/* ==========================================================================
   DealCart Enterprise Control Centre — Core Design System
   Modern UI Architecture · Plus Jakarta Sans · Bento Grids · Sleek Forms
   ========================================================================== */

:root {
  /* Color Palette - Light Theme */
  --blue: #2563eb;
  --blue2: #4f46e5;
  --green: #10b981;
  --green2: #059669;
  --ink: #0f172a;
  --ink-light: #334155;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --bg: #f8fafc;
  --bg-subtle: #f1f5f9;
  --card: #ffffff;
  --card-glass: rgba(255, 255, 255, 0.88);
  --line: #e2e8f0;
  --line-subtle: #f1f5f9;
  --line-focus: #3b82f6;

  /* Semantics */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #8b5cf6;
  --cyan: #06b6d4;

  /* Sidebar */
  --sidebar: #090e17;
  --sidebar-surface: #0f172a;
  --sidebar-border: rgba(255, 255, 255, 0.07);
  --sidebar-text: #94a3b8;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);

  /* Layout Measurements */
  --sw: 276px;
  --hh: 72px;
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --content-max: 1680px;

  /* Elevation & Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 2px 6px -1px rgba(15, 23, 42, 0.06), 0 1px 4px -1px rgba(15, 23, 42, 0.04);
  --shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 35px -8px rgba(15, 23, 42, 0.12), 0 10px 15px -5px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 8px 25px -4px rgba(37, 99, 235, 0.3);

  /* Transitions */
  --tr-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --tr-smooth: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Variables */
body.dark, html.dark-init body {
  --bg: #090e17;
  --bg-subtle: #0f172a;
  --card: #111a2e;
  --card-glass: rgba(17, 26, 46, 0.88);
  --ink: #f8fafc;
  --ink-light: #cbd5e1;
  --muted: #94a3b8;
  --muted-light: #64748b;
  --line: #1e293b;
  --line-subtle: #152033;
  --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.4);
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 40px -8px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 8px 25px -4px rgba(59, 130, 246, 0.4);
}

/* Base Reset & Typography */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button, a {
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}

/* Universal SVG / Icon Baseline */
svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  max-width: 100%;
}

img {
  max-width: 100%;
  height: auto;
}

/* App Loader */
.app-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg);
  display: grid;
  place-items: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.app-loader.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loader-brand img {
  width: 60px;
  height: 60px;
  background: #ffffff;
  padding: 8px;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.loader-brand span {
  display: block;
  width: 140px;
  height: 3.5px;
  margin: 18px auto 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--blue) 0%, var(--green) 50%, rgba(37, 99, 235, 0.2) 100%);
  background-size: 200% 100%;
  animation: loadShimmer 1.4s ease-in-out infinite;
}

.loader-brand small {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  font-weight: 700;
}

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

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sw);
  background: linear-gradient(180deg, var(--sidebar) 0%, #0d1527 65%, #080d16 100%);
  color: #e2e8f0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--sidebar-border);
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.2);
  transition: transform var(--tr-smooth);
}

.brand {
  height: var(--hh);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand-logo-wrap {
  width: 40px;
  height: 40px;
  background: #ffffff;
  padding: 4px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.brand-logo-wrap img, .brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.brand-info {
  flex: 1;
  min-width: 0;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.4px;
  line-height: 1.2;
}

.brand-name span {
  color: #38bdf8;
  background: linear-gradient(135deg, #38bdf8, #4ade80);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.sidebar-close {
  display: none;
  background: transparent;
  border: 0;
  color: #94a3b8;
  padding: 6px;
  border-radius: 8px;
}

.sidebar-close svg {
  width: 20px;
  height: 20px;
}

/* Workspace Chip */
.workspace-chip {
  margin: 12px 14px 4px;
  padding: 10px 12px;
  border: 1px solid var(--sidebar-border);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.workspace-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.workspace-meta {
  flex: 1;
  min-width: 0;
}

.workspace-chip strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-chip small {
  display: block;
  font-size: 10px;
  color: #94a3b8;
}

.online-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  animation: pulseGreen 2s infinite;
  flex: 0 0 auto;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Nav Menu */
.nav-scroll {
  padding: 12px 10px 24px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.nav-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: #64748b;
  font-weight: 800;
  padding: 16px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9.5px 13px;
  border-radius: 10px;
  color: #94a3b8;
  margin: 2px 0;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--tr-fast);
  position: relative;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
  transform: translateX(2px);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.nav-item.active::after {
  content: "";
  position: absolute;
  right: -10px;
  width: 4px;
  height: 20px;
  background: #38bdf8;
  border-radius: 4px 0 0 4px;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg, .nav-item svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
  flex: 0 0 auto;
}

.nav-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-count {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 800;
  margin-left: auto;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  border-radius: 99px;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  display: grid;
  place-items: center;
}

.nav-item.active .nav-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: transparent;
}

/* Sidebar Foot */
.sidebar-foot {
  border-top: 1px solid var(--sidebar-border);
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
}

.system-health {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}

.health-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  animation: pulseGreen 2s infinite;
  flex: 0 0 auto;
}

.system-health strong {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #a7f3d0;
}

.system-health small {
  display: block;
  font-size: 9.5px;
  color: #6ee7b7;
  opacity: 0.8;
}

.sidebar-user {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--sidebar-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-meta {
  flex: 1;
  min-width: 0;
}

.sidebar-user strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user small {
  display: block;
  font-size: 10.5px;
  color: #94a3b8;
}

.logout-mini {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  color: #cbd5e1;
  transition: all var(--tr-fast);
}

.logout-mini:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.logout-mini svg {
  width: 15px;
  height: 15px;
}

/* ==========================================================================
   Main Shell & Topbar
   ========================================================================== */

.main {
  margin-left: var(--sw);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--hh);
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--card-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 20px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03);
}

.top-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.menu-btn {
  display: none;
}

.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.breadcrumb a {
  color: var(--muted);
  font-weight: 500;
  transition: color var(--tr-fast);
}

.breadcrumb a:hover {
  color: var(--blue);
}

.breadcrumb-sep {
  opacity: 0.4;
  font-weight: 400;
}

.breadcrumb strong {
  color: var(--ink);
  font-weight: 700;
}

/* Global Top Search */
.top-search-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
}

.top-search {
  max-width: 480px;
  width: 100%;
  position: relative;
}

.top-search > svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.top-search input {
  width: 100%;
  height: 42px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 12px;
  padding: 0 54px 0 42px;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--tr-smooth);
}

.top-search input:focus {
  outline: 0;
  background: var(--card);
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.top-search kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  box-shadow: var(--shadow-xs);
  pointer-events: none;
}

/* Top Actions */
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 11px;
  color: var(--muted);
  display: grid;
  place-items: center;
  position: relative;
  transition: all var(--tr-fast);
  box-shadow: var(--shadow-xs);
}

.icon-btn:hover {
  color: var(--blue);
  border-color: rgba(37, 99, 235, 0.35);
  background: var(--bg-subtle);
  transform: translateY(-1px);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.notification-btn .notification-indicator {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--card);
}

/* Profile Chip */
.profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 4px 10px 4px 5px;
  cursor: pointer;
  transition: all var(--tr-fast);
  box-shadow: var(--shadow-xs);
}

.profile-chip:hover {
  border-color: rgba(37, 99, 235, 0.3);
  background: var(--bg-subtle);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #ffffff;
  font-weight: 800;
  font-size: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.avatar.round {
  border-radius: 50%;
}

.profile-text strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.profile-text small {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
}

.profile-arrow {
  font-size: 13px;
  color: var(--muted);
  margin-left: 2px;
}

/* Notification Panel Dropdown */
.notification-panel {
  position: fixed;
  right: 28px;
  top: calc(var(--hh) + 6px);
  width: 380px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--tr-smooth);
  overflow: hidden;
}

.notification-panel.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-subtle);
}

.panel-head strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.panel-head small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.panel-head button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px;
  border-radius: 6px;
}

.panel-head button:hover {
  color: var(--ink);
}

.panel-head svg {
  width: 16px;
  height: 16px;
}

.notification-list {
  max-height: 380px;
  overflow-y: auto;
}

.notification-list a {
  display: flex;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-subtle);
  transition: background var(--tr-fast);
}

.notification-list a:hover {
  background: var(--bg-subtle);
}

.notification-list strong {
  display: block;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink);
}

.notification-list small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.panel-footer {
  display: block;
  text-align: center;
  padding: 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-subtle);
  border-top: 1px solid var(--line);
  transition: all var(--tr-fast);
}

.panel-footer:hover {
  background: var(--card);
}

/* ==========================================================================
   Page Layout & Headings
   ========================================================================== */

.content {
  padding: 28px 32px 48px;
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  font-size: 11px;
  color: var(--blue);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 5px;
}

.page-head h1 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.6px;
  color: var(--ink);
}

.page-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  max-width: 760px;
  line-height: 1.5;
}

.head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

/* ==========================================================================
   Button System
   ========================================================================== */

.btn {
  height: 42px;
  border: 0;
  border-radius: 11px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  transition: all var(--tr-fast);
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

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

.btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue2) 100%);
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  box-shadow: 0 10px 28px -4px rgba(37, 99, 235, 0.45);
}

.btn-success {
  color: #ffffff;
  background: linear-gradient(135deg, var(--green) 0%, var(--green2) 100%);
  box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.35);
}

.btn-light {
  background: var(--card);
  border: 1.5px solid var(--line);
  color: var(--ink);
}

.btn-light:hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  box-shadow: 0 8px 20px -4px rgba(239, 68, 68, 0.35);
}

.btn-ghost {
  border: 1.5px dashed var(--line);
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(37, 99, 235, 0.05);
}

.btn-white {
  background: #ffffff;
  color: var(--blue);
  font-weight: 800;
  box-shadow: var(--shadow);
}

.btn-white:hover {
  background: #f8fafc;
}

.btn-glass {
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  backdrop-filter: blur(10px);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.25);
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 9px;
}

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

/* ==========================================================================
   Grids & Layout Utilities
   ========================================================================== */

.grid {
  display: grid;
  gap: 18px;
}

.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.mb { margin-bottom: 20px; }

/* ==========================================================================
   Card System
   ========================================================================== */

.card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  transition: all var(--tr-smooth);
}

.card:hover {
  box-shadow: var(--shadow);
}

.pad {
  padding: 22px;
}

.card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.card-title h3 {
  font-size: 15.5px;
  font-weight: 750;
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.2px;
}

.card-title p {
  font-size: 12px;
  color: var(--muted);
  margin: 3px 0 0;
}

.card-link {
  font-size: 12.5px;
  color: var(--blue);
  font-weight: 700;
  transition: color var(--tr-fast);
}

.card-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Bento KPI Stat Cards
   ========================================================================== */

.stat {
  padding: 20px;
  min-height: 136px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat::before {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  right: -35px;
  top: -35px;
  background: var(--glow, rgba(37, 99, 235, 0.08));
  pointer-events: none;
}

.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--grad, linear-gradient(135deg, var(--blue), var(--blue2)));
  color: #ffffff;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px var(--shade, rgba(37, 99, 235, 0.25));
  flex: 0 0 auto;
}

.stat-icon svg {
  width: 19px;
  height: 19px;
}

.trend {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 20px;
  color: var(--success);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.trend.down {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.2);
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  margin: 6px 0 2px;
  letter-spacing: -0.8px;
  color: var(--ink);
  line-height: 1.15;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-note {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
}

/* Hero Banner */
.hero-banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 55%, #10b981 100%);
  color: #ffffff;
  padding: 28px 32px;
  border: 0;
  box-shadow: 0 12px 36px -6px rgba(37, 99, 235, 0.35);
}

.hero-banner::after, .hero-banner::before {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 60px solid rgba(255, 255, 255, 0.07);
}

.hero-banner::after {
  width: 260px;
  height: 260px;
  right: -90px;
  top: -100px;
}

.hero-banner::before {
  width: 170px;
  height: 170px;
  right: 180px;
  bottom: -110px;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
}

.hero-content h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0 0 6px;
  line-height: 1.2;
}

.hero-content p {
  font-size: 13.5px;
  opacity: 0.9;
  margin: 0;
  max-width: 680px;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

/* ==========================================================================
   Dashboard Components & Widgets
   ========================================================================== */

/* Quick Operations Grid */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.quick {
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all var(--tr-smooth);
  box-shadow: var(--shadow-xs);
  color: var(--ink);
}

.quick:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
  box-shadow: var(--shadow-sm);
}

.quick-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--blue);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  margin: 0 auto 4px;
}

.quick-icon svg {
  width: 20px !important;
  height: 20px !important;
}

.quick strong {
  font-size: 12.5px;
  font-weight: 750;
  color: var(--ink);
  display: block;
}

.quick small {
  font-size: 11px;
  color: var(--muted);
  display: block;
  line-height: 1.35;
}

/* Activity Stream */
.activity, .activity-list {
  display: grid;
  gap: 10px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all var(--tr-fast);
}

.activity-item:hover {
  background: var(--bg-subtle);
  border-color: var(--line);
}

.activity-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--blue);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.activity-icon svg {
  width: 18px !important;
  height: 18px !important;
}

.activity-icon.warning {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.activity-icon.danger {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.activity-icon.success {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.activity-icon.info {
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue);
}

.activity-item strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  display: block;
}

.activity-item small {
  font-size: 11.5px;
  color: var(--muted);
  display: block;
  margin-top: 1px;
}

.activity-item time {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* Operational Health Progress Rows */
.progress-row {
  margin-bottom: 14px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 6px;
}

.progress-meta span {
  color: var(--muted);
  font-weight: 600;
}

.progress-meta strong {
  font-weight: 750;
  color: var(--ink);
}

.progress {
  height: 7px;
  background: var(--bg-subtle);
  border-radius: 99px;
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.4s ease;
}

/* Charts (Bar & Donut) */
.bar-chart {
  height: 220px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 20px 8px 30px;
  border-bottom: 1.5px solid var(--line);
}

.bar-group {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 100%;
  position: relative;
}

.bar {
  flex: 1;
  border-radius: 6px 6px 0 0;
  min-height: 6px;
  transition: all var(--tr-smooth);
}

.bar:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.bar.blue {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
}

.bar.green {
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
}

.bar-group label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -24px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.legend {
  display: flex;
  gap: 18px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}

.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.legend i.line1 {
  background: #2563eb;
}

.legend i.line2 {
  background: #10b981;
}

.donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 16px 0;
}

.donut {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(#2563eb 0% 46%, #10b981 46% 77%, #8b5cf6 77% 92%, #f59e0b 92% 100%);
  position: relative;
  flex: 0 0 auto;
  box-shadow: 0 8px 24px -4px rgba(37, 99, 235, 0.15);
}

.donut::after {
  content: "";
  position: absolute;
  inset: 22px;
  background: var(--card);
  border-radius: 50%;
}

.donut-center {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  text-align: center;
}

.donut-center strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

.donut-center small {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.donut-list {
  display: grid;
  gap: 10px;
}

.donut-list div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.donut-list i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.donut-list span {
  color: var(--muted);
}

.donut-list b {
  margin-left: auto;
  color: var(--ink);
  font-weight: 750;
}

/* Guidance KPI Cards & Icons */
.guidance-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.guidance-kpi {
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border-radius: var(--r);
  background: var(--card);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: all var(--tr-smooth);
}

.guidance-kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(37, 99, 235, 0.3);
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue);
}

.kpi-icon svg {
  width: 20px !important;
  height: 20px !important;
}

.guidance-kpi.blue .kpi-icon { background: rgba(37, 99, 235, 0.12); color: var(--blue); }
.guidance-kpi.green .kpi-icon { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.guidance-kpi.purple .kpi-icon { background: rgba(139, 92, 246, 0.12); color: var(--purple); }
.guidance-kpi.orange .kpi-icon { background: rgba(245, 158, 11, 0.12); color: var(--warning); }

.guidance-kpi small {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 750;
  color: var(--muted);
}

.guidance-kpi strong {
  display: block;
  font-size: 24px;
  font-weight: 800;
  margin: 4px 0;
  color: var(--ink);
  line-height: 1.2;
}

.guidance-kpi p {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin: 0;
}

/* ==========================================================================
   Document Verification & KYC Media Components
   ========================================================================== */

.document-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.document-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  box-shadow: var(--shadow-xs);
  transition: all var(--tr-smooth);
  overflow: hidden;
}

.document-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: var(--shadow-sm);
}

.document-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--blue);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.document-icon svg {
  width: 18px !important;
  height: 18px !important;
}

.doc-preview-wrap,
.document-card .doc-preview,
.document-card > div > div[style*="min-height:100px"],
.document-card > div > div[style*="min-height: 100px"] {
  max-height: 130px;
  min-height: 96px;
  max-width: 100%;
  overflow: hidden;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 10px !important;
  background: var(--bg-subtle) !important;
  border: 1.5px dashed var(--line) !important;
  border-radius: 10px !important;
  margin-bottom: 12px !important;
  text-align: center;
}

.document-card img,
.document-grid img,
.doc-thumb-img,
.deal-media-thumb {
  max-height: 100px !important;
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  border-radius: 6px !important;
  display: block !important;
  margin: 0 auto !important;
  box-shadow: var(--shadow-xs);
}

.document-card span svg,
.document-card div svg {
  max-width: 28px;
  max-height: 28px;
}

.doc-type-icon,
.document-card span[style*="font-size:28px"],
.document-card span[style*="font-size: 28px"] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 42px !important;
  height: 42px !important;
  margin: 0 auto 6px !important;
  background: rgba(37, 99, 235, 0.08) !important;
  border-radius: 10px !important;
  color: var(--blue) !important;
}

.doc-type-icon svg,
.document-card span[style*="font-size:28px"] svg,
.document-card span[style*="font-size: 28px"] svg {
  width: 22px !important;
  height: 22px !important;
}

/* Profile XL Avatars */
.profile-avatar-xl, .store-avatar {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: #ffffff;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.profile-avatar-xl svg, .store-avatar svg {
  width: 28px !important;
  height: 28px !important;
}

/* Mini Profile Cards */
.mini-profile-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: var(--r);
  border: 1.5px solid var(--line);
  background: var(--card);
}

.mini-profile-card > span {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--blue);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.mini-profile-card > span svg {
  width: 18px !important;
  height: 18px !important;
}

.mini-profile-card small {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 750;
  margin-top: 10px;
}

.mini-profile-card strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  margin-top: 2px;
}

.mini-profile-card p {
  font-size: 11.5px;
  color: var(--muted);
  margin: 3px 0 0;
}

/* ==========================================================================
   Table & Data Grid System
   ========================================================================== */

.table-card {
  overflow: hidden;
}

.table-toolbar {
  padding: 16px 20px;
  border-bottom: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-subtle);
}

.table-search {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 380px;
}

.table-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}

.table-search input {
  width: 100%;
  height: 38px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  padding: 0 12px 0 36px;
  font-size: 13px;
  outline: 0;
  transition: all var(--tr-smooth);
}

.table-search input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-left: auto;
}

.filter-select, .filter-date, .filter {
  height: 38px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 500;
  outline: 0;
  transition: all var(--tr-fast);
}

.filter-select:focus, .filter-date:focus, .filter:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.table-wrap {
  overflow-x: auto;
  background: var(--card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
  text-align: left;
}

.data-table th {
  background: var(--bg-subtle);
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 13px 16px;
  border-bottom: 1.5px solid var(--line);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: middle;
  color: var(--ink);
}

.data-table tbody tr {
  transition: background var(--tr-fast);
}

.data-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.035);
}

.record-primary {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 160px;
}

.record-primary .avatar {
  flex: 0 0 auto;
}

.record-primary strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.record-primary small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

.entity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.entity strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.entity small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.date-cell {
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 99px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  line-height: 1;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.success {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge.warning {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge.danger {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge.info {
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.badge.purple {
  background: rgba(139, 92, 246, 0.12);
  color: var(--purple);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.badge.muted {
  background: rgba(100, 116, 139, 0.1);
  color: var(--muted);
  border: 1px solid rgba(100, 116, 139, 0.2);
}

/* Row Actions */
.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.row-actions form {
  display: inline-flex;
  margin: 0;
}

.action-btn {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--muted);
  border-radius: 8px;
  display: grid;
  place-items: center;
  transition: all var(--tr-fast);
}

.action-btn:hover {
  color: var(--blue);
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.05);
}

.action-btn.danger-action:hover {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.05);
}

.action-btn svg {
  width: 14px;
  height: 14px;
}

/* Pagination */
.pagination {
  padding: 14px 20px;
  border-top: 1.5px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12.5px;
  background: var(--bg-subtle);
}

.pagination-info strong {
  color: var(--ink);
}

.pages {
  display: flex;
  gap: 6px;
}

.page-btn {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 8px;
  font-weight: 700;
  font-size: 12px;
  display: grid;
  place-items: center;
  transition: all var(--tr-fast);
}

.page-btn:hover:not(.disabled) {
  border-color: var(--blue);
  color: var(--blue);
}

.page-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.page-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Empty State */
.table-empty {
  padding: 56px 20px !important;
  text-align: center;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.empty-state span {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(37, 99, 235, 0.08);
  display: grid;
  place-items: center;
  color: var(--blue);
}

.empty-state svg {
  width: 26px;
  height: 26px;
}

.empty-state strong {
  font-size: 15px;
  font-weight: 750;
  color: var(--ink);
}

.empty-state small {
  font-size: 12.5px;
  color: var(--muted);
  max-width: 340px;
}

/* ==========================================================================
   Form Controls, Inputs & Textboxes (Modern Redesign)
   ========================================================================== */

.form-page {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.7fr);
  gap: 20px;
}

.form-card {
  padding: 0;
  overflow: hidden;
}

.form-card-head {
  padding: 20px 24px;
  border-bottom: 1.5px solid var(--line);
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--bg-subtle);
}

.form-card-head > span {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  color: #ffffff;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.form-card-head svg {
  width: 20px;
  height: 20px;
}

.form-card-head h3 {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
  color: var(--ink);
}

.form-card-head p {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 0;
}

.form-body {
  padding: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 750;
  margin-bottom: 8px;
}

.field label em {
  font-style: normal;
  font-size: 10.5px;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  padding: 2px 7px;
  border-radius: 12px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
}

/* Modern Inputs, Selects & Textareas */
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 11px;
  outline: 0;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--tr-smooth);
}

.field input,
.field select {
  height: 44px;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #cbd5e1;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  background: var(--card);
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted-light);
}

.field-help {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

/* Input with Icon */
.input-icon {
  position: relative;
  width: 100%;
}

.input-icon > svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
}

.input-icon input {
  padding-left: 42px !important;
  padding-right: 42px !important;
}

/* Checkboxes & Switches */
.field-check {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  border-radius: 11px;
  padding: 0 14px;
  cursor: pointer;
  transition: all var(--tr-fast);
}

.field-check:hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
}

.field-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
  margin: 0;
  cursor: pointer;
}

.field-check span {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.switch-row:last-child {
  border-bottom: 0;
}

.switch-row strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.switch-row small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.switch {
  width: 44px;
  height: 24px;
  border: 0;
  border-radius: 20px;
  background: #cbd5e1;
  position: relative;
  cursor: pointer;
  transition: background var(--tr-fast);
  flex: 0 0 auto;
}

.switch::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  top: 3px;
  left: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform var(--tr-fast);
}

.switch.on {
  background: var(--blue);
}

.switch.on::after {
  transform: translateX(20px);
}

/* File Upload Field */
.upload-field {
  border: 2px dashed rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.035);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  gap: 16px;
  align-items: center;
  transition: all var(--tr-fast);
}

.upload-field:hover {
  border-color: var(--blue);
  background: rgba(37, 99, 235, 0.06);
}

.upload-field input[type="file"] {
  width: min(260px, 48%);
  background: var(--card) !important;
  border: 1.5px solid var(--line);
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 12px;
}

.upload-field strong {
  display: block;
  font-size: 13px;
  font-weight: 750;
  color: var(--ink);
}

.upload-field small, .upload-field span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
}

/* Form Footer */
.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 24px;
  border-top: 1.5px solid var(--line);
  background: var(--bg-subtle);
}

/* Side Guides */
.side-card {
  padding: 20px;
}

.form-guide {
  display: grid;
  gap: 16px;
}

.guide-item {
  display: flex;
  gap: 12px;
}

.guide-number {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue);
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 900;
  flex: 0 0 auto;
}

.guide-item strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}

.guide-item small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.45;
}

/* Detail Lists */
.detail-list {
  display: grid;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-row span {
  color: var(--muted);
  font-weight: 500;
}

.detail-row strong {
  text-align: right;
  font-weight: 700;
  color: var(--ink);
}

/* Code Inputs */
.code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  background: #0f172a !important;
  color: #f8fafc !important;
  border-color: #1e293b !important;
}

/* ==========================================================================
   Notice & Alert Banners
   ========================================================================== */

.notice {
  padding: 14px 18px;
  border: 1.5px solid rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.08);
  border-radius: var(--r);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  transition: all var(--tr-smooth);
}

.notice-icon, .notice > span {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(37, 99, 235, 0.15);
  color: var(--blue);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.notice-icon svg, .notice > span svg {
  width: 16px;
  height: 16px;
}

.notice-body, .notice > div {
  flex: 1;
}

.notice strong {
  font-size: 13px;
  font-weight: 800;
  display: block;
  color: var(--ink);
}

.notice p {
  font-size: 12.5px;
  color: var(--ink-light);
  margin: 3px 0 0;
  line-height: 1.45;
}

.notice.success {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.08);
}

.notice.success .notice-icon, .notice.success > span {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.notice.danger {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}

.notice.danger .notice-icon, .notice.danger > span {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.notice.warn, .notice.warning {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.08);
}

.notice.warn .notice-icon, .notice.warning > span {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.dismiss-notice {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  padding: 0;
  line-height: 1;
  cursor: pointer;
  transition: color var(--tr-fast);
}

.dismiss-notice:hover {
  color: var(--ink);
}

.notice-leaving {
  opacity: 0;
  transform: translateY(-8px);
}

/* ==========================================================================
   Spotlight Command Palette (⌘ K)
   ========================================================================== */

.command-palette {
  position: fixed;
  inset: 0;
  background: rgba(9, 14, 23, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 400;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  opacity: 0;
  visibility: hidden;
  transition: all var(--tr-smooth);
}

.command-palette.show {
  opacity: 1;
  visibility: visible;
}

.command-box {
  width: min(640px, calc(100% - 32px));
  max-height: 75vh;
  overflow: hidden;
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.35);
  border: 1.5px solid var(--line);
  display: flex;
  flex-direction: column;
}

.command-search {
  height: 62px;
  border-bottom: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: var(--bg-subtle);
}

.command-search svg {
  width: 20px;
  height: 20px;
  color: var(--blue);
  flex: 0 0 auto;
}

.command-search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: 0;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
}

.command-search kbd {
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 8px;
  color: var(--muted);
  background: var(--card);
}

.command-results {
  padding: 10px;
  overflow-y: auto;
  max-height: calc(75vh - 62px);
}

.command-results a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  transition: all var(--tr-fast);
}

.command-results a.hide {
  display: none;
}

.command-results a:hover,
.command-results a.selected {
  background: var(--bg-subtle);
}

.command-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue);
  flex: 0 0 auto;
}

.command-icon svg {
  width: 17px;
  height: 17px;
}

.command-info {
  flex: 1;
  min-width: 0;
}

.command-info strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.command-info small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

.command-enter {
  font-style: normal;
  color: var(--muted);
  font-size: 13px;
}

/* ==========================================================================
   Toasts & Modals
   ========================================================================== */

.toast-container {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 300;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 290px;
  background: var(--card);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-lg);
  border-radius: 13px;
  padding: 13px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  animation: toastSlideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.toast-icon svg {
  width: 16px;
  height: 16px;
}

.toast.error .toast-icon {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.toast strong {
  display: block;
  font-size: 13px;
  font-weight: 750;
  color: var(--ink);
}

.toast small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 1px;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Modal System */
.modal-shell, .modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--tr-smooth);
}

.modal-shell.show, .modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 14, 23, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-card, .modal {
  position: relative;
  z-index: 1;
  width: min(600px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.35);
  border: 1.5px solid var(--line);
  padding: 22px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1.5px solid var(--line);
}

.modal-head h3 {
  font-size: 17px;
  font-weight: 800;
  margin: 0;
  color: var(--ink);
}

.modal-head p {
  font-size: 12px;
  color: var(--muted);
  margin: 3px 0 0;
}

.modal-head button, .close-modal {
  border: 0;
  background: var(--bg-subtle);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
}

.modal-actions, .modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1.5px solid var(--line);
}

/* ==========================================================================
   Auth / Login Modern Page
   ========================================================================== */

.auth-body {
  background: #090e17;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.auth-page {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  background: #f8fafc;
}

.auth-visual {
  background: linear-gradient(140deg, #0f172a 0%, #1e3a8a 45%, #047857 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.auth-glow-orb {
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, rgba(16, 185, 129, 0.15) 50%, transparent 70%);
  top: 10%;
  left: 10%;
  pointer-events: none;
  filter: blur(40px);
}

.visual-content {
  max-width: 540px;
  position: relative;
  z-index: 1;
}

.visual-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px 8px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 24px;
  backdrop-filter: blur(12px);
}

.visual-logo {
  width: 42px;
  height: 42px;
  background: #ffffff;
  padding: 5px;
  border-radius: 12px;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.brand-title span {
  color: #38bdf8;
}

.brand-subtitle {
  font-size: 10.5px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.visual-eyebrow {
  color: #93c5fd;
}

.visual-content h1 {
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -0.9px;
  font-weight: 800;
  margin: 14px 0 16px;
  color: #ffffff;
}

.visual-content p {
  font-size: 14.5px;
  color: #cbd5e1;
  line-height: 1.6;
}

.visual-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 32px;
}

.visual-feature {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(8px);
}

.vf-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.vf-icon svg {
  width: 18px;
  height: 18px;
}

.visual-feature strong {
  display: block;
  font-size: 12.5px;
  font-weight: 750;
  color: #ffffff;
}

.visual-feature small {
  display: block;
  font-size: 11px;
  color: #94a3b8;
}

.login-proof {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 36px;
}

.login-proof span {
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}

.proof-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  margin-right: 6px;
}

/* Auth Right Panel */
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  padding: 40px;
  min-height: 0;
  overflow: hidden;
}

.login-box {
  width: 100%;
  max-width: 440px;
  padding: 36px 32px;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
}

.mobile-login-logo {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.mobile-login-logo img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.mobile-login-logo strong {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

.login-box h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 4px 0 0;
  letter-spacing: -0.6px;
  color: var(--ink);
}

.login-subtitle {
  color: var(--muted);
  font-size: 13.5px;
  margin: 6px 0 24px;
}

.login-box .field {
  margin-bottom: 18px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px;
  border-radius: 6px;
}

.password-toggle svg {
  width: 17px;
  height: 17px;
}

.remember {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  margin: 10px 0 24px;
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-light);
  font-weight: 550;
  cursor: pointer;
}

.remember-label input {
  accent-color: var(--blue);
  width: 16px;
  height: 16px;
}

.forgot-link {
  color: var(--blue);
  font-weight: 700;
}

.login-submit {
  width: 100%;
  height: 46px;
  font-size: 14px;
}

.security-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  margin-top: 20px;
  border-radius: 12px;
  background: var(--bg-subtle);
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}

.security-note svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--success);
  margin-top: 1px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1280px) {
  .g5 { grid-template-columns: repeat(3, 1fr); }
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .form-page { grid-template-columns: 1fr; }
}

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: none;
  }
  .main {
    margin-left: 0;
  }
  .menu-btn {
    display: grid;
  }
  .sidebar-close {
    display: block;
  }
  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 14, 23, 0.5);
    backdrop-filter: blur(4px);
    z-index: 70;
    display: none;
  }
  .mobile-overlay.show {
    display: block;
  }
  .topbar {
    padding: 0 18px;
  }
  .top-search-wrap {
    display: none;
  }
  .profile-text {
    display: none;
  }
  .content {
    padding: 22px 18px 36px;
  }
  .g3, .g2 {
    grid-template-columns: 1fr;
  }
  .span2 {
    grid-column: span 1;
  }
  .auth-page {
    grid-template-columns: 1fr;
  }
  .auth-visual {
    display: none;
  }
  .auth-panel {
    min-height: 100dvh;
  }
  .mobile-login-logo {
    display: flex;
  }
}

@media (max-width: 640px) {
  .page-head {
    flex-direction: column;
  }
  .head-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .head-actions .btn {
    flex: 1;
  }
  .g4, .g5 {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .top-quick {
    display: none;
  }
  .notification-panel {
    right: 12px;
    width: calc(100% - 24px);
  }
  .hero-content {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-actions {
    width: 100%;
  }
  .hero-actions .btn {
    flex: 1;
  }
  .filter-bar {
    width: 100%;
  }
  .filter-select, .filter-date {
    flex: 1;
  }
  .form-footer {
    flex-direction: column-reverse;
  }
  .form-footer .btn {
    width: 100%;
  }
}
