/* ============================================================
   Spotfit Finder — spotfit-lime theme
   All colors live in :root so re-theming is a one-stop edit.
   ============================================================ */

:root {
  /* Brand */
  --accent:        #c6f24e;   /* spotfit lime */
  --accent-strong: #b4e636;   /* hover / pressed */
  --accent-ink:    #5e7c14;   /* text accent: links, labels */
  --accent-soft:   #eef9ca;   /* lime tint: pills, fills */
  --accent-haze:   #f4fbe2;   /* faintest lime wash */

  /* Ink */
  --ink:   #1a1e12;
  --ink-2: #555c47;
  --ink-3: #8b917c;

  /* Surfaces */
  --bg:        #f7f8f2;
  --surface:   #ffffff;
  --surface-2: #fbfcf5;
  --line:      #e6e9d8;
  --line-2:    #f0f2e6;

  /* Status */
  --danger:      #e0474c;
  --danger-soft: #fcebec;
  --warn-bg:     #fbf2cf;
  --warn-ink:    #806713;
  --ok-bg:       #eef9ca;
  --ok-ink:      #4f6a10;

  /* Shape */
  --radius:    18px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  --pill:      999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(26, 30, 18, .05), 0 1px 3px rgba(26, 30, 18, .04);
  --shadow-md: 0 6px 24px rgba(26, 30, 18, .08);
  --shadow-pop: 0 12px 40px rgba(26, 30, 18, .16);

  /* Type */
  --ff-display: "Bricolage Grotesque", system-ui, sans-serif;
  --ff-body:    "DM Sans", system-ui, sans-serif;
  --ff-schedule:"Poppins", system-ui, sans-serif;

  /* Layout */
  --maxw: 1080px;
  --gap:  16px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;   /* no iOS auto-inflation */
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;              /* no horizontal scroll */
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--ff-display); line-height: 1.12; margin: 0; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; display: block; }

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

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Header / footer ---------- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: rgba(247, 248, 242, .82);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.head-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent);
  box-shadow: inset 0 0 0 3px rgba(26,30,18,.9);
  transform: rotate(-8deg);
}
.brand-name { font-family: var(--ff-display); font-size: 1.18rem; letter-spacing: -.01em; }
.head-nav { display: flex; align-items: center; gap: 4px; }
.head-nav > a { padding: 8px 12px; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 500; font-size: .95rem; }
.head-nav > a:hover { color: var(--ink); background: var(--line-2); text-decoration: none; }

.head-right { display: flex; align-items: center; gap: 12px; }
.lang-switch { display: inline-flex; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--pill); padding: 3px; }
.lang-btn {
  min-width: 36px; height: 32px; padding: 0 9px; border: none; background: transparent;
  border-radius: var(--pill); cursor: pointer; font-family: var(--ff-body); font-weight: 700;
  font-size: .8rem; letter-spacing: .03em; color: var(--ink-3);
}
.lang-btn:hover { color: var(--ink); }
.lang-btn.is-active { background: var(--accent); color: #1a2106; }

.site-main { padding: 28px 0 64px; min-height: 60vh; }
.site-foot { border-top: 1px solid var(--line); padding: 22px 0; color: var(--ink-3); font-size: .9rem; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: var(--pill);
  background: var(--bg); color: var(--ink);
  font-family: var(--ff-body); font-size: .98rem; font-weight: 600;
  cursor: pointer; transition: transform .06s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  text-decoration: none; white-space: nowrap; user-select: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #1a2106; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

.btn-dark { background: var(--ink); border-color: var(--ink); color: #f3f6e6; }
.btn-dark:hover { background: #2a3020; }

.btn-ghost { background: var(--surface); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--ink-3); }

.btn-danger { background: var(--danger-soft); border-color: #f3c9cb; color: var(--danger); }
.btn-danger:hover { background: #f9dcdd; }

.btn-sm { min-height: 38px; padding: 0 14px; font-size: .9rem; }
.btn-xs { min-height: 32px; padding: 0 11px; font-size: .84rem; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 1.04rem; }
.btn-block { width: 100%; }

/* ---------- Forms / fields ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field-grow { flex: 1 1 auto; }
.field-label { font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.field-hint { font-size: .78rem; color: var(--ink-3); margin-top: 2px; }

.input, .textarea {
  width: 100%; min-height: 48px;
  padding: 12px 14px;
  font: inherit; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .textarea:focus {
  outline: none; border-color: var(--accent-ink);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
/* Any textarea using only .input (e.g. plan features) gets at least 90px too */
textarea.input:not(.textarea):not(.tr-input) { min-height: 90px; resize: vertical; }

/* Native <select class="input"> — match the brand (custom caret, app font, focus ring) */
select.input {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  font-family: var(--ff-body); font-weight: 600; color: var(--ink);
  cursor: pointer; padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' fill='none' stroke='%235e7c14' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
select.input:hover { border-color: var(--ink-3); }
select.input::-ms-expand { display: none; }

.input-wrap { position: relative; }
.input-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); font-size: 1.15rem; pointer-events: none;
}
.input-wrap .input { padding-left: 40px; }

.form { display: flex; flex-direction: column; gap: 18px; margin: 16px 6px; }
.form-card { padding: 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .95rem; font-weight: 500; }
.alert-ok    { background: var(--ok-bg); color: var(--ok-ink); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-warn  { background: var(--warn-bg); color: var(--warn-ink); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-h { font-family: var(--ff-display); font-size: 1.18rem; font-weight: 700; margin: 0 0 14px; }
.card-h-note { font-family: var(--ff-body); font-weight: 500; font-size: .78rem; color: var(--ink-3); margin-left: 6px; }

/* ---------- Hero (search page) ---------- */
.hero { text-align: center; padding: 26px 0 26px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .76rem; font-weight: 700; color: var(--accent-ink); }
.hero-title { font-size: clamp(2rem, 6vw, 3.3rem); letter-spacing: -.02em; margin: 12px 0 14px; font-weight: 800; }
.hero-title .hl { position: relative; white-space: nowrap; }
.hero-title .hl::after {
  content: ""; position: absolute; left: -2px; right: -2px; bottom: .07em; height: .34em;
  background: var(--accent); border-radius: 4px; z-index: -1; opacity: .85;
}
.hero-sub { max-width: 560px; margin: 0 auto; color: var(--ink-2); font-size: 1.05rem; }

/* ---------- Search panel ---------- */
.search-panel {
  display: flex; align-items: flex-end; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 18px; margin: 6px auto 26px; max-width: 880px;
}
.search-panel .field { gap: 6px; }
.search-go { flex: 0 0 auto; }

/* ---------- Combobox (select-or-type) ---------- */
.combo { position: relative; }
.combo .input-wrap { display: flex; align-items: stretch; }
.combo-input { padding-right: 42px; }
.combo-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: none; background-color: transparent;
  cursor: pointer; border-radius: 8px; font-size: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' fill='none' stroke='%235e7c14' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
}
.combo-toggle:hover { background-color: var(--line-2); }

/* Custom single-select dropdown (matches the combobox list styling) */
.combo-select-btn { text-align: left; cursor: pointer; display: flex; align-items: center; }
.combo-select-btn[aria-expanded="true"] { border-color: var(--accent-ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.combo-select .combo-toggle { pointer-events: none; }
.combo-option[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }

.combo-list, .picker-pop {
  position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-pop);
  padding: 6px; margin: 0; list-style: none;
  max-height: 264px; overflow-y: auto;
}
.combo-option {
  padding: 10px 12px; border-radius: var(--radius-xs); cursor: pointer; font-size: .96rem;
  margin-top: 6px; margin-bottom: 6px;
}
.combo-option:hover, .combo-option.is-active { background: var(--accent-soft); color: var(--accent-ink); }
.combo-empty { padding: 10px 12px; color: var(--ink-3); font-size: .9rem; }

/* ---------- Tag combobox (multi-value) ---------- */
.tagcombo { position: relative; }
.tag-field {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  min-height: 48px; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.tag-field:focus-within { border-color: var(--accent-ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.tags { display: contents; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 6px 5px 12px; border-radius: var(--pill);
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: .9rem; font-weight: 600;
}
.tag-x {
  width: 20px; height: 20px; border: none; border-radius: 50%;
  background: rgba(94,124,20,.16); color: var(--accent-ink);
  font-size: 1rem; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.tag-x:hover { background: rgba(94,124,20,.3); }
.tag-input {
  flex: 1 1 90px; min-width: 90px; border: none; outline: none;
  font: inherit; background: transparent; min-height: 30px; padding: 0 2px;
}

/* ---------- Pickers (date / time) ---------- */
.datepick, .timepick { position: relative; }
.picker-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 48px; padding: 12px 14px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; color: var(--ink); cursor: pointer;
}
.picker-btn:hover { border-color: var(--ink-3); }
.picker-icon { color: var(--accent-ink); font-size: 1.05rem; }
.picker-btn .is-empty { color: var(--ink-3); }

.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; }
.cal-title { font-family: var(--ff-display); font-weight: 700; font-size: 1rem; }
.cal-nav { width: 34px; height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; cursor: pointer; color: var(--ink); }
.cal-nav:hover { background: var(--line-2); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow { text-align: center; font-size: .72rem; font-weight: 700; color: var(--ink-3); padding: 4px 0; }
.cal-day {
  aspect-ratio: 1 / 1; min-height: 38px; border: none; background: transparent;
  border-radius: var(--radius-xs); cursor: pointer; font: inherit; font-size: .92rem; color: var(--ink);
}
.cal-day:hover { background: var(--accent-soft); }
.cal-day.is-empty { visibility: hidden; }
.cal-day.is-today { box-shadow: inset 0 0 0 1px var(--accent-ink); }
.cal-day.is-selected { background: var(--accent); color: #1a2106; font-weight: 700; }
.cal-foot { display: flex; justify-content: flex-end; padding-top: 8px; }

.time-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.time-col { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.time-col-label { font-size: .72rem; font-weight: 700; color: var(--ink-3); text-align: center; padding-bottom: 4px; }
.time-opt {
  padding: 9px 10px; border: none; background: transparent; border-radius: var(--radius-xs);
  cursor: pointer; font: inherit; text-align: center;
}
.time-opt:hover { background: var(--accent-soft); }
.time-opt.is-selected { background: var(--accent); color: #1a2106; font-weight: 700; }

/* ---------- Results bar + layout toggle ---------- */
.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; }
.results-count { color: var(--ink-2); font-weight: 600; font-size: .95rem; }
.view-toggle { display: inline-flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--pill); padding: 4px; }
.vt-btn {
  min-width: 40px; height: 36px; border: none; background: transparent; border-radius: var(--pill);
  cursor: pointer; color: var(--ink-3); font-size: 1.05rem;
}
.vt-btn:hover { color: var(--ink); }
.vt-btn.is-active { background: var(--accent); color: #1a2106; }

/* ---------- Results grid / list / single ---------- */
.results { display: grid; gap: 16px; }
.results.view-grid   { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.results.view-single { grid-template-columns: 1fr; max-width: 620px; }
.results.view-list   { grid-template-columns: 1fr; }

.results-empty {
  grid-column: 1 / -1; text-align: center; padding: 48px 20px; color: var(--ink-3);
  border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface-2);
}
.results-empty strong { display: block; color: var(--ink); font-family: var(--ff-display); font-size: 1.1rem; margin-bottom: 4px; }

/* ---------- Instructor card ---------- */
.instructor-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; transition: box-shadow .18s ease, transform .12s ease, border-color .18s ease; }
.instructor-card:hover { box-shadow: var(--shadow-md); border-color: var(--line); transform: translateY(-2px); }
.card-top { display: flex; align-items: center; gap: 13px; }
.avatar {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; font-family: var(--ff-display); font-weight: 700; font-size: 1.1rem;
  background: var(--accent-soft); color: var(--accent-ink);
}
.avatar-lg { width: 72px; height: 72px; border-radius: 20px; font-size: 1.7rem; }
.avatar-xl { width: 96px; height: 96px; border-radius: 24px; font-size: 2rem; flex: 0 0 auto; }
.avatar { overflow: hidden; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
/* When there is no photo the <img> is hidden; the display:block above would
   otherwise beat the UA [hidden] rule and show a broken-image icon.
   Hiding it leaves only the initials badge. */
.avatar-img[hidden] { display: none; }

/* Photo upload control */
.avatar-edit { display: flex; gap: 18px; align-items: flex-start; }
.avatar-edit-controls { display: flex; flex-direction: column; gap: 11px; flex: 1 1 auto; min-width: 0; }
.file-btn {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  min-height: 44px; padding: 0 18px; border: 1px solid var(--line);
  border-radius: var(--pill); background: var(--surface); font-weight: 600; cursor: pointer;
}
.file-btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.file-btn span::before { content: "↑"; margin-right: 6px; color: var(--accent-ink); font-weight: 800; }
.file-btn input[type="file"] { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: .92rem; color: var(--ink-2); cursor: pointer; }
.check input[type="checkbox"] { width: 20px; height: 20px; margin-top: 1px; flex: 0 0 auto; accent-color: var(--accent-ink); cursor: pointer; }
@media (max-width: 460px) { .avatar-edit { flex-direction: column; } }
.card-name { font-size: 1.16rem; letter-spacing: -.01em; }
.card-headline { color: var(--ink-2); font-size: .92rem; margin-top: 2px; }
.card-section { display: flex; flex-direction: column; gap: 7px; margin-bottom: 9px; }
.card-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--ink-3); margin-bottom: 6px; border-bottom: solid 1px #f2f2f2; padding-bottom: 6px; }
.card-about { color: var(--ink-2); font-size: .92rem; line-height: 1.55; padding: 16px; border-radius: 6px; background: #f2f2f2; }
.card-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; padding-top: 16px; border-top: solid 1px #f2f2f2; }

/* List layout: lay the card out horizontally on wide screens */
.results.view-list .instructor-card { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "top trainings foot"; align-items: center; gap: 18px; }
.results.view-list .card-top { grid-area: top; }
.results.view-list [data-trainings-wrap] { grid-area: trainings; }
.results.view-list [data-cities-wrap],
.results.view-list [data-avail-wrap],
.results.view-list .card-about { display: none; }
.results.view-list .card-foot { grid-area: foot; margin: 0; }
/* List view: no separator borders on the label or foot (grid + single keep them) */
.results.view-list .card-label { border-bottom: none; }
.results.view-list .card-foot { border-top: none; }
@media (max-width: 640px) {
  .results.view-list .instructor-card { grid-template-columns: 1fr; grid-template-areas: "top" "trainings" "foot"; }
  .results.view-list [data-cities-wrap] { display: flex; }
}

/* ---------- Pills ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 7px; }
.pill {
  display: inline-flex; align-items: center; padding: 5px 12px; border-radius: var(--pill);
  background: var(--accent-haze); color: var(--accent-ink); border: 1px solid var(--accent-soft);
  font-size: .85rem; font-weight: 600;
}
.pill-avail { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); }
.pill-avail::before { content: "●"; color: #57b14a; font-size: .6rem; margin-right: 6px; }
.pill-warn { background: var(--warn-bg); color: var(--warn-ink); border-color: #f0e2b0; }
.pill-lang { background: var(--surface-2); color: var(--ink-1); border-color: var(--line); }
.pill-lang::before { content: "🌐"; font-size: .72rem; margin-right: 6px; }
.pill-billing { background: #eef4ff; color: #2f4a7a; border-color: #d4e1f7; }
.pill-billing::before { content: "▤"; font-size: .72rem; margin-right: 6px; opacity: .8; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 20px; padding-top: 4px; }
.check-row .check { font-size: .9rem; }

/* ---------- Auth ---------- */
.auth-card { max-width: 440px; margin: 24px auto; padding: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.auth-title { font-size: 1.7rem; letter-spacing: -.02em; }
.auth-sub { color: var(--ink-2); margin: 8px 0 22px; }
.auth-card .form { margin-top: 4px; }
.auth-foot { margin-top: 20px; text-align: center; color: var(--ink-2); font-size: .95rem; }

/* ---------- Page heads ---------- */
.page-head { margin-bottom: 22px; margin-left: 6px; }
.page-title { font-size: clamp(1.7rem, 4vw, 2.3rem); letter-spacing: -.02em; }
.page-sub { color: var(--ink-2); margin-top: 8px; font-size: 1.02rem; }

/* ---------- Public profile (Poppins schedule) ---------- */
.profile-hero { display: flex; align-items: center; gap: 20px; padding: 24px; margin-bottom: 18px; }
.profile-name { font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: -.02em; }
.profile-headline { color: var(--ink-2); margin-top: 6px; font-size: 1.05rem; }
.profile-contact { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.schedule-strip {
  font-family: var(--ff-schedule);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 22px; margin-bottom: 18px;
  background: var(--ink); color: #f3f6e6; border-radius: var(--radius);
}
.schedule-label { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 600; color: var(--accent); }
.schedule-slot { font-size: 1.15rem; font-weight: 600; }

.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 18px; }
.profile-block { padding: 20px; }
.profile-about { color: var(--ink-2); line-height: 1.65; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.empty { text-align: center; padding: 60px 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* ---------- Modals / overlays ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 24, 12, .45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; animation: overlay-in .16s ease forwards;
}
/* The author display:flex above beats the UA [hidden] rule, so spell it out:
   without this, modals stay visible on load and can't be dismissed. */
.modal-overlay[hidden] { display: none; }
/* The QR "Save contact" dialog is opened from the "Save card" button, which
   also lives inside the instructor detail modal. Both are .modal-overlay at the
   same z-index, so by DOM order the (later) instructor modal would paint on top
   and hide the QR dialog. Lift the QR modal above it (still below toasts:200). */
#qr-modal { z-index: 120; }
@keyframes overlay-in { to { opacity: 1; } }
.modal {
  position: relative; width: 100%; max-width: 420px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-pop); padding: 26px;
  transform: translateY(8px) scale(.98); animation: modal-in .18s ease forwards;
}
@keyframes modal-in { to { transform: translateY(0) scale(1); } }
.modal-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: none; background: var(--line-2); color: var(--ink-2); border-radius: 50%; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.modal-x:hover { background: var(--line); color: var(--ink); }
.modal-title { font-size: 1.3rem; letter-spacing: -.01em; }
.modal-sub { color: var(--ink-2); margin: 8px 0 16px; font-size: .96rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.qr-box { display: grid; place-items: center; padding: 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.qr-box svg, .qr-box img { width: 220px; height: 220px; }
.qr-name { text-align: center; font-weight: 600; margin-top: 12px; }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px;
  background: var(--ink); color: #f3f6e6; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop); font-size: .94rem; font-weight: 500;
  opacity: 0; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease;
}
.toast.is-in { opacity: 1; transform: translateY(0); }
.toast::before { content: "✓"; color: var(--accent); font-weight: 700; }
.toast.toast-error::before { content: "!"; color: #ff8a8a; }

/* ---------- Admin: stats ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); margin: 16px 0; }
.stat-num { display: block; font-family: var(--ff-display); font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.stat-of { font-size: 1.1rem; color: var(--ink-3); font-weight: 600; }
.stat-label { color: var(--ink-2); font-size: .9rem; }

.panel { padding: 22px; margin-bottom: 20px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.muted-note { color: var(--ink-3); font-size: .78rem; }
.muted { color: var(--ink-3); font-size: .78rem; }

/* Reset-password result */
.reset-result { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.reset-pass { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.reset-pass code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 1.25rem; font-weight: 700; letter-spacing: .06em;
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--accent-haze); color: var(--ink); border: 1px solid var(--accent-soft);
  user-select: all;
}

/* Day bars */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 6px; }
.bar-col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-fill { width: 100%; max-width: 34px; background: var(--accent); border-radius: 7px 7px 3px 3px; min-height: 4px; transition: height .3s ease; }
.bar-col:hover .bar-fill { background: var(--accent-strong); }
.bar-x { font-size: .68rem; color: var(--ink-3); }

/* Rank lists */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.rank-row { display: grid; grid-template-columns: 110px 1fr 32px; align-items: center; gap: 10px; }
.rank-label { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-track { height: 9px; background: var(--line-2); border-radius: var(--pill); overflow: hidden; }
.rank-bar { display: block; height: 100%; background: var(--accent); border-radius: var(--pill); }
.rank-n { text-align: right; font-weight: 700; font-size: .9rem; color: var(--ink-2); }

/* Tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; min-width: 540px; }
.data-table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; padding: 0 12px 10px; }
.data-table td { padding: 12px; border-top: 1px solid var(--line-2); vertical-align: middle; }
.data-table .ta-r { text-align: right; }
.tcell-link { font-weight: 600; }
.muted-cell { color: var(--ink-2); font-size: .9rem; }
.inline-form { display: inline; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-dot.on { background: #57b14a; }
.status-dot.off { background: var(--ink-3); }
.data-table td.ta-r .btn { margin: 6px 0 6px 6px; }

.evt { font-size: .82rem; font-weight: 600; padding: 3px 9px; border-radius: var(--pill); background: var(--line-2); color: var(--ink-2); }
.evt-login_success { background: var(--ok-bg); color: var(--ok-ink); }
.evt-login_fail, .evt-login_blocked { background: var(--danger-soft); color: var(--danger); }
.evt-register { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .search-panel { flex-direction: column; align-items: stretch; }
  .search-go { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .profile-hero { flex-direction: column; text-align: center; }
  .profile-contact { justify-content: center; }
  .rank-row { grid-template-columns: 92px 1fr 28px; }
}
@media (max-width: 460px) {
  .wrap { padding: 0 16px; }
  .head-nav > a:not(.btn) { display: none; }   /* keep header tidy on small phones */
  .stat-row { grid-template-columns: 1fr 1fr; }
  .modal { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- Translations editor ---------- */
.lang-form { display: block; }
.lang-toolbar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  position: sticky; top: 64px; z-index: 5; background: var(--bg);
  padding: 10px 0; margin-bottom: 14px;
}
.lang-toolbar .input { max-width: 280px; }
.tr-head { display: grid; grid-template-columns: 160px repeat(3, 1fr); gap: 10px; padding-bottom: 8px; }
.tr-key-h, .tr-lang-h { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; }
.tr-row { display: grid; grid-template-columns: 160px repeat(3, 1fr); gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line-2); }
.tr-key { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .8rem; color: var(--accent-ink); word-break: break-all; padding-top: 9px; }
.tr-cell { display: block; }
.tr-lang-m { display: none; }
.tr-input { min-height: 90px; resize: vertical; line-height: 1.4; font-size: .92rem; padding: 9px 11px; }
@media (max-width: 720px) {
  .tr-head { display: none; }
  .tr-row { grid-template-columns: 1fr; gap: 8px; padding: 14px 0; }
  .tr-key { padding-top: 0; }
  .tr-lang-m { display: inline-block; font-size: .7rem; font-weight: 700; color: var(--ink-3); margin-bottom: 3px; letter-spacing: .06em; }
}

/* "Next class" strip on instructor cards */
.card-next {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 2px 0 4px; padding: 8px 12px;
  background: var(--accent); color: var(--text-accent, #5e7c14);
  border-radius: 12px; font-family: "Poppins", system-ui, sans-serif;
}
.card-next-label {
  font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  opacity: .8;
}
.card-next-slot { font-size: .95rem; font-weight: 600; }

/* Tag-combo caret (browse admin-managed options) */
.tagcombo .tag-field { padding-right: 40px; }
.tagcombo > .combo-toggle { position: absolute; right: 8px; top: 18px; transform: none; }

/* Admin lists editor */
.page-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-left: 6px; }
.lists-form .panel { margin-bottom: 18px; }
.list-row { display: grid; grid-template-columns: 1fr 1fr 1fr 40px; gap: 8px; align-items: center; margin-bottom: 8px; }
.list-head { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin-bottom: 6px; }
.list-head span { padding: 0 2px; }
.row-x { width: 40px; min-width: 40px; padding: 0; line-height: 1; font-size: 1.1rem; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 560px) {
  .list-row { grid-template-columns: 1fr 1fr; }
  .list-head { display: none; }
  .row-x { grid-column: 2; justify-self: end; }
}

/* ===== Flash messages (shared) ===== */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .95rem; font-weight: 500; margin-bottom: 16px; }
.flash-ok { background: var(--ok-bg); color: var(--ok-ink); }
.flash-error { background: var(--danger-soft); color: var(--danger); }

/* ===== Stat grid (billing admin) ===== */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-num { display: block; font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: 1.7rem; font-weight: 700; color: var(--ink); }
.stat-grid .stat-label { color: var(--ink-3); font-size: .85rem; }
@media (max-width: 720px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
.row-actions { white-space: nowrap; }

/* ===== Badges ===== */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; text-transform: capitalize; }
.badge-active, .badge-inv-paid { background: var(--ok-bg); color: var(--ok-ink); }
.badge-canceled, .badge-inv-void { background: var(--line-2); color: var(--ink-3); }
.badge-past_due, .badge-inv-open { background: var(--accent-soft); color: var(--accent-ink); }
.badge-overdue { background: var(--warn-bg); color: var(--warn-ink); /* margin-left: 6px; */ }

/* ===== Pricing page ===== */
.pricing-hero { text-align: center; max-width: 640px; margin: 0 auto 28px; }
.cycle-switch { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--pill); margin-top: 18px; box-shadow: var(--shadow-sm); }
.cycle-btn { border: none; background: transparent; padding: 9px 20px; border-radius: var(--pill); font-family: var(--ff-body); font-size: .95rem; font-weight: 600; cursor: pointer; color: var(--ink-2); transition: background .15s ease, color .15s ease; }
.cycle-btn:hover { color: var(--ink); }
.cycle-btn.is-active { background: var(--accent); color: #1a2106; box-shadow: var(--shadow-sm); }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .pricing-grid { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; } }
.plan-card { position: relative; background: var(--surface); border: 1px solid #f2f2f2; border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow-sm); }
.plan-card.is-popular { border-color: var(--accent-ink); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-pop); }
.plan-badge { position: absolute; top: -12px; left: 24px; background: var(--accent); color: var(--accent-ink); font-size: .74rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.plan-name { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: 1.4rem; margin: 0 0 2px; }
.plan-tagline { color: var(--ink-3); margin: 0 0 16px; font-size: .92rem; }
.plan-price { display: flex; align-items: baseline; gap: 6px; margin-bottom: 18px; min-height: 44px; }
.plan-amount { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: 2.2rem; font-weight: 700; color: var(--ink); }
.plan-per { color: var(--ink-3); font-size: .9rem; }
.plan-cta { margin-bottom: 18px; }
.plan-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.plan-features li { display: flex; gap: 10px; align-items: flex-start; font-size: .94rem; color: var(--ink-2, var(--ink)); list-style: none; }
.plan-features li::marker { content: ""; }
.plan-features .tick { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--accent-ink); }

/* ===== Plan summary on register ===== */
.plan-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--accent-soft); border-radius: var(--radius-sm); margin-bottom: 6px; flex-wrap: wrap; }
.plan-summary-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--accent-ink); }
.plan-summary-name { font-size: 1.05rem; }
.plan-summary-price { display: flex; align-items: center; gap: 12px; }
.plan-change { font-size: .85rem; color: var(--accent-ink); text-decoration: underline; }

/* ===== Subscription summary (billing) ===== */
.sub-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sub-plan { display: flex; align-items: center; gap: 10px; }
.sub-plan-name { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: 1.25rem; font-weight: 700; }
.sub-meta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.switch-box { margin: 8px 0; }
.switch-box > summary { display: inline-flex; list-style: none; cursor: pointer; }
.switch-box > summary::-webkit-details-marker { display: none; }
.switch-form { margin-top: 12px; padding: 14px; background: var(--bg-soft, var(--line-2)); border-radius: var(--radius-sm); }
.cancel-form { margin-top: 10px; }

/* ===== Admin plan editor ===== */
.lang-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 10px; }
.lang-cols .input { margin: 16px 0; }
.plan-edit .form-row .input { margin: 16px 0; }
.switch-form .input { margin: 16px 0; }
.field-check { display: flex; align-items: flex-end; }
@media (max-width: 720px) { .lang-cols { grid-template-columns: 1fr; } }

/* ===== Number inputs: replace native spinners with SVG chevron steppers ===== */
input[type="number"].input::-webkit-outer-spin-button,
input[type="number"].input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"].input { -moz-appearance: textfield; appearance: textfield; }
.num-wrap { position: relative; display: block; }
.num-wrap .input { padding-right: 40px; }
.num-steppers { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 2px; }
.num-step {
  width: 26px; height: 18px; border: none; background-color: transparent; cursor: pointer;
  border-radius: 5px; padding: 0; font-size: 0; background-repeat: no-repeat; background-position: center;
}
.num-step:hover { background-color: var(--line-2); }
.num-up   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 6.5L6 1.5L11 6.5' fill='none' stroke='%235e7c14' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.num-down { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' fill='none' stroke='%235e7c14' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }


/* ===== Invoice table: reference, method, PDF buttons ===== */
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ref-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.method-line { font-size: .78rem; margin-top: 3px; }

/* ===== Admin: payment method per user ===== */
.pm-admin-list { display: flex; flex-direction: column; }
.pm-admin-row {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 240px) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.pm-admin-row:last-child { border-bottom: none; }
.pm-admin-user { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-admin-row .combo-select { width: 100%; min-width: 0; max-width: none; }
.pm-admin-row .btn { justify-self: start; }
@media (max-width: 560px) {
  .pm-admin-row { grid-template-columns: 1fr auto; }
  .pm-admin-user { grid-column: 1 / -1; }
}

/* ===== 6px horizontal breathing room on every section ===== */
.site-main section { margin-left: 6px; margin-right: 6px; }

/* ===== 6px margin on generic content divs (styled components keep their own) ===== */
.site-main div:not([class]) { margin: 6px; }

/* ===== 6px inset on page-level classed blocks (toolbars, messages) ===== */
.lang-toolbar, .flash, .alert { margin-left: 6px; margin-right: 6px; }

/* ===== Notes: uniform .78rem; vat-note gets 25px vertical breathing room ===== */
.vat-note { font-size: .78rem; margin-top: 25px; margin-bottom: 25px; }

/* ===== Admin "assign a plan" rows ===== */
.assign-row {
  display: grid;
  grid-template-columns: minmax(0,180px) minmax(0,1fr) minmax(0,150px) auto;
  gap: 10px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.assign-row:last-child { border-bottom: none; }
.assign-row .combo-select { width: 100%; min-width: 0; max-width: none; }
.assign-row .btn { justify-self: start; }
@media (max-width: 640px) {
  .assign-row { grid-template-columns: 1fr; }
  .assign-row .pm-admin-user { grid-column: 1 / -1; }
}

/* ===== Sortable table headers (admin invoices) ===== */
.th-sort a { color: inherit; text-decoration: none; cursor: pointer; }
.th-sort a:hover { color: var(--accent-ink); text-decoration: underline; }
.th-sort-active a { color: var(--ink); }
.th-arrow { display: inline-flex; align-items: center; margin-left: 5px; color: var(--accent-ink); vertical-align: middle; }
.th-chevron { display: block; }

/* ===== Payment-method "hide" toggle in the translation editor (pm section) ===== */
.tr-pm-hide { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 8px; margin-top: 2px; font-size: .82rem; color: var(--ink-2); cursor: pointer; }
.tr-pm-hide input { width: 16px; height: 16px; accent-color: var(--accent-ink); }

/* ===== Login extras: remember-me + forgot link ===== */
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 2px 0 6px; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-2); cursor: pointer; }
.check-inline input { width: 16px; height: 16px; accent-color: var(--accent-ink); }
.auth-link { font-size: .9rem; color: var(--accent-ink); }
.auth-link:hover { text-decoration: underline; }

/* ---------- Password policy (admin settings) ---------- */
.card-subh { font-family: var(--ff-display); font-size: 1.02rem; font-weight: 600; color: var(--ink); margin: 18px 0 4px; }
.pw-policy { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 4px; }
.pw-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 10px 0 4px; }
.pw-grid .field { margin: 0; }
@media (max-width: 720px) { .pw-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .pw-grid { grid-template-columns: 1fr; } }

/* ---------- Invoice open / overdue counters ---------- */
.inv-counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; }
.inv-pill {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 4px 12px; border-radius: 999px;
  font-size: .82rem; font-weight: 500;
  border: 1px solid var(--line);
}
.inv-pill strong { font-family: var(--ff-display); font-size: 1rem; font-weight: 700; }
.inv-pill-open { background: var(--accent-haze); color: var(--accent-ink); border-color: var(--accent-soft); }
.inv-pill-overdue { background: var(--warn-bg); color: var(--warn-ink); border-color: #f0e2a8; }
.pw-age-note { margin-bottom: 14px; }

/* ---------- Billing nav count badges ---------- */
.nav-billing { position: relative; }
.nav-inv-badges {
  position: absolute; top: -9px; right: -8px;
  display: flex; gap: 3px; pointer-events: none;
}
.nav-badge {
  min-width: 17px; height: 17px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  font-family: var(--ff-body);
  font-size: .66rem; font-weight: 700; line-height: 1;
  box-shadow: 0 0 0 2px #f7f8f2;   /* ring matches the sticky header tint */
}
.nav-badge-open    { background: var(--ok-bg);     color: var(--ok-ink); }
.nav-badge-overdue { background: var(--danger-soft); color: var(--danger); }

/* ---------- Footer legal links ---------- */
.site-foot-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 16px; }
.foot-links a { color: var(--ink-3); text-decoration: none; }
.foot-links a:hover { color: var(--accent-ink); }

/* ---------- Legal pages ---------- */
.legal-page { max-width: 760px; }
.legal-body { color: var(--ink-2); }
.legal-h { font-family: var(--ff-display); font-size: 1.12rem; font-weight: 600; color: var(--ink); margin: 26px 0 8px; }
.legal-p { font-size: .95rem; line-height: 1.65; margin: 0 0 10px; }
.legal-list { margin: 0 0 12px; padding-left: 20px; }
.legal-list li { font-size: .95rem; line-height: 1.6; margin: 0 0 6px; }
.legal-link { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Registration consent ---------- */
.consent-check { margin: 4px 0 16px; align-items: flex-start; font-size: .9rem; line-height: 1.5; }

/* ---------- Account: your data ---------- */
.data-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

/* ---------- Cookie notice ---------- */
.cookie-notice {
  position: sticky; bottom: 0; z-index: 60;
  background: #f7f8f2; border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(20, 24, 12, .06);
}
.cookie-notice-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.cookie-notice-text { margin: 0; font-size: .85rem; color: var(--ink-2); flex: 1 1 280px; }
.cookie-notice-actions { display: flex; align-items: center; gap: 14px; }
.cookie-notice-link { color: var(--accent-ink); font-size: .85rem; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }

/* ---------- Legal: download button spacing ---------- */
.legal-download { margin: 2px 0 18px; }

/* ---------- Staff & permissions ---------- */
.badge-owner { background: var(--accent); color: var(--accent-ink); }

.perm-block { margin: 6px 0 4px; }
.perm-legend { display: block; font-weight: 600; color: var(--ink); margin-bottom: 8px; font-size: .92rem; }

.preset-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.preset-label { font-size: .82rem; color: var(--ink-3); margin-right: 2px; }

.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.perm-item {
  display: flex; align-items: baseline; gap: 8px;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); cursor: pointer; font-size: .9rem;
}
.perm-item:hover { border-color: var(--accent-strong); }
.perm-item input { margin: 0; flex: 0 0 auto; position: relative; top: 1px; }
.perm-name { font-weight: 600; color: var(--ink); }
.perm-desc { color: var(--ink-3); font-size: .8rem; }
.perm-item.is-disabled { opacity: .5; cursor: not-allowed; }
.perm-item.is-disabled:hover { border-color: var(--line); }

.staff-row { padding: 16px 0; border-top: 1px solid var(--line); }
.staff-row:first-of-type { border-top: 0; }
.staff-row.is-inactive { opacity: .65; }
.staff-row-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.staff-id { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.staff-name { font-family: var(--ff-display); font-weight: 600; color: var(--ink); }
.staff-user { color: var(--ink-3); font-size: .88rem; }
.staff-actions { display: flex; align-items: center; gap: 8px; }
.staff-perm-form { margin-top: 4px; }
.staff-perm-form .form-actions { margin-top: 12px; }
.staff-owner-note { color: var(--ink-2); font-size: .9rem; margin: 2px 0 0; }

@media (max-width: 640px) {
  .perm-grid { grid-template-columns: 1fr; }
}

/* ---------- Members page ---------- */
.plan-pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: .78rem; font-weight: 600; line-height: 1.5;
}
.tcell-sub { color: var(--ink-3); font-size: .8rem; }
.cp-invoice-row { align-items: flex-start; margin: 4px 0 2px; }
.cp-invoice-row .field-hint { display: block; margin-top: 2px; }

/* ---------- Change-plan dialog (members) ---------- */
.alert-info { background: var(--accent-haze); color: var(--accent-ink); border: 1px solid var(--line); }
.cp-current { color: var(--ink-3); font-weight: 400; }
.cp-state { margin-top: 14px; }
.cp-legend { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }

.seg { display: flex; gap: 8px; }
.seg-opt {
  flex: 1 1 0; display: flex; flex-direction: column; gap: 2px;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); cursor: pointer; font-size: .86rem; color: var(--ink);
}
.seg-opt input { margin: 0 0 2px; }
.seg-opt b { color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.seg-opt:has(input:checked) { border-color: var(--accent-strong); background: var(--accent-haze); box-shadow: 0 0 0 2px var(--accent-soft); }

.cp-ledger {
  margin-top: 14px; padding: 12px 14px;
  background: var(--accent-haze); border-left: 3px solid var(--accent); border-radius: 0;
}
.cp-line { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; font-size: .9rem; padding: 4px 0; color: var(--ink-2); }
.cp-num { font-variant-numeric: tabular-nums; color: var(--ink); }
.cp-credit { color: var(--accent-ink); font-weight: 600; }
.cp-total { border-top: 1px solid var(--line-2); margin-top: 4px; padding-top: 8px; }
.cp-total span:first-child { font-family: var(--ff-display); font-weight: 600; color: var(--ink); }
.cp-total .cp-num { font-family: var(--ff-display); font-weight: 700; font-size: 1.05rem; }
.cp-vat { margin: 2px 0 0; font-size: .72rem; color: var(--ink-3); }

.cp-radio-col { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.cp-radio {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); cursor: pointer;
}
.cp-radio input { margin-top: 2px; flex: 0 0 auto; }
.cp-radio b { display: block; font-size: .9rem; color: var(--ink); }
.cp-radio .field-hint { margin-top: 1px; }
.cp-radio:has(input:checked) { border-color: var(--accent-strong); background: var(--accent-haze); }
.cp-scheduled { display: block; color: var(--accent-ink); margin-top: 2px; }
.cp-scheduled i { font-style: normal; }

/* ---------- Admin table tools: search + client sort ---------- */
.table-search { position: relative; max-width: 320px; margin-bottom: 14px; }
.table-search-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.table-search-input { padding-left: 34px; }
.table-empty { margin: 14px 2px 2px; color: var(--ink-3); }

.th-csort button.th-csort-btn {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  background: none; border: none; padding: 0; margin: 0; font-family: inherit;
  color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; font-size: .76rem; font-weight: 700; line-height: 1;
}
.th-csort button.th-csort-btn:hover { color: var(--accent-ink); }
.th-chev { opacity: .3; transition: transform .15s ease, opacity .15s ease; }
.th-csort.sort-asc .th-csort-btn, .th-csort.sort-desc .th-csort-btn { color: var(--ink); }
.th-csort.sort-asc .th-chev { opacity: 1; transform: rotate(180deg); }
.th-csort.sort-desc .th-chev { opacity: 1; transform: rotate(0deg); }

/* ---------- Invoice due-date inline edit ---------- */
.due-cell { white-space: nowrap; }
.due-val { margin-right: 6px; }
.due-edit {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; vertical-align: middle; padding: 0;
  background: none; border: 1px solid var(--line); border-radius: var(--radius-xs);
  color: var(--ink-3); cursor: pointer; transition: color .14s, border-color .14s, background .14s;
}
.due-edit:hover { color: var(--accent-ink); border-color: var(--accent-strong); background: var(--accent-haze); }

/* ---------- Plan product numbers ---------- */
.plan-edit-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.plan-edit-head .card-h { margin: 0; }
.prodno-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prodno-label { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.prodno-chip { font-size: 12px; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); border: 1px solid var(--accent-strong); border-radius: 999px; padding: 3px 10px; font-variant-numeric: tabular-nums; }

/* ---------- User (customer) number ---------- */
.user-no { font-size: 12px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.user-no-chip { display: inline-block; font-size: 12px; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); border: 1px solid var(--accent-strong); border-radius: 999px; padding: 2px 9px; font-variant-numeric: tabular-nums; }
.account-userno { margin-top: 9px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }

/* Mobile: give billing invoice-status badges vertical breathing room when they wrap */
@media (max-width: 971px) {
  .badge-inv-open, .badge-inv-paid, .badge-inv-void, .badge-overdue { margin-top: 6px; margin-bottom: 6px; }
}

/* ---------- Textarea character counter ---------- */
.char-counter { margin-top: 5px; text-align: right; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.field.char-full .char-counter { color: var(--danger); font-weight: 600; }

/* ---------- Activity log category chips ---------- */
.actcat { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.actcat-admin   { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-strong); }
.actcat-billing { background: #fdf3df; color: #8a5a12; border-color: #f0d9a8; }
.actcat-auth    { background: #eef0fb; color: #4a4f86; border-color: #d6daf3; }
.actcat-config  { background: #e6f7f2; color: #1f7a64; border-color: #bfe9dd; }
.actcat-user    { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); }

/* ---------- Invoice cancellation-requested badge ---------- */
.badge-cancel-req { background: #fdf3df; color: #8a5a12; border: 1px solid #f0d9a8; margin-left: 6px; margin-top: 6px; }
@media (max-width: 971px) { .badge-cancel-req { margin-top: 6px; margin-bottom: 6px; } }

/* ---------- Lists CSV/TXT importer ---------- */
.import-grid { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.import-grid .field { flex: 1 1 200px; margin: 0; }
.import-grid .import-submit { flex: 0 0 auto; }
.import-grid input[type="file"] { padding: 8px 10px; cursor: pointer; }
.import-grid input[type="file"]::file-selector-button { font-family: var(--ff-body); font-weight: 600; font-size: .85rem; color: var(--accent-ink); background: var(--accent-soft); border: 1px solid var(--accent-strong); border-radius: var(--radius-xs); padding: 6px 12px; margin-right: 12px; cursor: pointer; }
.import-grid input[type="file"]::file-selector-button:hover { background: var(--accent); }
@media (max-width: 720px) { .import-grid .field { flex: 1 1 100%; } .import-grid .import-submit .btn { width: 100%; } }

/* ---------- AI translation: action row + suggested-field highlight ---------- */
.list-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.ai-fill-btn { color: var(--accent-ink); }
.ai-fill-btn:hover { background: var(--accent-soft); border-color: var(--accent-strong); }
.tr-suggested { background: var(--accent-haze); border-color: var(--accent-strong); }
.tr-suggested:focus { background: var(--surface); }

/* ---------- Per-field clear (x) button ---------- */
.field-clearable { position: relative; }
.field-clearable > .input { padding-right: 32px; }
.field-clear { position: absolute; top: 50%; right: 7px; transform: translateY(-50%); display: none; width: 22px; height: 22px; padding: 0; border: none; border-radius: 50%; background: var(--line); color: var(--ink-2); cursor: pointer; align-items: center; justify-content: center; font-size: 16px; line-height: 1; }
.field-clear:hover { background: var(--danger); color: #fff; }
.field-clearable:focus-within > .input:not(:placeholder-shown) ~ .field-clear,
.field-clearable:hover > .input:not(:placeholder-shown) ~ .field-clear { display: flex; }

/* ---------- Content validation feedback ---------- */
.settings-subhead { font-family: var(--ff-display); font-size: 1.05rem; margin: 24px 0 4px; padding-top: 18px; border-top: 1px solid var(--line); }
.input-invalid { border-color: var(--danger); background: #fdecec; }
.input-invalid:focus { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(224,71,76,.14); }
.field-error { display: block; margin-top: 5px; color: var(--danger); font-size: .82rem; line-height: 1.35; }

/* ---------- Member option suggestions (admin review) ---------- */
.req-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-size: .8rem; font-weight: 700; margin-left: 6px; vertical-align: middle; }
.req-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.req-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.req-value { font-family: var(--ff-display); font-size: 1.02rem; }
.req-meta { display: block; color: var(--ink-3); font-size: .82rem; margin-top: 2px; }
.req-lang { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); font-size: .72rem; font-weight: 700; }
.req-actions { display: flex; gap: 8px; }

/* ---------- Compact instructor cards + detail modal ---------- */
.card-compact-teaches, .btn-more { display: none; }
.card-compact .card-compact-teaches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.card-compact .btn-more { display: inline-flex; align-self: flex-start; width: fit-content; margin-top: 14px; }
.card-compact .card-next,
.card-compact .card-section,
.card-compact .card-about,
.card-compact .card-foot { display: none; }
.card-count { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: .78rem; font-weight: 700; }
.modal-instructor { max-width: 460px; width: 100%; max-height: 88vh; overflow-y: auto; }
.modal-instructor .instructor-card { border: none; box-shadow: none; margin: 0; padding: 0; background: transparent; }

/* ---------- Search clear (×) button + live search ---------- */
.input.has-clear { padding-right: 38px; }
.search-clear { position: absolute; top: 50%; right: 9px; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: none; border-radius: 50%; background: var(--line); color: var(--ink-2); cursor: pointer; font-size: 16px; line-height: 1; transition: background .15s ease, color .15s ease; }
.search-clear:hover { background: var(--danger); color: #fff; }
.search-clear[hidden] { display: none; }

/* ---------- Voice (microphone) search button ---------- */
.search-row { display: flex; gap: 8px; align-items: stretch; }
.search-row .input-wrap { flex: 1; }
.mic-btn { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 50px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-2); cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.mic-btn:hover { background: var(--surface-2); border-color: var(--ink-3); color: var(--ink); }
.mic-btn[hidden] { display: none; }
.mic-btn.is-listening { background: var(--accent); border-color: var(--accent-strong); color: #1a2106; animation: mic-pulse 1.2s ease-in-out infinite; }
@keyframes mic-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(180,230,54,.55); } 50% { box-shadow: 0 0 0 8px rgba(180,230,54,0); } }
@media (max-width: 560px) { .mic-btn { width: 46px; } }

/* ---------- Match highlighting in search results ---------- */
mark.hl { background: var(--accent); color: #1a2106; border-radius: 3px; padding: 0 1px; }
.pill mark.hl, .card-count mark.hl { background: var(--accent-strong); }
