/* Takoha Admin — shared shell stylesheet
   Design system: assets/16063191595020085025
   Primary indigo #5b4cff, teal #14b8a6, coral #ff6b6b, Plus Jakarta Sans + Inter, rounded 12px. */

:root {
  --indigo:   #5b4cff;
  --indigo-2: #4338ca;
  --indigo-soft: #eef0ff;
  --teal:     #14b8a6;
  --teal-soft:#ccfbf1;
  --coral:    #ff6b6b;
  --amber:    #f59e0b;
  --green:    #10b981;
  --grey-900: #0f172a;
  --grey-700: #334155;
  --grey-500: #64748b;
  --grey-400: #94a3b8;
  --grey-200: #e2e8f0;
  --grey-100: #f1f5f9;
  --grey-50:  #f8fafc;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 1px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: var(--font-body);
  color: var(--grey-900);
  background: var(--grey-50);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -0.01em; }
a { color: var(--indigo); text-decoration: none; }

/* App shell */
.app { display: grid; grid-template-rows: 64px 1fr; min-height: 100vh; }
.topbar {
  display: grid; grid-template-columns: 280px 1fr 280px; align-items: center;
  padding: 0 24px; background: white; border-bottom: 1px solid var(--grey-200);
  position: sticky; top: 0; z-index: 100;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--indigo) 0%, #7c6dff 100%);
  display: grid; place-items: center; color: white;
  font-family: var(--font-display); font-weight: 800; font-size: 16px;
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.brand-name span { color: var(--indigo); font-weight: 800; }

.topbar-search {
  position: relative; display: flex; align-items: center;
  background: var(--grey-100); border-radius: 999px; padding: 8px 16px;
  border: 1px solid transparent; transition: all 120ms ease;
}
.topbar-search:focus-within { background: white; border-color: var(--indigo); box-shadow: 0 0 0 4px var(--indigo-soft); }
.topbar-search input {
  border: 0; background: transparent; outline: none; flex: 1;
  font-family: var(--font-body); font-size: 14px; color: var(--grey-900);
}
.topbar-search input::placeholder { color: var(--grey-500); }
.kbd {
  font-family: var(--font-mono); font-size: 11px; color: var(--grey-500);
  background: white; border: 1px solid var(--grey-200); border-radius: 6px; padding: 2px 6px;
}

.topbar-right { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  /* inline-grid so adjacent icon-btns inside a table cell sit side-by-side
     rather than stacking vertically (each was a block-level grid before). */
  display: inline-grid; place-items: center; vertical-align: middle;
  background: var(--grey-100); border: 1px solid transparent; cursor: pointer;
  transition: all 120ms ease; position: relative;
  color: var(--grey-700); text-decoration: none;
  margin-left: 4px;
}
.icon-btn:first-child { margin-left: 0; }
/* Table action columns: tighten the gap and align right. */
.tbl td.right { white-space: nowrap; }
.icon-btn:hover { background: var(--indigo-soft); }
.icon-btn svg { width: 18px; height: 18px; color: var(--grey-700); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--coral); border: 2px solid white;
}
.admin-pill {
  display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px;
  background: var(--grey-100); border-radius: 999px;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo) 0%, var(--teal) 100%);
  display: grid; place-items: center; color: white; font-weight: 700; font-size: 12px;
  font-family: var(--font-display);
}
.admin-pill span { font-size: 13px; font-weight: 600; }

/* Body
   84px rail (was 72) gives the icons a 10px caption slot so unfamiliar
   users can read what each rail entry is without relying on the hover
   tooltip — see design-critique recommendation #2. */
.body { display: grid; grid-template-columns: 84px 1fr; min-height: calc(100vh - 64px); }
.body.with-sidebar { grid-template-columns: 84px 340px 1fr; }

/* Left rail */
.rail {
  background: white; border-right: 1px solid var(--grey-200);
  display: flex; flex-direction: column; align-items: center; padding: 16px 0;
  gap: 6px; overflow-y: auto;
}
/* Grouping caption for the nav rail — declutters a long flat list by
   chunking items under Monitor / Configure / Reports / Manage. Tiny by
   design so it fits the narrow rail; first one drops its top divider. */
.rail-section {
  width: 64px; text-align: center; font-size: 8.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--grey-400);
  padding: 8px 0 2px; margin-top: 4px; border-top: 1px solid var(--grey-100);
}
.rail-section.first { border-top: 0; margin-top: 0; padding-top: 0; }
.rail-item {
  width: 64px; min-height: 56px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 6px 4px;
  color: var(--grey-500); cursor: pointer; transition: all 120ms ease; position: relative;
  text-decoration: none;
}
.rail-item:hover { background: var(--indigo-soft); color: var(--indigo); }
.rail-item.active { background: var(--indigo); color: white; }
.rail-item.active::before {
  content: ''; position: absolute; left: -16px; top: 10px; bottom: 10px;
  width: 4px; background: var(--indigo); border-radius: 0 4px 4px 0;
}
.rail-item svg { width: 20px; height: 20px; }
.rail-label { font-size: 10px; font-weight: 600; line-height: 1.1; text-align: center; letter-spacing: 0.01em; }
.rail-spacer { flex: 1; }
/* Tooltip kept for cases where the label is truncated; activates on long press / focus only. */
.rail-tooltip {
  position: absolute; left: 100%; margin-left: 12px; padding: 6px 10px;
  background: var(--grey-900); color: white; font-size: 12px; font-weight: 500;
  border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity 120ms ease; z-index: 1000;
}
.rail-item:focus-visible .rail-tooltip { opacity: 1; }

/* Page header (used on non-map pages) */
.page { padding: 32px 40px; max-width: 1400px; margin: 0 auto; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; }
.page-title { font-size: 32px; font-weight: 800; font-family: var(--font-display); }
/* grey-700 (not grey-500) — keeps the sub readable at 14px and lands
   AA-compliant at 5.8:1 vs grey-500's 4.5:1 borderline. */
.page-sub { color: var(--grey-700); margin-top: 4px; font-size: 14px; line-height: 1.5; }

/* Cards */
.card {
  background: white; border-radius: 16px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--grey-100); overflow: hidden;
}
.card-header { padding: 20px 24px; border-bottom: 1px solid var(--grey-100); display: flex; justify-content: space-between; align-items: center; }
.card-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.card-body { padding: 20px 24px; }

/* Stat tiles */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-tile {
  background: white; border-radius: 16px; padding: 20px 24px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--grey-100);
  display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden;
}
.stat-tile.primary {
  background: linear-gradient(135deg, var(--indigo) 0%, #7c6dff 100%);
  color: white; border: 0;
}
.stat-tile.primary::after {
  content: ''; position: absolute; right: -40px; bottom: -40px; width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 70%);
}
.stat-tile .label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.7; }
.stat-tile.primary .label { opacity: 0.8; }
.stat-tile .value { font-family: var(--font-display); font-size: 32px; font-weight: 800; line-height: 1; }
/* Primary tile is the visual anchor — bump value to 40px so a 4-up
   grid clearly signals "this one is the answer to the headline question". */
.stat-tile.primary .value { font-size: 40px; }
.stat-tile .delta { font-size: 12px; font-weight: 600; color: var(--green); display: flex; align-items: center; gap: 4px; }
.stat-tile.primary .delta { color: rgba(255, 255, 255, 0.85); }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th {
  text-align: left; font-size: 11px; font-weight: 700; color: var(--grey-500);
  text-transform: uppercase; letter-spacing: 0.06em; padding: 12px 24px; border-bottom: 1px solid var(--grey-100);
  background: var(--grey-50);
}
.tbl tbody td { padding: 16px 24px; border-bottom: 1px solid var(--grey-100); font-size: 14px; color: var(--grey-700); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background 120ms ease; cursor: pointer; }
.tbl tbody tr:hover { background: var(--grey-50); }

.term-name-cell { display: flex; align-items: center; gap: 12px; }
.dot-online { width: 8px; height: 8px; border-radius: 50%; background: var(--grey-400); }
.dot-online.on { background: var(--green); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15); }
.mono { font-family: var(--font-mono); font-weight: 600; color: var(--grey-900); }
.muted { color: var(--grey-500); font-size: 12px; margin-top: 2px; }
.right { text-align: right; }
.amount-cell { font-family: var(--font-display); font-weight: 700; color: var(--grey-900); }

/* Channel chips */
.chan-chip { display: inline-flex; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.chan-skyzer    { background: var(--indigo-soft); color: var(--indigo-2); }
.chan-centrapay { background: #fef3c7; color: #92400e; }
.chan-wechat    { background: #d1fae5; color: #065f46; }
.chan-alipay    { background: #dbeafe; color: #1e40af; }
.chan-unionpay  { background: #fecaca; color: #991b1b; }
.chan-cash      { background: var(--grey-100); color: var(--grey-700); }
.chan-default   { background: var(--grey-100); color: var(--grey-700); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px;
  background: var(--indigo); color: white; border: 0; border-radius: 12px;
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 120ms ease;
}
.btn:hover { background: var(--indigo-2); transform: translateY(-1px); }
.btn.secondary { background: white; color: var(--indigo); border: 1px solid var(--grey-200); }
.btn.secondary:hover { background: var(--indigo-soft); }
.btn.ghost { background: transparent; color: var(--grey-700); }
.btn.ghost:hover { background: var(--grey-100); }
.btn.danger { background: var(--coral); }
.btn.danger:hover { background: #ef4444; }

/* Form fields */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 12px; font-weight: 600; color: var(--grey-700); }
.field input, .field textarea, .field select {
  font-family: var(--font-body); font-size: 14px; color: var(--grey-900);
  background: white; border: 1px solid var(--grey-200); border-radius: 12px;
  padding: 10px 14px; outline: none; transition: all 120ms ease;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--indigo); box-shadow: 0 0 0 4px var(--indigo-soft); }
.field .hint { font-size: 11px; color: var(--grey-500); }
.field textarea { min-height: 120px; resize: vertical; font-family: var(--font-mono); font-size: 13px; }

/* Form grid */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }

/* Empty state — three-part pattern: emoji + statement + invitation.
   Use .empty-cta for the primary action button slot so empty cells
   always have a clear next step (design-critique rec #4). */
.empty {
  text-align: center; padding: 64px 24px;
  color: var(--grey-700); font-size: 14px; line-height: 1.5;
}
.empty .empty-emoji { font-size: 40px; margin-bottom: 16px; opacity: 0.6; }
.empty .empty-title { font-family: var(--font-display); font-weight: 700; color: var(--grey-900); font-size: 16px; margin-bottom: 6px; }
.empty .empty-body { max-width: 360px; margin: 0 auto 16px; }
.empty .empty-cta { display: inline-flex; gap: 8px; margin-top: 8px; }
.empty .empty-cta .btn { padding: 10px 18px; }

/* Status chip — for state (active/inactive/pending). Distinct from
   .chan-chip (uppercase pill, for content categories like channels).
   Status uses a leading dot + lowercase to differentiate visually. */
.status-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--grey-100); color: var(--grey-700);
}
.status-chip::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.status-chip.ok      { background: rgba(16, 185, 129, 0.12); color: #047857; }
.status-chip.warn    { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.status-chip.danger  { background: rgba(255, 107, 107, 0.14); color: #c43d3d; }
.status-chip.muted   { background: var(--grey-100); color: var(--grey-500); }

/* Helpers */
.ic { width: 18px; height: 18px; }
.row-gap-12 { display: flex; gap: 12px; align-items: center; }
.toast-host {
  position: fixed; top: 88px; right: 24px; z-index: 600;
  display: flex; flex-direction: column; gap: 10px; width: 320px; pointer-events: none;
}
.toast {
  background: white; border-radius: 14px; padding: 14px 16px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--grey-100);
  position: relative; overflow: hidden; pointer-events: auto;
  animation: toast-in 280ms cubic-bezier(0.16, 1, 0.3, 1);
}
.toast::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--teal) 0%, var(--indigo) 100%);
}
@keyframes toast-in {
  0%   { transform: translateX(120%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
.toast-head { display: flex; justify-content: space-between; align-items: baseline; }
.toast-amount { font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.toast-time   { font-size: 11px; color: var(--grey-500); }
.toast-body   { font-size: 13px; color: var(--grey-700); margin-top: 4px; }

/* =====================================================================
   Legacy Bootstrap / Material Dashboard class overrides
   So existing Thymeleaf fragments (create_merchant, view_admin etc.) that
   use Bootstrap class names get the new design without per-page rewrites.
   =====================================================================*/

/* Bootstrap card */
.card {
  background: white; border-radius: 16px; border: 1px solid var(--grey-100);
  box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 24px;
}
.card-header, .card-header.card-header-primary {
  padding: 20px 24px; border-bottom: 1px solid var(--grey-100);
  background: white !important; color: var(--grey-900) !important;
  border-radius: 16px 16px 0 0; box-shadow: none !important;
  margin: 0 !important; position: relative;
}
.card-header h4, .card-title, .card-title.page-title, .head4 {
  font-family: var(--font-display); font-size: 20px; font-weight: 800;
  color: var(--grey-900); margin: 0;
}
.card-category, .paragh {
  color: var(--grey-500); font-size: 13px; margin-top: 4px;
}
.card-body { padding: 24px; }

/* Bootstrap form-group / form-control */
.form-group { margin-bottom: 16px; position: relative; }
.bmd-label-floating, .form-group label {
  font-size: 12px; font-weight: 600; color: var(--grey-700);
  display: block; margin-bottom: 6px; position: static !important;
  pointer-events: auto !important;
}
.form-control, .form-control:not([type='checkbox']):not([type='radio']) {
  font-family: var(--font-body); font-size: 14px; color: var(--grey-900);
  background: white; border: 1px solid var(--grey-200) !important; border-radius: 12px !important;
  padding: 10px 14px !important; outline: none; transition: all 120ms ease;
  height: auto !important; width: 100%; box-shadow: none !important;
}
.form-control:focus {
  border-color: var(--indigo) !important;
  box-shadow: 0 0 0 4px var(--indigo-soft) !important;
}
.form-control[readonly], .form-control:disabled { background: var(--grey-50); color: var(--grey-700); }
select.form-control { background-position: right 12px center; }
textarea.form-control { min-height: 100px; resize: vertical; }
.form-control::placeholder { color: var(--grey-400); }

/* Read-only inputs deserve their own look — without this they're
   indistinguishable from editable ones and users start clicking,
   typing, and getting confused on the "view" pages (which still use
   the same form-grid layout as edit). Greyed background + no border
   focus ring + cursor:default communicates "this is reference info,
   not a field". */
.form-control[readonly], .form-control[readonly]:focus {
  background: var(--grey-50);
  color: var(--grey-700);
  border-color: var(--grey-100);
  box-shadow: none;
  cursor: default;
}
.form-control:disabled, select.form-control:disabled {
  background: var(--grey-50);
  color: var(--grey-500);
  cursor: not-allowed;
  opacity: 1; /* override browser default that washes the text out */
}

/* Bootstrap buttons */
.btn:not(.btn-link) {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px;
  background: var(--indigo) !important; color: white !important; border: 0 !important; border-radius: 12px !important;
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 120ms ease; text-transform: none !important;
  box-shadow: none !important;
}
.btn:not(.btn-link):hover { background: var(--indigo-2) !important; transform: translateY(-1px); }
.btn.btn-info, .btn.btn-success { background: var(--indigo) !important; }
.btn.btn-danger { background: var(--coral) !important; }
.btn.btn-danger:hover { background: #ef4444 !important; }
.btn.btn-warning { background: var(--amber) !important; }
.btn.btn-default, .btn.btn-secondary {
  background: white !important; color: var(--indigo) !important;
  border: 1px solid var(--grey-200) !important;
}
.btn.btn-default:hover, .btn.btn-secondary:hover { background: var(--indigo-soft) !important; }
.btn.btn-link { color: var(--indigo); }

/* Bootstrap tables */
.table {
  width: 100%; border-collapse: collapse; background: white;
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm);
}
.table thead th {
  font-size: 11px; font-weight: 700; color: var(--grey-500);
  text-transform: uppercase; letter-spacing: 0.06em; padding: 14px 20px;
  border-bottom: 1px solid var(--grey-100); background: var(--grey-50); text-align: left;
}
.table tbody td {
  padding: 16px 20px; border-bottom: 1px solid var(--grey-100);
  font-size: 14px; color: var(--grey-700); vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover tbody tr:hover, .table tbody tr:hover { background: var(--grey-50); }
.dataTables_wrapper { padding: 4px; }
.dataTables_filter input { border: 1px solid var(--grey-200); border-radius: 10px; padding: 8px 12px; margin-left: 8px; }
.dataTables_length select { border: 1px solid var(--grey-200); border-radius: 10px; padding: 6px 10px; }
.dataTables_paginate .paginate_button {
  padding: 6px 12px; border-radius: 8px; border: 1px solid transparent;
  font-size: 13px; color: var(--grey-700); margin: 0 2px;
}
.dataTables_paginate .paginate_button.current,
.dataTables_paginate .paginate_button.current:hover {
  background: var(--indigo) !important; color: white !important;
  border-color: var(--indigo) !important;
}
.dataTables_paginate .paginate_button:hover { background: var(--indigo-soft) !important; color: var(--indigo) !important; }

/* Bootstrap grid spacing */
.container-fluid, .container-fluid1 { padding: 32px 40px; max-width: 1400px; margin: 0 auto; }
.row { display: flex; flex-wrap: wrap; gap: 16px 0; margin: 0 -8px; }
.row > [class*="col-"] { padding: 0 8px; }

/* Bootstrap modal.
   Bootstrap 4's own CSS isn't linked any more (we only ship its JS for
   legacy fragments that call `$('#myModal').modal('show')`). Without
   Bootstrap CSS, `.modal` defaults to display:block — which makes the
   legacy #myModal in home.html render as a giant purple banner above
   the entire app shell. Re-create the baseline display rules so the
   modal stays hidden until JS toggles `.show` (BS4) or `.in` (BS3). */
.modal {
  display: none;
  position: fixed; inset: 0; z-index: 2000;
  overflow: hidden; outline: 0;
  background: transparent;
}
.modal.show, .modal.in { display: block; background: rgba(15, 23, 42, 0.5); overflow-x: hidden; overflow-y: auto; }
.modal-dialog {
  position: relative; width: auto; margin: 1.75rem auto; max-width: 500px;
  pointer-events: none;
}
.modal.show .modal-dialog, .modal.in .modal-dialog { pointer-events: auto; }
.modal-content {
  position: relative; display: flex; flex-direction: column;
  background: white; border: 0; border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
}
.modal-header {
  background: linear-gradient(135deg, var(--indigo) 0%, #7c6dff 100%);
  color: white; border-bottom: 0; padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header .modal-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.modal-header .close {
  color: white; opacity: 0.9; font-size: 24px; background: transparent; border: 0;
  cursor: pointer; padding: 0; line-height: 1;
}
.modal-body { padding: 24px; font-size: 14px; color: var(--grey-700); }
.modal-footer { border-top: 1px solid var(--grey-100); padding: 16px 24px; display: flex; justify-content: flex-end; gap: 8px; }
/* Bootstrap dynamically injects `.modal-backdrop.fade` siblings — kill those
   only. Our own templates (e.g. admin_standby's zone editor) deliberately
   reuse `.modal-backdrop` as a class on a hidden div; that one uses the
   `[hidden]` attribute to stay invisible, so don't touch it here. */
.modal-backdrop.fade { display: none; }
/* Force the HTML `hidden` attribute to win against inline `display:*` so
   templates like admin_standby's zone editor (which carries both `hidden`
   AND `style="display:flex"`) actually stay hidden until JS opens them. */
[hidden] { display: none !important; }

/* Material Dashboard remnants we want to neutralise */
.skin-blue .main-header .navbar { background: transparent !important; }
.content-wrapper { background: transparent !important; padding: 0 !important; }
.content { padding: 0 !important; }
.top-header { padding: 20px 24px !important; }

/* Auth pages (login, forgetpass, reset_pass, link_expired) */
.auth-wrap {
  min-height: 100vh; background: linear-gradient(135deg, #f8fafc 0%, #eef0ff 100%);
  display: grid; place-items: center; padding: 24px;
}
.auth-card {
  background: white; border-radius: 24px; box-shadow: var(--shadow-lg);
  padding: 40px; width: 100%; max-width: 420px;
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.auth-brand .brand-mark { width: 40px; height: 40px; border-radius: 12px; }
.auth-card h1 {
  font-family: var(--font-display); font-size: 28px; font-weight: 800;
  margin-bottom: 8px; letter-spacing: -0.02em;
}
.auth-card .auth-sub { color: var(--grey-500); margin-bottom: 24px; font-size: 14px; }
.auth-card .field { margin-bottom: 16px; }
.auth-card .btn { width: 100%; justify-content: center; padding: 14px; font-size: 15px; }
.auth-card .auth-foot { text-align: center; margin-top: 24px; color: var(--grey-500); font-size: 13px; }
.auth-card .auth-foot a { color: var(--indigo); font-weight: 600; }

/* Badges + chips */
.badge, .label {
  display: inline-flex; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--grey-100); color: var(--grey-700);
}
.badge-success, .label-success { background: #d1fae5; color: #065f46; }
.badge-danger, .label-danger { background: #fecaca; color: #991b1b; }
.badge-warning, .label-warning { background: #fef3c7; color: #92400e; }
.badge-info, .label-info { background: var(--indigo-soft); color: var(--indigo-2); }

/* Alerts */
.alert {
  padding: 14px 18px; border-radius: 12px; border: 1px solid transparent;
  margin-bottom: 16px; font-size: 14px; display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.alert-danger, .alert-error { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.alert-info { background: var(--indigo-soft); color: var(--indigo-2); border-color: #c7d2fe; }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--grey-100) 25%, var(--grey-50) 50%, var(--grey-100) 75%);
  background-size: 200% 100%; animation: skel 1.4s infinite;
  border-radius: var(--radius-sm); display: inline-block;
}
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Breadcrumbs */
.breadcrumbs {
  display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--grey-500);
  margin-bottom: 16px;
}
.breadcrumbs a { color: var(--grey-500); }
.breadcrumbs a:hover { color: var(--indigo); }
.breadcrumbs .sep { color: var(--grey-400); }
.breadcrumbs .current { color: var(--grey-900); font-weight: 600; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--grey-200); margin-bottom: 24px; }
.tab {
  padding: 10px 16px; background: transparent; border: 0; border-bottom: 2px solid transparent;
  font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--grey-500);
  cursor: pointer; transition: all 120ms ease; margin-bottom: -1px;
}
.tab:hover { color: var(--indigo); }
.tab.active { color: var(--indigo); border-bottom-color: var(--indigo); }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { display: none; }
.switch .slider {
  position: absolute; inset: 0; background: var(--grey-200);
  border-radius: 999px; cursor: pointer; transition: all 200ms ease;
}
.switch .slider::before {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; background: white; border-radius: 50%;
  transition: all 200ms ease; box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.switch input:checked + .slider { background: var(--indigo); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* Sidebar nav (legacy home.html sidebar replaced by left rail; this kills it) */
.main-sidebar { display: none !important; }
.main-header { display: none !important; }
.main-footer { display: none !important; }
.wrapper { display: contents !important; }

/* Live pill */
.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--teal-soft); color: #0f766e;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.live-pill::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--teal);
  box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.6); animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(20, 184, 166, 0); }
  100% { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0); }
}

/* ============================================================
   Feature help — inline hints + hover info chips
   ------------------------------------------------------------
   Two complementary patterns so an operator can always tell what
   a feature does and why it matters:

   1. Always-visible helper text under a section/card title or a
      form-field label:
        <div class="section-hint">One line on what this section is for.</div>
        <span class="field-hint">What to type here / why it matters.</span>

   2. A hover/focus info chip (ⓘ) next to a control or column that
      reveals a styled tooltip. Works on ANY element via data-tip —
      the floating tooltip is rendered on <body> by the shared
      helper in _admin_shell::topbar, so it never clips inside a
      scrolling card or the rail:
        <span class="help-chip" tabindex="0"
              data-tip="Plain-English explanation."></span>
        <button class="btn" data-tip="What this button does">…</button>
   ============================================================ */

/* Helper copy under a section/card title (always visible). */
.section-hint {
  margin-top: 4px;
  font-size: 12.5px; line-height: 1.45;
  color: var(--grey-500); font-weight: 400;
  max-width: 72ch;
}

/* Helper copy under a form-field label / input (always visible). */
.field-hint {
  display: block; margin-top: 5px;
  font-size: 11.5px; line-height: 1.4;
  color: var(--grey-400); font-weight: 400;
}

/* The ⓘ chip — empty markup; glyph drawn via ::before. */
.help-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 6px; vertical-align: middle;
  border-radius: 50%; background: var(--grey-200); color: var(--grey-700);
  font-family: var(--font-display); font-weight: 800; font-size: 10px; line-height: 1;
  cursor: help; user-select: none; flex: 0 0 auto;
  transition: background 150ms ease, color 150ms ease;
}
.help-chip::before { content: "i"; font-style: normal; }
.help-chip:hover, .help-chip:focus-visible { background: var(--indigo); color: #fff; outline: none; }
/* Slightly muted chip for table-header use so it doesn't shout. */
th .help-chip { background: var(--grey-100); }

/* Floating tooltip element (single instance, appended to <body>). */
.tk-tip {
  position: fixed; z-index: 99999; pointer-events: none; display: none;
  max-width: 280px; background: var(--grey-900); color: #fff;
  font-family: var(--font-body); font-size: 11.5px; line-height: 1.45; font-weight: 500;
  padding: 8px 10px; border-radius: 8px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}
