/* =========================================================================
   Hixel My — Custom styles (loaded AFTER Bootstrap 5 CDN)

   Bootstrap handles: grid, typography, forms, buttons, tables, cards, alerts,
   badges, breadcrumbs, navbar, utilities.

   This file adds: admin shell layout, sidebar nav, topbar, and Hixel-specific
   component styles that don't exist in Bootstrap.
   ========================================================================= */

:root {
    --brand: #2c4a78;
    --brand-strong: #1a2f4f;
    --accent: #ff7a00;
}

/* Override Bootstrap primary with brand */
a { color: var(--brand); }
a:hover { color: var(--brand-strong); }

/* Headings */
h1, h2, h3, h4, h5, h6 { color: var(--brand-strong); }

/* Lead text */
.lead { max-width: 60ch; }

/* =========================================================================
   Custom components (not in Bootstrap)
   ========================================================================= */

/* Status pill */
.status-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #eef2f7;
    color: var(--brand);
}
.status-pill.active { background: #e6f3ec; color: #006633; }
.status-pill.suspended { background: #fbeaea; color: #b30000; }

/* KV list */
.kv-list { list-style: none; padding: 0; margin: 0; }
.kv-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--bs-border-color); }
.kv-list li:last-child { border-bottom: 0; }
.kv-list .key { color: var(--bs-secondary-color); }
.kv-list .value { font-weight: 600; color: var(--brand-strong); }

/* Wizard step indicator */
.wizard-nav { list-style: none; margin: 0 0 24px; padding: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wizard-step { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); font-size: 0.9rem; color: var(--bs-secondary-color); }
.wizard-step-number { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 999px; background: var(--bs-border-color); color: var(--bs-secondary-color); font-weight: 700; font-size: 0.8rem; }
.wizard-step.current { background: var(--brand); color: #fff; border-color: var(--brand); }
.wizard-step.current .wizard-step-number { background: #fff; color: var(--brand); }
.wizard-step.done { background: #e6f3ec; color: #006633; border-color: #b7e0c4; }
.wizard-step.done .wizard-step-number { background: #006633; color: #fff; }
.wizard-step.done a { color: #006633; text-decoration: none; font-weight: 600; }
.wizard-step.future { opacity: 0.6; }

/* URL preview */
.url-preview { display: block; margin-top: 8px; padding: 10px 14px; background: var(--bs-tertiary-bg); border: 1px dashed var(--bs-border-color); border-radius: 6px; font-family: var(--bs-font-monospace); font-size: 0.95rem; color: var(--brand-strong); }

/* Feature card */
.feature-card { padding: 16px; border: 1px solid var(--bs-border-color); border-radius: 8px; margin-bottom: 12px; background: var(--bs-body-bg); }
.feature-card.selected { border-color: var(--brand); background: #f0f5fb; }
.feature-card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.feature-card .price { font-weight: 700; color: var(--brand-strong); }

/* Placeholder card */
.placeholder-card { background: var(--bs-body-bg); border: 1px dashed var(--bs-border-color); border-radius: 8px; padding: 48px 32px; text-align: center; color: var(--bs-secondary-color); }
.placeholder-card h2 { color: var(--brand-strong); margin-top: 0; }
.placeholder-card p { max-width: 60ch; margin: 0 auto 16px; }

/* Dashboard stat grid */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 24px 0; }
.stat-card { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.stat-card .stat-label { font-size: 0.85rem; color: var(--bs-secondary-color); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; color: var(--brand-strong); line-height: 1; }
.stat-card .stat-sub { font-size: 0.85rem; color: var(--bs-secondary-color); margin-top: 6px; }

/* Media grid */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 8px; }
.media-card { display: flex; flex-direction: column; text-decoration: none; color: var(--bs-body-color); background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: 8px; overflow: hidden; transition: transform 0.1s, box-shadow 0.1s, border-color 0.1s; }
.media-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); border-color: var(--brand); }
.media-thumb { aspect-ratio: 4/3; background: var(--bs-tertiary-bg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-meta { padding: 10px 12px; }
.media-title { font-weight: 600; color: var(--brand-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }

/* Filter bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; margin: 0 0 16px; padding: 12px 16px; background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); border-radius: 8px; }

/* Help text */
.help { display: block; color: var(--bs-secondary-color); font-size: 0.85rem; margin-top: 4px; }

/* Env badge */
.env-badge { display: inline-block; padding: 2px 10px; border-radius: 4px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); border: 1px solid var(--bs-border-color); }
.env-badge.env-sit   { background: #fff4e0; color: #b36b00; border-color: #f0d0a0; }
.env-badge.env-stage { background: #eaf1ff; color: #1a3e80; border-color: #b7cbe8; }
.env-badge.env-prod  { background: #e6f3ec; color: #006633; border-color: #b7e0c4; }

/* Tab bar */
.tab-bar a { text-decoration: none; font-weight: 600; }

/* Badge extensions */
.badge-kind { background: #eef2f7; color: var(--brand); }
.badge-purpose { background: #fff4e0; color: #b36b00; }

/* =========================================================================
   Admin shell — sidebar + top bar layout
   ========================================================================= */

body.admin-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }

.admin-sidebar {
    background: var(--brand-strong);
    color: #e9eef5;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px 0;
    overflow-y: auto;
}
.admin-sidebar .brand { color: #fff; font-weight: 700; font-size: 1.3rem; padding: 0 24px 16px; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 12px; display: block; }
.admin-sidebar .brand span { color: var(--accent); }

.admin-nav { flex: 1; display: flex; flex-direction: column; }
.admin-nav > ul { list-style: none; margin: 0; padding: 0; flex: 1; }
.admin-nav a { display: block; padding: 10px 24px; color: #c7d0df; text-decoration: none; font-size: 0.95rem; transition: background 0.12s, color 0.12s; border-left: 3px solid transparent; }
.admin-nav a:hover { background: rgba(255,255,255,.04); color: #fff; }
.admin-nav li.active > a { background: rgba(255,255,255,.08); color: #fff; border-left-color: var(--accent); font-weight: 600; }

.admin-nav-section { margin: 6px 0; }
.admin-nav-section-header { padding: 8px 24px 6px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: #6f7d92; font-weight: 700; }
.admin-nav-section > ul { list-style: none; margin: 0; padding: 0; }
.admin-nav-section > ul > li > a { padding-left: 36px; }

.admin-nav-footer { padding: 16px 24px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 12px; }
.admin-nav-footer a { padding: 0; border: none; color: #8fa0ba; font-size: 0.85rem; }
.admin-nav-footer a:hover { background: transparent; color: #fff; }

.admin-main { display: flex; flex-direction: column; min-height: 100vh; }

.admin-topbar {
    background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
    padding: 14px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-content { flex: 1; padding: 32px; max-width: 1200px; width: 100%; }

/* Responsive */
@media (max-width: 960px) {
    body.admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; height: auto; }
    .admin-content { padding: 20px; }
}
