/* ================================================================
   NE'SAS SAMSAT V1.0.0 — Global Design System
   Tema: Deep Navy + Amber Gold + Metallic Silver
   ================================================================ */

/* === GOOGLE FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* === CSS VARIABLES (Design Tokens) === */
:root {
  --bg-base: #05080f;
  --bg-surface: #0d1424;
  --bg-elevated: #111827;
  --bg-card: rgba(13, 20, 36, 0.8);
  --bg-card-hover: rgba(17, 24, 39, 0.95);
  
  --gold: #f59e0b;
  --gold-light: #fbbf24;
  --gold-dim: rgba(245, 158, 11, 0.15);
  --gold-border: rgba(245, 158, 11, 0.25);
  
  --silver: #94a3b8;
  --silver-light: #cbd5e1;
  --silver-dim: rgba(148, 163, 184, 0.1);
  
  --blue-accent: #3b82f6;
  --blue-dim: rgba(59, 130, 246, 0.15);
  --teal-accent: #14b8a6;
  --rose-accent: #f43f5e;
  --emerald-accent: #10b981;
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --text-gold: #f59e0b;
  
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(245, 158, 11, 0.3);
  
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow-gold: 0 0 20px rgba(245, 158, 11, 0.15);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --font-body: 'Inter', sans-serif;
  --font-heading: 'Plus Jakarta Sans', sans-serif;
  
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.25;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(245, 158, 11, 0.25); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(245, 158, 11, 0.5); }

/* === ANIMATED BACKGROUND === */
.app-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(245, 158, 11, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(59, 130, 246, 0.03) 0%, transparent 60%),
    var(--bg-base);
  pointer-events: none;
}

.app-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(245, 158, 11, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 158, 11, 0.015) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: gridDrift 60s linear infinite;
  pointer-events: none;
}
@keyframes gridDrift {
  from { background-position: 0 0; }
  to { background-position: -48px -48px; }
}

/* === CARD COMPONENT === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}
.card:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-card), var(--shadow-glow-gold);
  transform: translateY(-2px);
}

/* === METRIC CARD === */
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}
.metric-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-2px);
}
.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}
.metric-card:hover::before { opacity: 1; }

/* === SIDEBAR & NAV === */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  white-space: nowrap;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}
.nav-item.active {
  background: var(--gold-dim);
  color: var(--gold-light);
  border-color: var(--gold-border);
  font-weight: 600;
}
.nav-item.active svg { color: var(--gold-light); }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold), #d97706);
  color: #fff;
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.45);
  transform: translateY(-1px);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border-color: var(--border-card);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}
.btn-danger {
  background: rgba(244, 63, 94, 0.1);
  color: #f43f5e;
  border-color: rgba(244, 63, 94, 0.25);
}
.btn-danger:hover {
  background: rgba(244, 63, 94, 0.2);
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.2);
}

/* === BADGES === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.badge-gold { background: var(--gold-dim); color: var(--gold-light); border: 1px solid var(--gold-border); }
.badge-green { background: rgba(16, 185, 129, 0.12); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.25); }
.badge-blue { background: var(--blue-dim); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.25); }
.badge-red { background: rgba(244, 63, 94, 0.1); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.25); }
.badge-gray { background: var(--silver-dim); color: var(--silver); border: 1px solid rgba(148, 163, 184, 0.2); }

/* === FORM INPUTS === */
.input-field {
  width: 100%;
  background: rgba(5, 8, 15, 0.6);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 0.875rem;
  font-family: var(--font-body);
  transition: all var(--transition-fast);
  outline: none;
}
.input-field::placeholder { color: var(--text-muted); }
.input-field:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
  background: rgba(5, 8, 15, 0.8);
}
.input-field:hover:not(:focus) { border-color: rgba(255, 255, 255, 0.12); }

select.input-field option { background: var(--bg-elevated); color: var(--text-primary); }

/* === TABLE === */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  background: rgba(5, 8, 15, 0.5);
  padding: 11px 16px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}
.data-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}
.data-table tbody tr:hover {
  background: rgba(245, 158, 11, 0.04);
  transform: none;
  box-shadow: none;
}
.data-table tbody td {
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: none;
}
.data-table tbody td:first-child { color: var(--text-primary); font-weight: 500; }

/* === ANIMATIONS === */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}

.animate-fade-in { animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.animate-fade-in.delay-100 { animation-delay: 0.1s; }
.animate-fade-in.delay-200 { animation-delay: 0.2s; }
.animate-fade-in.delay-300 { animation-delay: 0.3s; }
.animate-fade-in.delay-400 { animation-delay: 0.4s; }
.animate-slide-up { animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }

/* === SCANLINE (subtle) === */
.scanline {
  position: fixed; left: 0; width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.5), transparent);
  animation: scanMove 8s linear infinite;
  opacity: 0.12;
  pointer-events: none;
  z-index: 1;
}
@keyframes scanMove {
  0% { top: -2%; }
  100% { top: 102%; }
}

/* === TOPBAR === */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(5, 8, 15, 0.7);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 40;
}

/* === SIDEBAR DRAWER === */
.sidebar-drawer {
  position: fixed;
  inset-y: 0; left: 0;
  width: 260px;
  background: rgba(5, 8, 15, 0.95);
  backdrop-filter: blur(30px);
  border-right: 1px solid var(--border-subtle);
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.sidebar-drawer.open { transform: translateX(0); }

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}
.sidebar-backdrop.visible { opacity: 1; visibility: visible; }

/* === SECTION HEADING === */
.section-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.section-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* === DIVIDER === */
.divider { height: 1px; background: var(--border-subtle); }

/* === LOADING STATE === */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === STATUS DOT === */
.status-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.green { background: var(--emerald-accent); box-shadow: 0 0 6px var(--emerald-accent); }
.status-dot.red { background: var(--rose-accent); box-shadow: 0 0 6px var(--rose-accent); }
.status-dot.gold { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.status-dot.gray { background: var(--silver); }

/* === PANEL HEADER === */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

/* Utility: remove default browser table row hover/transform */
tr { transition: background var(--transition-fast); }
tr:hover { transform: none; box-shadow: none; }
td { border-bottom: 1px solid var(--border-subtle); }
