/* ============================================================
   Maintenance Scheduler — Design System "Horizon"
   Light, card-forward control console: white surfaces, a warm
   neutral page background, a signal-blue accent, horizontal
   top navigation. Icon-square KPI cards with trend indicators.
============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #F5F6F9;
  --surface: #FFFFFF;
  --surface-alt: #F1F3F7;
  --border: #E7E9EF;
  --border-strong: #D6D9E2;

  --text: #171923;
  --text-secondary: #5B5F70;
  --text-muted: #8A8FA0;

  --nav-bg: #FFFFFF;
  --nav-border: #EAEBF1;

  --accent: #2F6FED;
  --accent-dark: #1E56D6;
  --accent-soft: #EAF1FE;
  --accent-ring: rgba(47, 111, 237, 0.20);

  --success: #12A150;
  --success-bg: #E7F8EE;
  --success-border: #C6EBD5;
  --danger: #E13A4B;
  --danger-bg: #FDEAEC;
  --danger-border: #F6C9CF;
  --warning: #D97A0A;
  --warning-bg: #FDF1DF;
  --warning-border: #F3DBAA;
  --purple: #7C4FE0;
  --purple-bg: #F0EBFC;
  --purple-border: #DECBF5;

  --icon-blue: #2F6FED; --icon-blue-bg: #E9F1FE;
  --icon-green: #12A150; --icon-green-bg: #E7F8EE;
  --icon-orange: #E17A1F; --icon-orange-bg: #FDF0E3;
  --icon-purple: #7C4FE0; --icon-purple-bg: #F0EBFC;

  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(23, 25, 35, 0.05);
  --shadow: 0 2px 10px rgba(23, 25, 35, 0.06);
  --shadow-md: 0 10px 28px rgba(23, 25, 35, 0.09);
  --shadow-lg: 0 26px 64px rgba(23, 25, 35, 0.18);
  --font-display: 'Sora', 'Inter', sans-serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0E0F13;
  --surface: #17181E;
  --surface-alt: #1F2129;
  --border: #292B35;
  --border-strong: #383A46;

  --text: #EDEDF2;
  --text-secondary: #A3A6B5;
  --text-muted: #6E7180;

  --nav-bg: #14151A;
  --nav-border: #23252E;

  --accent: #5B8CF5;
  --accent-dark: #4574E0;
  --accent-soft: rgba(91, 140, 245, 0.16);
  --accent-ring: rgba(91, 140, 245, 0.30);

  --success: #34D67C;
  --success-bg: rgba(52, 214, 124, 0.13);
  --success-border: rgba(52, 214, 124, 0.30);
  --danger: #FF6273;
  --danger-bg: rgba(255, 98, 115, 0.13);
  --danger-border: rgba(255, 98, 115, 0.30);
  --warning: #FFB443;
  --warning-bg: rgba(255, 180, 67, 0.13);
  --warning-border: rgba(255, 180, 67, 0.30);
  --purple: #C39CF2;
  --purple-bg: rgba(195, 156, 242, 0.14);
  --purple-border: rgba(195, 156, 242, 0.30);

  --icon-blue: #5B8CF5; --icon-blue-bg: rgba(91,140,245,0.16);
  --icon-green: #34D67C; --icon-green-bg: rgba(52,214,124,0.14);
  --icon-orange: #F0983C; --icon-orange-bg: rgba(240,152,60,0.15);
  --icon-purple: #C39CF2; --icon-purple-bg: rgba(195,156,242,0.15);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.32);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 26px 64px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
html { -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; font-family: var(--font-ui); background: var(--bg); color: var(--text);
  font-size: 14px; -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
a { color: inherit; }
code, .mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }
hr.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}

/* ---------- Top navigation (horizontal) ---------- */
.topnav { background: var(--nav-bg); border-bottom: 1px solid var(--nav-border); position: sticky; top: 0; z-index: 60; }
.topnav-inner { max-width: 1500px; margin: 0 auto; display: flex; align-items: center; gap: 20px; padding: 0 28px; height: 64px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent) 0%, #1B3FA8 100%);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(47,111,237,0.28);
}
.brand-mark-img { object-fit: cover; background: var(--surface); padding: 3px; }
.brand-mark-lg { width: 48px; height: 48px; border-radius: 13px; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--text); letter-spacing: -0.01em; line-height: 1.25; }
.brand-sub { font-size: 10.5px; color: var(--text-muted); font-family: var(--font-mono); letter-spacing: 0.02em; }

.topnav-items { display: flex; align-items: center; gap: 3px; flex: 1; min-width: 0; }
.topnav-items > a, .nav-dropdown > summary {
  display: flex; align-items: center; gap: 7px; text-decoration: none; cursor: pointer;
  color: var(--text-secondary); font-size: 13.3px; font-weight: 600;
  padding: 8px 13px; border-radius: 9px; border: 1px solid transparent;
  white-space: nowrap; list-style: none;
  transition: background 0.14s var(--ease), color 0.14s var(--ease), border-color 0.14s var(--ease);
}
.nav-dropdown > summary::-webkit-details-marker { display: none; }
.topnav-items > a .icon, .nav-dropdown > summary .icon { opacity: 0.8; }
.topnav-items > a:hover, .nav-dropdown > summary:hover { background: var(--surface-alt); color: var(--text); }
.topnav-items > a.active, .nav-dropdown > summary.active {
  background: var(--accent-soft); color: var(--accent); border-color: var(--accent-ring);
}
.topnav-items > a.active .icon, .nav-dropdown > summary.active .icon { opacity: 1; color: var(--accent); }
.nav-dropdown { position: relative; }
.nav-dropdown .chevron { width: 12px; height: 12px; opacity: 0.6; transition: transform 0.18s var(--ease); }
.nav-dropdown[open] .chevron { transform: rotate(180deg); }
.dropdown-panel {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 210px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: 6px; z-index: 70;
  animation: dropdown-in 0.16s var(--ease) both;
}
.dropdown-panel-right { left: auto; right: 0; }
@keyframes dropdown-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.dropdown-panel a {
  display: flex; align-items: center; gap: 9px; padding: 8px 11px; border-radius: 7px;
  font-size: 13px; font-weight: 500; color: var(--text-secondary); text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.dropdown-panel a .icon { opacity: 0.75; width: 15px; }
.dropdown-panel a:hover { background: var(--surface-alt); color: var(--text); }
.dropdown-panel a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.dropdown-panel a.danger-link { color: var(--danger); }
.dropdown-panel a.danger-link:hover { background: var(--danger-bg); }

/* Higher specificity than ".topnav-items > a" (which would otherwise
   win and force these visible on desktop too) */
.topnav-items a.mobile-only-link { display: none; }

.topnav-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-secondary); display: flex; align-items: center;
  justify-content: center; cursor: pointer; text-decoration: none; position: relative;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: inline; }

.user-summary { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px !important; border: 1px solid var(--border) !important; background: var(--surface); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; flex-shrink: 0;
}
.user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.user-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.role-tag { font-size: 10px; color: var(--text-muted); text-transform: capitalize; }

.mobile-nav-toggle {
  display: none; background: var(--surface); border: 1px solid var(--border); color: var(--text);
  width: 36px; height: 36px; border-radius: var(--radius-sm); cursor: pointer;
  align-items: center; justify-content: center;
}
.mobile-nav-toggle svg { width: 18px; height: 18px; }

.content { max-width: 1500px; margin: 0 auto; padding: 30px 28px 60px; animation: page-in 0.3s var(--ease) both; }

.app-footer { border-top: 1px solid var(--border); background: var(--surface); }
.app-footer-inner {
  max-width: 1500px; margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-size: 12px; color: var(--text-muted);
}
.app-footer-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.app-footer .mono { font-family: var(--font-mono); color: var(--text-secondary); }
@media (max-width: 960px) {
  .app-footer-inner { flex-direction: column; align-items: flex-start; padding: 14px 16px; }
}
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 26px; gap: 16px; flex-wrap: wrap; }
.page-header .titles h1 { margin: 0 0 5px; }
.page-header .titles p { margin: 0; color: var(--text-secondary); font-size: 13.5px; }

h1 { font-family: var(--font-display); font-size: 23px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px; }
h2 { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text); margin: 0 0 12px; letter-spacing: -0.005em; }
h3 { font-family: var(--font-display); font-size: 13.5px; font-weight: 600; color: var(--text); margin: 20px 0 8px; }
p.section-sub { color: var(--text-secondary); font-size: 13px; margin: -8px 0 16px; }
.label-note { font-weight: 400; color: var(--text-muted); }

/* ---------- Flash / toast ---------- */
.flash {
  padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px;
  font-size: 13.5px; font-weight: 500; border: 1px solid transparent;
  display: flex; align-items: center; gap: 8px; animation: toast-in 0.3s var(--ease) both;
}
.flash-dismiss { animation: toast-out 0.4s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); max-height: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; } }
.flash.success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.flash.error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }

/* ---------- KPI stat cards (icon square + trend) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 26px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 20px; box-shadow: var(--shadow-sm);
  animation: card-in 0.4s var(--ease) both;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), border-color 0.15s var(--ease);
  display: flex; flex-direction: column; gap: 12px;
}
.cards .card:nth-child(1) { animation-delay: 0.02s; }
.cards .card:nth-child(2) { animation-delay: 0.06s; }
.cards .card:nth-child(3) { animation-delay: 0.10s; }
.cards .card:nth-child(4) { animation-delay: 0.14s; }
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card-icon-row { display: flex; align-items: center; justify-content: space-between; }
.card-icon {
  width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.card-icon svg { width: 19px; height: 19px; }
.card-icon.blue { background: var(--icon-blue-bg); color: var(--icon-blue); }
.card-icon.green { background: var(--icon-green-bg); color: var(--icon-green); }
.card-icon.orange { background: var(--icon-orange-bg); color: var(--icon-orange); }
.card-icon.purple { background: var(--icon-purple-bg); color: var(--icon-purple); }
.card .label { font-size: 12.5px; color: var(--text-secondary); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.card .value { font-family: var(--font-display); font-size: 27px; font-weight: 700; letter-spacing: -0.02em; }
.card.ok .value { color: var(--success); }
.card.bad .value { color: var(--danger); }
.card .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); display: inline-block; }
.card.ok .dot { background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); animation: pulse-dot-ok 1.8s infinite; }
.card.bad .dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); animation: pulse-dot-bad 1.4s infinite; }
.card-trend { display: flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; }
.card-trend.up { color: var(--success); }
.card-trend.down { color: var(--danger); }
.card-trend .trend-note { color: var(--text-muted); font-weight: 500; }

/* ---------- Tables ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; overflow-y: hidden; box-shadow: var(--shadow-sm); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table-wrap table { border: none; border-radius: 0; box-shadow: none; }
th, td { text-align: left; padding: 13px 16px; font-size: 13.5px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
td.cell-truncate, td:has(> *) { white-space: normal; }
th { background: var(--surface-alt); color: var(--text-muted); font-weight: 700; font-size: 10.6px; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: var(--surface-alt); }
tr:last-child td { border-bottom: none; }
td.mono, .cell-mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-secondary); }
td.cell-truncate { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.empty-row { color: var(--text-muted); text-align: center; padding: 44px 16px; white-space: normal; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 4px; }
th.sortable .sort-arrow { width: 10px; height: 10px; opacity: 0.35; }
th.sortable.active .sort-arrow { opacity: 1; color: var(--accent); }
tbody tr.clickable-row { cursor: pointer; }
tbody tr.row-selected { background: var(--accent-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--accent-dark); background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.08s var(--ease), border-color 0.15s ease;
  font-family: inherit; white-space: nowrap;
}
.btn:hover { background: var(--accent-dark); box-shadow: 0 6px 18px rgba(47,111,237,0.28); transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn.secondary:hover { background: var(--surface-alt); border-color: var(--text-muted); box-shadow: var(--shadow-sm); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.danger:hover { filter: brightness(1.08); box-shadow: 0 6px 18px rgba(225,58,75,0.28); }
.btn.small { padding: 6px 12px; font-size: 12px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; border: 1px solid transparent; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.badge.success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.badge.success::before { background: var(--success); }
.badge.failed { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.badge.failed::before { background: var(--danger); }
.badge.pending { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.badge.pending::before { background: var(--warning); }
.badge.custom { background: var(--purple-bg); color: var(--purple); border-color: var(--purple-border); }
.badge.custom::before { background: var(--purple); }
.badge.neutral { background: var(--surface-alt); color: var(--text-secondary); border-color: var(--border); }
.badge.neutral::before { background: var(--text-muted); }
.badge.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-ring); }
.badge.active::before { background: var(--accent); animation: pulse-dot-ok 1.8s infinite; }
.badge.inactive { background: var(--surface-alt); color: var(--text-muted); border-color: var(--border); }
.badge.inactive::before { background: var(--text-muted); }

@keyframes pulse-dot-ok { 0% { box-shadow: 0 0 0 0 rgba(18, 161, 80, 0.4); } 70% { box-shadow: 0 0 0 5px rgba(18, 161, 80, 0); } 100% { box-shadow: 0 0 0 0 rgba(18, 161, 80, 0); } }
@keyframes pulse-dot-bad { 0% { box-shadow: 0 0 0 0 rgba(225, 58, 75, 0.4); } 70% { box-shadow: 0 0 0 5px rgba(225, 58, 75, 0); } 100% { box-shadow: 0 0 0 0 rgba(225, 58, 75, 0); } }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

/* ---------- Forms ---------- */
form.stacked label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); margin: 16px 0 6px; }
form.stacked label:first-child { margin-top: 0; }
form.stacked input[type=text], form.stacked input[type=number], form.stacked input[type=email],
form.stacked input[type=password], form.stacked input[type=datetime-local], form.stacked input[type=file], form.stacked select, form.stacked textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: inherit; color: var(--text); background: var(--surface);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
form.stacked input:focus, form.stacked select:focus, form.stacked textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
form.stacked textarea { resize: vertical; font-family: var(--font-mono); font-size: 12.5px; }
form.stacked input[name="url"], form.stacked input[name="cron_expr"] { font-family: var(--font-mono); font-size: 13px; }
form.stacked .hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; line-height: 1.55; }
form.stacked .hint a { color: var(--accent); font-weight: 600; }
form.stacked .row { display: flex; gap: 16px; }
form.stacked .row > div { flex: 1; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-top: 18px; cursor: pointer; }
.checkbox-row input { width: auto !important; }
.form-card { background: var(--surface); border: 1px solid var(--border); padding: 26px 28px; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.form-card h2 { font-size: 15.5px; margin-bottom: 4px; }
.form-eyebrow {
  font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em;
  margin: 28px 0 4px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
form.stacked .form-eyebrow:first-child { margin-top: 0; }

/* ---------------------------------------------------------
   FORM PAGE HEADER — icon badge + title/subtitle + Back button
   (used at the top of every create/edit form, e.g. task_form.php)
--------------------------------------------------------- */
.form-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.form-page-header .heading-row { display: flex; align-items: center; gap: 14px; }
.form-page-icon {
  width: 46px; height: 46px; border-radius: 13px; background: var(--icon-purple-bg); color: var(--icon-purple);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.form-page-icon svg { width: 22px; height: 22px; }
.form-page-header h1 { margin: 0; }
.form-page-header .titles p { margin: 2px 0 0; color: var(--text-secondary); font-size: 13px; }
.back-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); text-decoration: none;
  font-size: 13px; font-weight: 600; transition: border-color 0.14s ease, background 0.14s ease;
}
.back-btn:hover { background: var(--surface-alt); border-color: var(--text-muted); }
.back-btn svg { width: 15px; height: 15px; }

/* ---------------------------------------------------------
   FORM SECTIONS — colored bar + bold title, grouping related
   fields inside one card (Schedule Information / Timing / etc.)
--------------------------------------------------------- */
.section-title-bar {
  display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 14.5px;
  font-weight: 700; color: var(--text); margin: 30px 0 18px;
}
.section-title-bar:first-child { margin-top: 0; }
.section-title-bar::before { content: ''; width: 4px; height: 17px; border-radius: 3px; background: var(--accent); flex-shrink: 0; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px 20px; }
.field-grid + .section-title-bar, .field-grid + hr.divider { margin-top: 30px; }

.field { display: flex; flex-direction: column; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.field label .required-mark { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; line-height: 1.5; }

/* Icon-prefixed input: an icon sits inside the left edge of the field */
.input-icon { position: relative; }
.input-icon .field-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none; display: flex; z-index: 1;
}
.input-icon .field-icon svg { width: 15px; height: 15px; }
.input-icon input, .input-icon select, .input-icon textarea { padding-left: 36px !important; }
.input-icon select { background-position: right 11px center, 12px center; }
.input-icon textarea { padding-top: 9px !important; }
.input-icon .field-icon.top { top: 15px; transform: none; }

/* ---------------------------------------------------------
   FORM BOTTOM ACTION BAR — Reset (left) / secondary + primary
   (right), sticky to the bottom of the form card
--------------------------------------------------------- */
.form-actions-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--border); flex-wrap: wrap;
}
.form-actions-bar .right-group { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.gradient { background: linear-gradient(90deg, var(--accent) 0%, #7C4FE0 100%); border: none; }
.btn.gradient:hover { filter: brightness(1.06); box-shadow: 0 8px 20px rgba(47,111,237,0.30); }

.rule-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; animation: rule-in 0.2s var(--ease) both; flex-wrap: wrap; }
@keyframes rule-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: translateX(0); } }
.rule-row input { flex: 1; min-width: 140px; }
.time-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; animation: rule-in 0.2s var(--ease) both; }
.time-row select, form.stacked .time-row select { width: 76px; flex: none; }
.time-sep { font-weight: 700; color: var(--text-muted); }

.task-check-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; background: var(--surface-alt); }
.checklist-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.link-btn { background: none; border: none; padding: 0; color: var(--accent); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }
.checklist-toolbar .dim { color: var(--text-muted); font-size: 12px; }
.task-check-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 13px; border-radius: 6px; cursor: pointer; transition: background 0.12s ease; }
.task-check-row:hover { background: var(--surface); }
.task-check-row input { width: auto; }
.task-check-row.disabled { cursor: not-allowed; color: var(--text-muted); opacity: 0.65; }
.task-check-row.disabled:hover { background: none; }
.not-configured { margin-left: auto; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); padding: 1px 7px; border-radius: 999px; }
.channel-check-list { display: flex; flex-direction: column; gap: 2px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-alt); }
.channel-check-list .task-check-row { padding: 7px 10px; }

/* ---------- Login (split-screen) ---------- */
.login-page { display: flex; align-items: stretch; justify-content: center; min-height: 100vh; background: var(--surface); padding: 0; }
.login-split { display: flex; width: 100%; max-width: 1180px; margin: auto; box-shadow: var(--shadow-lg); border-radius: 22px; overflow: hidden; min-height: 620px; animation: login-in 0.5s var(--ease) both; }
@keyframes login-in { from { opacity: 0; transform: translateY(14px) scale(0.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
.login-panel-dark {
  flex: 1.05; background: radial-gradient(circle at 20% 15%, #22348C 0%, #0E1B4D 45%, #0A1436 100%);
  color: #fff; padding: 46px 44px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden; min-width: 0;
}
.login-panel-dark::before, .login-panel-dark::after {
  content: ''; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,0.08);
}
.login-panel-dark::before { width: 480px; height: 480px; right: -180px; bottom: -160px; }
.login-panel-dark::after { width: 320px; height: 320px; right: -80px; bottom: -60px; border-color: rgba(255,255,255,0.06); }
.login-brand-row { display: flex; align-items: center; gap: 11px; position: relative; z-index: 1; }
.login-panel-dark .brand-name { color: #fff; font-size: 17px; }
.login-panel-dark .brand-sub { color: rgba(255,255,255,0.55); }
.login-headline { position: relative; z-index: 1; margin: 40px 0 0; }
.login-headline h1 { font-family: var(--font-display); font-size: 24px; line-height: 1.3; margin: 0 0 14px; color: #fff; letter-spacing: -0.01em; white-space: nowrap; }
.login-headline h1 .accent-word { background: linear-gradient(90deg, #8FB3FF, #C9A9FA); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-headline p { font-size: 13.5px; color: rgba(255,255,255,0.62); line-height: 1.6; max-width: 320px; }
.login-illustration { position: relative; z-index: 1; margin-top: 34px; }

.login-panel-light { flex: 1; background: var(--surface); padding: 46px 44px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.login-panel-light h1 { font-size: 21px; margin-bottom: 4px; }
.login-panel-light .login-sub { color: var(--text-secondary); font-size: 13px; margin-bottom: 26px; }
.login-panel-light form.stacked { max-width: 360px; }
.login-panel-light .btn { width: 100%; justify-content: center; padding: 11px; margin-top: 6px; background: linear-gradient(90deg, var(--accent) 0%, #7C4FE0 100%); border: none; }
.login-panel-light .btn:hover { filter: brightness(1.06); box-shadow: 0 8px 22px rgba(47,111,237,0.32); }
.login-panel-light .hint { text-align: center; margin-top: 20px; color: var(--text-muted); font-size: 12px; }
.login-panel-light .hint code { background: var(--surface-alt); padding: 2px 6px; border-radius: 4px; color: var(--accent); }

.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.schedule-fields { display: none; }
.schedule-fields.active { display: block; animation: fade-slide 0.2s var(--ease) both; }
@keyframes fade-slide { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.pagination { margin-top: 16px; display: flex; gap: 6px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 6px 12px; border-radius: var(--radius-sm); font-size: 12.5px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-secondary);
  font-family: var(--font-mono); transition: border-color 0.12s ease;
}
.pagination a:hover { border-color: var(--border-strong); }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent-dark); font-weight: 600; }

.filters { display: flex; gap: 12px; margin-bottom: 18px; align-items: flex-end; flex-wrap: wrap; }
.filters label { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.filters select, .filters input[type=text] {
  padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; color: var(--text); background: var(--surface);
  min-width: 180px; height: 36px; box-sizing: border-box; transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.filters select:hover, .filters input[type=text]:hover { border-color: var(--text-muted); }
.filters input[type=text]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.filters .btn { height: 36px; }
.two-col { display: flex; gap: 24px; flex-wrap: wrap; }
.two-col > div { flex: 1; min-width: 320px; }
.cron-note { background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; font-family: var(--font-mono); font-size: 12.5px; color: var(--text-secondary); overflow-x: auto; white-space: pre; }

.bulk-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--accent-soft); border: 1px solid var(--accent-ring); border-radius: var(--radius-sm);
  padding: 0 14px; margin-bottom: 0; font-size: 13px; font-weight: 500; color: var(--accent);
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.25s var(--ease), opacity 0.2s var(--ease), padding 0.25s var(--ease), margin 0.25s var(--ease);
}
.bulk-bar.visible { max-height: 80px; opacity: 1; padding: 10px 14px; margin-bottom: 14px; }

.tag-chip {
  display: inline-block; background: var(--surface-alt); border: 1px solid var(--border); color: var(--text-secondary);
  font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-right: 4px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
tr.group-row td {
  background: var(--surface-alt); font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em; padding: 8px 16px; border-bottom: 1px solid var(--border);
}
tr.group-row:first-child td { border-top: none; }

/* ---------- Chart card + uptime bars ---------- */
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 24px 16px; box-shadow: var(--shadow-sm); }
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.bar { width: 100%; border-radius: 5px 5px 0 0; min-height: 4px; height: 0; transition: height 0.6s var(--ease), opacity 0.15s ease; animation: bar-grow 0.7s var(--ease) both; }
@keyframes bar-grow { from { height: 0; } }
.bar-col:hover .bar { opacity: 0.75; }
.bar.good { background: var(--success); }
.bar.warn { background: var(--warning); }
.bar.bad { background: var(--danger); }
.bar.empty { background: var(--border-strong); }
.bar-label { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); }

/* ---------- Response viewer (logs) ---------- */
.log-error { color: var(--danger); font-size: 12px; font-family: var(--font-mono); margin-bottom: 4px; max-width: 320px; white-space: normal; }
.response-details summary { cursor: pointer; font-size: 12px; color: var(--accent); font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 4px; }
.response-details summary::before { content: '▸'; transition: transform 0.15s ease; font-size: 10px; }
.response-details[open] summary::before { transform: rotate(90deg); }
.response-details summary::-webkit-details-marker { display: none; }
.response-pre {
  margin: 8px 0 0; padding: 10px 12px; background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 11.5px; max-width: 380px; max-height: 180px; overflow: auto;
  white-space: pre-wrap; word-break: break-word; color: var(--text-secondary);
}

/* ---------- API docs ---------- */
.docs-layout { display: flex; gap: 32px; align-items: flex-start; }
.docs-nav { width: 168px; flex-shrink: 0; position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; }
.docs-nav a { padding: 7px 10px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text-secondary); font-size: 13px; font-weight: 500; transition: background 0.12s ease, color 0.12s ease; }
.docs-nav a:hover { background: var(--surface-alt); color: var(--text); }
.docs-content { flex: 1; min-width: 0; max-width: 720px; }
.docs-content section { margin-bottom: 36px; scroll-margin-top: 84px; }
.docs-content p { font-size: 13.5px; line-height: 1.65; color: var(--text-secondary); }
.docs-content code { background: var(--surface-alt); border: 1px solid var(--border); padding: 1px 6px; border-radius: 4px; font-size: 12px; color: var(--accent); }
.code-block {
  position: relative; background: #14151A; color: #E4E2EA; font-family: var(--font-mono); font-size: 12.5px;
  padding: 16px 16px 14px; border-radius: var(--radius-sm); overflow-x: auto; white-space: pre;
  margin: 10px 0 14px; line-height: 1.6; border: 1px solid #24252E;
}
.code-block::before {
  content: attr(data-label); display: block; font-size: 10px; color: #75778A; text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 8px; font-family: var(--font-ui); font-weight: 600;
}
.code-block .tok { color: #9BB7FF; }
.docs-table { width: 100%; border-collapse: collapse; margin: 10px 0 14px; }
.docs-table th, .docs-table td { text-align: left; padding: 9px 12px; font-size: 12.5px; border-bottom: 1px solid var(--border); white-space: normal; }
.docs-table th { color: var(--text-muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; }

/* ---------- Custom select styling ---------- */
select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A8FA0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 15px;
  padding: 7px 34px 7px 11px !important; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background-color: var(--surface); color: var(--text); font-family: inherit; font-size: 13px; line-height: 1.4;
  min-height: 34px; cursor: pointer; transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
select:hover { border-color: var(--text-muted); }
select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
select::-ms-expand { display: none; }
select:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- Icon sizing ---------- */
.icon svg { width: 16px; height: 16px; display: block; }
.icon.icon-sm svg { width: 12px; height: 12px; }
.theme-icon-light svg, .theme-icon-dark svg { width: 15px; height: 15px; }

/* ---------- Notification channel cards ---------- */
.channel-grid form { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.channel-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.channel-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.channel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.channel-head h3 { margin: 0; flex: 1; font-size: 13.5px; }
.channel-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.channel-dot.slack { background: #ECB22E; }
.channel-dot.discord { background: #5865F2; }
.channel-dot.telegram { background: #29A9EA; }
.channel-dot.whatsapp { background: #25D366; }
.channel-dot.generic { background: var(--text-muted); }

/* ---------- Toggle switch ---------- */
.switch { position: relative; display: inline-block; width: 36px; height: 21px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; cursor: pointer; transition: background 0.2s var(--ease); }
.switch-track::before { content: ''; position: absolute; width: 15px; height: 15px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform 0.2s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::before { transform: translateX(15px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

.logo-preview { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-alt); }
.logo-preview img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: var(--surface); }

/* ---------------------------------------------------------
   GLOBAL CONFIRMATION MODAL — rendered once as a direct child
   of <body>, never inside an animated/transformed ancestor, so
   `position: fixed` always centers on the real viewport.
--------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 17, 25, 0.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity 0.18s var(--ease); padding: 20px;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 420px; max-width: 100%; padding: 26px 26px 22px;
  transform: translateY(10px) scale(0.98); transition: transform 0.18s var(--ease);
}
.modal-overlay.open .modal-box { transform: translateY(0) scale(1); }
.modal-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--danger-bg); color: var(--danger); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.modal-icon svg { width: 22px; height: 22px; }
.modal-box h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.modal-box p { font-size: 13.5px; color: var(--text-secondary); margin: 0 0 20px; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Large modal variant (field-testing popup, etc.) ---------- */
.modal-box-lg { width: 720px; max-width: 100%; max-height: 85vh; display: flex; flex-direction: column; padding: 0; }
.modal-box-lg .modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 26px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-box-lg .modal-header h3 { margin: 0; }
.modal-box-lg .modal-header p { margin: 3px 0 0; font-size: 12.5px; color: var(--text-secondary); }
.modal-box-lg .modal-close-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 6px; border-radius: 8px; flex-shrink: 0; }
.modal-box-lg .modal-close-btn:hover { background: var(--surface-alt); color: var(--text); }
.modal-box-lg .modal-close-btn svg { width: 16px; height: 16px; }
.modal-box-lg .modal-scroll-body { padding: 20px 26px; overflow-y: auto; flex: 1; }
.modal-box-lg .modal-footer { padding: 16px 26px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; background: var(--surface-alt); border-radius: 0 0 var(--radius-lg) var(--radius-lg); flex-wrap: wrap; gap: 10px; }

#sample-input {
  width: 100%; min-height: 130px; font-family: var(--font-mono); font-size: 12px; padding: 12px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  resize: vertical; line-height: 1.6;
}
#parse-error { font-size: 12px; color: var(--danger); margin-left: 10px; }
#results-count { font-size: 12px; color: var(--text-muted); margin: 14px 0 8px; }
#results-empty { text-align: center; padding: 26px 20px; color: var(--text-muted); font-size: 12.5px; }
.field-row-detected {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 7px; background: var(--surface); flex-wrap: wrap;
  animation: card-in 0.2s var(--ease) both;
}
.field-row-detected input.label-input {
  font-size: 12px; font-weight: 600; padding: 5px 8px; border: 1px solid var(--border-strong);
  border-radius: 6px; background: var(--surface); color: var(--text); width: 130px; flex-shrink: 0;
}
.field-row-detected .path-tag {
  font-family: var(--font-mono); font-size: 10.5px; background: var(--surface-alt); color: var(--accent);
  padding: 3px 7px; border-radius: 5px; flex-shrink: 0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.field-row-detected .sample-val { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); flex: 1; min-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-row-detected .type-pill { font-size: 9px; font-weight: 700; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; flex-shrink: 0; }
.type-pill.scalar { background: var(--icon-blue-bg); color: var(--icon-blue); }
.type-pill.array { background: var(--icon-purple-bg); color: var(--icon-purple); }
.remove-field-btn { margin-left: auto; background: none; border: none; color: var(--text-muted); cursor: pointer; width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0; font-size: 14px; }
.remove-field-btn:hover { background: var(--danger-bg); color: var(--danger); }
.array-subfields { display: flex; flex-wrap: wrap; gap: 4px; }
.array-subfields span { background: var(--surface-alt); border: 1px solid var(--border); font-family: var(--font-mono); font-size: 10px; padding: 2px 6px; border-radius: 4px; }

.fields-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.field-badge-mini { font-size: 11.5px; background: var(--accent-soft); color: var(--accent); padding: 4px 10px; border-radius: 999px; font-weight: 600; }

/* ---------- Live Task Responses report ---------- */
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); display: inline-block; margin-right: 8px; animation: pulse-dot-ok 1.8s infinite; }
.field-badge {
  display: inline-flex; align-items: center; gap: 4px; background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 9px; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-secondary); margin: 2px 4px 2px 0;
}
.field-badge b { color: var(--text); font-weight: 700; }

@media (max-width: 960px) {
  .modal-box-lg { width: 100%; max-height: 92vh; }
}

.drawer-overlay { position: fixed; inset: 0; background: rgba(15, 17, 25, 0.45); z-index: 190; opacity: 0; pointer-events: none; transition: opacity 0.2s var(--ease); }
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: 380px; max-width: 92vw; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.25s var(--ease); }
.drawer-overlay.open .drawer-panel { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.drawer-header h3 { margin: 0; font-size: 15px; }
.drawer-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 6px; }
.drawer-close:hover { background: var(--surface-alt); color: var(--text); }
.drawer-close svg { width: 18px; height: 18px; }
.drawer-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.drawer-row { padding: 12px 0; border-bottom: 1px solid var(--border); }
.drawer-row:last-child { border-bottom: none; }
.drawer-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 5px; }
.drawer-value { font-size: 13.5px; color: var(--text); word-break: break-word; line-height: 1.5; white-space: pre-wrap; }
.drawer-value.mono { font-family: var(--font-mono); font-size: 12.5px; }

/* ---------- Dashboard-specific: activity list + circular gauge ---------- */
.activity-list { display: flex; flex-direction: column; }
.activity-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.activity-row:last-child { border-bottom: none; }
.activity-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.activity-icon svg { width: 16px; height: 16px; }
.activity-body { flex: 1; min-width: 0; }
.activity-title { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

.gauge-wrap { display: flex; flex-direction: column; align-items: center; padding: 6px 0 4px; }
.gauge-value { font-family: var(--font-display); font-size: 27px; font-weight: 800; margin-top: -74px; }
.gauge-caption { font-size: 12px; color: var(--text-secondary); margin-top: 82px; font-weight: 600; }

.resource-list { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.resource-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.8px; }
.resource-row .r-label { display: flex; align-items: center; gap: 7px; color: var(--text-secondary); font-weight: 500; }
.resource-row .r-label .icon { opacity: 0.7; }
.resource-row .r-val { font-weight: 700; color: var(--text); font-family: var(--font-mono); font-size: 12px; }

.mini-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.mini-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.mini-card-head h2 { margin: 0; }
.mini-card-head a { font-size: 12.5px; font-weight: 600; color: var(--accent); text-decoration: none; }
.mini-card-head a:hover { text-decoration: underline; }

.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.quick-action { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; border-radius: var(--radius); background: var(--surface-alt); border: 1px solid var(--border); text-decoration: none; color: var(--text); font-size: 12px; font-weight: 600; text-align: center; transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease); }
.quick-action:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.quick-action .card-icon { margin: 0; }

/* ============================================================
   RESPONSIVE — nav collapses into a dropdown list below 960px;
   tables keep horizontal scroll; forms/filters go full-width.
============================================================ */
@media (max-width: 960px) {
  .topnav-inner { flex-wrap: nowrap; }
  .brand-sub { display: none; }
  .mobile-nav-toggle { display: inline-flex; order: 3; }
  .topnav-items {
    display: none; position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
    background: var(--nav-bg); flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px; overflow-y: auto; z-index: 55; border-top: 1px solid var(--nav-border);
  }
  .topnav-items.open { display: flex; }
  .topnav-items > a, .nav-dropdown > summary { padding: 11px 14px; }
  .nav-dropdown { width: 100%; }
  .dropdown-panel { position: static; box-shadow: none; border: none; padding: 2px 0 2px 14px; margin-top: 2px; width: 100%; animation: none; }
  .topnav-items a.mobile-only-link { display: flex; }
  .user-dropdown { display: none; }
  .topnav-actions .icon-btn:first-child { display: none; }

  .content { padding: 18px 16px 40px; }
  h1 { font-size: 20px; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header > .btn, .page-header > a.btn { align-self: flex-start; }

  .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card { padding: 14px 15px; }
  .card .value { font-size: 21px; }

  .filters { flex-direction: column; align-items: stretch; }
  .filters > div { width: 100%; }
  .filters select, .filters input[type=text] { width: 100%; min-width: 0; }

  .two-col { flex-direction: column; }
  .two-col > div { min-width: 0; }

  form.stacked .row { flex-direction: column; gap: 0; }
  .form-card { padding: 20px; }

  .modal-box { width: 100%; }
  .drawer-panel { width: 100%; max-width: 100%; }

  .docs-layout { flex-direction: column; }
  .docs-nav { position: static; width: 100%; flex-direction: row; flex-wrap: wrap; }

  .actions-cell { width: 100%; }
  .bulk-bar.visible { flex-direction: column; align-items: flex-start; }

  .login-split { flex-direction: column; border-radius: 16px; min-height: 0; }
  .login-panel-dark { padding: 32px 26px; }
  .login-headline h1 { font-size: 19px; white-space: normal; }
  .login-panel-light { padding: 32px 26px; }
  .login-illustration { display: none; }
}

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