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

:root {
  --bg-plain:     #181743;
  --glass:        rgba(24,23,67,0.60);
  --glass-lite:   rgba(255,255,255,0.08);
  --glass-border: rgba(255,255,255,0.15);
  --blur:         blur(22px);
  --primary:      #ce650c;
  --primary-dk:   #a84e08;
  --primary-lt:   #de7519;
  --danger:       #ef4444;
  --danger-dk:    #dc2626;
  --warn:         #f59e0b;
  --info:         #3b82f6;
  --success:      #10b981;
  --text:         #ffffff;
  --muted:        rgba(255,255,255,0.65);
  --hint:         rgba(255,255,255,0.40);
  --sidebar-bg:   rgba(15,14,50,0.85);
  --sidebar-txt:  rgba(255,255,255,0.70);
  --sidebar-act:  #ce650c;
  --radius:       8px;
  --radius-lg:    16px;
  --shadow:       0 8px 32px rgba(0,0,0,0.40);
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.25);
}

body {
  font-family: system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  font-size: 14px; line-height: 1.6; color: var(--text);
  background-color: var(--bg-plain);
  background-image: url('/assets/brand/the-aquarium-bg.png');
  background-size: cover; background-position: center;
  background-repeat: no-repeat; background-attachment: fixed;
  min-height: 100vh;
}

a { color: var(--primary-lt); text-decoration: none; }
a:hover { text-decoration: underline; color: #fff; }
code { font-family: "SFMono-Regular",Consolas,monospace; font-size: 12px;
       background: rgba(255,255,255,0.12); padding: 2px 7px; border-radius: 4px; color: #fff; }

/* ── Shell ───────────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar { background: var(--sidebar-bg);
           backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
           border-right: 1px solid var(--glass-border);
           display: flex; flex-direction: column;
           position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-logo { padding: 20px 18px 14px; border-bottom: 1px solid var(--glass-border); }
.sidebar-logo img { width: 100%; max-width: 170px; height: auto; }
.nav-links { list-style: none; padding: 10px 0; flex: 1; }
.nav-links li a { display: flex; align-items: center; gap: 10px; padding: 9px 18px;
                  color: var(--sidebar-txt); font-size: 13px; transition: background 0.15s; white-space: nowrap; }
.nav-links li a:hover { background: var(--glass-lite); color: #fff; text-decoration: none; }
.nav-links li a.active { background: rgba(206,101,12,0.20); color: #fff;
                          border-left: 3px solid var(--sidebar-act); text-decoration: none; }
.nav-links .icon { font-size: 15px; width: 20px; text-align: center; }
.nav-section { padding: 14px 18px 4px; font-size: 10px; font-weight: 600;
               text-transform: uppercase; letter-spacing: 0.08em; color: var(--hint); }
.sidebar-footer { padding: 14px 18px; border-top: 1px solid var(--glass-border);
                  display: flex; align-items: center; gap: 10px; font-size: 12px; }
.admin-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.btn-logout { background: none; border: 1px solid var(--glass-border); color: var(--muted);
              padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 12px; }
.btn-logout:hover { background: rgba(239,68,68,0.20); color: #fff; border-color: var(--danger); }

/* ── Main ────────────────────────────────────────────────────────────────── */
.main { padding: 28px 32px; overflow: auto; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-title  { font-size: 22px; font-weight: 600; color: #fff; }
.page-actions { display: flex; gap: 10px; }

/* ── Glass cards ─────────────────────────────────────────────────────────── */
.card { background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
        border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
        margin-bottom: 20px; box-shadow: var(--shadow); }
.card-header { display: flex; align-items: center; justify-content: space-between;
               padding: 16px 20px; border-bottom: 1px solid var(--glass-border); }
.card-header h2 { font-size: 15px; font-weight: 600; color: #fff; }
.card-body { padding: 20px; }

/* ── Stat cards ──────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
             border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
             padding: 20px; text-align: center; box-shadow: var(--shadow-sm); }
.stat-value { font-size: 36px; font-weight: 700; color: var(--primary-lt); }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.stat-warn  .stat-value { color: var(--warn); }
.stat-muted .stat-value { color: var(--muted); }
.content-grid { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 10px 16px; font-size: 11px; font-weight: 600;
            text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted);
            border-bottom: 1px solid var(--glass-border); background: rgba(255,255,255,0.05); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--glass-border); vertical-align: middle; color: #fff; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--glass-lite); }
.table .muted { color: var(--muted); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
       border-radius: var(--radius); font-size: 13px; font-weight: 500; cursor: pointer;
       border: 1px solid transparent; transition: all 0.15s; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary   { background: var(--primary);  color: #fff; border-color: var(--primary); }
.btn-primary:hover   { background: var(--primary-dk); color: #fff; }
.btn-danger    { background: var(--danger);   color: #fff; border-color: var(--danger); }
.btn-danger:hover    { background: var(--danger-dk);  color: #fff; }
.btn-secondary { background: var(--glass-lite); color: #fff; border-color: var(--glass-border); }
.btn-secondary:hover { background: rgba(255,255,255,0.15); }
.btn-warn      { background: var(--warn); color: #000; border-color: var(--warn); }
.btn-sm        { padding: 5px 12px; font-size: 12px; }
.btn-block     { width: 100%; justify-content: center; padding: 11px; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px;
         font-size: 13px; border: 1px solid transparent; }
.alert-error   { background: rgba(239,68,68,0.20);   color: #fca5a5; border-color: rgba(239,68,68,0.40); }
.alert-success { background: rgba(16,185,129,0.20);  color: #6ee7b7; border-color: rgba(16,185,129,0.40); }
.alert-info    { background: rgba(59,130,246,0.20);  color: #93c5fd; border-color: rgba(59,130,246,0.40); }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--glass-border);
  border-radius: var(--radius); font-size: 14px;
  background: rgba(255,255,255,0.08); color: #fff; transition: border-color 0.15s; }
.field input::placeholder, .field textarea::placeholder { color: var(--hint); }
.field select option { background: #1e1b4b; color: #fff; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(206,101,12,0.25); }
.field input:disabled { background: rgba(255,255,255,0.04); color: var(--muted); }
.field-hint { font-size: 12px; color: var(--hint); margin-top: 4px; display: block; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-section { margin-bottom: 28px; }
.form-section-title { font-size: 13px; font-weight: 600; color: var(--muted);
                      text-transform: uppercase; letter-spacing: 0.05em;
                      padding-bottom: 8px; border-bottom: 1px solid var(--glass-border); margin-bottom: 16px; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer;
                  padding: 6px 12px; border: 1px solid var(--glass-border);
                  border-radius: var(--radius); background: var(--glass-lite); color: #fff; }
.checkbox-label:hover { border-color: var(--primary); }
.checkbox-label input[type="checkbox"] { width: auto; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge-active      { background: rgba(16,185,129,0.25);  color: #6ee7b7; }
.badge-pending     { background: rgba(245,158,11,0.25);  color: #fcd34d; }
.badge-inactive    { background: rgba(255,255,255,0.10); color: var(--muted); }
.badge-archived    { background: rgba(239,68,68,0.25);   color: #fca5a5; }
.badge-provisioned { background: rgba(16,185,129,0.25);  color: #6ee7b7; }
.badge-failed      { background: rgba(239,68,68,0.25);   color: #fca5a5; }
.badge-service     { background: rgba(206,101,12,0.25);  color: #fdba74; }

/* ── User detail ─────────────────────────────────────────────────────────── */
.user-header { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.user-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--primary);
               display: flex; align-items: center; justify-content: center;
               font-size: 24px; font-weight: 700; color: #fff; flex-shrink: 0; }
.user-meta h2 { font-size: 20px; font-weight: 600; color: #fff; }
.user-meta p  { color: var(--muted); }
.services-grid { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Login page ──────────────────────────────────────────────────────────── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-wrap { width: 100%; max-width: 440px; padding: 20px; }
.login-card { background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
              border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
              padding: 40px; box-shadow: var(--shadow); }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo img { height: 80px; width: auto; }
.login-title { font-size: 20px; font-weight: 600; text-align: center; color: #fff; margin-bottom: 24px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-help  { text-align: center; font-size: 13px; color: var(--muted); margin-top: 16px; }
.login-help a { color: var(--primary-lt); }

/* ── Quick links ─────────────────────────────────────────────────────────── */
.quick-links { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; }
.quick-link  { display: flex; align-items: center; gap: 12px; padding: 10px 16px;
               border-radius: var(--radius); color: #fff; font-size: 13px; transition: background 0.1s; }
.quick-link:hover { background: var(--glass-lite); text-decoration: none; }
.quick-link span  { font-size: 16px; width: 20px; text-align: center; }

/* ── Log viewer ──────────────────────────────────────────────────────────── */
.log-viewer { background: rgba(0,0,0,0.50); color: #a3e635;
              font-family: "SFMono-Regular",Consolas,monospace; font-size: 12px;
              padding: 16px; border-radius: var(--radius); border: 1px solid var(--glass-border);
              max-height: 600px; overflow-y: auto; white-space: pre; }

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 1px solid var(--glass-border); margin-bottom: 20px; }
.tab  { padding: 10px 20px; font-size: 13px; font-weight: 500; color: var(--muted);
        border-bottom: 2px solid transparent; cursor: pointer; }
.tab.active, .tab:hover { color: var(--primary-lt); border-bottom-color: var(--primary); }
.tab a { color: inherit; }
.tab a:hover { text-decoration: none; }

/* ── Confirm dialog ──────────────────────────────────────────────────────── */
.confirm-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.65);
                   z-index: 1000; align-items: center; justify-content: center; }
.confirm-overlay.open { display: flex; }
.confirm-box { background: #1e1b4b; border: 1px solid var(--glass-border);
               border-radius: var(--radius-lg); padding: 28px; max-width: 420px; width: 100%; }
.confirm-box h3 { margin-bottom: 12px; color: #fff; }
.confirm-box p  { color: var(--muted); margin-bottom: 20px; font-size: 14px; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
