/* ═══════════════════════════════════════════════════════
   KYC PLATFORM  ·  Soft Luxe Theme
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Lora:ital,wght@0,400;0,600;1,400&display=swap');

/* ── Variables ──────────────────────────────────────────── */
:root {
  --navy:          #1E2D3D;
  --navy-hover:    #263647;
  --navy-active:   #2D4057;
  --gold:          #C4A05A;
  --gold-light:    #E2C98A;
  --gold-pale:     #F5EDD6;
  --bg:            #F4F1EC;
  --bg-card:       #FFFFFF;
  --bg-sidebar:    #1E2D3D;
  --text:          #2C3A47;
  --text-2:        #6B7A88;
  --text-3:        #9CA9B5;
  --border:        #E8E2D9;
  --border-light:  #F0EBE4;
  --green:         #52A97B;
  --green-bg:      #EEF8F3;
  --red:           #D47070;
  --red-bg:        #FDF2F2;
  --orange:        #D4855A;
  --orange-bg:     #FDF5EF;
  --blue:          #6B97D4;
  --blue-bg:       #EEF3FB;
  --purple:        #9B7ED4;
  --purple-bg:     #F5F0FB;
  --shadow-xs:     0 1px 2px rgba(30,45,61,0.05);
  --shadow-sm:     0 2px 8px rgba(30,45,61,0.07), 0 1px 3px rgba(30,45,61,0.04);
  --shadow-md:     0 6px 24px rgba(30,45,61,0.09), 0 2px 8px rgba(30,45,61,0.05);
  --shadow-lg:     0 16px 48px rgba(30,45,61,0.12), 0 4px 16px rgba(30,45,61,0.06);
  --sidebar-w:     252px;
  --header-h:      62px;
  --r:             10px;
  --r-sm:          6px;
  --r-lg:          16px;
  --ease:          cubic-bezier(0.25,0.46,0.45,0.94);
  --ease-spring:   cubic-bezier(0.34,1.56,0.64,1);
}

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ── Layout Shell ───────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;   /* stretch full viewport height */
  z-index: 100;
  overflow: hidden;              /* clip horizontal only */
}

.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom,
    transparent 0%,
    rgba(196,160,90,0.3) 30%,
    rgba(196,160,90,0.3) 70%,
    transparent 100%);
}

.sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(196,160,90,0.4);
}

.brand-name {
  display: flex; flex-direction: column; gap: 1px;
}

.brand-title {
  font-family: 'Lora', serif;
  font-size: 14px;
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.brand-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  min-height: 0;                /* REQUIRED: lets flex child shrink below content size */
  overflow-y: auto;             /* scroll when nav items exceed available height */
  overflow-x: hidden;
  padding: 14px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(196,160,90,0.25) transparent;
}
.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(196,160,90,0.25);
  border-radius: 2px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(196,160,90,0.5);
}

.nav-section-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 16px 20px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  margin: 1px 8px;
  border-radius: var(--r-sm);
  color: rgba(255,255,255,0.55);
  font-size: 13.5px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  position: relative;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.9);
}

.nav-item.active {
  background: rgba(196,160,90,0.15);
  color: var(--gold-light);
  font-weight: 500;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--gold);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.75;
}
.nav-item.active .nav-icon { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.5;
}

.sidebar-footer,
.sidebar-user {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;         /* never squish — stays pinned at bottom of flex column */
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.2s var(--ease);
}
.user-chip:hover { background: rgba(255,255,255,0.07); }

.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, #A07A3A 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--navy);
  flex-shrink: 0;
}

.user-info { flex: 1; overflow: hidden; }
.user-name {
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 10.5px;
  color: rgba(255,255,255,0.35);
}

/* ── Main Content ───────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top Header ─────────────────────────────────────────── */
.topbar {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0; z-index: 50;
  box-shadow: var(--shadow-xs);
}

.page-title {
  font-family: 'Lora', serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  width: 240px;
  transition: all 0.2s var(--ease);
}
.topbar-search:focus-within {
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(196,160,90,0.12);
}
.topbar-search input {
  border: none; background: transparent;
  outline: none; width: 100%;
  font-size: 13px; color: var(--text);
}
.topbar-search input::placeholder { color: var(--text-3); }

.topbar-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  transition: all 0.18s var(--ease);
  position: relative;
}
.topbar-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-pale);
}

.notif-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: var(--red);
  border-radius: 50%;
  border: 1.5px solid #fff;
}

/* ── Content Area ───────────────────────────────────────── */
.content {
  padding: 28px;
  flex: 1;
}

/* ── Page Header ────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.page-header-left { flex: 1; }
.page-heading {
  font-family: 'Lora', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.page-subheading {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 3px;
}
.page-actions { display: flex; gap: 10px; align-items: center; }

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.card-body { padding: 22px; }
.card-body-sm { padding: 14px 22px; }

/* ── Stat Cards ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.07;
  transform: translate(20px, -20px);
}
.stat-card.green::after { background: var(--green); }
.stat-card.blue::after { background: var(--blue); }
.stat-card.orange::after { background: var(--orange); }
.stat-card.red::after { background: var(--red); }
.stat-card.gold::after { background: var(--gold); }
.stat-card.purple::after { background: var(--purple); }

.stat-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.stat-value {
  font-family: 'Lora', serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
}

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

.stat-icon {
  position: absolute;
  top: 18px; right: 18px;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.stat-icon.green { background: var(--green-bg); }
.stat-icon.blue  { background: var(--blue-bg); }
.stat-icon.orange{ background: var(--orange-bg); }
.stat-icon.red   { background: var(--red-bg); }
.stat-icon.gold  { background: var(--gold-pale); }
.stat-icon.purple{ background: var(--purple-bg); }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.18s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover {
  background: var(--navy-hover);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, #A07A35 100%);
  color: var(--navy);
  font-weight: 600;
}
.btn-gold:hover {
  box-shadow: 0 4px 16px rgba(196,160,90,0.35);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
}
.btn-outline:hover {
  border-color: var(--navy);
  color: var(--navy);
  background: rgba(30,45,61,0.03);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12.5px;
}

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(212,112,112,0.25);
}
.btn-danger:hover {
  background: var(--red);
  color: #fff;
}

.btn-success {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(82,169,123,0.25);
}
.btn-success:hover {
  background: var(--green);
  color: #fff;
}

/* ── Badges / Status Pills ──────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-pending   { background: var(--orange-bg); color: var(--orange); }
.badge-pending::before { background: var(--orange); }
.badge-approved  { background: var(--green-bg);  color: var(--green);  }
.badge-approved::before  { background: var(--green); }
.badge-rejected  { background: var(--red-bg);    color: var(--red);    }
.badge-rejected::before  { background: var(--red); }
.badge-escalated { background: var(--purple-bg); color: var(--purple); }
.badge-escalated::before { background: var(--purple); }
.badge-inreview  { background: var(--blue-bg);   color: var(--blue);   }
.badge-inreview::before  { background: var(--blue); }

.badge-low      { background: var(--green-bg);  color: var(--green);  }
.badge-medium   { background: var(--orange-bg); color: var(--orange); }
.badge-high     { background: var(--red-bg);    color: var(--red);    }
.badge-critical { background: var(--red-bg);    color: #a33; font-weight:700; }

/* ── Tables ─────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

table.kyc-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
}

.kyc-table thead tr {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.kyc-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  white-space: nowrap;
}

.kyc-table td {
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.kyc-table tbody tr {
  transition: background 0.15s var(--ease);
}
.kyc-table tbody tr:hover { background: rgba(196,160,90,0.04); }
.kyc-table tbody tr:last-child td { border-bottom: none; }

.table-link {
  color: var(--navy);
  font-weight: 500;
  transition: color 0.15s;
}
.table-link:hover { color: var(--gold); }

/* ── Forms ──────────────────────────────────────────────── */
.form-section {
  margin-bottom: 28px;
}
.form-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 8px;
}
.form-section-title::before {
  content: '';
  width: 16px; height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }

.form-group { display: flex; flex-direction: column; gap: 5px; }

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0.02em;
}
.form-label .req { color: var(--red); margin-left: 2px; }

.form-control {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--text);
  background: var(--bg-card);
  transition: all 0.18s var(--ease);
  outline: none;
  width: 100%;
}
.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(196,160,90,0.14);
}
.form-control::placeholder { color: var(--text-3); }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }

.form-hint {
  font-size: 11.5px;
  color: var(--text-3);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.form-check input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
}
.form-check-label {
  font-size: 13px;
  color: var(--text);
}

/* ── Filter Bar ─────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: center;
}
.filter-bar .form-control {
  width: auto;
  font-size: 13px;
  padding: 7px 10px;
}

/* ── Pagination ─────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 22px;
  border-top: 1px solid var(--border-light);
  justify-content: center;
}
.page-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.page-btn:hover { border-color: var(--navy); color: var(--navy); }
.page-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.page-btn:disabled { opacity: 0.4; cursor: default; }

/* ── Empty State ────────────────────────────────────────── */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-3);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty-state-sub { font-size: 13px; }

/* ── Timeline ───────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  position: relative;
}
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 13px; top: 36px;
  width: 1px;
  bottom: 0;
  background: var(--border);
}
.timeline-dot {
  width: 27px; height: 27px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 2px;
}
.timeline-body { flex: 1; }
.timeline-text { font-size: 13px; color: var(--text); line-height: 1.5; }
.timeline-time { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* ── Activity Feed ──────────────────────────────────────── */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.activity-item:last-child { border-bottom: none; }
.activity-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--navy);
  color: rgba(255,255,255,0.8);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  flex-shrink: 0;
}
.activity-text { font-size: 13px; color: var(--text); line-height: 1.5; }
.activity-time { font-size: 11px; color: var(--text-3); }

/* ── Risk Score Bar ─────────────────────────────────────── */
.risk-bar-wrap { margin-top: 6px; }
.risk-bar {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.risk-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s var(--ease);
}
.risk-fill.low    { background: var(--green); }
.risk-fill.medium { background: var(--orange); }
.risk-fill.high   { background: var(--red); }
.risk-fill.critical { background: #a33; }

/* ── Progress Steps (Wizard) ────────────────────────────── */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 36px;
}
.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  position: relative;
}
.wizard-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px;
  left: calc(50% + 18px);
  right: calc(-50% + 18px);
  height: 1px;
  background: var(--border);
  z-index: 0;
}
.wizard-step.done:not(:last-child)::after { background: var(--gold); }

.step-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  z-index: 1;
  transition: all 0.25s var(--ease);
}
.wizard-step.done .step-circle {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--navy);
}
.wizard-step.active .step-circle {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(30,45,61,0.12);
}
.step-label {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
}
.wizard-step.active .step-label { color: var(--navy); font-weight: 600; }
.wizard-step.done .step-label  { color: var(--gold); }

/* ── Color Swatch Picker ────────────────────────────────── */
.color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.swatch {
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
  border: 3px solid transparent;
}
.swatch:hover { transform: scale(1.15); }
.swatch.selected {
  border-color: var(--text);
  transform: scale(1.1);
  box-shadow: var(--shadow-sm);
}

/* ── Upload Zone ────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--r);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  color: var(--text-3);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--gold);
  background: var(--gold-pale);
  color: var(--text-2);
}
.upload-icon { font-size: 36px; margin-bottom: 10px; }
.upload-text { font-size: 14px; font-weight: 500; color: var(--text-2); }
.upload-sub  { font-size: 12px; margin-top: 4px; }

/* ── Connector Cards ────────────────────────────────────── */
.connector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.connector-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s var(--ease);
}
.connector-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.connector-card.active { border-color: var(--green); background: var(--green-bg); }

.connector-icon {
  width: 42px; height: 42px;
  border-radius: var(--r-sm);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.connector-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.connector-status {
  font-size: 11.5px;
  display: flex; align-items: center; gap: 5px;
}
.connector-status.on  { color: var(--green); }
.connector-status.off { color: var(--text-3); }

/* ── Toggle Switch ──────────────────────────────────────── */
.toggle {
  position: relative;
  width: 40px; height: 22px;
  cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 11px;
  background: var(--border);
  transition: background 0.2s var(--ease);
}
.toggle input:checked ~ .toggle-track { background: var(--green); }
.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s var(--ease-spring);
}
.toggle input:checked ~ .toggle-thumb { transform: translateX(18px); }

/* ── Alerts / Toasts ────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-success { background: var(--green-bg); color: #2a7a52; border-color: rgba(82,169,123,0.2); }
.alert-danger  { background: var(--red-bg);   color: #a34040; border-color: rgba(212,112,112,0.2); }
.alert-warning { background: var(--orange-bg);color: #9A5A35; border-color: rgba(212,133,90,0.2); }
.alert-info    { background: var(--blue-bg);  color: #3A6A9A; border-color: rgba(107,151,212,0.2); }

/* ── Animations ─────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideRight {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.animate-fade-up { animation: fadeUp 0.4s var(--ease) both; }
.animate-fade-in { animation: fadeIn 0.3s var(--ease) both; }
.animate-slide-right { animation: slideRight 0.35s var(--ease) both; }

/* Staggered children */
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 60ms; }
.stagger > *:nth-child(3) { animation-delay: 120ms; }
.stagger > *:nth-child(4) { animation-delay: 180ms; }
.stagger > *:nth-child(5) { animation-delay: 240ms; }
.stagger > *:nth-child(6) { animation-delay: 300ms; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--bg) 25%, var(--border-light) 50%, var(--bg) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--r-sm);
}

/* ── Tabs ───────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab {
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.18s var(--ease);
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
  font-weight: 600;
}

/* ── Misc ───────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 20px 0;
}
.text-muted { color: var(--text-3); }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.fw-600 { font-weight: 600; }
.mono { font-family: 'Courier New', monospace; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ── Login Page ─────────────────────────────────────────── */
.login-shell {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}
.login-panel {
  width: 440px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 50px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}
.login-art {
  flex: 1;
  background: var(--navy);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-art-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(196,160,90,0.08);
}
.login-art-circle-1 { width: 400px; height: 400px; top: -100px; right: -100px; }
.login-art-circle-2 { width: 280px; height: 280px; bottom: 40px; left: -80px; }
.login-art-circle-3 { width: 160px; height: 160px; top: 50%; left: 50%; transform: translate(-50%,-50%); background: rgba(196,160,90,0.15); }

.login-logo {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 40px;
}
.login-heading {
  font-family: 'Lora', serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.login-sub {
  font-size: 13.5px;
  color: var(--text-2);
  margin-bottom: 32px;
}

/* ── Setup Wizard Page ──────────────────────────────────── */
.setup-shell {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 48px 24px;
}
.setup-header {
  text-align: center;
  margin-bottom: 40px;
}
.setup-container {
  width: 100%;
  max-width: 720px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
  .col-span-3 { grid-column: span 1; }
}

/* ── Donut Chart Cards ──────────────────────────────────────── */
.chart-card { padding: 0; }
.chart-card-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 16px;
}
.donut-wrap {
  flex-shrink: 0;
  width: 110px;
  height: 110px;
}
.donut-svg {
  width: 100%;
  height: 100%;
}
.chart-meta { flex: 1; min-width: 0; }
.chart-title {
  font-family: 'Lora', serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.chart-legend { display: flex; flex-direction: column; gap: 5px; }
.legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-label { flex: 1; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-val { font-weight: 600; color: var(--text); }
.legend-val.val-warn { color: var(--red); }

/* ── Compact inline sparklines (for sub-pages) ───────────────── */
.spark-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.spark-svg { flex-shrink: 0; }
.spark-info .spark-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.spark-info .spark-lbl {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px;
}
