/* LPH design system — utilities 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. */
/* --------------------------------------------------
   Badges
-------------------------------------------------- */

.lph-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    border: 1px solid rgba(var(--ink-rgb), 0.06);
    background: var(--color-surface-veil);
    color: var(--color-text);
}

.lph-badge-default {
    background: var(--color-surface-veil);
    color: var(--color-text);
}

.lph-badge-success {
    background: rgba(37, 184, 101, 0.14);
    border-color: rgba(37, 184, 101, 0.22);
    color: #8ff0b7;
}

.lph-badge-warning {
    background: rgba(199, 162, 71, 0.14);
    border-color: rgba(199, 162, 71, 0.24);
    color: #e6c97b;
}

.lph-badge-danger {
    background: rgba(214, 84, 84, 0.14);
    border-color: rgba(214, 84, 84, 0.22);
    color: #ffadad;
}

.lph-badge-info {
    background: rgba(74, 144, 226, 0.14);
    border-color: rgba(74, 144, 226, 0.22);
    color: #9cc7ff;
}

/* --------------------------------------------------
   Empty State
-------------------------------------------------- */

.lph-empty-state {
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
    padding: 28px 6px 10px;
}

.lph-empty-state h4 {
    margin: 0;
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 700;
}

.lph-empty-state p {
    margin: 0;
    color: var(--lph-text-secondary);
    font-size: 0.9rem;
    line-height: 1.55;
    max-width: 520px;
}

/* --------------------------------------------------
   Grid Helpers
-------------------------------------------------- */

.lph-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.lph-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.lph-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

/* --------------------------------------------------
   Responsive
-------------------------------------------------- */

@media (max-width: 1280px) {
    :root {
        --lph-sidebar-width: 244px;
    }

    .lph-hero-copy h2 {
        font-size: 2.45rem;
    }

    .lph-stat-value {
        font-size: 2rem;
    }
}

@media (max-width: 1024px) {
    .lph-shell {
        grid-template-columns: 1fr;
    }

    .lph-sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--color-surface-hover);
    }

    .lph-stats-grid,
    .lph-grid-4,
    .lph-grid-3,
    .lph-grid-2 {
        grid-template-columns: 1fr;
    }

    .lph-hero-card {
        min-height: auto;
    }

    .lph-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .lph-toolbar-search {
        width: 100%;
    }

    .lph-input-wrap {
        min-width: 0;
        width: 100%;
    }

    .lph-form-actions {
        justify-content: stretch;
    }

    .lph-form-actions .lph-btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .lph-page-wrap {
        padding: 10px;
    }

    .lph-main {
        padding: 14px;
    }

    .lph-sidebar {
        padding: 16px 14px;
    }

    .lph-hero-card,
    .lph-panel,
    .lph-section {
        padding: 16px;
    }

    .lph-panel-item {
        padding: 14px 16px;
        flex-direction: column;
    }

    .lph-item-status {
        padding-top: 0;
    }

    .lph-hero-copy h2 {
        font-size: 2rem;
    }

    .lph-pill {
        width: 100%;
    }

    .lph-table {
        min-width: 760px;
    }

    .lph-form-section {
        padding: 14px;
    }
}

/* --------------------------------------------------
   Public body dark mode
-------------------------------------------------- */

.lph-body {
    background: var(--lph-bg-base);
    color: var(--lph-text-primary);
}

/* Public page hero badge */
.lph-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(199, 162, 71, 0.1);
    border: 1px solid rgba(199, 162, 71, 0.22);
    color: var(--color-primary-strong);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Public section headings */
.lph-section-heading {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0 0 12px;
}

.lph-section-subtitle {
    font-size: 0.95rem;
    color: rgba(var(--ink-rgb), 0.55);
    line-height: 1.65;
    margin: 0;
}

.lph-section-header {
    text-align: left;
}

/* Grid helpers for public pages */
.lph-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.lph-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Public panel card */
.lph-panel-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 24px;
    border-radius: 16px;
    background: rgba(var(--ink-rgb), 0.025);
    border: 1px solid var(--color-border);
    transition: 160ms ease;
}

.lph-panel-item:hover {
    border-color: rgba(199, 162, 71, 0.2);
    background: rgba(var(--ink-rgb), 0.035);
}

.lph-hero-card {
    border-radius: 16px;
    background: rgba(var(--ink-rgb), 0.02);
    border: 1px solid rgba(var(--ink-rgb), 0.06);
    padding: 32px;
}

/* Stats grid for public */
.lph-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--color-surface-hover);
}

.lph-stat-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 28px 32px;
    background: rgba(3, 7, 17, 0.98);
}

.lph-stat-label {
    font-size: 0.76rem;
    color: rgba(var(--ink-rgb), 0.45);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.lph-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.lph-stat-hint {
    font-size: 0.8rem;
    color: rgba(var(--ink-rgb), 0.4);
}

/* Public panel */
.lph-panel {
    border-radius: 16px;
    background: rgba(var(--ink-rgb), 0.02);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.lph-panel-header {
    padding: 18px 24px;
    border-bottom: 1px solid rgba(var(--ink-rgb), 0.06);
}

.lph-panel-header h3 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--color-text);
}

.lph-panel-list {
    display: flex;
    flex-direction: column;
}

.lph-panel-item-copy h4 {
    margin: 0 0 3px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-text);
}

.lph-panel-item-copy p {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(var(--ink-rgb), 0.5);
    line-height: 1.5;
}

@media (max-width: 900px) {
    .lph-grid-3,
    .lph-grid-2 {
        grid-template-columns: 1fr;
    }
    .lph-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .lph-stat-card {
        padding: 20px;
    }
}

