:root {
    --sidebar-width: 292px;
    --accent: #0f766e;
    --accent-strong: #0b5f59;
    --ink: #182230;
    --muted: #667085;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #eef4ff;
    --border: #d9e2ec;
    --line: rgba(24, 34, 48, .08);
    --shadow-sm: 0 8px 24px rgba(15, 23, 42, .08);
    --shadow-md: 0 18px 50px rgba(15, 23, 42, .13);
    --ring: 0 0 0 .22rem rgba(15, 118, 110, .18);
}

[data-bs-theme="dark"] {
    --ink: #e7edf6;
    --muted: #a6b0c2;
    --surface: #151b24;
    --surface-2: #0d1118;
    --surface-3: #16263b;
    --border: #293546;
    --line: rgba(231, 237, 246, .08);
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, .26);
    --shadow-md: 0 18px 54px rgba(0, 0, 0, .36);
}

* {
    scrollbar-width: thin;
}

body {
    min-height: 100vh;
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 400;
    letter-spacing: 0;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, .10), transparent 32%),
        linear-gradient(315deg, rgba(37, 99, 235, .11), transparent 34%),
        var(--surface-2);
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 18px;
    overflow-y: auto;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-right: 1px solid var(--border);
    box-shadow: 10px 0 30px rgba(15, 23, 42, .05);
    backdrop-filter: blur(18px);
}

.brand,
.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    font-weight: 700;
}

.auth-brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.brand {
    margin-bottom: 20px;
    padding: 10px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, #0f766e, #2563eb 52%, #eab308);
    box-shadow: 0 12px 30px rgba(15, 118, 110, .28);
    font-weight: 800;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    margin-bottom: 3px;
    color: color-mix(in srgb, var(--ink) 86%, var(--muted));
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: .92rem;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 20%, transparent);
}

.nav-link.disabled {
    opacity: .45;
}

.nav-link svg,
.btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.9;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: none;
}

.btn-primary {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: var(--accent-strong);
    --bs-btn-hover-border-color: var(--accent-strong);
    box-shadow: 0 10px 22px rgba(15, 118, 110, .22);
}

.btn-outline-secondary {
    --bs-btn-border-color: var(--border);
    --bs-btn-color: var(--ink);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
}

.app-main {
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 16px 18px 0;
    padding: 18px 20px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(18px);
}

.page-kicker {
    color: var(--muted);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.content-wrap {
    padding: 22px 28px 34px;
}

.page-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 16px;
}

.panel,
.stat-card {
    position: relative;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.panel {
    overflow: hidden;
}

.panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, #0f766e, #2563eb, #f59e0b, #e11d48);
}

.panel-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-3) 34%, transparent);
}

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

.stat-card {
    padding: 18px;
    overflow: hidden;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 600;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 2rem;
    font-weight: 800;
}

.form-grid {
    padding: 24px;
}

.form-section {
    padding: 18px;
    background: color-mix(in srgb, var(--surface-2) 50%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.form-section + .form-section {
    margin-top: 18px;
}

.form-section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-weight: 700;
    line-height: 1.25;
}

.form-section h2::before {
    content: "";
    flex: 0 0 38px;
    width: 38px;
    height: 10px;
    background:
        radial-gradient(circle at 5px 50%, #0f766e 0 5px, transparent 5.5px),
        radial-gradient(circle at 19px 50%, #2563eb 0 5px, transparent 5.5px),
        radial-gradient(circle at 33px 50%, #f59e0b 0 5px, transparent 5.5px);
}

.form-section-help,
.form-text {
    color: var(--muted);
    font-size: .84rem;
}

.form-section-help {
    margin-bottom: 16px;
}

.form-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: .86rem;
    font-weight: 650;
}

.field-help-icon {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    color: var(--muted);
    cursor: help;
}

.form-control,
.form-select {
    min-height: 42px;
    border-color: var(--border);
    border-radius: 8px;
    background-color: color-mix(in srgb, var(--surface) 96%, transparent);
    font-weight: 400;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: var(--ring);
}

.table {
    --bs-table-bg: transparent;
}

.table > :not(caption) > * > * {
    padding: 14px 16px;
}

.table thead th {
    color: var(--muted);
    background: color-mix(in srgb, var(--surface-3) 45%, transparent);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.badge {
    border-radius: 8px;
    font-weight: 700;
}

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

.auth-panel {
    width: min(100%, 440px);
    padding: 30px;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(16px);
}

.setup-panel {
    width: min(100%, 720px);
}

.auth-brand {
    margin-bottom: 24px;
}

.setup-help {
    display: flex;
    gap: 12px;
    margin-bottom: 22px;
    padding: 14px;
    background: color-mix(in srgb, #0f766e 10%, var(--surface));
    border: 1px solid color-mix(in srgb, #0f766e 22%, var(--border));
    border-radius: 8px;
}

.setup-help svg {
    flex: 0 0 auto;
    color: var(--accent);
}

.setup-help span {
    display: block;
    color: var(--muted);
    margin-top: 2px;
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 55vh;
    text-align: center;
    gap: 12px;
}

.compact-empty {
    min-height: 260px;
}

.empty-state svg {
    width: 46px;
    height: 46px;
    color: var(--muted);
}

.markdown-editor {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    line-height: 1.55;
}

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

.permission-item {
    display: flex;
    gap: 10px;
    min-height: 58px;
    padding: 10px;
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.permission-item small {
    display: block;
    color: var(--muted);
}

.top-menu-settings-grid {
    display: grid;
    gap: 18px;
}

.top-menu-settings-group h3 {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.report-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px;
}

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

.report-summary-card {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 12px;
    min-height: 118px;
    padding: 16px;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.report-summary-card span,
.report-summary-card small {
    display: block;
    color: var(--muted);
}

.report-summary-card span {
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.report-summary-card strong {
    display: block;
    margin: 3px 0;
    font-size: 1.9rem;
    line-height: 1;
    font-weight: 800;
}

.summary-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    color: #fff;
    border-radius: 8px;
    background: #0f766e;
}

.summary-icon svg {
    width: 22px;
    height: 22px;
}

.tone-blue .summary-icon {
    background: #2563eb;
}

.tone-amber .summary-icon {
    background: #d97706;
}

.tone-violet .summary-icon {
    background: #7c3aed;
}

.tone-rose .summary-icon {
    background: #e11d48;
}

.tone-orange .summary-icon {
    background: #ea580c;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.management-report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    padding: 16px;
}

.management-report-card {
    display: grid;
    gap: 14px;
    padding: 14px;
    background: color-mix(in srgb, var(--surface-2) 72%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.management-report-card header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.management-report-card header > span {
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    color: #fff;
    background: #0f766e;
    border-radius: 8px;
}

.management-report-card h3 {
    margin: 0;
    font-size: .98rem;
    font-weight: 800;
}

.management-report-card p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: .84rem;
}

.management-report-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.management-report-kpis div {
    min-width: 0;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.management-report-kpis span {
    display: block;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.management-report-kpis strong {
    display: block;
    margin-top: 3px;
    color: var(--ink);
    font-size: 1.05rem;
    line-height: 1.15;
}

.management-report-kpis .tone-green {
    border-color: color-mix(in srgb, #16a34a 28%, var(--line));
}

.management-report-kpis .tone-blue {
    border-color: color-mix(in srgb, #2563eb 28%, var(--line));
}

.management-report-kpis .tone-amber {
    border-color: color-mix(in srgb, #d97706 28%, var(--line));
}

.management-report-kpis .tone-rose {
    border-color: color-mix(in srgb, #e11d48 28%, var(--line));
}

.management-report-kpis .tone-violet {
    border-color: color-mix(in srgb, #7c3aed 28%, var(--line));
}

.report-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 350px;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.report-card-wide {
    grid-column: span 2;
}

.report-card-header {
    padding: 16px 18px 10px;
    border-bottom: 1px solid var(--line);
}

.report-card-header p {
    margin: 0;
    color: var(--muted);
    font-size: .84rem;
}

.report-chart-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    max-height: 255px;
    padding: 12px 14px 16px;
}

.report-table-scroll {
    max-height: 390px;
    overflow: auto;
}

.report-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.report-table-scroll {
    max-height: 270px;
}

.report-table-scroll table {
    table-layout: fixed;
    min-width: 860px;
}

.report-table-scroll th:nth-child(1),
.report-table-scroll td:nth-child(1) {
    width: 128px;
}

.report-table-scroll th:nth-child(2),
.report-table-scroll td:nth-child(2) {
    width: 170px;
}

.report-table-scroll th:nth-child(3),
.report-table-scroll td:nth-child(3) {
    width: 150px;
}

.report-table-scroll th:nth-child(4),
.report-table-scroll td:nth-child(4) {
    width: 122px;
}

.report-table-scroll td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

code {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (max-width: 920px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .app-sidebar .nav {
        flex-direction: row !important;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .nav-link {
        white-space: nowrap;
    }

    .topbar {
        align-items: flex-start;
        margin: 12px;
        padding: 16px;
    }

    .content-wrap {
        padding: 16px;
    }

    .form-grid {
        padding: 16px;
    }

    .report-hero {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .report-card,
    .report-card-wide {
        grid-column: span 1;
    }
}

/* Top-navigation layout inspired by dense admin tools. */
:root {
    --nav-blue: #153f75;
    --nav-blue-2: #0f5f91;
    --nav-gold: #d6a728;
    --nav-gold-soft: #fff4c7;
    --accent: #1d4ed8;
    --accent-strong: #153f75;
    --ring: 0 0 0 .22rem rgba(29, 78, 216, .18);
}

body {
    background: #f4f7fb;
}

[data-bs-theme="dark"] body {
    background: #0b111b;
}

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-topnav {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr) auto;
    align-items: stretch;
    min-height: 58px;
    color: #fff;
    background:
        repeating-linear-gradient(28deg, rgba(255,255,255,.08) 0 2px, transparent 2px 9px),
        linear-gradient(90deg, var(--nav-blue), var(--nav-blue-2) 54%, #12315f);
    box-shadow: 0 8px 22px rgba(8, 34, 70, .18);
}

.top-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 0 18px;
    color: #fff;
    text-decoration: none;
    font-size: 1.12rem;
    font-weight: 800;
}

.top-brand img {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
}

.top-menu {
    display: flex;
    align-items: stretch;
    min-width: 0;
    overflow-x: auto;
}

.top-menu a,
.top-icon,
.top-user {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255,255,255,.88);
    text-decoration: none;
    border: 0;
    background: transparent;
}

.top-menu a {
    position: relative;
    min-width: max-content;
    padding: 0 17px;
    font-size: .92rem;
    font-weight: 700;
}

.top-menu a.active,
.top-menu a:hover {
    color: #fff;
    background: rgba(255,255,255,.12);
}

.top-menu a.active::after {
    content: "";
    position: absolute;
    left: 13px;
    right: 13px;
    bottom: 0;
    height: 3px;
    background: var(--nav-gold);
    border-radius: 999px 999px 0 0;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 12px;
}

.top-icon {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 8px;
}

.top-icon-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
    line-height: 1;
    background: #dc2626;
    border: 2px solid var(--nav-bg, #153f75);
    border-radius: 999px;
}

.top-user {
    min-height: 42px;
    max-width: 190px;
    padding: 0 10px;
    border-radius: 8px;
    font-weight: 700;
}

.top-user span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-icon:hover,
.top-icon.active,
.top-user:hover {
    color: #fff;
    background: rgba(255,255,255,.14);
}

.btn-primary {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: var(--accent-strong);
    --bs-btn-hover-border-color: var(--accent-strong);
    box-shadow: 0 10px 22px rgba(29, 78, 216, .18);
}

.top-menu svg,
.top-actions svg {
    width: 19px;
    height: 19px;
    stroke-width: 2.25;
}

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

.app-sidebar {
    position: sticky;
    top: 58px;
    height: calc(100vh - 58px);
    padding: 12px 0 24px;
    overflow-y: auto;
    background: #eef2f7;
    border-right: 1px solid #d8e1ec;
    box-shadow: none;
    backdrop-filter: none;
}

[data-bs-theme="dark"] .app-sidebar {
    background: #101824;
    border-right-color: #263446;
}

.side-section {
    margin-bottom: 8px;
}

.side-section > p {
    margin: 10px 18px 6px;
    color: var(--muted);
    font-size: .73rem;
    font-weight: 800;
    text-transform: uppercase;
}

.app-sidebar .nav {
    gap: 0 !important;
}

.nav-link {
    min-height: 34px;
    margin: 0;
    padding: 8px 18px;
    border: 0;
    border-left: 4px solid transparent;
    border-radius: 0;
    color: color-mix(in srgb, var(--ink) 78%, var(--muted));
    font-size: .86rem;
}

.nav-link.active,
.nav-link:hover {
    color: var(--nav-blue);
    background: color-mix(in srgb, var(--nav-gold-soft) 58%, var(--surface));
    border-left-color: var(--nav-gold);
}

[data-bs-theme="dark"] .nav-link.active,
[data-bs-theme="dark"] .nav-link:hover {
    color: #f8df8b;
    background: rgba(214,167,40,.12);
}

.app-main {
    min-width: 0;
    background: color-mix(in srgb, var(--surface-2) 86%, #fff);
}

.topbar {
    position: sticky;
    top: 58px;
    z-index: 20;
    margin: 0;
    padding: 12px 22px;
    min-height: 72px;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: color-mix(in srgb, var(--surface) 95%, transparent);
    box-shadow: 0 7px 16px rgba(15, 23, 42, .04);
}

.content-wrap {
    padding: 18px 22px 32px;
}

.module-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 18px 18px 18px 20px;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.module-hero h2 {
    margin: 0 0 5px;
    font-size: 1.75rem;
    font-weight: 650;
}

.module-hero p {
    margin: 0;
    color: var(--muted);
}

.module-hero-actions {
    display: flex;
    gap: 10px;
    flex: 0 0 auto;
}

.search-help-panel {
    overflow: hidden;
}

.search-help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
    padding: 0 18px 18px;
}

.search-help-item {
    display: flex;
    gap: 12px;
    min-width: 0;
    min-height: 118px;
    padding: 14px;
    background: color-mix(in srgb, var(--surface-2) 78%, var(--surface));
    border: 1px solid var(--border);
    border-radius: 8px;
}

.search-help-item svg {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin-top: 2px;
    color: var(--accent);
}

.search-help-item strong,
.search-help-item span,
.search-help-item small {
    display: block;
    overflow-wrap: anywhere;
}

.search-help-item strong {
    margin-bottom: 3px;
    font-size: .93rem;
}

.search-help-item span {
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.35;
}

.search-help-item small {
    margin-top: 8px;
    color: color-mix(in srgb, var(--muted) 82%, var(--ink));
    font-size: .76rem;
    line-height: 1.35;
}

.search-example-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 0 18px 18px;
}

.search-example-strip span {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.search-example-strip a {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 30px;
    padding: 5px 10px;
    color: var(--ink);
    font-size: .82rem;
    text-decoration: none;
    overflow-wrap: anywhere;
    background: color-mix(in srgb, var(--surface-3) 58%, var(--surface));
    border: 1px solid var(--border);
    border-radius: 999px;
}

.search-example-strip a:hover {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
}

.template-token {
    padding: 5px 8px;
    color: var(--ink);
    background: color-mix(in srgb, var(--surface-3) 64%, var(--surface));
    border: 1px solid var(--border);
    border-radius: 8px;
}

.template-test-box {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    padding: 14px;
    background: color-mix(in srgb, var(--surface-2) 82%, var(--surface));
    border: 1px solid var(--border);
    border-radius: 8px;
}

.template-test-actions {
    display: flex;
    gap: 10px;
    min-width: min(100%, 430px);
}

.template-test-actions .form-control {
    min-width: 0;
}

@media (max-width: 720px) {
    .template-test-box,
    .template-test-actions {
        display: grid;
        width: 100%;
    }
}

.table-link {
    color: inherit;
    text-decoration: none;
}

.table-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

.tag-badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 3px 8px;
    color: color-mix(in srgb, var(--tag-color, var(--accent)) 72%, var(--ink));
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.15;
    overflow-wrap: anywhere;
    background: color-mix(in srgb, var(--tag-color, var(--accent)) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--tag-color, var(--accent)) 34%, var(--border));
    border-radius: 999px;
}

.credential-hero {
    border-top: 4px solid #7c3aed;
}

.entity-show-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 18px;
    align-items: start;
}

.entity-main-stack,
.entity-side-stack {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.entity-detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    padding: 4px 18px 18px;
}

.entity-detail-list > div {
    min-width: 0;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.entity-detail-list dt {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.entity-detail-list dd {
    margin: 4px 0 0;
    color: var(--ink);
    font-size: .9rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.entity-related-grid {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.entity-related-section {
    display: grid;
    gap: 10px;
}

.entity-related-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--ink);
    font-size: .88rem;
    font-weight: 700;
}

.entity-related-section h3 svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.entity-compact-list {
    display: grid;
    gap: 8px;
    padding: 16px;
}

.entity-related-section .entity-compact-list {
    padding: 0;
}

.entity-compact-list a,
.entity-compact-list article {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-width: 0;
    padding: 10px;
    color: inherit;
    text-decoration: none;
    background: color-mix(in srgb, var(--surface-3) 35%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.entity-compact-list a:hover {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.entity-compact-list svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: var(--accent);
}

.entity-compact-list span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.entity-compact-list strong {
    color: var(--ink);
    font-size: .86rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.entity-compact-list small,
.entity-compact-list article span {
    color: var(--muted);
    font-size: .76rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.entity-quick-actions,
.secret-action-grid {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.secret-action-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.entity-visual-hero {
    align-items: center;
}

.entity-visual-title {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.entity-visual-title img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    padding: 10px;
    background: color-mix(in srgb, var(--surface-3) 70%, var(--surface));
    border: 1px solid var(--line);
    border-radius: 8px;
}

.reminders-hero {
    border-top: 4px solid var(--nav-gold);
}

.severity-info {
    color: #075985;
    background: #e0f2fe;
}

.severity-warning {
    color: #854d0e;
    background: #fef3c7;
}

.severity-danger {
    color: #991b1b;
    background: #fee2e2;
}

.severity-critical {
    color: #fff;
    background: #7f1d1d;
}

.status-open {
    color: #075985;
    background: #e0f2fe;
}

.status-done {
    color: #166534;
    background: #dcfce7;
}

.status-snoozed {
    color: #854d0e;
    background: #fef3c7;
}

.status-cancelled {
    color: #475569;
    background: #e2e8f0;
}

.status-pending {
    color: #854d0e;
    background: #fef3c7;
}

.status-overdue {
    color: #991b1b;
    background: #fee2e2;
}

.status-paid {
    color: #166534;
    background: #dcfce7;
}

.status-active {
    color: #166534;
    background: #dcfce7;
}

.status-inactive,
.status-archived,
.status-retired {
    color: #475569;
    background: #e2e8f0;
}

.status-maintenance {
    color: #854d0e;
    background: #fef3c7;
}

.severity-low {
    color: #166534;
    background: #dcfce7;
}

.severity-medium {
    color: #075985;
    background: #e0f2fe;
}

.severity-high {
    color: #854d0e;
    background: #fef3c7;
}

.dashboard-pending-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.dashboard-pending-header span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: .78rem;
}

.dashboard-pending-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    padding: 16px 18px 0;
}

.pending-summary-item {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.pending-summary-item span {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
}

.pending-summary-item strong {
    display: block;
    margin-top: 4px;
    font-size: 1.45rem;
    font-weight: 650;
}

.pending-list {
    padding: 14px 18px 18px;
}

.pending-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    padding: 13px 0;
    border-top: 1px solid var(--line);
}

.pending-list .pending-item:first-child {
    border-top: 0;
}

.pending-item-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.pending-item-title strong {
    font-size: .92rem;
    font-weight: 600;
}

.pending-item-main p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: .8rem;
}

.pending-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 7px;
    color: var(--muted);
    font-size: .74rem;
}

.pending-item-meta span + span::before {
    content: "•";
    margin-right: 8px;
}

.pending-item-action {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    min-width: 145px;
    color: var(--muted);
    font-size: .76rem;
    text-align: right;
}

.pending-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 92px;
    color: var(--muted);
    font-size: .84rem;
}

.pending-empty svg {
    width: 18px;
    height: 18px;
    color: #0f766e;
}

.financial-actions,
.payment-inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.financial-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.financial-chart-wrap {
    height: 290px;
    padding: 16px 18px 20px;
}

.financial-closing-header {
    align-items: flex-start;
}

.financial-closing-header p {
    margin-top: 4px;
    color: var(--muted);
}

.financial-closing-kpis {
    text-align: right;
}

.financial-closing-kpis span,
.financial-closing-list small,
.financial-closing-toolbar small {
    display: block;
    color: var(--muted);
    font-size: .78rem;
}

.financial-closing-kpis strong {
    display: block;
    margin-top: 3px;
}

.financial-closing-layout {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    min-height: 360px;
}

.financial-closing-side {
    display: grid;
    align-content: start;
    gap: 16px;
    padding: 16px;
    border-right: 1px solid var(--line);
}

.financial-closing-list {
    display: grid;
    gap: 10px;
}

.financial-closing-list a {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    padding: 12px;
    background: color-mix(in srgb, var(--surface-2) 70%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.financial-closing-list a:hover,
.financial-closing-list a.active {
    background: color-mix(in srgb, var(--accent) 9%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 32%, var(--border));
}

.financial-closing-list b {
    flex: 0 0 auto;
}

.financial-closing-detail {
    min-width: 0;
}

.financial-closing-total-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 16px;
    background: color-mix(in srgb, var(--surface-2) 68%, transparent);
    border-bottom: 1px solid var(--line);
}

.financial-closing-total-strip div {
    min-width: 0;
    padding: 12px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.financial-closing-total-strip span {
    display: block;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.financial-closing-total-strip strong {
    display: block;
    margin-top: 4px;
}

.financial-closing-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}

.financial-closing-toolbar .btn-group {
    gap: 8px;
}

.status-pricing_table,
.status-service_order,
.status-contract,
.status-manual {
    color: #1d4ed8;
    background: color-mix(in srgb, #2563eb 13%, var(--surface));
}

.status-billed {
    color: #067647;
    background: var(--mint);
}

.payment-inline-form .form-select {
    width: 132px;
    min-height: 30px;
}

.system-logo-preview {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px 12px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.system-logo-preview img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.system-logo-preview span {
    font-weight: 700;
}

.ticket-filter-form {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    padding: 18px;
    align-items: end;
}

.ticket-filter-actions,
.ticket-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ticket-chart-grid,
.ticket-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    gap: 18px;
}

.ticket-detail-grid {
    align-items: start;
}

.ticket-side {
    display: grid;
    gap: 18px;
}

.ticket-thread {
    display: grid;
    gap: 18px;
}

.ticket-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.ticket-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.ticket-meta-grid > div {
    min-width: 0;
    padding: 12px;
    background: color-mix(in srgb, var(--surface-2) 68%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.ticket-meta-grid span {
    display: block;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.ticket-meta-grid strong {
    display: block;
    overflow: hidden;
    margin-top: 3px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-message-list {
    display: grid;
    gap: 12px;
}

.ticket-message {
    max-width: 78%;
    padding: 12px 14px;
    background: color-mix(in srgb, var(--surface-2) 70%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.ticket-message.from-me {
    justify-self: end;
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 18%, transparent);
}

.ticket-message.is-system {
    max-width: 100%;
    justify-self: stretch;
    background: color-mix(in srgb, #64748b 10%, var(--surface));
}

.ticket-message header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: .78rem;
}

.ticket-message header strong {
    color: var(--ink);
}

.ticket-reply-form {
    display: grid;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.table-main-link {
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.table-main-link:hover {
    color: var(--accent);
}

.ticket-status-open {
    color: #075985;
    background: #e0f2fe;
}

.ticket-status-in-progress,
.ticket-status-waiting-support {
    color: #1d4ed8;
    background: #dbeafe;
}

.ticket-status-waiting-customer {
    color: #854d0e;
    background: #fef3c7;
}

.ticket-status-resolved,
.ticket-status-closed {
    color: #166534;
    background: #dcfce7;
}

.ticket-status-cancelled {
    color: #475569;
    background: #e2e8f0;
}

.ticket-priority-low {
    color: #475569;
    background: #e2e8f0;
}

.ticket-priority-medium {
    color: #075985;
    background: #e0f2fe;
}

.ticket-priority-high {
    color: #854d0e;
    background: #fef3c7;
}

.ticket-priority-critical {
    color: #991b1b;
    background: #fee2e2;
}

.billing-email-modal .modal-content {
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
}

.billing-email-modal .modal-header,
.billing-email-modal .modal-footer {
    border-color: var(--line);
    background: color-mix(in srgb, var(--surface-3) 34%, transparent);
}

.billing-email-modal .modal-header {
    align-items: flex-start;
}

.billing-modal-subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: .86rem;
}

.billing-modal-grid {
    display: grid;
    grid-template-columns: minmax(290px, .92fr) minmax(340px, 1.08fr);
    gap: 16px;
}

.billing-panel {
    min-width: 0;
    padding: 16px;
    background: color-mix(in srgb, var(--surface-2) 48%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.billing-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.billing-panel-header h3 {
    margin: 0;
    font-size: .98rem;
    font-weight: 700;
}

.billing-panel-header span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: .8rem;
}

.billing-filter {
    min-width: 178px;
}

.billing-select-all,
.billing-recipient-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.billing-select-all {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: .84rem;
    font-weight: 650;
}

.billing-recipient-list {
    display: grid;
    gap: 8px;
    max-height: 438px;
    overflow: auto;
    padding-right: 3px;
}

.billing-recipient-row {
    margin: 0;
    padding: 12px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
}

.billing-recipient-row:has(input:disabled) {
    cursor: not-allowed;
    opacity: .62;
}

.billing-recipient-main {
    min-width: 0;
    flex: 1 1 auto;
}

.billing-recipient-main strong,
.billing-recipient-main small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.billing-recipient-main strong {
    font-size: .9rem;
    font-weight: 700;
}

.billing-recipient-main small {
    color: var(--muted);
    font-size: .78rem;
}

.billing-recipient-meta {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 auto;
    color: var(--muted);
    font-size: .76rem;
    text-align: right;
}

.billing-email-modal .form-check-input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    flex: 0 0 1rem;
    margin: .18rem 0 0;
    border-radius: 4px;
    background-image: var(--bs-form-check-bg-image);
    background-size: 100% 100%;
}

.billing-email-body {
    min-height: 252px;
    resize: vertical;
}

.billing-placeholder-box {
    padding: 12px;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.billing-placeholder-box > span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.billing-placeholder-box > div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.billing-placeholder-chip {
    min-height: 28px;
    padding: 4px 8px;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 9%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
    border-radius: 8px;
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .76rem;
    font-weight: 700;
}

.billing-placeholder-chip:hover {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

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

.help-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 20px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(21, 63, 117, .94), rgba(15, 95, 145, .92)),
        var(--nav-blue);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.help-hero span {
    display: block;
    margin-bottom: 5px;
    color: rgba(255,255,255,.72);
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.help-hero h2 {
    margin: 0 0 6px;
    font-size: 1.55rem;
    font-weight: 760;
}

.help-hero p {
    max-width: 760px;
    margin: 0;
    color: rgba(255,255,255,.78);
}

.help-hero-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
    color: #153f75;
    background: #fff7dc;
    border-radius: 8px;
}

.help-hero-icon svg {
    width: 28px;
    height: 28px;
}

.help-guide-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.help-guide-card {
    min-width: 0;
    overflow: hidden;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.help-guide-card.is-current {
    border-color: color-mix(in srgb, var(--accent) 44%, var(--border));
    box-shadow: 0 16px 38px rgba(31, 95, 191, .13);
}

.help-guide-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: color-mix(in srgb, var(--surface-3) 42%, transparent);
    border-bottom: 1px solid var(--line);
}

.help-guide-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    color: #fff;
    background: linear-gradient(135deg, #1d4ed8, #0f766e);
    border-radius: 8px;
}

.help-guide-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.help-guide-title h3 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 760;
}

.help-guide-title span {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    color: #174a95;
    background: #fff7dc;
    border: 1px solid #d5aa37;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.help-guide-header p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: .82rem;
}

.help-guide-content {
    padding: 16px 18px 18px;
}

.help-guide-content h2 {
    display: none;
}

.help-guide-content h3 {
    margin: 18px 0 7px;
    color: var(--ink);
    font-size: .95rem;
    font-weight: 760;
}

.help-guide-content h3:first-child {
    margin-top: 0;
}

.help-guide-content p,
.help-guide-content li {
    color: color-mix(in srgb, var(--ink) 82%, var(--muted));
    font-size: .86rem;
    line-height: 1.58;
}

.help-guide-content p {
    margin: 0 0 10px;
}

.help-guide-content ul {
    display: grid;
    gap: 7px;
    margin: 0 0 12px;
    padding-left: 18px;
}

.equipment-hero {
    border-top: 4px solid #0ea5e9;
}

.equipment-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.equipment-summary-card {
    padding: 16px;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.equipment-summary-card span {
    display: block;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.equipment-summary-card strong {
    display: block;
    margin-top: 5px;
    color: var(--ink);
    font-size: 1.8rem;
    line-height: 1;
    font-weight: 800;
}

.equipment-summary-card.tone-success {
    border-color: color-mix(in srgb, #16a34a 32%, var(--border));
}

.equipment-summary-card.tone-warning {
    border-color: color-mix(in srgb, #f59e0b 38%, var(--border));
}

.equipment-summary-card.tone-danger {
    border-color: color-mix(in srgb, #e11d48 36%, var(--border));
}

.equipment-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
}

.equipment-card {
    overflow: hidden;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.equipment-card-grid > .empty-state {
    grid-column: 1 / -1;
}

.equipment-card-visual {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 156px;
    background:
        linear-gradient(135deg, color-mix(in srgb, #1d4ed8 12%, transparent), transparent 44%),
        color-mix(in srgb, var(--surface-3) 58%, var(--surface));
    border-bottom: 1px solid var(--line);
}

.equipment-card-visual img {
    width: 118px;
    height: 118px;
    object-fit: contain;
    filter: drop-shadow(0 16px 22px rgba(15, 23, 42, .16));
}

.equipment-card-visual .badge {
    position: absolute;
    top: 12px;
    right: 12px;
}

.equipment-card-body {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.equipment-card-body h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 760;
}

.equipment-card-body p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: .84rem;
}

.equipment-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    margin: 0;
}

.equipment-meta div {
    min-width: 0;
}

.equipment-meta dt {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.equipment-meta dd {
    margin: 2px 0 0;
    overflow: hidden;
    color: var(--ink);
    font-size: .83rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.equipment-form-layout {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 20px;
}

.equipment-preview {
    position: sticky;
    top: 146px;
    align-self: start;
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 18px;
    text-align: center;
    background:
        linear-gradient(135deg, color-mix(in srgb, #0ea5e9 13%, transparent), transparent 44%),
        color-mix(in srgb, var(--surface-3) 50%, var(--surface));
    border: 1px solid var(--border);
    border-radius: 8px;
}

.equipment-preview img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    filter: drop-shadow(0 18px 24px rgba(15, 23, 42, .16));
}

.equipment-preview strong {
    display: block;
    font-size: 1rem;
    font-weight: 760;
}

.equipment-preview span {
    color: var(--muted);
    font-size: .84rem;
}

.equipment-form-sections {
    display: grid;
    gap: 18px;
}

.lookup-grid > div,
.lookup-loading {
    min-height: 72px;
    padding: 12px;
    background: color-mix(in srgb, var(--surface) 80%, var(--surface-3));
    border: 1px solid var(--border);
    border-radius: 8px;
}

.lookup-grid span {
    display: block;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.lookup-grid strong {
    display: block;
    margin-top: 4px;
    font-size: .92rem;
    word-break: break-word;
}

.mfa-qr {
    display: flex;
    justify-content: center;
}

.mfa-qr img {
    width: 220px;
    height: 220px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: 10px;
}

.recovery-code-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.recovery-code-grid code {
    display: block;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--ink);
    text-align: center;
    font-size: .95rem;
}

.password-strength {
    display: grid;
    gap: 4px;
}

.password-strength .progress {
    height: 6px;
    background: var(--surface-3);
}

.password-strength span {
    color: var(--muted);
    font-size: .78rem;
}

.dt-container {
    padding: 14px 16px 16px;
}

.dt-container .row {
    row-gap: 10px;
}

.dt-search input,
.dt-length select {
    border-color: var(--border);
    border-radius: 8px;
}

.ck.ck-editor {
    color: #111827;
}

.ck-editor__editable_inline {
    min-height: 180px;
}

.rich-editor + .ck.ck-editor .ck-editor__editable_inline {
    min-height: 170px;
}

@media (max-width: 1100px) {
    .app-topnav {
        grid-template-columns: 210px minmax(0, 1fr);
    }

    .top-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
        min-height: 46px;
        background: rgba(0,0,0,.12);
    }

    .app-body {
        grid-template-columns: 210px minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .app-topnav {
        position: static;
        grid-template-columns: 1fr;
    }

    .top-menu {
        order: 3;
        min-height: 48px;
    }

    .top-brand,
    .top-actions {
        min-height: 52px;
    }

    .app-body {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: static;
        height: auto;
        max-height: 230px;
    }

    .topbar {
        top: 0;
        align-items: flex-start;
        flex-direction: column;
    }

    .content-wrap {
        padding: 14px;
    }

    .module-hero {
        flex-direction: column;
    }
}

/* Slim visual refresh */
:root {
    --sidebar-width: 228px;
    --nav-height: 52px;
    --accent: #1f5fbf;
    --accent-strong: #174a95;
    --nav-blue: #173f74;
    --nav-blue-2: #155d8e;
    --nav-gold: #d5aa37;
    --nav-gold-soft: #fff7dc;
    --ink: #172033;
    --muted: #708095;
    --surface: #ffffff;
    --surface-2: #f5f7fb;
    --surface-3: #edf4ff;
    --border: #dfe7f1;
    --line: rgba(23, 32, 51, .075);
    --shadow-sm: 0 10px 28px rgba(22, 39, 72, .055);
    --shadow-md: 0 22px 58px rgba(22, 39, 72, .11);
    --ring: 0 0 0 .18rem rgba(31, 95, 191, .16);
    --bs-body-font-size: .875rem;
    --bs-body-font-weight: 300;
    --bs-body-line-height: 1.48;
}

[data-bs-theme="dark"] {
    --ink: #e8edf7;
    --muted: #9eaac0;
    --surface: #141b27;
    --surface-2: #0c121d;
    --surface-3: #17253a;
    --border: #27354a;
    --line: rgba(232, 237, 247, .075);
}

html {
    font-size: 14px;
}

body {
    color: var(--ink);
    font-size: .875rem;
    font-weight: 300;
    line-height: 1.48;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background:
        linear-gradient(145deg, rgba(31, 95, 191, .055), transparent 34%),
        linear-gradient(315deg, rgba(213, 170, 55, .09), transparent 30%),
        var(--surface-2);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--ink);
    font-weight: 450;
    line-height: 1.2;
}

.h4,
h4 {
    font-size: 1.12rem;
}

.h5,
h5 {
    font-size: 1rem;
}

.h6,
h6 {
    font-size: .91rem;
}

.small,
small {
    font-weight: 300;
}

.app-topnav {
    grid-template-columns: 228px minmax(0, 1fr) auto;
    min-height: var(--nav-height);
    background:
        repeating-linear-gradient(28deg, rgba(255, 255, 255, .07) 0 1px, transparent 1px 8px),
        linear-gradient(90deg, var(--nav-blue), var(--nav-blue-2) 58%, #13366a);
    box-shadow: 0 6px 18px rgba(8, 34, 70, .14);
}

.top-brand {
    gap: 9px;
    padding: 0 16px;
    font-size: 1rem;
    font-weight: 550;
}

.top-brand img {
    width: 28px;
    height: 28px;
}

.top-menu a {
    padding: 0 14px;
    font-size: .82rem;
    font-weight: 500;
}

.top-menu svg,
.top-actions svg {
    width: 17px;
    height: 17px;
    stroke-width: 2;
}

.top-actions {
    padding: 0 10px;
}

.top-icon {
    width: 36px;
    height: 36px;
}

.top-user {
    min-height: 36px;
    max-width: 165px;
    padding: 0 9px;
    font-size: .82rem;
    font-weight: 500;
}

.app-body {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: calc(100vh - var(--nav-height));
}

.app-sidebar {
    top: var(--nav-height);
    height: calc(100vh - var(--nav-height));
    padding: 14px 0 26px;
    background: color-mix(in srgb, var(--surface-2) 92%, #fff);
}

[data-bs-theme="dark"] .app-sidebar {
    background: #101724;
}

.side-section {
    margin-bottom: 12px;
}

.side-section > p {
    margin: 12px 18px 7px;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .04em;
}

.nav-link {
    min-height: 32px;
    gap: 9px;
    padding: 7px 17px;
    font-size: .8rem;
    font-weight: 350;
}

.nav-link svg {
    width: 15px;
    height: 15px;
}

.nav-link.active {
    font-weight: 500;
}

.app-main {
    background:
        linear-gradient(180deg, rgba(255,255,255,.55), transparent 220px),
        var(--surface-2);
}

[data-bs-theme="dark"] .app-main {
    background:
        linear-gradient(180deg, rgba(255,255,255,.025), transparent 220px),
        var(--surface-2);
}

.topbar {
    top: var(--nav-height);
    min-height: 58px;
    padding: 10px 24px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    box-shadow: 0 6px 16px rgba(17, 24, 39, .035);
    backdrop-filter: blur(14px);
}

.topbar h1 {
    font-size: 1.04rem;
    font-weight: 450;
}

.page-kicker {
    font-size: .66rem;
    font-weight: 500;
    letter-spacing: .04em;
}

.content-wrap {
    padding: 24px 30px 38px;
}

.content-wrap > * + * {
    margin-top: 18px;
}

.page-actions {
    justify-content: flex-end;
    margin-bottom: 12px;
}

.panel,
.stat-card,
.report-summary-card,
.report-card,
.module-hero,
.auth-panel {
    border-color: var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.panel::before {
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--nav-gold));
}

.panel-header {
    padding: 16px 18px;
    background: color-mix(in srgb, var(--surface-3) 26%, transparent);
}

.panel-header h2 {
    font-weight: 500;
}

.btn {
    min-height: 34px;
    gap: 7px;
    padding: .42rem .78rem;
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 450;
}

.btn-sm {
    min-height: 30px;
    padding: .28rem .54rem;
    font-size: .78rem;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    box-shadow: 0 8px 18px rgba(31, 95, 191, .16);
}

.stats-grid,
.report-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
}

.stat-card,
.report-summary-card {
    min-height: 104px;
    padding: 17px;
}

.stat-card span,
.report-summary-card span {
    font-size: .72rem;
    font-weight: 550;
    letter-spacing: .035em;
}

.stat-card strong,
.report-summary-card strong {
    font-size: 1.55rem;
    font-weight: 550;
}

.report-summary-card small {
    font-size: .78rem;
}

.summary-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
}

.summary-icon svg {
    width: 19px;
    height: 19px;
}

.module-hero,
.report-hero {
    padding: 20px 22px;
    gap: 20px;
}

.module-hero h2,
.report-hero h2 {
    font-size: 1.32rem;
    font-weight: 400;
}

.module-hero p,
.report-hero p {
    max-width: 860px;
    font-size: .86rem;
}

.form-grid {
    display: grid;
    gap: 18px;
    padding: 18px;
}

.form-section {
    padding: 22px;
    background: color-mix(in srgb, var(--surface) 88%, var(--surface-2));
    border: 1px solid var(--border);
    border-radius: 10px;
}

.form-section + .form-section {
    margin-top: 0;
}

.form-section h2 {
    gap: 12px;
    margin-bottom: 8px;
    font-size: .95rem;
    font-weight: 500;
}

.form-section h2::before {
    flex-basis: 32px;
    width: 32px;
    height: 8px;
    background:
        radial-gradient(circle at 4px 50%, var(--accent) 0 4px, transparent 4.5px),
        radial-gradient(circle at 16px 50%, var(--nav-gold) 0 4px, transparent 4.5px),
        radial-gradient(circle at 28px 50%, #54a3cf 0 4px, transparent 4.5px);
}

.form-section-help {
    margin-bottom: 18px;
    max-width: 820px;
    font-size: .8rem;
}

.form-label {
    margin-bottom: 5px;
    color: color-mix(in srgb, var(--ink) 88%, var(--muted));
    font-size: .78rem;
    font-weight: 500;
}

.form-text {
    font-size: .76rem;
}

.field-help-icon {
    width: 16px;
    height: 16px;
}

.field-help-icon svg {
    width: 15px;
    height: 15px;
}

.form-control,
.form-select,
.input-group-text {
    min-height: 36px;
    border-radius: 8px;
    font-size: .84rem;
    font-weight: 300;
}

textarea.form-control {
    line-height: 1.45;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text,
[data-bs-theme="dark"] textarea.form-control {
    color: var(--ink);
    background-color: color-mix(in srgb, var(--surface) 94%, #000);
    border-color: var(--border);
}

[data-bs-theme="dark"] .form-control::placeholder,
[data-bs-theme="dark"] textarea.form-control::placeholder {
    color: color-mix(in srgb, var(--muted) 78%, transparent);
}

[data-bs-theme="dark"] .ck.ck-editor {
    --ck-color-base-background: var(--surface);
    --ck-color-base-foreground: var(--surface-2);
    --ck-color-base-border: var(--border);
    --ck-color-text: var(--ink);
    --ck-color-toolbar-background: color-mix(in srgb, var(--surface) 95%, #000);
    --ck-color-button-default-hover-background: var(--surface-3);
    --ck-color-button-on-background: var(--surface-3);
    --ck-color-button-on-hover-background: color-mix(in srgb, var(--surface-3) 80%, #000);
}

[data-bs-theme="dark"] .ck-editor__editable_inline,
[data-bs-theme="dark"] .rich-editor + .ck.ck-editor .ck-editor__editable_inline {
    color: var(--ink);
    background: color-mix(in srgb, var(--surface) 94%, #000);
}

.table {
    font-size: .82rem;
}

.table > :not(caption) > * > * {
    padding: 10px 13px;
}

.table thead th {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .035em;
}

.badge {
    border-radius: 999px;
    padding: .35em .62em;
    font-size: .72rem;
    font-weight: 500;
}

.dt-container {
    padding: 16px 18px 18px;
    font-size: .82rem;
}

.dt-search label,
.dt-length label,
.dt-info {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 300;
}

.dt-search input,
.dt-length select {
    min-height: 32px;
    font-size: .8rem;
}

.report-grid {
    gap: 18px;
}

.report-card {
    height: 330px;
}

.report-card-header {
    padding: 15px 17px 9px;
}

.report-card-header h2 {
    font-weight: 500;
}

.report-card-header p {
    font-size: .78rem;
}

.report-chart-wrap {
    max-height: 238px;
}

.lookup-grid {
    gap: 12px;
}

.lookup-grid > div,
.lookup-loading {
    min-height: 68px;
    padding: 12px 14px;
}

.lookup-grid span {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .035em;
}

.lookup-grid strong {
    font-size: .82rem;
    font-weight: 400;
}

.swal2-container {
    position: fixed;
    z-index: 2000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    overflow-x: hidden;
    overflow-y: auto;
    background: rgba(15, 23, 42, .38);
    pointer-events: auto;
}

.swal2-container.swal2-no-backdrop {
    background: transparent;
    pointer-events: none;
}

.swal2-container.swal2-no-backdrop .swal2-popup {
    pointer-events: auto;
}

.app-toast-stack {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2600;
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 12px;
    width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

.app-toast {
    --toast-accent: #1d4ed8;
    --toast-soft: #eff6ff;
    --toast-glow: rgba(29, 78, 216, .18);
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 30px;
    gap: 12px;
    width: 100%;
    min-height: 76px;
    padding: 14px 14px 16px;
    overflow: hidden;
    color: var(--ink);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--toast-accent) 13%, transparent), transparent 42%),
        color-mix(in srgb, var(--surface) 96%, #fff);
    border: 1px solid color-mix(in srgb, var(--toast-accent) 30%, var(--border));
    border-radius: 12px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .16), 0 0 0 1px rgba(255,255,255,.18) inset;
    pointer-events: auto;
    animation: app-toast-enter .28s cubic-bezier(.2, .8, .2, 1);
}

.app-toast::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, var(--toast-accent), color-mix(in srgb, var(--toast-accent) 62%, #fff));
}

.app-toast.is-leaving {
    animation: app-toast-leave .24s ease-in forwards;
}

.app-toast-success {
    --toast-accent: #16a34a;
    --toast-soft: #ecfdf3;
    --toast-glow: rgba(22, 163, 74, .2);
}

.app-toast-warning {
    --toast-accent: #f59e0b;
    --toast-soft: #fffbeb;
    --toast-glow: rgba(245, 158, 11, .23);
}

.app-toast-danger {
    --toast-accent: #e11d48;
    --toast-soft: #fff1f2;
    --toast-glow: rgba(225, 29, 72, .22);
}

.app-toast-info {
    --toast-accent: #0ea5e9;
    --toast-soft: #f0f9ff;
    --toast-glow: rgba(14, 165, 233, .22);
}

.app-toast-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-top: 1px;
    color: var(--toast-accent);
    background: color-mix(in srgb, var(--toast-accent) 13%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--toast-accent) 26%, transparent);
    border-radius: 10px;
    box-shadow: 0 10px 24px var(--toast-glow);
}

.app-toast-icon svg {
    width: 21px;
    height: 21px;
    stroke-width: 2.35;
}

.app-toast-content {
    min-width: 0;
    padding-top: 1px;
}

.app-toast-content strong,
.app-toast-content span {
    display: block;
}

.app-toast-content strong {
    margin-bottom: 3px;
    color: var(--ink);
    font-size: .93rem;
    font-weight: 760;
    line-height: 1.25;
}

.app-toast-content span {
    color: color-mix(in srgb, var(--ink) 78%, var(--muted));
    font-size: .84rem;
    line-height: 1.42;
}

.app-toast-close {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
}

.app-toast-close:hover {
    color: var(--toast-accent);
    background: color-mix(in srgb, var(--toast-accent) 10%, transparent);
}

.app-toast-close svg {
    width: 17px;
    height: 17px;
}

.app-toast-progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 4px;
    background: color-mix(in srgb, var(--toast-accent) 12%, transparent);
}

.app-toast-progress span {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, color-mix(in srgb, var(--toast-accent) 70%, #fff), var(--toast-accent));
    border-radius: 0 999px 999px 0;
    transform: scaleX(0);
    transform-origin: left center;
    animation-name: app-toast-progress;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

[data-bs-theme="dark"] .app-toast {
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--toast-accent) 16%, transparent), transparent 46%),
        color-mix(in srgb, var(--surface) 94%, #000);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .42);
}

@keyframes app-toast-enter {
    from {
        opacity: 0;
        transform: translateX(22px) translateY(-4px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateX(0) translateY(0) scale(1);
    }
}

@keyframes app-toast-leave {
    to {
        opacity: 0;
        transform: translateX(22px) scale(.98);
    }
}

@keyframes app-toast-progress {
    to {
        transform: scaleX(1);
    }
}

body.swal2-toast-shown .swal2-container,
.swal2-container.swal2-top-end {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 16px;
    background: transparent;
    pointer-events: none;
}

body.swal2-toast-shown .swal2-popup.swal2-toast,
.swal2-popup.swal2-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(100%, 380px);
    padding: 12px 14px;
    pointer-events: auto;
    text-align: left;
    border-radius: 8px;
}

.swal2-popup.swal2-toast .swal2-icon {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    margin: 0;
    border-width: 2px;
    font-size: 1rem;
}

.swal2-popup.swal2-toast .swal2-title {
    margin: 0;
    font-size: .9rem;
    line-height: 1.35;
}

.swal2-popup.swal2-toast .swal2-html-container {
    margin: 2px 0 0;
    font-size: .8rem;
}

.swal2-popup.swal2-toast .swal2-timer-progress-bar-container {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
}

.swal2-popup.swal2-toast .swal2-timer-progress-bar {
    height: 3px;
    background: color-mix(in srgb, var(--accent) 70%, transparent);
}

body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) {
    overflow: hidden;
}

.swal2-popup {
    display: none;
    width: min(100%, 420px);
    max-width: 100%;
    padding: 24px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .24);
    text-align: center;
}

.swal2-popup.swal2-show {
    animation: swal2-pop-in .16s ease-out;
}

.swal2-title {
    margin: 0 0 8px;
    padding: 0;
    color: var(--ink);
    font-size: 1.08rem;
    font-weight: 550;
}

.swal2-html-container {
    margin: 0;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 300;
    line-height: 1.5;
}

.swal2-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.swal2-confirm,
.swal2-deny,
.swal2-cancel {
    min-height: 34px;
    padding: .44rem .92rem;
    color: #fff;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-size: .84rem;
    font-weight: 500;
}

.swal2-confirm {
    background: var(--accent);
}

.swal2-deny {
    background: #b91c1c;
}

.swal2-cancel {
    background: #64748b;
}

.swal2-confirm:focus-visible,
.swal2-deny:focus-visible,
.swal2-cancel:focus-visible {
    outline: 0;
    box-shadow: var(--ring);
}

.swal2-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border: 3px solid currentColor;
    border-radius: 50%;
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
}

.swal2-icon > * {
    display: none !important;
}

.swal2-success {
    color: #15803d;
    background: #dcfce7;
}

.swal2-success::before {
    content: "\2713";
}

.swal2-error {
    color: #b91c1c;
    background: #fee2e2;
}

.swal2-error::before {
    content: "\00d7";
}

.swal2-warning {
    color: #a16207;
    background: #fef3c7;
}

.swal2-warning::before {
    content: "!";
}

.swal2-info {
    color: #0369a1;
    background: #e0f2fe;
}

.swal2-info::before {
    content: "i";
}

.swal2-question {
    color: #6d28d9;
    background: #ede9fe;
}

.swal2-question::before {
    content: "?";
}

@keyframes swal2-pop-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ck.ck-editor {
    font-size: .84rem;
}

.ck-editor__editable_inline,
.rich-editor + .ck.ck-editor .ck-editor__editable_inline {
    min-height: 150px;
}

.form-control,
.form-select,
.input-group-text {
    border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
    border-radius: 20px;
    background-color: color-mix(in srgb, var(--surface) 97%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 2px rgba(15, 23, 42, .03);
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.form-control:hover,
.form-select:hover {
    border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
}

.form-control:focus,
.form-select:focus {
    border-color: color-mix(in srgb, var(--accent) 78%, #fff);
    box-shadow: var(--ring), 0 6px 18px rgba(15, 23, 42, .06);
}

.input-group > .form-control,
.input-group > .form-select,
.input-group > .input-group-text,
.input-group > .btn {
    border-radius: 12px;
}

.input-group > :not(:first-child) {
    margin-left: 6px;
}

.date-picker-field {
    display: flex;
    align-items: stretch;
    gap: 6px;
    position: relative;
}

.date-picker-field .js-date {
    min-width: 0;
    flex: 1 1 auto;
}

.date-picker-button {
    flex: 0 0 38px;
    width: 38px;
    padding-inline: 0;
}

.date-picker-native {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

[data-bs-theme="dark"] textarea,
[data-bs-theme="dark"] textarea.form-control,
[data-bs-theme="dark"] .swal2-textarea {
    color: var(--ink);
    background-color: color-mix(in srgb, var(--surface) 94%, #000);
    border-color: var(--border);
}

[data-bs-theme="dark"] .ck.ck-editor,
[data-bs-theme="dark"] .ck.ck-editor__main > .ck-editor__editable {
    color: var(--ink);
    background: color-mix(in srgb, var(--surface) 94%, #000);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-check .form-check-input[type="checkbox"] {
    width: 2.55rem;
    height: 1.35rem;
    flex: 0 0 auto;
    margin-top: 0;
    margin-left: 0;
    border-radius: 999px;
    border-color: color-mix(in srgb, var(--border) 88%, transparent);
    background-color: var(--surface-3);
    background-image: radial-gradient(circle at .67rem 50%, #fff 0 .42rem, transparent .44rem);
    background-size: 100% 100%;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .12);
    cursor: pointer;
    transition: background-color .18s ease, background-position .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.form-check .form-check-input[type="checkbox"]:checked {
    border-color: var(--accent);
    background-color: var(--accent);
    background-image: radial-gradient(circle at 1.87rem 50%, #fff 0 .42rem, transparent .44rem);
}

.form-check .form-check-input[type="checkbox"]:focus {
    box-shadow: var(--ring);
}

.form-check .form-check-label {
    margin-bottom: 0;
}

.permission-grid .permission-item {
    align-items: flex-start;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
    white-space: nowrap;
}

.btn-soft-action,
.rounded-action {
    border-radius: 12px;
}

.auth-panel {
    padding: 28px;
}

.inventory-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.inventory-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: min(520px, 100%);
}

.inventory-filter .form-select {
    min-width: 280px;
}

.inventory-filter-label {
    color: var(--muted);
    font-weight: 700;
}

.inventory-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
    padding: 12px 14px;
    background: color-mix(in srgb, #2563eb 8%, var(--surface));
    border: 1px solid color-mix(in srgb, #2563eb 22%, var(--border));
    border-radius: 8px;
}

.inventory-pager strong,
.inventory-pager span {
    display: block;
}

.inventory-pager span {
    color: var(--muted);
    font-size: .84rem;
}

.inventory-pager nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inventory-empty-copy {
    max-width: 680px;
}

.inventory-overview,
.inventory-client-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.inventory-overview > div,
.inventory-client-summary > div {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 14px;
}

.inventory-overview span,
.inventory-client-summary span {
    display: block;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
}

.inventory-overview strong,
.inventory-client-summary strong {
    color: var(--ink);
    font-size: 1.35rem;
    line-height: 1.1;
}

.inventory-client-report {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    margin-bottom: 24px;
    padding: 20px;
}

.inventory-company-header {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    gap: 18px;
    align-items: start;
    border-bottom: 1px solid var(--line);
    margin-bottom: 18px;
    padding-bottom: 18px;
}

.inventory-company-logo {
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
    overflow: hidden;
}

.inventory-company-logo img {
    max-width: 82px;
    max-height: 82px;
    object-fit: contain;
}

.inventory-company-info > p {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
    margin: 0 0 4px;
    text-transform: uppercase;
}

.inventory-company-info h2 {
    color: var(--ink);
    font-size: 1.6rem;
    margin: 0 0 12px;
}

.inventory-company-info dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 16px;
    margin: 0;
}

.inventory-company-info dt,
.inventory-section-header span,
.inventory-generated span {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.inventory-company-info dd {
    color: var(--ink);
    margin: 0;
    overflow-wrap: anywhere;
}

.inventory-company-address {
    color: var(--muted);
    margin-top: 10px;
}

.inventory-generated {
    min-width: 128px;
    text-align: right;
}

.inventory-generated strong {
    display: block;
    color: var(--ink);
}

.inventory-section {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-top: 14px;
    overflow: hidden;
}

.inventory-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
}

.inventory-section-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-size: .98rem;
    margin: 0;
}

.inventory-section-header i {
    width: 18px;
    height: 18px;
}

.inventory-table {
    --bs-table-bg: transparent;
}

.inventory-table th {
    color: var(--muted);
    font-size: .72rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.inventory-table td {
    max-width: 280px;
    overflow-wrap: anywhere;
    vertical-align: top;
}

/* Visual refresh based on the ev1-ev10 references. */
:root {
    --sidebar-width: 232px;
    --app-max-width: 1120px;
    --accent: #3b63f4;
    --accent-strong: #2f50d8;
    --accent-soft: #e8eefc;
    --nav-blue: #3b63f4;
    --nav-blue-2: #14b8a6;
    --nav-gold: #79d7c8;
    --nav-gold-soft: #edf7f8;
    --teal: #14b8a6;
    --mint: #dff8ef;
    --rose: #f3dce4;
    --amber: #f6e8bd;
    --ink: #192436;
    --muted: #718096;
    --surface: #ffffff;
    --surface-2: #f6f9fc;
    --surface-3: #eef5fb;
    --border: #dde8f2;
    --line: rgba(48, 67, 92, .10);
    --shadow-sm: 0 8px 24px rgba(40, 59, 86, .08);
    --shadow-md: 0 20px 54px rgba(40, 59, 86, .13);
    --ring: 0 0 0 .22rem rgba(59, 99, 244, .16);
}

[data-bs-theme="dark"] {
    --accent: #7f9cff;
    --accent-strong: #a7b9ff;
    --accent-soft: #182849;
    --nav-blue: #7f9cff;
    --nav-blue-2: #24c7b9;
    --nav-gold: #24c7b9;
    --nav-gold-soft: #132f37;
    --teal: #24c7b9;
    --mint: #0f3836;
    --rose: #3b1f2b;
    --amber: #3b321b;
    --ink: #e8eef7;
    --muted: #93a4ba;
    --surface: #121b2a;
    --surface-2: #0b1320;
    --surface-3: #172437;
    --border: #26364d;
    --line: rgba(222, 232, 245, .10);
    --shadow-sm: 0 10px 28px rgba(0, 0, 0, .22);
    --shadow-md: 0 24px 60px rgba(0, 0, 0, .34);
    --ring: 0 0 0 .22rem rgba(127, 156, 255, .20);
}

body {
    background:
        linear-gradient(118deg, #eaf1ff 0%, #f2f7fb 48%, #e6f7f4 100%);
}

[data-bs-theme="dark"] body {
    background:
        linear-gradient(118deg, #08111f 0%, #111c2d 52%, #062929 100%);
}

.app-topnav {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) auto;
    min-height: 58px;
    color: var(--ink);
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    border-bottom: 1px solid var(--line);
    box-shadow: none;
    backdrop-filter: blur(18px);
}

[data-bs-theme="dark"] .app-topnav {
    background: color-mix(in srgb, #0b1320 82%, transparent);
}

.top-brand {
    color: var(--ink);
    font-size: .98rem;
    font-weight: 760;
}

.top-brand:hover {
    color: var(--accent);
}

.top-brand img {
    width: 28px;
    height: 28px;
}

.top-menu a,
.top-icon,
.top-user {
    color: color-mix(in srgb, var(--ink) 76%, var(--muted));
}

.top-menu {
    gap: 5px;
    padding: 9px 0;
}

.top-menu a {
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: .84rem;
    font-weight: 720;
}

.top-menu a.active,
.top-menu a:hover,
.top-icon:hover,
.top-icon.active,
.top-user:hover {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border-color: color-mix(in srgb, var(--accent) 18%, transparent);
}

.top-menu a.active::after {
    display: none;
}

.top-actions {
    padding: 0 16px 0 10px;
}

.top-icon,
.top-user {
    min-height: 38px;
    border: 1px solid transparent;
    border-radius: 8px;
}

.app-body {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: calc(100vh - 58px);
}

.app-sidebar {
    top: 58px;
    height: calc(100vh - 58px);
    padding: 20px 14px 26px;
    background: transparent;
    border-right: 0;
}

[data-bs-theme="dark"] .app-sidebar {
    background: transparent;
    border-right: 0;
}

.side-section {
    margin-bottom: 12px;
}

.side-section > p {
    margin: 12px 10px 7px;
    color: color-mix(in srgb, var(--muted) 90%, var(--ink));
    font-size: .68rem;
    letter-spacing: 0;
}

.nav-link {
    min-height: 36px;
    margin-bottom: 3px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: color-mix(in srgb, var(--ink) 72%, var(--muted));
    font-size: .84rem;
    font-weight: 640;
}

.nav-link.active,
.nav-link:hover {
    color: var(--accent);
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    border-color: color-mix(in srgb, var(--accent) 18%, var(--border));
    box-shadow: 0 8px 20px rgba(44, 75, 130, .06);
}

[data-bs-theme="dark"] .nav-link.active,
[data-bs-theme="dark"] .nav-link:hover {
    color: var(--accent-strong);
    background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.app-main {
    background: transparent;
}

.topbar {
    position: static;
    width: min(var(--app-max-width), calc(100% - 44px));
    min-height: auto;
    margin: 24px auto 0;
    padding: 0 2px 14px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
}

.page-kicker {
    color: var(--accent);
    font-size: .66rem;
    font-weight: 800;
}

.topbar h1 {
    color: var(--ink);
    font-size: 1.42rem;
    font-weight: 760;
}

.content-wrap {
    width: min(var(--app-max-width), calc(100% - 44px));
    margin: 0 auto;
    padding: 0 0 48px;
}

.panel,
.stat-card,
.report-card,
.report-summary-card,
.equipment-card,
.equipment-summary-card,
.help-guide-card,
.inventory-client-report,
.inventory-overview > div,
.inventory-client-summary > div,
.pending-summary-item,
.billing-panel,
.lookup-grid > div,
.lookup-loading {
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.panel::before {
    display: none;
}

.panel-header,
.report-card-header,
.help-guide-header,
.billing-email-modal .modal-header,
.billing-email-modal .modal-footer,
.inventory-section-header {
    background: color-mix(in srgb, var(--surface-3) 68%, var(--surface));
    border-color: var(--line);
}

.module-hero,
.report-hero,
.help-hero {
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.module-hero,
.report-hero {
    background:
        linear-gradient(100deg, color-mix(in srgb, var(--accent) 9%, var(--surface)) 0%, color-mix(in srgb, var(--teal) 10%, var(--surface)) 100%);
}

.help-hero {
    color: var(--ink);
    background:
        linear-gradient(100deg, color-mix(in srgb, var(--accent) 12%, var(--surface)) 0%, color-mix(in srgb, var(--teal) 16%, var(--surface)) 100%);
}

.help-hero span,
.help-hero p {
    color: var(--muted);
}

.help-hero-icon {
    color: var(--accent);
    background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.module-hero h2,
.help-hero h2 {
    font-size: 1.34rem;
}

.form-grid {
    padding: 20px;
}

.form-section {
    background: color-mix(in srgb, var(--surface) 74%, var(--surface-2));
    border-color: var(--line);
}

.form-section h2::before {
    flex-basis: 30px;
    width: 30px;
    height: 8px;
    background:
        linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 11px, var(--teal) 11px 19px, transparent 19px 22px, #ef7b98 22px 30px);
    border-radius: 999px;
}

.form-control,
.form-select,
.dt-search input,
.dt-length select {
    min-height: 40px;
    border-color: var(--border);
    border-radius: 8px;
    background-color: color-mix(in srgb, var(--surface) 88%, transparent);
}

.form-control:focus,
.form-select:focus,
.dt-search input:focus,
.dt-length select:focus {
    border-color: color-mix(in srgb, var(--accent) 78%, var(--border));
    box-shadow: var(--ring);
}

.btn {
    min-height: 38px;
    border-radius: 8px;
    font-size: .88rem;
}

.btn-primary {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: var(--accent-strong);
    --bs-btn-hover-border-color: var(--accent-strong);
    box-shadow: 0 10px 22px rgba(59, 99, 244, .18);
}

.btn-outline-secondary {
    --bs-btn-border-color: var(--border);
    --bs-btn-color: color-mix(in srgb, var(--ink) 84%, var(--muted));
    background: color-mix(in srgb, var(--surface) 74%, transparent);
}

.table > :not(caption) > * > * {
    padding: 10px 12px;
    border-color: var(--line);
}

.table thead th {
    color: var(--muted);
    background: color-mix(in srgb, var(--surface-3) 74%, var(--surface));
    font-size: .68rem;
}

.badge,
.status-pill {
    border-radius: 999px;
}

.status-active,
.status-done,
.status-paid,
.severity-low {
    color: #067647;
    background: var(--mint);
}

.status-open,
.severity-medium,
.severity-info {
    color: #2752d8;
    background: var(--accent-soft);
}

.status-maintenance,
.status-pending,
.severity-high,
.severity-warning {
    color: #8a5d00;
    background: var(--amber);
}

.status-overdue,
.status-revoked,
.severity-danger,
.severity-critical {
    color: #a33a55;
    background: var(--rose);
}

[data-bs-theme="dark"] .status-active,
[data-bs-theme="dark"] .status-done,
[data-bs-theme="dark"] .status-paid,
[data-bs-theme="dark"] .severity-low {
    color: #7ee7bf;
}

[data-bs-theme="dark"] .status-open,
[data-bs-theme="dark"] .severity-medium,
[data-bs-theme="dark"] .severity-info {
    color: #b7c6ff;
}

[data-bs-theme="dark"] .status-maintenance,
[data-bs-theme="dark"] .status-pending,
[data-bs-theme="dark"] .severity-high,
[data-bs-theme="dark"] .severity-warning {
    color: #f2d58b;
}

[data-bs-theme="dark"] .status-overdue,
[data-bs-theme="dark"] .status-revoked,
[data-bs-theme="dark"] .severity-danger,
[data-bs-theme="dark"] .severity-critical {
    color: #ffb1c1;
}

.stat-card strong,
.report-summary-card strong,
.equipment-summary-card strong,
.inventory-overview strong,
.inventory-client-summary strong {
    font-weight: 760;
}

.equipment-card-visual,
.equipment-preview {
    background:
        linear-gradient(120deg, color-mix(in srgb, var(--accent) 9%, transparent), color-mix(in srgb, var(--teal) 10%, transparent)),
        color-mix(in srgb, var(--surface-3) 60%, var(--surface));
}

.auth-page {
    background:
        linear-gradient(118deg, #eaf1ff 0%, #f4f8fb 48%, #e7f8f5 100%);
}

[data-bs-theme="dark"] .auth-page {
    background:
        linear-gradient(118deg, #08111f 0%, #111c2d 52%, #062929 100%);
}

@media (max-width: 1100px) {
    .app-topnav,
    .app-body {
        grid-template-columns: 210px minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    html {
        font-size: 13.5px;
    }

    .app-topnav {
        position: static;
        grid-template-columns: minmax(0, 1fr) auto;
        min-height: auto;
        top: 0;
    }

    .global-client-context-bar {
        position: static;
        align-items: flex-start;
        flex-direction: column;
        min-height: auto;
        padding: 10px 14px;
    }

    .global-client-context-summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
        width: 100%;
    }

    .global-client-context-summary small {
        white-space: normal;
    }

    .global-client-context-divider {
        display: none;
    }

    .global-client-context-actions {
        width: 100%;
    }

    .global-client-context-actions .btn {
        flex: 1 1 auto;
    }

    .top-brand {
        padding: 12px 14px;
    }

    .top-actions {
        grid-column: 2;
        grid-row: 1;
        padding: 8px 10px;
    }

    .top-menu {
        grid-column: 1 / -1;
        padding: 0 10px 10px;
    }

    .app-body {
        display: block;
        min-height: auto;
    }

    .app-sidebar {
        position: static;
        height: auto;
        top: auto;
        padding: 10px;
        overflow: visible;
    }

    .side-section {
        margin: 0 0 8px;
    }

    .side-section > p {
        display: none;
    }

    .app-sidebar .nav {
        display: flex;
        flex-direction: row !important;
        overflow-x: auto;
        gap: 6px !important;
        padding-bottom: 2px;
    }

    .nav-link {
        white-space: nowrap;
    }

    .topbar,
    .content-wrap {
        width: calc(100% - 24px);
    }

    .content-wrap {
        padding: 0 0 28px;
    }

    .topbar {
        min-height: auto;
        margin-top: 16px;
        padding: 0 0 12px;
    }

    .form-section {
        padding: 18px;
    }

    .module-hero,
    .report-hero {
        padding: 18px;
    }

    .billing-modal-grid {
        grid-template-columns: 1fr;
    }

    .billing-panel-header,
    .billing-recipient-row {
        flex-direction: column;
    }

    .billing-filter {
        width: 100%;
    }

    .billing-recipient-meta {
        align-items: flex-start;
        text-align: left;
    }

    .help-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .help-guide-grid {
        grid-template-columns: 1fr;
    }

    .equipment-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inventory-toolbar,
    .inventory-filter {
        align-items: stretch;
        flex-direction: column;
    }

    .inventory-filter .form-select {
        min-width: 0;
        width: 100%;
    }

    .inventory-overview,
    .inventory-client-summary,
    .inventory-company-info dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inventory-company-header {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .inventory-company-logo {
        width: 72px;
        height: 72px;
    }

    .inventory-company-logo img {
        max-width: 60px;
        max-height: 60px;
    }

    .inventory-generated {
        grid-column: 1 / -1;
        text-align: left;
    }

    .equipment-form-layout {
        grid-template-columns: 1fr;
    }

    .equipment-preview {
        position: static;
    }

    .app-toast-stack {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .app-toast {
        grid-template-columns: 34px minmax(0, 1fr) 28px;
        min-height: 70px;
        padding: 12px 12px 15px;
    }

    .app-toast-icon {
        width: 34px;
        height: 34px;
    }
}

@media (max-width: 1100px) {
    .ticket-filter-form,
    .ticket-chart-grid,
    .ticket-detail-grid,
    .ticket-meta-grid {
        grid-template-columns: 1fr;
    }

    .ticket-message {
        max-width: 100%;
    }
}

.client-workspace {
    display: grid;
    gap: 18px;
}

.client-context-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px;
    background:
        linear-gradient(110deg, color-mix(in srgb, var(--accent) 10%, var(--surface)) 0%, color-mix(in srgb, var(--teal) 13%, var(--surface)) 100%);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.client-context-identity {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.client-context-logo {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    overflow: hidden;
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent), var(--teal));
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(40, 59, 86, .12);
}

.client-context-logo img {
    max-width: 54px;
    max-height: 54px;
    object-fit: contain;
}

.client-context-logo span {
    font-size: 1.15rem;
    font-weight: 800;
}

.client-context-header h2 {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 1.36rem;
    font-weight: 760;
}

.client-context-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.client-context-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 4px 9px;
    color: color-mix(in srgb, var(--ink) 78%, var(--muted));
    background: color-mix(in srgb, var(--surface) 74%, transparent);
    border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 650;
}

.client-context-meta svg {
    width: 14px;
    height: 14px;
}

.client-context-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.client-workspace-grid {
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.client-context-sidebar {
    position: sticky;
    top: 18px;
    display: grid;
    gap: 12px;
    padding: 14px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.client-context-nav-group p {
    margin: 0 0 7px;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.client-context-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 34px;
    padding: 7px 9px;
    color: color-mix(in srgb, var(--ink) 78%, var(--muted));
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 650;
}

.client-context-nav-link:hover {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 9%, transparent);
    border-color: color-mix(in srgb, var(--accent) 18%, var(--border));
}

.client-context-nav-link.active {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border-color: color-mix(in srgb, var(--accent) 26%, var(--border));
}

.client-context-nav-link span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.client-context-nav-link svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

.client-context-nav-link strong {
    min-width: 24px;
    padding: 2px 7px;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 760;
    text-align: center;
}

.context-readonly-field {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 12px;
    color: color-mix(in srgb, var(--ink) 84%, var(--muted));
    background: color-mix(in srgb, var(--accent) 7%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
    border-radius: 8px;
    font-size: .84rem;
    font-weight: 650;
}

.context-readonly-field svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: var(--accent);
}

.context-readonly-field span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-context-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.client-context-bar > div {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
}

.client-context-bar span {
    color: var(--accent);
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.client-context-bar strong {
    color: var(--ink);
    font-size: .92rem;
    font-weight: 760;
}

.client-context-bar small {
    color: var(--muted);
    font-size: .78rem;
}

:root {
    --global-client-context-height: 52px;
    --app-topnav-height: 58px;
}

.global-client-context-bar {
    position: sticky;
    top: 0;
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: var(--global-client-context-height);
    padding: 7px 18px;
    color: var(--ink);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

[data-bs-theme="dark"] .global-client-context-bar {
    background: color-mix(in srgb, #0b1320 90%, transparent);
}

.global-client-context-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-size: .86rem;
}

.global-client-context-user,
.global-client-context-scope {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    white-space: nowrap;
}

.global-client-context-user {
    font-weight: 700;
}

.global-client-context-scope strong {
    color: var(--muted);
    font-size: .76rem;
    text-transform: uppercase;
}

.global-client-context-name {
    display: inline-block;
    max-width: 380px;
    overflow: hidden;
    padding: 5px 10px;
    color: var(--accent-strong);
    background: color-mix(in srgb, var(--accent) 14%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border));
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(15, 118, 110, .10);
    font-size: 1.02rem;
    font-weight: 850;
    line-height: 1.15;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

[data-bs-theme="dark"] .global-client-context-name {
    color: #7dd3c7;
    background: color-mix(in srgb, var(--accent) 18%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
}

.global-client-context-summary small {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-client-context-divider {
    width: 1px;
    height: 20px;
    background: var(--line);
}

.global-client-context-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    flex: 0 0 auto;
}

.global-client-context-bar svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.1;
}

.client-context-search-field {
    position: relative;
    margin-bottom: 14px;
}

.client-context-search-field svg {
    position: absolute;
    top: 50%;
    left: 13px;
    width: 18px;
    height: 18px;
    color: var(--muted);
    transform: translateY(-50%);
}

.client-context-search-field .form-control {
    padding-left: 42px;
}

.client-context-results {
    display: grid;
    gap: 8px;
    min-height: 118px;
}

.client-context-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 12px 14px;
    color: var(--ink);
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.client-context-result:hover {
    border-color: color-mix(in srgb, var(--accent) 32%, var(--border));
    background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.client-context-result strong,
.client-context-result span {
    display: block;
}

.client-context-result span {
    color: var(--muted);
    font-size: .82rem;
}

.client-context-result i {
    color: var(--accent);
}

.client-account-modal .modal-body {
    display: grid;
    gap: 18px;
}

.client-account-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.client-account-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    color: #fff;
    background: linear-gradient(135deg, #0f766e, #2563eb);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    font-size: 1.15rem;
    font-weight: 850;
}

.client-account-hero h3,
.client-account-section h3 {
    margin: 0;
    letter-spacing: 0;
}

.client-account-hero h3 {
    font-size: 1.32rem;
    font-weight: 850;
}

.client-account-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.client-account-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 4px 9px;
    color: color-mix(in srgb, var(--ink) 82%, var(--muted));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 650;
}

.client-account-meta svg,
.client-product-summary-item svg {
    width: 16px;
    height: 16px;
}

.client-account-section {
    display: grid;
    gap: 12px;
}

.client-account-section h3 {
    font-size: .95rem;
    font-weight: 800;
}

.client-account-info-grid,
.client-product-summary,
.client-product-grid {
    display: grid;
    gap: 10px;
}

.client-account-info-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.client-account-info-grid > div,
.client-product-summary-item,
.client-product-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.client-account-info-grid > div {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 11px 12px;
}

.client-account-info-grid span,
.client-product-summary-item span,
.client-product-list small {
    color: var(--muted);
    font-size: .78rem;
}

.client-account-info-grid strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: .9rem;
    font-weight: 720;
}

.client-product-summary {
    grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
}

.client-product-summary-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 9px;
    align-items: center;
    min-height: 76px;
    padding: 11px 12px;
}

.client-product-summary-item svg {
    color: var(--accent);
    grid-row: span 2;
}

.client-product-summary-item strong {
    font-size: 1.24rem;
    font-weight: 850;
    line-height: 1;
}

.client-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-product-panel {
    min-width: 0;
    padding: 13px;
}

.client-product-panel.wide {
    grid-column: 1 / -1;
}

.client-product-panel h4 {
    margin: 0 0 10px;
    color: var(--ink);
    font-size: .88rem;
    font-weight: 800;
}

.client-product-list {
    display: grid;
    gap: 8px;
}

.client-product-list > div {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 9px 0;
    border-top: 1px solid var(--line);
}

.client-product-list > div:first-child {
    padding-top: 0;
    border-top: 0;
}

.client-product-list span {
    min-width: 0;
    color: var(--ink);
    font-size: .88rem;
    font-weight: 690;
}

.client-product-list small {
    display: block;
    margin-top: 2px;
    overflow-wrap: anywhere;
    font-weight: 500;
}

.client-product-list strong {
    flex: 0 0 auto;
    color: var(--accent-strong);
    font-size: .85rem;
    font-weight: 800;
    white-space: nowrap;
}

.client-product-list.compact > div {
    align-items: center;
    padding: 7px 0;
}

.client-product-empty {
    margin: 0;
    color: var(--muted);
    font-size: .84rem;
}

.client-transfer-modal .modal-body {
    display: grid;
    gap: 15px;
}

.client-transfer-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
    border-radius: 8px;
}

.client-transfer-current span,
.client-transfer-destination dt {
    color: var(--muted);
    font-size: .76rem;
    font-weight: 700;
    text-transform: uppercase;
}

.client-transfer-current strong {
    display: block;
    margin-top: 2px;
    font-size: 1.02rem;
    font-weight: 820;
}

.client-transfer-current small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: .82rem;
}

.client-transfer-current svg {
    width: 22px;
    height: 22px;
    color: var(--accent);
}

.client-transfer-select {
    display: grid;
    gap: 5px;
}

.client-transfer-destinations {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-height: 430px;
    overflow: auto;
    padding-right: 2px;
}

.client-transfer-destination {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.client-transfer-destination.root-option {
    background: color-mix(in srgb, #2563eb 8%, var(--surface));
    border-color: color-mix(in srgb, #2563eb 22%, var(--border));
}

.client-transfer-destination-title {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.client-transfer-destination-title svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    color: var(--accent);
}

.client-transfer-destination-title strong,
.client-transfer-destination-title span {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.client-transfer-destination-title strong {
    color: var(--ink);
    font-size: .94rem;
    font-weight: 800;
}

.client-transfer-destination-title span,
.client-transfer-destination p {
    color: var(--muted);
    font-size: .82rem;
}

.client-transfer-destination p {
    margin: 0;
}

.client-transfer-destination dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    margin: 0;
}

.client-transfer-destination dt,
.client-transfer-destination dd {
    margin: 0;
}

.client-transfer-destination dd {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: .83rem;
    font-weight: 650;
}

.app-topnav {
    top: var(--global-client-context-height);
}

.app-body {
    min-height: calc(100vh - var(--app-topnav-height) - var(--global-client-context-height));
}

.app-sidebar {
    top: calc(var(--app-topnav-height) + var(--global-client-context-height));
    height: calc(100vh - var(--app-topnav-height) - var(--global-client-context-height));
}

@media (max-width: 760px) {
    .app-topnav {
        top: 0;
    }

    .global-client-context-bar {
        position: static;
        align-items: flex-start;
        flex-direction: column;
        min-height: auto;
        padding: 10px 14px;
    }

    .global-client-context-summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
        width: 100%;
    }

    .global-client-context-summary small {
        white-space: normal;
    }

    .global-client-context-name {
        max-width: 100%;
    }

    .global-client-context-divider {
        display: none;
    }

    .global-client-context-actions {
        width: 100%;
    }

    .global-client-context-actions .btn {
        flex: 1 1 auto;
    }

    .app-sidebar {
        top: auto;
        height: auto;
    }

    .client-account-hero {
        align-items: flex-start;
    }

    .client-product-grid {
        grid-template-columns: 1fr;
    }

    .client-transfer-destinations {
        grid-template-columns: 1fr;
        max-height: none;
    }

    .client-transfer-destination dl {
        grid-template-columns: 1fr;
    }
}

.client-workspace-main {
    min-width: 0;
}

.client-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.client-summary-card {
    display: grid;
    gap: 7px;
    min-height: 96px;
    padding: 15px;
    color: var(--ink);
    text-decoration: none;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.client-summary-card:hover {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}

.client-summary-card span {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.client-summary-card strong {
    font-size: 1.65rem;
    line-height: 1;
    font-weight: 800;
}

.client-summary-card.tone-blue {
    border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}

.client-summary-card.tone-rose {
    border-color: color-mix(in srgb, #ef7b98 36%, var(--border));
}

.client-summary-card.tone-amber {
    border-color: color-mix(in srgb, #d5aa37 40%, var(--border));
}

.client-summary-card.tone-teal {
    border-color: color-mix(in srgb, var(--teal) 34%, var(--border));
}

.client-indicator-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 280px;
}

.client-indicator-badges .badge {
    font-weight: 700;
}

.client-timeline-hero {
    margin-bottom: 18px;
    border-top: 4px solid var(--accent);
}

.client-timeline-toolbar {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
    padding: 16px;
}

.client-timeline-filter {
    display: grid;
    grid-template-columns: minmax(170px, 1.2fr) minmax(140px, .75fr) minmax(140px, .75fr) auto;
    gap: 12px;
    align-items: end;
}

.client-timeline-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.client-timeline-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.client-timeline-summary span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    color: color-mix(in srgb, var(--ink) 78%, var(--muted));
    background: color-mix(in srgb, var(--surface-2) 72%, transparent);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 650;
}

.client-timeline-summary strong {
    color: var(--accent);
}

.client-timeline-panel {
    display: grid;
    gap: 0;
    padding: 10px 18px;
}

.client-timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
    padding: 16px 0;
}

.client-timeline-item + .client-timeline-item {
    border-top: 1px solid var(--line);
}

.client-timeline-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: var(--timeline-color, var(--accent));
    background: color-mix(in srgb, var(--timeline-color, var(--accent)) 11%, transparent);
    border: 1px solid color-mix(in srgb, var(--timeline-color, var(--accent)) 30%, var(--border));
    border-radius: 999px;
}

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

.client-timeline-item.severity-success {
    --timeline-color: #15803d;
}

.client-timeline-item.severity-warning {
    --timeline-color: #b45309;
}

.client-timeline-item.severity-danger,
.client-timeline-item.severity-critical {
    --timeline-color: #be123c;
}

.client-timeline-body {
    min-width: 0;
}

.client-timeline-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.client-timeline-item-header span {
    display: inline-flex;
    margin-bottom: 3px;
    color: var(--timeline-color, var(--accent));
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.client-timeline-item-header h3 {
    margin: 0;
    color: var(--ink);
    font-size: .98rem;
    font-weight: 760;
    overflow-wrap: anywhere;
}

.client-timeline-item-header time {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: .77rem;
    font-weight: 650;
    white-space: nowrap;
}

.client-timeline-body p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: .86rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.client-timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.client-timeline-meta span,
.client-timeline-meta a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    padding: 3px 8px;
    color: color-mix(in srgb, var(--ink) 76%, var(--muted));
    background: color-mix(in srgb, var(--surface-2) 70%, transparent);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 650;
    text-decoration: none;
}

.client-timeline-meta a {
    color: var(--accent);
}

.client-timeline-meta svg {
    width: 13px;
    height: 13px;
}

.client-timeline-meta .timeline-status {
    color: var(--timeline-color, var(--accent));
    background: color-mix(in srgb, var(--timeline-color, var(--accent)) 9%, transparent);
    border-color: color-mix(in srgb, var(--timeline-color, var(--accent)) 25%, var(--border));
}

.client-timeline-empty {
    margin: 14px 0;
}

.client-widget-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.client-widget {
    min-width: 0;
}

.client-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.client-widget-header span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: .78rem;
}

.client-widget-list {
    display: grid;
    padding: 8px 16px 16px;
}

.client-list-item {
    display: grid;
    gap: 5px;
    padding: 12px 0;
    color: var(--ink);
    text-decoration: none;
    border-top: 1px solid var(--line);
}

.client-list-item:first-child {
    border-top: 0;
}

.client-list-item:hover {
    color: var(--accent);
}

.client-list-item strong {
    overflow-wrap: anywhere;
    font-size: .9rem;
    font-weight: 760;
}

.client-list-item small {
    color: var(--muted);
    font-size: .78rem;
}

.client-list-badge {
    justify-self: start;
    min-height: 22px;
    padding: 3px 8px;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.client-list-badge.urgency-danger,
.client-list-badge.urgency-overdue,
.client-list-badge.urgency-critical {
    color: #a33a55;
    background: var(--rose);
}

.client-list-badge.urgency-warning,
.client-list-badge.urgency-high {
    color: #8a5d00;
    background: var(--amber);
}

.client-list-badge.urgency-normal,
.client-list-badge.urgency-medium,
.client-list-badge.urgency-low {
    color: #067647;
    background: var(--mint);
}

.client-ticket-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 16px;
}

.client-ticket-metrics div,
.client-ticket-metrics a,
.client-location-list > a,
.client-location-list > div {
    min-width: 0;
    padding: 13px;
    background: color-mix(in srgb, var(--surface-2) 68%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.client-ticket-metrics a {
    color: inherit;
    text-decoration: none;
}

.client-ticket-metrics a:hover {
    border-color: var(--accent);
}

.client-location-list > a {
    color: inherit;
    text-decoration: none;
}

.client-location-list > a:hover {
    border-color: var(--accent);
}

.client-ticket-metrics span,
.client-location-list span {
    display: block;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.client-location-list small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 600;
    text-transform: none;
}

.client-ticket-metrics strong,
.client-location-list strong {
    display: block;
    margin-top: 4px;
    font-size: 1.28rem;
    line-height: 1;
    font-weight: 800;
}

.client-ticket-metrics small {
    display: block;
    margin-top: 6px;
    font-size: .72rem;
    line-height: 1.25;
}

.client-location-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 16px;
}

.client-location-list .pending-empty {
    grid-column: 1 / -1;
}

.sidebar-search {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 10px 12px;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.sidebar-search svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: var(--muted);
}

.sidebar-search input {
    min-width: 0;
    width: 100%;
    color: var(--ink);
    font-size: .82rem;
    background: transparent;
    border: 0;
    outline: 0;
}

.sidebar-expand-all {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    color: var(--muted);
    background: color-mix(in srgb, var(--surface-2) 80%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.sidebar-expand-all:hover,
.sidebar-expand-all[aria-pressed="true"] {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}

.sidebar-expand-all svg {
    width: 15px;
    height: 15px;
}

.side-section {
    overflow: hidden;
    margin-bottom: 8px;
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    border-radius: 8px;
}

.side-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 38px;
    padding: 9px 10px;
    color: color-mix(in srgb, var(--ink) 78%, var(--muted));
    font-size: .72rem;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
    background: transparent;
    border: 0;
}

.side-section-toggle svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    transition: transform .16s ease;
}

.side-section.is-open .side-section-toggle svg {
    transform: rotate(180deg);
}

.side-section-menu {
    display: grid;
    padding: 0 0 8px;
}

.side-section.is-collapsed .side-section-menu,
.side-section.is-filter-hidden,
.nav-link.is-filter-hidden {
    display: none !important;
}

.app-sidebar .side-section .nav-link {
    margin: 0 8px 3px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
}

.side-section-emphasis {
    background: color-mix(in srgb, #0891b2 8%, var(--surface));
    border-color: color-mix(in srgb, #0891b2 34%, var(--border));
}

.side-section-emphasis .side-section-toggle {
    color: color-mix(in srgb, #075985 84%, var(--ink));
}

.side-section-emphasis .nav-link {
    font-weight: 700;
}

.catalog-hero {
    border-top: 4px solid #0f766e;
}

.catalog-workspace-grid {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr) 330px;
    gap: 18px;
    align-items: start;
}

.catalog-type-panel,
.catalog-form-panel {
    position: sticky;
    top: 92px;
}

.catalog-type-list {
    display: grid;
    gap: 6px;
    padding: 12px;
}

.catalog-type-list a {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 9px 10px;
    color: color-mix(in srgb, var(--ink) 78%, var(--muted));
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 8px;
}

.catalog-type-list a.active,
.catalog-type-list a:hover {
    color: var(--accent);
    background: color-mix(in srgb, var(--surface-3) 52%, transparent);
    border-color: color-mix(in srgb, var(--accent) 18%, var(--border));
}

.catalog-type-list svg {
    width: 16px;
    height: 16px;
}

.catalog-type-list span {
    min-width: 0;
    overflow: hidden;
    font-size: .82rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.catalog-type-list strong {
    min-width: 26px;
    padding: 2px 7px;
    color: var(--muted);
    font-size: .72rem;
    text-align: center;
    background: color-mix(in srgb, var(--surface-2) 72%, transparent);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.catalog-main-stack {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.catalog-list-header {
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.catalog-list-header p {
    margin-top: 4px;
    color: var(--muted);
    font-size: .82rem;
}

.catalog-coverage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
    padding: 16px;
}

.catalog-coverage-grid a {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 10px;
    color: inherit;
    text-decoration: none;
    background: color-mix(in srgb, var(--surface-3) 35%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.catalog-coverage-grid a:hover {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.catalog-coverage-grid svg {
    width: 17px;
    height: 17px;
    color: var(--accent);
}

.catalog-form {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.asset-followup-hero {
    border-top: 4px solid #2563eb;
}

.asset-followup-layout {
    display: grid;
    grid-template-columns: minmax(240px, .8fr) minmax(0, 1.65fr) minmax(280px, .95fr);
    gap: 18px;
    align-items: start;
}

.pricing-table-panel,
.asset-followup-actions {
    position: sticky;
    top: 118px;
}

.pricing-table-list,
.asset-followup-actions {
    display: grid;
    gap: 12px;
}

.pricing-table-list {
    padding: 14px;
}

.pricing-table-row {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    color: inherit;
    text-decoration: none;
    background: color-mix(in srgb, var(--surface-2) 70%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.pricing-table-row:hover,
.pricing-table-row.active {
    color: var(--ink);
    background: color-mix(in srgb, var(--accent) 9%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 32%, var(--border));
}

.pricing-table-row strong,
.pricing-table-row small,
.pricing-table-meta b {
    display: block;
    min-width: 0;
}

.pricing-table-row small {
    margin-top: 3px;
    color: var(--muted);
    font-size: .78rem;
}

.pricing-table-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pricing-detail-header {
    align-items: flex-start;
}

.pricing-total-box {
    min-width: 150px;
    text-align: right;
}

.pricing-total-box span,
.pricing-approval-strip span,
.movement-row-money span {
    display: block;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.pricing-total-box strong {
    display: block;
    margin: 3px 0 6px;
    font-size: 1.25rem;
}

.pricing-approval-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 20px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-2) 68%, transparent);
}

.pricing-approval-strip strong,
.pricing-approval-strip small {
    display: block;
}

.pricing-approval-strip small {
    color: var(--muted);
}

.movement-timeline {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.movement-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 13px;
    background: color-mix(in srgb, var(--surface-2) 70%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.movement-row-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
    border-radius: 8px;
}

.movement-row-icon svg {
    width: 18px;
    height: 18px;
}

.movement-row-body {
    min-width: 0;
}

.movement-row-body > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.movement-row-body p,
.movement-row-body small,
.movement-row-money small {
    margin: 4px 0 0;
    color: var(--muted);
}

.movement-row-money {
    min-width: 132px;
    text-align: right;
}

.movement-row-money strong {
    display: block;
}

.approval-page {
    min-height: 100vh;
    padding: 32px;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, .10), transparent 34%),
        linear-gradient(315deg, rgba(37, 99, 235, .12), transparent 36%),
        var(--surface-2);
}

.approval-shell {
    max-width: 1040px;
    margin: 0 auto;
}

.approval-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 24px;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.approval-header h1 {
    margin: 0;
    font-size: clamp(1.45rem, 3vw, 2.25rem);
}

.approval-header p {
    margin: 8px 0 0;
    color: var(--muted);
}

.approval-total {
    min-width: 180px;
    text-align: right;
}

.approval-total span {
    display: block;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.approval-total strong {
    display: block;
    margin: 4px 0 8px;
    font-size: 1.45rem;
}

.approval-state {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px 16px;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.approval-state svg {
    width: 24px;
    height: 24px;
    color: var(--accent);
}

.approval-state strong,
.approval-state span {
    display: block;
}

.approval-state span {
    color: var(--muted);
}

.approval-decision-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.approval-form-body {
    padding: 18px;
}

.status-pending_approval,
.status-sent {
    color: #8a5d00;
    background: var(--amber);
}

.status-approved,
.status-addition,
.status-add {
    color: #067647;
    background: var(--mint);
}

.status-rejected,
.status-removal,
.status-remove {
    color: #a33a55;
    background: var(--rose);
}

.status-relocation,
.status-keep {
    color: #1d4ed8;
    background: color-mix(in srgb, #2563eb 13%, var(--surface));
}

.commercial-hero {
    border-top: 4px solid #7c3aed;
}

.commercial-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}

.commercial-actions {
    position: sticky;
    top: 118px;
    display: grid;
    gap: 14px;
}

.commercial-main {
    min-width: 0;
}

.commercial-section-header {
    align-items: flex-start;
}

.commercial-pipeline {
    display: grid;
    grid-template-columns: repeat(6, minmax(180px, 1fr));
    gap: 12px;
    padding: 16px;
    overflow-x: auto;
}

.pipeline-column {
    min-width: 180px;
    padding: 10px;
    background: color-mix(in srgb, var(--surface-2) 76%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.pipeline-column header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: .74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.pipeline-column header span {
    display: grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    color: var(--ink);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.pipeline-card-stack {
    display: grid;
    gap: 10px;
}

.pipeline-card {
    display: grid;
    gap: 7px;
    padding: 12px;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}

.pipeline-card strong,
.pipeline-card span,
.pipeline-card small,
.pipeline-card b {
    min-width: 0;
}

.pipeline-card span,
.pipeline-card small {
    color: var(--muted);
}

.pipeline-card > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pipeline-empty {
    padding: 16px 10px;
    color: var(--muted);
    font-size: .82rem;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: 8px;
}

.commercial-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, .75fr);
    gap: 18px;
    align-items: start;
}

.commercial-expiring-list {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.commercial-expiring-list article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    background: color-mix(in srgb, var(--surface-2) 70%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.commercial-expiring-list span {
    display: block;
    color: var(--muted);
    font-size: .82rem;
}

.commercial-proposal-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 320px;
}

.commercial-proposal-list {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 14px;
    border-right: 1px solid var(--line);
}

.commercial-proposal-list a {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    padding: 12px;
    background: color-mix(in srgb, var(--surface-2) 70%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.commercial-proposal-list a:hover,
.commercial-proposal-list a.active {
    background: color-mix(in srgb, var(--accent) 9%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 32%, var(--border));
}

.commercial-proposal-list small,
.commercial-proposal-list b {
    display: block;
}

.commercial-proposal-list small {
    margin-top: 3px;
    color: var(--muted);
}

.commercial-proposal-detail {
    min-width: 0;
}

.proposal-total-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 16px;
    background: color-mix(in srgb, var(--surface-2) 68%, transparent);
    border-bottom: 1px solid var(--line);
}

.proposal-total-strip div {
    min-width: 0;
    padding: 12px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.proposal-total-strip span {
    display: block;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.proposal-total-strip strong {
    display: block;
    margin-top: 4px;
}

.commercial-admin-grid {
    display: grid;
    gap: 14px;
}

.status-negotiation,
.status-qualified,
.status-proposal {
    color: #1d4ed8;
    background: color-mix(in srgb, #2563eb 13%, var(--surface));
}

.status-accepted,
.status-won {
    color: #067647;
    background: var(--mint);
}

.status-lost,
.status-cancelled,
.status-expired {
    color: #a33a55;
    background: var(--rose);
}

.status-sent,
.status-lead {
    color: #8a5d00;
    background: var(--amber);
}

.service-order-hero {
    border-top: 4px solid #0f766e;
}

.integration-hero {
    border-top: 4px solid #2563eb;
}

.integration-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .72fr);
    gap: 18px;
    align-items: start;
}

.hr-hero {
    border-top: 4px solid #0891b2;
}

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

.hr-shortcut-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    color: var(--ink);
    text-decoration: none;
    text-align: left;
    font: inherit;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: 1px solid color-mix(in srgb, #0891b2 28%, var(--border));
    border-left: 4px solid #0891b2;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.hr-shortcut-link:hover,
.hr-shortcut-link:focus {
    color: color-mix(in srgb, #075985 88%, var(--ink));
    background: color-mix(in srgb, #0891b2 9%, var(--surface));
    border-color: color-mix(in srgb, #0891b2 44%, var(--border));
}

.hr-shortcut-link svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
}

.hr-shortcut-link span {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 800;
}

.hr-anchor-target {
    scroll-margin-top: 136px;
}

.hr-employee-picker {
    display: grid;
    grid-template-columns: minmax(220px, 1.1fr) minmax(260px, 1.3fr) minmax(150px, .6fr) auto;
    gap: 12px;
    align-items: end;
    padding: 18px;
}

.hr-employee-picker select {
    min-height: 42px;
}

.hr-selected-employee-panel {
    overflow: hidden;
    border: 1px solid color-mix(in srgb, #0891b2 42%, var(--border));
    box-shadow: 0 18px 42px color-mix(in srgb, #0f172a 11%, transparent);
}

.hr-selected-employee-banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 20px;
    background: color-mix(in srgb, #0891b2 8%, var(--surface));
    border-bottom: 1px solid color-mix(in srgb, #0891b2 30%, var(--border));
}

.hr-profile-identity {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.hr-profile-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    color: color-mix(in srgb, #075985 88%, var(--ink));
    background: color-mix(in srgb, #0891b2 16%, var(--surface));
    border: 1px solid color-mix(in srgb, #0891b2 42%, var(--border));
    border-radius: 8px;
}

.hr-profile-avatar svg {
    width: 25px;
    height: 25px;
}

.hr-profile-label {
    display: block;
    margin-bottom: 3px;
    color: color-mix(in srgb, #075985 78%, var(--muted));
    font-size: .74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.hr-profile-title {
    margin: 0;
    color: var(--ink);
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.hr-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.hr-profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    padding: 6px 9px;
    color: color-mix(in srgb, var(--ink) 92%, #075985);
    background: color-mix(in srgb, var(--surface) 88%, #0891b2);
    border: 1px solid color-mix(in srgb, #0891b2 24%, var(--border));
    border-radius: 7px;
    font-size: .82rem;
    font-weight: 750;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.hr-profile-chip svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

.hr-profile-status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    flex: 0 0 auto;
    padding-top: 2px;
}

.hr-employee-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    padding: 18px 20px 20px;
    background: color-mix(in srgb, var(--surface-2) 34%, transparent);
}

.hr-employee-detail-grid > div {
    min-width: 0;
    padding: 15px 16px;
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--line) 72%, #0891b2);
    border-left: 4px solid color-mix(in srgb, #0891b2 82%, var(--line));
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.hr-employee-detail-grid span {
    display: block;
    color: color-mix(in srgb, var(--muted) 78%, var(--ink));
    font-size: .76rem;
    font-weight: 850;
    text-transform: uppercase;
}

.hr-employee-detail-grid strong {
    display: block;
    margin-top: 7px;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.hr-time-entry-form,
.hr-vacation-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
    padding: 18px;
}

.hr-time-entry-notes,
.hr-vacation-notes {
    grid-column: 1 / -1;
}

.hr-modal-form {
    padding: 0;
}

.hr-time-bulk-form {
    display: block;
}

.hr-time-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.hr-time-card-header > div {
    min-width: 0;
}

.hr-time-card-header .btn {
    flex: 0 0 auto;
}

.hr-time-bulk-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    background: color-mix(in srgb, var(--surface-2) 52%, transparent);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.hr-time-bulk-toolbar strong,
.hr-time-bulk-toolbar small {
    display: block;
}

.hr-time-bulk-toolbar small {
    margin-top: 3px;
    color: var(--muted);
}

.hr-time-bulk-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.hr-time-table-wrap {
    padding: 14px 18px 18px;
    max-height: none;
    overflow-x: visible;
    overflow-y: visible;
}

.hr-time-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.hr-time-table .hr-col-select { width: 50px; }
.hr-time-table .hr-col-date { width: 94px; }
.hr-time-table .hr-col-entry { width: 70px; }
.hr-time-table .hr-col-break { width: 112px; }
.hr-time-table .hr-col-exit { width: 66px; }
.hr-time-table .hr-col-expected { width: 86px; }
.hr-time-table .hr-col-worked { width: 94px; }
.hr-time-table .hr-col-day-balance { width: 74px; }
.hr-time-table .hr-col-final-balance { width: 74px; }
.hr-time-table .hr-col-status { width: 96px; }
.hr-time-table .hr-col-actions { width: 66px; }

.hr-time-table th,
.hr-time-table td {
    padding: 10px 6px;
    vertical-align: middle;
}

.hr-time-table th {
    line-height: 1.12;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    font-size: .68rem;
}

.hr-time-table td {
    white-space: nowrap;
    font-size: .82rem;
}

.hr-time-table .badge {
    font-size: .72rem;
    white-space: nowrap;
}

.hr-time-table .btn-sm {
    min-width: 32px;
    padding-right: .45rem;
    padding-left: .45rem;
}

.hr-time-table th:first-child,
.hr-time-table td:first-child {
    text-align: center;
}

.hr-time-table td:nth-child(1),
.hr-time-table td:nth-child(2),
.hr-time-table td:nth-child(8),
.hr-time-table td:nth-child(9) {
    background: color-mix(in srgb, var(--surface-2) 62%, transparent);
}

.hr-approval-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.hr-approval-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.hr-approval-summary-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 18px;
}

.hr-approval-summary-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: color-mix(in srgb, #075985 88%, var(--ink));
    background: color-mix(in srgb, #0891b2 14%, var(--surface));
    border: 1px solid color-mix(in srgb, #0891b2 38%, var(--border));
    border-radius: 8px;
}

.hr-approval-summary-icon svg {
    width: 23px;
    height: 23px;
}

.hr-approval-summary-card span,
.hr-approval-summary-card small {
    display: block;
}

.hr-approval-summary-card span {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 850;
    text-transform: uppercase;
}

.hr-approval-summary-card strong {
    display: block;
    margin-top: 2px;
    color: var(--ink);
    font-size: 1.85rem;
    font-weight: 900;
    line-height: 1;
}

.hr-approval-summary-card small {
    margin-top: 6px;
    color: var(--muted);
}

.hr-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.hr-sidebar {
    position: sticky;
    top: 118px;
    display: grid;
    gap: 14px;
}

.hr-main {
    min-width: 0;
}

.hr-employee-list {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.hr-employee-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    padding: 12px;
    background: color-mix(in srgb, var(--surface-2) 70%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.hr-employee-list a:hover,
.hr-employee-list a.active {
    background: color-mix(in srgb, #0891b2 9%, var(--surface));
    border-color: color-mix(in srgb, #0891b2 32%, var(--border));
}

.hr-employee-list strong,
.hr-employee-list small {
    display: block;
}

.hr-employee-list small {
    color: var(--muted);
}

.hr-profile-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.hr-action-grid,
.hr-data-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 16px;
}

.hr-action-grid form {
    min-width: 0;
    padding: 14px;
    background: color-mix(in srgb, var(--surface-2) 72%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.hr-action-grid h3 {
    margin: 0 0 12px;
    font-size: .94rem;
    font-weight: 800;
}

.status-milvus {
    color: #1d4ed8;
    background: color-mix(in srgb, #2563eb 13%, var(--surface));
}

.status-bitdefender,
.status-veeam,
.status-success,
.status-info {
    color: #067647;
    background: var(--mint);
}

.status-bom_controle {
    color: #8a5d00;
    background: var(--amber);
}

.status-warning {
    color: #8a5d00;
    background: var(--amber);
}

.status-danger,
.status-critical,
.status-failed,
.status-error {
    color: #a33a55;
    background: var(--rose);
}

.status-draft,
.status-scheduled,
.status-candidate,
.status-planned {
    color: #475467;
    background: color-mix(in srgb, var(--muted) 12%, var(--surface));
}

.status-in_progress,
.status-on_leave,
.status-vacation {
    color: #1d4ed8;
    background: color-mix(in srgb, #2563eb 13%, var(--surface));
}

.status-completed,
.status-billed,
.status-active,
.status-received {
    color: #067647;
    background: var(--mint);
}

.status-terminated {
    color: #a33a55;
    background: var(--rose);
}

.service-order-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}

.service-order-main {
    min-width: 0;
}

.service-order-actions {
    position: sticky;
    top: 118px;
    display: grid;
    gap: 14px;
}

.service-order-section-header {
    align-items: flex-start;
}

.service-order-filter {
    min-width: min(260px, 100%);
}

.service-order-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.service-order-total-strip,
.service-report-totals {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 16px;
    background: color-mix(in srgb, var(--surface-2) 70%, transparent);
    border-bottom: 1px solid var(--line);
}

.service-order-total-strip div,
.service-report-totals div {
    min-width: 0;
    padding: 12px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.service-order-total-strip span,
.service-report-totals span,
.service-report-grid span,
.service-report-signatures span {
    display: block;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.service-order-total-strip strong,
.service-report-totals strong {
    display: block;
    margin-top: 4px;
}

.service-order-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 18px;
    padding: 16px;
}

.service-order-status-panel {
    min-width: 0;
    padding: 14px;
    background: color-mix(in srgb, var(--surface-2) 72%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.service-order-note {
    margin-top: 14px;
    padding: 14px;
    background: color-mix(in srgb, var(--surface-2) 72%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.service-order-note.internal {
    border-style: dashed;
}

.service-order-note p {
    margin: 6px 0 0;
    color: var(--muted);
}

.service-contract-usage {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.service-contract-usage article {
    display: grid;
    gap: 8px;
    padding: 12px;
    background: color-mix(in srgb, var(--surface-2) 72%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.service-contract-usage span,
.service-contract-usage small {
    display: block;
    color: var(--muted);
}

.service-usage-bar {
    height: 8px;
    overflow: hidden;
    background: color-mix(in srgb, var(--border) 70%, transparent);
    border-radius: 999px;
}

.service-usage-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #0f766e, #2563eb);
}

.service-report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.service-order-report {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
}

.service-report-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    border-bottom: 1px solid var(--line);
}

.service-report-header h1 {
    margin: 0;
    font-size: 1.9rem;
    letter-spacing: 0;
}

.service-report-header span,
.service-report-status small {
    display: block;
    color: var(--muted);
}

.service-report-status {
    min-width: 160px;
    text-align: right;
}

.service-report-status strong {
    display: block;
    margin-top: 10px;
    font-size: 1.35rem;
}

.service-report-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 16px 24px;
}

.service-report-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 0;
}

.service-report-grid div {
    min-width: 0;
    padding: 12px;
    background: color-mix(in srgb, var(--surface-2) 72%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.service-report-grid strong,
.service-report-grid small {
    display: block;
    margin-top: 4px;
}

.service-report-grid small {
    color: var(--muted);
}

.service-report-section {
    padding: 18px 24px;
    border-top: 1px solid var(--line);
}

.service-report-section h2 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.service-report-section p {
    margin: 0;
    color: var(--muted);
}

.service-report-table {
    margin-bottom: 0;
}

.service-report-signatures {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding: 24px;
    border-top: 1px solid var(--line);
}

.service-report-signatures div {
    min-height: 82px;
    padding-top: 12px;
    border-top: 1px solid var(--ink);
}

@media (max-width: 980px) {
    .commercial-layout,
    .commercial-grid,
    .commercial-proposal-layout,
    .financial-closing-layout,
    .integration-layout,
    .hr-approval-layout,
    .hr-approval-summary-grid,
    .hr-layout,
    .hr-employee-picker,
    .hr-employee-detail-grid,
    .hr-time-entry-form,
    .hr-vacation-form,
    .hr-action-grid,
    .hr-data-grid,
    .service-order-layout,
    .service-order-detail-grid,
    .service-report-grid {
        grid-template-columns: 1fr;
    }

    .hr-approval-summary-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .hr-approval-summary-card .btn {
        grid-column: 1 / -1;
        justify-content: center;
    }

    .commercial-actions,
    .service-order-actions,
    .hr-sidebar {
        position: static;
    }

    .commercial-proposal-list {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .financial-closing-side {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .asset-followup-layout,
    .approval-decision-grid {
        grid-template-columns: 1fr;
    }

    .pricing-table-panel,
    .asset-followup-actions {
        position: static;
    }

    .catalog-workspace-grid {
        grid-template-columns: 1fr;
    }

    .catalog-type-panel,
    .catalog-form-panel {
        position: static;
    }

    .entity-show-grid {
        grid-template-columns: 1fr;
    }

    .client-workspace-grid,
    .client-widget-grid,
    .client-timeline-filter {
        grid-template-columns: 1fr;
    }

    .client-context-sidebar {
        position: static;
    }

    .client-timeline-filter-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 680px) {
    .proposal-total-strip,
    .service-order-total-strip,
    .service-report-totals,
    .service-report-signatures,
    .service-report-grid.compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pricing-approval-strip,
    .approval-header,
    .movement-row,
    .service-report-header {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .service-report-header {
        flex-direction: column;
    }

    .service-report-status {
        text-align: left;
    }

    .pricing-approval-strip,
    .approval-header {
        flex-direction: column;
    }

    .pricing-total-box,
    .approval-total,
    .movement-row-money {
        text-align: left;
    }

    .approval-page {
        padding: 16px;
    }

    .entity-detail-list,
    .secret-action-grid {
        grid-template-columns: 1fr;
    }

    .entity-visual-hero,
    .entity-visual-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .client-context-header,
    .client-context-identity {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .client-context-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .client-summary-grid,
    .client-ticket-metrics,
    .client-location-list {
        grid-template-columns: 1fr;
    }

    .client-timeline-item,
    .client-timeline-item-header {
        grid-template-columns: 1fr;
    }

    .client-timeline-item-header {
        display: grid;
    }

    .client-timeline-item-header time {
        white-space: normal;
    }
}

@media print {
    @page {
        margin: 12mm;
    }

    body {
        background: #ffffff !important;
        color: #111827 !important;
    }

    .app-topnav,
    .app-sidebar,
    .topbar,
    .inventory-screen-actions,
    .service-report-actions,
    .app-toast-stack {
        display: none !important;
    }

    .app-shell,
    .app-body,
    .app-main,
    .content-wrap {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .inventory-client-report {
        border: 0 !important;
        box-shadow: none !important;
        margin: 0 0 18mm !important;
        padding: 0 !important;
        page-break-after: always;
    }

    .inventory-client-report:last-child {
        page-break-after: auto;
    }

    .inventory-company-header,
    .inventory-section,
    .inventory-client-summary,
    .service-report-section,
    .service-report-grid,
    .service-report-totals,
    .service-report-signatures {
        break-inside: avoid;
    }

    .service-order-report {
        border: 0 !important;
        box-shadow: none !important;
        margin: 0 !important;
    }

    .inventory-section {
        border-color: #d1d5db !important;
        margin-top: 8px !important;
    }

    .inventory-section-header {
        background: #f3f4f6 !important;
        border-color: #d1d5db !important;
        padding: 8px 10px !important;
    }

    .inventory-company-header {
        grid-template-columns: 78px minmax(0, 1fr) 120px;
        border-color: #d1d5db !important;
    }

    .inventory-company-logo {
        width: 78px;
        height: 78px;
        border-color: #d1d5db !important;
    }

    .inventory-company-info h2 {
        font-size: 18px !important;
    }

    .inventory-company-info dl,
    .inventory-client-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .inventory-client-summary > div {
        border-color: #d1d5db !important;
        padding: 8px !important;
    }

    .inventory-table {
        font-size: 10px;
    }

    .inventory-table th,
    .inventory-table td {
        border-color: #e5e7eb !important;
        padding: 4px 6px !important;
    }

    a {
        color: #111827 !important;
        text-decoration: none !important;
    }
}
