/* GarageCore - Super Admin Portal Stylesheet */
:root {
  --admin-bg: #090c15;
  --admin-sidebar: #0d121f;
  --admin-surface: #141c2e;
  --admin-card: #192338;
  --admin-border: #22304c;
  --admin-text: #f8fafc;
  --admin-muted: #94a3b8;
  --admin-gold: #f59e0b;
  --admin-accent: #38bdf8;
  --admin-primary: #0284c7;
  --admin-success: #10b981;
  --admin-danger: #ef4444;
  --radius: 8px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--admin-bg);
  color: var(--admin-text);
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
}
a { color: var(--admin-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background: var(--admin-sidebar);
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-brand {
  padding: 20px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  letter-spacing: 0.5px;
}
.super-tag {
  background: #f59e0b;
  color: #000;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.sidebar-menu { padding: 16px 12px; flex: 1; }
.menu-header {
  font-size: 11px;
  text-transform: uppercase;
  color: #64748b;
  padding: 8px 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--admin-muted);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius);
  margin-bottom: 2px;
}
.menu-item:hover { background: var(--admin-surface); color: #fff; text-decoration: none; }
.menu-item.active { background: #1e293b; color: #fff; border-left: 3px solid var(--admin-gold); }

/* Main */
.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-header {
  height: 64px;
  background: var(--admin-surface);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.admin-content { padding: 28px; flex: 1; }

/* Page title */
.page-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.page-header-bar h1 { font-size: 24px; font-weight: 800; }

/* Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  border-top: 3px solid var(--admin-gold);
}
.stat-card.blue   { border-top-color: var(--admin-accent); }
.stat-card.green  { border-top-color: var(--admin-success); }
.stat-card.red    { border-top-color: var(--admin-danger); }
.stat-label { font-size: 12px; font-weight: 600; color: var(--admin-muted); text-transform: uppercase; }
.stat-number { font-size: 28px; font-weight: 900; margin-top: 4px; color: #fff; }
.stat-sub { font-size: 12px; color: var(--admin-muted); margin-top: 4px; }

/* Data tables */
.data-panel {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: hidden;
}
.data-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.data-panel-header h3 { font-size: 16px; font-weight: 700; color: #fff; }

.table-wrap { overflow-x: auto; }
table.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}
table.admin-table th {
  background: #0d121f;
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--admin-muted);
  border-bottom: 1px solid var(--admin-border);
}
table.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #1a243a;
  color: #e2e8f0;
}
table.admin-table tr:hover td { background: #162035; }

/* Status Badges */
.badge { display: inline-flex; padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; text-transform: capitalize; }
.badge-active    { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-trialing  { background: rgba(56, 189, 248, 0.2); color: #7dd3fc; }
.badge-past_due  { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-suspended { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.badge-cancelled { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none !important;
}
.btn-primary { background: #0284c7; color: #fff; }
.btn-primary:hover { background: #0369a1; color: #fff; }
.btn-gold    { background: #f59e0b; color: #000; font-weight: 700; }
.btn-gold:hover { background: #d97706; color: #000; }
.btn-secondary { background: #1e293b; color: #cbd5e1; border-color: var(--admin-border); }
.btn-secondary:hover { background: #334155; color: #fff; }
.btn-danger  { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-outline { background: transparent; color: #cbd5e1; border-color: var(--admin-border); }
.btn-outline:hover { border-color: var(--admin-accent); color: var(--admin-accent); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Form Elements */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #cbd5e1; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  background: #090e1a;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
}
.form-control:focus { outline: none; border-color: var(--admin-accent); }

/* Alerts */
.alert { padding: 12px 18px; border-radius: 6px; margin-bottom: 20px; font-size: 14px; }
.alert-success { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.4); color: #34d399; }
.alert-danger  { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.4); color: #f87171; }
.alert-warning { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.4); color: #fbbf24; }
.alert-info    { background: rgba(2, 132, 199, 0.15); border: 1px solid rgba(2, 132, 199, 0.4); color: #38bdf8; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

@media (max-width: 900px) {
  body { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
