/* ------------------------------------------------------------------
   english.webbetas.com
   Cool paper, ink, and a chalkboard green. The level scale is the one
   place colour carries meaning: A1 pale through C2 deep, so a row's
   level reads before you get to the words.
------------------------------------------------------------------- */

:root {
  --page:    #EDF0EE;
  --surface: #FFFFFF;
  --ink:     #16241F;
  --muted:   #61726B;
  --line:    #D3DCD7;
  --accent:  #146B54;
  --accent-dim: #DCEAE4;
  --alert:   #8F4318;
  --alert-dim: #F6E7DC;

  --l1: #C3DCCE; --l2: #97C9B0; --l3: #63B08F;
  --l4: #349475; --l5: #1B775C; --l6: #0E5644;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

  --r: 4px;
  --shadow: 0 1px 2px rgba(22, 36, 31, .06);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 15px/1.55 var(--sans);
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Shell -------------------------------------------------------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 216px;
  flex: 0 0 216px;
  background: var(--ink);
  color: #C9D6D0;
  padding: 20px 0 24px;
  display: flex;
  flex-direction: column;
}

.brand {
  font: 600 19px/1.2 var(--serif);
  color: #FFF;
  padding: 0 20px 20px;
  letter-spacing: .01em;
}
.brand span { display: block; font: 400 12px/1.4 var(--sans); color: #7E958C; margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a {
  color: #C9D6D0;
  text-decoration: none;
  padding: 8px 20px;
  font-size: 14.5px;
  border-left: 3px solid transparent;
}
.nav a:hover { background: rgba(255,255,255,.05); color: #FFF; }
.nav a.on { background: rgba(255,255,255,.08); color: #FFF; border-left-color: #6FC3A2; }

.sidebar footer { margin-top: auto; padding: 16px 20px 0; font-size: 12.5px; color: #7E958C; }
.sidebar footer button {
  background: none; border: 0; color: #7E958C; padding: 0; margin-top: 6px;
  font: inherit; cursor: pointer; text-decoration: underline;
}
.sidebar footer button:hover { color: #FFF; }
.sidebar footer a.who {
  display: block; color: #C9D6D0; text-decoration: none;
  font-size: 13.5px; font-weight: 500;
}
.sidebar footer a.who:hover { color: #FFF; text-decoration: underline; }
.sidebar footer a.who.on { color: #6FC3A2; }

.main { flex: 1 1 auto; min-width: 0; padding: 26px 30px 60px; }

.page-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.page-head h1 { font: 400 26px/1.2 var(--serif); margin: 0; }
.page-head .sub { color: var(--muted); font-size: 13.5px; }

/* --- Flash -------------------------------------------------------- */

.flash {
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  background: var(--surface); padding: 10px 14px; margin-bottom: 16px;
  border-radius: var(--r); font-size: 14px;
}
.flash.error { border-left-color: var(--alert); background: var(--alert-dim); }

/* --- Panels ------------------------------------------------------- */

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 20px;
}
.panel > h2 {
  font: 500 14px/1.3 var(--sans); margin: 0;
  padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted);
}
.panel-body { padding: 16px; }
.panel-body > :first-child { margin-top: 0; }
.panel-body > :last-child { margin-bottom: 0; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid-main { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: 20px; align-items: start; }

/* --- Search ------------------------------------------------------- */

.searchbar { margin-bottom: 16px; }
.searchbar input[type=search] {
  width: 100%; font: 400 19px/1.3 var(--sans);
  padding: 13px 16px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--surface); color: var(--ink);
}
.searchbar input[type=search]:focus { border-color: var(--accent); }

.filters {
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 12px 14px; margin-bottom: 18px;
}
.filters .f { display: flex; flex-direction: column; gap: 3px; }
.filters label { font-size: 11.5px; color: var(--muted); }
.filters select, .filters input {
  font: 400 14px var(--sans); padding: 6px 8px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink); min-width: 96px;
}
.filters .skills { display: flex; flex-wrap: wrap; gap: 4px; max-width: 380px; }

.chip {
  display: inline-block; font-size: 12.5px; padding: 3px 9px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--muted); cursor: pointer;
  user-select: none;
}
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip:has(input:checked) { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }

/* --- Result rows -------------------------------------------------- */

.rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.row {
  display: grid; grid-template-columns: 58px minmax(0,1fr) auto;
  gap: 14px; align-items: center;
  padding: 11px 16px; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row:hover { background: #F7F9F8; }
.row h3 { margin: 0; font: 500 15.5px/1.35 var(--sans); }
.row h3 a { text-decoration: none; color: var(--ink); }
.row h3 a:hover { color: var(--accent); text-decoration: underline; }
.row .meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.row .right { text-align: right; color: var(--muted); font-size: 12.5px; white-space: nowrap; }

.lvl {
  display: inline-block; min-width: 34px; text-align: center;
  font: 600 11.5px/1 var(--sans); padding: 5px 6px; border-radius: 3px;
  color: #05271D;
}
.lvl-1 { background: var(--l1); } .lvl-2 { background: var(--l2); }
.lvl-3 { background: var(--l3); } .lvl-4 { background: var(--l4); color: #EAF6F0; }
.lvl-5 { background: var(--l5); color: #EAF6F0; } .lvl-6 { background: var(--l6); color: #EAF6F0; }
.lvl-0 { background: #E4E9E6; color: var(--muted); }

.tag {
  display: inline-block; font-size: 12px; padding: 2px 8px; margin: 0 3px 3px 0;
  background: var(--accent-dim); color: #0E5644; border-radius: 3px; text-decoration: none;
}
a.tag:hover { background: var(--accent); color: #FFF; }

.stars { color: var(--accent); letter-spacing: 1px; }

/* --- Forms -------------------------------------------------------- */

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; font: 400 14.5px/1.5 var(--sans);
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink);
}
textarea { resize: vertical; min-height: 90px; }
textarea.tall { min-height: 300px; font-family: var(--serif); font-size: 15.5px; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px var(--accent-dim); }

.row-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 14px; }

.btn {
  display: inline-block; font: 500 14px/1 var(--sans);
  padding: 9px 15px; border-radius: var(--r); border: 1px solid var(--accent);
  background: var(--accent); color: #FFF; cursor: pointer; text-decoration: none;
}
.btn:hover { background: #0E5644; color: #FFF; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--surface); }
.btn.small { font-size: 13px; padding: 6px 11px; }
.btn.danger { background: var(--surface); color: var(--alert); border-color: #E0C4B0; }
.btn.danger:hover { background: var(--alert); color: #FFF; }

.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.inline-form { display: inline; }

/* --- Tables ------------------------------------------------------- */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font: 500 12.5px var(--sans); color: var(--muted);
  padding: 8px 10px; border-bottom: 1px solid var(--line);
}
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }

/* --- Detail ------------------------------------------------------- */

.plan-body {
  font: 400 16px/1.65 var(--serif);
  white-space: pre-wrap; max-width: 68ch;
}
.summary { font: 400 16.5px/1.5 var(--serif); color: var(--ink); max-width: 66ch; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin: 0; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; }

.stat-strip { display: flex; gap: 26px; flex-wrap: wrap; }
.stat b { display: block; font: 400 27px/1.1 var(--serif); }
.stat span { font-size: 12.5px; color: var(--muted); }

.status { font-size: 12px; padding: 2px 8px; border-radius: 3px; background: #E4E9E6; color: var(--muted); }
.status.done { background: var(--accent-dim); color: #0E5644; }
.status.planned { background: #E3ECF5; color: #2A4E77; }
.status.cancelled, .status.no_show { background: var(--alert-dim); color: var(--alert); }

.empty { color: var(--muted); font-size: 14px; padding: 18px 0; }
.empty b { display: block; color: var(--ink); font-weight: 500; margin-bottom: 3px; }

.pager { display: flex; gap: 8px; align-items: center; margin-top: 16px; font-size: 13.5px; color: var(--muted); }

/* --- Login -------------------------------------------------------- */

.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: var(--ink);
}
.login-card {
  background: var(--surface); border-radius: var(--r); padding: 30px;
  width: 100%; max-width: 360px; box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.login-card h1 { font: 400 24px/1.2 var(--serif); margin: 0 0 4px; }
.login-card p.lede { color: var(--muted); font-size: 13.5px; margin: 0 0 20px; }
.login-card .btn { width: 100%; text-align: center; padding: 11px; }

/* --- Responsive --------------------------------------------------- */

@media (max-width: 900px) {
  .grid2, .grid-main { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex: none; padding: 12px 0; }
  .brand { padding: 0 16px 10px; }
  .brand span { display: none; }
  .nav { flex-direction: row; overflow-x: auto; gap: 0; }
  .nav a { border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; padding: 8px 14px; }
  .nav a.on { border-left: 0; border-bottom-color: #6FC3A2; }
  .sidebar footer { margin-top: 10px; padding: 10px 16px 0; }
  .main { padding: 18px 16px 50px; }
  .row { grid-template-columns: 46px minmax(0,1fr); }
  .row .right { grid-column: 2; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  .sidebar, .filters, .actions, .searchbar { display: none; }
  .main { padding: 0; }
  body { background: #FFF; }
}
