:root {
    --ink: #173b63;
    --muted: #60758d;
    --line: #dbe6f2;
    --card: rgba(255, 255, 255, .94);
    --primary: #2f7dbc;
    --primary-dark: #173f68;
    --primary-deep: #153a63;
    --primary-soft: #eaf4fb;
    --primary-mid: #d8e9f7;
    --success: #2a8f6a;
    --danger: #c64b5e;
    --warning: #b68200;
}

/* ===== SHRM reference dashboard layout ===== */
:root {
    --brand-900:#0a1f3d;
    --brand-800:#0f2d52;
    --brand-700:#154273;
    --brand-600:#1c5cab;
    --brand-500:#256abf;
    --brand-400:#2a78d6;
    --brand-300:#5598e7;
    --brand-200:#9ec5f4;
    --brand-100:#cde2fb;
    --brand-50:#eaf3fd;
    --page:#f4f6f9;
    --surface:#ffffff;
    --surface-2:#f9fafc;
    --ink-1:#0b1220;
    --ink-2:#4b5565;
    --ink-3:#8a94a6;
    --line:#e4e8ee;
    --line-soft:#eef1f5;
    --good:#0ca30c;
    --good-bg:#e8f6e8;
    --good-ink:#006300;
    --warn:#fab219;
    --warn-bg:#fdf3dc;
    --warn-ink:#8a5a00;
    --crit:#d03b3b;
    --crit-bg:#fbe9e9;
    --crit-ink:#a02323;
    --neutral-bg:#eef1f5;
    --neutral-ink:#4b5565;
    --shadow-sm:0 1px 2px rgba(11,18,32,.05);
    --shadow-md:0 1px 3px rgba(11,18,32,.06), 0 8px 24px -12px rgba(11,18,32,.12);
    --radius:14px;
}

html {
    font-size: 15px;
}

body.has-sidebar {
    background: var(--page);
    color: var(--ink-1);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body.has-sidebar a {
    color: inherit;
    text-decoration: none;
}

body.has-sidebar .app {
    display: grid;
    grid-template-columns: 264px 1fr;
    gap: 0;
    min-height: 100vh;
    padding: 0;
}

body.sidebar-collapsed .app {
    grid-template-columns: 78px 1fr;
}

body.has-sidebar .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    border-radius: 0;
    background: linear-gradient(178deg, var(--brand-800) 0%, var(--brand-900) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: none;
}

body.has-sidebar .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px 18px;
    border-bottom: 0;
    text-align: left;
    font-size: inherit;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #fff;
    flex: none;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: .5px;
    color: var(--brand-700);
    box-shadow: inset 0 0 0 2px var(--brand-200);
}

.brand-name {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .2px;
    line-height: 1.25;
}

.brand-sub {
    font-size: 11.5px;
    color: #9db8d9;
    font-weight: 500;
    margin-top: 2px;
}

.side-section {
    padding: 6px 12px 20px;
    flex: 1;
}

.side-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #7d9cc4;
    padding: 14px 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 9px;
    margin-bottom: 2px;
    font-size: 13.5px;
    font-weight: 500;
    color: #c8d8ec;
    background: transparent;
    transition: background .15s, color .15s;
    position: relative;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex: none;
    opacity: .85;
}

.nav-item:hover {
    background: rgba(255,255,255,.07);
    color: #fff;
    transform: none;
    box-shadow: none;
}

.nav-item.active {
    background: rgba(255,255,255,.12);
    color: #fff;
    font-weight: 600;
}

.nav-item.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--brand-300);
}

.side-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,.09);
}

.side-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex: none;
    background: var(--brand-400);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 12.5px;
    font-weight: 700;
}

.side-user-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.side-user-role {
    font-size: 11.5px;
    color: #9db8d9;
}

body.sidebar-collapsed .brand {
    justify-content: center;
    padding: 18px 12px;
}

body.sidebar-collapsed .brand > div:not(.brand-mark),
body.sidebar-collapsed .side-label,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .side-user > div {
    display: none;
}

body.sidebar-collapsed .side-section {
    padding: 8px;
}

body.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 12px;
}

body.has-sidebar .main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 32px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.crumb {
    font-size: 13px;
    color: var(--ink-3);
    font-weight: 500;
}

.crumb b {
    color: var(--ink-1);
    font-weight: 600;
}

.top-search {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 7px 12px;
    width: 280px;
    color: var(--ink-3);
}

.top-search input {
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 13px;
    width: 100%;
    color: var(--ink-1);
    padding: 0;
    box-shadow: none;
}

.top-search svg {
    width: 15px;
    height: 15px;
    flex: none;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--surface);
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--ink-2);
    transition: background .15s;
    position: relative;
}

.icon-btn:hover {
    background: var(--surface-2);
}

.icon-btn svg {
    width: 17px;
    height: 17px;
}

.content {
    padding: 28px 32px 48px;
    max-width: 1240px;
    width: 100%;
    margin: 0 auto;
}

body.has-sidebar .sidebar-toggle {
    position: static;
    margin: 0;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: none;
    color: var(--ink-2);
    font-size: 24px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.01em;
    margin: 0;
}

.page-desc {
    font-size: 13.5px;
    color: var(--ink-2);
    margin-top: 5px;
}

.scope-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-600);
    background: var(--brand-50);
    border: 1px solid var(--brand-100);
    border-radius: 999px;
    padding: 5px 12px;
}

.scope-chip svg {
    width: 13px;
    height: 13px;
}

.head-actions {
    display: flex;
    gap: 10px;
}

body.has-sidebar .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    border-radius: 9px;
    padding: 9px 16px;
    border: 1px solid transparent;
    transition: background .15s, box-shadow .15s;
    box-shadow: none;
}

body.has-sidebar .btn svg {
    width: 15px;
    height: 15px;
}

body.has-sidebar .btn-primary {
    background: var(--brand-600);
    color: #fff;
}

body.has-sidebar .btn-primary:hover {
    background: var(--brand-700);
}

body.has-sidebar .btn-ghost,
body.has-sidebar .btn-outline {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink-2);
}

body.has-sidebar .btn-ghost:hover,
body.has-sidebar .btn-outline:hover {
    background: var(--surface-2);
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.stats-row-2 {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 28px;
}

body.has-sidebar .stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    transition: box-shadow .18s, transform .18s;
    font-size: inherit;
    color: var(--ink-1);
}

body.has-sidebar .stat:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.stat-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-2);
}

.stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    flex: none;
}

.stat-icon svg {
    width: 17px;
    height: 17px;
}

.si-blue { background: var(--brand-50); color: var(--brand-600); }
.si-good { background: var(--good-bg); color: var(--good-ink); }
.si-warn { background: var(--warn-bg); color: var(--warn-ink); }
.si-crit { background: var(--crit-bg); color: var(--crit-ink); }
.si-neutral { background: var(--neutral-bg); color: var(--neutral-ink); }

.stat-value {
    font-size: 30px;
    font-weight: 650;
    letter-spacing: -.02em;
    line-height: 1;
}

.stat-foot {
    font-size: 12px;
    color: var(--ink-3);
}

.stat-foot b {
    color: var(--ink-2);
    font-weight: 600;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 16px;
    align-items: start;
}

.panel-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line-soft);
}

.panel-title {
    font-size: 14.5px;
    font-weight: 700;
}

.panel-sub {
    font-size: 12px;
    color: var(--ink-3);
    margin-top: 3px;
}

.panel-link {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--brand-600);
}

.panel-link:hover {
    text-decoration: underline;
}

.panel-body {
    padding: 18px 20px;
}

.meter-row {
    display: grid;
    grid-template-columns: 64px 1fr 70px;
    gap: 14px;
    align-items: center;
    padding: 10px 0;
}

.meter-row + .meter-row {
    border-top: 1px solid var(--line-soft);
}

.meter-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-1);
}

.meter-track {
    height: 8px;
    border-radius: 99px;
    background: var(--brand-100);
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--brand-500);
}

.meter-val {
    font-size: 13px;
    font-weight: 650;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.meter-pct {
    font-size: 11px;
    color: var(--ink-3);
    font-weight: 500;
    margin-left: 4px;
}

.split-bar {
    display: flex;
    height: 12px;
    border-radius: 99px;
    overflow: hidden;
    gap: 2px;
    background: var(--surface);
    margin: 6px 0 16px;
}

.split-bar span {
    display: block;
    height: 100%;
}

.legend {
    display: flex;
    flex-direction: column;
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px solid var(--line-soft);
}

.legend-row:first-child {
    border-top: 0;
}

.swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex: none;
}

.legend-label {
    font-size: 13px;
    color: var(--ink-2);
    font-weight: 500;
}

.legend-val {
    margin-left: auto;
    font-size: 13px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.qa-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.qa {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.qa:hover {
    border-color: var(--brand-300);
    background: var(--brand-50);
}

.qa-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--brand-50);
    color: var(--brand-600);
    display: grid;
    place-items: center;
    flex: none;
    font-weight: 800;
}

.qa-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.qa-desc {
    font-size: 11.5px;
    color: var(--ink-3);
    margin-top: 1px;
}

.act-row {
    display: flex;
    gap: 12px;
    padding: 11px 0;
    border-top: 1px solid var(--line-soft);
}

.act-row:first-child {
    border-top: 0;
}

.act-ico {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex: none;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.act-text {
    font-size: 13px;
    color: var(--ink-2);
    line-height: 1.45;
}

.act-text b {
    color: var(--ink-1);
    font-weight: 600;
}

.act-time {
    font-size: 11.5px;
    color: var(--ink-3);
    margin-top: 2px;
}

@media (max-width: 1100px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-row-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    body.has-sidebar .app {
        grid-template-columns: 1fr;
    }

    body.has-sidebar .sidebar {
        display: none;
    }

    .content {
        padding: 20px 16px 40px;
    }

    .top-search {
        display: none;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: Inter, Segoe UI, Arial, sans-serif;
    background:
        radial-gradient(circle at 12% 8%, rgba(47, 125, 188, .14), transparent 30%),
        radial-gradient(circle at 88% 10%, rgba(23, 63, 104, .12), transparent 32%),
        linear-gradient(180deg, #f6f9fc, #edf4fa);
}

.auth {
    display: grid;
    place-items: center;
    min-height: 100vh;
}

.auth-card,
.card {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 26px;
    box-shadow: 0 22px 60px rgba(112, 122, 176, .16);
    backdrop-filter: blur(14px);
}

.auth-card {
    width: min(440px, 92vw);
    padding: 30px;
}

.login-logo-wrap {
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    padding: 14px;
    border-radius: 22px;
    background: rgba(255, 255, 255, .72);
    box-shadow: inset 0 0 0 1px rgba(124, 131, 255, .12);
}

.login-logo {
    display: block;
    width: min(280px, 100%);
    max-height: 150px;
    object-fit: contain;
}

.app {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    padding: 24px;
    transition: grid-template-columns .2s ease;
}

.sidebar-collapsed .app {
    grid-template-columns: 92px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 24px;
    height: calc(100vh - 48px);
    border-radius: 32px;
    color: #fff;
    background: linear-gradient(180deg, #173f68, #2f7dbc);
    box-shadow: 0 28px 75px rgba(23, 63, 104, .20);
    overflow: auto;
    transition: width .2s ease;
}

.brand {
    padding: 26px;
    border-bottom: 1px solid rgba(255, 255, 255, .16);
    color: #fff;
    font-weight: 950;
    font-size: 23px;
    text-align: center;
}

.brand-logo {
    display: block;
    width: min(190px, 100%);
    max-height: 95px;
    object-fit: contain;
    object-position: center;
    margin: 0 auto 14px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .96);
}

.brand span {
    display: block;
}

.brand small {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    font-weight: 600;
    opacity: .75;
    color: rgba(255, 255, 255, .78);
}

.sidebar-collapsed .brand {
    padding: 18px 12px;
}

.sidebar-collapsed .brand-logo {
    width: 54px;
    height: 54px;
    max-height: 54px;
    object-fit: contain;
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .brand small {
    display: none;
}

.nav {
    padding: 16px;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
    padding: 14px 16px;
    border-radius: 18px;
    font-weight: 850;
    margin-bottom: 9px;
    background: rgba(255, 255, 255, .10);
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.nav-icon {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    font-size: 17px;
    line-height: 1;
}

.nav-label {
    min-width: 0;
}

.nav a:hover,
.nav a.active {
    transform: translateX(3px);
    background: rgba(255, 255, 255, .20);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 12px 26px rgba(23, 63, 104, .16);
}

.sidebar-collapsed .nav {
    padding: 12px;
}

.sidebar-collapsed .nav a {
    justify-content: center;
    padding: 15px 8px;
}

.sidebar-collapsed .nav-label {
    display: none;
}

.sidebar-collapsed .nav-icon {
    width: 34px;
    height: 34px;
    font-size: 20px;
}

.main {
    min-width: 0;
}

.hero {
    position: relative;
    overflow: hidden;
    border-radius: 32px;
    color: #fff;
    padding: 34px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #173f68, #2f7dbc);
    box-shadow: 0 26px 70px rgba(23, 63, 104, .18);
}

.hero::after {
    content: "";
    position: absolute;
    right: -70px;
    bottom: -90px;
    width: 260px;
    height: 260px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .35);
}

.hero h1 {
    margin-top: 0;
    color: #fff;
}

.hero p {
    color: rgba(255, 255, 255, .84);
    font-weight: 600;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.card {
    padding: 22px;
    margin-bottom: 20px;
}

.card h2 {
    color: #27305f;
}

.stat {
    font-size: 32px;
    font-weight: 950;
    color: var(--primary-dark);
}

.muted {
    color: var(--muted);
}

.btn {
    border: 0;
    border-radius: 15px;
    padding: 11px 16px;
    font-weight: 900;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(116, 128, 152, .14);
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(116, 128, 152, .18);
}

.btn:disabled {
    opacity: .58;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, #173f68, #2f7dbc);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, #2a8f6a, #66c09e);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #c64b5e, #e07888);
    color: #fff;
}

.btn-light {
    background: #fff;
    color: var(--primary-dark);
}

.btn-outline {
    background: rgba(255, 255, 255, .78);
    border: 1px solid #d7dcff;
    color: var(--primary-dark);
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #d8def5;
    border-radius: 16px;
    padding: 12px 14px;
    color: var(--ink);
    background: rgba(255, 255, 255, .82);
    font: inherit;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(124, 131, 255, .14);
}

label {
    display: block;
    color: #3d4666;
    font-weight: 400;
    margin-bottom: 7px;
}

.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

.user-form-card {
    padding: 28px;
}

.user-form-section {
    padding: 22px;
    border: 1px solid rgba(216, 222, 245, .86);
    border-radius: 24px;
    background: rgba(255, 255, 255, .48);
    margin-bottom: 18px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.section-heading h3 {
    margin: 0;
    color: #27305f;
}

.section-heading p {
    margin: 2px 0 0;
    text-align: right;
}

.user-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 18px;
}

.field-hint {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.help-text {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(190px, 1fr));
    gap: 14px;
}

.option-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    padding: 15px;
    border: 1px solid #dbe2f5;
    border-radius: 18px;
    background: rgba(255, 255, 255, .72);
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.option-card:hover {
    transform: translateY(-1px);
    border-color: var(--primary);
    box-shadow: 0 12px 26px rgba(124, 131, 255, .12);
}

.option-card input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--primary);
    flex: 0 0 auto;
}

.option-card span {
    display: grid;
    gap: 5px;
}

.option-card strong {
    color: #30345f;
    font-size: 15px;
}

.option-card em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
    line-height: 1.35;
}

.region-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.region-card {
    background: linear-gradient(135deg, rgba(191, 244, 220, .44), rgba(255, 255, 255, .72));
}

.user-form-actions {
    justify-content: flex-start;
    padding-top: 4px;
}

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

.table-wrap {
    overflow: auto;
}

.records-filter-card,
.column-card,
.table-card {
    border: 1px solid rgba(219, 230, 242, .9);
}

.records-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.records-toolbar h2 {
    margin: 0 0 4px;
    color: var(--primary-deep);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.primary-filters {
    align-items: end;
}

.filter-panel {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(234, 244, 251, .55);
}

.filter-panel summary {
    cursor: pointer;
    color: var(--primary-deep);
    font-weight: 950;
    margin-bottom: 14px;
}

.column-card {
    background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(234,244,251,.82));
}

.column-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin: 14px 0 18px;
}

.column-choice {
    display: flex;
    gap: 9px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,.74);
    color: var(--ink);
    font-weight: 850;
}

.column-choice input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1100px;
}

.table th,
.table td {
    border-bottom: 1px solid var(--line);
    padding: 14px;
    text-align: left;
    vertical-align: top;
}

.table th {
    font-size: 12px;
    text-transform: uppercase;
    color: #5e6782;
    background: #eef5fb;
    white-space: nowrap;
}

.master-table th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.sort-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-deep);
    text-decoration: none;
}

.sort-arrow {
    color: var(--primary);
    font-size: 13px;
    font-weight: 950;
}

.sort-muted {
    color: #9aa9ba;
}

.table tbody tr:nth-child(even) {
    background: rgba(234, 244, 251, .58);
}

.table tbody tr:hover {
    background: rgba(216, 233, 247, .72);
}

.alert {
    padding: 14px 17px;
    border-radius: 18px;
    margin-bottom: 15px;
    font-weight: 800;
}

.alert-success {
    background: #def9eb;
    color: #187052;
}

.alert-error {
    background: #ffe3ec;
    color: #a92245;
}

.pill {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eaf4fb;
    color: #173f68;
    font-weight: 900;
    font-size: 12px;
}

.status-valid {
    background: #d9f8e9;
    color: #087a57;
    box-shadow: inset 0 0 0 1px #9be8c8;
}

.status-not-valid {
    background: #ffe3ec;
    color: #b3234b;
    box-shadow: inset 0 0 0 1px #ffadc2;
}

.status-unknown {
    background: #fff3c4;
    color: #8a6500;
    box-shadow: inset 0 0 0 1px #f6d96b;
}

.status-pending {
    background: #fff3c4;
    color: #8a6500;
    box-shadow: inset 0 0 0 1px #f6d96b;
}

.verification-details {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(143, 156, 190, .22);
}

.verification-overlay {
    margin-top: 24px;
    padding: 28px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(12, 24, 44, .72), rgba(68, 40, 94, .54));
    box-shadow: 0 28px 80px rgba(42, 50, 89, .28);
}

.verification-card {
    position: relative;
    max-width: 860px;
    margin: 0 auto;
    padding: 34px;
    border-radius: 26px;
    border: 3px solid rgba(149, 84, 189, .42);
    background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(231, 214, 248, .94));
    box-shadow: 0 24px 60px rgba(40, 31, 71, .24);
}

.verification-close {
    position: absolute;
    top: 18px;
    right: 20px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #edf4fb;
    color: #28315f;
    text-decoration: none;
    font-size: 24px;
    font-weight: 900;
}

.verification-card-head {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    text-align: left;
}

.verification-card-head h2 {
    margin: 0 0 6px;
    font-size: 22px;
}

.mail-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #6c2b8f;
    color: #fff;
    font-size: 24px;
    box-shadow: 0 12px 24px rgba(108, 43, 143, .24);
}

.verification-check-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.check-box {
    min-height: 78px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .72);
    border: 2px solid #d8ddd8;
}

.check-box .check-label {
    display: block;
    margin-bottom: 8px;
    color: #74809c;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.check-box strong {
    display: block;
    color: #1d253f;
    font-size: 17px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.check-box em {
    display: inline-block;
    margin-top: 8px;
    font-style: normal;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.check-pass {
    border-color: #34c98c;
    background: #f1fff8;
}

.check-pass em {
    color: #087a57;
}

.check-fail {
    border-color: #ff8bab;
    background: #fff3f7;
}

.check-fail em {
    color: #b3234b;
}

.check-unknown {
    border-color: #f2c94c;
    background: #fffaf0;
}

.check-unknown em {
    color: #8a6500;
}

.verification-raw {
    margin-top: 22px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .62);
    overflow: hidden;
}

.verification-raw summary {
    cursor: pointer;
    padding: 15px 18px;
    color: #28315f;
    font-weight: 900;
}

.verification-details h3 {
    margin: 0 0 14px;
    font-size: 18px;
}

.details-grid {
    display: grid;
    grid-template-columns: minmax(170px, 240px) 1fr;
    border: 1px solid rgba(143, 156, 190, .22);
    border-radius: 18px;
    overflow: hidden;
}

.detail-label,
.detail-value {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(143, 156, 190, .16);
}

.detail-label {
    background: linear-gradient(135deg, #fff3c4, #d9f8e9);
    font-weight: 900;
    color: #26315f;
}

.detail-value {
    background: rgba(255, 255, 255, .74);
    color: #536280;
    overflow-wrap: anywhere;
}

.detail-label:nth-last-child(2),
.detail-value:last-child {
    border-bottom: 0;
}

.progress-wrap {
    width: 180px;
    height: 10px;
    background: #edf0fb;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 9px;
    box-shadow: inset 0 1px 3px rgba(116, 128, 152, .14);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #173f68, #2f7dbc);
    border-radius: 999px;
    transition: width .25s ease;
}

.pagination-bar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-top: 16px;
}

.pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.page-link {
    display: inline-grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--primary-deep);
    text-decoration: none;
    font-weight: 950;
}

.page-link.active {
    background: var(--primary-deep);
    color: #fff;
    border-color: var(--primary-deep);
}

.disabled {
    pointer-events: none;
    opacity: .48;
}

.sidebar-toggle {
    position: sticky;
    top: 12px;
    z-index: 5;
    margin-bottom: 14px;
    border: 0;
    border-radius: 14px;
    width: 44px;
    height: 40px;
    background: #fff;
    color: var(--primary-dark);
    box-shadow: 0 12px 28px rgba(23, 63, 104, .14);
    cursor: pointer;
    font-weight: 950;
    font-size: 28px;
    line-height: 1;
}

.toggle-expand {
    display: none;
}

.sidebar-collapsed .toggle-collapse {
    display: none;
}

.sidebar-collapsed .toggle-expand {
    display: inline;
}

@media (max-width: 900px) {
    .app {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
        margin-bottom: 18px;
    }

    .verification-check-grid,
    .details-grid {
        grid-template-columns: 1fr;
    }

    .verification-card {
        padding: 24px;
    }

    .user-form-grid,
    .option-grid,
    .region-grid {
        grid-template-columns: 1fr;
    }

    .section-heading {
        display: block;
    }

    .section-heading p {
        text-align: left;
    }

    .records-toolbar,
    .pagination-bar {
        display: block;
    }

    .records-toolbar .actions,
    .pagination {
        margin-top: 12px;
    }
}

/* ===== Final reference overrides for Records and shared CRUD pages ===== */
body.has-sidebar .hero {
    display: none;
}

body.has-sidebar .card,
body.has-sidebar .panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    backdrop-filter: none;
}

body.has-sidebar .panel.mb,
body.has-sidebar .mb {
    margin-bottom: 16px;
}

body.has-sidebar .filter-head,
body.has-sidebar .table-head,
body.has-sidebar .column-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line-soft);
    flex-wrap: wrap;
    margin: 0;
}

body.has-sidebar .filter-title,
body.has-sidebar .table-title {
    font-size: 14.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--ink-1);
}

body.has-sidebar .filter-title svg {
    width: 16px;
    height: 16px;
    color: var(--brand-600);
}

body.has-sidebar .filter-sub {
    font-size: 12px;
    color: var(--ink-3);
    margin-top: 3px;
}

body.has-sidebar .filter-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

body.has-sidebar .filter-body {
    padding: 18px 20px 6px;
}

body.has-sidebar .filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px 16px;
    margin-bottom: 14px;
}

body.has-sidebar .field-wide {
    grid-column: span 2;
}

body.has-sidebar .field label {
    display: block;
    font-size: 11.5px;
    font-weight: 650;
    color: var(--ink-2);
    margin-bottom: 6px;
    letter-spacing: .02em;
}

body.has-sidebar .field input,
body.has-sidebar .field select,
body.has-sidebar .card input,
body.has-sidebar .card select,
body.has-sidebar .card textarea {
    width: 100%;
    font: inherit;
    font-size: 13px;
    color: var(--ink-1);
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 8px 11px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    box-shadow: none;
}

body.has-sidebar .field select,
body.has-sidebar .card select,
body.has-sidebar .per-page select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    padding-right: 32px;
}

body.has-sidebar .field input:focus,
body.has-sidebar .field select:focus,
body.has-sidebar .card input:focus,
body.has-sidebar .card select:focus,
body.has-sidebar .card textarea:focus {
    border-color: var(--brand-400);
    box-shadow: 0 0 0 3px var(--brand-50);
}

body.has-sidebar .search-wrap {
    position: relative;
}

body.has-sidebar .search-wrap svg {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--ink-3);
    pointer-events: none;
}

body.has-sidebar .search-wrap input {
    padding-left: 32px;
}

body.has-sidebar .advanced-filter-panel {
    border-top: 1px solid var(--line-soft);
}

body.has-sidebar .adv-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    cursor: pointer;
    background: var(--surface-2);
    border: 0;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--brand-600);
    padding: 11px 20px;
    text-align: left;
    list-style: none;
}

body.has-sidebar .adv-toggle::-webkit-details-marker {
    display: none;
}

body.has-sidebar .chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 16px 2px 14px;
}

body.has-sidebar .chips-label {
    font-size: 12px;
    color: var(--ink-3);
    font-weight: 500;
}

body.has-sidebar .chip,
body.has-sidebar .count-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 600;
    background: var(--brand-50);
    color: var(--brand-700);
    border: 1px solid var(--brand-100);
    border-radius: 999px;
    padding: 4px 11px;
}

body.has-sidebar .chip-clear {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-3);
}

body.has-sidebar .column-panel details > summary {
    cursor: pointer;
}

body.has-sidebar .column-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin: 0 0 18px;
}

body.has-sidebar .column-choice {
    display: flex;
    gap: 9px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--ink-1);
    font-size: 13px;
    font-weight: 600;
}

body.has-sidebar .table-note {
    margin-left: auto;
    font-size: 12px;
    color: var(--ink-3);
    display: flex;
    align-items: center;
    gap: 6px;
}

body.has-sidebar .table-note svg {
    width: 13px;
    height: 13px;
}

body.has-sidebar .table-scroll,
body.has-sidebar .table-wrap {
    overflow-x: auto;
}

body.has-sidebar table,
body.has-sidebar .table,
body.has-sidebar .reference-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    min-width: 1080px;
}

body.has-sidebar thead th,
body.has-sidebar .table th {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ink-3);
    text-align: left;
    padding: 11px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    user-select: none;
}

body.has-sidebar thead th.sortable:hover,
body.has-sidebar thead th.sortable:hover a {
    color: var(--brand-600);
}

body.has-sidebar thead th a {
    color: inherit;
    text-decoration: none;
}

body.has-sidebar thead th .sort {
    display: inline-block;
    margin-left: 4px;
    opacity: .55;
    font-size: 10px;
}

body.has-sidebar thead th .active-sort {
    color: var(--brand-600);
    opacity: 1;
}

body.has-sidebar tbody td,
body.has-sidebar .table td {
    padding: 14px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 13px;
    color: var(--ink-2);
    vertical-align: middle;
}

body.has-sidebar tbody tr {
    transition: background .12s;
}

body.has-sidebar tbody tr:nth-child(even) {
    background: transparent;
}

body.has-sidebar tbody tr:hover {
    background: var(--brand-50);
}

body.has-sidebar tbody tr:last-child td {
    border-bottom: 0;
}

body.has-sidebar .region-tag {
    display: inline-flex;
    align-items: center;
    font-size: 11.5px;
    font-weight: 650;
    color: var(--brand-700);
    background: var(--brand-50);
    border: 1px solid var(--brand-100);
    border-radius: 6px;
    padding: 3px 9px;
    white-space: nowrap;
}

body.has-sidebar .person {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

body.has-sidebar .p-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex: none;
    display: grid;
    place-items: center;
    font-size: 11.5px;
    font-weight: 700;
    color: #fff;
    background: var(--brand-600);
}

body.has-sidebar .p-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-1);
    line-height: 1.3;
}

body.has-sidebar .p-title {
    font-size: 11.5px;
    color: var(--ink-3);
    margin-top: 1px;
    white-space: nowrap;
}

body.has-sidebar .email-cell a {
    color: var(--brand-600);
    font-weight: 500;
}

body.has-sidebar .email-cell a:hover {
    text-decoration: underline;
}

body.has-sidebar .badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 650;
    border-radius: 999px;
    padding: 3.5px 10px;
    white-space: nowrap;
    border: 1px solid transparent;
}

body.has-sidebar .b-valid {
    background: var(--good-bg);
    color: var(--good-ink);
    border-color: #cfe9cf;
}

body.has-sidebar .b-unknown {
    background: var(--warn-bg);
    color: var(--warn-ink);
    border-color: #f3e2b3;
}

body.has-sidebar .b-invalid {
    background: var(--crit-bg);
    color: var(--crit-ink);
    border-color: #f2caca;
}

body.has-sidebar .row-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

body.has-sidebar .row-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-2);
    transition: background .15s, border-color .15s, color .15s;
    font-size: 14px;
}

body.has-sidebar .row-btn:hover {
    background: var(--brand-50);
    border-color: var(--brand-200);
    color: var(--brand-600);
}

body.has-sidebar .row-btn.danger:hover {
    background: var(--crit-bg);
    border-color: #f2caca;
    color: var(--crit-ink);
}

body.has-sidebar .table-foot {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-top: 1px solid var(--line-soft);
    flex-wrap: wrap;
}

body.has-sidebar .foot-info {
    font-size: 12.5px;
    color: var(--ink-3);
}

body.has-sidebar .foot-info b {
    color: var(--ink-2);
    font-weight: 600;
}

body.has-sidebar .pager {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

body.has-sidebar .page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid var(--line);
    background: var(--surface);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background .15s;
}

body.has-sidebar .page-btn.current {
    background: var(--brand-600);
    border-color: var(--brand-600);
    color: #fff;
}

body.has-sidebar .page-btn.disabled {
    opacity: .45;
    pointer-events: none;
}

body.has-sidebar .per-page {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--ink-3);
}

body.has-sidebar .per-page select {
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-1);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 5px 26px 5px 9px;
    background-color: var(--surface);
    outline: none;
    cursor: pointer;
}

body.has-sidebar .btn-danger {
    background: var(--crit);
    color: #fff;
}

body.has-sidebar .column-choice {
    cursor: grab;
    user-select: none;
}

body.has-sidebar .column-choice.dragging {
    opacity: .55;
    transform: scale(.98);
}

body.has-sidebar .drag-grip {
    color: var(--muted);
    letter-spacing: -4px;
    margin-right: 8px;
}

/* Layout fixes for reference UI after broad form/table overrides */
body.has-sidebar .adv-toggle svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
}

body.has-sidebar .field > span {
    display: block;
    font-size: 11.5px;
    font-weight: 650;
    color: var(--ink-2);
    margin-bottom: 6px;
    letter-spacing: .02em;
}

body.has-sidebar .option-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 16px;
}

body.has-sidebar .option-card {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: flex-start;
    gap: 12px;
    min-height: 112px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    overflow: hidden;
}

body.has-sidebar .option-card input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    padding: 0;
    margin: 2px 0 0;
    box-shadow: none;
    accent-color: var(--brand-600);
}

body.has-sidebar .option-card span {
    min-width: 0;
    display: block;
}

body.has-sidebar .option-card strong {
    display: block;
    color: var(--ink-1);
    font-size: 14px;
    line-height: 1.25;
    margin-bottom: 6px;
    overflow-wrap: anywhere;
}

body.has-sidebar .option-card em {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
    line-height: 1.45;
    padding-left: 0;
    overflow-wrap: anywhere;
}

body.has-sidebar .region-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
}

body.has-sidebar .page-head h1 {
    margin: 0 0 8px;
    font-size: 30px;
    line-height: 1.15;
    color: var(--ink-1);
}

body.has-sidebar .page-head p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

body.has-sidebar .eyebrow {
    margin: 0 0 8px;
    color: var(--brand-600);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

body.has-sidebar .btn-sm {
    padding: 7px 12px;
    font-size: 12px;
}

body.has-sidebar .table-link {
    color: var(--brand-600);
    font-weight: 700;
}

body.has-sidebar .table-link:hover {
    text-decoration: underline;
}

body.has-sidebar .record-form-grid {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
}

body.has-sidebar input[type="file"] {
    min-height: 42px;
}

@media (max-width: 1100px) {
    body.has-sidebar .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 820px) {
    body.has-sidebar .filter-grid {
        grid-template-columns: 1fr;
    }

    body.has-sidebar .field-wide {
        grid-column: auto;
    }

    body.has-sidebar .table-foot {
        display: block;
    }

    body.has-sidebar .pager,
    body.has-sidebar .per-page {
        margin-top: 10px;
        margin-left: 0;
    }
}

/* Audit Logs alignment polish */
body.has-sidebar .audit-filter-form {
    padding: 18px 20px;
}

body.has-sidebar .audit-filter-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.4fr) minmax(220px, 1fr) minmax(240px, 1fr) auto;
    gap: 16px;
    align-items: end;
}

body.has-sidebar .audit-filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
}

body.has-sidebar .audit-filter-actions .btn {
    min-height: 42px;
}

body.has-sidebar .audit-filter-panel .field {
    margin: 0;
}

@media (max-width: 1100px) {
    body.has-sidebar .audit-filter-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
    body.has-sidebar .audit-filter-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    body.has-sidebar .audit-filter-grid {
        grid-template-columns: 1fr;
    }
}

/* Login page redesign */
body:not(.has-sidebar) {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 16%, rgba(158, 197, 244, .42), transparent 30%),
        radial-gradient(circle at 90% 10%, rgba(234, 243, 253, .95), transparent 28%),
        linear-gradient(135deg, #f5f8fc 0%, #eef4fa 52%, #ffffff 100%);
    color: var(--ink-1);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body:not(.has-sidebar) .auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
}

.login-shell {
    width: min(1120px, 96vw);
    min-height: 640px;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    background: rgba(255,255,255,.86);
    border: 1px solid rgba(219,230,242,.95);
    border-radius: 28px;
    box-shadow: 0 30px 90px rgba(15, 45, 82, .16);
    overflow: hidden;
}

.login-brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 46px;
    background:
        radial-gradient(circle at 88% 10%, rgba(255,255,255,.22), transparent 22%),
        linear-gradient(145deg, var(--brand-800), var(--brand-900));
    color: #fff;
    overflow: hidden;
}

.login-brand-panel::after {
    content: "";
    position: absolute;
    right: -110px;
    bottom: -150px;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: rgba(85, 152, 231, .24);
}

.login-logo-card {
    width: 245px;
    min-height: 106px;
    display: grid;
    place-items: center;
    padding: 18px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(0,0,0,.14);
    position: relative;
    z-index: 1;
}

.login-logo-card .login-logo {
    width: 100%;
    max-height: 82px;
    object-fit: contain;
}

.login-brand-copy {
    position: relative;
    z-index: 1;
    max-width: 480px;
}

.login-brand-copy .eyebrow {
    color: var(--brand-200);
}

.login-brand-copy h1 {
    margin: 0 0 16px;
    font-size: clamp(38px, 5vw, 60px);
    line-height: .98;
    letter-spacing: -.04em;
}

.login-brand-copy p {
    margin: 0;
    color: #c8d8ec;
    font-size: 17px;
    line-height: 1.65;
}

.login-feature-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.login-feature-grid div {
    padding: 16px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 16px;
    background: rgba(255,255,255,.08);
    backdrop-filter: blur(10px);
}

.login-feature-grid strong {
    display: block;
    font-size: 24px;
    line-height: 1;
    margin-bottom: 8px;
}

.login-feature-grid span {
    display: block;
    color: #b6cbe5;
    font-size: 12px;
    font-weight: 700;
}

.login-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    padding: 54px;
    background: rgba(255,255,255,.96);
}

.login-card-head {
    margin-bottom: 8px;
}

.login-badge {
    display: inline-flex;
    margin-bottom: 14px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--brand-50);
    color: var(--brand-700);
    font-size: 12px;
    font-weight: 800;
}

.login-card h2 {
    margin: 0 0 8px;
    color: var(--ink-1);
    font-size: 34px;
    letter-spacing: -.03em;
}

.login-card p {
    margin: 0;
    color: var(--muted);
}

.login-field {
    display: block;
    margin: 0;
}

.login-field span {
    display: block;
    margin-bottom: 8px;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 800;
}

.login-field input {
    width: 100%;
    height: 48px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0 14px;
    background: #fff;
    color: var(--ink-1);
    font: inherit;
    outline: none;
    box-shadow: none;
}

.login-field input:focus {
    border-color: var(--brand-400);
    box-shadow: 0 0 0 4px var(--brand-50);
}

.login-submit {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    margin-top: 4px;
}

.login-help {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.5;
}

.login-demo {
    justify-content: center;
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
    }
    .login-brand-panel {
        gap: 34px;
        padding: 34px;
    }
    .login-card {
        padding: 34px;
    }
}

@media (max-width: 560px) {
    body:not(.has-sidebar) .auth {
        padding: 16px;
    }
    .login-feature-grid {
        grid-template-columns: 1fr;
    }
    .login-logo-card {
        width: 210px;
    }
}

/* Soft Deleted Records layout polish */
body.has-sidebar .deleted-filter-form {
    padding: 18px 20px;
}

body.has-sidebar .deleted-filter-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1.2fr) minmax(220px, 1fr) minmax(200px, 1fr) 110px auto;
    gap: 16px;
    align-items: end;
}

body.has-sidebar .deleted-filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
}

body.has-sidebar .deleted-filter-actions .btn {
    min-height: 42px;
}

body.has-sidebar .deleted-table-scroll {
    overflow-x: auto;
    scrollbar-gutter: stable;
}

body.has-sidebar .deleted-table {
    min-width: 1280px;
}

body.has-sidebar .deleted-table th,
body.has-sidebar .deleted-table td {
    white-space: normal;
}

body.has-sidebar .deleted-table .nowrap {
    white-space: nowrap;
}

body.has-sidebar .deleted-table .actions-col {
    width: 210px;
    min-width: 210px;
    text-align: right;
    position: sticky;
    right: 0;
    background: var(--surface);
    box-shadow: -10px 0 18px rgba(11,18,32,.04);
}

body.has-sidebar .deleted-table thead .actions-col {
    background: var(--surface-2);
}

body.has-sidebar .deleted-actions {
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
}

body.has-sidebar .deleted-actions .row-btn {
    width: auto;
    min-width: auto;
    height: 34px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

body.has-sidebar .deleted-actions .restore-btn {
    border-color: #cfe9cf;
    color: var(--good-ink);
    background: var(--good-bg);
}

body.has-sidebar .deleted-actions .delete-forever-btn {
    border-color: #f2caca;
    color: var(--crit-ink);
    background: var(--crit-bg);
}

@media (max-width: 1180px) {
    body.has-sidebar .deleted-filter-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
    body.has-sidebar .deleted-filter-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    body.has-sidebar .deleted-filter-grid {
        grid-template-columns: 1fr;
    }
}

/* Soft Deleted Records final table fix */
body.has-sidebar .deleted-records-panel {
    overflow: hidden;
}

body.has-sidebar .deleted-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

body.has-sidebar .deleted-table {
    width: max-content;
    min-width: 1180px;
    table-layout: auto;
}

body.has-sidebar .deleted-table th,
body.has-sidebar .deleted-table td {
    max-width: 180px;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

body.has-sidebar .deleted-table th:nth-child(1),
body.has-sidebar .deleted-table td:nth-child(1) { min-width: 92px; }
body.has-sidebar .deleted-table th:nth-child(2),
body.has-sidebar .deleted-table td:nth-child(2) { min-width: 150px; }
body.has-sidebar .deleted-table th:nth-child(3),
body.has-sidebar .deleted-table td:nth-child(3) { min-width: 160px; }
body.has-sidebar .deleted-table th:nth-child(6),
body.has-sidebar .deleted-table td:nth-child(6) { min-width: 220px; }

body.has-sidebar .deleted-table .actions-col {
    width: 230px;
    min-width: 230px;
    max-width: 230px;
    z-index: 3;
}

body.has-sidebar .deleted-actions .row-btn,
body.has-sidebar .deleted-actions .row-btn.danger {
    display: inline-flex;
    width: auto !important;
    min-width: 78px;
    height: 36px;
    border-radius: 12px;
    padding: 0 13px;
    line-height: 1;
}

body.has-sidebar .deleted-actions .delete-forever-btn {
    min-width: 116px;
}

/* Email Verifier page redesign */
body.has-sidebar .verifier-hero {
    background: linear-gradient(135deg, #ffffff 0%, #eef6fd 45%, #d8eafa 100%);
    border: 1px solid var(--line);
    border-radius: 26px;
    padding: 34px 36px;
    box-shadow: var(--shadow-soft);
}

body.has-sidebar .verifier-form-panel {
    overflow: hidden;
}

body.has-sidebar .verifier-form {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto;
    gap: 18px;
    align-items: end;
    padding: 24px 28px;
}

body.has-sidebar .verifier-email-field {
    margin: 0;
}

body.has-sidebar .verifier-email-field input {
    height: 54px;
    font-size: 16px;
    border-radius: 16px;
}

body.has-sidebar .verifier-form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
}

body.has-sidebar .verification-result-shell {
    margin-top: 26px;
    padding: 38px 28px;
    border-radius: 30px;
    background: radial-gradient(circle at 30% 70%, rgba(45, 107, 169, .22), transparent 34%), linear-gradient(135deg, rgba(8, 34, 62, .78), rgba(19, 64, 105, .68));
    box-shadow: 0 26px 70px rgba(12, 41, 73, .28);
}

body.has-sidebar .verifier-result-card {
    max-width: 1040px;
    border: 1px solid rgba(45, 107, 169, .22);
    border-top: 5px solid var(--primary);
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 62%, #edf5fb 100%);
    box-shadow: 0 22px 54px rgba(12, 41, 73, .2);
}

body.has-sidebar .verification-result-pass .verifier-result-card { border-top-color: var(--good); }
body.has-sidebar .verification-result-fail .verifier-result-card { border-top-color: var(--crit); }
body.has-sidebar .verification-result-unknown .verifier-result-card { border-top-color: var(--warn); }

body.has-sidebar .verifier-result-head {
    justify-content: flex-start;
    text-align: left;
    padding-right: 42px;
}

body.has-sidebar .verifier-result-head .eyebrow {
    margin-bottom: 5px;
}

body.has-sidebar .verifier-result-head h2 {
    font-size: 26px;
    color: var(--ink);
}

body.has-sidebar .verifier-check-grid {
    grid-template-columns: repeat(3, minmax(210px, 1fr));
    gap: 16px;
}

body.has-sidebar .verifier-check-grid .check-box {
    border-radius: 16px;
    padding: 17px 18px;
    min-height: 108px;
    box-shadow: 0 10px 24px rgba(12, 41, 73, .06);
}

body.has-sidebar .verifier-check-grid .check-box strong {
    font-size: 20px;
}

body.has-sidebar .verifier-raw-details {
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

body.has-sidebar .verifier-raw-details summary {
    color: var(--primary);
}

@media (max-width: 980px) {
    body.has-sidebar .verifier-form,
    body.has-sidebar .verifier-check-grid {
        grid-template-columns: 1fr;
    }
    body.has-sidebar .verifier-form-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}



/* Saved Searches admin module */
body.has-sidebar .saved-search-admin-form {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}
body.has-sidebar .saved-search-admin-form { justify-content: space-between; }
body.has-sidebar .saved-search-admin-form .field { flex: 1 1 360px; }
body.has-sidebar .saved-search-admin-actions { display: flex; gap: 10px; }
body.has-sidebar .saved-search-admin-table { min-width: 1080px; }
body.has-sidebar .saved-search-summary {
    display: block;
    max-width: 520px;
    color: var(--muted);
    line-height: 1.45;
    overflow-wrap: anywhere;
}
body.has-sidebar .saved-search-row-actions { justify-content: flex-end; gap: 10px; white-space: nowrap; }
body.has-sidebar .row-action-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--primary);
    background: #fff;
    text-decoration: none;
    font-weight: 900;
    font-size: 12px;
}
body.has-sidebar .row-action-text.danger {
    color: var(--crit-ink);
    border-color: #f2caca;
    background: var(--crit-bg);
}

body.has-sidebar .save-search-panel {
    overflow: visible;
}

body.has-sidebar .save-search-form {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto;
    gap: 16px;
    align-items: end;
}

body.has-sidebar .save-search-title {
    margin: 0;
}

body.has-sidebar .save-search-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

body.has-sidebar .save-search-help {
    font-size: 12.5px;
    color: var(--ink-3);
}

@media (max-width: 820px) {
    body.has-sidebar .save-search-form {
        grid-template-columns: 1fr;
    }

    body.has-sidebar .save-search-actions {
        justify-content: flex-start;
    }
}




/* Keep sidebar and page content aligned without the wide center gutter. */
body.has-sidebar .app {
    gap: 0;
    padding: 0;
}

body.has-sidebar .sidebar {
    top: 0;
    height: 100vh;
    border-radius: 0;
}

body.has-sidebar .main {
    min-width: 0;
}

body.has-sidebar .content {
    max-width: none;
    width: 100%;
    margin: 0;
    padding-left: 32px;
    padding-right: 32px;
}

@media (max-width: 820px) {
    body.has-sidebar .app {
        gap: 0;
        padding: 0;
    }

    body.has-sidebar .content {
        padding-left: 18px;
        padding-right: 18px;
    }
}
