/* ===== OralCare Admin — design tokens ===== */
:root {
  --ink: #14302D;
  --ink-soft: #4C6A66;
  --mist: #7E9C97;
  --bg: #F3F8F6;
  --surface: #FFFFFF;
  --line: #E1EBE8;

  --teal-900: #0D3B39;
  --teal-700: #10534F;
  --teal-500: #157A73;
  --mint-400: #2FBFA6;
  --mint-100: #DAF4EE;

  --amber: #B8862E;
  --amber-100: #FBF0DC;
  --coral: #D9583F;
  --coral-100: #FBE7E2;
  --sky-100: #E6F1FB;
  --sky-700: #2A6FA5;

  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 7px;
  --shadow-card: 0 1px 2px rgba(15, 59, 57, 0.06), 0 8px 24px -12px rgba(15, 59, 57, 0.12);
  --font-display: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ===== Auth pages (login / setup) ===== */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 15% 20%, rgba(47,191,166,0.16), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(13,59,57,0.10), transparent 40%),
    var(--bg);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 396px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 40px 36px 32px;
  border: 1px solid var(--line);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.auth-brand .mark { width: 34px; height: 34px; }

.auth-brand span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--teal-900);
  letter-spacing: -0.01em;
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin: 22px 0 4px;
  color: var(--teal-900);
}

.auth-card p.sub {
  margin: 0 0 26px;
  color: var(--ink-soft);
  font-size: 13.5px;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-family: var(--font-body);
  background: #FCFEFD;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--mint-400);
  box-shadow: 0 0 0 3px rgba(47,191,166,0.18);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform .1s ease, filter .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--teal-700), var(--teal-900));
  color: #fff;
  width: 100%;
  padding: 12px 18px;
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--ink);
}
.btn-outline:hover { border-color: var(--mist); }

.btn-danger {
  background: var(--coral-100);
  color: var(--coral);
}
.btn-danger:hover { background: #F7D5CD; }

.btn-sm { padding: 7px 12px; font-size: 12.5px; }

.notice-banner {
  background: #FFF8E8;
  color: #7A5A12;
  border: 1px solid #F0DCA8;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 18px;
}

.error-banner {
  background: var(--coral-100);
  color: var(--coral);
  border: 1px solid #F0C3B7;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 18px;
}

.success-banner {
  background: var(--mint-100);
  color: var(--teal-900);
  border: 1px solid #B9E9DD;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 18px;
}

/* ===== App shell ===== */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--teal-900), #0A2E2C);
  color: #EAF6F3;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 26px;
}

.sidebar .brand .mark { width: 28px; height: 28px; }

.sidebar .brand span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.nav-group-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7FADA6;
  padding: 14px 10px 6px;
  font-weight: 700;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.8px;
  font-weight: 500;
  color: #CDE7E1;
  margin-bottom: 2px;
}

.nav-link svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.9; }

.nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }

.nav-link.active {
  background: rgba(47,191,166,0.16);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--mint-400);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.09);
  padding-top: 14px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 12px;
}

.avatar-chip {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--mint-400);
  color: var(--teal-900);
  font-weight: 700;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.sidebar-user .who { min-width: 0; }
.sidebar-user .name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .role { font-size: 11px; color: #8FBDB6; }

/* ===== Main content ===== */
.main { flex: 1; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  /* The page title, the date and the avatar stay in view while the
     page scrolls, on every admin screen. */
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar h1 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--teal-900);
  margin: 0;
}

.topbar .subtitle { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-super { background: var(--amber-100); color: var(--amber); }
.badge-admin { background: var(--sky-100); color: var(--sky-700); }

.content { padding: 28px 32px 60px; }

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
}

.stat-card .label { font-size: 12px; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-card .value { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--teal-900); margin-top: 6px; }
.stat-card .hint { font-size: 12px; color: var(--mist); margin-top: 4px; }

/* Panels / tables */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2 { font-family: var(--font-display); font-size: 15.5px; font-weight: 700; margin: 0; color: var(--teal-900); }
.panel-header p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-soft); }

table { width: 100%; border-collapse: collapse; }

thead th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  font-weight: 700;
  padding: 12px 22px;
  background: #FAFCFB;
  border-bottom: 1px solid var(--line);
}

tbody td {
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  font-size: 13.8px;
  vertical-align: top;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #FAFDFC; }

.cell-primary { font-weight: 600; color: var(--teal-900); }
.cell-muted { color: var(--ink-soft); }

.empty-state {
  padding: 46px 22px;
  text-align: center;
  color: var(--ink-soft);
}
.empty-state .mark { width: 40px; height: 40px; margin: 0 auto 12px; opacity: 0.35; }
.empty-state p { margin: 4px 0 0; font-size: 13.5px; }

.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row .field { flex: 1; min-width: 200px; }

.kw-tag {
  display: inline-block;
  background: var(--mint-100);
  color: var(--teal-700);
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  margin: 2px 3px 2px 0;
}

.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(13,45,43,0.42);
  align-items: center; justify-content: center;
  z-index: 50;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 26px;
  width: 100%; max-width: 380px;
  box-shadow: 0 24px 60px -12px rgba(13,45,43,0.35);
}

.modal-card h3 { font-family: var(--font-display); margin: 0 0 8px; color: var(--teal-900); font-size: 16.5px; }
.modal-card p { margin: 0 0 20px; color: var(--ink-soft); font-size: 13.5px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

.toolbar { display: flex; align-items: center; gap: 10px; }

@media (max-width: 880px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; flex-direction: row; align-items: center; padding: 12px 16px; }
  .sidebar .brand { padding: 0; margin-right: auto; }
  .nav-group-label { display: none; }
  .sidebar-footer { display: none; }
  .nav-link { padding: 8px 10px; }
  .content { padding: 20px 16px 40px; }
  .topbar { padding: 16px; }
  table { display: block; overflow-x: auto; }
}
/* =====================================================================
   2026-09 redesign: dashboard, users page, login. New components only;
   everything above is untouched so knowledge.php / admins.php /
   profile.php keep their look.
   ===================================================================== */

/* ---- Topbar: right side (date, avatar) ---- */
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-date {
  font-size: 12.5px; color: var(--ink-soft); font-weight: 500;
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: #FAFCFB;
  display: inline-flex; align-items: center; gap: 7px;
}
.topbar-date svg { width: 14px; height: 14px; color: var(--mist); }
.topbar-avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none;
  border: 2px solid var(--mint-100);
}
.topbar-avatar.chip {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--mint-100); color: var(--teal-900); font-weight: 700; font-size: 13px;
}

/* ---- Dashboard: welcome band ---- */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  color: #EAF6F3;
  background:
    radial-gradient(circle at 88% 10%, rgba(47,191,166,0.45), transparent 42%),
    radial-gradient(circle at 70% 120%, rgba(47,191,166,0.22), transparent 40%),
    linear-gradient(120deg, var(--teal-900), var(--teal-700));
  box-shadow: var(--shadow-card);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-bottom: 22px;
}
.hero::after {
  /* the tooth mark, faint, bottom-right */
  content: ""; position: absolute; right: -18px; bottom: -34px; width: 170px; height: 170px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'><path d='M20 5c-3.2 0-5.6 1.7-7.4 1.7-1.9 0-3.9-1.6-6.4-1.6C3.1 5.1 1 8.6 1 13.2c0 5.6 2.6 11.4 4.8 15.9 1.5 3.1 2.8 6.4 5.1 6.4 2.2 0 2.6-1.5 3.4-4.4.6-2.3 1.4-6.4 3.4-6.4h4.6c2 0 2.8 4.1 3.4 6.4.8 2.9 1.2 4.4 3.4 4.4 2.3 0 3.6-3.3 5.1-6.4C36.4 24.6 39 18.8 39 13.2 39 8.6 36.9 5.1 33.8 5.1c-2.5 0-4.5 1.6-6.4 1.6C25.6 6.7 23.2 5 20 5z' fill='white' fill-opacity='0.07'/></svg>") no-repeat center / contain;
  pointer-events: none;
}
.hero .eyebrow { font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: #8FD6C8; font-weight: 700; margin-bottom: 6px; }
.hero h2 { font-family: var(--font-display); font-size: 24px; font-weight: 800; margin: 0 0 6px; color: #fff; letter-spacing: -0.01em; }
.hero p { margin: 0; font-size: 13.5px; color: #C6E6DF; max-width: 52ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.btn-light { background: #fff; color: var(--teal-900); }
.btn-light:hover { filter: brightness(0.97); }
.btn-ghost { background: rgba(255,255,255,0.10); color: #fff; border: 1px solid rgba(255,255,255,0.22); }
.btn-ghost:hover { background: rgba(255,255,255,0.16); }
.btn svg { width: 16px; height: 16px; }

/* ---- Dashboard: stat cards with icon + delta ---- */
.stat-grid.four { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card.rich { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; position: relative; }
.stat-card .stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-icon {
  width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--mint-100); color: var(--teal-700); flex: none;
}
.stat-icon svg { width: 19px; height: 19px; }
.stat-icon.sky { background: var(--sky-100); color: var(--sky-700); }
.stat-icon.amber { background: var(--amber-100); color: var(--amber); }
.stat-icon.coral { background: var(--coral-100); color: var(--coral); }
.stat-card.rich .value { margin-top: 0; line-height: 1; font-size: 32px; }
.stat-card .delta {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  color: var(--teal-700); background: var(--mint-100); padding: 3px 9px; border-radius: 999px;
}
.stat-card .delta.flat { color: var(--ink-soft); background: var(--bg); }
.stat-card .delta svg { width: 12px; height: 12px; }
.stat-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 6px 8px; flex-wrap: wrap; }
.stat-card .delta { white-space: nowrap; }
.stat-card.rich .hint { margin-top: 0; }

/* ---- Dashboard: two-column panels ---- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.dash-grid .panel { margin-bottom: 0; }
.dash-grid > * { min-width: 0; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.panel-header .link { font-size: 12.5px; font-weight: 600; color: var(--teal-700); display: inline-flex; align-items: center; gap: 5px; }
.panel-header .link svg { width: 14px; height: 14px; }
.panel-header .link:hover { color: var(--teal-900); }

/* people rows (avatar initials + name + username) */
.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.avatar-initials {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12.5px; letter-spacing: 0.02em;
  background: var(--mint-100); color: var(--teal-900);
}
.avatar-initials.t2 { background: var(--sky-100); color: var(--sky-700); }
.avatar-initials.t3 { background: var(--amber-100); color: var(--amber); }
.avatar-initials.t4 { background: #EEE8FA; color: #6A4FB6; }
.avatar-initials.t5 { background: var(--coral-100); color: var(--coral); }
.person .who { min-width: 0; }
.person .name { font-weight: 600; color: var(--teal-900); font-size: 13.8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .handle { font-size: 12px; color: var(--mist); margin-top: 1px; }

/* list of recent questions */
.qlist { list-style: none; margin: 0; padding: 6px 0; }
.qlist li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 22px; border-bottom: 1px solid var(--line); }
.qlist li:last-child { border-bottom: 0; }
.qlist .bubble {
  width: 30px; height: 30px; border-radius: 10px; flex: none; margin-top: 1px;
  background: var(--mint-100); color: var(--teal-700); display: inline-flex; align-items: center; justify-content: center;
}
.qlist .bubble svg { width: 15px; height: 15px; }
.qlist .q { font-weight: 600; color: var(--teal-900); font-size: 13.6px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.qlist .meta { font-size: 12px; color: var(--mist); margin-top: 3px; }
.qlist .meta b { font-weight: 600; color: var(--ink-soft); }

/* second dashboard row: activity feed wider */
.dash-grid.second { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); margin-top: 20px; }

/* signups chart (inline svg) */
.chart { padding: 14px 18px 10px; }
.chart svg { width: 100%; height: auto; display: block; font-family: var(--font-body); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
/* sizes are in viewBox units (640 wide): ~13px on a desktop card, ~9px on a phone */
.chart .tick { font-size: 15px; fill: var(--mist); }
.chart .val { font-size: 16px; font-weight: 700; fill: var(--teal-900); }
.chart .bar { fill: #BFE6DC; }
.chart .bar.now { fill: var(--mint-400); }

/* activity feed (timeline) */
.feed { list-style: none; margin: 0; padding: 8px 22px 14px; position: relative; }
.feed li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; position: relative; }
.feed li + li::before { content: ""; position: absolute; left: 17px; top: -18px; height: 26px; border-left: 2px dashed var(--line); }
.feed .avatar-initials { position: relative; z-index: 1; }
.feed .what { font-size: 13.5px; color: var(--ink); min-width: 0; padding-top: 4px; }
.feed .what b { color: var(--teal-900); }
.feed .handle { color: var(--mist); font-size: 12.5px; }
.feed .when { font-size: 12px; color: var(--mist); margin-top: 2px; }

/* knowledge base health */
.health { padding: 8px 22px 16px; display: grid; gap: 12px; }
.hrow { display: grid; grid-template-columns: 1.3fr 1fr auto; align-items: center; gap: 12px; }
.hlabel b { display: block; font-size: 13px; color: var(--teal-900); font-weight: 600; }
.hlabel small { display: block; font-size: 11.5px; color: var(--mist); }
.hbar { height: 8px; border-radius: 999px; background: #E6EFEC; overflow: hidden; }
.hbar span { display: block; height: 100%; border-radius: 999px; background: var(--mint-400); }
.hbar span.mid { background: var(--amber); }
.hbar span.low { background: var(--coral); }
.hval { font-size: 13px; font-weight: 700; color: var(--teal-900); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hval small { font-weight: 500; color: var(--mist); margin-left: 4px; }

/* quick actions list */
.actions { padding: 6px 10px 10px; display: grid; gap: 2px; }
.action { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-md); transition: background .15s ease; }
.action:hover { background: var(--bg); }
.action .ic { width: 34px; height: 34px; border-radius: 10px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--mint-100); color: var(--teal-700); }
.action .ic.sky { background: var(--sky-100); color: var(--sky-700); }
.action .ic.amber { background: var(--amber-100); color: var(--amber); }
.action .ic.coral { background: var(--coral-100); color: var(--coral); }
.action .ic svg { width: 17px; height: 17px; }
.action b { display: block; font-size: 13.5px; font-weight: 600; color: var(--teal-900); }
.action small { display: block; font-size: 12px; color: var(--mist); margin-top: 1px; }

/* topic coverage bars */
.bars { padding: 8px 22px 16px; display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 130px 1fr 34px; align-items: center; gap: 12px; font-size: 12.5px; }
.bar .k { color: var(--ink-soft); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .track { display: block; height: 8px; border-radius: 999px; background: #E6EFEC; overflow: hidden; }
.bar .fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--mint-400), var(--teal-500)); }
.bar .n { text-align: right; font-weight: 700; color: var(--teal-900); font-variant-numeric: tabular-nums; }

.time-muted { color: var(--mist); font-size: 12px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.ok { background: var(--mint-400); }
.dot.warn { background: var(--amber); }

/* ---- Search pill: icon inside, Enter searches, × clears (was inline in users.php) ---- */
.search {
  display: flex; align-items: center; gap: 8px; padding: 0 6px 0 12px; height: 38px; min-width: 300px;
  border: 1.5px solid var(--line); border-radius: 999px; background: #FCFEFD;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search:focus-within { border-color: var(--mint-400); box-shadow: 0 0 0 3px rgba(47,191,166,0.18); }
.search svg { width: 16px; height: 16px; color: var(--mist); flex: none; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 13.5px; font-family: var(--font-body); color: var(--ink); min-width: 0; }
.search .clear { display: none; border: 0; background: var(--bg); color: var(--ink-soft); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 1; }
.search.has-value .clear { display: inline-flex; align-items: center; justify-content: center; }
.search .go { border: 0; background: var(--teal-900); color: #fff; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: var(--font-body); }
.search .go:hover { filter: brightness(1.1); }

/* ---- Users page ---- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h2 { font-family: var(--font-display); font-size: 18px; font-weight: 800; margin: 0; color: var(--teal-900); }
.page-head p { margin: 4px 0 0; font-size: 13px; color: var(--ink-soft); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-soft); }
.chip b { color: var(--teal-900); font-size: 13.5px; }
.chip.warn { background: var(--amber-100); border-color: transparent; color: var(--amber); }
.chip.warn b { color: var(--amber); }

.seg { display: inline-flex; background: #E9F2EF; padding: 4px; border-radius: 999px; gap: 2px; }
.seg a {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--ink-soft); transition: background .15s ease, color .15s ease;
}
.seg a:hover { color: var(--teal-900); }
.seg a.active { background: var(--surface); color: var(--teal-900); box-shadow: 0 1px 2px rgba(15,59,57,0.08), 0 4px 10px -6px rgba(15,59,57,0.25); }
.seg .n { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: rgba(13,59,57,0.08); color: var(--teal-900); font-weight: 700; }
.seg a.active .n { background: var(--mint-100); }

.table-tools { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 22px; border-bottom: 1px solid var(--line); background: #FAFCFB; }
.table-tools .count { font-size: 13px; color: var(--ink-soft); }
.table-tools .count b { color: var(--teal-900); }

.badge.badge-user { background: var(--sky-100); color: var(--sky-700); }
.badge.badge-admin { background: var(--mint-100); color: var(--teal-700); }
.badge.badge-super { background: var(--amber-100); color: var(--amber); }
.badge.soft { text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 12px; }

.empty-state .icon { width: 46px; height: 46px; border-radius: 14px; background: var(--bg); color: var(--mist); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.empty-state .icon svg { width: 22px; height: 22px; }
.empty-state h3 { margin: 0; font-family: var(--font-display); font-size: 15px; color: var(--teal-900); }

/* users table on small screens: rows become cards */
@media (max-width: 720px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table-cards td { padding: 4px 0; border: 0; font-size: 13.5px; }
  .table-cards td[data-label]::before { content: attr(data-label); display: inline-block; width: 92px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--mist); font-weight: 700; }
  .table-cards td.no-label::before { display: none; }
  .table-tools { padding: 12px 16px; }
  .search { min-width: 0; width: 100%; }
}

/* ---- Login: split layout ---- */
.auth-split {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  background: var(--bg);
}
.auth-side {
  position: relative; overflow: hidden; color: #EAF6F3; padding: 48px 52px;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(circle at 80% 15%, rgba(47,191,166,0.42), transparent 40%),
    radial-gradient(circle at 20% 90%, rgba(47,191,166,0.22), transparent 42%),
    linear-gradient(150deg, var(--teal-900) 0%, #0B3634 55%, var(--teal-700) 100%);
}
.auth-side::before {
  content: ""; position: absolute; right: -60px; top: 50%; transform: translateY(-50%);
  width: 460px; height: 460px; opacity: 0.08; pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'><path d='M20 5c-3.2 0-5.6 1.7-7.4 1.7-1.9 0-3.9-1.6-6.4-1.6C3.1 5.1 1 8.6 1 13.2c0 5.6 2.6 11.4 4.8 15.9 1.5 3.1 2.8 6.4 5.1 6.4 2.2 0 2.6-1.5 3.4-4.4.6-2.3 1.4-6.4 3.4-6.4h4.6c2 0 2.8 4.1 3.4 6.4.8 2.9 1.2 4.4 3.4 4.4 2.3 0 3.6-3.3 5.1-6.4C36.4 24.6 39 18.8 39 13.2 39 8.6 36.9 5.1 33.8 5.1c-2.5 0-4.5 1.6-6.4 1.6C25.6 6.7 23.2 5 20 5z' fill='white'/></svg>") no-repeat center / contain;
}
.auth-side .brand { display: flex; align-items: center; gap: 12px; position: relative; }
.auth-side .brand .mark { width: 36px; height: 36px; }
.auth-side .brand span { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: #fff; }
.auth-side .pitch { position: relative; max-width: 46ch; }
.auth-side .pitch h2 { font-family: var(--font-display); font-size: 34px; line-height: 1.15; font-weight: 800; margin: 0 0 14px; color: #fff; letter-spacing: -0.015em; text-wrap: balance; }
.auth-side .pitch p { margin: 0 0 24px; font-size: 15px; color: #C6E6DF; line-height: 1.55; }
.auth-side .points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.auth-side .points li { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #E3F3EF; }
.auth-side .points .ic { width: 32px; height: 32px; border-radius: 10px; background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.14); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.auth-side .points .ic svg { width: 16px; height: 16px; }
.auth-side .foot { position: relative; font-size: 12px; color: #8FBDB6; }

.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form .auth-card { max-width: 420px; box-shadow: var(--shadow-card); }
.auth-form .auth-card h1 { margin-top: 6px; font-size: 24px; }
.auth-card .field-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.auth-card .field-row label { margin: 0; }
.auth-card .btn-primary { margin-top: 6px; padding: 13px 18px; font-size: 14.5px; border-radius: var(--radius-md); }
.auth-card .below { margin: 18px 0 0; text-align: center; font-size: 12.5px; color: var(--mist); }
.auth-card .field input { padding: 12px 14px; border-radius: var(--radius-md); }

@media (max-width: 880px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 22px; min-height: 0; }
  .auth-side::before { display: none; }
  .auth-side .pitch h2 { font-size: 24px; margin-bottom: 8px; }
  .auth-side .pitch p { margin-bottom: 14px; font-size: 14px; }
  .auth-side .points { display: none; }
  .auth-side .foot { display: none; }
  .auth-side .brand { margin-bottom: 20px; }
  .auth-form { padding: 22px 16px 40px; }
  .hero { flex-direction: column; align-items: flex-start; padding: 22px 20px; }
  .hero h2 { font-size: 21px; }
  .dash-grid, .dash-grid.second { grid-template-columns: minmax(0, 1fr); }
  .hrow { grid-template-columns: 1fr; gap: 6px; }
  .topbar-right .topbar-date { display: none; }
  .bar { grid-template-columns: 96px 1fr 30px; }
  /* stat cards: two per row, never wider than the screen */
  .stat-grid.four, .stat-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat-card.rich { padding: 16px; }
  .stat-card.rich .value { font-size: 28px; }
  /* the sidebar becomes a top bar: let it scroll sideways instead of
     pushing the page wider than the screen */
  .sidebar { overflow-x: auto; scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar .brand span, .nav-link { white-space: nowrap; }
}
@media (max-width: 420px) {
  .stat-grid.four, .stat-grid.three { grid-template-columns: 1fr; }
}
