:root {
    --app-bg: #f3f6f8;
    --app-text: #263238;
    --app-primary: #126e82;
    --app-accent: #d28b17;
    --app-border: #dce4e8;
}

body {
    background: var(--app-bg);
    color: var(--app-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.btn-primary {
    --bs-btn-bg: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: color-mix(in srgb, var(--app-primary) 84%, #000);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--app-primary) 84%, #000);
}

.btn-outline-primary {
    --bs-btn-color: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: var(--app-primary);
    --bs-btn-hover-border-color: var(--app-primary);
}

.form-control:focus,
.form-check-input:focus,
.btn:focus-visible,
a:focus-visible {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 0.25rem rgba(18, 110, 130, 0.2);
    outline: 0;
}

.text-primary {
    color: var(--app-primary) !important;
}

.app-card {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 1.25rem;
    box-shadow: 0 1rem 3rem rgba(38, 50, 56, 0.08);
}

.brand-mark {
    align-items: center;
    background: var(--app-primary);
    border-radius: 1rem;
    color: #fff;
    display: inline-flex;
    font-size: 1.5rem;
    height: 3.5rem;
    justify-content: center;
    width: 3.5rem;
}

.navbar-brand-mark {
    align-items: center;
    background: var(--app-primary);
    border-radius: 0.5rem;
    color: #fff;
    display: inline-flex;
    height: 2rem;
    justify-content: center;
    width: 2rem;
}

.navbar-brand-logo {
    height: 2.25rem;
    max-width: 8rem;
    object-fit: contain;
}

.site-footer {
    background: #fff;
    border-top: 1px solid var(--app-border);
}

.site-footer a {
    color: inherit;
    text-decoration: none;
}

.site-footer a:hover { color: var(--app-primary); }

.public-hero {
    background: radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--app-accent) 16%, transparent), transparent 28%), linear-gradient(145deg, #fff 0%, #eef6f7 100%);
}

.public-hero-logo { max-height: 5rem; max-width: 15rem; object-fit: contain; }
.public-hero-mark { height: 5rem; width: 5rem; font-size: 2rem; }
.public-eyebrow { color: var(--app-primary); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.public-quick-card { border-top: .3rem solid var(--app-accent); }
.public-feature { align-items: center; display: flex; gap: 1rem; }
.public-feature + .public-feature { border-top: 1px solid var(--app-border); margin-top: 1rem; padding-top: 1rem; }
.public-feature > span { align-items: center; background: color-mix(in srgb, var(--app-primary) 12%, #fff); border-radius: .8rem; color: var(--app-primary); display: inline-flex; flex: 0 0 2.8rem; height: 2.8rem; justify-content: center; }
.public-feature strong, .public-feature small { display: block; }
.public-feature small { color: #6c757d; margin-top: .15rem; }

.status-item {
    align-items: center;
    background: #f8fafb;
    border: 1px solid var(--app-border);
    border-radius: 0.75rem;
    display: flex;
    font-weight: 600;
    gap: 0.625rem;
    min-height: 3rem;
    padding: 0.75rem 1rem;
}

.login-notice {
    align-items: flex-start;
    background: #eef8fa;
    border: 1px solid #c8e3e8;
    border-radius: 1rem;
    display: flex;
    gap: 0.875rem;
    padding: 1rem;
}

.login-notice-icon {
    align-items: center;
    background: #d6eef2;
    border-radius: 50%;
    color: var(--app-primary);
    display: inline-flex;
    flex: 0 0 2.25rem;
    font-size: 1.05rem;
    height: 2.25rem;
    justify-content: center;
}

.login-notice-title {
    color: #174b56;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
}

.login-notice-step {
    align-items: flex-start;
    display: flex;
    gap: 0.625rem;
}

.login-notice-step + .login-notice-step {
    border-top: 1px solid #d6e9ed;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
}

.login-notice-step p {
    color: #45636a;
    font-size: 0.875rem;
    line-height: 1.45;
    margin: 0;
}

.login-notice-number {
    align-items: center;
    background: var(--app-primary);
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    flex: 0 0 1.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    height: 1.4rem;
    justify-content: center;
    margin-top: 0.05rem;
}

.admin-navigation {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 1.25rem;
    box-shadow: 0 1rem 3rem rgba(38, 50, 56, 0.07);
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    padding: 1rem;
}

.admin-navigation-group {
    background: #f7f9fa;
    border: 1px solid #e7edef;
    border-radius: 0.95rem;
    min-width: 0;
    padding: 0.8rem;
}

.admin-navigation-title {
    align-items: center;
    color: #52646a;
    display: flex;
    font-size: 0.78rem;
    font-weight: 800;
    gap: 0.5rem;
    letter-spacing: 0.055em;
    margin: 0 0 0.7rem;
    padding: 0 0.2rem;
    text-transform: uppercase;
}

.admin-navigation-title-icon {
    align-items: center;
    background: #e5f2f4;
    border-radius: 0.45rem;
    color: var(--app-primary);
    display: inline-flex;
    height: 1.7rem;
    justify-content: center;
    width: 1.7rem;
}

.admin-navigation-items {
    display: grid;
    gap: 0.4rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-navigation-link {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.65rem;
    color: #52646a;
    display: flex;
    font-size: 0.84rem;
    font-weight: 600;
    gap: 0.55rem;
    min-height: 2.75rem;
    min-width: 0;
    padding: 0.55rem 0.65rem;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.admin-navigation-link i {
    color: var(--app-primary);
    flex: 0 0 1rem;
    text-align: center;
}

.admin-navigation-link span {
    line-height: 1.2;
}

.admin-navigation-link:hover {
    background: #eaf4f6;
    border-color: #d5e7ea;
    color: #174b56;
}

.admin-navigation-link.active {
    background: var(--app-primary);
    border-color: var(--app-primary);
    color: #fff;
    box-shadow: 0 0.4rem 1rem rgba(18, 110, 130, 0.2);
}

.admin-navigation-link.active i {
    color: #fff;
}

.admin-dashboard-header {
    align-items: center;
    display: flex;
    gap: 1.5rem;
    justify-content: space-between;
}

.admin-dashboard-eyebrow {
    color: var(--app-primary);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.admin-dashboard-user {
    align-items: center;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 0.9rem;
    display: flex;
    flex: 0 0 auto;
    gap: 0.7rem;
    padding: 0.65rem 0.9rem;
}

.admin-dashboard-user-icon,
.dashboard-stat-icon {
    align-items: center;
    background: #e7f4f6;
    border-radius: 0.75rem;
    color: var(--app-primary);
    display: inline-flex;
    justify-content: center;
}

.admin-dashboard-user-icon {
    height: 2.4rem;
    width: 2.4rem;
}

.admin-dashboard-user span:last-child {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.admin-dashboard-user small {
    color: #74868c;
    font-size: 0.7rem;
}

.admin-dashboard-user strong {
    font-size: 0.9rem;
}

.dashboard-card {
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-card:has(.stretched-link):hover {
    box-shadow: 0 1.25rem 3.25rem rgba(38, 50, 56, 0.13);
    transform: translateY(-2px);
}

.dashboard-stat-card {
    overflow: hidden;
}

.dashboard-stat-card::after {
    background: var(--app-primary);
    border-radius: 50%;
    content: "";
    height: 7rem;
    opacity: 0.035;
    position: absolute;
    right: -2rem;
    top: -2.5rem;
    width: 7rem;
}

.dashboard-stat-icon {
    font-size: 1.1rem;
    height: 2.8rem;
    margin-bottom: 1rem;
    width: 2.8rem;
}

.dashboard-stat-value {
    font-size: 2.15rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.4rem;
}

.dashboard-stat-label {
    color: #66777c;
    font-size: 0.9rem;
    font-weight: 600;
}

@media (max-width: 991.98px) {
    .admin-navigation {
        grid-template-columns: 1fr;
    }

    .admin-navigation-items {
        grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
    }
}

@media (max-width: 575.98px) {
    .admin-navigation {
        border-radius: 1rem;
        padding: 0.7rem;
    }

    .admin-navigation-items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-navigation-link {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
        min-height: 4.2rem;
    }

    .admin-dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-dashboard-user {
        width: 100%;
    }
}

@media (max-width: 359.98px) {
    .admin-navigation-items {
        grid-template-columns: 1fr;
    }
}

.filter-panel {
    box-shadow: none;
}

.app-table thead th {
    background: #f7f9fa;
    border-bottom-color: var(--app-border);
    color: #66777c;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    padding: 0.85rem 1rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.table-sort-link {
    align-items: center;
    color: inherit;
    display: inline-flex;
    gap: 0.4rem;
    text-decoration: none;
}

.table-sort-link:hover,
.table-sort-link.active {
    color: var(--app-primary);
}

.app-table tbody td {
    border-color: #edf1f3;
    padding: 0.9rem 1rem;
}

.app-table tbody tr:last-child td {
    border-bottom: 0;
}

.empty-state {
    color: #74868c;
    padding: 3rem 1rem !important;
    text-align: center;
}

.empty-inline {
    background: #f7f9fa;
    border: 1px dashed #cbd6da;
    border-radius: 0.75rem;
    color: #687a80;
    padding: 1rem;
}

.audit-value-old {
    background: #fff4f2 !important;
    color: #b42318 !important;
    font-weight: 600;
}

.audit-value-new {
    background: #ecfdf3 !important;
    color: #067647 !important;
    font-weight: 600;
}

.owner-highlight {
    background: #f1f8f9;
    border-left: 4px solid var(--app-primary);
    border-radius: 0.65rem;
    padding: 1rem;
}

.detail-list {
    display: grid;
    gap: 0.25rem 1rem;
    grid-template-columns: minmax(7rem, 0.75fr) minmax(0, 1.25fr);
}

.detail-list dt,
.detail-list dd {
    border-bottom: 1px solid #edf1f3;
    margin: 0;
    padding: 0.65rem 0;
}

.detail-list dt {
    color: #74868c;
    font-weight: 500;
}

.detail-list dd {
    font-weight: 600;
}

@media (max-width: 575.98px) {
    .navbar .container {
        align-items: flex-start;
    }

    .navbar .ms-auto {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .detail-list {
        grid-template-columns: 1fr;
    }

    .detail-list dt {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .detail-list dd {
        padding-top: 0.2rem;
    }
}

.email-domain-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.email-domain-option {
    background: #f4f8f9;
    border: 1px solid #ccdade;
    border-radius: 999px;
    color: #45636a;
    font-size: 0.78rem;
    padding: 0.25rem 0.6rem;
}

.email-domain-option:hover {
    background: #e4f1f3;
    border-color: var(--app-primary);
    color: var(--app-primary);
}

.address-suggest-results {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 0.75rem;
    box-shadow: 0 0.75rem 2rem rgba(38, 50, 56, 0.14);
    left: 0;
    max-height: 18rem;
    overflow-y: auto;
    position: absolute;
    right: 0;
    top: calc(100% + 0.25rem);
    z-index: 20;
}

.address-suggest-option {
    background: #fff;
    border: 0;
    border-bottom: 1px solid #edf1f3;
    color: var(--app-text);
    display: block;
    padding: 0.7rem 0.85rem;
    text-align: left;
    width: 100%;
}

.address-suggest-option:hover,
.address-suggest-option:focus {
    background: #eef8fa;
    outline: 0;
}

.address-suggest-option:last-child {
    border-bottom: 0;
}

.settings-card {
    display: block;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.settings-card:hover {
    box-shadow: 0 1.25rem 3rem rgba(38, 50, 56, 0.13);
    transform: translateY(-3px);
}

.template-category-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.template-category-card .card-heading-icon {
    flex: 0 0 3rem;
}

.template-list-link > span {
    min-width: 0;
}

.template-list-link .small {
    display: block;
    overflow-wrap: anywhere;
}

.card-heading-icon,
.card-heading-icon-sm {
    align-items: center;
    background: #e7f4f6;
    border-radius: 0.8rem;
    color: var(--app-primary);
    display: inline-flex;
    justify-content: center;
}

.card-heading-icon {
    font-size: 1.25rem;
    height: 3rem;
    width: 3rem;
}

.card-heading-icon-sm {
    font-size: 0.9rem;
    height: 2rem;
    margin-right: 0.55rem;
    vertical-align: middle;
    width: 2rem;
}

.icon-action {
    align-items: center;
    display: inline-flex;
    height: 2rem;
    justify-content: center;
    padding: 0;
    width: 2rem;
}

.owner-indicators {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.status-indicator {
    align-items: center;
    cursor: help;
    display: inline-flex;
    font-size: 0.8rem;
    height: 1.8rem;
    justify-content: center;
    min-width: 1.8rem;
    padding: 0.3rem 0.45rem;
}

.status-indicator-monogram {
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.garage-link-chip {
    background: #eef8fa;
    border: 1px solid #cbe2e6;
    border-radius: 999px;
    color: var(--app-primary);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    text-decoration: none;
}

.garage-link-chip:hover {
    background: var(--app-primary);
    color: #fff;
}

.markdown-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.publication-card {
    transition: transform .15s ease, box-shadow .15s ease;
}

.publication-card:hover {
    box-shadow: 0 1rem 2rem rgba(22, 66, 75, .12);
    transform: translateY(-2px);
}

.publication-content {
    font-size: 1.02rem;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.publication-content img {
    height: auto;
    max-width: 100%;
}

.publication-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

.publication-content blockquote {
    border-left: .3rem solid var(--app-primary);
    color: #52646a;
    padding-left: 1rem;
}

.appeal-internal-message {
    background: #fff8db;
    border-color: #f0d36d;
}

.appeal-message-body {
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.consent-preview,
.consent-document {
    line-height: 1.7;
}

.consent-preview h2,
.consent-document h2 {
    color: #174b56;
}

.consent-change-old,
.consent-preview li > del,
.consent-document li > del,
.consent-content li > del {
    color: #dc3545;
    text-decoration: none;
}

.consent-change-new,
.consent-preview li > del ~ strong,
.consent-document li > del ~ strong,
.consent-content li > del ~ strong {
    color: #198754;
    font-weight: inherit;
}

.onboarding-page {
    background: radial-gradient(circle at top, #eef8fa 0, #f7f9fa 45%, transparent 75%);
    min-height: calc(100vh - 73px);
}

.consent-check {
    background: #f4f8f9;
    border: 1px solid #d6e3e6;
    border-radius: 0.8rem;
    padding: 1rem 1rem 1rem 2.6rem;
}

.consent-modal .modal-content {
    border: 0;
    border-radius: 1.25rem;
    box-shadow: 0 2rem 5rem rgba(20, 49, 56, 0.25);
    overflow: hidden;
}

.consent-modal-header {
    align-items: center;
    background: linear-gradient(135deg, #176778, #2095a7);
    color: #fff;
    gap: 1rem;
    padding: 1.35rem 1.5rem;
}

.modal-icon {
    align-items: center;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    display: inline-flex;
    font-size: 1.25rem;
    height: 3rem;
    justify-content: center;
    width: 3rem;
}
