/* Medinova Admin Panel CSS */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f172a;
  --bg2: #1e293b;
  --bg3: #334155;
  --border: #475569;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --blue: #3b82f6;
  --green: #22c55e;
  --red: #ef4444;
  --orange: #f97316;
  --purple: #a855f7;
  --teal: #14b8a6;
  --yellow: #eab308;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 52px;
  gap: 24px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}
.brand-text { font-weight: 600; font-size: 15px; }
.badge-admin {
  background: #dc2626; color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 5px; border-radius: 4px; margin-left: 6px;
  vertical-align: middle; letter-spacing: .5px;
}
.nav-links { display: flex; list-style: none; gap: 4px; flex: 1; margin-left: 8px; flex-wrap: wrap; }
.nav-separator-item { color: var(--border); padding: 6px 2px; font-size: 13px; list-style: none; }
.nav-links a {
  display: block; padding: 6px 14px; border-radius: 6px;
  color: var(--text2); text-decoration: none; font-size: 13px;
  transition: background .15s, color .15s;
}
.nav-links a:hover, .nav-links a.active {
  background: var(--bg3); color: var(--text);
}
.nav-user { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.user-email { color: var(--text2); font-size: 13px; }
.btn-logout {
  background: transparent; border: 1px solid var(--border);
  color: var(--text2); padding: 5px 12px; border-radius: 6px;
  text-decoration: none; font-size: 12px; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* ── Main content ─────────────────────────────────────────── */
.main-content { padding: 28px 32px; max-width: 1400px; margin: 0 auto; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  padding: 10px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13px;
}
.alert-danger { background: rgba(239,68,68,.15); border: 1px solid var(--red); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,.15); border: 1px solid var(--green); color: #86efac; }
.alert-info { background: rgba(59,130,246,.15); border: 1px solid var(--blue); color: #93c5fd; }

/* ── Page header ──────────────────────────────────────────── */
.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 22px; font-weight: 600; }
.page-subtitle { color: var(--text2); font-size: 13px; }

/* ── KPI grid ─────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 4px; height: 100%;
}
.kpi-blue::before   { background: var(--blue); }
.kpi-green::before  { background: var(--green); }
.kpi-red::before    { background: var(--red); }
.kpi-orange::before { background: var(--orange); }
.kpi-purple::before { background: var(--purple); }
.kpi-teal::before   { background: var(--teal); }

.kpi-value { font-size: 28px; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.kpi-label { font-size: 13px; font-weight: 500; color: var(--text2); margin-bottom: 2px; }
.kpi-sub   { font-size: 11px; color: var(--text2); }

/* ── Section card ─────────────────────────────────────────── */
.section-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}
.section-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 16px; }

/* ── Table ────────────────────────────────────────────────── */
.table-toolbar { margin-bottom: 14px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  background: var(--bg3); color: var(--text2);
  padding: 9px 12px; text-align: left;
  font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
}
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(71,85,105,.4);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,.03); }
.ts { color: var(--text2); font-size: 12px; }
.amount { font-variant-numeric: tabular-nums; }
.empty-msg { text-align: center; color: var(--text2); padding: 32px; }

/* ── Badges ───────────────────────────────────────────────── */
.slug-badge {
  background: var(--bg3); color: var(--text);
  padding: 2px 8px; border-radius: 4px; font-size: 11px; font-family: monospace;
  display: inline-block;
}
.status-badge {
  padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px; display: inline-block;
}
.status-active, .status-success, .status-paid, .status-completed {
  background: rgba(34,197,94,.15); color: #86efac;
}
.status-inactive, .status-failed, .status-error {
  background: rgba(239,68,68,.15); color: #fca5a5;
}
.status-pending, .status-shadow {
  background: rgba(234,179,8,.15); color: #fde047;
}
.status-provisioned {
  background: rgba(59,130,246,.15); color: #93c5fd;
}

/* Shadow toggle */
.shadow-toggle {
  padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 700;
  display: inline-block; transition: opacity .15s;
}
.shadow-on  { background: rgba(234,179,8,.2);  color: #fde047; }
.shadow-off { background: rgba(34,197,94,.2);  color: #86efac; }
.shadow-toggle:hover { opacity: .7; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-sm {
  padding: 4px 10px; border-radius: 5px; font-size: 12px;
  text-decoration: none; display: inline-block; cursor: pointer; border: none;
}
.btn-info { background: rgba(59,130,246,.2); color: #93c5fd; }
.btn-info:hover { background: rgba(59,130,246,.35); }
.btn-primary {
  background: var(--blue); color: #fff; padding: 10px 20px; border-radius: 8px;
  border: none; cursor: pointer; font-size: 14px; font-weight: 500;
  transition: background .15s;
}
.btn-primary:hover { background: #2563eb; }
.btn-full { width: 100%; }

/* ── Search ───────────────────────────────────────────────── */
.search-input {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); padding: 8px 14px; border-radius: 7px;
  font-size: 13px; outline: none; width: 320px; max-width: 100%;
}
.search-input:focus { border-color: var(--blue); }

/* ── Login ────────────────────────────────────────────────── */
.login-body {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: var(--bg);
}
.login-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; padding: 40px; width: 380px;
}
.login-header { text-align: center; margin-bottom: 28px; }
.logo-large {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 26px; margin: 0 auto 14px;
}
.login-header h1 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.login-subtitle { color: var(--text2); font-size: 13px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--text2); }
.form-group input {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); padding: 10px 14px; border-radius: 8px;
  font-size: 14px; outline: none;
}
.form-group input:focus { border-color: var(--blue); }

/* ── Modal ────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal.hidden { display: none; }
.modal-box {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 14px; width: 640px; max-width: 95vw; max-height: 80vh;
  overflow-y: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none; border: none; color: var(--text2);
  font-size: 22px; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 22px; }
.loading-msg, .error-msg { color: var(--text2); font-size: 13px; }

/* ── Detail list ──────────────────────────────────────────── */
.detail-list {
  display: grid; grid-template-columns: 140px 1fr; gap: 6px 16px;
  margin-bottom: 20px;
}
.detail-list dt { color: var(--text2); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .4px; align-self: center; }
.detail-list dd { font-size: 13px; align-self: center; }

code {
  background: var(--bg3); padding: 1px 6px; border-radius: 4px;
  font-family: monospace; font-size: 12px;
}
