/* ═══════════════════════════════════════════════════════════
   NOGAL EXECUTIVE DESIGN SYSTEM v1.0
   Stripe/Linear/Vercel-inspired dark theme
   ═══════════════════════════════════════════════════════════ */

/* Google Fonts — loaded in each HTML */
/* @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap'); */

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

/* Base */
body {
  background: #0f1419;
  color: #e4e8ec;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  min-height: 100vh;
}
.mono { font-family: 'JetBrains Mono', monospace; }
a { color: inherit; text-decoration: none; }

/* Layout */
.container { max-width: 1400px; margin: 0 auto; padding: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 16px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.grid-60-40 { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.grid-65-35 { display: grid; grid-template-columns: 65fr 35fr; gap: 16px; }

/* Cards */
.card {
  background: #1a2332;
  border: 1px solid #243040;
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.2s ease;
}
.card:hover { border-color: #2d3f54; }
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: #8899aa;
  margin-bottom: 16px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

/* KPI Cards */
.kpi-card {
  background: #1a2332;
  border: 1px solid #243040;
  border-radius: 12px;
  padding: 16px 20px;
  transition: border-color 0.2s ease;
}
.kpi-card:hover { border-color: #2d3f54; }
.kpi-label {
  font-size: 11px;
  font-weight: 500;
  color: #566778;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.kpi-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}
.kpi-sub {
  font-size: 11px;
  color: #566778;
  margin-top: 4px;
}
.kpi-positive { color: #22c55e; }
.kpi-negative { color: #ef4444; }
.kpi-warning { color: #f59e0b; }
.kpi-neutral { color: #e4e8ec; }
.kpi-info { color: #3b82f6; }
.kpi-purple { color: #8b5cf6; }

/* Progress bar */
.progress { height: 6px; background: #243040; border-radius: 3px; overflow: hidden; margin-top: 10px; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.3s ease; }
.progress-green { background: #22c55e; }
.progress-red { background: #ef4444; }
.progress-amber { background: #f59e0b; }
.progress-blue { background: #3b82f6; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #566778;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #243040;
}
td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: #e4e8ec;
}
tr:hover td { background: rgba(255,255,255,0.02); }
tbody tr:nth-child(even) td { background: rgba(255,255,255,0.01); }
tbody tr:nth-child(even):hover td { background: rgba(255,255,255,0.03); }
td.mono { font-family: 'JetBrains Mono', monospace; }
td.right, th.right { text-align: right; }
.tbl-amount { font-family: 'JetBrains Mono', monospace; text-align: right; font-weight: 500; }
.tbl-total td { font-weight: 700; border-top: 2px solid #2d3f54; font-size: 14px; }

/* Badges */
.badge { font-size: 11px; padding: 2px 8px; border-radius: 9999px; font-weight: 500; display: inline-block; }
.badge-green { background: rgba(34,197,94,0.1); color: #22c55e; }
.badge-red { background: rgba(239,68,68,0.1); color: #ef4444; }
.badge-amber { background: rgba(245,158,11,0.1); color: #f59e0b; }
.badge-blue { background: rgba(59,130,246,0.1); color: #3b82f6; }
.badge-purple { background: rgba(139,92,246,0.1); color: #8b5cf6; }
.badge-gray { background: rgba(120,120,120,0.1); color: #8899aa; }

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid #243040;
}
.header-title { font-size: 18px; font-weight: 700; }
.header-sub { font-size: 12px; color: #566778; margin-top: 2px; }
.header-nav { display: flex; gap: 8px; }
.header-nav a {
  font-size: 12px;
  color: #566778;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}
.header-nav a:hover { background: #1a2332; color: #e4e8ec; border-color: #243040; }
.header-nav a.active { background: rgba(34,197,94,0.1); color: #22c55e; border-color: rgba(34,197,94,0.2); }

/* Chart containers */
.chart-container { position: relative; height: 240px; }

/* Section spacing */
.section { margin-bottom: 20px; }
.section-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e4e8ec;
}

/* Traffic lights */
.traffic { display: flex; align-items: center; gap: 8px; }
.traffic-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.traffic-green { background: #22c55e; }
.traffic-red { background: #ef4444; }
.traffic-amber { background: #f59e0b; }

/* Alert box */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 8px; }
.alert-red { background: rgba(239,68,68,0.06); border-left: 3px solid #ef4444; }
.alert-amber { background: rgba(245,158,11,0.06); border-left: 3px solid #f59e0b; }
.alert-green { background: rgba(34,197,94,0.06); border-left: 3px solid #22c55e; }
.alert-blue { background: rgba(59,130,246,0.06); border-left: 3px solid #3b82f6; }

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #566778;
  font-size: 13px;
}
.spinner {
  width: 18px; height: 18px;
  border: 2px solid #243040;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Clock */
.clock {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #8899aa;
}

/* PnL Sections */
.pnl-section-header {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 6px;
  margin-bottom: 4px;
}
.pnl-section-header.income { background: rgba(34,197,94,0.06); color: #22c55e; border-left: 3px solid #22c55e; }
.pnl-section-header.expense { background: rgba(239,68,68,0.06); color: #ef4444; border-left: 3px solid #ef4444; }
.pnl-result { padding: 16px; text-align: center; border-radius: 8px; margin-top: 16px; }
.pnl-result .label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: #8899aa; margin-bottom: 4px; }
.pnl-result .value { font-family: 'JetBrains Mono', monospace; font-size: 28px; font-weight: 700; }

/* Month Selector */
.month-sel { display: flex; align-items: center; gap: 16px; }
.month-sel button {
  background: #1a2332;
  border: 1px solid #243040;
  color: #8899aa;
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.month-sel button:hover { border-color: #3b82f6; color: #3b82f6; }
.month-sel h2 { font-size: 20px; font-weight: 600; min-width: 200px; text-align: center; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0f1419; }
::-webkit-scrollbar-thumb { background: #243040; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #2d3f54; }

/* Status dot */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.green { background: #22c55e; }
.status-dot.red { background: #ef4444; }
.status-dot.amber { background: #f59e0b; }

/* Responsive */
@media (max-width: 1200px) {
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
  .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr 1fr; }
  .grid-60-40, .grid-65-35 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .container { padding: 12px; }
  .header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .kpi-value { font-size: 20px; }
}
