/* Atlas Ops Hub — Internal Management UI */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --navy: #0F1E2E;
  --navy-mid: #162638;
  --navy-light: #1E3448;
  --gold: #C5A028;
  --gold-light: #E8C547;
  --green: #10B981;
  --amber: #F59E0B;
  --red: #EF4444;
  --blue: #3B82F6;
  --gray: #6B7280;
  --white: #FFFFFF;
  --card-bg: #FFFFFF;
  --card-border: #DDE3EA;
  --text-primary: #0F1E2E;
  --text-secondary: #4B5563;
  --text-muted: #9CA3AF;
  --body-bg: #F0F4F8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--body-bg);
  color: var(--text-primary);
  min-height: 100vh;
}

/* ─── NAV ─── */
nav {
  background: var(--navy);
  border-bottom: 1px solid rgba(197,160,40,0.3);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 0;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  color: var(--gold);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  margin-right: 2rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 0;
  flex: 1;
}

.nav-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0 1rem;
  height: 56px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.nav-links a:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}

.nav-links a.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.nav-back {
  margin-left: auto;
  color: rgba(255,255,255,0.5) !important;
  font-size: 0.8rem !important;
}

/* ─── HEADER ─── */
.page-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, #1a2f45 100%);
  color: white;
  padding: 2.5rem 2rem 2rem;
  border-bottom: 1px solid rgba(197,160,40,0.2);
}

.page-header h1 {
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.page-header .subtitle {
  color: var(--gold);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ─── STATS STRIP ─── */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: 1.5rem 2rem;
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.stat-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  color: white;
}

.stat-card .label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0.5rem;
}

.stat-card .value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-card .sub {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
}

.stat-card.green .value { color: var(--green); }
.stat-card.white-val .value { color: #fff; }

/* ─── MAIN CONTENT ─── */
.content {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* ─── SECTION HEADERS ─── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-header h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.section-header .count {
  background: var(--navy);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
}

/* ─── CARDS ─── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* ─── CLIENT GRID ─── */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.client-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: box-shadow 0.15s, transform 0.15s;
  position: relative;
  overflow: hidden;
}

.client-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

.client-card .tier-stripe {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.client-card .card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  margin-top: 0.25rem;
}

.client-card .client-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.client-card .client-company {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

/* ─── TIER BADGES ─── */
.tier-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tier-badge.Platinum { background: #FFF8E1; color: #92700A; border: 1px solid #C5A028; }
.tier-badge.Gold     { background: #FFFBEB; color: #92400E; border: 1px solid #F59E0B; }
.tier-badge.Silver   { background: #F3F4F6; color: #374151; border: 1px solid #9CA3AF; }
.tier-badge.Bronze   { background: #EFF6FF; color: #1E40AF; border: 1px solid #3B82F6; }

/* ─── STATUS BADGES ─── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-badge.Active      { background: #ECFDF5; color: #065F46; }
.status-badge.Active::before { background: var(--green); }
.status-badge.Low-Balance { background: #FFFBEB; color: #92400E; }
.status-badge.Low-Balance::before { background: var(--amber); }
.status-badge.Overdue     { background: #FEF2F2; color: #991B1B; }
.status-badge.Overdue::before { background: var(--red); }

/* ─── PROGRESS BAR ─── */
.progress-wrap {
  margin: 0.75rem 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.progress-bar-bg {
  background: #E5E7EB;
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s;
  background: var(--green);
}

.progress-bar-fill.warn  { background: var(--amber); }
.progress-bar-fill.alert { background: var(--red); }

/* ─── DETAIL ROW ─── */
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  padding: 0.25rem 0;
  border-top: 1px solid #F3F4F6;
}

.detail-row .lbl { color: var(--text-muted); }
.detail-row .val { font-weight: 600; color: var(--text-primary); }
.detail-row .val.gold { color: var(--gold); }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--navy);
  color: white;
}

.btn-primary:hover { background: var(--navy-light); }

.btn-gold {
  background: var(--gold);
  color: var(--navy);
}

.btn-gold:hover { background: var(--gold-light); }

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--card-border);
}

.btn-outline:hover { background: #F8FAFC; }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.75rem; }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-full { width: 100%; justify-content: center; margin-top: 1rem; }

/* ─── TABLE ─── */
table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: #F8FAFC;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
}

tbody td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid #F3F4F6;
  color: var(--text-primary);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #FAFBFC; }

/* ─── GAUGE ─── */
.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
}

.gauge-svg { overflow: visible; }

.gauge-number {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.gauge-sub {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ─── CHART AREA ─── */
.chart-wrap {
  padding: 1rem 0;
  overflow-x: auto;
}

/* ─── ACTIVITY FEED ─── */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid #F3F4F6;
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.activity-dot.green  { background: var(--green); }
.activity-dot.gold   { background: var(--gold); }
.activity-dot.amber  { background: var(--amber); }
.activity-dot.blue   { background: var(--blue); }

.activity-content { flex: 1; }
.activity-title { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.activity-meta  { font-size: 0.775rem; color: var(--text-muted); margin-top: 0.15rem; }

.activity-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── GRID LAYOUTS ─── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

/* ─── ALERT BOX ─── */
.alert {
  border-radius: 10px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.alert-amber {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
}

.alert-red {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}

.alert-green {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
}

.alert-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ─── USAGE REPORT STYLES ─── */
.report-card {
  background: #FFFFFF;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  max-width: 680px;
  margin: 0 auto;
}

.report-header {
  background: linear-gradient(135deg, var(--navy) 0%, #1a3a5c 100%);
  padding: 2rem;
  color: white;
}

.report-header .logo { color: var(--gold); font-size: 1.25rem; font-weight: 800; margin-bottom: 0.25rem; }
.report-header .title { font-size: 1rem; opacity: 0.7; }
.report-body { padding: 2rem; }

/* ─── TOP-UP BUTTONS ─── */
.topup-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.topup-btn {
  flex: 1;
  padding: 0.75rem;
  border-radius: 8px;
  border: 2px solid var(--card-border);
  background: white;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  cursor: not-allowed;
  opacity: 0.6;
  text-align: center;
  transition: all 0.15s;
}

/* ─── DONUT CHART ─── */
.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.825rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-label { color: var(--text-secondary); flex: 1; }
.legend-value { font-weight: 700; color: var(--text-primary); }

/* ─── PAYG ─── */
.balance-display {
  text-align: center;
  padding: 2rem;
  background: var(--navy);
  border-radius: 12px;
  color: white;
}

.balance-display .balance-label {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0.5rem;
}

.balance-display .balance-amount {
  font-size: 3rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -0.03em;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  nav { padding: 0 1rem; }
  .content { padding: 1rem; }
  .page-header { padding: 1.5rem 1rem; }
  .stats-strip { padding: 1rem; grid-template-columns: 1fr 1fr; }
  .client-grid { grid-template-columns: 1fr; }
}

/* ─── UTILITIES ─── */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-bold { font-weight: 700; }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-red { color: var(--red); }
.w-full { width: 100%; }
