/* ═══════════════════════════════════════════════════
   建筑公司资质管理系统 — "精工建造" 主题
   Design System: Precision Engineering
   Inspired by Braun industrial design × architectural blueprints
   ═══════════════════════════════════════════════════ */

:root {
    --ink: #161b2b;
    --ink-soft: #232a3e;
    --nav-bg: #111827;
    --nav-text: #a8b5c8;
    --nav-hover: rgba(255,255,255,0.06);
    --nav-active-bg: #ffffff;
    --nav-active-text: #111827;

    --bg: #f0eeea;
    --bg-grid: rgba(22,27,43,0.03);
    --surface: #fefdfa;
    --surface-soft: #f7f5f1;
    --surface-warm: #fdf6ec;

    --line: #e4dfd6;
    --line-strong: #d4cec3;

    --text: #1a1c1e;
    --muted: #787164;

    --primary: #1e3a5c;
    --primary-soft: #eaf0f7;
    --primary-light: #eaf0f7;
    --accent: #d46b08;
    --accent-hover: #b85d07;
    --accent-soft: #fef3e6;
    --warn: #b91c1c;
    --warn-soft: #fef1f1;
    --success: #0d7b6c;
    --success-soft: #eaf7f4;

    --shadow-sm: 0 1px 2px rgba(22,27,43,0.05);
    --shadow: 0 1px 3px rgba(22,27,43,0.06), 0 4px 16px rgba(22,27,43,0.05);
    --shadow-lg: 0 2px 6px rgba(22,27,43,0.06), 0 12px 32px rgba(22,27,43,0.08);

    --radius: 6px;
    --radius-sm: 4px;
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* subtle blueprint dot grid on workspace */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.28;
    background-image: radial-gradient(circle, var(--bg-grid) 1px, transparent 1px);
    background-size: 20px 20px;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 15px; font-weight: 600; }

/* ════ Login ════ */
.login-view {
    min-height: 100vh;
    padding: 32px;
    display: grid;
    place-items: center;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(22,27,43,0.08), transparent 45%),
        radial-gradient(ellipse at 80% 65%, rgba(212,107,8,0.06), transparent 40%),
        var(--bg);
}

.login-shell {
    width: min(920px, 100%);
    min-height: 520px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.login-side {
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(155deg, #0f1729 0%, #1a2744 50%, #1e3a5c 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.login-side::after {
    content: "";
    position: absolute;
    top: -60px;
    right: -60px;
    width: 280px;
    height: 280px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50%;
}
.login-side::before {
    content: "";
    position: absolute;
    bottom: -40px;
    left: -40px;
    width: 180px;
    height: 180px;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 50%;
}

.login-side h1 {
    margin-top: 28px;
    position: relative;
    z-index: 1;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.login-side p {
    margin-top: 12px;
    position: relative;
    z-index: 1;
    max-width: 340px;
    color: rgba(255,255,255,0.65);
    line-height: 1.75;
    font-size: 13px;
}

.login-features {
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.login-features li {
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius);
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.04);
}

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

.login-metrics span {
    padding: 14px 10px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.78);
    text-align: center;
}
.login-metrics strong {
    display: block;
    margin-bottom: 3px;
    font-size: 24px;
    color: #fff;
    font-weight: 700;
}

.login-card {
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.login-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 22px;
}
.login-tab {
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
    transition: all .2s ease;
}
.login-tab.active {
    background: linear-gradient(135deg, #0d7b6c, #12a08d);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}
.login-tab-dev.active {
    background: linear-gradient(135deg, #5b3fd4, #7c5cff);
}
.login-submit-dev {
    background: linear-gradient(135deg, #5b3fd4, #7c5cff) !important;
}
.role-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    vertical-align: middle;
    margin-left: 6px;
}
.role-badge-dev {
    background: rgba(91, 63, 212, 0.12);
    color: #5b3fd4;
}
.login-note-dev span:first-child {
    color: #5b3fd4;
    font-weight: 600;
}
.login-panel { display: none; }
.login-panel.active { display: block; }
.login-heading { margin-bottom: 26px; }
.login-heading h2 { font-size: 22px; }
.login-heading p { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.login-form { display: grid; gap: 14px; }
.login-form label,
.form-card label,
.setting-grid label { display: grid; gap: 8px; }
.login-form span,
.form-card span,
.setting-grid span { color: var(--muted); font-weight: 600; font-size: 13px; }

select, input, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
select { height: 40px; padding: 0 34px 0 12px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23787164' fill='none' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input { height: 40px; padding: 0 12px; }
textarea { min-height: 92px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212,107,8,0.1);
}

.login-submit { width: 100%; height: 44px; margin-top: 4px; }
.login-note {
    margin-top: 18px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 0.02em;
}
.login-side .brand-mark {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
    z-index: 1;
}

/* ════ App Shell ════ */
.app-shell { display: none; position: relative; z-index: 1; }
body.is-authenticated .login-view { display: none; }
body.is-authenticated .app-shell { display: block; }

/* ════ Topbar ════ */
.topbar {
    height: 64px;
    padding: 0 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand p, .panel-head p, .muted { color: var(--muted); }
.brand p { margin-top: 2px; font-size: 12px; }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.current-context {
    min-height: 38px;
    max-width: 500px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    white-space: normal;
    line-height: 1.4;
}

.crawler-status {
    height: 28px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.crawler-status.on {
    background: #eaf7f4;
    color: #0d7b6c;
    border: 1px solid #0d7b6c;
}
.crawler-status.off {
    background: var(--surface-soft);
    color: var(--muted);
    border: 1px solid var(--line);
}
.crawler-status.on::before {
    content: "";
    width: 7px; height: 7px;
    margin-right: 6px;
    border-radius: 50%;
    background: #0d7b6c;
}

.verify-loading {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border-radius: var(--radius-md);
}

.verify-loading-inner {
    max-width: 360px;
    text-align: center;
    color: var(--text);
    line-height: 1.6;
}

.verify-loading-inner strong {
    display: block;
    margin-bottom: 8px;
    color: #0d7b6c;
}

.modal {
    position: relative;
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.role-box {
    height: 38px;
    padding: 0 6px 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
}
.role-box span { color: var(--muted); font-size: 12px; }
.role-box select {
    width: 88px; height: 28px;
    border: 0; background: transparent;
    box-shadow: none; font-size: 13px;
}

button {
    height: 36px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    font-weight: 500;
    font-size: 13px;
    transition: all 0.15s ease;
    letter-spacing: 0.01em;
}
button:hover {
    border-color: var(--line-strong);
    background: #f9f8f5;
}

.primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}
.primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); }

/* ════ Layout ════ */
.layout {
    display: grid;
    grid-template-columns: 224px minmax(0, 1fr);
    min-height: calc(100vh - 64px);
}

.sidebar {
    padding: 16px 10px 16px 12px;
    background: linear-gradient(180deg, #0f1729 0%, #1a2237 100%);
    color: var(--nav-text);
    border-right: 1px solid rgba(255,255,255,0.06);
}

.side-profile {
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.04);
}
.side-profile span {
    display: block;
    margin-bottom: 4px;
    color: #7788a0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.side-profile strong { font-size: 14px; font-weight: 600; }

.side-title {
    padding: 0 8px 8px;
    color: #7788a0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.nav {
    width: 100%;
    height: 38px;
    margin-bottom: 4px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--nav-text);
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.12s ease;
}
.nav:hover { background: var(--nav-hover); color: #e2e8f0; }
.nav.active {
    background: var(--nav-active-bg);
    color: var(--nav-active-text);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

/* ════ Workspace ════ */
.workspace { padding: 24px; min-width: 0; }

.toolbar {
    margin-bottom: 18px;
    padding: 14px 18px;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.toolbar-title { display: grid; gap: 3px; }
.toolbar-title strong { font-size: 15px; }
.toolbar-title span { color: var(--muted); font-size: 12px; }

.search-group { display: flex; gap: 8px; min-width: 300px; }
.search-group input { width: 340px; max-width: 48vw; }

/* ════ Panels ════ */
.panel {
    display: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 22px;
}
.panel.active { display: block; }

.panel-head {
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.panel-head p { margin-top: 4px; font-size: 13px; }

/* ════ Stats ════ */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat {
    min-height: 92px;
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    transition: box-shadow 0.2s;
}
.stat:hover { box-shadow: var(--shadow); }

.stat::after {
    content: "";
    position: absolute;
    right: -20px;
    top: -30px;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(212,107,8,0.06);
}
.stat:nth-child(2)::after { background: rgba(30,58,92,0.06); }
.stat:nth-child(3)::after { background: rgba(13,123,108,0.06); }
.stat:nth-child(4)::after { background: rgba(120,113,100,0.06); }
.stat:nth-child(5)::after { background: rgba(185,28,28,0.06); }

.stat span {
    position: relative; z-index: 1;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.stat strong {
    position: relative; z-index: 1;
    display: block;
    margin-top: 10px;
    font-size: 32px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ════ Split layout ════ */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
}

.section-block {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}
.section-title {
    padding: 12px 18px;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--line);
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
}

/* ════ Admin hub ════ */
.admin-hub {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.admin-rail {
    position: sticky;
    top: 12px;
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 2px);
    background: linear-gradient(180deg, #fff 0%, var(--surface-soft) 100%);
    box-shadow: var(--shadow-sm);
}

.admin-rail__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}
.admin-rail__head strong { font-size: 14px; }
.admin-rail__head span {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
}

.admin-rail-add {
    width: 100%;
    padding: 10px 12px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: #fff;
    color: var(--primary);
    font-weight: 600;
}
.admin-rail-add:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-hover);
}

.admin-card-list { display: grid; gap: 10px; max-height: 62vh; overflow: auto; padding-right: 2px; }

.admin-card {
    width: 100%;
    height: auto;
    padding: 14px;
    display: grid;
    gap: 10px;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.admin-card:hover {
    border-color: #c5d5e8;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}
.admin-card.active {
    border-color: var(--primary);
    background: linear-gradient(180deg, #fff 0%, var(--primary-soft) 100%);
    box-shadow: var(--shadow);
}

.admin-card__top {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
}

.admin-avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, #2f5280 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.admin-card__title { min-width: 0; display: grid; gap: 2px; }
.admin-card .admin-name {
    color: var(--text);
    font-weight: 700;
    font-size: 15px;
    line-height: 1.3;
}
.admin-account {
    color: var(--muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-count-badge {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
}

.admin-card__scope {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
    min-height: 36px;
}

.admin-card__foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.admin-status {
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}
.admin-status.is-on {
    background: var(--success-soft);
    color: var(--success);
}
.admin-status.is-off {
    background: var(--warn-soft);
    color: var(--warn);
}

.admin-login-hint {
    color: var(--muted);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-workspace {
    min-width: 0;
    display: grid;
    gap: 14px;
}

.admin-workspace__hero {
    padding: 20px 22px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 2px);
    background:
        radial-gradient(circle at top right, rgba(212,107,8,0.08), transparent 42%),
        linear-gradient(180deg, #fff 0%, var(--surface-soft) 100%);
    box-shadow: var(--shadow-sm);
}
.admin-workspace__hero h3 {
    margin: 6px 0 4px;
    font-size: 22px;
    letter-spacing: -0.02em;
}
.admin-workspace__hero p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.admin-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 10px;
}
.admin-kpi {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}
.admin-kpi.accent {
    border-color: #f3dcc3;
    background: linear-gradient(180deg, #fff 0%, var(--accent-soft) 100%);
}
.admin-kpi span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
}
.admin-kpi strong { font-size: 15px; }

.admin-company-panel {
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 2px);
    background: #fff;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.admin-company-panel__head {
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-end;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
}
.admin-company-panel__head .section-title { margin-bottom: 4px; }

.admin-search {
    min-width: 260px;
    display: grid;
    gap: 4px;
}
.admin-search span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}
.admin-search input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
}

.admin-company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    padding: 16px;
}

.admin-company-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fff 0%, #fcfbfa 100%);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.admin-company-card:hover {
    border-color: #c5d5e8;
    box-shadow: var(--shadow-sm);
}

.admin-company-card__head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}
.admin-company-card__head h4 {
    margin: 0 0 4px;
    font-size: 16px;
    line-height: 1.35;
}
.admin-company-card__head p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.admin-company-badge {
    flex-shrink: 0;
    max-width: 120px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-company-card__meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.admin-company-card__meta div {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
}
.admin-company-card__meta span {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
}
.admin-company-card__meta strong {
    display: block;
    font-size: 12px;
    line-height: 1.45;
    word-break: break-all;
}

.admin-company-card__actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 4px;
    border-top: 1px solid var(--line);
}

.admin-empty {
    padding: 42px 24px;
    text-align: center;
    color: var(--muted);
}
.admin-empty.compact { padding: 24px 12px; }
.admin-empty strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 15px;
}
.admin-empty p { margin: 0; font-size: 13px; }

/* legacy admin layout aliases */
.admin-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.admin-detail { min-width: 0; display: grid; gap: 12px; }
.admin-detail-head {
    min-height: 68px;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
}
.admin-detail-head h3 { margin: 3px 0 0; font-size: 18px; }
.admin-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.admin-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    gap: 8px;
}
.admin-summary div {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    text-align: center;
}
.admin-summary span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.02em; }
.admin-summary strong { font-size: 14px; }
.admin-company-block .table-wrap { border: 0; border-radius: 0; }
.admin-company-block table { min-width: 960px; }

.person-page {
    padding: 8px 0 12px;
}
.admin-grouped-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.admin-group-body {
    padding: 14px 16px 16px;
    background: #f8fafc;
}
.admin-group-body .table-wrap {
    border: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(22, 27, 43, 0.04);
}
.dev-global-actions {
    margin-bottom: 14px;
}
.person-page--dev {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.person-admin-group {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(22, 27, 43, 0.04);
}
.person-admin-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border-bottom: 1px solid #edf0f4;
}
.person-admin-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(145deg, #1e3a5c 0%, #2d5280 100%);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(30, 58, 92, 0.18);
}
.person-admin-info {
    min-width: 0;
}
.person-admin-title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.02em;
    color: #1a2332;
}
.person-admin-meta {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}
.person-company-list--nested {
    padding: 14px 16px 16px;
    gap: 12px;
    background: #f8fafc;
}
.person-table-host {
    padding: 0 4px;
}
.panel--persons .panel-head {
    margin-bottom: 8px;
}
.panel--persons .panel-head h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.panel--persons .panel-head p {
    font-size: 13px;
    color: #8b8580;
}
.person-company-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.person-company-block {
    margin-bottom: 0;
    overflow: hidden;
    border: 1px solid rgba(30, 58, 92, 0.1);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(22, 27, 43, 0.04);
    transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.person-company-block:hover {
    border-color: rgba(30, 58, 92, 0.16);
    box-shadow: 0 4px 16px rgba(22, 27, 43, 0.07);
}
.person-company-block.is-open {
    box-shadow: 0 8px 28px rgba(22, 27, 43, 0.09);
    border-color: rgba(30, 58, 92, 0.14);
}
.person-company-toggle {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    min-height: 80px;
    border: 0;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: background 0.25s ease;
}
.person-company-toggle:hover {
    background: #fcfcfd;
}
.person-company-block.is-open .person-company-toggle {
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border-bottom: 1px solid #edf0f4;
}
.person-company-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: linear-gradient(145deg, #eef4fb 0%, #e4edf7 100%);
    color: #2a5078;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.person-company-main {
    flex: 1;
    min-width: 0;
    overflow: visible;
}
.person-company-title {
    display: block;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.55;
    letter-spacing: 0.02em;
    color: #1a2332;
}
.person-company-block.is-open .person-company-title {
    color: #1e3a5c;
}
.person-company-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.5;
}
.person-company-count {
    color: #64748b;
    font-weight: 500;
}
.person-company-hint {
    color: #94a3b8;
    font-weight: 400;
    transition: opacity 0.2s ease;
}
.person-company-hint::before {
    content: '·';
    margin: 0 8px;
    color: #cbd5e1;
}
.person-company-block.is-open .person-company-hint {
    display: none;
}
.person-company-expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #64748b;
    flex-shrink: 0;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s ease, color 0.25s ease;
}
.person-company-toggle:hover .person-company-expand {
    background: #e8eef5;
    color: #1e3a5c;
}
.person-company-block.is-open .person-company-expand {
    transform: rotate(180deg);
    background: #e8f0f8;
    color: #1e3a5c;
}
.person-company-panel {
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;
    transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.person-company-block.is-open .person-company-panel {
    grid-template-rows: 1fr;
}
.person-company-panel__inner {
    overflow: hidden;
    min-height: 0;
}
.person-company-body {
    background: #fff;
}

.person-filter-board {
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #edf0f4;
}
.person-filter-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.person-filter-main,
.person-filter-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: flex-start;
}
.person-filter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: 36px;
    padding: 0 16px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.02em;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.person-filter-chip:hover {
    border-color: #b8c9dc;
    color: #1e3a5c;
    background: #fff;
    box-shadow: 0 2px 8px rgba(30, 58, 92, 0.08);
}
.person-filter-chip.is-active {
    border-color: #1e3a5c;
    background: linear-gradient(160deg, #1e3a5c 0%, #2d5280 100%);
    color: #fff;
    box-shadow: none;
    cursor: default;
}
.person-filter-chip--sub {
    height: 36px;
    padding: 0 16px;
    font-size: 13px;
}
.person-content-card {
    padding: 0;
}
.person-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid #edf0f4;
    background: #fff;
}
.person-section-title {
    margin: 0 0 2px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: #64748b;
    text-transform: uppercase;
}
.person-section-head .muted {
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    color: #94a3b8;
}
.person-add-btn {
    flex-shrink: 0;
    height: 36px;
    padding: 0 18px;
    font-size: 13px;
    border-radius: 10px;
}
.person-table-area {
    background: #fff;
}
.empty.compact {
    margin: 0;
    padding: 32px 20px;
    color: #94a3b8;
    font-size: 14px;
}
.person-company-block .table-wrap {
    border: 0;
    border-radius: 0;
}
.person-table th.col-index,
.person-table td.col-index {
    width: 56px;
    text-align: center;
    color: #94a3b8;
    font-weight: 600;
    font-size: 13px;
}
.person-table thead th {
    background: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.03em;
    padding-top: 12px;
    padding-bottom: 12px;
}
.person-table tbody td {
    font-size: 13px;
    color: #334155;
    padding-top: 13px;
    padding-bottom: 13px;
}
.person-table tbody tr:hover td {
    background: #f8fafc;
}
@media (max-width: 900px) {
    .person-company-toggle {
        padding: 16px 18px;
        gap: 12px;
        min-height: 72px;
    }
    .person-company-title {
        font-size: 16px;
    }
    .person-company-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }
    .person-filter-grid,
    .person-filter-grid.has-sub {
        gap: 8px;
    }
    .person-filter-main,
    .person-filter-sub {
        gap: 8px;
    }
    .person-section-head {
        flex-direction: column;
        align-items: flex-start;
    }
}
@media (prefers-reduced-motion: reduce) {
    .person-company-panel,
    .person-company-expand,
    .person-filter-chip,
    .person-company-block {
        transition: none;
    }
}

.eyebrow {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.danger-btn {
    border: 1px solid #fecaca;
    background: #fff;
    color: var(--warn);
    font-weight: 600;
}
.danger-btn:hover { border-color: #fca5a5; background: var(--warn-soft); }

/* ════ Enterprise Profile ════ */
.enterprise-profile { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.profile-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.profile-main {
    grid-column: 1 / -1;
    background: linear-gradient(180deg, var(--surface) 0%, #fdfcf7 100%);
    border-color: var(--accent);
    border-left: 3px solid var(--accent);
}
.profile-card h3 { margin: 4px 0 14px; font-size: 19px; }

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 10px;
}
.profile-grid div {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
}
.profile-grid span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.02em; }
.profile-grid strong { line-height: 1.5; }

/* ════ Action row ════ */
.action-row {
    padding: 10px 18px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
}

.text-danger {
    height: auto; padding: 0;
    border: 0; background: transparent;
    color: var(--warn); font-weight: 700;
    font-size: 13px;
}
.text-danger:hover { background: transparent; color: #991b1b; text-decoration: underline; }

.table-actions { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.table-actions--stack {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    min-width: 92px;
}

.action-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}
.action-chip:disabled { opacity: 0.65; cursor: wait; }
.action-chip--muted {
    background: #fff;
    border-color: #e2e8f0;
    color: #64748b;
}
.action-chip--muted:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
}
.action-chip--edit {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
}
.action-chip--edit:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}
.action-chip--danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}
.action-chip--danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}
.action-chip--upload {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #2563eb;
    color: #fff;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.22);
}
.action-chip--upload:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.company-summary-table .table-actions--stack {
    padding: 2px 0;
}
.admin-company-card__actions.table-actions--stack {
    margin-top: 4px;
}

.tiny-btn {
    height: 28px; padding: 0 10px;
    border-color: var(--line);
    color: var(--text);
    font-size: 12px; font-weight: 600;
}
.tiny-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.tiny-btn.danger { border-color: #fecaca; color: var(--warn); }
.tiny-btn.danger:hover { background: var(--warn-soft); }
.tiny-btn.upload-server { border-color: #93c5fd; color: #2563eb; white-space: nowrap; }
.tiny-btn.upload-server:hover { background: #eff6ff; border-color: #60a5fa; }
.tiny-btn.upload-server:disabled { opacity: 0.6; cursor: wait; }

/* ════ Lists ════ */
.list { display: grid; }
.item {
    padding: 13px 18px;
    border-bottom: 1px solid var(--line);
    transition: background 0.12s;
}
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--surface-soft); }
.item strong { display: block; font-size: 14px; line-height: 1.5; }
.item .muted { margin-top: 5px; font-size: 12px; }

/* ════ Tables ════ */
.table-wrap {
    width: 100%;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
table { width: 100%; min-width: 800px; border-collapse: collapse; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; font-size: 13px; }
th {
    position: sticky; top: 0;
    background: var(--surface-soft);
    color: var(--muted);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
tbody tr { transition: background 0.1s; }
tbody tr:nth-child(even) { background: rgba(247,245,241,0.5); }
tbody tr:hover { background: var(--accent-soft); }
tbody tr:last-child td { border-bottom: 0; }

.qual-names-brief {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    line-height: 1.45;
}
.company-summary-wrap {
    overflow-x: auto;
}
.company-summary-table {
    table-layout: fixed;
    width: 100%;
    min-width: 980px;
}
.company-summary-table th,
.company-summary-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}
.company-summary-table .col-company {
    max-width: 15%;
}
.company-summary-table .col-names {
    width: 16%;
    max-width: 16%;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    vertical-align: top;
}
.company-summary-table .col-names .qual-names-compact {
    max-width: 100%;
}
.company-summary-table .qual-names-compact--company {
    max-width: 100%;
    padding: 2px 0;
}
.company-summary-table .qual-names-text--wrap {
    -webkit-line-clamp: 3;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}
.company-summary-table .qual-names-open {
    margin-top: 2px;
}
.qual-names-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    max-width: 560px;
    line-height: 1.5;
}
.qual-names-compact {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    max-width: 280px;
}
.qual-names-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text);
    word-break: break-all;
}
.qual-names-more {
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
}
.qual-names-open {
    border: 0;
    padding: 0;
    background: none;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.qual-names-open:hover {
    color: var(--accent);
    text-decoration: underline;
}
.cell-ellipsis {
    cursor: default;
}
table.qual-table {
    min-width: 920px;
}
.qual-table td {
    vertical-align: middle;
}
.qual-table td.col-names {
    white-space: normal;
    width: 280px;
    max-width: 280px;
}
.qual-table th.col-company,
.qual-table td.col-company {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 168px;
    min-width: 168px;
    max-width: 168px;
    white-space: normal;
    word-break: break-all;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--line);
}
.qual-table th.col-actions,
.qual-table td.col-actions {
    position: sticky;
    left: 168px;
    z-index: 2;
    white-space: nowrap !important;
    width: 128px;
    min-width: 128px;
    max-width: 128px;
    text-align: center;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--line);
}
.qual-table thead th.col-company,
.qual-table thead th.col-actions {
    z-index: 4;
    background: var(--surface-soft);
}
.qual-table tbody tr:nth-child(even) td.col-company,
.qual-table tbody tr:nth-child(even) td.col-actions {
    background: #faf9f7;
}
.qual-table tbody tr:hover td.col-company,
.qual-table tbody tr:hover td.col-actions {
    background: var(--accent-soft);
}
.qual-name-tag {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    cursor: default;
}
.qual-name-link {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--text);
    font-size: 12px;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.qual-name-link:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
    text-decoration: none;
}
.qual-name-tag:not(:last-child)::after {
    content: none;
}
.qual-row-actions {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 54px;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    writing-mode: horizontal-tb;
    word-break: keep-all;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.action-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}
.action-btn--danger {
    border-color: #fecaca;
    color: var(--warn);
    background: #fffafa;
}
.action-btn--danger:hover {
    border-color: #fca5a5;
    background: var(--warn-soft);
    color: #991b1b;
}
.qual-group-modal {
    width: min(640px, 92vw);
    max-height: 86vh;
    overflow: auto;
}
.qual-group-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    padding: 0 20px 16px;
    border-bottom: 1px solid var(--line);
}
.qual-group-summary span {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 2px;
}
.qual-group-summary strong {
    font-size: 13px;
    font-weight: 600;
    word-break: break-all;
}
.qual-group-list-head {
    padding: 14px 20px 8px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
}
.qual-group-list {
    padding: 0 20px 12px;
    max-height: 320px;
    overflow-y: auto;
}
.qual-group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.qual-group-item:last-child {
    border-bottom: 0;
}
.qual-group-item-name {
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-all;
}

a { color: var(--primary); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; color: var(--accent); }

/* ════ Badges ════ */
.badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--success-soft);
    color: var(--success);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.badge.warn {
    background: var(--warn-soft);
    color: var(--warn);
}

/* ════ Tabs ════ */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }

.tab {
    height: 32px; padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}
.tab:hover { color: var(--text); border-color: var(--line-strong); }
.tab.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

/* ════ Audit ════ */
.audit-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fff 0%, var(--surface-soft) 100%);
}

.audit-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.audit-stat {
    min-width: 72px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--line);
}
.audit-stat span {
    display: block;
    color: var(--muted);
    font-size: 11px;
}
.audit-stat strong {
    display: block;
    margin-top: 2px;
    font-size: 18px;
    line-height: 1.2;
}
.audit-stat.pending strong { color: #b45309; }
.audit-stat.passed strong { color: var(--success); }
.audit-stat.rejected strong { color: var(--warn); }

.audit-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.audit-filter {
    height: 34px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.audit-filter:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.audit-filter.active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

.audit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 14px;
}

.audit-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    transition: box-shadow 0.15s, border-color 0.15s;
}
.audit-card.is-pending {
    border-color: #fcd34d;
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.15);
}
.audit-card:hover { box-shadow: var(--shadow); }

.audit-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.audit-category {
    color: var(--primary);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.02em;
}

.audit-status {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: var(--surface-soft);
    color: var(--muted);
}
.audit-status.pending {
    background: #fff7ed;
    color: #b45309;
}
.audit-status.passed {
    background: var(--success-soft);
    color: var(--success);
}
.audit-status.rejected {
    background: var(--warn-soft);
    color: var(--warn);
}

.audit-card h3 { margin: 10px 0 8px; font-size: 16px; line-height: 1.45; }

.audit-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    color: var(--muted);
    font-size: 12px;
}
.audit-meta b {
    display: block;
    margin-bottom: 2px;
    color: #94a3b8;
    font-weight: 600;
    font-size: 11px;
}

.audit-remark {
    margin-top: 10px;
    padding: 10px 14px;
    color: var(--text);
    background: var(--surface-soft);
    border-radius: var(--radius-sm);
    line-height: 1.65;
    font-size: 13px;
}

.audit-actions {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.audit-btn { height: 32px; font-size: 13px; min-width: 72px; }

.audit-btn.pass {
    border-color: var(--success);
    color: var(--success);
    font-weight: 600;
}
.audit-btn.pass:hover { background: var(--success-soft); }

.audit-btn.reject {
    border-color: #fecaca;
    color: var(--warn);
    font-weight: 600;
}
.audit-btn.reject:hover { background: var(--warn-soft); }

.audit-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
}
.audit-note.done { color: var(--text); font-weight: 500; }

.audit-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
}
.audit-dot.pending {
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.audit-empty { margin-top: 8px; }

.captcha-prompt {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
}

.captcha-prompt-box {
    width: min(320px, 92vw);
    padding: 18px;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    display: grid;
    gap: 12px;
}

.captcha-img {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #f8fafc;
}

.captcha-prompt-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.verify-photo-preview {
    grid-column: 1 / -1;
    padding: 10px;
    border: 1px dashed var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
}
.verify-photo-preview img {
    display: block;
    max-width: 180px;
    margin-top: 8px;
    border-radius: 4px;
}

/* ════ Forms ════ */
.form-card {
    max-width: 640px;
    padding: 18px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}
.form-card input { width: 100%; }

.audit-submit-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(200px, 1fr));
    gap: 14px;
}
.audit-submit-form label { display: grid; gap: 6px; }
.audit-submit-form span { color: var(--muted); font-weight: 600; font-size: 13px; }
.form-wide { grid-column: 1 / -1; }
.audit-submit-form button { width: max-content; justify-self: end; }

.inline-audit-form {
    padding: 12px 14px;
    display: grid;
    grid-template-columns: auto 140px minmax(160px, 1fr) minmax(200px, 1.4fr) auto;
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
}
.inline-audit-form strong { white-space: nowrap; font-size: 13px; }

/* ════ Settings ════ */
.setting-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 320px));
    gap: 14px;
}
.setting-grid label {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

/* ════ Empty state ════ */
.empty {
    padding: 32px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    font-size: 13px;
}

/* ════ Toast ════ */
.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: none;
    max-width: 360px;
    padding: 12px 18px;
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    z-index: 50;
    font-size: 13px;
    font-weight: 500;
    animation: toastIn 0.25s ease;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ════ Modal ════ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    padding: 24px;
    display: grid;
    place-items: center;
    background: rgba(15,23,41,0.55);
    backdrop-filter: blur(3px);
    animation: fadeIn 0.18s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    width: min(680px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(-16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 18px; }
.icon-close { height: 32px; width: 32px; padding: 0; }

.modal-grid {
    padding-top: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(200px, 1fr));
    gap: 14px;
}
.modal-grid label { display: grid; gap: 6px; }
.modal-grid span { color: var(--muted); font-weight: 600; font-size: 13px; }
.inline-captcha-preview {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}
.inline-captcha-preview img {
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 4px;
}
.inline-captcha-preview span {
    font-size: 12px;
    color: var(--muted);
}

.tabs-sub {
    margin-top: -8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 6px;
}
.tab-sub {
    font-size: 12px;
    padding: 6px 12px;
}

.modal-grid .field-hint {
    grid-column: 1 / -1;
    margin-top: -2px;
    font-size: 12px;
    font-weight: 400;
    color: var(--accent);
}

.modal-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ════ Muted text ════ */
.muted { margin-top: 8px; line-height: 1.7; font-size: 13px; color: var(--muted); }

/* ════ Responsive ════ */
@media (max-width: 1080px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-side { min-height: 280px; }
    .stats { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
}

@media (max-width: 980px) {
    .topbar { height: auto; padding: 12px 16px; align-items: flex-start; gap: 10px; flex-direction: column; }
    .layout { grid-template-columns: 1fr; }
    .sidebar {
        display: flex;
        gap: 6px;
        overflow: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding: 8px 10px;
    }
    .side-profile, .side-title { display: none; }
    .nav { width: auto; white-space: nowrap; }
    .split, .setting-grid, .admin-layout, .admin-hub, .audit-grid,
    .admin-summary, .admin-kpi-row, .enterprise-profile, .profile-grid { grid-template-columns: 1fr; }
    .admin-detail-head, .admin-workspace__hero, .admin-company-panel__head { align-items: flex-start; flex-direction: column; }
    .admin-rail { position: static; max-height: none; }
    .admin-card-list { max-height: none; }
}

@media (max-width: 640px) {
    .login-view { padding: 16px; }
    .login-side, .login-card { padding: 24px; }
    .login-metrics, .stats { grid-template-columns: 1fr; }
    .login-note { flex-direction: column; }
    .workspace { padding: 14px; }
    .toolbar, .search-group, .topbar-actions,
    .form-card, .inline-audit-form, .modal-grid {
        align-items: stretch;
        flex-direction: column;
        grid-template-columns: 1fr;
    }
    .search-group { min-width: 0; }
    .search-group input { width: 100%; max-width: none; }
    .audit-submit-form { grid-template-columns: 1fr; }
    .audit-submit-form button { width: 100%; }
}

/* ------------------------------------------------------------------
   Detail polish layer
   Keeps existing behavior and selectors intact, only refines layout.
------------------------------------------------------------------- */
:root {
    --ink: #172033;
    --ink-soft: #283449;
    --nav-bg: #172033;
    --nav-text: #b8c2d2;
    --nav-hover: rgba(255,255,255,0.075);
    --nav-active-bg: #eef4ff;
    --nav-active-text: #193760;

    --bg: #f6f7f9;
    --bg-grid: transparent;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --surface-warm: #fff8f0;

    --line: #e5e9f0;
    --line-strong: #cfd7e3;
    --text: #202735;
    --muted: #6f7a8a;

    --primary: #28527a;
    --primary-soft: #edf4fb;
    --primary-light: #edf4fb;
    --accent: #c7662d;
    --accent-hover: #aa5524;
    --accent-soft: #fff2e8;
    --success: #14796d;
    --success-soft: #eaf7f4;
    --warn: #b42318;
    --warn-soft: #fff1f0;

    --shadow-sm: 0 1px 2px rgba(26,36,54,0.04);
    --shadow: 0 8px 22px rgba(26,36,54,0.07);
    --shadow-lg: 0 18px 46px rgba(26,36,54,0.12);
    --radius: 8px;
    --radius-sm: 6px;
}

html {
    background: var(--bg);
    text-rendering: optimizeLegibility;
}

body {
    background: var(--bg);
    color: var(--text);
    letter-spacing: 0;
}

body::before {
    display: none;
}

h1, h2, h3,
button,
.side-title,
.stat strong,
th {
    letter-spacing: 0;
}

button,
input,
select,
textarea {
    border-radius: var(--radius-sm);
}

button {
    min-height: 36px;
    height: auto;
    padding: 8px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-color: var(--line);
    background: #fff;
    box-shadow: 0 1px 0 rgba(26,36,54,0.03);
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26,36,54,0.08);
}

button:active {
    transform: translateY(0);
    box-shadow: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.nav:focus-visible,
.login-tab:focus-visible {
    outline: 3px solid rgba(40,82,122,0.16);
    outline-offset: 2px;
}

.primary {
    background: linear-gradient(180deg, #d3733a 0%, var(--accent) 100%);
    border-color: #bd5f29;
    box-shadow: 0 6px 16px rgba(199,102,45,0.18);
}

.primary:hover {
    background: linear-gradient(180deg, #bd632e 0%, var(--accent-hover) 100%);
    box-shadow: 0 8px 18px rgba(199,102,45,0.22);
}

input,
select,
textarea {
    min-height: 40px;
    border-color: var(--line);
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(26,36,54,0.02);
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(40,82,122,0.12);
}

.login-view {
    padding: 28px;
    background:
        linear-gradient(180deg, #f9fafc 0%, #f2f5f8 100%);
}

.login-shell {
    width: min(900px, 100%);
    min-height: 500px;
    grid-template-columns: minmax(300px, 0.86fr) minmax(360px, 1fr);
    border-radius: 8px;
}

.login-side {
    padding: 40px;
    background: #1f3147;
}

.login-side::before,
.login-side::after {
    display: none;
}

.login-side h1 {
    margin-top: 24px;
    font-size: 24px;
    line-height: 1.32;
}

.login-side p {
    color: rgba(255,255,255,0.72);
}

.login-features {
    gap: 8px;
}

.login-features li {
    padding: 9px 12px;
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
}

.login-card {
    padding: 38px 40px;
}

.login-tabs {
    padding: 4px;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.login-tab {
    min-height: 34px;
    height: auto;
    padding: 7px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    box-shadow: none;
}

.login-tab:hover {
    transform: none;
    box-shadow: none;
    background: #fff;
}

.login-tab.active,
.login-tab-dev.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 1px 6px rgba(26,36,54,0.08);
}

.login-submit-dev {
    background: linear-gradient(180deg, #3d6490 0%, var(--primary) 100%) !important;
    border-color: var(--primary) !important;
}

.role-badge-dev,
.login-note-dev span:first-child {
    color: var(--primary);
}

.role-badge-dev {
    background: var(--primary-soft);
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--primary);
}

.topbar {
    height: 60px;
    padding: 0 22px;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(10px);
}

.brand {
    min-width: 0;
}

.brand .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 16px;
}

.brand h1 {
    font-size: 17px;
    line-height: 1.25;
}

.brand p {
    color: #7b8493;
}

.topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.current-context {
    min-height: 34px;
    padding: 6px 12px;
    max-width: 420px;
    background: #fff;
}

.crawler-status {
    min-height: 26px;
    border-radius: 999px;
}

.layout {
    grid-template-columns: 212px minmax(0, 1fr);
}

.sidebar {
    padding: 14px 10px;
    background: var(--nav-bg);
}

.side-profile {
    padding: 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.055);
}

.side-title {
    padding-left: 10px;
    color: #7f91ab;
}

.nav {
    min-height: 36px;
    margin-bottom: 3px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    border-radius: 6px;
}

.nav:hover {
    transform: none;
    box-shadow: none;
}

.nav.active {
    background: var(--nav-active-bg);
    color: var(--nav-active-text);
    box-shadow: none;
}

.workspace {
    max-width: 1480px;
    width: 100%;
    padding: 20px;
}

.toolbar,
.panel,
.section-block,
.stat,
.table-wrap,
.audit-toolbar,
.audit-card,
.form-card,
.setting-grid label,
.admin-rail,
.admin-card,
.admin-workspace__hero,
.admin-kpi,
.admin-company-panel,
.admin-company-card,
.profile-card,
.person-company-block,
.person-content-card {
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.toolbar {
    grid-template-columns: minmax(220px, 1fr) minmax(320px, 520px) auto;
    padding: 12px 14px;
    gap: 12px;
    background: #fff;
}

.toolbar-title strong {
    font-size: 15px;
}

.search-group {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
}

.search-group input {
    width: 100%;
    max-width: none;
}

.panel {
    padding: 18px;
}

.panel-head {
    margin-bottom: 14px;
    padding-bottom: 12px;
}

.panel-head h2 {
    font-size: 18px;
}

.stats {
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 10px;
}

.stat {
    min-height: 82px;
    padding: 14px 16px;
    background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
}

.stat::after {
    right: 12px;
    top: 14px;
    width: 8px;
    height: 38px;
    border-radius: 999px;
    background: var(--accent);
    opacity: 0.18;
}

.stat strong {
    margin-top: 8px;
    font-size: 28px;
}

.split {
    gap: 12px;
}

.section-title {
    padding: 11px 14px;
    background: #fbfcfe;
}

.list .item,
.item {
    padding: 12px 14px;
}

.action-row,
.admin-actions,
.admin-company-card__actions,
.table-actions,
.modal-actions,
.audit-actions,
.captcha-prompt-actions {
    gap: 8px;
    flex-wrap: wrap;
}

.table-wrap {
    border-color: var(--line);
}

table {
    min-width: 860px;
}

th,
td {
    padding: 10px 12px;
    vertical-align: middle;
}

th {
    background: #f8fafc;
    color: #667386;
    text-transform: none;
}

tbody tr:nth-child(even) {
    background: #fbfcfe;
}

tbody tr:hover {
    background: #fff8f1;
}

.badge,
.audit-status,
.admin-status,
.admin-count-badge,
.admin-company-badge,
.qual-name-link,
.audit-filter,
.person-filter-chip {
    border-radius: 999px;
}

.tiny-btn,
.action-btn,
.audit-btn,
.danger-btn {
    min-height: 30px;
    padding: 6px 10px;
}

.action-btn {
    border-radius: 6px;
}

.danger-btn,
.tiny-btn.danger,
.action-btn--danger {
    background: #fff;
    border-color: #ffd4d0;
    color: var(--warn);
}

.danger-btn:hover,
.tiny-btn.danger:hover,
.action-btn--danger:hover {
    background: var(--warn-soft);
    border-color: #ffb8b0;
}

.admin-hub {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 14px;
}

.admin-rail {
    top: 74px;
    padding: 12px;
}

.admin-card {
    padding: 12px;
}

.admin-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--primary);
}

.admin-card:hover,
.audit-card:hover,
.admin-company-card:hover,
.person-company-block:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.admin-card.active {
    background: #f4f8fd;
    box-shadow: 0 0 0 1px rgba(40,82,122,0.12);
}

.admin-workspace__hero {
    padding: 16px;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.eyebrow {
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
}

.admin-kpi-row {
    gap: 10px;
}

.admin-kpi {
    padding: 12px;
    background: #fff;
}

.admin-company-grid,
.profile-grid {
    gap: 10px;
}

.admin-company-card,
.profile-card {
    padding: 14px;
    background: #fff;
}

.enterprise-profile {
    gap: 12px;
}

.person-filter-board {
    padding: 12px 14px;
    border: none;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: #fbfcfe;
}

.person-filter-grid,
.person-filter-main,
.person-filter-sub {
    gap: 8px;
}

.person-company-list,
.admin-grouped-page {
    gap: 12px;
}

.person-company-toggle {
    border-radius: 8px 8px 0 0;
}

.person-company-panel__inner {
    padding: 0;
}

.person-content-card {
    padding: 0 14px 14px;
}

.audit-toolbar {
    padding: 12px;
    background: #fbfcfe;
}

.audit-grid {
    gap: 12px;
}

.audit-card {
    padding: 16px;
}

.audit-card.is-pending {
    border-color: #f4c866;
    box-shadow: 0 0 0 1px rgba(244,200,102,0.18);
}

.audit-meta {
    gap: 8px 10px;
}

.audit-remark {
    border: 1px solid var(--line);
    background: #fbfcfe;
}

.form-card {
    max-width: 720px;
    background: #fbfcfe;
}

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

#settings .panel-head + .setting-grid + div {
    flex-wrap: wrap;
}

.empty {
    padding: 28px;
    border-radius: 8px;
    background: #fbfcfe;
}

.modal-backdrop {
    background: rgba(20,29,43,0.48);
}

.modal,
.captcha-prompt-box {
    border-radius: 8px;
}

.modal {
    padding: 20px;
}

.modal-grid {
    gap: 12px;
}

.toast {
    border-radius: 8px;
    background: #172033;
}

@media (max-width: 1180px) {
    .toolbar {
        grid-template-columns: 1fr;
    }

    .search-group {
        grid-template-columns: minmax(0, 1fr) auto;
    }

}

@media (max-width: 980px) {
    .topbar {
        padding: 12px 16px;
    }

    .topbar-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .current-context {
        max-width: 100%;
    }

    .layout {
        min-height: auto;
    }

    .sidebar {
        background: #fff;
        color: var(--text);
    }

    .nav {
        color: var(--muted);
        border: 1px solid var(--line);
        background: #fff;
    }

    .nav.active {
        border-color: #bfd0e6;
    }

    .admin-hub,
    .audit-grid,
    .split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .login-view {
        padding: 14px;
    }

    .login-shell {
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .login-side {
        padding: 24px;
    }

    .login-card {
        padding: 24px;
    }

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

    .brand h1 {
        font-size: 16px;
    }

    .workspace {
        padding: 12px;
    }

    .panel {
        padding: 14px;
    }

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

    .search-group,
    .form-card,
    .inline-audit-form,
    .modal-grid,
    .audit-submit-form {
        grid-template-columns: 1fr;
    }

    .search-group button,
    .toolbar > button,
    .form-card button,
    .modal-actions button,
    .captcha-prompt-actions button {
        width: 100%;
    }

    .modal-backdrop {
        padding: 12px;
    }

    .modal {
        max-height: calc(100vh - 24px);
    }
}

/* Final visual guardrails against older decorative rules. */
* {
    letter-spacing: 0 !important;
}

.admin-workspace__hero {
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%) !important;
}

.login-view {
    background: linear-gradient(180deg, #f9fafc 0%, #f2f5f8 100%) !important;
}

.admin-group-body .table-wrap,
.person-admin-avatar,
.person-company-expand,
.person-add-btn,
.person-company-icon {
    border-radius: 8px;
}
