/* LPH design system — base layer.
   Ordered slice of lph-system.css, split to honour the <500-line rule.
   MUST load in sequence base -> components -> utilities -> portal -> responsive, BEFORE lph-theme.css.
   Do not reorder or edit across slice boundaries. */
:root {
    /* Bridge legacy chrome tokens to the theme engine's --color-* set so a theme
       switch retints the whole shell. Fallbacks = default dark values. */
    --lph-bg-base: var(--color-background, #030711);
    --lph-bg-elevated: var(--color-elevated, #071224);
    --lph-surface-1: var(--color-surface, rgba(9, 17, 34, 0.94));
    --lph-surface-2: var(--color-surface-secondary, rgba(10, 20, 40, 0.92));
    --lph-surface-3: rgba(var(--ink-rgb), 0.02);
    --lph-surface-4: rgba(var(--ink-rgb), 0.028);

    --lph-border-soft: var(--color-surface-hover);
    --lph-border-gold: rgba(199, 162, 71, 0.14);
    --lph-border-gold-strong: var(--color-border-strong);

    --lph-text-primary: var(--color-text, #f7f4ee);
    --lph-text-secondary: var(--color-text-secondary, #aab4c9);
    --lph-text-muted: var(--color-text-muted, #7f8aa1);
    --lph-text-gold: var(--color-primary-strong);

    --lph-gold: var(--color-primary);
    --lph-gold-soft: var(--color-primary-soft);
    --lph-shadow-main: 0 18px 50px rgba(0, 0, 0, 0.28);

    --lph-radius-2xl: 28px;
    --lph-radius-xl: 22px;
    --lph-radius-lg: 18px;
    --lph-radius-md: 14px;
    --lph-radius-sm: 12px;

    --lph-sidebar-width: 270px;
    --lph-container-padding: 18px;
    --lph-main-padding-x: 24px;

    --lph-font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    --lph-text-xs: 0.72rem;
    --lph-text-sm: 0.82rem;
    --lph-text-md: 0.92rem;
    --lph-text-lg: 1rem;
    --lph-text-xl: 1.12rem;
    --lph-text-2xl: 1.35rem;
    --lph-text-3xl: 2.2rem;
    --lph-text-4xl: 3rem;

    --lph-space-1: 4px;
    --lph-space-2: 8px;
    --lph-space-3: 12px;
    --lph-space-4: 16px;
    --lph-space-5: 20px;
    --lph-space-6: 24px;
    --lph-space-7: 28px;
    --lph-space-8: 32px;

    /* Shorthand aliases used across views */
    --gold: var(--color-primary);
    --gold-soft: var(--color-primary-soft);
    --border: var(--color-border);
    --surface-1: rgba(9, 17, 34, 0.94);
    --surface-2: rgba(10, 20, 40, 0.92);
    --surface-3: var(--color-surface-veil);
    --text-primary: #f7f4ee;
    --text-secondary: #aab4c9;
    --text-muted: #7f8aa1;
    --text-gold: var(--color-primary-strong);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: var(--lph-font-sans);
    background: var(--lph-bg-base);
    color: var(--lph-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    line-height: 1.45;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* --------------------------------------------------
   Layout Foundation
-------------------------------------------------- */

.lph-page-wrap {
    padding: var(--lph-container-padding);
}

/* Admin page header row */
.lph-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.lph-page-title h1 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.lph-page-title p {
    margin: 5px 0 0;
    color: var(--lph-text-secondary);
    font-size: 0.87rem;
    line-height: 1.45;
}

.lph-page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Neutral page wrapper */
.lph-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lph-shell {
    width: 100%;
    max-width: none;
    min-height: calc(100vh - (var(--lph-container-padding) * 2));
    display: grid;
    grid-template-columns: var(--lph-sidebar-width) minmax(0, 1fr);
    border-radius: var(--lph-radius-2xl);
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(199, 162, 71, 0.08), transparent 16%),
        linear-gradient(180deg, var(--lph-bg-base) 0%, var(--lph-bg-elevated) 100%);
    color: var(--lph-text-primary);
    box-shadow: var(--lph-shadow-main);
}

/* --------------------------------------------------
   Sidebar
-------------------------------------------------- */

.lph-sidebar {
    padding: 22px 20px;
    /* Themed from active surface tokens (light themes get a light rail). */
    background: linear-gradient(180deg,
        var(--color-elevated, rgba(2, 7, 17, 0.98)),
        var(--color-background, rgba(4, 10, 22, 0.96)));
    border-right: 1px solid rgba(var(--ink-rgb), 0.04);
}

.lph-brand-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(var(--ink-rgb), 0.06);
}

.lph-brand-mark {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #d8b56f, #b8892d);
    color: #111;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.lph-brand-copy {
    min-width: 0;
}

.lph-brand-copy h1 {
    margin: 0;
    color: var(--color-text);
    font-size: 0.98rem;
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.lph-brand-copy p {
    margin: 5px 0 0;
    color: var(--lph-text-secondary);
    font-size: 0.76rem;
    line-height: 1.45;
}

.lph-sidebar-section {
    margin-bottom: 16px;
}

.lph-sidebar-label {
    margin: 0 0 8px;
    color: var(--lph-text-muted);
    font-size: 0.68rem;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.26em;
    font-weight: 600;
}

.lph-nav-list,
.lph-foundation-list {
    display: grid;
    gap: 8px;
}

.lph-nav-item,
.lph-foundation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid transparent;
    background: rgba(var(--ink-rgb), 0.01);
    text-decoration: none;
    transition: 160ms ease;
}

.lph-nav-item:hover {
    text-decoration: none;
    background: var(--lph-surface-4);
    border-color: rgba(199, 162, 71, 0.18);
    color: var(--color-text);
}

.lph-nav-item.is-active {
    background: linear-gradient(180deg, rgba(199, 162, 71, 0.14), rgba(199, 162, 71, 0.06));
    border-color: var(--lph-border-gold-strong);
    box-shadow: inset 0 0 0 1px rgba(var(--ink-rgb), 0.025);
}

.lph-nav-item span,
.lph-foundation-item span {
    font-size: 0.92rem;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-text);
}

.lph-nav-item small,
.lph-foundation-item small {
    flex-shrink: 0;
    color: var(--lph-text-secondary);
    font-size: 0.82rem;
    line-height: 1.2;
    font-weight: 500;
}

.lph-sidebar-footnote {
    margin: 18px 2px 0;
    color: var(--lph-text-secondary);
    font-size: 0.78rem;
    line-height: 1.6;
}

/* --------------------------------------------------
   Main Area
-------------------------------------------------- */

.lph-main {
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 20px var(--lph-main-padding-x) 32px;
}

.lph-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.lph-pill {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 15px;
    background: rgba(12, 20, 40, 0.9);
    border: 1px solid rgba(var(--ink-rgb), 0.055);
    color: #cad3e8;
    font-size: 0.87rem;
    line-height: 1.2;
    font-weight: 500;
}

/* --------------------------------------------------
   Shared Cards
-------------------------------------------------- */

.lph-hero-card,
.lph-stat-card,
.lph-panel,
.lph-section {
    border: 1px solid var(--lph-border-gold);
    background: linear-gradient(180deg, rgba(9, 17, 35, 0.96), rgba(7, 14, 28, 0.96));
    box-shadow: var(--lph-shadow-main);
}

/* --------------------------------------------------
   Hero
-------------------------------------------------- */

.lph-hero-card {
    min-height: 174px;
    padding: 24px 28px;
    border-radius: var(--lph-radius-xl);
    display: flex;
    align-items: center;
    margin-bottom: 14px;
}

.lph-hero-copy {
    max-width: 820px;
}

.lph-hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    margin-bottom: 14px;
    background: var(--lph-gold-soft);
    border: 1px solid var(--color-border-strong);
    color: var(--lph-text-gold);
    font-size: 0.82rem;
    line-height: 1;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.lph-hero-copy h2 {
    margin: 0 0 10px;
    color: var(--color-text);
    font-size: 2.9rem;
    line-height: 0.98;
    letter-spacing: -0.04em;
    font-weight: 700;
}

.lph-hero-copy p {
    margin: 0;
    color: var(--lph-text-secondary);
    font-size: 0.98rem;
    line-height: 1.52;
    max-width: 760px;
}

/* --------------------------------------------------
   Stats Grid
-------------------------------------------------- */

.lph-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.lph-stat-card {
    border-radius: 22px;
    padding: 18px 20px;
    min-height: 140px;
}

.lph-stat-label {
    display: block;
    margin-bottom: 12px;
    color: var(--lph-text-secondary);
    font-size: 0.86rem;
    line-height: 1.2;
    font-weight: 500;
}

.lph-stat-value {
    display: block;
    margin-bottom: 10px;
    color: var(--color-text);
    font-size: 2.35rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.lph-stat-hint {
    display: block;
    color: var(--lph-text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
}

/* --------------------------------------------------
   Panel
-------------------------------------------------- */

.lph-panel {
    border-radius: 24px;
    padding: 22px;
}

.lph-panel-header h3,
.lph-section-title {
    margin: 0;
    color: var(--color-text);
    font-size: 1.08rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.lph-panel-header {
    margin-bottom: 14px;
}

.lph-panel-list {
    display: grid;
    gap: 12px;
}

.lph-panel-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 18px;
    background: var(--lph-surface-3);
    border: 1px solid var(--color-surface-hover);
}

.lph-panel-item-copy {
    min-width: 0;
}

.lph-panel-item h4 {
    margin: 0 0 6px;
    color: var(--color-text);
    font-size: 0.98rem;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.012em;
}

.lph-panel-item p {
    margin: 0;
    color: var(--lph-text-secondary);
    font-size: 0.9rem;
    line-height: 1.52;
    max-width: 760px;
}

.lph-item-status {
    flex-shrink: 0;
    color: #eef3ff;
    font-size: 0.86rem;
    line-height: 1.2;
    font-weight: 600;
    padding-top: 2px;
}

