:root {
    --lph-bg-base: #030711;
    --lph-bg-elevated: #071224;
    --lph-surface-1: rgba(9, 17, 34, 0.94);
    --lph-surface-2: rgba(10, 20, 40, 0.92);
    --lph-surface-3: rgba(255, 255, 255, 0.02);
    --lph-surface-4: rgba(255, 255, 255, 0.028);

    --lph-border-soft: rgba(255, 255, 255, 0.05);
    --lph-border-gold: rgba(199, 162, 71, 0.14);
    --lph-border-gold-strong: rgba(199, 162, 71, 0.28);

    --lph-text-primary: #f7f4ee;
    --lph-text-secondary: #aab4c9;
    --lph-text-muted: #7f8aa1;
    --lph-text-gold: #d6b86e;

    --lph-gold: #c7a247;
    --lph-gold-soft: rgba(199, 162, 71, 0.12);
    --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: 272px;
    --lph-container-padding: 18px;

    --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: #c7a247;
    --gold-soft: rgba(199, 162, 71, 0.12);
    --border: rgba(255, 255, 255, 0.07);
    --surface-1: rgba(9, 17, 34, 0.94);
    --surface-2: rgba(10, 20, 40, 0.92);
    --surface-3: rgba(255, 255, 255, 0.03);
    --text-primary: #f7f4ee;
    --text-secondary: #aab4c9;
    --text-muted: #7f8aa1;
    --text-gold: #d6b86e;
}

*,
*::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: #fff;
    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 {
    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;
    background: linear-gradient(180deg, rgba(2, 7, 17, 0.98), rgba(4, 10, 22, 0.96));
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.lph-brand-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 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: #fff;
    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(255, 255, 255, 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: #fff;
}

.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(255, 255, 255, 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: #fff;
}

.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 {
    padding: 20px 22px 24px;
}

.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(255, 255, 255, 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 rgba(199, 162, 71, 0.28);
    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: #fff;
    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: #fff;
    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: #fff;
    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 rgba(255, 255, 255, 0.05);
}

.lph-panel-item-copy {
    min-width: 0;
}

.lph-panel-item h4 {
    margin: 0 0 6px;
    color: #fff;
    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;
}

/* --------------------------------------------------
   Section + Toolbar
-------------------------------------------------- */

.lph-section {
    border-radius: 24px;
    padding: 22px;
}

.lph-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.lph-section-heading {
    min-width: 0;
}

.lph-section-subtitle {
    margin: 6px 0 0;
    color: var(--lph-text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
}

.lph-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.lph-toolbar-search {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.lph-toolbar-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* --------------------------------------------------
   Inputs / Buttons
-------------------------------------------------- */

.lph-input-wrap {
    min-width: 260px;
}

.lph-input,
.lph-select,
.lph-textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: #0d1e2e;
    color: #e0e4ec;
    font-size: 0.88rem;
    line-height: 1.2;
    outline: none;
    transition: 160ms ease;
    -webkit-appearance: none;
    appearance: none;
    color-scheme: dark;
}

/* Override native select white background in all browsers */
select,
select.lph-input,
.lph-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238e98ae' d='M1.41 0 6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px !important;
    color-scheme: dark;
}

option,
select option {
    background-color: #0d1e2e;
    color: #e0e4ec;
}

.lph-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

.lph-input::placeholder,
.lph-textarea::placeholder {
    color: #8e98ae;
}

.lph-input:focus,
.lph-select:focus,
.lph-textarea:focus {
    border-color: rgba(199, 162, 71, 0.32);
    box-shadow: 0 0 0 3px rgba(199, 162, 71, 0.08);
}

.lph-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: 160ms ease;
}

.lph-btn:hover {
    text-decoration: none;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.lph-btn-primary {
    background: linear-gradient(180deg, rgba(199, 162, 71, 0.22), rgba(199, 162, 71, 0.12));
    border-color: rgba(199, 162, 71, 0.34);
    color: #fff;
}

.lph-btn-primary:hover {
    background: linear-gradient(180deg, rgba(199, 162, 71, 0.28), rgba(199, 162, 71, 0.16));
}

.lph-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.025);
    color: var(--lph-text-secondary);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
    transition: 160ms ease;
}

.lph-filter-chip:hover {
    color: #fff;
    text-decoration: none;
    border-color: rgba(199, 162, 71, 0.18);
}

.lph-filter-chip.is-active {
    color: #fff;
    background: rgba(199, 162, 71, 0.12);
    border-color: rgba(199, 162, 71, 0.28);
}

.lph-filter-chip small {
    color: var(--lph-text-muted);
    font-size: 0.78rem;
}

/* --------------------------------------------------
   Table Card
-------------------------------------------------- */

.lph-table-wrap {
    width: 100%;
}

.lph-table-scroll {
    width: 100%;
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.045);
    background: rgba(255, 255, 255, 0.015);
}

.lph-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
}

.lph-table thead th {
    text-align: left;
    padding: 14px 16px;
    color: var(--lph-text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.015);
}

.lph-table tbody td {
    padding: 16px;
    color: var(--lph-text-primary);
    font-size: 0.9rem;
    line-height: 1.45;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: top;
}

.lph-table tbody tr:last-child td {
    border-bottom: 0;
}

.lph-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.018);
}

.lph-table-actions-head,
.lph-table-actions {
    text-align: right;
}

.lph-cell-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lph-cell-stack strong {
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.3;
}

.lph-cell-stack small {
    color: var(--lph-text-secondary);
    font-size: 0.8rem;
    line-height: 1.45;
}

.lph-row-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lph-row-action {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: 160ms ease;
}

.lph-row-action:hover {
    text-decoration: none;
    background: rgba(255, 255, 255, 0.055);
    color: #fff;
}

.lph-row-action.is-primary {
    border-color: rgba(199, 162, 71, 0.28);
    background: rgba(199, 162, 71, 0.12);
}

.lph-row-action.is-primary:hover {
    background: rgba(199, 162, 71, 0.18);
}

.lph-table-empty-actions {
    color: var(--lph-text-muted);
    font-size: 0.9rem;
}

/* --------------------------------------------------
   Form Card
-------------------------------------------------- */

.lph-form {
    display: grid;
    gap: 18px;
}

.lph-form-section {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.lph-form-section-head h4 {
    margin: 0 0 6px;
    color: #fff;
    font-size: 0.98rem;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.012em;
}

.lph-form-section-head p {
    margin: 0;
    color: var(--lph-text-secondary);
    font-size: 0.88rem;
    line-height: 1.55;
}

.lph-grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.lph-form-group {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.lph-form-group-full {
    grid-column: 1 / -1;
}

.lph-label {
    color: #fff;
    font-size: 0.84rem;
    line-height: 1.2;
    font-weight: 600;
}

.lph-required {
    color: #ffb0b0;
    margin-inline-start: 4px;
}

.lph-field-hint {
    color: var(--lph-text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.lph-field-error {
    color: #ffb0b0;
    font-size: 0.78rem;
    line-height: 1.4;
}

.lph-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
}

.lph-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--lph-gold);
}

.lph-file-input {
    padding-top: 9px;
    padding-bottom: 9px;
}

.lph-form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 2px;
}

/* --------------------------------------------------
   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(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
}

.lph-badge-default {
    background: rgba(255, 255, 255, 0.03);
    color: #eaf0ff;
}

.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: #fff;
    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 rgba(255, 255, 255, 0.05);
    }

    .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: #d6b86e;
    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: #fff;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0 0 12px;
}

.lph-section-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 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(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: 160ms ease;
}

.lph-panel-item:hover {
    border-color: rgba(199, 162, 71, 0.2);
    background: rgba(255, 255, 255, 0.035);
}

.lph-hero-card {
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 32px;
}

/* Stats grid for public */
.lph-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: rgba(255, 255, 255, 0.05);
}

.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(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.lph-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #c7a247;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.lph-stat-hint {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Public panel */
.lph-panel {
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.lph-panel-header {
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.lph-panel-header h3 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
}

.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: #fff;
}

.lph-panel-item-copy p {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 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;
    }
}

/* --------------------------------------------------
   Short CSS variable aliases (for backward compat)
-------------------------------------------------- */

:root {
    --gold:           var(--lph-gold);
    --gold-soft:      var(--lph-gold-soft);
    --text-primary:   var(--lph-text-primary);
    --text-secondary: var(--lph-text-secondary);
    --text-muted:     var(--lph-text-muted);
    --surface-1:      var(--lph-surface-1);
    --surface-2:      var(--lph-surface-2);
    --border:         var(--lph-border-soft);
    --border-gold:    var(--lph-border-gold);
}

/* --------------------------------------------------
   Portal card (used in dashboard/order/case views)
-------------------------------------------------- */

.lph-card {
    background: var(--lph-surface-1);
    border: 1px solid var(--lph-border-soft);
    border-radius: var(--lph-radius-md);
    overflow: hidden;
}

.lph-card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--lph-border-soft);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--lph-text-primary);
}

.lph-card-body {
    padding: 16px 18px;
}

/* --------------------------------------------------
   Alert banners
-------------------------------------------------- */

.lph-alert {
    padding: 10px 16px;
    border-radius: var(--lph-radius-sm);
    font-size: 0.85rem;
    margin-bottom: 14px;
}

.lph-alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #4ade80;
}

.lph-alert-danger, .lph-alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
}

.lph-alert-warning {
    background: rgba(199, 162, 71, 0.1);
    border: 1px solid rgba(199, 162, 71, 0.25);
    color: #e6c97b;
}

.lph-alert-info {
    background: rgba(74, 144, 226, 0.1);
    border: 1px solid rgba(74, 144, 226, 0.25);
    color: #9cc7ff;
}

/* --------------------------------------------------
   Portal page header
-------------------------------------------------- */

.lph-portal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.lph-portal-header h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--lph-text-primary);
}

.lph-muted {
    color: var(--lph-text-muted);
    font-size: 0.85rem;
    margin: 0;
}

/* --------------------------------------------------
   Stats row (horizontal flex stats)
-------------------------------------------------- */

.lph-stats-row {
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.lph-stats-row .lph-stat-card {
    flex: 1;
    min-width: 140px;
    background: var(--lph-surface-1);
    border: 1px solid var(--lph-border-soft);
    border-radius: var(--lph-radius-md);
    padding: 16px 18px;
}

/* --------------------------------------------------
   Input size variants
-------------------------------------------------- */

.lph-input-sm {
    padding: 6px 10px;
    font-size: 0.82rem;
    border-radius: 8px;
}

.lph-btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    min-height: auto;
    border-radius: 8px;
}

.lph-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--lph-text-primary);
}

.lph-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
}

.lph-btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.65);
}

.lph-btn-outline:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
}

/* --------------------------------------------------
   Badge extra tones
-------------------------------------------------- */

.lph-badge-muted {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--lph-text-muted);
}

.lph-badge-customer {
    background: rgba(74, 144, 226, 0.14);
    border-color: rgba(74, 144, 226, 0.22);
    color: #9cc7ff;
}

.lph-badge-partner {
    background: rgba(199, 162, 71, 0.14);
    border-color: rgba(199, 162, 71, 0.24);
    color: #e6c97b;
}

.lph-badge-agent {
    background: rgba(37, 184, 101, 0.14);
    border-color: rgba(37, 184, 101, 0.22);
    color: #8ff0b7;
}

.lph-badge-lawyer {
    background: rgba(147, 114, 255, 0.14);
    border-color: rgba(147, 114, 255, 0.22);
    color: #c9b8ff;
}

.lph-badge-translator {
    background: rgba(255, 147, 51, 0.14);
    border-color: rgba(255, 147, 51, 0.22);
    color: #ffcb8e;
}

.lph-badge-finance {
    background: rgba(37, 211, 184, 0.14);
    border-color: rgba(37, 211, 184, 0.22);
    color: #7ef8e5;
}

.lph-badge-operations {
    background: rgba(236, 72, 72, 0.14);
    border-color: rgba(236, 72, 72, 0.22);
    color: #ffb0b0;
}

/* --------------------------------------------------
   Mobile sidebar overlay + hamburger
-------------------------------------------------- */

.lph-mobile-topbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(2, 7, 17, 0.99);
    border-radius: var(--lph-radius-xl) var(--lph-radius-xl) 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.lph-mobile-topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lph-mobile-topbar-brand .lph-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 0.82rem;
}

.lph-mobile-topbar-brand span {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.lph-hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.lph-hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.lph-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 98;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.lph-sidebar-overlay.is-open {
    display: block;
}

/* --------------------------------------------------
   Mobile: prevent horizontal overflow in portal
-------------------------------------------------- */

@media (max-width: 768px) {
    .lph-mobile-topbar {
        display: flex;
    }

    .lph-shell {
        grid-template-columns: 1fr !important;
        border-radius: 0 0 var(--lph-radius-2xl) var(--lph-radius-2xl);
    }

    .lph-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 280px !important;
        height: 100vh !important;
        z-index: 99;
        overflow-y: auto !important;
        border-radius: 0 !important;
        border-right: 1px solid rgba(199, 162, 71, 0.15) !important;
        box-shadow: 4px 0 32px rgba(0, 0, 0, 0.7);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .lph-sidebar.is-open {
        transform: translateX(0);
    }

    .lph-portal-header {
        flex-direction: column;
        gap: 10px;
    }

    .lph-stats-row {
        flex-direction: column;
    }

    .lph-stats-row .lph-stat-card {
        min-width: 0;
    }

    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    [style*="grid-template-columns:1fr 2fr auto"],
    [style*="grid-template-columns: 1fr 2fr auto"] {
        grid-template-columns: 1fr !important;
    }

    [style*="grid-template-columns:repeat(2,1fr)"],
    [style*="grid-template-columns: repeat(2, 1fr)"],
    [style*="grid-template-columns:repeat(2, 1fr)"],
    [style*="grid-template-columns: repeat(2,1fr)"] {
        grid-template-columns: 1fr !important;
    }

    [style*="grid-template-columns:repeat(4,1fr)"],
    [style*="grid-template-columns: repeat(4, 1fr)"],
    [style*="grid-template-columns:repeat(4, 1fr)"],
    [style*="grid-template-columns: repeat(4,1fr)"] {
        grid-template-columns: 1fr 1fr !important;
    }

    .lph-card-header[style*="display:flex"] {
        flex-direction: column;
        gap: 8px;
    }

    .lph-btn {
        white-space: nowrap;
    }

    .lph-page-actions {
        flex-wrap: wrap;
    }

    .lph-portal-header .lph-btn {
        width: 100%;
        justify-content: center;
    }

    /* Auto-scroll any card body containing a wide table (tablet only — overridden at 540px) */
    .lph-card-body > table,
    .lph-card > table {
        min-width: 480px;
    }

    .lph-card-body,
    .lph-card {
        overflow-x: auto;
    }

    /* Tighter grid on small screens */
    [style*="grid-template-columns:repeat(3,1fr)"] {
        grid-template-columns: 1fr !important;
    }
    [style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: 1fr !important;
    }
    [style*="grid-template-columns:repeat(auto-fill"] {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* --------------------------------------------------
   Global overflow protection
-------------------------------------------------- */
html, body { overflow-x: hidden; }

.lph-main { overflow-x: hidden; min-width: 0; }

/* Ensure all inline-styled tables can scroll on narrow viewports */
.lph-card { overflow: hidden; }
.lph-card-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Tap-target minimum for buttons */
.lph-btn {
    min-height: 40px;
    min-width: 40px;
}

/* Compact card styling */
.lph-card-header {
    border-bottom: 1px solid var(--border);
}

/* Remove any remaining white/light backgrounds from native inputs */
input, select, textarea {
    background-color: #0d1e2e;
    color: #e0e4ec;
    color-scheme: dark;
}

/* Force dark on native select even without lph-input class */
select {
    -webkit-appearance: none;
    appearance: none;
    background-color: #0d1e2e !important;
    color: #e0e4ec !important;
    color-scheme: dark;
}
select option {
    background-color: #0d1e2e;
    color: #e0e4ec;
}

/* Dark background for plain <table> elements inside portal cards */
.lph-card-body table,
.lph-portal-content table,
.lph-page table {
    background: transparent;
    color: var(--lph-text-primary, #e0e4ec);
}
.lph-card-body table td,
.lph-card-body table th,
.lph-portal-content table td,
.lph-portal-content table th {
    background: transparent;
    color: inherit;
}
.lph-card-body table tr,
.lph-portal-content table tr {
    background: transparent;
}

/* Logo alignment in sidebar brand card */
.lph-brand-card {
    align-items: center;
}
.lph-brand-card img {
    max-height: 44px;
    max-width: 160px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

/* Premium scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
::-webkit-scrollbar-thumb { background: rgba(199,162,71,0.25); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(199,162,71,0.4); }

/* --------------------------------------------------
   Mobile: Table → Stacked Cards (≤ 540px)
-------------------------------------------------- */
@media (max-width: 540px) {
    .lph-page-wrap { padding: 8px; }

    /* Table card layout — covers lph-table + inline portal tables */
    .lph-table-scroll {
        overflow-x: visible;
        border: none;
        background: transparent;
        border-radius: 0;
    }
    .lph-table,
    .lph-card-body table,
    .lph-card table {
        min-width: 0 !important;
        width: 100% !important;
        border-collapse: collapse;
    }
    .lph-table thead,
    .lph-card-body table thead,
    .lph-card table thead { display: none; }
    .lph-table tbody tr,
    .lph-card-body table tbody tr,
    .lph-card table tbody tr {
        display: block;
        background: rgba(255,255,255,0.025);
        border: 1px solid rgba(255,255,255,0.07);
        border-radius: 14px;
        margin-bottom: 10px;
        padding: 4px 0;
        overflow: hidden;
    }
    .lph-table tbody td,
    .lph-card-body table tbody td,
    .lph-card table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 14px;
        border-bottom: 1px solid rgba(255,255,255,0.04);
        font-size: 0.83rem;
        gap: 10px;
    }
    .lph-table tbody tr:last-child td:last-child,
    .lph-card-body table tbody tr:last-child td:last-child { border-bottom: none; }
    .lph-table tbody td::before,
    .lph-card-body table tbody td::before,
    .lph-card table tbody td::before {
        content: attr(data-label);
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.09em;
        color: var(--lph-text-muted);
        flex-shrink: 0;
        min-width: 80px;
    }
    .lph-table tbody td:empty { display: none; }
    .lph-table-actions { justify-content: flex-start; }
    .lph-row-actions { justify-content: flex-start; flex-wrap: wrap; }
    /* "View →" inline links in tables */
    .lph-card-body table tbody td a { font-size: 0.82rem; }

    /* Touch targets */
    .lph-btn, .lph-row-action { min-height: 44px; }
    .lph-row-action {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    /* Page header */
    .lph-page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .lph-page-actions { width: 100%; flex-wrap: wrap; }
    .lph-page-actions .lph-btn { flex: 1 1 auto; justify-content: center; text-align: center; }
    .lph-page-title h1 { font-size: 1.15rem; }

    /* Forms */
    .lph-form-section-body { padding: 14px; }
    .lph-input, .lph-select, .lph-textarea { width: 100% !important; font-size: 16px !important; } /* 16px prevents iOS zoom */
    .lph-form-actions { flex-direction: column; gap: 8px; }
    .lph-form-actions .lph-btn { width: 100%; justify-content: center; }

    /* Stat cards */
    .lph-stat-card { padding: 14px 16px; }
    .lph-stat-value { font-size: 1.7rem; }

    /* Card headers */
    .lph-card-header { padding: 12px 14px; }
    .lph-card-body { padding: 0; }

    /* Toolbar */
    .lph-toolbar { padding: 10px 14px; }
    .lph-toolbar-search { flex: 1 1 100%; }
}

/* --------------------------------------------------
   RTL: Mobile sidebar slides from right
-------------------------------------------------- */
@media (max-width: 768px) {
    [dir="rtl"] .lph-sidebar {
        left: auto !important;
        right: 0 !important;
        transform: translateX(100%) !important;
        border-right: none !important;
        border-left: 1px solid rgba(199,162,71,0.15) !important;
    }
    [dir="rtl"] .lph-sidebar.is-open {
        transform: translateX(0) !important;
    }

    /* RTL text alignment fixes */
    [dir="rtl"] .lph-table thead th,
    [dir="rtl"] .lph-table tbody td { text-align: right; }
    [dir="rtl"] .lph-table-actions-head,
    [dir="rtl"] .lph-table-actions { text-align: left; }
    [dir="rtl"] .lph-row-actions { justify-content: flex-start; }

    /* Ensure main content not obscured by sidebar on mobile */
    .lph-main { padding: 14px 12px; }
}

/* --------------------------------------------------
   Public: Mobile hero + sections
-------------------------------------------------- */
@media (max-width: 768px) {
    /* Reduce large horizontal padding on public sections */
    section[style*="padding:60px 48px"],
    section[style*="padding: 60px 48px"],
    section[style*="padding:52px 48px"],
    section[style*="padding: 52px 48px"] {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
    /* Hero and wide content containers */
    [style*="max-width:1160px;margin:0 auto"],
    [style*="max-width: 1160px; margin: 0 auto"],
    [style*="max-width:1100px;margin:0 auto"] {
        padding-left: 4px;
        padding-right: 4px;
    }
    /* Wide content areas inside sections */
    [style*="max-width:700px;margin:0 auto"],
    [style*="max-width:600px;margin:0 auto"] {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

@media (max-width: 540px) {
    .pub-btn-primary, .pub-btn-outline {
        min-height: 48px;
        padding: 12px 20px;
        width: 100%;
        justify-content: center;
    }
    .pub-cta-section { padding: 40px 16px; }
    .pub-footer { padding: 20px 14px; }
    .lph-section-heading { font-size: 1.5rem; }
    /* Hero section side padding */
    section[style*="padding:60px 48px"],
    section[style*="padding: 60px 48px"],
    section[style*="padding:52px 48px"],
    section[style*="padding: 52px 48px"] {
        padding-top: 32px !important;
        padding-bottom: 32px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}