*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bg-0: #050b14;
  --bg-1: #09111f;
  --bg-2: #0f1a2d;
  --surface-0: rgba(10, 18, 31, .92);
  --surface-1: rgba(14, 24, 40, .84);
  --surface-2: rgba(20, 32, 52, .94);
  --surface-3: rgba(29, 43, 69, .98);
  --surface-hover: rgba(38, 56, 88, .98);
  --field-bg: rgba(10, 18, 31, .84);
  --line: rgba(141, 169, 214, .14);
  --line-strong: rgba(141, 169, 214, .24);
  --text: #f3f7ff;
  --text-soft: #b1c0d9;
  --text-dim: #8c9db8;
  --text-muted: #5f708c;
  --accent: #6be6ff;
  --accent-strong: #4cb5ff;
  --accent-violet: #8170ff;
  --green: #39d98a;
  --green-dim: rgba(57, 217, 138, .12);
  --red: #ff6b7a;
  --red-dim: rgba(255, 107, 122, .12);
  --yellow: #ffcb57;
  --yellow-dim: rgba(255, 203, 87, .14);
  --blue-dim: rgba(76, 181, 255, .14);
  --purple-dim: rgba(129, 112, 255, .16);
  --shadow-xs: 0 8px 18px rgba(0, 0, 0, .22);
  --shadow-md: 0 18px 40px rgba(0, 0, 0, .28);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, .4);
  --sidebar-w: 300px;
  --content-w: 1560px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition: 180ms ease;
}

html {
  font-size: 14px;
  color-scheme: dark;
}

body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at 12% 12%, rgba(76, 181, 255, .18), transparent 30%),
    radial-gradient(circle at 88% 10%, rgba(129, 112, 255, .16), transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(57, 217, 138, .08), transparent 30%),
    linear-gradient(180deg, var(--bg-1) 0%, #07101d 52%, var(--bg-0) 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

body::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
  background-size: 120px 120px;
  mask-image: linear-gradient(180deg, rgba(255, 255, 255, .32), transparent 92%);
}

body::after {
  z-index: -1;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, .06) 0, transparent 55%),
    radial-gradient(circle at center, rgba(255, 255, 255, .03) 0, transparent 70%);
  opacity: .35;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238c9db8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px !important;
}

input[type="checkbox"] {
  accent-color: var(--accent-strong);
}

.hidden {
  display: none !important;
}

.is-hidden {
  display: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--accent);
}

.brand-mark {
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .15), transparent 45%),
    linear-gradient(145deg, var(--accent-strong), var(--accent-violet));
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .16em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    0 20px 38px rgba(76, 181, 255, .2);
}

.surface-panel,
.table-wrap,
.metric-card,
.hero-metric,
.info-card,
.empty-state,
.toolbar {
  position: relative;
  overflow: hidden;
}

.surface-panel::before,
.table-wrap::before,
.metric-card::before,
.hero-metric::before,
.info-card::before,
.empty-state::before,
.toolbar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), transparent 22%);
  pointer-events: none;
}

.surface-panel {
  background: linear-gradient(180deg, rgba(19, 31, 49, .92), rgba(10, 17, 30, .96));
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.text-soft { color: var(--text-soft); }
.text-dim { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--green); }
.text-danger { color: var(--red); }
.text-warning { color: var(--yellow); }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Login */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px;
}

.login-stage {
  width: min(1320px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, .95fr);
  gap: 24px;
  align-items: stretch;
}

.login-hero,
.login-panel {
  padding: 36px;
}

.login-hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 620px;
}

.login-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(107, 230, 255, .08);
  border: 1px solid rgba(107, 230, 255, .18);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-brand {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-top: 28px;
}

.login-brand-copy {
  max-width: 720px;
}

.login-brand h1 {
  margin-top: 12px;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: .98;
  letter-spacing: -.05em;
}

.login-copy {
  max-width: 760px;
  margin-top: 22px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-soft);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.hero-metric {
  background: linear-gradient(180deg, rgba(17, 28, 45, .95), rgba(10, 17, 30, .9));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow-md);
}

.hero-metric-label {
  display: block;
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .16em;
  margin-bottom: 10px;
}

.hero-metric strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}

.hero-metric-copy {
  display: block;
  color: var(--text-dim);
  line-height: 1.6;
}

.hero-strip {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-strip span {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  max-width: 440px;
  justify-self: end;
}

.login-panel-head h2 {
  margin-top: 12px;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: -.04em;
}

.login-panel-head p {
  margin-top: 12px;
  color: var(--text-dim);
  line-height: 1.7;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-btn {
  width: 100%;
  justify-content: center;
}

.login-error {
  min-height: 20px;
  color: var(--red);
  font-size: 13px;
}

.login-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 13px;
}

.login-note-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--green), #1fbf73);
  box-shadow: 0 0 0 6px rgba(57, 217, 138, .08);
}

/* App layout */
.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  position: fixed;
  inset: 0 auto 0 0;
  padding: 18px;
  z-index: 30;
}

.sidebar-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(14, 24, 40, .92), rgba(7, 13, 24, .96));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}

.sidebar-head {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sidebar-brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  font-size: 16px;
}

.sidebar-eyebrow {
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .18em;
}

.sidebar-title {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.04em;
}

.sidebar-copy {
  margin-top: 16px;
  color: var(--text-dim);
  line-height: 1.7;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.sidebar-nav::-webkit-scrollbar,
.content::-webkit-scrollbar,
.table-scroll::-webkit-scrollbar,
.modal::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.sidebar-nav::-webkit-scrollbar-thumb,
.content::-webkit-scrollbar-thumb,
.table-scroll::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .12);
  border-radius: 999px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid transparent;
  color: var(--text-dim);
  transition: border-color var(--transition), background var(--transition), color var(--transition), transform var(--transition);
}

.nav-item:hover {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .04);
  color: var(--text);
  transform: translateX(2px);
}

.nav-item.active {
  background:
    linear-gradient(180deg, rgba(76, 181, 255, .14), rgba(16, 31, 53, .95));
  border-color: rgba(107, 230, 255, .22);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.nav-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  color: inherit;
  flex-shrink: 0;
}

.nav-item.active .nav-icon {
  background: linear-gradient(135deg, rgba(76, 181, 255, .18), rgba(129, 112, 255, .2));
  color: var(--accent);
}

.nav-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.nav-title {
  font-size: 14px;
  font-weight: 700;
}

.nav-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.sidebar-footer {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.mode-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
}

.mode-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 7px rgba(57, 217, 138, .08);
  animation: pulse 2s ease-in-out infinite;
}

.mode-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mode-caption {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--text-muted);
}

#mode-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.92); }
}

.main {
  flex: 1;
  min-height: 100vh;
  margin-left: var(--sidebar-w);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin: 18px 18px 0;
  padding: 24px 28px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(13, 23, 40, .88), rgba(9, 16, 29, .92));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
}

.topbar-heading h2 {
  margin-top: 8px;
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  line-height: 1;
  letter-spacing: -.05em;
}

.topbar-heading p {
  margin-top: 10px;
  max-width: 720px;
  color: var(--text-dim);
  line-height: 1.7;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.topbar-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid rgba(57, 217, 138, .18);
  background: rgba(57, 217, 138, .08);
  color: #d8ffe9;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.status-dot.green {
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(57, 217, 138, .08);
}

.status-meta {
  color: var(--text-muted);
  font-size: 12px;
}

.content {
  padding: 18px;
}

.content-shell {
  width: min(var(--content-w), 100%);
  margin: 0 auto;
}

/* Global stacks */
.page-stack > * + * {
  margin-top: 20px;
}

.section-grid {
  display: grid;
  gap: 20px;
}

.section-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.page-hero {
  padding: 28px 30px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(19, 33, 53, .94), rgba(10, 16, 30, .96));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.page-hero h3 {
  margin-top: 10px;
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  line-height: 1.02;
  letter-spacing: -.04em;
}

.page-hero p {
  margin-top: 14px;
  max-width: 880px;
  color: var(--text-dim);
  line-height: 1.75;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

.pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  opacity: .8;
}

/* Toolbars */
.toolbar {
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(16, 27, 45, .96), rgba(10, 18, 31, .92));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}

.toolbar .form-input,
.toolbar .form-select {
  min-height: 44px;
}

.toolbar-group + .toolbar-group {
  margin-top: 14px;
}

.toolbar-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .16em;
}

.date-range {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-separator {
  color: var(--text-muted);
  font-size: 15px;
}

.quick-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-btn {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  transition: border-color var(--transition), background var(--transition), color var(--transition), transform var(--transition);
}

.quick-btn:hover,
.quick-btn.active {
  background: rgba(76, 181, 255, .12);
  border-color: rgba(107, 230, 255, .26);
  color: var(--accent);
  transform: translateY(-1px);
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}

.filter-field.compact {
  max-width: 110px;
}

/* Cards and metrics */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.metric-card {
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 28, 45, .96), rgba(10, 17, 30, .96));
  box-shadow: var(--shadow-md);
}

.metric-card::after {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
  opacity: .42;
}

.metric-card.tone-cyan { box-shadow: 0 18px 40px rgba(76, 181, 255, .12); }
.metric-card.tone-cyan::before { background: linear-gradient(180deg, rgba(76, 181, 255, .15), transparent 26%); }
.metric-card.tone-green::before { background: linear-gradient(180deg, rgba(57, 217, 138, .15), transparent 26%); }
.metric-card.tone-yellow::before { background: linear-gradient(180deg, rgba(255, 203, 87, .14), transparent 26%); }
.metric-card.tone-rose::before { background: linear-gradient(180deg, rgba(255, 107, 122, .14), transparent 26%); }
.metric-card.tone-violet::before { background: linear-gradient(180deg, rgba(129, 112, 255, .16), transparent 26%); }

.metric-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .18em;
}

.metric-value {
  margin-top: 16px;
  font-size: clamp(2rem, 3vw, 2.65rem);
  font-weight: 800;
  letter-spacing: -.05em;
  line-height: 1;
}

.metric-sub {
  margin-top: 10px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* Panels and tables */
.table-wrap {
  background: linear-gradient(180deg, rgba(16, 27, 45, .96), rgba(9, 16, 29, .96));
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow-md);
}

.table-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.table-title-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.table-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.03em;
}

.table-meta {
  color: var(--text-dim);
  line-height: 1.6;
  font-size: 13px;
}

.table-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.table-scroll {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(11, 19, 33, .96);
}

th {
  padding: 13px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .16em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  user-select: none;
  transition: color var(--transition), background var(--transition);
}

th[data-sort]:hover {
  color: var(--text-soft);
  background: rgba(255, 255, 255, .03);
}

th .sort-arrow {
  margin-left: 6px;
  opacity: .35;
}

th .sort-arrow.active {
  opacity: 1;
  color: var(--accent);
}

td {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-soft);
  border-bottom: 1px solid rgba(141, 169, 214, .1);
  white-space: nowrap;
  vertical-align: middle;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

tbody tr {
  transition: background var(--transition), transform var(--transition);
}

tbody tr:hover td {
  background: rgba(255, 255, 255, .03);
}

tbody tr:last-child td {
  border-bottom: none;
}

td a {
  color: var(--accent);
}

td a:hover {
  text-decoration: underline;
}

.cell-accent { color: var(--accent); }
.cell-dim { color: var(--text-dim); }
.cell-danger { color: var(--red); }
.cell-small { font-size: 11px; }
.cell-xs { font-size: 10px; }

/* Empty and info states */
.empty-state {
  padding: 36px 26px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(16, 27, 45, .92), rgba(10, 18, 31, .9));
  border: 1px solid var(--line);
  text-align: center;
  box-shadow: var(--shadow-xs);
}

.empty-state-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.03em;
}

.empty-state-copy {
  margin-top: 10px;
  color: var(--text-dim);
  line-height: 1.7;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.info-card {
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(16, 27, 45, .95), rgba(10, 18, 31, .92));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}

.info-card h4 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(141, 169, 214, .1);
}

.info-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.info-key {
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.info-value {
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-green {
  color: #d8ffe9;
  background: var(--green-dim);
  border: 1px solid rgba(57, 217, 138, .18);
}

.badge-red {
  color: #ffd7dc;
  background: var(--red-dim);
  border: 1px solid rgba(255, 107, 122, .18);
}

.badge-yellow {
  color: #fff0be;
  background: var(--yellow-dim);
  border: 1px solid rgba(255, 203, 87, .2);
}

.badge-blue {
  color: #dff7ff;
  background: var(--blue-dim);
  border: 1px solid rgba(76, 181, 255, .2);
}

.badge-purple {
  color: #e6dfff;
  background: var(--purple-dim);
  border: 1px solid rgba(129, 112, 255, .24);
}

/* Buttons */
.btn {
  min-height: 42px;
  padding: 11px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .01em;
  transition: transform var(--transition), border-color var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  color: #03131f;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 12px 26px rgba(76, 181, 255, .22);
}

.btn-primary:hover {
  box-shadow: 0 18px 34px rgba(76, 181, 255, .26);
}

.btn-ghost {
  color: var(--text-soft);
  background: rgba(255, 255, 255, .03);
  border-color: var(--line);
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .06);
  border-color: var(--line-strong);
}

.btn-danger {
  color: #fff0f2;
  background: linear-gradient(135deg, rgba(255, 107, 122, .9), rgba(234, 68, 90, .95));
  box-shadow: 0 12px 24px rgba(255, 107, 122, .16);
}

.btn-sm {
  min-height: 38px;
  padding: 9px 14px;
  font-size: 12px;
}

.btn-icon {
  width: 46px;
  min-width: 46px;
  padding: 0;
}

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

.form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .16em;
}

.form-input,
.form-select {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 18, 31, .9), rgba(12, 20, 34, .96));
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus,
.form-select:focus {
  border-color: rgba(107, 230, 255, .44);
  box-shadow: 0 0 0 4px rgba(107, 230, 255, .08);
}

textarea.form-input {
  min-height: 110px;
  resize: vertical;
}

/* Toggle */
.toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.toggle {
  position: relative;
  width: 54px;
  height: 30px;
}

.toggle input {
  width: 0;
  height: 0;
  opacity: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line);
  transition: background var(--transition), border-color var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff, #d7e1ef);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .18);
  transition: transform var(--transition);
}

.toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, rgba(107, 230, 255, .28), rgba(76, 181, 255, .28));
  border-color: rgba(107, 230, 255, .26);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(24px);
}

.toggle-label {
  color: var(--text-soft);
  font-weight: 600;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 22px;
  border-top: 1px solid var(--line);
}

.pagination-info,
.per-page {
  color: var(--text-dim);
  font-size: 12px;
}

.pagination-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.per-page {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.per-page select {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--field-bg);
  color: var(--text-soft);
}

.page-nums {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.page-num {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.page-num:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.page-num.active {
  color: #03131f;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
}

.page-num.dots {
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 12, .72);
  backdrop-filter: blur(10px);
}

.modal {
  width: min(640px, 100%);
  max-height: min(86vh, 900px);
  overflow-y: auto;
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(18, 30, 49, .98), rgba(9, 16, 29, .98));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}

.modal-head {
  margin-bottom: 20px;
}

.modal h3 {
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -.04em;
}

.modal-subtitle {
  margin-top: 10px;
  color: var(--text-dim);
  line-height: 1.7;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* Settings and vault specifics */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.settings-panel {
  padding: 22px;
}

.settings-mode-body {
  padding: 22px;
}

.settings-panel-head {
  margin-bottom: 18px;
}

.settings-panel-head h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.03em;
}

.settings-panel-head p {
  margin-top: 8px;
  color: var(--text-dim);
  line-height: 1.6;
  font-size: 13px;
}

.vault-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.vault-line {
  margin-bottom: 4px;
  line-height: 1.6;
}

.vault-key {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.vault-value {
  color: var(--text-soft);
  font-size: 12px;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 1260px) {
  .login-stage {
    grid-template-columns: 1fr;
  }

  .login-panel {
    max-width: none;
    justify-self: stretch;
  }

  .section-grid.two,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  :root {
    --sidebar-w: 92px;
  }

  .sidebar {
    padding: 14px;
  }

  .sidebar-shell {
    padding: 16px 12px;
  }

  .sidebar-copy,
  .sidebar-title,
  .sidebar-eyebrow,
  .nav-copy,
  .sidebar-footer {
    display: none;
  }

  .sidebar-brand {
    justify-content: center;
  }

  .sidebar-brand-mark {
    width: 48px;
    height: 48px;
  }

  .nav-item {
    justify-content: center;
    padding: 12px;
  }

  .nav-icon {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 820px) {
  .login-screen,
  .content {
    padding: 14px;
  }

  .topbar {
    margin: 14px 14px 0;
    padding: 20px;
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-right {
    justify-content: space-between;
  }

  .topbar-status {
    align-items: flex-start;
  }

  .hero-metrics,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .page-hero,
  .table-header,
  .settings-panel,
  .login-hero,
  .login-panel,
  .modal {
    padding: 20px;
  }

  .filters-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --sidebar-w: 74px;
  }

  .login-screen,
  .content,
  .modal-overlay {
    padding: 12px;
  }

  .hero-metrics,
  .filters-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .page-num {
    min-width: 30px;
    height: 30px;
  }

  td,
  th {
    padding-left: 12px;
    padding-right: 12px;
  }
}
