/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:      #2563EB;
  --primary-dark: #1D4ED8;
  --success:      #16A34A;
  --error:        #DC2626;
  --warning:      #D97706;
  --bg:           #F0F2F5;
  --card:         #FFFFFF;
  --border:       #DDE3ED;
  --text:         #111827;
  --text2:        #374151;
  --muted:        #6B7280;
  --accent:       #EFF6FF;
  --sidebar:      #1E2A3A;
  --radius:       8px;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
  min-height: 100vh;
}

/* ── Layout ── */
.app-shell   { display: flex; min-height: 100vh; }
.sidebar     { width: 220px; background: var(--sidebar); flex-shrink: 0;
               display: flex; flex-direction: column; }
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ── Sidebar ── */
.sidebar-logo { padding: 20px 16px; border-bottom: 1px solid #2D3F54; }
.sidebar-logo .logo-row { display: flex; align-items: center; gap: 10px; }
.sidebar-logo .icon    { font-size: 22px; }
.sidebar-logo .name    { font-size: 14px; font-weight: 700; color: #fff; }
.sidebar-logo .tagline { font-size: 11px; color: #94A3B8; margin-top: 1px; }

.sidebar-nav  { padding: 12px 8px; flex: 1; }
.nav-item     { display: flex; align-items: center; gap: 10px; padding: 10px 12px;
                border-radius: var(--radius); color: #CBD5E1; text-decoration: none;
                font-size: 13px; font-weight: 500; margin-bottom: 2px;
                transition: background .15s, color .15s; }
.nav-item:hover  { background: #263548; color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav-item .nav-icon { font-size: 15px; width: 20px; text-align: center; }

.sidebar-footer { padding: 14px 16px; border-top: 1px solid #2D3F54; }
.sidebar-footer .username { font-size: 11px; color: #64748B; margin-bottom: 8px; }
.btn-signout { display: inline-block; padding: 6px 14px; background: #263548;
               color: #CBD5E1; border-radius: var(--radius); font-size: 12px;
               text-decoration: none; border: none; cursor: pointer;
               transition: background .15s; }
.btn-signout:hover { background: #344A60; color: #fff; }

/* ── Page header ── */
.page-header { background: var(--card); border-bottom: 1px solid var(--border);
               padding: 16px 24px; display: flex; align-items: center;
               justify-content: space-between; }
.page-header h1 { font-size: 18px; font-weight: 700; color: var(--text); }
.page-header p  { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Page content ── */
.page-body { padding: 20px 24px; flex: 1; overflow-y: auto; }

/* ── Alerts ── */
.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px;
         font-weight: 500; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.alert-success { background: #DCFCE7; color: var(--success); border: 1px solid #BBF7D0; }
.alert-error   { background: #FEE2E2; color: var(--error);   border: 1px solid #FECACA; }
.alert-warning { background: #FEF3C7; color: var(--warning); border: 1px solid #FDE68A; }
.alert-info    { background: var(--accent); color: var(--primary); border: 1px solid #BFDBFE; }

/* ── Cards ── */
.card { background: var(--card); border: 1px solid var(--border);
        border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { padding: 14px 20px; background: var(--accent);
               border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.card-header h2 { font-size: 14px; font-weight: 700; color: var(--text); }
.card-body   { padding: 20px; }
.card-footer { padding: 12px 20px; background: #F8FAFC;
               border-top: 1px solid var(--border);
               border-radius: 0 0 var(--radius) var(--radius); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 6px;
       padding: 8px 18px; border-radius: var(--radius);
       border: none; cursor: pointer; font-size: 13px; font-weight: 600;
       text-decoration: none; transition: background .15s, transform .1s;
       line-height: 1.4; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost   { background: var(--border); color: var(--text2); }
.btn-ghost:hover { background: #CBD5E1; }
.btn-success { background: #DCFCE7; color: var(--success); }
.btn-danger  { background: #FEE2E2; color: var(--error); }
.btn-sm      { padding: 5px 12px; font-size: 12px; }
.btn-full    { width: 100%; justify-content: center; padding: 11px; }

/* ── Forms ── */
.form-group  { margin-bottom: 14px; }
.form-label  { display: block; font-size: 11px; font-weight: 700; letter-spacing: .05em;
               text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.form-control {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; font-family: inherit; background: var(--card);
  color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-control.mono { font-family: 'Consolas', 'Courier New', monospace;
                     letter-spacing: 1px; }
.form-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-section { background: #F8FAFC; border: 1px solid var(--border);
                border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.form-section-title { font-size: 12px; font-weight: 700; color: var(--primary);
                      text-transform: uppercase; letter-spacing: .05em;
                      margin-bottom: 12px; padding-bottom: 8px;
                      border-bottom: 1px solid var(--border); }

/* ── Auth pages ── */
.auth-shell  { min-height: 100vh; display: flex; }
.auth-brand  { width: 260px; background: var(--sidebar); display: flex;
               flex-direction: column; align-items: center; justify-content: center;
               padding: 40px 30px; flex-shrink: 0; }
.auth-brand .brand-icon { font-size: 48px; margin-bottom: 12px; }
.auth-brand .brand-name { font-size: 22px; font-weight: 800; color: #fff; }
.auth-brand .brand-tag  { font-size: 12px; color: #94A3B8; margin-top: 4px; margin-bottom: 32px; }
.auth-brand .brand-feat { width: 100%; }
.auth-brand .brand-feat li { list-style: none; font-size: 12px; color: #94A3B8;
                              padding: 5px 0; display: flex; align-items: center; gap: 8px; }
.auth-brand .brand-feat li::before { content: "✓"; color: #60A5FA; font-weight: 700; }
.auth-panel  { flex: 1; display: flex; align-items: center; justify-content: center;
               padding: 40px 24px; }
.auth-card   { width: 100%; max-width: 420px; }
.auth-card .card-header h2 { font-size: 18px; }
.auth-card .card-header p  { font-size: 13px; color: var(--muted); margin-top: 3px; }
.auth-version { font-size: 11px; color: #475569; margin-top: 24px; text-align: center; }

/* ── Toolbar ── */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
           flex-wrap: wrap; }
.toolbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.search-box { position: relative; }
.search-box input { padding-left: 32px; min-width: 260px; }
.search-box::before { content: "🔍"; position: absolute; left: 10px; top: 50%;
                      transform: translateY(-50%); font-size: 12px; }
.filter-chips { display: flex; gap: 4px; }
.chip { padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
        border: none; cursor: pointer; text-decoration: none;
        background: var(--border); color: var(--muted); transition: all .15s; }
.chip.active, .chip:hover { background: var(--primary); color: #fff; }

/* ── Table ── */
.table-card  { background: var(--card); border: 1px solid var(--border);
               border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table-wrap  { overflow-x: auto; }
table        { width: 100%; border-collapse: collapse; }
thead        { background: #F8FAFC; }
th           { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700;
               text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
               border-bottom: 1px solid var(--border); white-space: nowrap; }
td           { padding: 11px 14px; border-top: 1px solid var(--border);
               vertical-align: middle; font-size: 13px; }
tr:nth-child(even) td { background: #FAFBFC; }
tr:hover td  { background: var(--accent); }
.col-center  { text-align: center; }
.col-mono    { font-family: 'Consolas', monospace; font-size: 12px; letter-spacing: .5px; }
.table-empty { text-align: center; padding: 48px; color: var(--muted); }

/* ── Badges ── */
.badge       { display: inline-flex; align-items: center; gap: 4px;
               padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-green { background: #DCFCE7; color: var(--success); }
.badge-grey  { background: #F1F5F9; color: var(--muted); }
.badge-red   { background: #FEE2E2; color: var(--error); }
.badge-blue  { background: var(--accent); color: var(--primary); }

/* ── Detail card ── */
.detail-section { margin-bottom: 16px; }
.detail-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase;
                        letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.detail-grid { background: var(--card); border: 1px solid var(--border);
               border-radius: var(--radius); overflow: hidden; }
.detail-row  { display: flex; border-bottom: 1px solid var(--border); }
.detail-row:last-child { border-bottom: none; }
.detail-row:nth-child(even) { background: #F8FAFC; }
.detail-label { min-width: 160px; padding: 10px 16px; font-size: 12px; font-weight: 700;
                color: var(--muted); }
.detail-value { padding: 10px 16px; font-size: 13px; color: var(--text); flex: 1; }

/* ── API ref ── */
.api-row     { display: flex; align-items: center; gap: 12px; padding: 8px 0;
               border-bottom: 1px solid var(--border); }
.api-row:last-child { border-bottom: none; }
.api-method  { font-size: 11px; font-weight: 700; padding: 2px 8px;
               border-radius: 4px; white-space: nowrap; }
.api-get     { background: #DCFCE7; color: var(--success); }
.api-post    { background: var(--accent); color: var(--primary); }
.api-path    { font-family: 'Consolas', monospace; font-size: 12px; color: var(--text); }
.api-desc    { font-size: 12px; color: var(--muted); }

/* ── Activate page ── */
.activate-wrap { max-width: 680px; margin: 0 auto; }

/* ── Status bar ── */
.status-bar  { display: flex; align-items: center; justify-content: space-between;
               padding: 8px 0; font-size: 12px; color: var(--muted); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar     { width: 60px; }
  .nav-item span { display: none; }
  .sidebar-logo .name, .sidebar-logo .tagline, .sidebar-footer .username { display: none; }
  .form-row    { grid-template-columns: 1fr; }
  .auth-brand  { width: 80px; }
  .auth-brand .brand-name, .auth-brand .brand-tag, .auth-brand .brand-feat { display: none; }
}

code { background: #F1F5F9; padding: 2px 6px; border-radius: 4px;
       font-family: 'Consolas', monospace; font-size: .85em; }
