:root {
    --ink: #111318;
    --panel: #181b22;
    --line: #2d3340;
    --navy: #071c3f;
    --blue: #0b2f67;
    --gold: #d8a84d;
    --gold-2: #f2d083;
    --paper: #f7f4ed;
    --muted: #8d95a3;
    --ok: #167a4a;
    --bad: #b83d45;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--paper);
    background: #101217;
}
a { color: inherit; }
input, textarea, select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    background: #11141b;
    color: var(--paper);
    padding: 10px 12px;
    border-radius: 6px;
}
textarea { min-height: 82px; resize: vertical; }
label { display: grid; gap: 6px; color: #d9dde6; font-size: 13px; }
button, .link-button {
    border: 0;
    border-radius: 6px;
    min-height: 40px;
    padding: 10px 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #15100a; }
.secondary, .ghost { background: #242a36; color: var(--paper); }
.danger { background: #3a1d22; color: #ffd7dc; border: 1px solid #7a2c35; }
.app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
    background: #0c1018;
    border-right: 1px solid var(--line);
    padding: 18px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 800; color: var(--gold-2); }
.brand img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.sidebar nav { display: grid; gap: 6px; margin-top: 28px; }
.sidebar nav a {
    color: #dbe3f3;
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 6px;
}
.sidebar nav a:hover { background: #172033; color: var(--gold-2); }
.main { padding: 22px; min-width: 0; }
.topbar {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    margin-bottom: 22px;
}
.topbar div { display: grid; gap: 3px; }
.topbar span { color: var(--muted); font-size: 13px; }
.topbar-account {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}
.user-chip {
    min-width: 0;
    text-align: right;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #121821;
}
.user-chip strong {
    display: block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-chip span {
    display: block;
    color: var(--gold-2);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}
.topbar-account form {
    margin: 0;
}
.topbar-account .ghost {
    min-width: 74px;
}
h1 { margin: 0 0 18px; font-size: 30px; }
h2 { margin: 0 0 12px; }
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 36px;
    align-items: center;
    min-height: calc(100vh - 120px);
}
.hero h1 { font-size: 64px; line-height: 1; color: var(--gold-2); }
.hero p { color: #d4d9e4; font-size: 18px; max-width: 620px; }
.hero img { width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.eyebrow { color: var(--gold) !important; text-transform: uppercase; font-size: 12px !important; letter-spacing: 0 !important; font-weight: 800; }
.actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.auth-panel, .panel {
    max-width: 560px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px;
}
.auth-panel.wide { max-width: 860px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.metric-grid div, .plan {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}
.metric-grid span { color: var(--muted); display: block; margin-bottom: 8px; }
.metric-grid strong { font-size: 25px; color: var(--gold-2); }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plan strong { display: block; color: var(--gold-2); font-size: 24px; margin-bottom: 10px; }
.mt { margin-top: 18px; }
.full { grid-column: 1 / -1; }
.item-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--line);
    margin-bottom: 12px;
}
.content-list { display: grid; gap: 14px; }
.content-card { max-width: none; }
.welcome-notice-card {
    max-width: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: linear-gradient(135deg, #171b23, #10141b);
    border: 1px solid rgba(216, 168, 77, .42);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 18px;
}
.welcome-notice-card h2 { margin-bottom: 6px; }
.welcome-notice-card p { margin: 0; color: #cbd3df; }
.welcome-notice-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.welcome-letter-page { max-width: 980px; margin: 0 auto; }
.welcome-letter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 16px;
}
.welcome-letter {
    background: #f7f4ed;
    color: #16181d;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .26);
}
.welcome-letter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 34px 38px;
    background: linear-gradient(135deg, #101217, #172033);
    color: var(--paper);
    border-bottom: 5px solid var(--gold);
}
.welcome-letter-head h1 {
    margin: 8px 0;
    color: var(--gold-2);
    font-size: 34px;
}
.welcome-letter-head p { margin: 0; color: #d7deea; }
.welcome-letter-head img {
    width: 86px;
    height: 86px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(242, 208, 131, .42);
}
.welcome-letter-body {
    padding: 34px 38px;
    display: grid;
    gap: 18px;
}
.welcome-letter-body h2 { color: #0f1724; margin: 0; }
.welcome-letter-body p {
    color: #303846;
    line-height: 1.65;
    margin: 0;
}
.letter-date { justify-self: end; font-weight: 700; }
.welcome-letter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 8px 0;
}
.welcome-letter-grid div {
    border: 1px solid #d9d0bf;
    background: #fffaf0;
    border-radius: 8px;
    padding: 13px;
}
.welcome-letter-grid span {
    display: block;
    color: #69707c;
    font-size: 12px;
    margin-bottom: 5px;
}
.welcome-letter-grid strong {
    display: block;
    color: #111318;
    overflow-wrap: anywhere;
}
.welcome-letter-foot {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 38px;
    background: #111318;
    color: var(--paper);
}
.welcome-letter-foot div { display: grid; gap: 4px; }
.welcome-letter-foot strong { color: var(--gold-2); }
.welcome-letter-foot span, .welcome-letter-foot p { color: #c7cfdb; margin: 0; }
.split { max-width: none; display: grid; grid-template-columns: 1fr 1.2fr; gap: 18px; align-items: start; }
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.project-form-panel { max-width: none; }
.member-project-grid, .project-list, .admin-project-grid {
    display: grid;
    gap: 16px;
}
.member-project-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 340px));
    align-items: start;
}
.admin-project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.project-card, .member-project-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}
.project-card { padding: 18px; }
.project-card-link {
    display: grid;
    grid-template-rows: auto 1fr;
    color: inherit;
    text-decoration: none;
    height: 100%;
}
.project-card-media {
    aspect-ratio: 16 / 8.5;
    background: #0d1119;
    border-bottom: 1px solid var(--line);
}
.project-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.project-media-placeholder {
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--gold-2);
    font-size: 42px;
    font-weight: 900;
    background: linear-gradient(135deg, #121925, #0f131b);
}
.project-media-placeholder.large {
    min-height: 320px;
}
.project-card-content {
    display: grid;
    grid-template-rows: auto minmax(44px, 1fr) auto;
    gap: 11px;
    padding: 15px;
    min-height: 222px;
}
.project-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 0;
}
.project-card-head h2 {
    margin: 4px 0 0;
    line-height: 1.18;
    font-size: 21px;
    overflow-wrap: anywhere;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(242, 208, 131, .14);
    color: var(--gold-2);
    border: 1px solid rgba(216, 168, 77, .36);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.project-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 0;
}
.project-meta-grid div {
    background: #121720;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    min-height: 55px;
}
.project-meta-grid span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-bottom: 4px;
}
.project-meta-grid strong {
    color: var(--paper);
    display: block;
    line-height: 1.25;
    overflow-wrap: normal;
    word-break: normal;
}
.project-card p {
    color: #cbd3df;
    margin: 0;
    line-height: 1.45;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.empty-state {
    border-style: dashed;
}
.project-detail-page {
    max-width: 1120px;
    margin: 0 auto;
}
.project-detail {
    display: grid;
    gap: 18px;
}
.project-detail-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 16px;
}
.project-detail-header,
.project-info-panel,
.project-section {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px;
}
.project-detail-header h1 {
    margin: 8px 0 10px;
    color: var(--gold-2);
}
.project-detail-header p,
.project-section p {
    color: #cbd3df;
    line-height: 1.65;
    margin: 0;
}
.project-info-panel h2,
.project-section h2 {
    margin-bottom: 14px;
}
.project-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.project-detail-grid div {
    background: #121720;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}
.project-detail-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 6px;
}
.project-detail-grid strong {
    color: var(--paper);
    overflow-wrap: anywhere;
}
.project-notes p {
    color: #cbd3df;
    line-height: 1.65;
}
.project-media-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #121720;
}
.project-media-summary div {
    min-width: 110px;
}
.project-media-summary span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}
.project-media-summary strong {
    color: var(--gold-2);
    font-size: 20px;
}
.project-existing-media {
    display: grid;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #121720;
}
.section-title-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}
.section-title-row h3,
.media-edit-block h4 {
    margin: 0;
}
.section-title-row p {
    margin: 0;
    max-width: 620px;
}
.media-edit-block {
    display: grid;
    gap: 10px;
}
.media-edit-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.video-edit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.media-edit-card {
    display: grid;
    gap: 9px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0f141d;
}
.media-edit-card img,
.media-edit-card video {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 6px;
    background: #0b0f16;
}
.media-edit-card span {
    color: #dbe3f3;
    font-size: 12px;
    overflow-wrap: anywhere;
}
.media-edit-card b,
.check-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffd7dc;
    font-size: 13px;
}
.media-edit-card input,
.check-row input {
    width: auto;
    min-height: auto;
}
.document-edit-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.file-list {
    display: block;
}
.file-list ul {
    display: grid;
    gap: 6px;
    margin: 4px 0 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #10151f;
    list-style: none;
}
.file-list li {
    color: #dbe3f3;
    font-size: 12px;
    overflow-wrap: anywhere;
}
.file-list .file-error,
.upload-total-warning.file-error {
    color: #ff9c9c;
}
.project-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.project-gallery a {
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #0d1119;
}
.project-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.project-video-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.project-video-grid video {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #0d1119;
    display: block;
}
.project-list-table td {
    vertical-align: middle;
}
.project-list-title {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-width: 320px;
}
.project-list-title img,
.project-list-title > span {
    width: 72px;
    height: 54px;
    border-radius: 8px;
    border: 1px solid var(--line);
    object-fit: cover;
    background: #0d1119;
}
.project-list-title > span {
    display: grid;
    place-items: center;
    color: var(--gold-2);
    font-size: 24px;
    font-weight: 900;
}
.project-list-title strong,
.project-list-title small,
.project-list-title p {
    display: block;
}
.project-list-title small {
    color: var(--gold-2);
    margin-top: 3px;
}
.project-list-title p {
    color: var(--muted);
    margin: 5px 0 0;
    line-height: 1.35;
}
.project-list-media {
    display: grid;
    gap: 6px;
    min-width: 96px;
}
.project-list-media span {
    color: #dbe3f3;
}
.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.inline-delete { margin: 0; }
.inline-delete button { min-height: 40px; }
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--gold-2); font-size: 13px; background: #111722; }
.alert { padding: 12px 14px; border-radius: 6px; margin-bottom: 16px; background: #17351f; border: 1px solid #285c35; }
.alert.error { background: #3a171b; border-color: #713138; }
.badge { background: #253149; border-radius: 999px; padding: 4px 9px; color: #d8e4ff; font-size: 12px; }
.pos { color: #7be0a3; }
.neg { color: #ff9c9c; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline select, .inline input { min-width: 120px; }
.tree { overflow-x: auto; padding-bottom: 16px; }
.node {
    display: inline-grid;
    gap: 4px;
    background: var(--panel);
    border: 1px solid var(--gold);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 8px;
    min-width: 150px;
}
.node span { color: var(--muted); font-size: 12px; }
.children { margin-left: 26px; border-left: 1px solid var(--line); padding-left: 14px; }
.install-page { background: #111318; color: var(--paper); }
.install-shell { display: grid; grid-template-columns: 420px 1fr; min-height: 100vh; }
.brand-panel {
    background: #0b0e14;
    display: grid;
    align-content: center;
    justify-items: center;
    padding: 30px;
    text-align: center;
}
.install-logo { width: 230px; max-width: 80%; border-radius: 8px; }
.brand-panel h1 { color: var(--gold-2); }
.install-form { padding: 40px; align-self: center; }
.install-form form { display: grid; gap: 18px; max-width: 920px; }

@media (max-width: 1100px) {
    .app-shell, .install-shell { grid-template-columns: 1fr; }
    .sidebar { position: sticky; top: 0; z-index: 20; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 14px; }
    .sidebar-head { width: 100%; }
    .brand img { width: 36px; height: 36px; }
    .nav-toggle-button { display: grid; }
    .side-nav { display: none !important; grid-template-columns: 1fr; gap: 8px; margin-top: 12px; max-height: calc(100vh - 78px); overflow-y: auto; padding: 8px 0 4px; }
    .nav-toggle:checked ~ .nav-toggle-button span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
    .nav-toggle:checked ~ .nav-toggle-button span:nth-child(2) { opacity: 0; }
    .nav-toggle:checked ~ .nav-toggle-button span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
    .sidebar:has(.nav-toggle:checked) .side-nav { display: grid !important; }
    .sidebar nav a { padding: 12px 13px; background: #111722; }
    .hero, .split, .grid.two, .filter-bar { grid-template-columns: 1fr; }
    .member-project-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 330px)); }
    .admin-project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .project-meta-grid, .project-detail-grid, .project-gallery, .project-video-grid, .media-edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .welcome-notice-card, .welcome-letter-foot { flex-direction: column; align-items: flex-start; }
    .welcome-notice-actions { justify-content: flex-start; }
    .welcome-letter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero { min-height: auto; padding: 22px 0; }
    .hero h1 { font-size: 44px; }
    .metric-grid, .metric-grid.compact, .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    table { display: block; overflow-x: auto; white-space: nowrap; }
    .member-head { flex-direction: column; }
}
@media (max-width: 560px) {
    .main { padding: 14px; }
    .metric-grid, .metric-grid.compact, .plan-grid { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; gap: 10px; flex-direction: column; }
    .topbar-account { width: 100%; justify-content: space-between; }
    .user-chip { text-align: left; }
    .user-chip strong { max-width: 160px; }
    table { font-size: 13px; }
    .auth-panel, .panel { padding: 16px; }
    .hero h1 { font-size: 38px; }
    .hero p { font-size: 16px; }
    .welcome-letter-head { padding: 24px 20px; flex-direction: column; align-items: flex-start; }
    .welcome-letter-head h1 { font-size: 28px; }
    .welcome-letter-body { padding: 24px 20px; }
    .welcome-letter-grid { grid-template-columns: 1fr; }
    .welcome-letter-foot { padding: 20px; }
    .letter-date { justify-self: start; }
    .page-head, .project-card-head { flex-direction: column; }
    .member-project-grid, .project-meta-grid, .project-detail-grid, .project-gallery, .project-video-grid, .media-edit-grid { grid-template-columns: 1fr; }
    .section-title-row { display: grid; }
    .project-media-placeholder.large { min-height: 220px; }
    .project-detail-actions { justify-content: flex-start; flex-wrap: wrap; }
    .project-list-title { min-width: 260px; grid-template-columns: 58px minmax(0, 1fr); }
    .project-list-title img, .project-list-title > span { width: 58px; height: 46px; }
    .bar-row { grid-template-columns: 1fr; }
    .bar-row b { text-align: left; }
}

@media (max-width: 760px) {
    .member-filter-bar {
        grid-template-columns: 1fr;
    }
    .member-filter-bar button {
        width: 100%;
    }
}

@media print {
    body { background: #fff; color: #111318; }
    .sidebar, .topbar, .alert, .no-print { display: none !important; }
    .app-shell { display: block; min-height: 0; }
    .main { padding: 0; }
    .welcome-letter-page { max-width: none; margin: 0; }
    .welcome-letter { box-shadow: none; border-radius: 0; }
    .welcome-letter-head, .welcome-letter-body, .welcome-letter-foot { break-inside: avoid; }
    a { text-decoration: none; }
}

.wide-panel { max-width: none; }
.muted { color: var(--muted); font-size: 12px; }
.filter-bar { max-width: none; grid-template-columns: minmax(220px, 1fr) 180px auto; align-items: end; margin-bottom: 16px; }
.member-filter-bar {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 220px auto;
    gap: 18px;
    align-items: end;
}
.member-filter-bar button {
    min-width: 96px;
}
.member-list { display: grid; gap: 16px; }
.member-card { max-width: none; }
.member-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.member-head h2 { margin-bottom: 4px; }
.member-admin-sections {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
    gap: 16px;
    align-items: start;
}
.member-admin-actions { display: grid; gap: 16px; }
.member-admin-section {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #141922;
}
.section-title {
    display: grid;
    gap: 4px;
    margin-bottom: 2px;
}
.section-title h3 {
    margin: 0;
    color: var(--gold-2);
    font-size: 15px;
}
.section-title span {
    color: var(--muted);
    font-size: 12px;
}
.member-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.metric-grid.compact { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.metric-grid.compact strong { font-size: 18px; }
.inline-stack { display: grid; gap: 10px; }
.bar-list { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 110px minmax(120px, 1fr) 40px; gap: 10px; align-items: center; }
.bar-row div { height: 10px; background: #10141d; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar-row i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); border-radius: inherit; }
.bar-row b { color: var(--gold-2); text-align: right; }
section > table, .panel table { margin-top: 14px; }
.kyc-review { max-width: none; }
.kyc-review-list { display: grid; gap: 16px; }
.kyc-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}
.kyc-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: #111722;
}
.kyc-card-head h2 { margin: 0 0 4px; font-size: 20px; }
.kyc-card-head p { margin: 0; color: var(--muted); font-size: 13px; }
.status-pill {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 12px;
    font-weight: 800;
    color: #d8e4ff;
    background: #253149;
}
.status-approved { color: #bff3d2; background: rgba(22, 122, 74, .26); }
.status-rejected { color: #ffd0d4; background: rgba(184, 61, 69, .26); }
.status-pending { color: var(--gold-2); background: rgba(216, 168, 77, .18); }
.status-not_submitted { color: #cbd3df; background: rgba(141, 149, 163, .18); }
.kyc-card-body {
    display: grid;
    grid-template-columns: 1.4fr .9fr 1fr .8fr;
    gap: 1px;
    background: var(--line);
}
.kyc-block {
    min-width: 0;
    background: var(--panel);
    padding: 18px;
}
.kyc-block h3 {
    margin: 0 0 12px;
    color: var(--gold-2);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0;
}
.kyc-block dl {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 8px 12px;
    margin: 0;
}
.kyc-block dt { color: var(--muted); font-size: 12px; }
.kyc-block dd { margin: 0; color: #f4f1e9; overflow-wrap: anywhere; line-height: 1.35; }
.kyc-block dd span { color: var(--muted); font-size: 12px; }
.doc-links { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-links a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(216, 168, 77, .35);
    background: rgba(216, 168, 77, .12);
    color: var(--gold-2);
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
}
.kyc-action {
    display: grid;
    grid-template-columns: 180px minmax(240px, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 16px 20px;
    border-top: 1px solid var(--line);
    background: #141821;
}
.kyc-action button { min-width: 112px; }
.kyc-edit-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    padding: 20px;
}
.kyc-edit-form .section-title {
    margin-top: 6px;
}
.kyc-edit-form .actions {
    margin-top: 4px;
}
.approval-alert {
    max-width: none;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 1.4fr auto;
    gap: 18px;
    align-items: center;
    margin-bottom: 18px;
    border-color: rgba(216, 168, 77, .45);
}
.approval-alert h2 { margin: 4px 0 0; }
.approval-mini-list { display: grid; gap: 8px; }
.approval-mini-list div { display: grid; gap: 2px; }
.approval-mini-list span { color: var(--muted); font-size: 13px; }
.approval-page { max-width: none; }
.approval-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.approval-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: #dbe3f3;
    background: #141a24;
    text-decoration: none;
    font-weight: 700;
}
.approval-tabs a.active {
    border-color: rgba(216, 168, 77, .55);
    color: var(--gold-2);
    background: rgba(216, 168, 77, .13);
}
.approval-list { display: grid; gap: 16px; }
.approval-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}
.approval-card-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: #111722;
}
.approval-card-head h2 { margin: 0 0 4px; font-size: 20px; }
.approval-card-head p { margin: 0; color: var(--muted); font-size: 13px; }
.approval-card-body {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
}
.approval-card-body div {
    min-width: 0;
    display: grid;
    gap: 7px;
    padding: 16px;
    background: var(--panel);
}
.approval-card-body span { color: var(--muted); font-size: 12px; }
.approval-card-body strong { overflow-wrap: anywhere; }
.approval-card-body a { color: var(--gold-2); }
.plan-status-panel {
    max-width: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}
.plan-status-panel h2,
.plan-status-panel p { margin: 0; }
.plan-status-panel div { display: grid; gap: 8px; }
.plan-status-panel p { color: #d4d9e4; line-height: 1.45; }
.plan-editor-panel { max-width: 980px; }
.plan-editor-form { display: grid; gap: 18px; }
.plan-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 16px;
}
.plan-editor-grid label {
    min-width: 0;
    align-content: start;
}
.plan-editor-grid .full { grid-column: 1 / -1; }
.plan-editor-grid textarea { min-height: 110px; }
.plan-editor-actions {
    margin-top: 0;
    padding-top: 2px;
}
.payment-method-help {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #10151f;
}
.payment-method-help div {
    display: grid;
    gap: 3px;
}
.payment-method-help strong { color: var(--gold-2); }
.payment-method-help span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.selfie-capture {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #121722;
}
.selfie-capture-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}
.selfie-capture-head h2 {
    margin: 0 0 4px;
    font-size: 18px;
}
.selfie-capture-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}
.selfie-preview {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 260px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0d1119;
}
.selfie-preview video,
.selfie-preview img {
    display: none;
    width: 100%;
    max-height: 360px;
    object-fit: contain;
}
.selfie-preview canvas { display: none; }
.selfie-preview p {
    margin: 0;
    color: var(--muted);
    text-align: center;
    padding: 18px;
}
.selfie-upload-fallback {
    display: none;
    padding-top: 4px;
}
/* Layout polish */
section { max-width: 1180px; }
section > h1 { margin-bottom: 24px; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-toggle-button { display: none; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: #121925; cursor: pointer; }
.nav-toggle-button span { display: block; width: 18px; height: 2px; background: var(--gold-2); margin: 3px 0; border-radius: 999px; }
.sidebar nav a.active,
.sidebar nav a[aria-current="page"] { background: linear-gradient(180deg, rgba(242, 208, 131, .16), rgba(216, 168, 77, .10)); color: var(--gold-2); border: 1px solid rgba(216, 168, 77, .42); }
.plan-grid { align-items: stretch; }
.plan { display: grid; align-content: start; gap: 12px; }
.plan h2, .plan p { margin: 0; }
.plan small { color: #d7ddea; line-height: 1.5; }
.plan form { margin-top: 2px; }
.panel form { display: grid; gap: 14px; }
.panel.split { padding: 26px; gap: 28px; }
.panel.split h2 { margin-bottom: 4px; }
input[type="file"] { padding: 9px 12px; }
/* Final mobile navigation override */
@media (max-width: 1100px) {
    .nav-toggle-button { display: grid; }
    .side-nav { display: none !important; grid-template-columns: 1fr; gap: 8px; margin-top: 12px; max-height: calc(100vh - 78px); overflow-y: auto; padding: 8px 0 4px; }
    .sidebar:has(.nav-toggle:checked) .side-nav { display: grid !important; }
    .sidebar nav a { width: 100%; }
    .panel.split { padding: 20px; gap: 22px; }
    .plan { padding: 20px; }
}
/* Auth and referral polish */
.home-wrap { min-height: calc(100vh - 120px); display: grid; align-content: center; gap: 22px; }
.home-wrap .hero { min-height: auto; }
.developer-credit { justify-self: center; display: inline-flex; align-items: center; gap: 8px; color: #d7ddea; background: #151a23; border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; font-size: 13px; }
.developer-credit span { color: var(--gold-2); font-size: 12px; }
.auth-card { margin-top: 18px; padding: 28px 32px; }
.auth-card h1 { margin-bottom: 24px; }
.auth-card form { display: grid; gap: 18px; }
.auth-card button { justify-self: start; min-width: 96px; margin-top: 2px; }
.referral-panel { max-width: 760px; display: grid; gap: 16px; }
.referral-panel h2 { margin: 4px 0 0; }
.copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.copy-row input { font-weight: 700; color: #ffffff; }
.copy-row button { min-width: 88px; }
@media (max-width: 700px) {
    .auth-card { margin-top: 8px; padding: 22px 18px; }
    .copy-row { grid-template-columns: 1fr; }
    .copy-row button { width: 100%; }
    .developer-credit { justify-self: stretch; justify-content: center; border-radius: 8px; }
}
/* Tablet dashboard fit */
.metric-grid > div { min-width: 0; }
.metric-grid strong { overflow-wrap: anywhere; }
.split > * { min-width: 0; }
@media (min-width: 901px) and (max-width: 1100px) {
    .main { padding: 20px; }
    section { max-width: none; }
    .split { grid-template-columns: 1fr; }
    .metric-grid, .metric-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kyc-card-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .approval-alert { grid-template-columns: 1fr; align-items: start; }
    .approval-card-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .metric-grid, .metric-grid.compact, .plan-grid { grid-template-columns: 1fr; }
    .kyc-card-head { flex-direction: column; padding: 16px; }
    .kyc-card-body { grid-template-columns: 1fr; }
    .kyc-block { padding: 16px; }
    .kyc-action { grid-template-columns: 1fr; padding: 16px; }
    .kyc-action button { width: 100%; }
    .approval-alert { grid-template-columns: 1fr; padding: 16px; }
    .approval-card-head { flex-direction: column; padding: 16px; }
    .approval-card-body { grid-template-columns: 1fr; }
    .plan-editor-grid { grid-template-columns: 1fr; }
    .member-admin-sections,
    .member-form-grid { grid-template-columns: 1fr; }
}
/* Landing credit placement fix */
.home-wrap { min-height: calc(100vh - 102px); grid-template-rows: 1fr auto; align-items: center; width: 100%; }
.home-wrap .hero { align-self: center; width: 100%; }
.developer-credit { align-self: end; margin: 18px auto 4px; }
@media (max-width: 1100px) {
    .home-wrap { min-height: auto; grid-template-rows: auto auto; padding-bottom: 12px; }
    .developer-credit { margin-top: 22px; }
}
/* Landing viewport overflow fix */
html, body { max-width: 100%; overflow-x: hidden; }
.main { overflow-x: hidden; }
.home-wrap { min-height: calc(100dvh - 104px); max-width: 100%; overflow: hidden; }
.home-wrap .hero { max-width: 100%; grid-template-columns: minmax(0, 1fr) minmax(260px, 360px); }
.home-wrap .hero > * { min-width: 0; }
.home-wrap .hero img { max-width: 100%; height: auto; }
@media (max-width: 1100px) {
    .home-wrap { min-height: auto; overflow: visible; }
}
@media (min-width: 701px) and (max-width: 1100px) {
    .sidebar { padding: 10px 14px; }
    .brand img { width: 30px; height: 30px; }
    .nav-toggle-button { width: 36px; height: 36px; }
    .main { padding: 16px 20px 22px; }
    .topbar { min-height: 46px; margin-bottom: 18px; }
    .home-wrap { min-height: auto; gap: 16px; padding-bottom: 0; }
    .home-wrap .hero {
        grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
        gap: 28px;
        padding: 0;
    }
    .home-wrap .hero h1 { font-size: 38px; margin-bottom: 10px; }
    .home-wrap .hero p { font-size: 16px; }
    .developer-credit { margin: 14px auto 0; }
}
@media (max-width: 700px) {
    .home-wrap .hero { grid-template-columns: 1fr; gap: 22px; }
    .actions .link-button { width: 100%; }
}
