:root {
    --gp-bg: #F6F5F0;
    --gp-surface: #FFFFFF;
    --gp-border: #E3DFD5;
    --gp-text: #14221D;
    --gp-muted: #5A6B64;
    --gp-primary: #145346;
    --gp-primary-hover: #0F4036;
    --gp-primary-soft: #E7F2EE;
    --gp-amber: #B85D19;
    --gp-amber-soft: #FDF3E7;
    --gp-danger: #B91C1C;
    --gp-danger-soft: #FEF2F2;
    --gp-radius: 16px;
    --gp-shadow: 0 10px 28px rgba(20, 34, 29, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    max-width: 100%;
    overflow-x: hidden;
    background: var(--gp-bg);
    color: var(--gp-text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.gp-landing-body {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at 15% 15%, rgba(20,83,70,0.10), transparent 45%),
                radial-gradient(circle at 85% 80%, rgba(184,93,25,0.10), transparent 45%),
                var(--gp-bg);
}

.gp-auth-card {
    width: 100%;
    max-width: 620px;
    background: var(--gp-surface);
    border: 1px solid var(--gp-border);
    border-radius: 22px;
    padding: 32px;
    box-shadow: var(--gp-shadow);
}

.gp-auth-brand, .gp-brand-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.gp-brand-emblem {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: linear-gradient(135deg, #145346, #0D382F);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(20, 83, 70, 0.22);
}

.gp-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--gp-amber);
    text-transform: uppercase;
}

.gp-auth-card h1 {
    margin: 4px 0 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 24px;
    letter-spacing: -0.02em;
}

.gp-auth-desc {
    color: var(--gp-muted);
    font-size: 14.5px;
    line-height: 1.6;
    margin: 16px 0 20px;
}

.gp-impact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin-bottom: 22px;
}

.gp-impact-item {
    background: #FAF9F6;
    border: 1px solid var(--gp-border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.gp-impact-item strong { font-size: 12.5px; color: var(--gp-primary); }
.gp-impact-item span { font-size: 12px; color: var(--gp-muted); line-height: 1.45; }

.gp-auth-foot {
    margin-top: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--gp-muted);
}

.gp-restricted-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--gp-danger-soft);
    color: var(--gp-danger);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Topbar */
.gp-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--gp-border);
}

.gp-topbar-inner {
    max-width: 1380px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.gp-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: var(--gp-text);
}
.gp-title-sub {
    font-weight: 500;
    font-size: 13.5px;
    color: var(--gp-muted);
    margin-left: 6px;
}

.gp-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.gp-operator-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--gp-primary-soft);
    border: 1px solid rgba(20, 83, 70, 0.18);
}
.gp-op-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
}
.gp-op-name { font-size: 12.5px; font-weight: 700; color: var(--gp-primary); }
.gp-op-role { font-size: 11px; color: var(--gp-muted); }

/* Container */
.gp-container {
    max-width: 1380px;
    margin: 0 auto;
    padding: 22px 20px 90px;
}

.gp-rule-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 14px;
    background: linear-gradient(90deg, #E7F2EE 0%, #FDF8F2 100%);
    border: 1px solid rgba(20, 83, 70, 0.18);
    margin-bottom: 20px;
    font-size: 13.5px;
    line-height: 1.55;
}
.gp-rule-icon { color: var(--gp-primary); flex-shrink: 0; margin-top: 2px; }

.gp-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.gp-kpi-card {
    background: var(--gp-surface);
    border: 1px solid var(--gp-border);
    border-radius: 15px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 4px 14px rgba(20,34,29,0.03);
}
.gp-kpi-amber { border-left: 4px solid var(--gp-amber); }
.gp-kpi-teal { border-left: 4px solid var(--gp-primary); }
.gp-kpi-label { font-size: 12px; font-weight: 600; color: var(--gp-muted); }
.gp-kpi-val { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 26px; font-weight: 800; color: var(--gp-text); }
.gp-kpi-sub { font-size: 11.5px; color: var(--gp-muted); }

/* Toolbar */
.gp-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.gp-tabs {
    display: flex;
    gap: 6px;
    background: #EAE7DD;
    padding: 5px;
    border-radius: 13px;
    overflow-x: auto;
    max-width: 100%;
}

.gp-tab {
    border: none;
    background: transparent;
    color: var(--gp-muted);
    font-weight: 600;
    font-size: 13px;
    padding: 9px 14px;
    border-radius: 9px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    transition: all 0.18s ease;
}
.gp-tab.active {
    background: var(--gp-surface);
    color: var(--gp-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.gp-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.gp-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.gp-search-wrap svg {
    position: absolute;
    left: 11px;
    color: var(--gp-muted);
    pointer-events: none;
}
.gp-search-wrap input {
    padding: 9px 12px 9px 34px;
    border-radius: 10px;
    border: 1px solid var(--gp-border);
    background: var(--gp-surface);
    font-size: 13.5px;
    min-width: 240px;
}

.gp-select, .gp-field input, .gp-field textarea {
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--gp-border);
    background: var(--gp-surface);
    font-family: inherit;
    font-size: 13.5px;
    color: var(--gp-text);
}

/* Buttons */
.gp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 15px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.16s ease;
}
.gp-btn-full { width: 100%; padding: 12px 18px; font-size: 14px; }
.gp-btn-primary { background: var(--gp-primary); color: #fff; }
.gp-btn-primary:hover { background: var(--gp-primary-hover); }
.gp-btn-secondary { background: var(--gp-primary-soft); color: var(--gp-primary); border-color: rgba(20,83,70,0.2); }
.gp-btn-ghost { background: var(--gp-surface); color: var(--gp-text); border-color: var(--gp-border); }
.gp-btn-ghost:hover { background: #F3F1EA; }
.gp-btn-danger { background: var(--gp-danger); color: #fff; }
.gp-btn-warn { background: var(--gp-amber-soft); color: #9A4409; border-color: rgba(184,93,25,0.3); }
.gp-btn-warn:hover { background: #FCE8D2; }
.gp-btn-success { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }

/* Panels & Cards */
.gp-panel { display: none; }
.gp-panel.active { display: block; }

.gp-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.gp-item-card {
    background: var(--gp-surface);
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 16px rgba(20,34,29,0.04);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.gp-item-card:hover { transform: translateY(-2px); box-shadow: var(--gp-shadow); }
.gp-item-card.is-retired {
    background: #FCFBF8;
    border-color: #E7C6A5;
    border-left: 4px solid var(--gp-amber);
}
.gp-item-card.is-mandatory {
    border-left: 4px solid var(--gp-primary);
}

.gp-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.gp-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
}
.gp-pill-live { background: #DCFCE7; color: #166534; }
.gp-pill-retired { background: #FEF3C7; color: #92400E; }
.gp-pill-mandatory { background: var(--gp-primary-soft); color: var(--gp-primary); }
.gp-pill-cat {
    background: #F1EFE8;
    color: #475650;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
}

.gp-card-title {
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.3;
}
.gp-card-sub {
    margin: 4px 0 0;
    font-size: 12.5px;
    color: var(--gp-muted);
    line-height: 1.45;
}

.gp-price-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 11px;
    background: #F8F7F3;
}
.gp-price-tag {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 19px;
    font-weight: 800;
    color: var(--gp-primary);
}
.gp-price-tag small { font-size: 12px; font-weight: 500; color: var(--gp-muted); }
.gp-holders-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--gp-text);
}

.gp-retired-notice {
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--gp-amber-soft);
    border: 1px dashed rgba(184,93,25,0.45);
    font-size: 12px;
    color: #7C3709;
    line-height: 1.45;
}

.gp-card-actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.gp-card-actions .gp-btn { flex: 1; min-width: 120px; }

/* Split legacy + audit */
.gp-split-2 {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 18px;
}

.gp-surface {
    background: var(--gp-surface);
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius);
    padding: 20px;
}
.gp-surface-head h3 { margin: 0 0 4px; font-size: 16px; }
.gp-surface-head p { margin: 0 0 14px; font-size: 12.5px; color: var(--gp-muted); }

.gp-table-wrap { overflow-x: auto; }
.gp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.gp-table th, .gp-table td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--gp-border);
}
.gp-table th { font-size: 11.5px; text-transform: uppercase; color: var(--gp-muted); }

.gp-audit-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 520px;
    overflow-y: auto;
}
.gp-audit-row {
    padding: 10px 12px;
    border-radius: 11px;
    background: #FAF9F5;
    border: 1px solid var(--gp-border);
    font-size: 12.5px;
}
.gp-audit-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: var(--gp-muted);
    margin-bottom: 4px;
}

/* Modal */
.gp-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(15, 25, 22, 0.52);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.gp-modal-backdrop[hidden] { display: none !important; }

.gp-modal {
    width: 100%;
    max-width: 540px;
    max-height: 90dvh;
    overflow-y: auto;
    background: var(--gp-surface);
    border-radius: 20px;
    border: 1px solid var(--gp-border);
    box-shadow: 0 24px 50px rgba(0,0,0,0.22);
}
.gp-modal-wide { max-width: 680px; }

.gp-modal-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.gp-modal-head h3 { margin: 0; font-size: 17px; }
.gp-icon-close {
    border: none;
    background: #F1EFE8;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
}

.gp-modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.gp-impact-callout {
    background: var(--gp-amber-soft);
    border: 1px solid rgba(184,93,25,0.3);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 12.5px;
    color: #6B310A;
}
.gp-impact-callout ul { margin: 6px 0 0; padding-left: 18px; }
.gp-impact-callout li { margin-bottom: 4px; }

.gp-field { display: flex; flex-direction: column; gap: 6px; }
.gp-field span { font-size: 12.5px; font-weight: 600; color: var(--gp-text); }
.gp-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.gp-col-2 { grid-column: span 2; }
.gp-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
}

.gp-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 120;
    background: #14221D;
    color: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

@media (max-width: 1024px) {
    .gp-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gp-split-2 { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
    .gp-hide-sm { display: none !important; }
    .gp-container { padding: 14px 12px 84px; }
    .gp-topbar-inner { padding: 10px 12px; }
    .gp-title-sub { display: none; }
    .gp-kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .gp-kpi-card { padding: 12px; }
    .gp-kpi-val { font-size: 21px; }
    .gp-cards-grid { grid-template-columns: 1fr; }
    .gp-search-wrap, .gp-search-wrap input, .gp-toolbar-right, .gp-select { width: 100%; min-width: 0; }
    .gp-form-grid { grid-template-columns: 1fr; }
    .gp-col-2 { grid-column: span 1; }
}
