/* ============================================================
   TERMINALX999 - Elite Cyber Security & Admin Platform
   Theme: Pure Black (#060609), Crisp White (#ffffff), Neon Red (#ef4444)
   Aesthetics: Sleek Dark Glassmorphism, Micro Red Glowing Accents, Minimal Sharp Curves
   ============================================================ */

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

:root {
  /* ── Core Brand (Neon Red & Fiery Crimson) ── */
  --accent:          #ef4444;
  --accent-dark:     #dc2626;
  --accent-light:    rgba(239, 68, 68, 0.14);
  --accent-glow:     rgba(239, 68, 68, 0.45);
  --accent-red:      #ef4444;
  --accent-red-glow: rgba(239, 68, 68, 0.5);

  /* ── Status Colors ── */
  --success:         #22c55e;
  --success-bg:      rgba(34, 197, 94, 0.14);
  --success-border:  rgba(34, 197, 94, 0.32);
  --success-text:    #4ade80;

  --danger:          #ef4444;
  --danger-bg:       rgba(239, 68, 68, 0.14);
  --danger-border:   rgba(239, 68, 68, 0.35);
  --danger-text:     #f87171;

  --warning:         #f59e0b;
  --warning-bg:      rgba(245, 158, 11, 0.14);
  --warning-border:  rgba(245, 158, 11, 0.32);
  --warning-text:    #fbbf24;

  --info:            #06b6d4;
  --info-bg:         rgba(6, 182, 212, 0.14);
  --info-border:     rgba(6, 182, 212, 0.32);
  --info-text:       #22d3ee;

  --purple:          #a855f7;
  --purple-bg:       rgba(168, 85, 247, 0.14);
  --purple-border:   rgba(168, 85, 247, 0.32);
  --purple-text:     #c084fc;

  /* ── Sidebar (Deep Carbon Cyber) ── */
  --sidebar-bg:      #09090e;
  --sidebar-surface: #0f0f18;
  --sidebar-hover:   rgba(255, 255, 255, 0.05);
  --sidebar-active:  rgba(239, 68, 68, 0.14);
  --sidebar-border:  rgba(255, 255, 255, 0.07);
  --sidebar-text:    #94a3b8;
  --sidebar-text-hi: #ffffff;
  --sidebar-accent:  #ef4444;

  /* ── Body & Glass Cards (Pure Cyber Black) ── */
  --body-bg:         #050508;
  --card-bg:         rgba(13, 13, 20, 0.88);
  --card-bg-alt:     rgba(20, 20, 30, 0.72);
  --card-bg-hover:   rgba(25, 25, 38, 0.95);
  
  --text:            #ffffff;
  --text-muted:      #94a3b8;
  --text-light:      #64748b;
  
  --border:          rgba(255, 255, 255, 0.08);
  --border-subtle:   rgba(255, 255, 255, 0.05);
  --border-focus:    #ef4444;
  --border-glow:     rgba(239, 68, 68, 0.45);

  /* ── High-Tech Radii (Minimal Sharp Curves) ── */
  --radius-xs:       3px;
  --radius-sm:       4px;
  --radius:          6px;
  --radius-lg:       8px;

  /* ── Shadows & Glows ── */
  --shadow-xs:       0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-sm:       0 3px 12px rgba(0, 0, 0, 0.55);
  --shadow:          0 6px 24px rgba(0, 0, 0, 0.65);
  --shadow-lg:       0 16px 48px rgba(0, 0, 0, 0.75);
  --glow-red:        0 0 20px rgba(239, 68, 68, 0.35);

  /* ── Typography ── */
  --font:            'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono:       'JetBrains Mono', 'Fira Code', Consolas, monospace;

  --transition:      all .18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ══ Universal Reset & Base ══════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font);
  background: var(--body-bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: #f87171;
}

img {
  display: block;
  max-width: 100%;
}

/* ── Clean Scroll (No Ugly Scrollbars, 100% Smooth Scrolling) ── */
*, html, body, div, table, tbody, select, input, textarea {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
::-webkit-scrollbar,
*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

/* ══ Layout (GPU Layer Accelerated) ══════════════════════════════ */
.layout {
  display: block;
  min-height: 100vh;
  width: 100%;
  box-sizing: border-box;
  background-color: #060609;
  position: relative;
}

.layout::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(239, 68, 68, 0.08) 0%, transparent 70%),
    linear-gradient(180deg, #07070b 0%, #050508 100%);
  pointer-events: none;
  z-index: 0;
  transform: translateZ(0);
  will-change: transform;
}

.sidebar, .main {
  position: relative;
  z-index: 1;
}

/* ── Sidebar Backdrop for Mobile ── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1040;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sidebar-close-btn {
  display: none;
}

/* ══ Upgraded Sidebar ═════════════════════════════════════════ */
.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  border-right: 1px solid var(--sidebar-border);
  overflow-y: auto;
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.4);
}

/* Sidebar Header / Brand */
.sidebar-logo {
  padding: 18px 18px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--sidebar-border);
  background: linear-gradient(180deg, rgba(20, 20, 30, 0.4) 0%, transparent 100%);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.45);
}

.logo-text {
  font-size: 12.5px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.8px;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo-beacon {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  display: inline-block;
  animation: beaconPulse 2s infinite ease-in-out;
}

@keyframes beaconPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.logo-version {
  font-size: 10px;
  color: #64748b;
  font-family: var(--font-mono);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.version-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 9px;
  color: #cbd5e1;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 10px 0 20px;
}

.nav-section {
  padding: 16px 18px 6px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: #64748b;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-section::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
  margin-left: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8.5px 14px;
  margin: 2px 10px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 12.5px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  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;
  border-left: 3px solid var(--sidebar-accent);
  padding-left: 11px;
  box-shadow: inset 0 0 14px rgba(239, 68, 68, 0.1);
}

.nav-item.active .nav-icon {
  color: var(--sidebar-accent);
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.5));
}

.nav-icon {
  font-size: 14.5px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.nav-item:hover .nav-icon {
  transform: scale(1.1);
}

/* Sidebar Footer / User Card */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--sidebar-border);
  background: rgba(10, 10, 15, 0.6);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-user:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.user-info .user-name {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info .user-role {
  font-size: 10px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.user-role-beacon {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

/* ══ Main Content ════════════════════════════════════════════ */
.main {
  margin-left: 240px;
  width: calc(100% - 240px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-sizing: border-box;
  position: relative;
}

/* ── Topbar (Frosted Cyber Glass) ── */
.topbar {
  background: rgba(9, 9, 14, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  width: 100%;
  box-sizing: border-box;
  transform: translateZ(0);
}

.topbar-title {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

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

.branding-grid-2 {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}

@media (max-width: 960px) {
  .branding-grid-2 {
    grid-template-columns: 1fr;
  }
}

.sidebar-toggle {
  display: none;
}

/* Content Area */
.content {
  padding: 24px 28px;
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ══ Cards ═══════════════════════════════════════════════════ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  position: relative;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius) var(--radius) 0 0;
}

.card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 20px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

/* ══ Stats Grid ══════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.dashboard-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  min-width: 0;
  box-sizing: border-box;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow);
}

.stat-accent-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.stat-card.blue   .stat-accent-line { background: #3b82f6; box-shadow: 0 0 10px rgba(59, 130, 246, 0.6); }
.stat-card.green  .stat-accent-line { background: #22c55e; box-shadow: 0 0 10px rgba(34, 197, 94, 0.6); }
.stat-card.purple .stat-accent-line { background: #a855f7; box-shadow: 0 0 10px rgba(168, 85, 247, 0.6); }
.stat-card.orange .stat-accent-line { background: #f97316; box-shadow: 0 0 10px rgba(249, 115, 22, 0.6); }
.stat-card.red    .stat-accent-line { background: #ef4444; box-shadow: 0 0 10px rgba(239, 68, 68, 0.6); }
.stat-card.cyan   .stat-accent-line { background: #06b6d4; box-shadow: 0 0 10px rgba(6, 182, 212, 0.6); }
.stat-card.amber  .stat-accent-line { background: #eab308; box-shadow: 0 0 10px rgba(234, 179, 8, 0.6); }

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-icon.blue   { background: rgba(59, 130, 246, 0.12); color: #60a5fa; }
.stat-icon.green  { background: rgba(34, 197, 94, 0.12);  color: #4ade80; }
.stat-icon.purple { background: rgba(168, 85, 247, 0.12); color: #c084fc; }
.stat-icon.orange { background: rgba(249, 115, 22, 0.12); color: #fb923c; }
.stat-icon.red    { background: rgba(239, 68, 68, 0.12);  color: #f87171; }
.stat-icon.cyan   { background: rgba(6, 182, 212, 0.12);  color: #22d3ee; }
.stat-icon.amber  { background: rgba(234, 179, 8, 0.12);  color: #fde047; }

.stat-value {
  font-size: 24px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
  margin-top: 2px;
  font-family: var(--font);
}

.stat-label {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 5px;
}

/* ══ Charts ══════════════════════════════════════════════════ */
.chart-container {
  padding: 4px 0;
}

.chart-row {
  display: grid;
  grid-template-columns: 100px 1fr 40px;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.chart-row:last-child {
  margin-bottom: 0;
}

.chart-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-track {
  height: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.chart-fill {
  height: 100%;
  border-radius: 2px;
  min-width: 0;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.chart-fill.green  { background: linear-gradient(90deg, #16a34a, #22c55e); box-shadow: 0 0 10px rgba(34,197,94,0.4); }
.chart-fill.red    { background: linear-gradient(90deg, #dc2626, #ef4444); box-shadow: 0 0 10px rgba(239,68,68,0.4); }
.chart-fill.blue   { background: linear-gradient(90deg, #2563eb, #3b82f6); box-shadow: 0 0 10px rgba(59,130,246,0.4); }
.chart-fill.purple { background: linear-gradient(90deg, #7c3aed, #a855f7); box-shadow: 0 0 10px rgba(168,85,247,0.4); }
.chart-fill.orange { background: linear-gradient(90deg, #ea580c, #f97316); box-shadow: 0 0 10px rgba(249,115,22,0.4); }
.chart-fill.cyan   { background: linear-gradient(90deg, #0891b2, #06b6d4); box-shadow: 0 0 10px rgba(6,182,212,0.4); }
.chart-fill.amber  { background: linear-gradient(90deg, #ca8a04, #eab308); box-shadow: 0 0 10px rgba(234,179,8,0.4); }
.chart-fill.slate  { background: linear-gradient(90deg, #334155, #64748b); }

.chart-count {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  text-align: right;
  font-family: var(--font-mono);
}

/* ══ Tables ══════════════════════════════════════════════════ */
.table-wrapper {
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

thead th {
  padding: 10px 16px;
  background: rgba(20, 20, 30, 0.8);
  color: #94a3b8;
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
  font-family: var(--font-mono);
}

thead th:last-child {
  border-right: none;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  color: #ffffff;
  vertical-align: middle;
}

tbody td:last-child {
  border-right: none;
}

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

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: rgba(239, 68, 68, 0.05);
}

.mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.3px;
  color: #cbd5e1;
}

/* ══ Buttons ══════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  font-family: var(--font);
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

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

.btn-primary:hover {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.55);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-accent {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.btn-accent:hover {
  background: #dc2626;
  color: #ffffff;
}

.btn-success {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}
.btn-success:hover {
  background: #22c55e;
  color: #ffffff;
}

.btn-danger {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}
.btn-danger:hover {
  background: #ef4444;
  color: #ffffff;
}

.btn-warning {
  background: #d97706;
  color: #ffffff;
  border-color: #d97706;
}
.btn-warning:hover {
  background: #f59e0b;
  color: #ffffff;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: #ffffff;
  background: rgba(239, 68, 68, 0.12);
}

.btn-ghost {
  background: transparent;
  color: #94a3b8;
  border-color: transparent;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.btn-sm  { padding: 5px 11px; font-size: 11.5px; border-radius: var(--radius-sm); }
.btn-lg  { padding: 11px 24px; font-size: 14px; border-radius: var(--radius-sm); }
.btn-icon { padding: 6px 8px; }

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

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-mono);
}

.form-hint {
  font-size: 11px;
  color: #64748b;
  margin-top: 5px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  color: #ffffff;
  background: rgba(10, 10, 16, 0.75);
  transition: var(--transition);
  outline: none;
  box-sizing: border-box;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
  background: rgba(14, 14, 22, 0.95);
}

.form-control::placeholder {
  color: #64748b;
}

.form-control.mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 10 10'%3E%3Cpath fill='%2394a3b8' d='M5 7L0 2h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

select.form-control option {
  background: #0d0d15;
  color: #ffffff;
}

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

/* ══ Badges ══════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 8px;
  border-radius: var(--radius-xs);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  font-family: var(--font-mono);
  line-height: 1.3;
}

.badge-success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.32);
  color: #4ade80;
}

.badge-danger, .badge-red {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.badge-warning, .badge-orange {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.32);
  color: #fbbf24;
}

.badge-info, .badge-cyan {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.32);
  color: #22d3ee;
}

.badge-purple {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.32);
  color: #c084fc;
}

.badge-blue {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.32);
  color: #60a5fa;
}

.badge-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge-dark {
  background: #101018;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ══ Alerts ══════════════════════════════════════════════════ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 18px;
  border: 1px solid;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}

.alert-success {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.alert-error, .alert-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.alert-info {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.3);
  color: #22d3ee;
}

/* ══ Code Block ══════════════════════════════════════════════ */
.code-block {
  background: #08080d;
  color: #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.75;
  overflow-x: auto;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.code-block .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 3px 9px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 10.5px;
  font-family: var(--font);
  font-weight: 600;
  transition: var(--transition);
}

.code-block .copy-btn:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* ══ Modals ═══════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 8, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: #0d0d15;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(12px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.modal-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #ffffff;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
  transition: var(--transition);
  padding: 2px 6px;
  border-radius: 3px;
}

.modal-close:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.modal-body {
  padding: 20px;
  background: #0d0d15;
  color: #ffffff;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
}

/* ══ Pagination ══════════════════════════════════════════════ */
.pagination {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: center;
  padding: 16px 0;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: #94a3b8;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-family: var(--font-mono);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.page-btn:hover {
  border-color: var(--accent);
  color: #ffffff;
  background: rgba(239, 68, 68, 0.12);
}

.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

/* ══ Empty State ═════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: #94a3b8;
}

.empty-state .empty-icon {
  font-size: 42px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state .empty-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.empty-state .empty-text {
  font-size: 12px;
  color: #64748b;
}

/* ══ Load More Wrap ══════════════════════════════════════════ */
.load-more-wrap {
  text-align: center;
  padding: 14px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ══ Toggle Switch ═══════════════════════════════════════════ */
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: #ffffff;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

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

/* ══ Utility ══════════════════════════════════════════════════ */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.items-center { align-items: center; }
.gap-2        { gap: 8px; }
.gap-3        { gap: 12px; }
.gap-4        { gap: 16px; }
.mt-2         { margin-top: 8px; }
.mt-4         { margin-top: 16px; }
.mb-4         { margin-bottom: 16px; }
.mb-6         { margin-bottom: 24px; }
.text-muted   { color: var(--text-muted) !important; }
.text-small   { font-size: 11.5px; }
.font-bold    { font-weight: 700; }
.text-center  { text-align: center; }
.w-full       { width: 100%; }

/* ══ Copy Toast ══════════════════════════════════════════════ */
.copy-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #10101a;
  color: var(--accent);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(239, 68, 68, 0.35);
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ══ Responsive Media Queries (Mobile & Tablet) ══════════════ */
@media (max-width: 1024px) {
  .sidebar {
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1050;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.8);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 18px;
    color: #cbd5e1;
    cursor: pointer;
    line-height: 1;
    z-index: 100;
    transition: var(--transition);
  }

  .sidebar-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--accent);
    color: #ffffff;
  }

  .sidebar-backdrop.open {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .topbar {
    padding: 0 18px;
    height: 60px;
  }

  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 18px;
    color: #ffffff;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    transition: var(--transition);
  }

  .sidebar-toggle:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--accent);
    color: #ffffff;
  }

  .content {
    padding: 18px;
  }
}

@media (max-width: 900px) {
  .dashboard-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .chart-row {
    grid-template-columns: 80px 1fr 34px;
    gap: 8px;
  }

  .chart-label {
    font-size: 10.5px;
  }

  .card-header {
    padding: 12px 16px;
  }

  .card-body {
    padding: 16px;
  }
}

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

  .topbar {
    padding: 0 12px;
  }

  .topbar-actions span.text-small {
    display: none;
  }

  .topbar-title {
    font-size: 13.5px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .card-header input,
  .card-header select {
    width: 100% !important;
  }

  .content {
    padding: 12px;
  }

  .modal {
    max-width: 95%;
    margin: 10px;
  }

  .modal-footer {
    flex-direction: column;
    gap: 8px;
  }

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