/* Symniq CRM — design system
   Top-navigation console layout: a dark header band carries the page title,
   and content cards overlap its lower edge. Palette is unchanged from the
   original sidebar design; only structure, shape and spacing differ. */

:root {
  --ink-950: #0b0f14;
  --ink-900: #10151c;
  --ink-800: #171e28;
  --ink-700: #212a37;
  --ink-600: #2c3646;
  --ink-500: #4a5568;
  --ink-400: #6b7686;
  --ink-300: #94a0b0;
  --ink-200: #c3cad4;
  --ink-100: #e6e9ed;
  --paper: #f5f6f8;
  --card: #ffffff;
  --line: #e2e5ea;

  --accent: #1f6f5c;
  --accent-dark: #175646;
  --accent-soft: #e5f2ee;
  --accent-ink: #0e3d33;

  --amber: #b6752b;
  --amber-soft: #faf1e3;
  --red: #b93a3a;
  --red-soft: #fbeaea;
  --blue: #2a5da8;
  --blue-soft: #e9f0fb;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(16, 21, 28, 0.05), 0 1px 1px rgba(16, 21, 28, 0.03);
  --shadow-2: 0 8px 28px rgba(16, 21, 28, 0.08), 0 2px 6px rgba(16, 21, 28, 0.04);
  --shadow-3: 0 18px 50px rgba(16, 21, 28, 0.16);

  --content-max: 1440px;
  --gutter: 32px;

  --font: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink-800);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Sidebar ---------- */
.app-shell { flex-direction: row; }

.app-sidebar {
  width: 256px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink-950);
  border-right: 1px solid rgba(255,255,255,0.06);
  z-index: 120;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}
.sidebar-brand { min-width: 0; }

.brand-mark,
.sidebar-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 15px; color: #fff; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--ink-400); font-weight: 500; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-section-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-500);
  font-weight: 700;
  padding: 16px 12px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  color: var(--ink-300);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link i { width: 16px; text-align: center; font-size: 13px; color: var(--ink-400); transition: color 0.15s ease; }

.nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-link:hover i { color: var(--ink-200); }

.nav-link.active {
  background: rgba(31, 111, 92, 0.35);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(127, 216, 189, 0.18);
}
.nav-link.active i { color: #7fd8bd; }

.sidebar-profile {
  margin: 14px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
}

.sidebar-profile-card {
  display: flex;
  align-items: center;
  gap: 11px;
}
.sidebar-profile-meta { min-width: 0; }

.header-user-name {
  font-size: 13px;
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-user-role { font-size: 11.5px; color: var(--ink-400); margin-top: 1px; }

.header-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ink-700);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--ink-950), 0 0 0 3px rgba(127, 216, 189, 0.35);
}

.sidebar-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  margin-bottom: 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--ink-200);
  font-size: 12.5px;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.sidebar-logout-btn:hover {
  background: rgba(185, 58, 58, 0.18);
  border-color: rgba(185, 58, 58, 0.45);
  color: #fff;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 20, 0.55);
  z-index: 110;
}

.page-head-title { display: flex; align-items: center; gap: 14px; }

/* ---------- Page head band ---------- */
.page-head {
  background: var(--ink-900);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.045) 1px, transparent 0);
  background-size: 22px 22px;
  padding: 30px 0 84px;
}

.page-head-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.topbar-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.025em;
  line-height: 1.15;
}
.topbar-subtitle { font-size: 13px; color: var(--ink-300); margin-top: 6px; max-width: 640px; }

.page-actions .btn-outline {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
  color: #fff;
}
.page-actions .btn-outline:hover:not(:disabled) {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.24);
}

.app-content {
  width: 100%;
  max-width: var(--content-max);
  margin: -60px auto 0;
  padding: 0 var(--gutter) 56px;
  flex: 1;
  position: relative;
}

/* ---------- Flash messages ---------- */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }

.flash {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  box-shadow: var(--shadow-2);
}

.flash-success { background: var(--accent-soft); color: var(--accent-ink); border-color: #c3e3d9; }
.flash-error { background: var(--red-soft); color: #7a2727; border-color: #f0c9c9; }
.flash-info { background: var(--blue-soft); color: #1d3f70; border-color: #c4d7f0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  line-height: 1;
  white-space: nowrap;
}

.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-solid {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(31, 111, 92, 0.25);
}
.btn-solid:hover:not(:disabled) { background: var(--accent-dark); }

.btn-outline {
  background: var(--card);
  color: var(--ink-700);
  border-color: var(--line);
}
.btn-outline:hover:not(:disabled) { background: var(--paper); border-color: var(--ink-300); }

.btn-ghost {
  background: transparent;
  color: var(--ink-500);
}
.btn-ghost:hover:not(:disabled) { background: var(--paper); color: var(--ink-800); }

.btn-danger-outline {
  background: var(--card);
  color: var(--red);
  border-color: #ecc9c9;
}
.btn-danger-outline:hover:not(:disabled) { background: var(--red-soft); }

.btn-sm { height: 32px; padding: 0 13px; font-size: 12px; }

/* ---------- Cards / panels ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  overflow: visible;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2, .panel-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-900);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  flex-shrink: 0;
}

.panel-meta {
  font-size: 12px;
  color: var(--ink-400);
  font-weight: 600;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.panel-body { padding: 22px; }

/* ---------- Metric tiles ---------- */
.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.metric-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.metric-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-3); }

.metric-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.metric-tile.tone-amber .metric-icon { background: var(--amber-soft); color: var(--amber); }
.metric-tile.tone-blue .metric-icon { background: var(--blue-soft); color: var(--blue); }
.metric-tile.tone-red .metric-icon { background: var(--red-soft); color: var(--red); }

.metric-body { min-width: 0; }

.metric-label {
  font-size: 12px;
  color: var(--ink-400);
  font-weight: 600;
  margin-bottom: 4px;
}

.metric-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.metric-skel {
  height: 26px;
  width: 70px;
  border-radius: 6px;
  background: linear-gradient(90deg, #eceef1 25%, #dfe2e7 50%, #eceef1 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-500);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field .hint {
  font-size: 11.5px;
  color: var(--ink-400);
  margin-top: 5px;
}

.input, select.input {
  width: 100%;
  height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  font-weight: 500;
  color: var(--ink-800);
  background: var(--paper);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.input::placeholder { color: var(--ink-300); }

.input:hover { border-color: var(--ink-200); }

.input:focus, select.input:focus {
  outline: none;
  background: var(--card);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(31, 111, 92, 0.12);
}

.input-icon-wrap { position: relative; }
.input-icon-wrap .ic {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-300);
  font-size: 12px;
  pointer-events: none;
  transition: color 0.15s ease;
}
.input-icon-wrap:focus-within .ic { color: var(--accent); }
.input-icon-wrap .input { padding-left: 36px; }

/* ---------- Search / filter bar ---------- */
.filter-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 16px;
}

@media (max-width: 1100px) {
  .filter-bar { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .filter-bar { grid-template-columns: 1fr !important; }
}

.filter-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

/* ---------- Table ---------- */
.data-table-wrap { position: relative; }

table.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  table-layout: fixed;
}

.data-table thead th {
  text-align: left;
  background: var(--card);
  color: var(--ink-400);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--ink-100);
  color: var(--ink-700);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table tbody tr { transition: background 0.1s ease; }
.data-table tbody tr:hover { background: var(--paper); }
.data-table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.data-table tbody tr:last-child td { border-bottom: none; }

.cell-muted { color: var(--ink-400); }
.cell-strong { font-weight: 700; color: var(--ink-900); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.pill-accent { background: var(--accent-soft); color: var(--accent-ink); }
.pill-blue { background: var(--blue-soft); color: #1d3f70; }
.pill-neutral { background: var(--ink-100); color: var(--ink-500); }
.pill-amber { background: var(--amber-soft); color: #6e4013; }
.pill-red { background: var(--red-soft); color: #7a2727; }

.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 7px;
}
.status-dot.on { background: #2f9e6f; }
.status-dot.off { background: var(--ink-300); }
.status-dot.hold { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }

/* ---------- Column filter dropdown ---------- */
.th-filter { display: inline-flex; align-items: center; gap: 6px; position: relative; }

.th-filter-btn {
  border: none;
  background: transparent;
  color: var(--ink-300);
  cursor: pointer;
  font-size: 10px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
}
.th-filter-btn:hover { color: var(--ink-600); background: var(--ink-100); }
.th-filter-btn.on { color: var(--accent); background: var(--accent-soft); }

.th-filter-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-3);
  min-width: 180px;
  padding: 6px;
  z-index: 40;
  text-transform: none;
  letter-spacing: normal;
}
.th-filter-menu.open { display: block; }

.th-filter-opt {
  padding: 8px 11px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-700);
  cursor: pointer;
  border-radius: 6px;
}
.th-filter-opt:hover { background: var(--paper); }
.th-filter-opt.sel { color: var(--accent-dark); font-weight: 800; }

/* ---------- Toggle switch ---------- */
.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-500);
  cursor: pointer;
  user-select: none;
}
.switch-label input { display: none; }
.switch-track {
  width: 36px; height: 20px;
  border-radius: 999px;
  background: var(--ink-200);
  position: relative;
  transition: background 0.15s ease;
  flex-shrink: 0;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.22);
  transition: transform 0.18s ease;
}
.switch-label input:checked + .switch-track { background: var(--accent); }
.switch-label input:checked + .switch-track::after { transform: translateX(16px); }

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 4px 4px 4px 14px;
}
.toolbar-group .input {
  height: 30px;
  width: auto;
  font-size: 12px;
  padding: 0 26px 0 12px;
  border-radius: var(--radius-pill);
  background: var(--card);
}

/* ---------- Empty / loading / error states ---------- */
.state-block {
  text-align: center;
  padding: 64px 20px;
  white-space: normal;
}
.state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--ink-300);
}
.state-title { font-size: 15px; font-weight: 800; color: var(--ink-800); margin-bottom: 5px; }
.state-text { font-size: 13px; color: var(--ink-400); margin-bottom: 18px; }

.table-loading-veil {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.8);
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  backdrop-filter: blur(2px);
  z-index: 30;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.table-loading-veil.show { display: flex; }

.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.spinner-sm {
  width: 12px; height: 12px;
  border-width: 2px;
  display: inline-block;
  vertical-align: -1px;
}

/* ---------- Pagination ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-400);
}
.pager-controls { display: flex; gap: 4px; flex-wrap: wrap; }
.pager-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-600);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s ease;
}
.pager-btn:hover:not(.disabled):not(.active) { background: var(--paper); border-color: var(--line); }
.pager-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager-btn.disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- API key value / copy ---------- */
.key-chip {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--paper);
  border: 1px dashed var(--ink-200);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-700);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.key-chip:hover { border-color: var(--accent); border-style: solid; color: var(--accent-dark); background: var(--accent-soft); }
.key-chip .ic { font-size: 10.5px; color: var(--ink-300); }
.key-chip:hover .ic { color: var(--accent); }

.toast-stack {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--ink-900);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-3);
  min-width: 220px;
  border-left: 3px solid var(--accent);
  animation: toast-in 0.2s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Modal ---------- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 20, 0.55);
  backdrop-filter: blur(3px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal-box {
  background: var(--card);
  border-radius: 22px;
  width: 460px;
  max-width: 100%;
  box-shadow: var(--shadow-3);
  padding: 28px;
  animation: modal-in 0.18s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.modal-box h3 { margin: 0 0 8px; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; color: var(--ink-900); }
.modal-box p { margin: 0 0 22px; font-size: 13px; line-height: 1.55; color: var(--ink-500); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* ---------- Auth (login) ---------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--paper);
}

.auth-aside {
  background: var(--ink-950);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.05) 1px, transparent 0);
  background-size: 22px 22px;
  color: var(--ink-200);
  padding: 44px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-aside .brand-name { font-size: 16px; }

.auth-aside-title {
  font-size: 38px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0 0 16px;
  max-width: 460px;
}
.auth-aside-text { font-size: 14.5px; color: var(--ink-300); line-height: 1.6; max-width: 420px; margin: 0 0 30px; }

.auth-feature-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.auth-feature-list li { display: flex; align-items: center; gap: 12px; font-size: 13.5px; font-weight: 600; color: var(--ink-200); }
.auth-feature-list .ic {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: rgba(31, 111, 92, 0.35);
  color: #7fd8bd;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.auth-aside-foot { font-size: 12px; color: var(--ink-500); }

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card {
  width: 400px;
  max-width: 100%;
}
.auth-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
}
.auth-title { font-size: 26px; font-weight: 800; color: var(--ink-900); letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-subtitle { font-size: 13.5px; color: var(--ink-400); margin-bottom: 28px; }
.auth-card .input { height: 46px; background: var(--card); }
.auth-card .btn { height: 46px; font-size: 14px; }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-brand { display: flex; }
}

/* ---------- Misc ---------- */
.text-link { color: var(--accent); font-weight: 700; cursor: pointer; }
.text-link:hover { text-decoration: underline; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap { display: flex; align-items: center; gap: 8px; }

.responsive-scroll { overflow-x: auto; }
.responsive-scroll .data-table { min-width: 860px; }

/* ---------- Sidebar collapse ---------- */
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 20px 14px 16px 22px;
}

.sidebar-collapse-btn {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: var(--ink-400);
  font-size: 11.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, transform 0.2s ease;
}
.sidebar-collapse-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }

.app-sidebar { transition: width 0.2s ease; overflow: hidden; }
.brand-text, .nav-label, .sidebar-profile-meta { white-space: nowrap; }

@media (min-width: 901px) {
  .sidebar-collapsed .app-sidebar { width: 78px; }

  .sidebar-collapsed .sidebar-top {
    justify-content: center;
    padding: 20px 6px 12px;
    gap: 5px;
  }
  .sidebar-collapsed .brand-mark { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }
  .sidebar-collapsed .sidebar-collapse-btn { width: 24px; height: 24px; font-size: 10.5px; }
  .sidebar-collapsed .brand-text,
  .sidebar-collapsed .nav-label,
  .sidebar-collapsed .sidebar-profile-meta { display: none; }

  .sidebar-collapsed .sidebar-collapse-btn i { transform: rotate(180deg); }

  .sidebar-collapsed .sidebar-nav { padding: 4px 14px; }
  .sidebar-collapsed .sidebar-section-label { padding: 14px 0 8px; }
  .sidebar-collapsed .sidebar-section-label span { display: none; }
  .sidebar-collapsed .sidebar-section-label::before {
    content: "";
    display: block;
    height: 1px;
    margin: 0 8px;
    background: rgba(255,255,255,0.08);
  }
  .sidebar-collapsed .nav-link { justify-content: center; padding: 0; }

  .sidebar-collapsed .sidebar-profile {
    margin: 12px 10px;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .sidebar-collapsed .sidebar-logout-btn { width: 38px; padding: 0; margin-bottom: 10px; }
  .sidebar-collapsed .sidebar-profile-card { justify-content: center; }
}

@media (max-width: 900px) {
  .sidebar-collapse-btn { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  :root { --gutter: 16px; }

  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-3);
  }
  .app-sidebar.open { transform: translateX(0); }
  .app-sidebar.open + .sidebar-backdrop { display: block; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

  .page-head { padding: 22px 0 76px; }
  .topbar-title { font-size: 22px; }
  .metric-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .metric-tile { padding: 14px; gap: 12px; }
  .metric-icon { width: 38px; height: 38px; font-size: 14px; border-radius: 11px; }
  .metric-value { font-size: 21px; }
  .panel-body { padding: 16px; }
  .panel-header { padding: 14px 16px; }
}

@media (max-width: 480px) {
  .metric-tile { flex-direction: column; align-items: flex-start; gap: 10px; }
}
