:root {
    --primary: #1f6f5b;
    --primary-rgb: 31, 111, 91;
    --bg: #f5f7fb;
    --bg-alt: #eef1f6;
    --surface: #ffffff;
    --surface-subtle: color-mix(in srgb, var(--surface) 94%, #0b1021 6%);
    --surface-strong: color-mix(in srgb, var(--surface) 86%, #0b1021 14%);
    --border: #e3e8ef;
    --muted: #6b7280;
    --text: color-mix(in srgb, var(--muted) 32%, #0b1324 68%);
    --text-muted: var(--muted);
    --primary-600: color-mix(in srgb, var(--primary) 82%, #0b1021 18%);
    --primary-100: color-mix(in srgb, var(--primary) 12%, #ffffff 88%);
    --sidebar-bg: color-mix(in srgb, var(--primary) 22%, #0b1021 78%);
    --focus-ring: rgba(var(--primary-rgb), 0.35);
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 0.9rem;
    --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 18px 48px rgba(15, 23, 42, 0.12);
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 78px;
    --content-padding: 32px;
    --skeleton: #e9edf3;
    --overlay: rgba(255, 255, 255, 0.7);
    --code-bg: color-mix(in srgb, var(--surface) 90%, #0b1021 10%);

    --bs-primary: var(--primary);
    --bs-primary-rgb: var(--primary-rgb);
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-border-color: var(--border);
    --bs-card-bg: var(--surface);
    --bs-card-border-color: var(--border);
    --bs-card-cap-bg: var(--surface-subtle);
    --bs-dropdown-bg: var(--surface);
    --bs-dropdown-link-color: var(--text);
    --bs-dropdown-link-hover-bg: rgba(var(--primary-rgb), 0.08);
    --bs-dropdown-link-hover-color: var(--text);
    --bs-dropdown-border-color: var(--border);
    --bs-navbar-bg: var(--surface);
    --bs-offcanvas-bg: var(--surface);
    --bs-modal-bg: var(--surface);
    --bs-modal-border-color: var(--border);
    --bs-table-bg: var(--surface);
    --bs-table-border-color: var(--border);
    --bs-secondary-bg: var(--surface-subtle);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --primary: #62d3b3;
    --primary-rgb: 98, 211, 179;
    --bg: #0c1324;
    --bg-alt: #0f1b2f;
    --surface: #111a2e;
    --surface-subtle: color-mix(in srgb, var(--surface) 90%, #ffffff 10%);
    --surface-strong: color-mix(in srgb, var(--surface) 84%, #ffffff 16%);
    --border: #1f2a44;
    --muted: #9ca3af;
    --text: #e7edf6;
    --text-muted: #9ca3af;
    --primary-600: color-mix(in srgb, var(--primary) 76%, #0b1021 24%);
    --primary-100: color-mix(in srgb, var(--primary) 18%, #ffffff 82%);
    --sidebar-bg: color-mix(in srgb, var(--primary) 24%, #070d1a 76%);
    --focus-ring: rgba(var(--primary-rgb), 0.45);
    --shadow: 0 18px 38px rgba(0, 0, 0, 0.45);
    --shadow-soft: 0 20px 52px rgba(0, 0, 0, 0.55);
    --overlay: rgba(12, 18, 31, 0.7);
    --code-bg: #0f172a;
    --skeleton: #1f2937;

    --bs-primary: var(--primary);
    --bs-primary-rgb: var(--primary-rgb);
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-border-color: var(--border);
    --bs-card-bg: var(--surface);
    --bs-card-border-color: var(--border);
    --bs-card-cap-bg: var(--surface-subtle);
    --bs-dropdown-bg: var(--surface);
    --bs-dropdown-link-color: var(--text);
    --bs-dropdown-link-hover-bg: rgba(var(--primary-rgb), 0.16);
    --bs-dropdown-link-hover-color: var(--text);
    --bs-dropdown-border-color: var(--border);
    --bs-navbar-bg: var(--surface);
    --bs-offcanvas-bg: var(--surface);
    --bs-modal-bg: var(--surface);
    --bs-modal-border-color: var(--border);
    --bs-table-bg: var(--surface);
    --bs-table-border-color: var(--border);
    --bs-secondary-bg: var(--surface-subtle);
}

* {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", "Roboto", sans-serif;
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 96%, var(--bg-alt) 4%), var(--bg-alt));
    color: var(--text);
    min-height: 100vh;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0.01em;
}

a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

a:hover {
    color: var(--primary-600);
}

a:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

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

h1, .h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

h2, .h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

h3, .h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

p {
    color: var(--text);
}

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

small, .small {
    font-size: 0.88rem;
}

.bg-body {
    background: var(--bg) !important;
}

.bg-body-secondary {
    background: var(--bg-alt) !important;
}

.bg-white {
    background: var(--surface) !important;
    color: var(--text) !important;
}

.bg-light {
    background: var(--surface-subtle) !important;
    color: var(--text) !important;
}

code {
    background: var(--code-bg);
    padding: 0.25rem 0.4rem;
    border-radius: 0.45rem;
    border: 1px solid var(--border);
}

:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.app-body {
    min-height: 100vh;
    background: var(--bg);
}

.app-shell {
    display: flex;
    min-height: calc(100vh - 56px);
    background: var(--bg-alt);
}

.app-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background: var(--bg-alt);
    padding: var(--content-padding);
}

.app-content > .container-fluid {
    flex: 1;
    padding: 0;
}

.app-topbar {
    background: var(--surface);
    border-bottom: 1px solid color-mix(in srgb, var(--border) 85%, transparent 15%);
    position: sticky;
    top: 0;
    z-index: 1020;
    padding: 0.6rem 1rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(12px);
}

.app-topbar .container-fluid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

.app-topbar .container-fluid > .d-flex {
    flex-wrap: nowrap;
    gap: 0.5rem;
    flex: 1 1 auto;
    min-width: 0;
}

.app-topbar .navbar-brand {
    padding: 0;
    margin: 0;
}

.app-brand .brand-text {
    white-space: nowrap;
}

.app-topbar .brand-logo {
    gap: 0.45rem;
}

.app-topbar-brand {
    flex: 0 1 auto;
    min-width: 0;
}

.app-topbar-actions {
    flex: 0 1 auto;
    min-width: 0;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 0.4rem 0.6rem;
    margin-left: auto;
}

.app-topbar-actions > * {
    flex: 0 0 auto;
}

.app-topbar .btn {
    border-radius: 10px;
}

.app-topbar .input-group {
    height: 42px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-subtle);
}

.app-topbar .input-group-text,
.app-topbar .form-control {
    background: transparent;
    border: none;
    color: var(--text);
}

.app-topbar .form-control::placeholder {
    color: var(--text-muted);
}

.app-topbar .btn-outline-secondary {
    background: var(--surface-subtle);
}

@media (max-width: 768px) {
    .app-topbar .container-fluid {
        gap: 0.6rem;
    }

    .app-topbar .container-fluid > .d-flex:last-child {
        width: auto;
        justify-content: flex-end;
        gap: 0.4rem 0.6rem;
    }

    .app-brand .brand-text {
        display: none;
    }

    .org-chip {
        display: none;
    }
}

@media (max-width: 992px) {
    .app-topbar .container-fluid {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
    }

    .app-topbar .container-fluid > .d-flex {
        width: auto;
        justify-content: flex-start;
    }

    .app-topbar .container-fluid > .d-flex:last-child {
        justify-content: flex-end;
        gap: 0.4rem 0.6rem;
    }

    .app-topbar-brand {
        justify-content: flex-start;
    }

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

    .app-quick-menu {
        margin-left: auto;
    }
}

@media (max-width: 576px) {
    .app-topbar {
        padding: 0.5rem 0.75rem;
    }

    .app-topbar-actions {
        width: auto;
        justify-content: flex-end;
    }

    .app-quick-menu {
        margin-left: auto;
    }
}

.app-shell .app-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #e5e7eb;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.6rem 1.25rem;
    gap: 0.75rem;
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease, padding 0.2s ease;
}

.app-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.app-sidebar .nav-group-toggle,
.app-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.82);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    border: 1px solid transparent;
    background: transparent;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.app-sidebar .nav-group-toggle {
    width: 100%;
    text-align: left;
}

.app-sidebar .nav-link:hover,
.app-sidebar .nav-group-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.app-sidebar .nav-link.active,
.app-sidebar .nav-group-toggle.active {
    background: var(--primary);
    color: #ffffff;
    border-color: rgba(var(--primary-rgb), 0.45);
}

.app-sidebar .nav-caret {
    font-size: 0.9rem;
    margin-left: auto;
    transition: transform 0.15s ease;
    opacity: 0.7;
}

.app-sidebar .nav-group-toggle:not(.collapsed) .nav-caret {
    transform: rotate(90deg);
}

.app-sidebar .nav-submenu {
    gap: 0.45rem;
    margin: 0.3rem 0 0.8rem 0.5rem;
}

.app-sidebar .nav-submenu .nav-link {
    padding: 0.65rem 0.9rem;
    background: rgba(255, 255, 255, 0.02);
}

.app-body.sidebar-collapsed .app-sidebar {
    width: var(--sidebar-collapsed-width);
    padding: 1.6rem 0.75rem;
}

.app-body.sidebar-collapsed .app-sidebar .nav-group-toggle,
.app-body.sidebar-collapsed .app-sidebar .nav-link {
    justify-content: center;
    padding: 0.75rem;
}

.app-body.sidebar-collapsed .app-sidebar .nav-group-toggle span,
.app-body.sidebar-collapsed .app-sidebar .nav-link span,
.app-body.sidebar-collapsed .app-sidebar .nav-caret {
    display: none;
}

.app-body.sidebar-collapsed .app-sidebar .nav-submenu {
    margin-left: 0;
}

#sidebarOffcanvas {
    background: var(--sidebar-bg);
    color: #f0f4f8;
}

#sidebarOffcanvas .offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#sidebarOffcanvas .nav-link,
#sidebarOffcanvas .nav-group-toggle {
    color: #f0f4f8;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
}

#sidebarOffcanvas .nav-link:hover,
#sidebarOffcanvas .nav-group-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
}

.page-header p {
    margin: 0;
    color: var(--text-muted);
}

.page-header > .d-flex,
.page-header > form,
.page-header > .btn-group {
    flex-shrink: 0;
}

.page-header .btn,
.page-header .input-group,
.page-header .form-control,
.page-header .form-select {
    height: 42px;
    border-radius: 10px;
}

.page-header .input-group {
    overflow: hidden;
}

.kpi-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--surface);
}

.card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.card-header {
    background: var(--surface-subtle);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text);
    padding: 0.9rem 1rem;
}

.card-body {
    padding: 1rem;
}

.card-footer {
    background: var(--surface-subtle);
    border-top: 1px solid var(--border);
    padding: 0.85rem 1rem;
}

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

.form-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
}

.form-control,
.form-select,
.input-group-text {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    height: 42px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-600);
    box-shadow: 0 0 0 3px var(--focus-ring);
    background: var(--surface);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus-visible,
.form-select:focus-visible,
.input-group-text:focus-visible,
.form-check-input:focus-visible {
    outline: none;
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.btn-primary:focus-visible {
    box-shadow: 0 0 0 3px var(--focus-ring), 0 12px 28px rgba(var(--primary-rgb), 0.25);
}

.form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    min-width: 1.15rem;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    background-image: var(--bs-form-check-bg-image);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 68% 68%;
    margin-top: 0.2rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-check-input:focus {
    border-color: var(--primary-600);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-check-input[type="radio"] {
    border-radius: 999px;
    background-size: 55% 55%;
}

.input-group {
    border-radius: 10px;
    overflow: hidden;
    height: 42px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.input-group .input-group-text {
    border: none;
    background: transparent;
    color: var(--text-muted);
}

.input-group .form-control {
    border: none;
    height: 100%;
    background: transparent;
}

.input-group:focus-within {
    box-shadow: 0 0 0 3px var(--focus-ring);
    border-color: var(--primary-600);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border-radius: 10px;
    font-weight: 600;
    min-height: 38px;
}

.btn-sm {
    min-height: 36px;
    padding: 0.35rem 0.8rem;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 12px 28px rgba(var(--primary-rgb), 0.25);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-600);
    border-color: var(--primary-600);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: rgba(var(--primary-rgb), 0.45);
    background: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: rgba(var(--primary-rgb), 0.08);
    border-color: var(--primary);
    color: var(--primary-600);
}

.btn-outline-secondary {
    color: var(--text);
    border-color: var(--border);
    background: var(--surface);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: var(--surface-subtle);
    color: var(--text);
    border-color: color-mix(in srgb, var(--border) 70%, var(--primary) 30%);
}

.badge {
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 700;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge .badge-dot,
.badge-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: currentColor;
    display: inline-block;
}

.badge.bg-light {
    border: 1px solid var(--border);
    background: var(--surface-subtle) !important;
    color: var(--text) !important;
}

.badge.bg-success-subtle {
    background: color-mix(in srgb, var(--success) 14%, var(--surface) 86%) !important;
    color: color-mix(in srgb, var(--success) 80%, #0b1021 20%) !important;
}

.badge.bg-warning-subtle {
    background: color-mix(in srgb, var(--warning) 16%, var(--surface) 84%) !important;
    color: color-mix(in srgb, var(--warning) 80%, #0b1021 20%) !important;
}

.badge.bg-danger-subtle {
    background: color-mix(in srgb, var(--danger) 16%, var(--surface) 84%) !important;
    color: color-mix(in srgb, var(--danger) 80%, #0b1021 20%) !important;
}

.badge.bg-secondary-subtle {
    background: color-mix(in srgb, var(--muted) 16%, var(--surface) 84%) !important;
    color: color-mix(in srgb, var(--muted) 80%, #0b1021 20%) !important;
}

.list-group-item {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.table {
    border-collapse: separate;
    border-spacing: 0 12px;
    margin: 0;
}

.table > thead > tr > th,
.table > thead > tr > td {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0 0.5rem 0.25rem;
}

.table > tbody > tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.table > tbody > tr > * {
    padding: 14px 16px;
    border: none;
    vertical-align: middle;
}

.table > tbody > tr > *:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.table > tbody > tr > *:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.table > tbody > tr:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
    border-color: color-mix(in srgb, var(--border) 70%, var(--primary) 30%);
}

.table-responsive {
    padding: 4px;
    border-radius: var(--radius);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background: var(--surface-subtle);
}

.table-hover > tbody > tr:hover > * {
    background: rgba(var(--primary-rgb), 0.04);
    color: var(--text);
}

.modal-content,
.dropdown-menu,
.offcanvas,
.toast {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.toast-header,
.offcanvas-header {
    background: var(--surface-subtle);
    border-color: var(--border);
}

.alert {
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.empty-state {
    text-align: center;
    padding: 1.8rem 1rem;
}

.empty-state .empty-icon {
    font-size: 1.6rem;
    color: var(--text-muted);
}

.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--skeleton);
    border-radius: 0.75rem;
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    animation: skeleton-shimmer 1.2s infinite;
}

.skeleton-line {
    height: 12px;
    margin: 0.45rem 0;
    border-radius: 999px;
}

.skeleton-card {
    padding: 1rem;
    border-radius: var(--radius);
}

.skeleton-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

@keyframes skeleton-shimmer {
    100% {
        transform: translateX(100%);
    }
}

.timeline {
    list-style: none;
    padding-left: 0;
    margin: 0;
    border-left: 2px solid var(--border);
}

.timeline li {
    position: relative;
    padding: 0 0 1.5rem 1.5rem;
}

.timeline li:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -6px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
}

.detail-item {
    padding: 0.75rem 0;
    border-bottom: 1px dashed var(--border);
}

.detail-item:last-child {
    border-bottom: none;
}

.app-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 0;
    background: var(--surface);
    color: var(--text-muted);
}

.app-footer a {
    color: var(--text-muted);
}

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

.brand-mark {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: var(--primary);
    display: inline-block;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: inherit;
    text-decoration: none;
    font-weight: 700;
}

.brand-logo img {
    height: max(var(--app-logo-height, 40px), 40px);
    width: auto;
    display: block;
}

.brand-logo--lg img {
    height: max(var(--app-logo-height-lg, 64px), 64px);
}

.brand-logo--lg .brand-mark {
    width: 20px;
    height: 20px;
}

.brand-text {
    font-weight: 700;
    letter-spacing: 0.02em;
}

.org-chip {
    font-weight: 600;
    padding: 0.35rem 0.7rem;
    background: var(--surface-subtle);
    color: var(--text);
    border: 1px solid var(--border) !important;
    border-radius: 999px;
}

.color-swatch {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1px solid var(--border);
    display: inline-block;
}

.branding-palettes {
    padding: 0.25rem 0;
}

.palette-card {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 0.85rem;
    padding: 0.85rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.palette-card:hover,
.palette-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(var(--primary-rgb), 0.35);
    box-shadow: var(--shadow-soft);
}

.palette-card.is-selected {
    border-color: rgba(var(--primary-rgb), 0.7);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
}

.palette-swatches {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.35rem;
}

.palette-swatches span {
    display: block;
    width: 100%;
    padding-top: 70%;
    border-radius: 6px;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.palette-title {
    font-weight: 600;
}

.palette-note {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.branding-manual {
    border: 1px dashed var(--border);
    border-radius: 0.75rem;
    padding: 0.25rem 1rem 1rem;
}

.branding-manual-toggle {
    cursor: pointer;
    font-weight: 600;
    padding: 0.6rem 0.2rem;
}

.auth-body,
.plain-body {
    background: radial-gradient(circle at 18% 18%, color-mix(in srgb, var(--bg-alt) 86%, var(--primary-100) 14%), var(--bg));
    color: var(--text);
}

.auth-shell,
.plain-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
    position: relative;
}

.auth-card,
.plain-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem;
    width: min(420px, 100%);
    border: 1px solid var(--border);
}

.auth-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: center;
}

.auth-header .brand-logo img {
    height: calc(var(--app-logo-height-lg, 40px) + 16px);
}

.code-chip {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    padding: 0.5rem 0.75rem;
    border-radius: 0.6rem;
    background: var(--code-bg);
    border: 1px solid var(--border);
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-overlay.show {
    display: flex;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.loading-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.locale-switcher .dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.auth-locale {
    display: flex;
    justify-content: flex-end;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    margin: 0;
    z-index: 5;
}

@media (max-width: 575px) {
    .auth-locale {
        top: 1rem;
        right: 1rem;
    }
}

@media (max-width: 991px) {
    .app-shell {
        flex-direction: column;
    }

    .app-content {
        padding: 1.25rem;
    }

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

    .page-header > .d-flex,
    .page-header > form,
    .page-header > .btn-group {
        width: 100%;
    }
}
