/* ===========================================================================
   Sable Staff Portal — core stylesheet.

   OLED-black default per CLAUDE.md rule #19 and the Unified Panel mockup at
   mockups/presentation/design-final-floating-pins.html. No CDN, no build
   step — raw CSS, SRI-pinned when referenced from PHP (Phase 2).
   =========================================================================== */

:root {
    --bg-base:      #000000;
    --bg-card:      rgba(255, 255, 255, 0.02);
    --bg-hover:     rgba(255, 255, 255, 0.04);
    --bg-active:    rgba(255, 255, 255, 0.06);
    --border:       rgba(255, 255, 255, 0.08);
    --border-strong:rgba(255, 255, 255, 0.16);

    --accent:       #6366f1;
    --accent-soft:  #818cf8;
    --success:      #34d399;
    --warning:      #fbbf24;
    --danger:       #f87171;

    --text-primary:    #ffffff;
    --text-secondary:  rgba(255, 255, 255, 0.7);
    --text-muted:      rgba(255, 255, 255, 0.4);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --shadow-card: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 24px rgba(0,0,0,0.4);

    --header-height: 64px;
    --bottom-nav-height: 64px;
    --container-max: 1200px;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-soft); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }

/* -- Layout shell ---------------------------------------------------------- */

.shell {
    min-height: 100vh;
    padding-top: var(--header-height);
    padding-bottom: 0;
}
@media (max-width: 768px) {
    .shell { padding-bottom: var(--bottom-nav-height); }
}

/* Signed-out / bare shell — no header or bottom nav to pad around */
.shell--bare { padding-top: 0; }
@media (max-width: 768px) {
    .shell--bare { padding-bottom: 0; }
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 2rem 1.25rem;
}

/* -- Floating header (desktop) -------------------------------------------- */

.header {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}
.header__inner {
    max-width: var(--container-max);
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    gap: 1rem;
}
.header__brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}
.header__brand .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}
.header__nav {
    display: flex; gap: 0.25rem;
}
.header__nav a {
    color: var(--text-secondary);
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
}
.header__nav a:hover { background: var(--bg-hover); color: var(--text-primary); }
.header__nav a.is-active { background: var(--bg-active); color: var(--text-primary); }

.header__user {
    display: flex; align-items: center; gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.825rem;
}
.header__avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 600;
    color: var(--text-primary);
}

/* Hide nav row on mobile — bottom nav takes over */
@media (max-width: 768px) {
    .header__nav { display: none; }
    .header__user .user-name { display: none; }
}

/* -- Bottom nav (mobile) --------------------------------------------------- */

.bottom-nav {
    display: none;
}
@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
        position: fixed; bottom: 0; left: 0; right: 0;
        height: var(--bottom-nav-height);
        background: rgba(0, 0, 0, 0.9);
        backdrop-filter: blur(20px);
        border-top: 1px solid var(--border);
        z-index: 100;
    }
    .bottom-nav a {
        flex: 1;
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 0.15rem;
        color: var(--text-muted);
        font-size: 0.7rem;
        text-decoration: none;
    }
    .bottom-nav a.is-active { color: var(--accent); }
    .bottom-nav svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }
}

/* -- Cards, panels --------------------------------------------------------- */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
}
.card__title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.card__value {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}
.card__sub {
    font-size: 0.825rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.grid {
    display: grid;
    gap: 1rem;
}
.grid--stats  { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--two    { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 900px) {
    .grid--stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid--two   { grid-template-columns: 1fr; }
}

/* -- Headings -------------------------------------------------------------- */

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}
.page-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}
.section-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 1.75rem 0 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

/* -- Lists (service rows, activity) --------------------------------------- */

.list { display: flex; flex-direction: column; gap: 0.5rem; }
.list__item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.9rem 1rem;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem;
}
.list__left { display: flex; align-items: center; gap: 0.85rem; min-width: 0; }
.list__icon {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    background: var(--bg-hover);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.list__title { font-weight: 500; }
.list__meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.1rem; }

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
}
.badge--pending  { background: rgba(251, 191, 36, 0.12); color: var(--warning); }
.badge--active   { background: rgba(52, 211, 153, 0.12); color: var(--success); }
.badge--warn     { background: rgba(248, 113, 113, 0.12); color: var(--danger); }
.badge--muted    { background: var(--bg-hover); color: var(--text-muted); }

/* -- Buttons --------------------------------------------------------------- */

.btn {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
    transition: background 100ms;
}
.btn:hover { background: var(--bg-active); color: var(--text-primary); }
.btn--primary {
    background: var(--accent);
    color: #fff;
    border-color: transparent;
}
.btn--primary:hover { background: var(--accent-soft); color: #fff; }
.btn--ghost { background: transparent; }

/* -- Forms ----------------------------------------------------------------- */

.input {
    width: 100%;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.925rem;
}
.input:focus { outline: none; border-color: var(--accent); background: var(--bg-active); }
.label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* -- Empty states ---------------------------------------------------------- */

.empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
}
.empty__title { color: var(--text-secondary); font-weight: 500; margin-bottom: 0.25rem; }
.empty__hint { font-size: 0.85rem; }

/* -- Utilities ------------------------------------------------------------- */

.stack > * + * { margin-top: 0.5rem; }
.row { display: flex; align-items: center; gap: 0.75rem; }
.row--between { justify-content: space-between; }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
