:root {
    --cg-primary: #0b2c5f;
    --cg-primary-dark: #081a37;
    --cg-secondary: #174a97;
    --cg-gold: #d4a93a;
    --cg-gold-light: #f6dc8d;
    --cg-bg: #f6f8fc;
    --cg-card: #ffffff;
    --cg-card-soft: #f9fbff;
    --cg-text: #0d2144;
    --cg-muted: #5f6f8d;
    --cg-border: #d9e1ef;
    --cg-success: #159447;
    --cg-warning: #b7791f;
    --cg-danger: #b42318;
    --cg-info-bg: #eef5ff;
    --shadow-lg: 0 24px 60px rgba(8, 26, 55, 0.12);
    --shadow-md: 0 16px 35px rgba(9, 31, 67, 0.08);
    --shadow-sm: 0 8px 20px rgba(9, 31, 67, 0.06);
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--cg-text);
    background:
        radial-gradient(circle at top left, rgba(23, 74, 151, 0.10), transparent 31rem),
        radial-gradient(circle at 86% 12%, rgba(212, 169, 58, 0.13), transparent 25rem),
        linear-gradient(180deg, #f9fbff 0%, var(--cg-bg) 100%);
    min-height: 100vh;
    line-height: 1.6;
}

.admin-body { background-attachment: fixed; }

a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 13px 18px;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, background 0.18s ease;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--cg-primary), var(--cg-secondary));
    box-shadow: 0 14px 30px rgba(11, 44, 95, 0.22);
}
.btn-primary:hover { box-shadow: 0 18px 34px rgba(11, 44, 95, 0.28); }
.btn-primary-light {
    color: var(--cg-primary-dark);
    background: #ffffff;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.13);
}
.btn-gold {
    color: var(--cg-primary-dark);
    background: linear-gradient(135deg, var(--cg-gold-light), var(--cg-gold));
    box-shadow: 0 14px 30px rgba(212, 169, 58, 0.25);
}
.btn-soft {
    color: var(--cg-primary);
    background: rgba(11, 44, 95, 0.07);
    border: 1px solid rgba(11, 44, 95, 0.08);
}
.btn-soft-light {
    color: #ffffff;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.24);
}
.btn-danger-soft { color: var(--cg-danger); background: #fff1f0; }
.btn-disabled,
.btn[aria-disabled="true"] {
    opacity: 0.52;
    cursor: not-allowed;
    pointer-events: none;
}
.btn-block { width: 100%; }
.btn-mini { padding: 8px 12px; font-size: 0.78rem; line-height: 1; }

/* Alerts */
.alert {
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 18px;
    line-height: 1.5;
    font-weight: 700;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
}
.alert strong { font-weight: 900; }
.alert-danger { background: #fff1f0; color: var(--cg-danger); border-color: #ffd1cc; }
.alert-warning { background: #fff8e6; color: var(--cg-warning); border-color: #f7dc94; }
.alert-success { background: #ecfff4; color: var(--cg-success); border-color: #b9efcf; }
.alert-info { background: #eef5ff; color: var(--cg-primary); border-color: #cfe0fb; }

/* Login */
.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 12% 12%, rgba(212,169,58,0.18), transparent 30rem),
        radial-gradient(circle at 90% 8%, rgba(23,74,151,0.18), transparent 27rem),
        linear-gradient(180deg, #f9fbff 0%, #f4f7fc 100%);
}
.login-shell {
    width: min(1060px, 100%);
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    border-radius: 34px;
    overflow: hidden;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(217,225,239,0.95);
    box-shadow: var(--shadow-lg);
}
.login-panel { min-height: 610px; }
.login-panel--brand {
    position: relative;
    padding: 38px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(212,169,58,0.34), transparent 17rem),
        radial-gradient(circle at 0% 100%, rgba(255,255,255,0.14), transparent 18rem),
        linear-gradient(135deg, var(--cg-primary-dark), var(--cg-primary) 58%, var(--cg-secondary));
}
.login-panel--brand::before,
.login-panel--brand::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}
.login-panel--brand::before {
    right: -72px;
    top: -84px;
    width: 230px;
    height: 230px;
    background: rgba(212, 169, 58, 0.22);
}
.login-panel--brand::after {
    left: -90px;
    bottom: -110px;
    width: 270px;
    height: 270px;
    border: 1px solid rgba(255,255,255,0.17);
}
.login-brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: #fff;
    text-decoration: none;
}
.login-brand__mark,
.admin-brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fff, #f7e7b0);
    color: var(--cg-primary-dark);
    font-weight: 900;
    letter-spacing: -0.04em;
    box-shadow: 0 10px 25px rgba(0,0,0,0.18);
    flex-shrink: 0;
}
.login-brand strong,
.login-brand small { display: block; line-height: 1.12; }
.login-brand strong { font-size: 1.13rem; font-weight: 900; }
.login-brand small { color: rgba(255,255,255,0.74); font-size: 0.9rem; font-weight: 700; }
.login-hero-copy { position: relative; z-index: 1; max-width: 560px; }
.login-hero-copy h1 {
    margin: 18px 0 16px;
    font-size: clamp(2.3rem, 5vw, 4.15rem);
    line-height: 1.02;
    letter-spacing: -0.055em;
}
.login-hero-copy p { margin: 0; color: rgba(255,255,255,0.78); font-size: 1.05rem; }
.login-benefits {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.login-benefits span {
    display: inline-flex;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.92);
    font-size: 0.88rem;
    font-weight: 800;
}
.login-panel--form {
    padding: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.login-form-head h2 {
    margin: 8px 0 6px;
    font-size: clamp(1.85rem, 4vw, 2.65rem);
    line-height: 1.06;
    letter-spacing: -0.04em;
    color: var(--cg-primary-dark);
}
.login-form-head p { margin: 0 0 22px; color: var(--cg-muted); }
.login-form { margin: 0; }
.login-helper-box {
    margin-top: 20px;
    padding: 16px;
    border-radius: 18px;
    background: #f8fbff;
    border: 1px solid var(--cg-border);
    color: var(--cg-muted);
}
.login-helper-box strong,
.login-helper-box span,
.login-helper-box small { display: block; }
.login-helper-box strong { color: var(--cg-primary-dark); }
.login-helper-box small { margin-top: 4px; }

/* Forms */
.form-field { margin-bottom: 18px; }
.form-field label {
    display: block;
    font-weight: 850;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--cg-primary-dark);
}
.form-field input,
.form-field select,
.form-field textarea,
input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--cg-border);
    border-radius: 16px;
    padding: 14px 15px;
    background: #fff;
    color: var(--cg-text);
    outline: none;
    transition: border 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: rgba(23, 74, 151, 0.58);
    box-shadow: 0 0 0 4px rgba(23, 74, 151, 0.12);
    background: #fff;
}
textarea { resize: vertical; min-height: 132px; line-height: 1.55; }
.honeypot, .hidden-field { display: none !important; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-card h2 { margin-bottom: 18px; }
.form-actions-card { grid-column: 1 / -1; }
.form-actions-card p { max-width: 760px; }
.form-grid-wide { align-items: start; }

/* Admin top nav */
.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(249, 251, 255, 0.88);
    border-bottom: 1px solid rgba(217, 225, 239, 0.88);
    backdrop-filter: blur(18px);
}
.admin-topbar__inner {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 18px;
}
.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    min-width: 230px;
}
.admin-brand__mark {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--cg-primary), var(--cg-secondary));
    color: #fff;
    box-shadow: 0 10px 25px rgba(11, 44, 95, 0.22);
}
.admin-brand__text { display: grid; line-height: 1.1; }
.admin-brand__text strong { color: var(--cg-primary-dark); font-size: 1.02rem; font-weight: 900; }
.admin-brand__text small { color: var(--cg-muted); font-weight: 700; font-size: 0.76rem; }
.admin-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.admin-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    padding: 10px 13px;
    text-decoration: none;
    color: #334155;
    font-weight: 850;
    font-size: 0.9rem;
    transition: 0.18s ease;
}
.admin-nav__link:hover,
.admin-nav__link.is-active {
    color: var(--cg-primary-dark);
    background: #fff6da;
    box-shadow: inset 0 0 0 1px rgba(212, 169, 58, 0.36);
}
.admin-nav__link.is-disabled { color: #94a3b8; background: transparent; cursor: default; }
.admin-nav__link em {
    font-style: normal;
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 99px;
    background: #eef3fb;
}
.admin-user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid var(--cg-border);
    box-shadow: var(--shadow-sm);
}
.admin-user-chip__initial {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--cg-primary), var(--cg-secondary));
    color: #fff;
    font-weight: 900;
}
.admin-user-chip__name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 850;
    font-size: 0.84rem;
}
.admin-user-chip a {
    color: var(--cg-primary);
    font-weight: 850;
    font-size: 0.82rem;
    text-decoration: none;
}
.admin-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--cg-border);
    background: #fff;
    border-radius: 14px;
    margin-left: auto;
}
.admin-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--cg-primary-dark);
    margin: 4px auto;
    border-radius: 999px;
}

/* Layout */
.admin-main {
    width: min(1240px, calc(100% - 32px));
    margin: 28px auto 54px;
}
.section { margin-top: 22px; }
.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(217, 225, 239, 0.92);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px;
}
.card h2, .card h3 {
    margin: 0 0 12px;
    color: var(--cg-primary-dark);
    letter-spacing: -0.03em;
    line-height: 1.15;
}
.card p { color: var(--cg-muted); line-height: 1.65; }
.card-tall { min-height: 100%; }
.card-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 6px; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--cg-primary);
    background: rgba(11, 44, 95, 0.06);
    border: 1px solid rgba(11, 44, 95, 0.08);
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.admin-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 22px;
    align-items: end;
    padding: 32px;
    border-radius: var(--radius-xl);
    color: #fff;
    background:
        radial-gradient(circle at top right, rgba(212, 169, 58, 0.32), transparent 19rem),
        linear-gradient(135deg, var(--cg-primary-dark), var(--cg-primary) 56%, var(--cg-secondary));
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
}
.admin-hero--premium::before {
    content: '';
    position: absolute;
    right: -96px;
    top: -110px;
    width: 280px;
    height: 280px;
    border-radius: 999px;
    background: rgba(212, 169, 58, 0.18);
}
.admin-hero--premium::after {
    content: '';
    position: absolute;
    left: -80px;
    bottom: -110px;
    width: 250px;
    height: 250px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.16);
}
.admin-hero__content, .hero-actions { position: relative; z-index: 1; }
.admin-hero h1 {
    margin: 0 0 10px;
    font-size: clamp(2.15rem, 5vw, 3.7rem);
    line-height: 1;
    letter-spacing: -0.055em;
}
.admin-hero p {
    margin: 0;
    color: rgba(255,255,255,0.78);
    line-height: 1.65;
    max-width: 760px;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}
.hero-actions--stacked { max-width: 380px; }
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 9px 12px;
    font-weight: 900;
    font-size: 0.82rem;
    background: rgba(11, 44, 95, 0.06);
    border: 1px solid rgba(11, 44, 95, 0.08);
    color: var(--cg-primary-dark);
    margin-bottom: 14px;
}
.status-pill--light { background: rgba(255,255,255,0.13); border-color: rgba(255,255,255,0.22); color: #fff; }
.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #32d583;
    box-shadow: 0 0 0 5px rgba(50, 213, 131, 0.12);
}
.status-dot.warning { background: #fdb022; box-shadow: 0 0 0 5px rgba(253, 176, 34, 0.13); }

/* KPI and cards */
.kpi-card { position: relative; overflow: hidden; }
.kpi-card::after {
    content: '';
    position: absolute;
    right: -34px;
    top: -34px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(212, 169, 58, 0.12);
}
.kpi-card--blue::after { background: rgba(23, 74, 151, 0.12); }
.kpi-card--gold::after { background: rgba(212, 169, 58, 0.18); }
.kpi-label {
    display: block;
    color: var(--cg-muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.kpi-value {
    display: block;
    margin-top: 10px;
    color: var(--cg-primary-dark);
    font-size: 2.45rem;
    font-weight: 900;
    letter-spacing: -0.06em;
    line-height: 1;
}
.kpi-note {
    display: block;
    margin-top: 8px;
    color: var(--cg-muted);
    font-size: 0.88rem;
    font-weight: 700;
}
.kpi-sm { font-size: 1.2rem; letter-spacing: 0; margin-top: 16px; }
.kpi-text { font-size: 1.2rem; letter-spacing: -0.02em; line-height: 1.15; margin-top: 16px; }
.action-card { display: flex; flex-direction: column; align-items: flex-start; min-height: 245px; }
.action-card p { flex: 1; margin-top: 0; }
.action-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    margin-bottom: 16px;
    background: #fff6da;
    color: var(--cg-primary-dark);
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(212, 169, 58, 0.28);
}

/* Lists */
.workflow-list,
.health-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}
.workflow-list li,
.health-list li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid var(--cg-border);
    border-radius: 18px;
    background: #fbfdff;
}
.premium-list li { background: linear-gradient(180deg, #fff 0%, #fbfdff 100%); }
.workflow-step {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff6da;
    color: var(--cg-primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}
.health-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    background: #ecfff4;
    color: var(--cg-success);
}
.health-icon.bad { background: #fff1f0; color: var(--cg-danger); }
.list-title { font-weight: 900; color: var(--cg-primary-dark); }
.list-detail { margin-top: 3px; color: var(--cg-muted); font-size: 0.9rem; word-break: break-word; }
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.footer-note { margin-top: 26px; text-align: center; color: var(--cg-muted); font-size: 0.88rem; }
.copy-link-box {
    margin: 18px 0;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--cg-border);
    background: #f8fbff;
    overflow-x: auto;
}
.copy-link-box code { color: var(--cg-primary-dark); font-weight: 850; white-space: nowrap; }
.module-stack { display: grid; gap: 12px; }
.module-stack div {
    padding: 14px;
    border: 1px solid var(--cg-border);
    border-radius: 18px;
    background: #fbfdff;
}
.premium-module-stack div { background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%); }
.module-stack strong,
.module-stack span { display: block; }
.module-stack strong { color: var(--cg-primary-dark); margin-bottom: 5px; }
.module-stack span { color: var(--cg-muted); font-weight: 700; line-height: 1.5; }
.muted { color: var(--cg-muted); }
.notes-box {
    padding: 18px;
    border-radius: 18px;
    background: #fbfdff;
    border: 1px solid var(--cg-border);
    line-height: 1.65;
    color: var(--cg-text);
}

/* Filters and tables */
.filter-bar { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; }
.filter-grow { flex: 1 1 320px; margin-bottom: 0; }
.filter-bar .form-field { margin-bottom: 0; min-width: 210px; }
.filter-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.table-card { padding: 0; overflow: hidden; }
.table-card__head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 22px;
    border-bottom: 1px solid var(--cg-border);
}
.table-card__head h2 { margin-bottom: 5px; }
.table-card__head p { margin: 0; }
.responsive-table { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 850px; }
.admin-table th,
.admin-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--cg-border);
    text-align: left;
    vertical-align: middle;
}
.admin-table th {
    background: #f8fbff;
    color: var(--cg-primary-dark);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.admin-table td strong,
.admin-table td span { display: block; }
.admin-table td small {
    display: block;
    margin-top: 4px;
    color: var(--cg-muted);
    font-weight: 700;
    line-height: 1.45;
}
.table-actions-col { width: 270px; }
.table-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.table-actions form { margin: 0; }
.inline-form { display: inline-flex; margin: 0; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}
.badge-success { background: #ecfff4; color: var(--cg-success); }
.badge-warning { background: #fff8e6; color: var(--cg-warning); }
.badge-info { background: #eef5ff; color: var(--cg-primary); }
.badge-muted { background: #eef2f7; color: #64748b; }

/* Detail pages */
.empty-state {
    margin: 22px;
    padding: 28px;
    border: 1px dashed #c8d4e5;
    border-radius: 22px;
    background: #fbfdff;
    text-align: center;
}
.empty-state strong { display: block; color: var(--cg-primary-dark); font-size: 1.15rem; }
.empty-state p { margin: 10px auto 18px; max-width: 650px; }
.detail-card a { color: var(--cg-primary); font-weight: 850; text-decoration: none; }
.detail-list { display: grid; gap: 12px; margin: 0; }
.detail-list div {
    display: grid;
    grid-template-columns: 165px 1fr;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--cg-border);
}
.detail-list div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--cg-muted); font-weight: 900; font-size: 0.86rem; }
.detail-list dd { margin: 0; color: var(--cg-text); font-weight: 750; word-break: break-word; }
.detail-list-compact div { grid-template-columns: 110px 1fr; }
.status-update-form { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--cg-border); }
.subsection-title { margin-top: 24px; }
.stacked-actions { align-items: flex-start; }

/* Legacy public fallback classes from earlier files */
.public-body {
    background:
        radial-gradient(circle at top left, rgba(212, 169, 58, 0.18), transparent 28rem),
        radial-gradient(circle at 90% 15%, rgba(23, 74, 151, 0.12), transparent 24rem),
        linear-gradient(180deg, #f8fbff 0%, var(--cg-bg) 100%);
}
.public-header { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 22px 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.public-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.public-brand strong, .public-brand small { display: block; }
.public-brand strong { color: var(--cg-primary-dark); font-weight: 900; }
.public-brand small { color: var(--cg-muted); font-weight: 800; font-size: 0.78rem; }
.public-links { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.public-links a { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 10px 13px; background: rgba(255,255,255,0.82); border: 1px solid var(--cg-border); color: var(--cg-primary); font-weight: 900; text-decoration: none; font-size: 0.86rem; }
.public-main { width: min(1180px, calc(100% - 28px)); margin: 0 auto 42px; }
.public-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr); gap: 22px; align-items: stretch; margin: 10px 0 22px; }
.public-hero > div, .public-hero-card { border-radius: 32px; border: 1px solid rgba(219, 227, 241, 0.88); background: rgba(255, 255, 255, 0.9); box-shadow: var(--shadow-md); }
.public-hero > div { padding: clamp(28px, 5vw, 52px); position: relative; overflow: hidden; }
.public-hero h1 { margin: 0 0 16px; font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1.04; letter-spacing: -0.05em; color: var(--cg-primary-dark); }
.public-hero p { color: var(--cg-muted); font-size: 1.05rem; }
.public-hero-card { padding: 28px; }
.public-hero-points { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.public-hero-points span { border-radius: 999px; padding: 9px 12px; background: rgba(11,44,95,0.06); color: var(--cg-primary); font-weight: 800; }
.public-success span { display: block; margin-top: 5px; }

@media (max-width: 1100px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-panel { min-height: auto; }
    .login-panel--brand { min-height: 440px; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-hero { grid-template-columns: 1fr; align-items: start; }
    .hero-actions { justify-content: flex-start; }
    .hero-actions--stacked { max-width: none; }
}

@media (max-width: 820px) {
    .admin-topbar__inner { min-height: 68px; flex-wrap: wrap; padding: 10px 0; }
    .admin-brand { min-width: 0; }
    .admin-brand__text small { display: none; }
    .admin-menu-toggle { display: inline-block; }
    .admin-nav {
        display: none;
        order: 4;
        flex-basis: 100%;
        background: #fff;
        border: 1px solid var(--cg-border);
        border-radius: 18px;
        padding: 8px;
        flex-direction: column;
        align-items: stretch;
        box-shadow: var(--shadow-sm);
    }
    .admin-nav.is-open { display: flex; }
    .admin-nav__link { justify-content: space-between; }
    .admin-user-chip { margin-left: auto; padding: 6px; }
    .admin-user-chip__name { display: none; }
    .admin-user-chip a { font-size: 0.78rem; }
    .admin-main { width: min(100% - 24px, 1240px); margin-top: 18px; }
    .admin-hero { padding: 24px; border-radius: 24px; }
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .filter-bar { align-items: stretch; }
    .filter-bar .form-field { min-width: 100%; }
    .filter-actions { width: 100%; }
    .filter-actions .btn { flex: 1; }
    .table-card__head { align-items: flex-start; flex-direction: column; }
    .detail-list div { grid-template-columns: 1fr; gap: 5px; }
    .table-actions-col { width: auto; }
    .public-header { align-items: flex-start; flex-direction: column; }
    .public-hero { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .login-page { padding: 14px; }
    .login-shell { border-radius: 24px; }
    .login-panel--brand,
    .login-panel--form { padding: 24px; }
    .login-hero-copy h1 { font-size: 2.25rem; }
    .login-benefits { display: none; }
    .admin-hero h1 { font-size: 2.2rem; }
    .card { padding: 20px; border-radius: 20px; }
    .btn { width: 100%; }
    .quick-actions, .hero-actions { flex-direction: column; align-items: stretch; }
    .admin-user-chip a:first-of-type { display: none; }
}

/* Phase 4 posts module */
.form-grid-wide { align-items: start; }
.form-card-wide { grid-column: 1 / -1; }
.field-note,
.image-current-name { display: block; margin-top: 8px; color: var(--cg-muted); font-size: 0.86rem; font-weight: 700; }
.empty-mini {
    display: grid;
    place-items: center;
    min-height: 170px;
    border-radius: 20px;
    border: 1px dashed #c8d4e5;
    background: #fbfdff;
    color: var(--cg-muted);
    font-weight: 850;
    margin-bottom: 16px;
}
.post-image-preview {
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid var(--cg-border);
    background: #f8fbff;
    box-shadow: var(--shadow-sm);
    margin-bottom: 14px;
}
.post-image-preview img {
    display: block;
    width: 100%;
    height: 240px;
    object-fit: cover;
}
.post-image-preview-large img { height: min(520px, 58vh); object-fit: contain; background: #f8fbff; }
.copy-box {
    display: block;
    width: 100%;
    margin: 0;
    min-height: 140px;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 18px;
    border-radius: 18px;
    background: #fbfdff;
    border: 1px solid var(--cg-border);
    color: var(--cg-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.65;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}
.copy-box.is-hidden { position: absolute; left: -9999px; width: 1px; height: 1px; min-height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.compact-copy { margin-top: 0; }
.compact-empty { margin: 0; }
.compact-actions { margin-top: 10px; }
.align-bottom { display: flex; align-items: end; }
.admin-table td .badge { display: inline-flex; }
@media (max-width: 820px) {
    .form-card-wide { grid-column: auto; }
    .post-image-preview img { height: 220px; }
    .post-image-preview-large img { height: auto; max-height: 58vh; }
    .align-bottom { align-items: stretch; }
}

/* Phase 5 calendar month view */
.calendar-control-card { padding: 24px; }
.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 18px;
}
.calendar-toolbar h2 {
    margin: 10px 0 4px;
    font-size: clamp(1.7rem, 4vw, 2.45rem);
}
.calendar-toolbar p { margin: 0; }
.calendar-nav-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.calendar-filter-bar {
    padding-top: 18px;
    border-top: 1px solid var(--cg-border);
}
.calendar-card { padding: 0; overflow: hidden; }
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: #f8fbff;
    border-bottom: 1px solid var(--cg-border);
}
.calendar-weekdays span {
    padding: 14px 12px;
    text-align: center;
    color: var(--cg-primary-dark);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: var(--cg-border);
    gap: 1px;
}
.calendar-day {
    min-height: 190px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.94);
    position: relative;
}
.calendar-day.is-empty {
    background: rgba(248, 251, 255, 0.65);
}
.calendar-day.is-today {
    background: linear-gradient(180deg, #ffffff 0%, #fffaf0 100%);
    box-shadow: inset 0 0 0 2px rgba(212, 169, 58, 0.42);
}
.calendar-day.has-posts {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}
.calendar-day__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.calendar-day-number {
    width: 31px;
    height: 31px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cg-primary-dark);
    font-weight: 900;
    background: rgba(11, 44, 95, 0.06);
}
.calendar-day.is-today .calendar-day-number {
    color: var(--cg-primary-dark);
    background: linear-gradient(135deg, var(--cg-gold-light), var(--cg-gold));
}
.calendar-count {
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cg-primary);
    background: #eef5ff;
    font-size: 0.75rem;
    font-weight: 900;
}
.calendar-posts {
    display: grid;
    gap: 8px;
}
.calendar-post-chip {
    display: block;
    padding: 10px;
    border-radius: 14px;
    text-decoration: none;
    background: #f8fbff;
    border: 1px solid var(--cg-border);
    box-shadow: 0 4px 12px rgba(9, 31, 67, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.calendar-post-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(9, 31, 67, 0.08);
    border-color: rgba(23, 74, 151, 0.26);
}
.calendar-post-chip__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.calendar-post-chip__top strong {
    color: var(--cg-primary-dark);
    font-size: 0.74rem;
    font-weight: 900;
}
.calendar-post-chip__top em {
    color: var(--cg-primary);
    background: #eef5ff;
    border-radius: 999px;
    padding: 4px 7px;
    font-style: normal;
    font-size: 0.68rem;
    font-weight: 900;
    white-space: nowrap;
}
.calendar-post-title,
.calendar-post-meta {
    display: block;
}
.calendar-post-title {
    color: var(--cg-primary-dark);
    font-weight: 900;
    line-height: 1.25;
    font-size: 0.88rem;
    word-break: break-word;
}
.calendar-post-meta {
    color: var(--cg-muted);
    font-size: 0.76rem;
    font-weight: 750;
    line-height: 1.35;
    margin-top: 5px;
}
.calendar-post-chip--awaiting-approval {
    background: #fffaf0;
    border-color: #f7dc94;
}
.calendar-post-chip--approved,
.calendar-post-chip--posted {
    background: #f2fff7;
    border-color: #b9efcf;
}
.calendar-post-chip--scheduled {
    background: #eef5ff;
    border-color: #cfe0fb;
}
.calendar-post-chip--skipped,
.calendar-post-chip--archived {
    background: #f3f5f8;
    border-color: #d9e1ef;
    opacity: 0.82;
}
.calendar-unscheduled-list .quick-actions { margin-top: 10px; }
@media (max-width: 1100px) {
    .calendar-toolbar { flex-direction: column; }
    .calendar-nav-actions { justify-content: flex-start; }
    .calendar-grid,
    .calendar-weekdays { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .calendar-weekdays span:nth-child(n+3) { display: none; }
    .calendar-day.is-empty { display: none; }
}
@media (max-width: 640px) {
    .calendar-grid,
    .calendar-weekdays { grid-template-columns: 1fr; }
    .calendar-weekdays { display: none; }
    .calendar-day { min-height: auto; }
    .calendar-nav-actions { flex-direction: column; width: 100%; }
    .calendar-toolbar .btn { width: 100%; }
}

/* Phase 6 client approval workflow */
.badge-danger { background: #fff1f2; color: var(--cg-danger); }
.approval-card {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border-color: rgba(212, 169, 58, 0.28);
}
.approval-status-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 14px 0 18px;
}
.approval-status-strip small {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f8fbff;
    color: var(--cg-muted);
    border: 1px solid var(--cg-border);
    font-weight: 800;
}
.approval-link-box { margin-top: 14px; margin-bottom: 14px; }
.full-inline-form { width: 100%; margin: 0; }
.full-inline-form .btn { width: 100%; }
.compact-detail-list div { grid-template-columns: 135px 1fr; }
.admin-table .badge-danger { display: inline-flex; }
@media (max-width: 720px) {
    .approval-status-strip { align-items: stretch; }
    .approval-status-strip small { width: 100%; justify-content: center; }
    .compact-detail-list div { grid-template-columns: 1fr; }
}

/* Phase 7 posting queue */
.posting-kpi-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.posting-kpi-link:hover,
.posting-kpi-link.is-active {
    transform: translateY(-2px);
    border-color: rgba(212, 169, 58, 0.55);
    box-shadow: var(--shadow-lg);
}
.posting-filter-card { padding: 22px; }
.posting-filter-bar { align-items: end; }
.posting-board {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
}
.posting-card {
    position: relative;
    overflow: hidden;
}
.posting-card::before {
    content: '';
    position: absolute;
    right: -50px;
    top: -50px;
    width: 150px;
    height: 150px;
    border-radius: 999px;
    background: rgba(23, 74, 151, 0.08);
    pointer-events: none;
}
.posting-card--overdue::before { background: rgba(180, 35, 24, 0.10); }
.posting-card--today::before { background: rgba(212, 169, 58, 0.16); }
.posting-card--done::before { background: rgba(21, 148, 71, 0.10); }
.posting-card__top {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 14px;
}
.posting-card__top h2 {
    margin: 12px 0 7px;
    font-size: 1.35rem;
}
.posting-card__top p { margin: 0; }
.posting-score {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    align-content: center;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid var(--cg-border);
    box-shadow: var(--shadow-sm);
}
.posting-score strong {
    color: var(--cg-primary-dark);
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1;
}
.posting-score span {
    color: var(--cg-muted);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.posting-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
}
.posting-image {
    margin: 14px 0;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--cg-border);
    background: #f8fbff;
    box-shadow: var(--shadow-sm);
}
.posting-image img {
    display: block;
    width: 100%;
    height: 240px;
    object-fit: cover;
}
.posting-checklist {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}
.posting-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 900;
    border: 1px solid transparent;
}
.posting-check.is-ok {
    background: #ecfff4;
    color: var(--cg-success);
    border-color: #b9efcf;
}
.posting-check.is-missing {
    background: #fff8e6;
    color: var(--cg-warning);
    border-color: #f7dc94;
}
.posting-copy-preview {
    margin: 16px 0;
}
.posting-copy-preview strong {
    display: block;
    color: var(--cg-primary-dark);
    font-weight: 900;
    margin-bottom: 8px;
}
.posting-copy-preview pre {
    max-height: 230px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--cg-border);
    background: #fbfdff;
    color: var(--cg-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.92rem;
    line-height: 1.6;
}
.posting-actions { position: relative; }
.posting-status-actions {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--cg-border);
}
.posting-status-actions form { margin: 0; }
.posting-posted-form {
    padding: 16px;
    border-radius: 20px;
    background: #f8fbff;
    border: 1px solid var(--cg-border);
}
.posting-posted-form textarea {
    min-height: 92px;
}
@media (max-width: 1100px) {
    .posting-board { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .posting-card__top { flex-direction: column; }
    .posting-score { width: 100%; height: auto; padding: 14px; }
    .posting-image img { height: 210px; }
}

/* Phase 8: click tracking reports */
.metric-bars {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}
.metric-bar-row {
    display: grid;
    gap: 8px;
}
.metric-bar-label {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    color: var(--cg-primary-dark);
}
.metric-bar-label strong {
    font-weight: 900;
}
.metric-bar-label span {
    color: var(--cg-muted);
    font-size: 0.9rem;
    font-weight: 800;
}
.metric-bar-track {
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: #edf3fb;
    border: 1px solid var(--cg-border);
}
.metric-bar-track span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cg-primary) 0%, var(--cg-secondary) 100%);
}
.compact-table {
    min-width: 720px;
}
.truncate-cell {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.copy-link-box code,
.detail-list a {
    word-break: break-word;
}
