:root {
    --sidebar-width: 280px;
    --sidebar-width-collapsed: 72px;
    --sidebar-current-width: var(--sidebar-width);
    --header-height: 64px;
    --primary: #0066b3;
    --primary-dark: #004d86;
    --primary-light: #e8f4fc;
    --sidebar-bg: #0f2744;
    --sidebar-hover: #1a3a5c;
    --sidebar-active: #0066b3;
    --surface: #f4f7fb;
    --card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --radius: 12px;
    --radius-lg: 14px;
    --shadow: 0 1px 3px rgba(15, 39, 68, 0.08), 0 4px 12px rgba(15, 39, 68, 0.06);
    --shadow-md: 0 4px 16px rgba(15, 39, 68, 0.08);
    --dash-good: #047857;
    --dash-mid: #b45309;
    --dash-low: #b91c1c;
    --font-root: 14px;
    --line-height-base: 1.55;
}

* {
    box-sizing: border-box;
}

html {
    font-size: var(--font-root);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    background: var(--surface);
    color: var(--text);
    line-height: var(--line-height-base);
}

a {
    color: inherit;
    text-decoration: none;
}

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

body.sidebar-collapsed {
    --sidebar-current-width: var(--sidebar-width-collapsed);
}

.sidebar {
    width: var(--sidebar-current-width);
    background: var(--sidebar-bg);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    transition: width 0.25s ease;
    overflow: hidden;
}

.sidebar-brand {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
}

.sidebar-brand-short {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: var(--sidebar-active);
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: 10px;
}

.sidebar-brand-text {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.4;
    word-break: break-word;
    padding: 0 0.5rem;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-collapse-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    font: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.sidebar-collapse-btn:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.collapse-icon-collapse {
    display: none;
}

body.sidebar-collapsed .collapse-icon-expand {
    display: none;
}

body.sidebar-collapsed .collapse-icon-collapse {
    display: block;
}

.sidebar-brand p {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    color: #94a3b8;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
}

.nav-section-block {
    margin-bottom: 0.25rem;
}

.nav-subsection-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #64748b;
    padding: 0.75rem 0.75rem 0.2rem;
    margin: 0;
}

.nav-subsection-label--first {
    padding-top: 0.25rem;
}

.nav-link--section {
    margin-bottom: 0.125rem;
}

.nav-link--inset {
    padding: 0.5rem 0.75rem 0.5rem 1.5rem;
    font-size: 0.8125rem;
    color: #94a3b8;
}

.nav-link--inset:hover {
    color: #fff;
}

.nav-link--inset.active {
    color: #fff;
}

.nav-link--inset .icon {
    display: none;
}

.sidebar .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.9;
}

.nav-link-text {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
    word-break: break-word;
}

.nav-link {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: background 0.15s, color 0.15s;
}

.nav-link .icon {
    margin-top: 0.1rem;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-link.active {
    background: var(--sidebar-active);
    color: #fff;
    font-weight: 600;
}

/* Nhóm menu có submenu (Gia hạn dịch vụ CNTT) */
.nav-group {
    margin-bottom: 0.25rem;
}

.nav-group-toggle {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    margin: 0;
    border: none;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.875rem;
    line-height: 1.35;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    box-sizing: border-box;
}

.nav-group-toggle-inner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.nav-group-toggle .chevron {
    margin-top: 0.15rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    opacity: 0.75;
}

.nav-group:hover > .nav-group-toggle,
.nav-group.is-open > .nav-group-toggle {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-group.is-open > .nav-group-toggle .chevron {
    transform: rotate(180deg);
}

.nav-submenu {
    display: none;
    margin: 0.125rem 0 0.5rem 0.75rem;
    padding: 0.25rem 0 0.25rem 0.75rem;
    border-left: 2px solid rgba(255, 255, 255, 0.12);
}

.nav-group.is-open .nav-submenu {
    display: block;
}

.nav-sublink {
    display: block;
    padding: 0.5rem 0.75rem;
    margin: 0.125rem 0;
    border-radius: 6px;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: #94a3b8;
    transition: background 0.15s, color 0.15s;
}

.nav-sublink:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-sublink.active {
    background: var(--sidebar-active);
    color: #fff;
    font-weight: 600;
}

/* Sidebar thu gọn (desktop) */
@media (min-width: 901px) {
    body.sidebar-collapsed .sidebar-brand-text,
    body.sidebar-collapsed .nav-section-label,
    body.sidebar-collapsed .nav-subsection-label,
    body.sidebar-collapsed .nav-link-text,
    body.sidebar-collapsed .nav-group-toggle .chevron,
    body.sidebar-collapsed .sidebar-collapse-label {
        display: none !important;
    }

    body.sidebar-collapsed .sidebar-brand-short {
        display: flex;
    }

    body.sidebar-collapsed .sidebar-nav {
        padding: 0.75rem 0.5rem;
    }

    body.sidebar-collapsed .nav-link,
    body.sidebar-collapsed .nav-group-toggle {
        justify-content: center;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    body.sidebar-collapsed .nav-group-toggle-inner {
        justify-content: center;
    }

    body.sidebar-collapsed .nav-link .icon,
    body.sidebar-collapsed .nav-group-toggle .icon {
        margin-top: 0;
    }

    body.sidebar-collapsed .nav-submenu {
        display: none !important;
        position: absolute;
        left: calc(100% + 4px);
        top: 0;
        margin: 0;
        padding: 0.5rem;
        min-width: 220px;
        background: var(--sidebar-bg);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 8px;
        box-shadow: 4px 4px 20px rgba(0, 0, 0, 0.25);
        z-index: 110;
    }

    body.sidebar-collapsed .nav-group {
        position: relative;
    }

    body.sidebar-collapsed .nav-group.is-open .nav-submenu {
        display: none !important;
    }

    body.sidebar-collapsed .nav-group:hover .nav-submenu,
    body.sidebar-collapsed .nav-group:focus-within .nav-submenu {
        display: block !important;
    }

    body.sidebar-collapsed .nav-sublink {
        white-space: nowrap;
    }
}

.main-area {
    flex: 1;
    margin-left: var(--sidebar-current-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left 0.25s ease;
}

.top-header {
    height: var(--header-height);
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.header-menu-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumb strong {
    color: var(--text);
}

.page-content {
    padding: 1.5rem;
    flex: 1;
}

.page-title {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-subtitle {
    margin: 0 0 1.5rem;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.stat-card.tone-blue { border-left-color: #2563eb; }
.stat-card.tone-teal { border-left-color: #0d9488; }
.stat-card.tone-amber { border-left-color: #d97706; }
.stat-card.tone-green { border-left-color: #059669; }
.stat-card.tone-red { border-left-color: #dc2626; }

.stat-card .label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.service-tile {
    display: block;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.service-tile:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.service-tile h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: var(--primary-dark);
}

.service-tile p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary-dark);
}

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

.select-year {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    background: #fff;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table .col-stt {
    width: 1%;
    white-space: nowrap;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
    padding-left: 0.5rem !important;
    padding-right: 0.35rem !important;
}

.data-table .col-action {
    width: 1%;
    white-space: nowrap;
    text-align: right;
    vertical-align: middle;
    padding-right: 0.65rem !important;
}

.data-table thead .col-action {
    text-align: center;
    font-size: 0.75rem;
}

.table-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
}

.table-action-form {
    display: inline-flex;
    margin: 0;
}

.table-action-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    min-width: 2.5rem;
    padding: 0.25rem 0.35rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    background: #fff;
    color: var(--text-muted, #64748b);
    font: inherit;
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1.1;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s, color 0.12s, box-shadow 0.12s;
}

.table-action-btn svg {
    width: 0.95rem;
    height: 0.95rem;
    flex-shrink: 0;
}

.table-action-label {
    letter-spacing: 0.01em;
}

.table-action-btn:hover {
    border-color: var(--primary, #2563eb);
    color: var(--primary, #2563eb);
    background: #eff6ff;
}

.table-action-btn--perm:hover {
    border-color: #059669;
    color: #059669;
    background: #ecfdf5;
}

.table-action-btn--danger:hover {
    border-color: #fca5a5;
    color: #b91c1c;
    background: #fef2f2;
}

.table-action-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.table-action-btn--danger:focus-visible {
    box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.25);
}

@media (max-width: 1100px) {
    .table-action-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .table-action-btn {
        min-width: 1.75rem;
        padding: 0.3rem;
    }
}

.data-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.placeholder-cell {
    color: #94a3b8;
    font-style: italic;
}

.empty-note {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    background: #f8fafc;
    border-radius: 8px;
    border: 1px dashed var(--border);
}

.header-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.alert {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.import-map-list {
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.5rem 1.5rem;
}

.import-map-list li {
    margin: 0;
    line-height: 1.5;
    word-break: break-word;
}

.map-system {
    font-weight: 600;
}

.map-excel {
    color: var(--text-muted);
}

.import-unmapped {
    margin: 0.75rem 0 0;
    font-size: 0.8125rem;
}

.import-service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.import-service-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.import-service-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.import-service-card.is-disabled {
    opacity: 0.85;
}

.import-service-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.import-service-card-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.import-service-card p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--muted);
    flex: 1;
}

.import-service-card-action {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.import-hint {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text);
    background: #eff6ff;
    border-radius: 8px;
    border: 1px solid #bfdbfe;
}

.import-form-hint {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: var(--muted);
}

.import-back-link {
    margin-top: 1rem;
    font-size: 0.875rem;
}

.import-back-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.nav-sublink-tag {
    margin-left: 0.35rem;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: lowercase;
    color: var(--muted);
}

.import-card {
    margin-bottom: 1.5rem;
}

.import-form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.import-form-row .select-filter {
    max-width: none;
    min-width: 22rem;
    width: max-content;
}

.file-input {
    font-size: 0.875rem;
    max-width: 100%;
}

.form-error {
    margin: 0.5rem 0 0;
    color: var(--danger);
    font-size: 0.8125rem;
}

.import-help {
    margin-top: 1rem;
    font-size: 0.8125rem;
}

.import-help summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 600;
}

.import-columns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.import-col-item {
    padding: 0.625rem 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.import-col-item strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.8125rem;
}

.import-col-item span {
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

/* Bảng danh sách — canh vừa khung màn hình (tổng 100%) */
.card-body-table {
    padding: 0 0.75rem 0.75rem;
}

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

.list-table {
    width: 100%;
    font-size: 0.8125rem;
    table-layout: fixed;
    border-collapse: collapse;
}

.list-table th,
.list-table td {
    padding: 0.5rem 0.5rem;
    vertical-align: middle;
    overflow: hidden;
}

.list-table th {
    font-size: 0.75rem;
    line-height: 1.3;
}

.list-table td span {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.35;
    word-break: break-word;
}

/* Tỷ lệ cột danh sách gia hạn */
.list-table .col-stt { width: 3%; }
.list-table .col-action { width: 6%; }
.list-table .col-trang_thai { width: 13%; }
.list-table .col-ten_kh { width: 22%; }
.list-table .col-ma_tb { width: 8%; }
.list-table .col-ngay_het_han { width: 9%; }
.list-table .col-ten_goi { width: 13%; }
.list-table .col-vnpt_khu_vuc { width: 8%; }
.list-table .col-nhan_vien_phu_trach { width: 12%; }

.list-table .col-ten_goi span {
    -webkit-line-clamp: 1;
    font-size: 0.75rem;
}

.list-table .col-stt {
    text-align: center;
}

.list-table .col-ma_tb span {
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
    -webkit-line-clamp: 1;
}

.list-table .col-ngay_het_han span,
.list-table .col-ngay_het_han .expiry-date {
    -webkit-line-clamp: 1;
}

.list-table .col-ten_kh .list-cell-link {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.35;
    word-break: break-word;
    color: var(--primary-dark);
    font-weight: 600;
    text-decoration: none;
}

.list-table .col-ten_kh .list-cell-link:hover {
    text-decoration: underline;
}

.expiry-date {
    display: inline-block;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
}

.expiry-date--warn60 {
    color: #b45309;
}

.expiry-date--warn30 {
    color: #c2410c;
}

.expiry-date--expired {
    color: #b91c1c;
}

.expiry-date--pending {
    color: #0369a1;
}

.expiry-date--noted {
    color: #64748b;
}

.list-table tbody tr.list-row--renewal-alert {
    background: #fffbeb;
}

.list-table tbody tr.list-row--renewal-alert:hover {
    background: #fef3c7;
}

.status-cell-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    align-items: flex-start;
    min-width: 0;
    max-width: 100%;
}

.list-table .cell-status .status-pill {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
    line-height: 1.3;
    font-size: 0.65rem;
    padding: 0.15rem 0.35rem;
    max-width: 100%;
}

.status-warning {
    display: block;
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1.25;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-warning--warn60 {
    background: #fef9c3;
    color: #854d0e;
}

.status-warning--warn30 {
    background: #ffedd5;
    color: #c2410c;
}

.status-warning--expired {
    background: #fee2e2;
    color: #b91c1c;
}

.status-warning--pending {
    background: #e0f2fe;
    color: #0369a1;
}

.status-warning--noted {
    background: #f1f5f9;
    color: #475569;
}

.list-period-note {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.field-label {
    display: block;
    margin: 0.75rem 0 0.35rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
}

.field-label:first-of-type {
    margin-top: 0;
}

.ly-do-name-input {
    width: 100%;
    max-width: 24rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
}

.ly-do-meta {
    margin-top: 0.35rem;
    color: var(--primary);
    font-weight: 500;
}

.ly-do-input {
    width: 100%;
    max-width: 42rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
}

.detail-field-view {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.detail-field-text {
    flex: 1;
    min-width: 0;
}

.detail-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    margin-top: 0.05rem;
    padding: 0;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    background: #fff;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s, color 0.12s;
}

.detail-edit-btn svg {
    width: 0.9rem;
    height: 0.9rem;
}

.detail-edit-btn:hover {
    border-color: var(--primary, #2563eb);
    color: var(--primary, #2563eb);
    background: #eff6ff;
}

.detail-edit-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.detail-field-edit .ly-do-input,
.detail-field-input {
    width: 100%;
}

.ly-do-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.ly-do-saved {
    font-size: 0.8125rem;
    color: var(--muted);
}

.list-table .col-action {
    text-align: center;
    white-space: nowrap;
    padding-left: 0.25rem !important;
    padding-right: 0.75rem !important;
}

.list-table thead .col-action {
    padding-right: 0.75rem !important;
}

.list-table .col-action a {
    display: inline;
}

.btn-link {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.8125rem;
}

.btn-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Trang chi tiết thuê bao */
.detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.detail-header .page-subtitle {
    margin-bottom: 0;
}

.detail-header code {
    font-size: 0.875rem;
    background: #f1f5f9;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(160px, 220px) 1fr;
    gap: 0.75rem 1.5rem;
    margin: 0;
}

.detail-grid dt {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
}

.detail-grid dd {
    margin: 0;
    font-size: 0.875rem;
    word-break: break-word;
}

.detail-grid .detail-wide {
    grid-column: 2;
    line-height: 1.5;
}

.detail-meta {
    margin-top: 1rem;
    display: flex;
    gap: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.page-content--fill {
    flex: 1;
    min-height: 0;
    max-height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0.625rem 1rem;
}

html:has(.page-content--fill) {
    height: 100%;
    overflow: hidden;
}

body:has(.page-content--fill) {
    height: 100%;
    overflow: hidden;
}

.app-shell:has(.page-content--fill) {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.main-area:has(.page-content--fill) {
    height: 100vh;
    max-height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

.main-area:has(.page-content--fill) .top-header {
    flex-shrink: 0;
}

.list-page {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    max-height: 100%;
    gap: 0.5rem;
    overflow: hidden;
}

.list-page-intro {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.list-page-intro .page-title {
    margin: 0;
    font-size: 1.125rem;
}

.list-page-intro .page-subtitle {
    margin: 0;
    font-size: 0.8125rem;
}

.list-page-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.list-page-card .card-header-meta {
    margin-top: 0.125rem;
}

.list-page-card .card-header {
    padding: 0.625rem 1rem;
    flex-shrink: 0;
    align-items: center;
}

.list-page-card .card-header .toolbar {
    flex-shrink: 0;
}

.list-page-card .card-header h2 {
    font-size: 0.9375rem;
}

.list-page-card .card-filter-bar {
    padding: 0.625rem 1rem;
    flex-shrink: 0;
    overflow-x: auto;
    overflow-y: visible;
}

.list-page-card .list-filter-form {
    min-width: 0;
    width: 100%;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 0.5rem;
}

.list-page-card .list-filter-form .search-input {
    flex: 1 1 10rem;
    min-width: 9rem;
}

.list-page-card .list-filter-form .select-filter {
    flex: 0 0 auto;
    width: 10.5rem;
    min-width: 10.5rem;
}

.list-page-card .list-filter-form .date-range-filter {
    flex: 0 0 auto;
    flex-shrink: 0;
    min-width: 21rem;
}

.list-page-card .list-filter-form .date-input {
    width: 9rem;
    min-width: 9rem;
    flex-shrink: 0;
}

.list-page-card .list-filter-form .filter-actions {
    margin-left: auto;
    flex-shrink: 0;
}

.list-page-card .card-body-table {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 0.75rem 0.5rem;
}

.list-page-card .ajax-list-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.list-page-card .ajax-list-container > .list-table-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

.list-page-card .ajax-list-container > .table-pagination {
    flex-shrink: 0;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--border);
}

.list-page-card .ajax-list-container > .empty-note {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.list-page-card .list-table th,
.list-page-card .list-table td {
    padding: 0.35rem 0.5rem;
}

.list-page-card .list-table td span {
    -webkit-line-clamp: 1;
}

.list-page-card .list-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    box-shadow: inset 0 -1px 0 var(--border);
}

/* VNPT CA — bảng nhiều cột (legacy) */
.card-filter-bar {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: #fafbfd;
    overflow-x: auto;
}

.list-filter-form {
    width: 100%;
    min-width: 44rem;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
}

.list-filter-form .search-input {
    flex: 1 1 8rem;
    min-width: 0;
    width: auto;
}

.list-filter-form .select-filter {
    flex: 0 0 auto;
    width: 10.5rem;
    max-width: none;
}

.list-filter-form .date-range-filter {
    flex: 0 0 auto;
    flex-wrap: nowrap;
}

.list-filter-form .date-input {
    width: 8.75rem;
    min-width: 8.75rem;
}

.list-filter-form .filter-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
    margin-left: auto;
}

.list-filter-form .search-input,
.list-filter-form .select-filter,
.list-filter-form .date-input {
    height: 2.375rem;
    box-sizing: border-box;
}

.card-header-meta {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.card-header-meta .meta-sep {
    margin: 0 0.35rem;
}

.toolbar-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.search-input {
    min-width: 220px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
}

.select-filter {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    background: #fff;
    max-width: 180px;
}

.date-range-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.date-range-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.date-range-sep {
    color: var(--text-muted);
    font-size: 0.875rem;
    flex-shrink: 0;
}

.date-input {
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    background: #fff;
    min-width: 9.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-ghost {
    background: #f1f5f9;
    color: var(--text);
}

.btn-ghost:hover {
    background: #e2e8f0;
}

.table-scroll {
    overflow: auto;
    max-height: calc(100vh - 280px);
}

.vnpt-ca-table {
    width: max-content;
    min-width: 100%;
    font-size: 0.8125rem;
}

.vnpt-ca-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #eef4fa;
    box-shadow: 0 1px 0 var(--border);
}

.vnpt-ca-table .col-stt {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fff;
    min-width: 48px;
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
}

.vnpt-ca-table thead .col-stt {
    z-index: 3;
    background: #eef4fa;
}

.vnpt-ca-table tbody tr:hover .col-stt {
    background: #f8fafc;
}

.vnpt-ca-table th,
.vnpt-ca-table td {
    padding: 0.625rem 0.75rem;
    max-width: 220px;
    vertical-align: top;
}

.vnpt-ca-table .cell-wide {
    max-width: 280px;
}

.vnpt-ca-table td span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vnpt-ca-table .cell-wide span {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.vnpt-ca-table .cell-date {
    white-space: nowrap;
}

.status-pill {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary-dark);
    white-space: nowrap;
}

.table-pagination {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

.pagination-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-btn {
    padding: 0.4rem 0.875rem;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
}

.page-btn:hover:not(.disabled) {
    background: var(--primary-dark);
}

.page-btn.disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.ajax-list-container {
    transition: opacity 0.2s ease;
}

.ajax-list-container.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

@media (max-width: 900px) {
    body:not(.sidebar-mobile-open) .sidebar {
        transform: translateX(-100%);
    }

    body.sidebar-mobile-open .app-shell::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(15, 39, 68, 0.45);
        z-index: 99;
    }

    body.sidebar-mobile-open .sidebar {
        transform: translateX(0);
        width: var(--sidebar-width);
        z-index: 101;
    }

    body.sidebar-mobile-open.sidebar-collapsed .sidebar {
        width: var(--sidebar-width);
    }

    .main-area {
        margin-left: 0;
    }

    .page-content--fill {
        flex: 1;
        min-height: 0;
        max-height: 100%;
        overflow: hidden;
    }

    .list-page-card {
        min-height: 0;
    }

    .toolbar-form,
    .list-filter-form {
        width: 100%;
        min-width: 0;
        flex-wrap: wrap;
    }

    .list-filter-form .search-input {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .list-filter-form .select-filter {
        flex: 1 1 calc(50% - 0.25rem);
        width: auto;
    }

    .list-filter-form .date-range-filter {
        flex: 1 1 100%;
        flex-wrap: wrap;
        min-width: 0;
        width: 100%;
    }

    .list-page-card .list-filter-form .date-range-filter {
        min-width: 0;
    }

    .list-page-card .list-filter-form .date-input {
        flex: 1 1 8.5rem;
        min-width: 8.5rem;
        width: auto;
    }

    .list-filter-form .filter-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }

    .search-input {
        min-width: 100%;
    }

    .date-range-filter {
        width: 100%;
    }

    .date-input {
        flex: 1;
        min-width: 0;
        width: auto;
    }
}

.guest-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
}

.guest-main {
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
}

.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.auth-title {
    margin: 0 0 0.35rem;
    font-size: 1.25rem;
}

.auth-subtitle {
    margin: 0 0 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.auth-form .field-label:first-of-type {
    margin-top: 0;
}

.auth-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.auth-submit {
    width: 100%;
    justify-content: center;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-user-name {
    font-size: 0.875rem;
    font-weight: 600;
}

.logout-form {
    margin: 0;
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.8125rem;
}

.header-time {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.ly-do-history {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.ly-do-history h3 {
    margin: 0 0 0.75rem;
    font-size: 0.9375rem;
}

.ly-do-history--solo {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.ly-do-history-table {
    font-size: 0.8125rem;
}

.ly-do-history-table td {
    vertical-align: top;
}

/* Dashboard */
.dash-page {
    max-width: 1440px;
}

.dash-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.dash-page-intro {
    min-width: 0;
}

.dash-page-header .page-title {
    margin-bottom: 0.35rem;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.dash-page-header .page-subtitle {
    margin-bottom: 0;
    max-width: 36rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.dash-period-chip {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #f8fafc;
    white-space: nowrap;
}

.dash-period-chip-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

.dash-period-chip-label::after {
    content: ':';
}

.dash-period-chip strong {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text);
}

.dash-period-chip-live {
    display: inline-block;
    padding: 0.08rem 0.4rem;
    border-radius: 999px;
    font-size: 0.625rem;
    font-weight: 600;
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.dash-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.dash-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.25rem;
    background: #eef2f7;
    border-radius: 999px;
}

.dash-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.125rem;
    padding: 0.4rem 1.1rem;
    border: none;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-muted);
    text-decoration: none;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.dash-tab:hover {
    color: var(--text);
}

.dash-tab--active {
    color: var(--primary-dark);
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.dash-tab-panel {
    min-width: 0;
}

.dash-tab-pane[hidden],
.dash-lead-kpi-pane[hidden] {
    display: none !important;
}

.dash-tab-panel .dash-plan-card,
.dash-tab-panel .dash-plan-table-card,
.dash-tab-panel .dash-legend-card {
    margin-bottom: 1.25rem;
}

.dash-tab-panel .dash-plan-card:last-child,
.dash-tab-panel .dash-plan-table-card:last-child,
.dash-tab-panel .dash-legend-card:last-child {
    margin-bottom: 0;
}

.dash-scope-note {
    margin: 0 0 0.875rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--text-muted);
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.dash-scope-note--section {
    margin: 0;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
    border-radius: 0;
    background: #fafbfd;
}

.dash-summary-grid {
    margin-bottom: 1.5rem;
}

.dash-services-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1100px) {
    .dash-services-grid {
        grid-template-columns: 1fr;
    }
}

.dash-service {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border);
}

.dash-service--ca {
    --dash-accent: #2563eb;
    --dash-accent-soft: #eff6ff;
}

.dash-service--smartca {
    --dash-accent: #7c3aed;
    --dash-accent-soft: #f5f3ff;
}

.dash-service-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--dash-accent-soft);
    border-bottom: 1px solid var(--border);
}

.dash-service-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--dash-accent);
}

.dash-service-meta {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.dash-service-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.dash-renewal-ring {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dash-renewal-ring-chart {
    --rate: 0;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(
        var(--dash-accent) calc(var(--rate) * 1%),
        #e2e8f0 0
    );
    flex-shrink: 0;
}

.dash-renewal-ring-chart::before {
    content: '';
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    background: var(--card);
    position: absolute;
}

.dash-renewal-ring-chart {
    position: relative;
}

.dash-renewal-rate {
    position: relative;
    z-index: 1;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--dash-accent);
}

.dash-renewal-ring-label .label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
}

.dash-renewal-ring-label .hint {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.625rem;
}

@media (max-width: 700px) {
    .dash-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.dash-kpi {
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

a.dash-kpi:hover {
    border-color: var(--dash-accent);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.dash-kpi-value {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.dash-kpi-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    line-height: 1.3;
}

.dash-kpi--amber { background: #fffbeb; }
.dash-kpi--amber .dash-kpi-value { color: #b45309; }

.dash-kpi--green { background: #ecfdf5; }
.dash-kpi--green .dash-kpi-value { color: #047857; }

.dash-kpi--slate { background: #f8fafc; }
.dash-kpi--slate .dash-kpi-value { color: #475569; }

.dash-kpi--blue { background: #eff6ff; }
.dash-kpi--blue .dash-kpi-value { color: #1d4ed8; }

.dash-section-title {
    margin: 0 0 0.625rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
}

.dash-alert-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dash-alert-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 5.5rem;
    padding: 0.625rem 0.875rem;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform 0.12s, box-shadow 0.12s;
}

.dash-alert-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.dash-alert-count {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.dash-alert-label {
    font-size: 0.6875rem;
    margin-top: 0.125rem;
}

.dash-alert-chip--expired {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.dash-alert-chip--warn30 {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
}

.dash-alert-chip--warn60 {
    background: #fffbeb;
    color: #a16207;
    border-color: #fde68a;
}

.dash-footnote {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dash-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 900px) {
    .dash-charts-row {
        grid-template-columns: 1fr;
    }
}

.dash-chart-block {
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.dash-bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.375rem;
    min-height: 7rem;
    padding-top: 0.5rem;
}

.dash-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.dash-bar-track {
    width: 100%;
    max-width: 2.25rem;
    height: 5rem;
    display: flex;
    align-items: flex-end;
    background: #e2e8f0;
    border-radius: 4px 4px 0 0;
}

.dash-bar-fill {
    width: 100%;
    background: var(--dash-accent);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
}

.dash-bar-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
}

.dash-bar-count {
    font-size: 0.625rem;
    color: var(--text-muted);
}

.dash-status-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dash-status-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.dash-status-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.dash-status-count {
    font-weight: 600;
    flex-shrink: 0;
}

.dash-status-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.dash-status-bar-fill {
    height: 100%;
    background: var(--dash-accent);
    border-radius: 2px;
}

.dash-legend-card .card-body {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.dash-legend-body ul {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Dashboard — theo dõi kế hoạch */
.dash-plan-table-card {
    margin-bottom: 1.25rem;
}

.dash-plan-table .col-num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.dash-plan-table .col-done {
    color: #047857;
}

.dash-plan-table .col-pending {
    color: #b45309;
}

.dash-plan-table .col-progress {
    width: 12rem;
    min-width: 8rem;
}

.dash-plan-table-link {
    font-weight: 600;
    color: var(--primary-dark);
    text-decoration: none;
}

.dash-plan-table-link:hover {
    text-decoration: underline;
}

.dash-plan-table-total {
    background: #f8fafc;
}

.dash-plan-table-total td {
    border-top: 2px solid var(--border);
}

.dash-plan-cards-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.dash-plan-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    overflow: hidden;
}

.dash-plan-card--ca {
    --dash-accent: #2563eb;
    --dash-accent-soft: #eff6ff;
}

.dash-plan-card--smartca {
    --dash-accent: #7c3aed;
    --dash-accent-soft: #f5f3ff;
}

.dash-plan-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
    border-left: 4px solid var(--dash-accent);
}

.dash-plan-card-title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--dash-accent);
}

.dash-plan-card-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dash-plan-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    border-bottom: 1px solid var(--border);
}

@media (max-width: 640px) {
    .dash-plan-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.dash-plan-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.125rem 0.75rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    border-right: 1px solid var(--border);
    transition: background 0.12s;
}

.dash-plan-metric:last-child {
    border-right: none;
}

a.dash-plan-metric:hover {
    background: #f8fafc;
}

.dash-plan-metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.dash-plan-metric-label {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.dash-plan-metric--done .dash-plan-metric-value {
    color: #047857;
}

.dash-plan-metric--pending .dash-plan-metric-value {
    color: #b45309;
}

.dash-plan-metric--rate .dash-plan-metric-value {
    color: var(--dash-accent);
}

.dash-plan-progress {
    padding: 1rem 1.25rem 1.125rem;
}

.dash-plan-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.dash-plan-progress-head strong {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.dash-plan-progress-track {
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.dash-plan-progress-track--inline {
    height: 8px;
    min-width: 6rem;
}

.dash-plan-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--dash-accent, var(--primary)) 0%, #34d399 100%);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.dash-plan-table .dash-plan-progress-fill {
    background: linear-gradient(90deg, #2563eb 0%, #34d399 100%);
}

.dash-plan-progress-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-top: 0.625rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dash-plan-progress-legend .legend-done::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    margin-right: 0.25rem;
    vertical-align: middle;
}

.dash-plan-progress-legend .legend-pending::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fbbf24;
    margin-right: 0.25rem;
    vertical-align: middle;
}

.dash-year-form,
.dash-period-form {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}

.dash-period-field {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dash-period-field span {
    font-weight: 600;
}

.select-month {
    min-width: 4.75rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.8125rem;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
}

.select-year {
    min-width: 5.25rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.8125rem;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
}

.dash-period-badge {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.4rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 4px;
    vertical-align: middle;
}

.dash-page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

@media (max-width: 640px) {
    .dash-period-form {
        width: 100%;
        justify-content: space-between;
    }

    .dash-period-field {
        flex: 1;
    }

    .select-year,
    .select-month {
        width: 100%;
    }
}

.dash-monthly-wrap {
    border-top: 1px solid var(--border);
    padding: 1rem 1.25rem 1.125rem;
}

.dash-section-title {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
}

.dash-section-note {
    margin: -0.3rem 0 0.6rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dash-monthly-scroll {
    overflow: auto;
    max-height: min(28rem, calc(100vh - 18rem));
}

.dash-monthly-table {
    width: 100%;
    font-size: 0.8125rem;
    border-collapse: separate;
    border-spacing: 0;
}

.dash-monthly-table thead th {
    position: sticky;
    z-index: 2;
    background: #f8fafc;
    box-shadow: inset 0 -1px 0 var(--border);
}

.dash-monthly-table thead tr:first-child th {
    top: 0;
    z-index: 3;
}

.dash-monthly-table thead tr.dash-monthly-subhead th {
    top: 2.125rem;
}

.dash-monthly-table .col-region {
    white-space: nowrap;
    min-width: 10rem;
    position: sticky;
    left: 2.5rem;
    background: var(--card);
    z-index: 1;
}

.dash-monthly-table thead .col-region {
    background: #f8fafc;
    z-index: 4;
}

.dash-monthly-table thead th[colspan] {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: #f1f5f9;
}

.dash-monthly-subhead th {
    background: #f8fafc;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.dash-monthly-table .col-stt {
    width: 2.5rem;
    min-width: 2.5rem;
    text-align: center;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--card);
}

.dash-monthly-table thead .col-stt {
    z-index: 5;
    background: #f8fafc;
}

.dash-monthly-table tbody tr:hover .col-stt,
.dash-monthly-table tbody tr:hover .col-region {
    background: #f8fafc;
}

.dash-monthly-table tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: #f1f5f9;
    box-shadow: inset 0 1px 0 var(--border);
}

.dash-monthly-table tfoot .col-region {
    z-index: 3;
    left: 2.5rem;
}

.dash-monthly-table tfoot .col-stt {
    z-index: 3;
    left: 0;
}

.dash-monthly-table .col-num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.dash-monthly-total td {
    border-top: 2px solid var(--border);
    font-weight: 600;
}

.dash-num-link {
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 600;
}

.dash-num-link:hover {
    text-decoration: underline;
}

/* Leadership dashboard — KPI board */
.dash-lead-kpis {
    margin-bottom: 1.5rem;
    width: 100%;
}

.dash-lead-kpi-pane {
    width: 100%;
}

.dash-kpi-board {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.dash-kpi-hero {
    display: flex;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
}

.dash-kpi-hero-card {
    flex: 1;
    min-width: 0;
    padding: 1rem 1.25rem;
    border: none;
    border-radius: 0;
    border-right: 1px solid var(--border);
    background: #fff;
}

.dash-kpi-hero-card:last-child {
    border-right: none;
}

@media (max-width: 768px) {
    .dash-kpi-hero {
        flex-direction: column;
    }

    .dash-kpi-hero-card {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .dash-kpi-hero-card:last-child {
        border-bottom: none;
    }
}

.dash-kpi-hero-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.dash-kpi-hero-card--good .dash-kpi-hero-value { color: var(--dash-good); }
.dash-kpi-hero-card--mid .dash-kpi-hero-value { color: var(--dash-mid); }
.dash-kpi-hero-card--low .dash-kpi-hero-value { color: var(--dash-low); }

.dash-kpi-hero-label {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.dash-kpi-hero-track {
    margin-top: 0.65rem;
    height: 0.3rem;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.dash-kpi-hero-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #94a3b8;
}

.dash-kpi-hero-card--good .dash-kpi-hero-fill { background: #10b981; }
.dash-kpi-hero-card--mid .dash-kpi-hero-fill { background: #f59e0b; }
.dash-kpi-hero-card--low .dash-kpi-hero-fill { background: #ef4444; }

.dash-kpi-details {
    display: flex;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fafbfc;
}

.dash-kpi-detail-group {
    flex: 1;
    min-width: 0;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 0;
    border-right: 1px solid var(--border);
    background: transparent;
}

.dash-kpi-detail-group:last-child {
    border-right: none;
}

@media (max-width: 768px) {
    .dash-kpi-details {
        flex-direction: column;
    }

    .dash-kpi-detail-group {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .dash-kpi-detail-group:last-child {
        border-bottom: none;
    }
}

.dash-kpi-detail-title {
    margin: 0 0 0.65rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.dash-kpi-detail-grid {
    display: flex;
    width: 100%;
    gap: 0;
}

.dash-kpi-detail-grid--single {
    justify-content: center;
}

.dash-kpi-detail-item {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-width: 0;
    padding: 0.35rem 0.5rem;
    text-align: center;
    border-right: 1px solid #e8edf4;
}

.dash-kpi-detail-item:last-child {
    border-right: none;
}

.dash-kpi-detail-value {
    font-size: 1.0625rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    color: var(--text);
}

.dash-kpi-detail-item--done .dash-kpi-detail-value { color: var(--dash-good); }
.dash-kpi-detail-item--pending .dash-kpi-detail-value { color: var(--dash-mid); }
.dash-kpi-detail-item--plan .dash-kpi-detail-value { color: #0f766e; }

.dash-kpi-detail-link {
    color: inherit;
    text-decoration: none;
}

.dash-kpi-detail-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.dash-kpi-detail-of {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-muted);
}

.dash-kpi-detail-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    line-height: 1.3;
}

@media (max-width: 520px) {
    .dash-kpi-detail-grid {
        flex-direction: column;
    }

    .dash-kpi-detail-item {
        border-right: none;
        border-bottom: 1px solid #e8edf4;
        padding: 0.5rem;
    }

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

.dash-kpi-period-tag {
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: #f1f5f9;
    border: 1px solid var(--border);
}

.filter-scope-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    white-space: nowrap;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-plan-metric-of {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-muted);
}

.dash-lead-kpi-services {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.dash-lead-kpi-service {
    width: 100%;
    padding: 1.15rem 1.25rem 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: var(--shadow);
}

.dash-lead-kpi-service--solo {
    width: 100%;
}

.dash-lead-kpi-service--ca {
    --dash-svc-accent: #2563eb;
    --dash-svc-soft: #eff6ff;
}

.dash-lead-kpi-service--smartca {
    --dash-svc-accent: #7c3aed;
    --dash-svc-soft: #f5f3ff;
}

.dash-lead-kpi-service-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.dash-lead-kpi-service-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.dash-lead-kpi-service-dot {
    flex-shrink: 0;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--dash-svc-accent);
}

.dash-lead-kpi-service-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--dash-svc-accent);
}

.dash-lead-kpi-service-link {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-dark);
    text-decoration: none;
}

.dash-lead-kpi-service-link:hover {
    text-decoration: underline;
}

.dash-help {
    margin-top: 1.5rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fafbfc;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.dash-help summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
    list-style: none;
}

.dash-help summary::-webkit-details-marker {
    display: none;
}

.dash-help summary::before {
    content: '▸ ';
    color: var(--primary);
}

.dash-help[open] summary::before {
    content: '▾ ';
}

.dash-help ul {
    margin: 0.75rem 0 0;
    padding-left: 1.15rem;
    line-height: 1.55;
}

.dash-help li + li {
    margin-top: 0.35rem;
}

.dash-matrix-card {
    margin-bottom: 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.dash-matrix-card-header {
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.dash-matrix-card-header h2 {
    margin-bottom: 0.2rem;
    font-size: 1rem;
}

.dash-matrix-period-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-dark);
    background: var(--primary-light);
    border: 1px solid #bfdbfe;
}

.dash-matrix-col-cell {
    width: 10.5rem;
}

.dash-matrix-card--single .dash-matrix-col-cell {
    width: 12rem;
}

.dash-matrix-head-periods--solo th {
    top: 0;
}

.dash-matrix-head-periods--solo .col-stt,
.dash-matrix-head-periods--solo .col-region {
    z-index: 6;
    background: #f8fafc;
}

.dash-matrix-legend-inline {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.dash-matrix-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-right: 0.65rem;
}

.dash-matrix-dot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
}

.dash-matrix-dot--ca { background: #2563eb; }
.dash-matrix-dot--smartca { background: #7c3aed; }

.dash-matrix-body {
    padding-top: 0.5rem;
    overflow: visible;
}

.dash-matrix-table {
    width: 100%;
    font-size: 0.875rem;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
}

.dash-matrix-col-stt { width: 2.75rem; }
.dash-matrix-col-region { width: 5.5rem; }

.dash-matrix-table tfoot td {
    background: #e8eef5;
    border-top: 2px solid #cbd5e1;
}

.dash-matrix-table tfoot .col-stt,
.dash-matrix-table tfoot .col-region {
    background: #e8eef5;
}

.dash-matrix-table thead th {
    position: sticky;
    z-index: 4;
    background: #f8fafc;
    vertical-align: middle;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.8125rem;
}

.dash-matrix-head-services th {
    top: 0;
}

.dash-matrix-head-periods th {
    top: 2.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: none;
}

.dash-matrix-svc-head {
    text-align: center;
    font-size: 0.875rem;
    font-weight: 700;
    border-left: 2px solid var(--border);
}

.dash-matrix-svc-head--ca { color: #1d4ed8; background: #f8fbff; }
.dash-matrix-svc-head--smartca { color: #6d28d9; background: #faf8ff; }

.dash-matrix-period-head {
    text-align: center;
    border-left: 2px solid var(--border);
}

.dash-matrix-period-head--lk {
    background: #fafafa;
}

.dash-matrix-table .col-stt {
    position: sticky;
    left: 0;
    z-index: 5;
    width: 2.75rem;
    min-width: 2.75rem;
    text-align: center;
    background: #fff;
    box-shadow: 1px 0 0 var(--border);
}

.dash-matrix-table .col-region {
    position: sticky;
    left: 2.75rem;
    z-index: 5;
    width: 5.5rem;
    min-width: 5.5rem;
    max-width: 5.5rem;
    padding: 0.45rem 0.35rem;
    background: #fff;
    box-shadow: 1px 0 0 var(--border);
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.35;
    word-break: break-word;
    hyphens: auto;
}

.dash-matrix-table thead .col-stt,
.dash-matrix-table thead .col-region {
    z-index: 6;
    background: #f8fafc;
}

.dash-matrix-table thead .col-region {
    font-size: 0.8125rem;
    line-height: 1.3;
}

.dash-matrix-td {
    vertical-align: top;
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid #eef2f7;
    border-left: 2px solid #e8edf4;
    background: #fff;
}

.dash-matrix-td--lk {
    background: #fcfcfd;
}

.dash-matrix-table tbody tr:nth-child(even) .dash-matrix-td {
    background: #fafbfc;
}

.dash-matrix-table tbody tr:nth-child(even) .dash-matrix-td--lk {
    background: #f6f7f9;
}

.dash-matrix-table tbody tr:hover .dash-matrix-td {
    background: #f1f5f9;
}

.dash-matrix-table tbody tr:hover .col-stt,
.dash-matrix-table tbody tr:hover .col-region {
    background: #f1f5f9;
}

.dash-matrix-cell {
    min-width: 7.5rem;
}

.dash-matrix-cell-top {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.35rem;
}

.dash-matrix-cell-rate {
    flex-shrink: 0;
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 2.75rem;
}

.dash-matrix-cell--good .dash-matrix-cell-rate { color: #047857; }
.dash-matrix-cell--mid .dash-matrix-cell-rate { color: #b45309; }
.dash-matrix-cell--low .dash-matrix-cell-rate { color: #b91c1c; }
.dash-matrix-cell--empty .dash-matrix-empty {
    color: var(--text-muted);
    display: block;
    text-align: center;
    padding: 0.5rem 0;
}

.dash-matrix-bar {
    flex: 1;
    height: 0.35rem;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.dash-matrix-bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #94a3b8;
}

.dash-matrix-cell--good .dash-matrix-bar-fill { background: #10b981; }
.dash-matrix-cell--mid .dash-matrix-bar-fill { background: #f59e0b; }
.dash-matrix-cell--low .dash-matrix-bar-fill { background: #ef4444; }

.dash-matrix-cell-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.6rem;
    font-size: 0.8125rem;
    line-height: 1.35;
}

.dash-matrix-stat {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    min-width: 3.25rem;
    font-variant-numeric: tabular-nums;
}

.dash-matrix-stat-label {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.6875rem;
    line-height: 1.3;
    text-transform: none;
}

.dash-matrix-stat .dash-num-link,
.dash-matrix-stat strong {
    font-size: 0.875rem;
    font-weight: 600;
}

.dash-matrix-stat--done .dash-num-link { color: #047857; }
.dash-matrix-stat--pending .dash-num-link { color: #b45309; }
.dash-matrix-stat--other .dash-num-link { color: #64748b; }

.dash-kpi-detail-item--other .dash-kpi-detail-value { color: #64748b; }

.dash-matrix-zero {
    color: #94a3b8;
    font-weight: 600;
}

.dash-matrix-total .dash-matrix-cell-rate {
    font-size: 1.0625rem;
}

.dash-plan-metrics--period {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
    .dash-plan-metrics--period {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.dash-inventory-details {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: #fafafa;
}

.dash-inventory-details summary {
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
}

.dash-inventory-body {
    margin-top: 0.85rem;
}

.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.page-header-row .page-subtitle {
    margin-bottom: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}

.form-grid .field-full {
    grid-column: 1 / -1;
}

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

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.ward-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem;
    max-height: 16rem;
    overflow-y: auto;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}

.ward-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8125rem;
    cursor: pointer;
}

.ward-check input {
    margin-top: 0.125rem;
}

.staff-scope-section {
    margin-top: 0.75rem;
}

.staff-scope-section strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.subscriber-textarea {
    min-height: 10rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8125rem;
}

.field-hint {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.permissions-user-summary {
    margin: 0;
    font-size: 0.9375rem;
}

.permissions-user-summary code {
    margin: 0 0.35rem;
}

.permissions-catalog-stats {
    margin: 0 0 1rem;
    font-size: 0.8125rem;
}

/* —— Phân quyền: một khung full viewport —— */
.permissions-screen {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 0.35rem;
}

.permissions-alert {
    margin: 0;
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.permissions-frame {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
}

.permissions-frame .page-title {
    margin: 0;
    font-size: 1.125rem;
}

.permissions-frame-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    flex-shrink: 0;
}

.permissions-head-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
    max-width: 22rem;
}

.permissions-head-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.permissions-head-select .auth-input-sm {
    flex: 1;
    min-width: 0;
}

.permissions-filters {
    flex-shrink: 0;
    padding: 0.5rem 0.55rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.permissions-filters-search {
    position: relative;
    display: block;
}

.permissions-filters-search .icon {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.9rem;
    height: 0.9rem;
    color: var(--text-muted);
    pointer-events: none;
}

.permissions-filters-search .auth-input {
    width: 100%;
    padding-left: 1.85rem;
    padding-right: 1.75rem;
}

.permissions-search-clear {
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.35rem;
    height: 1.35rem;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.permissions-search-clear:hover {
    background: var(--bg-muted, #f1f5f9);
    color: var(--text);
}

.permissions-filter-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.permissions-filter-label {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.permissions-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.permissions-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.45rem;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.3;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 999px;
    background: #fff;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.permissions-filter-chip:hover {
    border-color: #cbd5e1;
    color: var(--text);
    background: #f8fafc;
}

.permissions-filter-chip.is-active {
    border-color: var(--primary, #2563eb);
    background: #eff6ff;
    color: var(--primary, #2563eb);
    font-weight: 600;
}

.permissions-filter-chip-count {
    font-size: 0.625rem;
    font-weight: 600;
    opacity: 0.85;
}

.permissions-filter-chip.is-active .permissions-filter-chip-count {
    opacity: 1;
}

.permissions-filters-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    padding-top: 0.15rem;
    border-top: 1px dashed var(--border, #e2e8f0);
    margin-top: 0.1rem;
}

.permissions-filter-result {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.permissions-filter-result strong {
    color: var(--text);
    font-weight: 700;
}

.permissions-clear-filters {
    padding: 0.15rem 0.4rem;
    font-size: 0.6875rem;
    min-height: 0;
}

.permissions-users-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.35rem;
}

.permissions-frame-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(220px, 28%) 1fr;
    overflow: hidden;
}

.permissions-users {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid var(--border, #e2e8f0);
    background: #fafbfc;
    overflow: hidden;
}

.permissions-workspace {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: #fff;
}

.permissions-workspace-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.permissions-form-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.65rem 0.85rem;
}

.permissions-form-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    padding: 0.45rem 0.85rem;
    border-top: 1px solid var(--border, #e2e8f0);
    background: #fafbfc;
}

.permissions-form-footer .form-actions {
    margin: 0;
    padding: 0;
    border: none;
}

.permissions-workspace-empty {
    margin: auto;
    padding: 1rem;
}

.permissions-form-compact {
    gap: 0.5rem;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.permissions-form-compact .permissions-ward-field {
    flex: 1;
    min-height: 8rem;
}

.permissions-staff-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-shrink: 0;
    padding: 0.15rem 0 0.35rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    margin-bottom: 0.35rem;
}

.permissions-dia-ban-bar {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    max-width: min(100%, 13.5rem);
}

.permissions-dia-ban-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    margin: 0;
}

.permissions-dia-ban-select {
    flex: 1;
    min-width: 0;
    width: 100%;
    max-width: 10.5rem;
    height: 1.625rem;
    padding: 0.15rem 1.35rem 0.15rem 0.45rem;
    font-size: 0.75rem;
    line-height: 1.25;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.35rem center;
    background-size: 0.65rem;
    appearance: none;
    color: var(--text);
    cursor: pointer;
}

.permissions-dia-ban-select:hover {
    border-color: #cbd5e1;
}

.permissions-dia-ban-select:focus {
    outline: none;
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.permissions-ward-grid .ward-check.is-filtered-out {
    display: none !important;
}

.permissions-ward-count {
    font-size: 0.6875rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.permissions-ward-field {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.permissions-ward-grid {
    flex: 1;
    min-height: 0;
    max-height: none;
    grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
    gap: 0.25rem 0.5rem;
    padding: 0.5rem;
}

.permissions-ward-grid .ward-check {
    align-items: center;
    padding: 0.15rem 0;
}

.permissions-ward-grid .ward-check-label {
    line-height: 1.25;
    font-size: 0.75rem;
}

.permissions-user-item-compact {
    padding: 0.35rem 0.45rem;
    gap: 0;
}

.permissions-user-item-compact .permissions-user-name {
    font-size: 0.8125rem;
}

.permissions-user-meta-compact {
    font-size: 0.6875rem;
    color: var(--text-muted);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.permissions-user-item-compact .permissions-badge {
    font-size: 0.5625rem;
    padding: 0.1rem 0.3rem;
}

.permissions-layout {
    display: grid;
    grid-template-columns: minmax(300px, 360px) 1fr;
    gap: 1rem;
    align-items: start;
}

.permissions-picker {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 12rem);
    overflow: hidden;
}

.permissions-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.permissions-picker-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-muted, #f1f5f9);
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

.permissions-picker-toolbar {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

.permissions-search {
    position: relative;
    display: block;
}

.permissions-search .icon {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.permissions-search .auth-input {
    padding-left: 2.25rem;
    width: 100%;
}

.permissions-picker-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.auth-input-sm {
    font-size: 0.8125rem;
    padding: 0.4rem 0.55rem;
}

.permissions-picker-list {
    overflow-y: auto;
    padding: 0.5rem;
    flex: 1;
    min-height: 0;
}

.permissions-picker-group + .permissions-picker-group {
    margin-top: 0.75rem;
}

.permissions-picker-group-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem 0.35rem;
}

.permissions-user-item.is-filtered-out,
.permissions-picker-group.is-filtered-out {
    display: none !important;
}

.permissions-user-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.6rem 0.65rem;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.permissions-user-item + .permissions-user-item {
    margin-top: 0.25rem;
}

.permissions-user-item:hover {
    background: var(--bg-muted, #f1f5f9);
}

.permissions-user-item.is-active {
    background: #e8f4fc;
    border-color: var(--sidebar-active, #0066b3);
    box-shadow: 0 0 0 1px rgba(0, 102, 179, 0.15);
}

.permissions-user-avatar {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--sidebar-active, #0066b3);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.permissions-user-item.is-active .permissions-user-avatar {
    background: #004d8c;
}

.permissions-user-body {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.permissions-user-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.35rem;
}

.permissions-user-name {
    font-size: 0.875rem;
    line-height: 1.3;
    font-weight: 600;
}

.permissions-user-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    font-size: 0.75rem;
}

.permissions-user-meta code {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.permissions-user-role {
    color: var(--text-muted);
}

.permissions-user-scope {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.permissions-badge {
    flex-shrink: 0;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    line-height: 1.2;
}

.permissions-badge-ok {
    background: #dcfce7;
    color: #166534;
}

.permissions-badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.permissions-picker-empty {
    margin: 1rem 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
}

.permissions-assign-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.permissions-assign-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.permissions-quick-select {
    min-width: min(100%, 220px);
}

.permissions-quick-select .auth-input-sm {
    width: 100%;
}

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

.permissions-snapshot-card {
    margin-bottom: 1rem;
}

.permissions-snapshot {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.permissions-snapshot-compact {
    gap: 0.35rem;
}

.permissions-snapshot-line {
    margin: 0;
    font-size: 0.875rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
}

.permissions-snapshot-wards {
    margin: 0;
    font-size: 0.8125rem;
}

.permissions-ward-groups {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.permissions-ward-group-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--sidebar-active, #0066b3);
    margin-bottom: 0.35rem;
}

.permissions-ward-tags {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.permissions-ward-tags li {
    font-size: 0.8125rem;
    background: var(--bg-muted, #f1f5f9);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
}

.permissions-snapshot-link {
    align-self: flex-start;
}

.btn-sm {
    font-size: 0.8125rem;
    padding: 0.35rem 0.75rem;
}

.permissions-table-cell {
    min-width: 12rem;
    max-width: 18rem;
}

.permissions-table-cell .permissions-snapshot-compact .permissions-snapshot-line {
    font-size: 0.8125rem;
}

.text-warning {
    color: #b45309;
}

.form-actions-split {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.permissions-snapshot-inline {
    margin-bottom: 0.5rem;
}

.permissions-form-divider {
    border: none;
    border-top: 1px solid var(--border, #e2e8f0);
    margin: 1rem 0;
}

@media (max-width: 900px) {
    .permissions-frame-body {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(140px, 32%) 1fr;
    }

    .permissions-users {
        border-right: none;
        border-bottom: 1px solid var(--border, #e2e8f0);
    }

    .permissions-frame-head {
        flex-wrap: wrap;
    }

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

    .permissions-picker {
        max-height: 320px;
    }

    .permissions-picker-filters {
        grid-template-columns: 1fr;
    }
}

.inline-form {
    display: inline;
}

.btn-link-danger {
    color: #b91c1c;
}

.scope-notice {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: var(--primary-dark);
}

.header-user-scope {
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 14rem;
    text-align: right;
    line-height: 1.3;
}

@media (max-width: 900px) {
    .header-user-scope {
        display: none;
    }
}

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

/* Core UI — readable text on tables, forms, actions */
.data-table,
.list-table,
.dash-matrix-table,
.ly-do-history-table {
    font-size: 0.9375rem;
}

.data-table th,
.list-table th {
    font-size: 0.8125rem;
}

.btn,
.search-input,
.select-filter,
.select-year,
.date-input,
.file-input {
    font-size: 0.9375rem;
}

.badge {
    font-size: 0.8125rem;
}

.alert {
    font-size: 0.9375rem;
}

/* Revenue reports */
.revenue-page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.revenue-page.list-page {
    gap: 0.875rem;
}

.revenue-page .list-page-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.625rem;
    flex-shrink: 0;
}

.revenue-page .list-page-intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    width: 100%;
}

.revenue-page .list-page-intro .page-title {
    font-size: 1.25rem;
    line-height: 1.3;
}

.revenue-page .list-page-intro .page-subtitle {
    line-height: 1.45;
}

.revenue-page .list-page-intro .scope-notice {
    margin-top: 0.35rem;
}

.revenue-page .revenue-back-link {
    font-size: 0.8125rem;
    line-height: 1.4;
}

.revenue-page.list-page .revenue-filter-card {
    margin-bottom: 0;
}

.revenue-filter-card {
    margin-bottom: 1rem;
}

.revenue-filter-body {
    padding: 0.75rem 1rem;
}

.revenue-filter-toolbar {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.revenue-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 0.1rem;
}

.revenue-filter-bar .dash-period-field {
    flex-shrink: 0;
    white-space: nowrap;
}

.revenue-filter-select {
    min-width: 0;
    padding: 0.4rem 0.55rem;
    font-size: 0.8125rem;
}

.revenue-filter-bar .revenue-dia-ban-select {
    width: 9.5rem;
}

.revenue-filter-bar .revenue-loaihinh-select {
    width: 10.5rem;
}

.revenue-filter-bar .revenue-filter-search-input {
    width: 9.5rem;
    min-width: 8rem;
    padding: 0.4rem 0.55rem;
    font-size: 0.8125rem;
}

.revenue-filter-bar .revenue-filter-search {
    flex-shrink: 0;
}

.revenue-filter-bar .btn {
    flex-shrink: 0;
}

.revenue-detail-link {
    flex-shrink: 0;
    align-self: flex-start;
    padding-top: 0.15rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary-dark);
    text-decoration: none;
    white-space: nowrap;
}

.revenue-detail-link:hover {
    text-decoration: underline;
}

.revenue-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.revenue-nhom-dv-section {
    margin-bottom: 1.25rem;
}

.revenue-section-title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.revenue-kpi-card .value {
    font-size: 1.35rem;
}

.revenue-money,
.revenue-money-inline {
    font-variant-numeric: tabular-nums;
}

.revenue-currency {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-muted);
}

.revenue-matrix-card {
    margin-bottom: 0;
}

.revenue-matrix-card .card-body-table {
    padding: 0;
}

.revenue-matrix-table {
    border-collapse: separate;
    border-spacing: 0;
}

.revenue-matrix-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #f8fafc;
    box-shadow: 0 1px 0 var(--border);
    vertical-align: bottom;
    padding: 0.65rem 0.75rem;
}

.revenue-matrix-table .col-region {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 10rem;
    max-width: 12rem;
    font-weight: 600;
    background: #fff;
    box-shadow: 1px 0 0 var(--border);
}

.revenue-matrix-table thead .col-region {
    z-index: 6;
    background: #f8fafc;
}

.revenue-matrix-table tfoot .col-region {
    background: #e8eef5;
    z-index: 3;
}

.revenue-matrix-cell {
    white-space: nowrap;
    vertical-align: top;
}

.revenue-matrix-total {
    background: #f8fafc;
}

.revenue-matrix-table tfoot th,
.revenue-matrix-table tfoot td {
    background: #e8eef5;
    border-top: 2px solid #cbd5e1;
    font-weight: 700;
}

.revenue-cell-meta {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.revenue-dia-ban-link {
    color: var(--primary-dark);
    font-weight: 600;
    text-decoration: none;
}

.revenue-dia-ban-link:hover {
    text-decoration: underline;
}

.revenue-list-card {
    margin-bottom: 0;
}

.revenue-invoice-table {
    width: 100%;
    min-width: 93rem;
    table-layout: fixed;
}

.revenue-invoice-table th,
.revenue-invoice-table td {
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    vertical-align: middle;
}

.revenue-invoice-table thead th {
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.8125rem;
    vertical-align: middle;
}

.revenue-invoice-table .col-stt { width: 3rem; }
.revenue-invoice-table .col-ma_tb { width: 7rem; }
.revenue-invoice-table .col-ten_kh { width: 15rem; }
.revenue-invoice-table .col-loaihinh_tb { width: 10rem; }
.revenue-invoice-table .col-tien { width: 6rem; }
.revenue-invoice-table .col-vat { width: 5.5rem; }
.revenue-invoice-table .col-tongtien { width: 7rem; }
.revenue-invoice-table .col-ten_nv { width: 8rem; }
.revenue-invoice-table .col-ten_phuong { width: 8.5rem; }
.revenue-invoice-table .col-ten_dv { width: 9.5rem; }
.revenue-invoice-table .col-soseri { width: 6.5rem; }
.revenue-invoice-table .col-ngay_ps { width: 7rem; }

.revenue-invoice-table .col-wrap {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.revenue-invoice-table .revenue-cell-wrap {
    display: block;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.revenue-matrix-table .col-region .revenue-cell-ellipsis {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

.revenue-matrix-table .col-region .revenue-dia-ban-link {
    display: inline-block;
    max-width: 100%;
}

.revenue-loaihinh-select {
    min-width: 14rem;
    max-width: 22rem;
}

.revenue-kpi-link,
.revenue-matrix-link {
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 600;
}

.revenue-kpi-link:hover,
.revenue-matrix-link:hover {
    text-decoration: underline;
}

.revenue-matrix-wrap {
    max-height: min(calc(100vh - var(--header-height) - 13rem), 40rem);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.revenue-matrix-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-subtle, #f8fafc);
}

.revenue-matrix-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
}

.revenue-matrix-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary, #334155);
}

.revenue-matrix-legend-dot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.revenue-matrix-legend-item--moi .revenue-matrix-legend-dot {
    background: #2563eb;
}

.revenue-matrix-legend-item--gia_han .revenue-matrix-legend-dot {
    background: #7c3aed;
}

.revenue-matrix-hint {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.revenue-matrix-table {
    table-layout: auto;
}

.revenue-matrix-service-col {
    min-width: 7.25rem;
    max-width: 9.5rem;
    border-left: 1px solid #eef2f7;
    vertical-align: top;
    padding: 0.5rem 0.55rem;
}

.revenue-matrix-table thead .revenue-matrix-service-col {
    text-align: left;
    vertical-align: bottom;
    padding: 0.55rem 0.55rem 0.65rem;
}

.revenue-matrix-table .col-total {
    position: sticky;
    right: 0;
    z-index: 3;
    min-width: 6.75rem;
    text-align: right;
    background: #f8fafc;
    box-shadow: -1px 0 0 var(--border);
    padding-right: 0.85rem;
}

.revenue-matrix-table tbody .col-total {
    background: #fff;
}

.revenue-matrix-table tbody tr:hover .col-total {
    background: #f8fafc;
}

.revenue-matrix-table tfoot .col-total {
    background: #e8eef5;
    z-index: 4;
}

.revenue-matrix-table thead .col-total {
    z-index: 7;
}

.revenue-split-cell {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.revenue-split-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    padding: 0.2rem 0.35rem;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    line-height: 1.25;
}

a.revenue-split-row:hover {
    background: rgba(37, 99, 235, 0.06);
}

.revenue-split-row--moi {
    background: #f0f9ff;
}

.revenue-split-row--gia_han {
    background: #f5f3ff;
}

a.revenue-split-row--moi:hover {
    background: #e0f2fe;
}

a.revenue-split-row--gia_han:hover {
    background: #ede9fe;
}

.revenue-split-tag {
    flex-shrink: 0;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted);
    min-width: 1.75rem;
}

.revenue-split-row--moi .revenue-split-tag {
    color: #1d4ed8;
}

.revenue-split-row--gia_han .revenue-split-tag {
    color: #6d28d9;
}

.revenue-split-row .revenue-money-inline {
    font-size: 0.8125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
    min-width: 0;
}

.revenue-matrix-cell--footer .revenue-split-row,
.revenue-split-row--footer {
    font-weight: 700;
}

.revenue-total-link {
    display: inline-block;
}

.revenue-matrix-service-label {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    white-space: normal;
    text-align: left;
}

.revenue-matrix-table tbody tr:nth-child(even) .revenue-matrix-service-col {
    background: #fcfdfe;
}

.revenue-matrix-table tbody tr:hover .revenue-matrix-service-col {
    background: #f8fafc;
}

.revenue-matrix-table tbody tr:nth-child(even):hover .revenue-matrix-service-col {
    background: #f1f5f9;
}

.revenue-matrix-table tfoot .revenue-matrix-service-col {
    background: #e8eef5;
}

@media (max-width: 768px) {
    .revenue-matrix-hint {
        white-space: normal;
        text-align: right;
        max-width: 12rem;
    }

    .revenue-matrix-service-col {
        min-width: 6.5rem;
    }
}

.import-form-row .import-year-field {
    flex-shrink: 0;
}

.import-form-row .import-year-field select {
    min-width: 6.5rem;
}

/* Revenue — Plan vs Actual (cumulative) */
.revenue-pva-card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.revenue-pva-card-header h2 {
    margin-bottom: 0.2rem;
    font-size: 1rem;
}

.revenue-pva-card-subtitle {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.revenue-pva-card-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.revenue-pva-count-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.revenue-pva {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 1.25rem 1.25rem;
}

.revenue-pva-kpi-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.875rem;
}

@media (max-width: 1024px) {
    .revenue-pva-kpi-board {
        grid-template-columns: 1fr;
    }
}

.revenue-pva-kpi {
    padding: 1rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.revenue-pva-kpi--primary {
    border-top: 3px solid #2563eb;
    background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}

.revenue-pva-kpi--moi {
    border-top: 3px solid #0284c7;
    background: linear-gradient(180deg, #f0f9ff 0%, #fff 100%);
}

.revenue-pva-kpi--gia_han {
    border-top: 3px solid #ea580c;
    background: linear-gradient(180deg, #fff7ed 0%, #fff 100%);
}

.revenue-pva-kpi-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.revenue-pva-kpi-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    flex-shrink: 0;
    background: #94a3b8;
}

.revenue-pva-kpi--primary .revenue-pva-kpi-dot { background: #2563eb; }
.revenue-pva-kpi--moi .revenue-pva-kpi-dot { background: #0284c7; }
.revenue-pva-kpi--gia_han .revenue-pva-kpi-dot { background: #ea580c; }

.revenue-pva-kpi-label {
    flex: 1;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
}

.revenue-pva-kpi-rate {
    font-size: 1.35rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.revenue-pva-kpi--good .revenue-pva-kpi-rate { color: #047857; }
.revenue-pva-kpi--mid .revenue-pva-kpi-rate { color: #b45309; }
.revenue-pva-kpi--low .revenue-pva-kpi-rate { color: #b91c1c; }
.revenue-pva-kpi--neutral .revenue-pva-kpi-rate { color: #64748b; }

.revenue-pva-kpi-track {
    height: 0.4rem;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.revenue-pva-kpi-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #94a3b8;
    transition: width 0.35s ease;
}

.revenue-pva-kpi--good .revenue-pva-kpi-fill { background: linear-gradient(90deg, #34d399, #10b981); }
.revenue-pva-kpi--mid .revenue-pva-kpi-fill { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.revenue-pva-kpi--low .revenue-pva-kpi-fill { background: linear-gradient(90deg, #f87171, #ef4444); }

.revenue-pva-kpi-amounts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.revenue-pva-kpi-amount-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.revenue-pva-kpi-amount-value,
.revenue-pva-kpi-amount-link {
    font-size: 0.9375rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    text-decoration: none;
}

.revenue-pva-kpi-amount-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.revenue-pva-kpi-amount--actual .revenue-pva-kpi-amount-value,
.revenue-pva-kpi-amount--actual .revenue-pva-kpi-amount-link {
    color: #1d4ed8;
}

.revenue-pva-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.revenue-pva-notice-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: #f59e0b;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
}

.revenue-pva-notice p {
    margin: 0.2rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: #a16207;
}

.revenue-pva-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding-bottom: 0.15rem;
    border-bottom: 1px solid #eef2f7;
}

.revenue-pva-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
}

.revenue-pva-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.revenue-pva-legend-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #94a3b8;
}

.revenue-pva-legend-item--moi .revenue-pva-legend-dot { background: #0284c7; }
.revenue-pva-legend-item--gia_han .revenue-pva-legend-dot { background: #ea580c; }
.revenue-pva-legend-item--tong .revenue-pva-legend-dot { background: #2563eb; }

.revenue-pva-hint {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

.revenue-pva-scroll {
    margin: 0 -0.25rem;
}

.revenue-pva-table {
    min-width: 58rem;
}

.revenue-pva-col-region {
    width: 8.5rem;
    min-width: 8.5rem;
    max-width: 9.5rem;
}

.revenue-pva-col-type {
    width: 11.5rem;
}

.revenue-pva-col-type--total {
    width: 12rem;
}

.revenue-pva-table .col-region {
    left: 2.75rem;
    max-width: 9.5rem;
}

.revenue-pva-head th {
    top: 0;
    text-align: center;
    font-size: 0.8125rem;
}

.revenue-pva-type-head {
    border-left: 2px solid #e8edf4;
    font-weight: 700;
}

.revenue-pva-type-head--moi {
    color: #0369a1;
    background: #f0f9ff;
}

.revenue-pva-type-head--gia_han {
    color: #c2410c;
    background: #fff7ed;
}

.revenue-pva-type-head--tong {
    color: #1e40af;
    background: #eff6ff;
}

.revenue-pva-td {
    vertical-align: top;
    padding: 0.6rem 0.7rem;
    border-left: 2px solid #e8edf4;
    background: #fff;
}

.revenue-pva-td--tong {
    background: #fcfdff;
}

.revenue-pva-table tbody tr:nth-child(even) .revenue-pva-td {
    background: #fafbfc;
}

.revenue-pva-table tbody tr:nth-child(even) .revenue-pva-td--tong {
    background: #f6f9ff;
}

.revenue-pva-table tbody tr:hover .revenue-pva-td {
    background: #f1f5f9;
}

.revenue-pva-table tbody tr:hover .revenue-pva-td--tong {
    background: #eef4ff;
}

.revenue-pva-region {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
    font-weight: 600;
}

.revenue-pva-cell {
    min-width: 9.5rem;
}

.revenue-pva-cell-top {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.4rem;
}

.revenue-pva-cell-rate {
    flex-shrink: 0;
    min-width: 3rem;
    font-size: 0.9375rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.revenue-pva-cell--good .revenue-pva-cell-rate { color: #047857; }
.revenue-pva-cell--mid .revenue-pva-cell-rate { color: #b45309; }
.revenue-pva-cell--low .revenue-pva-cell-rate { color: #b91c1c; }
.revenue-pva-cell--empty .revenue-pva-cell-rate { color: #94a3b8; }

.revenue-pva-cell-rate-na {
    font-weight: 600;
    color: #94a3b8;
}

.revenue-pva-bar {
    flex: 1;
    height: 0.35rem;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.revenue-pva-bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #94a3b8;
}

.revenue-pva-cell--good .revenue-pva-bar-fill { background: #10b981; }
.revenue-pva-cell--mid .revenue-pva-bar-fill { background: #f59e0b; }
.revenue-pva-cell--low .revenue-pva-bar-fill { background: #ef4444; }

.revenue-pva-cell-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.5rem;
}

.revenue-pva-stat-label {
    display: block;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    margin-bottom: 0.1rem;
}

.revenue-pva-stat-value,
.revenue-pva-stat-link {
    font-size: 0.8125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    text-decoration: none;
}

.revenue-pva-stat-value--plan {
    color: #64748b;
    font-weight: 600;
}

.revenue-pva-stat-link {
    color: #1d4ed8;
}

.revenue-pva-stat-link:hover {
    text-decoration: underline;
}

.revenue-pva-stat--actual .revenue-pva-stat-value {
    color: #1e3a8a;
}

.revenue-pva-empty {
    display: block;
    text-align: center;
    color: var(--text-muted);
    padding: 0.65rem 0;
}

.revenue-pva-cell--footer .revenue-pva-cell-rate {
    font-size: 1rem;
}

.revenue-pva-total-row .revenue-pva-td {
    background: #e8eef5;
}

@media (max-width: 768px) {
    .revenue-pva {
        padding: 0.85rem;
    }

    .revenue-pva-hint {
        text-align: left;
        width: 100%;
    }

    .revenue-pva-kpi-amounts {
        grid-template-columns: 1fr;
    }
}

.revenue-plan-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.revenue-plan-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.85rem 1rem;
    margin-bottom: 1rem;
}

.revenue-plan-dia-ban-field {
    min-width: 16rem;
}

.revenue-plan-amount-input {
    width: 100%;
    min-width: 10rem;
}

.revenue-plan-region-card {
    margin-bottom: 0;
}

.revenue-plan-region-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.revenue-plan-region-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
}

.revenue-plan-region-chip:hover {
    background: #dbeafe;
    text-decoration: none;
}

.revenue-plan-table .col-action {
    width: 8rem;
    white-space: nowrap;
}

.revenue-plan-matrix-card .card-body-table {
    padding: 0.75rem 1rem 1rem;
}

.revenue-plan-matrix-table {
    min-width: 36rem;
}

.revenue-plan-matrix-input {
    width: 100%;
    min-width: 8rem;
    padding: 0.4rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.revenue-plan-matrix-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.revenue-plan-matrix-total th,
.revenue-plan-matrix-total td {
    background: #f8fafc;
    border-top: 2px solid var(--border);
    font-weight: 700;
}

.revenue-plan-import-help {
    margin-bottom: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fafbfc;
}

.revenue-plan-import-help summary {
    cursor: pointer;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    list-style: none;
}

.revenue-plan-import-help summary::-webkit-details-marker {
    display: none;
}

.revenue-plan-import-help summary::before {
    content: '▸ ';
    color: var(--primary);
}

.revenue-plan-import-help[open] summary::before {
    content: '▾ ';
}

.revenue-plan-import-help-body {
    padding: 0 1rem 1rem;
}
