/* Limra Tech — Repair Logbook design tokens
   Light canvas, dark navy sidebar, bright blue accent (limratech.co.uk palette) */

:root {
  /* Surfaces — light canvas, dark sidebar exception is scoped below */
  --bg-0: #0F172A;          /* dark navy — used by sidebar / brand surfaces */
  --bg-1: #FFFFFF;          /* page canvas */
  --bg-2: #FFFFFF;          /* card */
  --bg-3: #F1F5F9;          /* hover / raised */
  --bg-4: #F8FAFC;          /* subtle / inputs */

  /* Lines — slate */
  --line-1: #E2E8F0;        /* hairline divider */
  --line-2: #CBD5E1;        /* default border */
  --line-3: #94A3B8;        /* hover / focus border */

  /* Text — slate on light */
  --fg-1: #0F172A;          /* primary */
  --fg-2: #334155;          /* secondary */
  --fg-3: #64748B;          /* tertiary / labels */
  --fg-4: #94A3B8;          /* muted / placeholder */

  /* Brand — Limra-Tech blue. Variable names kept as `amber-*` for compat. */
  --amber-50:  #EFF6FF;
  --amber-100: #DBEAFE;
  --amber-300: #60A5FA;
  --amber-400: #2C8FD9;
  --amber-500: #0075C1;     /* primary accent (limratech.co.uk blue) */
  --amber-600: #005EA0;
  --amber-700: #00497F;
  --amber-glow: rgba(0, 117, 193, 0.18);

  /* Status */
  --ok-500:    #16A34A;
  --ok-bg:     rgba(22, 163, 74, 0.10);
  --warn-500:  #D97706;
  --warn-bg:   rgba(217, 119, 6, 0.10);
  --err-500:   #DC2626;
  --err-bg:    rgba(220, 38, 38, 0.10);
  --info-500:  #0284C7;
  --info-bg:   rgba(2, 132, 199, 0.10);

  /* Type */
  --font-sans: "IBM Plex Sans", "Inter", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;
  --font-display: "IBM Plex Sans", system-ui, sans-serif;

  /* Shadows for light theme */
  --shadow-1: 0 1px 0 rgba(255,255,255,0.6) inset, 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-2: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -8px rgba(15, 23, 42, 0.10);
  --shadow-pop: 0 12px 40px -12px rgba(15, 23, 42, 0.18), 0 0 0 1px var(--line-2);

  /* Radius */
  --r-1: 4px;
  --r-2: 6px;
  --r-3: 10px;
  --r-4: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-1);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

#root { min-height: 100vh; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; border: 2px solid var(--bg-1); }
::-webkit-scrollbar-thumb:hover { background: var(--line-3); }

/* ==========================================================================
   App layout
   ========================================================================== */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top, rgba(0,117,193,0.04), transparent 60%),
    var(--bg-1);
}

/* ==========================================================================
   Sidebar — dark navy island in the otherwise light app
   ========================================================================== */
.sidebar {
  background: var(--bg-0);
  border-right: 1px solid #1E293B;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  color: rgba(255,255,255,0.78);
}
.sidebar__brand {
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar__brand .mark {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  display: grid; place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.1);
}
.sidebar__brand .mark img {
  width: 78%; height: 78%;
  object-fit: contain;
}
.sidebar__brand .name {
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 13px;
  color: #FFFFFF;
}
.sidebar__brand .name small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  font-weight: 500;
  margin-top: 1px;
}

.sidebar__section { padding: 14px 10px 6px; }
.sidebar__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.4);
  padding: 0 10px 6px;
  font-weight: 500;
}
.sidebar__nav { display: flex; flex-direction: column; gap: 1px; }

/* Default .navitem is light-theme (used by Settings sub-tabs in main canvas) */
.navitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-2);
  color: var(--fg-2);
  font-size: 13px;
  text-decoration: none;
  position: relative;
  transition: background 0.12s, color 0.12s;
  border: 1px solid transparent;
  background: transparent;
  font-family: inherit;
}
.navitem:hover { background: var(--bg-3); color: var(--fg-1); }
.navitem.active { background: var(--bg-3); color: var(--fg-1); border-color: var(--line-1); }
.navitem .icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.85; }
.navitem.active .icon { color: var(--amber-500); opacity: 1; }
.navitem .count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-3);
  border: 1px solid var(--line-1);
  padding: 1px 6px;
  border-radius: 99px;
  color: var(--fg-3);
}
.navitem.active .count { background: var(--amber-50); border-color: rgba(0,117,193,0.25); color: var(--amber-700); }

/* Sidebar-scoped overrides (dark theme) */
.sidebar .navitem { color: rgba(255,255,255,0.7); }
.sidebar .navitem:hover { background: rgba(255,255,255,0.06); color: #FFFFFF; }
.sidebar .navitem.active {
  background: rgba(255,255,255,0.08);
  color: #FFFFFF;
  border-color: rgba(255,255,255,0.05);
}
.sidebar .navitem.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 8px; bottom: 8px;
  width: 2px;
  background: var(--amber-500);
  border-radius: 0 2px 2px 0;
}
.sidebar .navitem.active .icon { color: var(--amber-300); }
.sidebar .navitem .count {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
}
.sidebar .navitem.active .count {
  background: rgba(0,117,193,0.25);
  border-color: rgba(0,117,193,0.45);
  color: #BFDBFE;
}

.sidebar__footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: var(--r-2);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}
.user-card .avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #475569, #1E293B);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  color: #FFFFFF;
  border: 1px solid rgba(255,255,255,0.1);
}
.user-card .meta { flex: 1; min-width: 0; }
.user-card .meta b { display: block; font-size: 12px; font-weight: 500; color: #FFFFFF; }
.user-card .meta span { font-size: 10px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.08em; }
.user-card .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ok-500);
  box-shadow: 0 0 0 2px rgba(34,197,94,0.18);
}

/* ==========================================================================
   Top bar
   ========================================================================== */
.topbar {
  height: 52px;
  border-bottom: 1px solid var(--line-1);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  padding: 0 22px;
  gap: 14px;
  position: sticky; top: 0; z-index: 10;
}
.crumb { display: flex; align-items: center; gap: 6px; color: var(--fg-3); font-size: 12px; }
.crumb b { color: var(--fg-1); font-weight: 500; }
.crumb .sep { opacity: 0.4; }

.topbar .search { margin-left: auto; width: 320px; position: relative; }
.topbar .search input {
  width: 100%;
  background: var(--bg-4);
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
  padding: 7px 10px 7px 32px;
  font-size: 12.5px;
  color: var(--fg-1);
  outline: none;
}
.topbar .search input:focus { border-color: var(--amber-500); background: var(--bg-2); box-shadow: 0 0 0 3px var(--amber-glow); }
.topbar .search .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--fg-4); width: 14px; height: 14px; }
.topbar .search kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-3);
  border: 1px solid var(--line-1);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--fg-3);
}

.topbar .icobtn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-2);
  color: var(--fg-2);
  position: relative;
}
.topbar .icobtn:hover { background: var(--bg-3); border-color: var(--line-1); color: var(--fg-1); }
.topbar .icobtn .badge-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--amber-500);
  box-shadow: 0 0 0 2px var(--bg-1);
}

/* ==========================================================================
   Main area
   ========================================================================== */
.main { display: flex; flex-direction: column; min-width: 0; }
.page { padding: 22px 28px 40px; max-width: 1480px; width: 100%; }

.page__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-1);
}
.page__title h1 { margin: 0 0 4px; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.page__title p { margin: 0; color: var(--fg-3); font-size: 13px; }
.page__actions { display: flex; gap: 8px; align-items: center; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--r-2);
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--fg-1);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  transition: background 0.12s, border-color 0.12s, transform 0.06s, box-shadow 0.12s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-3); border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 14px; height: 14px; }

.btn--primary {
  background: linear-gradient(180deg, var(--amber-500), var(--amber-600));
  border-color: var(--amber-700);
  color: #FFFFFF;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.20),
    0 1px 2px rgba(0,117,193,0.35);
  font-weight: 600;
}
.btn--primary:hover {
  background: linear-gradient(180deg, var(--amber-400), var(--amber-500));
  border-color: var(--amber-600);
  color: #FFFFFF;
}

.btn--ghost { background: transparent; border-color: transparent; color: var(--fg-2); }
.btn--ghost:hover { background: var(--bg-3); color: var(--fg-1); }

.btn--danger { color: var(--err-500); border-color: rgba(220,38,38,0.35); background: rgba(220,38,38,0.06); }
.btn--danger:hover { background: rgba(220,38,38,0.12); border-color: rgba(220,38,38,0.55); color: var(--err-500); }

.btn--sm { padding: 4px 8px; font-size: 11.5px; gap: 5px; }
.btn--lg { padding: 10px 16px; font-size: 13.5px; }
.btn--ico { padding: 6px; gap: 0; }

.btn-group {
  display: inline-flex;
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  overflow: hidden;
  background: var(--bg-2);
}
.btn-group .btn { border: none; border-radius: 0; background: transparent; }
.btn-group .btn + .btn { border-left: 1px solid var(--line-1); }
.btn-group .btn.is-on { background: var(--amber-50); color: var(--amber-700); }

/* ==========================================================================
   Inputs
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-3);
  font-weight: 600;
}
.input, .select, .textarea {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  padding: 8px 10px;
  font-size: 13px;
  color: var(--fg-1);
  outline: none;
  width: 100%;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-3); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--amber-500);
  box-shadow: 0 0 0 3px var(--amber-glow);
}
.input::placeholder, .textarea::placeholder { color: var(--fg-4); }
.input--mono { font-family: var(--font-mono); font-size: 12px; }
.textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%2364748B' stroke-width='1.5'%3E%3Cpath d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 28px;
}

.input-group {
  display: flex;
  align-items: stretch;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  overflow: hidden;
}
.input-group:focus-within { border-color: var(--amber-500); box-shadow: 0 0 0 3px var(--amber-glow); }
.input-group .ig-pre, .input-group .ig-post {
  display: flex; align-items: center; padding: 0 10px;
  font-size: 12px; color: var(--fg-3);
  background: var(--bg-4);
  border-right: 1px solid var(--line-1);
}
.input-group .ig-post { border-right: 0; border-left: 1px solid var(--line-1); }
.input-group .input { border: 0; background: transparent; border-radius: 0; }
.input-group .input:focus { box-shadow: none; }

/* Checkbox / switch */
.check {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--fg-2); cursor: pointer; user-select: none;
}
.check input { display: none; }
.check .box {
  width: 16px; height: 16px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--bg-2);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.check input:checked + .box {
  background: var(--amber-500);
  border-color: var(--amber-600);
}
.check input:checked + .box::after {
  content: "";
  width: 9px; height: 5px;
  border-left: 2px solid #FFFFFF;
  border-bottom: 2px solid #FFFFFF;
  transform: rotate(-45deg) translate(1px, -1px);
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-1);
}
.card__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-1);
  gap: 12px;
}
.card__head h3 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.01em; color: var(--fg-1); }
.card__head p { margin: 2px 0 0; font-size: 11.5px; color: var(--fg-3); }
.card__body { padding: 16px; }
.card__foot { padding: 12px 16px; border-top: 1px solid var(--line-1); display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* Stat card */
.stat {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-3);
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at top right, var(--amber-glow), transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.stat:hover::after { opacity: 1; }
.stat .label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--fg-3); font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.stat .label .icon { width: 13px; height: 13px; color: var(--amber-500); }
.stat .value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-feature-settings: "tnum";
  color: var(--fg-1);
}
.stat .delta { font-size: 11.5px; display: flex; align-items: center; gap: 5px; color: var(--fg-3); }
.stat .delta b { font-family: var(--font-mono); font-size: 11px; }
.stat .delta.up b { color: var(--ok-500); }
.stat .delta.down b { color: var(--err-500); }

/* ==========================================================================
   Badge / chip
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid;
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.badge--neutral { color: var(--fg-2); border-color: var(--line-2); background: var(--bg-3); }
.badge--neutral .dot { background: var(--fg-3); }
.badge--ok { color: #166534; border-color: rgba(22,163,74,0.3); background: var(--ok-bg); }
.badge--ok .dot { background: var(--ok-500); }
.badge--warn { color: #92400E; border-color: rgba(217,119,6,0.3); background: var(--warn-bg); }
.badge--warn .dot { background: var(--warn-500); }
.badge--err { color: #991B1B; border-color: rgba(220,38,38,0.3); background: var(--err-bg); }
.badge--err .dot { background: var(--err-500); }
.badge--info { color: #075985; border-color: rgba(2,132,199,0.3); background: var(--info-bg); }
.badge--info .dot { background: var(--info-500); }
.badge--accent { color: var(--amber-700); border-color: rgba(0,117,193,0.35); background: var(--amber-glow); }
.badge--accent .dot { background: var(--amber-500); }

.tag {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg-3);
  border: 1px solid var(--line-1);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--fg-2);
}

/* ==========================================================================
   Table
   ========================================================================== */
.table-wrap {
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-3);
  overflow: hidden;
}
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-3);
  font-weight: 600;
  background: var(--bg-4);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
  position: sticky; top: 0;
}
.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-1);
  vertical-align: middle;
  color: var(--fg-1);
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.1s; }
.table tbody tr:hover { background: var(--bg-3); cursor: pointer; }
.table tbody tr.is-active { background: var(--amber-50); box-shadow: inset 2px 0 0 var(--amber-500); }
.table .mono { font-family: var(--font-mono); font-size: 12px; color: var(--fg-2); }
.table .num { text-align: right; font-feature-settings: "tnum"; font-family: var(--font-mono); font-size: 12.5px; }

/* ==========================================================================
   Tabs
   ========================================================================== */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line-1);
  margin-bottom: 16px;
}
.tab {
  background: transparent;
  border: 0;
  color: var(--fg-3);
  font-size: 13px;
  padding: 8px 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.tab:hover { color: var(--fg-1); }
.tab.is-on { color: var(--amber-700); border-bottom-color: var(--amber-500); }
.tab .count {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-3);
  border: 1px solid var(--line-1);
  padding: 1px 6px;
  border-radius: 99px;
  color: var(--fg-3);
}

/* ==========================================================================
   Misc
   ========================================================================== */
.kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 5px;
  background: var(--bg-3);
  border: 1px solid var(--line-1);
  border-radius: 3px;
  color: var(--fg-2);
}

.divider { height: 1px; background: var(--line-1); }
.spacer { flex: 1; }

.hairline {
  background-image: repeating-linear-gradient(
    90deg, var(--line-1) 0 4px, transparent 4px 8px
  );
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 50%;
}

.code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-3);
  border: 1px solid var(--line-1);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--amber-700);
}

/* Avatar */
.avatar-circle {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber-400), var(--amber-600));
  border: 1px solid var(--amber-700);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  color: #FFFFFF;
  flex-shrink: 0;
}
.avatar-circle--sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar-circle--lg { width: 40px; height: 40px; font-size: 14px; }

/* Progress bar */
.bar { height: 6px; border-radius: 99px; background: var(--bg-3); overflow: hidden; border: 1px solid var(--line-1); }
.bar > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--amber-600), var(--amber-400));
  border-radius: 99px;
}

/* Grid utilities */
.grid { display: grid; gap: 16px; }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--main { grid-template-columns: 2fr 1fr; }

/* Splash / login bg */
.auth-bg {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 20%, rgba(0,117,193,0.10), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(15,23,42,0.06), transparent 50%),
    var(--bg-1);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.auth-bg::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line-1) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-1) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
  mask-image: radial-gradient(circle at center, black, transparent 70%);
  opacity: 0.6;
}

/* Status pill aligned to icon */
.status-row { display: flex; align-items: center; gap: 8px; }

/* Notice strip */
.notice {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-2);
  border: 1px solid;
  font-size: 12.5px;
}
.notice--info { background: var(--info-bg); border-color: rgba(2,132,199,0.3); color: #075985; }
.notice--warn { background: var(--warn-bg); border-color: rgba(217,119,6,0.3); color: #92400E; }
.notice--ok { background: var(--ok-bg); border-color: rgba(22,163,74,0.3); color: #166534; }
.notice--err { background: var(--err-bg); border-color: rgba(220,38,38,0.3); color: #991B1B; }

/* Empty / placeholder image area */
.placeholder-photo {
  background:
    repeating-linear-gradient(45deg, var(--bg-3) 0 8px, var(--bg-2) 8px 16px);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-2);
  display: grid; place-items: center;
  color: var(--fg-4);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ==========================================================================
   Modal
   ========================================================================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.45);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: grid; place-items: center;
  padding: 20px;
  animation: modal-fade-in 0.15s ease-out;
}
.modal {
  background: #FFFFFF;
  border: 1px solid var(--line-1);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  width: 100%;
  max-width: 520px;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 40px);
  overflow: hidden;
}
.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-1);
}
.modal__head h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--fg-1); }
.modal__body { padding: 18px; overflow-y: auto; flex: 1; }
.modal__foot { padding: 12px 18px; border-top: 1px solid var(--line-1); background: var(--bg-4); }
@keyframes modal-fade-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   Hamburger button (sidebar drawer trigger) — visible only on mobile
   ========================================================================== */
.menubtn {
  display: none;
  width: 32px; height: 32px;
  align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-2);
  color: var(--fg-1);
}
.menubtn:hover { background: var(--bg-3); border-color: var(--line-1); }
.sidebar-overlay { display: none; }

/* ==========================================================================
   Auth card (login layout) — class form so we can make it responsive
   ========================================================================== */
.auth-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  width: 940px;
  max-width: 94vw;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  overflow: hidden;
  background: #FFFFFF;
  box-shadow: 0 30px 80px -30px rgba(15,23,42,0.25);
}
.auth-card__brand {
  padding: 44px 40px;
  background: linear-gradient(160deg, #0F172A, #1E293B);
  color: #FFFFFF;
  display: flex; flex-direction: column; gap: 28px;
  position: relative; overflow: hidden;
}
.auth-card__form {
  padding: 44px 40px;
  display: flex; flex-direction: column; gap: 16px;
}

/* ==========================================================================
   Mobile / tablet breakpoints
   ========================================================================== */

/* Tablets and below */
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 260px;
    height: 100vh;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 0 0 40px rgba(15,23,42,0.4);
  }
  .sidebar.is-open { transform: translateX(0); }

  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15,23,42,0.45);
    z-index: 99;
    backdrop-filter: blur(2px);
  }
  .sidebar-overlay.is-on { display: block; }

  .menubtn { display: inline-flex; }

  .topbar { padding: 0 12px; gap: 8px; height: 50px; }
  .topbar .search { display: none; }

  .crumb { font-size: 11.5px; min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .page { padding: 16px 14px 40px; }
  .page__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 16px;
  }
  .page__title h1 { font-size: 20px; }
  .page__actions { flex-wrap: wrap; gap: 6px; }

  .grid--4 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid--3 { grid-template-columns: 1fr; }
  .grid--2 { grid-template-columns: 1fr; }
  .grid--main { grid-template-columns: 1fr; }

  .table th, .table td { padding: 8px 10px; font-size: 12.5px; }
  .table-wrap, .card { overflow-x: auto; }

  .stat .value { font-size: 22px; }

  /* Auth card stacks vertically; the brand panel shrinks */
  .auth-card { grid-template-columns: 1fr; width: 100%; max-width: 96vw; border-radius: 12px; }
  .auth-card__brand { padding: 28px 26px; gap: 18px; }
  .auth-card__brand .auth-card__hero { font-size: 22px !important; }
  .auth-card__brand .auth-card__lede { display: none; }
  .auth-card__brand .auth-card__stats { gap: 16px !important; flex-wrap: wrap; }
  .auth-card__form { padding: 28px 24px; gap: 14px; }
}

/* Phones */
@media (max-width: 520px) {
  .grid--4 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 12px; }
  .stat .value { font-size: 20px; }
  .stat .label { font-size: 10px; }

  .topbar .icobtn { width: 30px; height: 30px; }
  .topbar .crumb b { font-size: 12px; }

  .page__title h1 { font-size: 18px; }

  /* Make the breadcrumb show just the current page */
  .crumb a, .crumb .sep:first-of-type, .crumb a + .sep { display: none; }

  .auth-card__brand .auth-card__stats { font-size: 11px; }
}
