:root {
    --navy: #10233f;
    --navy-2: #18365f;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --bg: #f3f6fa;
    --card: #ffffff;
    --text: #172033;
    --muted: #64748b;
    --line: #d9e2ec;
    --success: #0f766e;
    --warning: #b45309;
    --danger: #b91c1c;
    --radius: 8px;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
}

a {
    color: var(--blue-dark);
}

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: 2px;
}

.skip-link {
    background: #fff;
    border: 2px solid var(--blue);
    left: 1rem;
    padding: 0.5rem 0.75rem;
    position: absolute;
    top: -4rem;
    z-index: 10;
}

.skip-link:focus {
    top: 1rem;
}

.topbar {
    align-items: center;
    background: var(--navy);
    color: #fff;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1rem clamp(1rem, 3vw, 2rem);
}

.brand {
    display: grid;
    gap: 0.15rem;
}

.brand-title {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
}

.brand-subtitle {
    color: #cbd5e1;
    font-size: 0.86rem;
}

.user-panel {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: flex-end;
}

.user-name {
    font-weight: 600;
}

.role-badge,
.badge {
    background: #e0ecff;
    border-radius: 999px;
    color: #173b73;
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    text-transform: uppercase;
}

.main-nav {
    background: var(--navy-2);
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    padding: 0.45rem clamp(1rem, 3vw, 2rem);
}

.main-nav a {
    border-radius: 6px;
    color: #e2e8f0;
    padding: 0.45rem 0.7rem;
    text-decoration: none;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.content-shell {
    margin: 0 auto;
    max-width: 1280px;
    overflow-x: hidden;
    padding: 1.5rem clamp(1rem, 3vw, 2rem) 3rem;
}

.page-header {
    margin-bottom: 1.25rem;
}

.page-header h1,
h1 {
    font-size: clamp(1.65rem, 2.2vw, 2.15rem);
    line-height: 1.2;
    margin: 0 0 0.4rem;
}

h2 {
    font-size: 1.25rem;
    margin: 0 0 0.85rem;
}

h3 {
    font-size: 1.05rem;
    margin: 1rem 0 0.5rem;
}

.page-kicker,
.muted,
.empty-state {
    color: var(--muted);
}

.card,
section {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    padding: 1rem;
    overflow-x: auto;
}

.dashboard-grid,
.card-grid,
.summary-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.dashboard-section {
    margin-bottom: 1.5rem;
}

.dashboard-card {
    min-height: 100%;
}

.card-icon {
    align-items: center;
    background: #eaf1ff;
    border-radius: 8px;
    color: var(--blue-dark);
    display: inline-flex;
    font-size: 1.35rem;
    height: 2.4rem;
    justify-content: center;
    margin-bottom: 0.65rem;
    width: 2.4rem;
}

.actions,
.toolbar,
.page-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 1rem 0;
}

.button,
button,
input[type="submit"] {
    background: var(--blue);
    border: 1px solid var(--blue);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: inline-block;
    font: inherit;
    font-weight: 700;
    padding: 0.52rem 0.85rem;
    text-decoration: none;
}

.button:hover,
button:hover,
input[type="submit"]:hover {
    background: var(--blue-dark);
    border-color: var(--blue-dark);
}

.button-secondary,
.logout-form button {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.65);
    color: #fff;
}

.button-muted {
    background: #fff;
    border-color: var(--line);
    color: var(--text);
}

form {
    margin: 0;
}

.filter-form,
.form-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    padding: 1rem;
}

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

label {
    color: #334155;
    display: block;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

input,
select,
textarea {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font: inherit;
    max-width: 100%;
    padding: 0.5rem 0.6rem;
}

input[type="search"],
input[type="text"],
input[type="date"],
input[type="password"],
select,
textarea {
    width: 100%;
}

.table-wrap {
    overflow-x: auto;
    width: 100%;
}

table {
    border-collapse: collapse;
    margin: 0.75rem 0 1rem;
    min-width: 720px;
    width: 100%;
}

.content-shell > table,
.content-shell > form + table {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: block;
    overflow-x: auto;
}

th,
td {
    border: 1px solid var(--line);
    padding: 0.6rem 0.7rem;
    text-align: left;
    vertical-align: top;
}

th {
    background: #eef3f8;
    color: #334155;
    font-weight: 800;
}

tr:nth-child(even) td {
    background: #fbfdff;
}

dl {
    display: grid;
    gap: 0.45rem 1rem;
    grid-template-columns: minmax(130px, 220px) 1fr;
}

dt {
    color: var(--muted);
    font-weight: 800;
}

dd {
    margin: 0;
}

.summary-item,
.metric-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.85rem;
}

.summary-label {
    color: var(--muted);
    display: block;
    font-size: 0.86rem;
    font-weight: 800;
}

.summary-value {
    display: block;
    font-size: 1.28rem;
    font-weight: 800;
    margin-top: 0.25rem;
}

.messages,
.alert {
    margin-bottom: 1rem;
}

.alert,
[role="status"] {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    color: #1e3a8a;
    padding: 0.75rem 0.9rem;
}

.alert-success {
    background: #ecfdf5;
    border-color: #99f6e4;
    color: var(--success);
}

.alert-error,
.alert-danger,
.errorlist {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--danger);
}

.warning,
.alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: var(--warning);
}

.pagination {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    margin: 1rem 0;
}

.login-page {
    align-items: center;
    background: linear-gradient(180deg, var(--navy) 0, #122748 40%, var(--bg) 40%);
    display: flex;
    min-height: 100vh;
    padding: 1rem;
}

.login-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
    margin: 0 auto;
    max-width: 420px;
    padding: 1.5rem;
    width: 100%;
}

.login-title {
    color: var(--navy);
}

.login-notice {
    color: var(--muted);
    font-size: 0.93rem;
}

.group-row td,
.group-row {
    background: #eaf1ff;
    font-weight: 800;
}

@media (max-width: 760px) {
    .topbar,
    .user-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .main-nav {
        display: grid;
    }

    dl {
        grid-template-columns: 1fr;
    }

    table {
        min-width: 640px;
    }
}

@media print {
    .topbar,
    .main-nav,
    .skip-link,
    .logout-form,
    .page-actions {
        display: none;
    }

    body {
        background: #fff;
    }

    .content-shell,
    .card,
    section {
        box-shadow: none;
        max-width: none;
    }
}

.sr-only {
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.topbar {
    min-height: 72px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-primary {
    align-items: center;
    display: flex;
    gap: 0.85rem;
    min-width: 0;
}

.nav-toggle {
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.5);
    display: none;
    height: 2.5rem;
    justify-content: center;
    padding: 0;
    width: 2.5rem;
}

.nav-toggle-lines,
.nav-toggle-lines::before,
.nav-toggle-lines::after {
    background: #fff;
    border-radius: 999px;
    display: block;
    height: 2px;
    width: 1.1rem;
}

.nav-toggle-lines {
    position: relative;
}

.nav-toggle-lines::before,
.nav-toggle-lines::after {
    content: "";
    left: 0;
    position: absolute;
}

.nav-toggle-lines::before {
    top: -6px;
}

.nav-toggle-lines::after {
    top: 6px;
}

.header-clock {
    color: #dbeafe;
    font-size: 0.86rem;
    white-space: nowrap;
}

.user-identity {
    display: grid;
    gap: 0.05rem;
    text-align: right;
}

.workspace-label {
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 700;
}

.workspace-form {
    align-items: center;
    display: flex;
    gap: 0.4rem;
}

.workspace-control-group {
    align-items: center;
    display: flex;
    gap: 0.45rem;
}

.workspace-control-group label {
    color: #e2e8f0;
    margin: 0;
    white-space: nowrap;
}

.workspace-form select {
    background: #fff;
    min-height: 2.35rem;
    width: auto;
}

.workspace-submit,
.logout-form button {
    min-height: 2.35rem;
}

.app-body {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: calc(100vh - 72px);
}

.sidebar {
    background: #fff;
    border-right: 1px solid var(--line);
    overflow-y: auto;
    padding: 1rem;
}

.main-nav {
    background: transparent;
    display: grid;
    gap: 1rem;
    padding: 0;
}

.nav-section {
    background: transparent;
    border: 0;
    box-shadow: none;
    margin: 0;
    overflow: visible;
    padding: 0;
}

.nav-section-title {
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    margin: 0 0 0.35rem;
    text-transform: uppercase;
}

.nav-list {
    display: grid;
    gap: 0.18rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    border-radius: 6px;
    color: #17324d;
    display: block;
    font-weight: 700;
    min-height: 2.35rem;
    padding: 0.48rem 0.65rem;
    text-decoration: none;
}

.nav-link:visited {
    color: #17324d;
}

.nav-link:hover,
.nav-link:focus {
    background: #eef6ff;
    color: #0f2a44;
}

.nav-link.is-active {
    background: #dbeafe;
    color: #0f2a44;
    box-shadow: inset 3px 0 0 #2563eb;
}

.breadcrumbs {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.88rem;
    gap: 0.35rem;
    margin: 0 0 0.8rem;
}

.breadcrumbs a {
    color: #17324d;
    font-weight: 700;
    text-decoration: none;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--muted);
    content: "\203A";
    display: inline-block;
    margin: 0 0.35rem;
}

.breadcrumbs a:hover,
.breadcrumbs a:focus {
    color: var(--blue-dark);
    text-decoration: underline;
}

.app-body .content-shell {
    margin: 0;
    max-width: none;
    min-width: 0;
}

@media (max-width: 768px) {
    .topbar {
        align-items: stretch;
        gap: 0.75rem;
    }

    .topbar-primary {
        width: 100%;
    }

    .nav-toggle {
        display: inline-flex;
        flex: 0 0 auto;
    }

    .brand {
        min-width: 0;
    }

    .brand-subtitle {
        display: none;
    }

    .user-panel {
        align-items: stretch;
        width: 100%;
    }

    .user-identity {
        text-align: left;
    }

    .header-clock {
        white-space: normal;
    }

    .workspace-form {
        flex-wrap: wrap;
    }

    .workspace-control-group {
        align-items: stretch;
        flex-wrap: wrap;
        width: 100%;
    }

    .app-body {
        display: block;
    }

    .sidebar {
        border-bottom: 1px solid var(--line);
        border-right: 0;
        display: none;
        max-height: calc(100vh - 72px);
        position: sticky;
        top: 72px;
        z-index: 15;
    }

    .nav-open .sidebar {
        display: block;
    }
}

@media (max-width: 760px) {
    .topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .main-nav {
        display: grid;
    }
}

@media print {
    .sidebar,
    .nav-toggle,
    .header-clock,
    .workspace-form {
        display: none;
    }

    .app-body {
        display: block;
    }
}

/* Data model review console */
.review-console { display: grid; gap: 1rem; }
.review-header { align-items: start; display: flex; gap: 1rem; justify-content: space-between; }
.review-safety { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 6px; color: #7c2d12; margin: 0.75rem 0; padding: 0.75rem; }
.review-actions, .review-toolbar, .review-domain-nav { align-items: end; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.review-actions { justify-content: flex-end; }
.review-import-button { cursor: pointer; }
.review-summary-grid { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.review-summary-grid div { background: #f8fafc; border: 1px solid var(--border); border-radius: 6px; padding: 0.75rem; }
.review-summary-grid span { color: #17324d; display: block; font-size: 1.4rem; font-weight: 700; }
.review-summary-grid small { color: var(--muted); }
.review-toolbar label { display: grid; gap: 0.25rem; }
.review-toolbar input, .review-toolbar select { min-width: 14rem; }
.review-domain-nav button, .priority-card { background: #ffffff; border: 1px solid var(--border); border-radius: 6px; color: #17324d; cursor: pointer; padding: 0.55rem 0.7rem; }
.review-domain-nav span { color: var(--muted); margin-left: 0.25rem; }
.priority-grid { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.priority-card { display: grid; gap: 0.25rem; text-align: left; }
.priority-card span { color: #7c2d12; font-size: 0.78rem; font-weight: 700; }
.priority-card small { color: var(--muted); }
.review-panels { align-items: start; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); }
.review-models { display: grid; gap: 1rem; min-width: 0; }
.review-model-card, .review-side-panel section { background: #ffffff; border: 1px solid var(--border); border-radius: 6px; padding: 1rem; }
.review-model-card > header { align-items: start; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) minmax(240px, auto); }
.review-model-card dl { display: grid; gap: 0.35rem; margin: 0; }
.review-model-card dl div { display: flex; gap: 0.4rem; justify-content: space-between; }
.review-model-card dt { color: var(--muted); }
.review-model-decision { display: flex; gap: 0.5rem; margin: 0.75rem 0; }
.review-model-decision input { flex: 1; }
.review-table-wrap { max-width: 100%; overflow-x: auto; }
.review-field-table { font-size: 0.86rem; min-width: 1800px; }
.review-field-table th, .review-field-table td { vertical-align: top; }
.change-proposal { display: grid; gap: 0.3rem; margin-top: 0.35rem; }
.change-proposal input, .change-proposal select, .review-field-table textarea { width: 100%; }
.proposed-field-panel { margin-top: 1rem; }
.proposed-field-row { display: grid; gap: 0.4rem; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin-bottom: 0.5rem; }
.review-side-panel { display: grid; gap: 1rem; min-width: 0; position: sticky; top: 0.75rem; }
.relationship-map, .audit-source-list { display: grid; gap: 0.5rem; max-height: 540px; overflow: auto; }
.relationship-row { border-bottom: 1px solid var(--border); display: grid; gap: 0.2rem; padding: 0.45rem 0; }
.audit-source-list pre { background: #f8fafc; border: 1px solid var(--border); border-radius: 6px; max-height: 220px; overflow: auto; padding: 0.6rem; white-space: pre-wrap; }
@media (max-width: 980px) { .review-header, .review-model-card > header, .review-panels { grid-template-columns: 1fr; } .review-header { display: grid; } .review-side-panel { position: static; } }

/* Public Landing Page */
.landing-container {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    max-width: 1160px;
    margin: 1.5rem auto 2.5rem;
    padding: 0 1.25rem;
    box-sizing: border-box;
}

.hero-card {
    background: var(--card, #ffffff);
    border: 1px solid var(--line, #e2e8f0);
    border-radius: var(--radius, 12px);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    padding: clamp(1.75rem, 3.5vw, 2.5rem);
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 34% 66%;
    gap: 2.25rem;
    align-items: center;
}

@media (max-width: 880px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-card .page-kicker {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--blue-dark, #1e3a8a);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

.hero-card h1 {
    color: var(--navy, #0f172a);
    font-size: clamp(1.6rem, 2.5vw, 2.1rem);
    font-weight: 800;
    margin: 0 0 0.5rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.hero-intro {
    color: var(--muted, #64748b);
    font-size: clamp(0.95rem, 1.3vw, 1.05rem);
    margin: 0 0 1.25rem;
    line-height: 1.5;
}

.hero-media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: auto;
    border-radius: 10px;
    overflow: hidden;
}

@media (max-width: 880px) {
    .hero-media {
        min-height: 0;
        max-height: none;
    }
}

.hero-building-img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 10px;
    border: 1px solid var(--line, #e2e8f0);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.landing-login-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    width: 100%;
    max-width: 100%;
    margin-top: 0.25rem;
}

.landing-login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.landing-login-form label {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--navy, #0f172a);
}

.landing-login-form input[type="text"],
.landing-login-form input[type="password"] {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--line, #cbd5e1);
    border-radius: 6px;
    font-size: 0.95rem;
    box-sizing: border-box;
    background: #f8fafc;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.landing-login-form input[type="text"]:focus,
.landing-login-form input[type="password"]:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--blue, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.landing-login-form .form-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.35rem;
}

.landing-login-form .block-btn {
    width: 100%;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    background: var(--blue, #2563eb);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.landing-login-form .block-btn:hover {
    background: var(--blue-dark, #1e3a8a);
    transform: translateY(-1px);
}

.forgot-password-wrap {
    text-align: center;
    margin-top: 0.15rem;
}

.forgot-link {
    font-size: 0.88rem;
    color: var(--blue-dark, #1e3a8a);
    text-decoration: underline;
}

.forgot-link:hover {
    color: var(--blue, #2563eb);
}

/* Lower Section - 3 Compact Cards */
.landing-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(3, 1fr);
}

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

.info-card {
    background: var(--card, #ffffff);
    border: 1px solid var(--line, #e2e8f0);
    border-radius: var(--radius, 10px);
    box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,0.05));
    padding: 1.35rem 1.45rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.info-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.info-card h2 {
    color: var(--navy, #0f172a);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.info-card p {
    color: var(--text, #334155);
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 0;
}

.access-notice-card {
    background: #f8fafc;
    border: 1px solid var(--line, #e2e8f0);
    border-left: 4px solid var(--blue, #2563eb);
    border-radius: var(--radius, 8px);
    padding: 1.1rem 1.3rem;
}

.access-notice-card p {
    color: #334155;
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 0;
}

.landing-footer {
    text-align: center;
    padding-top: 0.25rem;
}

.landing-footer p {
    color: var(--muted, #64748b);
    font-size: 0.88rem;
    margin: 0;
}

