:root {
    --portal-bg: #f5f5f5;
    --portal-bg-subtle: #fafafa;
    --portal-surface: #ffffff;
    --portal-text: #1a1a1a;
    --portal-text-muted: #6b6b6b;
    --portal-border: #e8e8e8;
    --portal-accent: #2e7d32;
    --portal-accent-hover: #256628;
    --portal-accent-soft: #e8f5e9;
    --portal-danger: #c62828;
    --portal-danger-soft: #ffebee;
    --portal-radius: 12px;
    --portal-radius-sm: 6px;
    --portal-radius-lg: 12px;
    --portal-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --portal-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --portal-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --portal-sidebar-width: 240px;
    --portal-topbar-height: 52px;
    --portal-font: 'Inter', system-ui, -apple-system, sans-serif;
    --portal-transition: 0.15s ease;

    --bs-primary: var(--portal-accent);
    --bs-primary-rgb: 46, 125, 50;
    --bs-body-font-family: var(--portal-font);
    --bs-body-bg: var(--portal-bg);
    --bs-border-color: var(--portal-border);
    --bs-link-color: var(--portal-accent);
    --bs-link-hover-color: var(--portal-accent-hover);
    --bs-focus-ring-color: rgba(46, 125, 50, 0.25);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    background-color: var(--portal-bg);
    color: var(--portal-text);
    font-size: 0.875rem;
    line-height: 1.5;
}

.portal-skip-link {
    position: absolute;
    left: -9999px;
    z-index: 9999;
    padding: 0.5rem 1rem;
    background: var(--portal-surface);
    border: 2px solid var(--portal-accent);
}

.portal-skip-link:focus {
    left: 0.5rem;
    top: 0.5rem;
}

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

.portal-sidebar {
    width: var(--portal-sidebar-width);
    flex-shrink: 0;
    background: var(--portal-bg-subtle);
    border-right: 1px solid var(--portal-border);
    display: none;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 1030;
}

@media (min-width: 992px) {
    .portal-sidebar {
        display: flex;
    }
}

.portal-sidebar-brand {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--portal-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.portal-brand-mark {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #fff;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px var(--portal-border);
}

.portal-brand-mark--lg {
    width: 5.25rem;
    height: 5.25rem;
    margin: 0 auto 0.85rem;
    box-shadow: 0 0 0 1px var(--portal-border), 0 8px 20px rgba(15, 23, 42, 0.08);
}

.portal-brand-title {
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 1.25;
    color: var(--portal-text);
}

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

.portal-nav-section {
    margin-bottom: 0.75rem;
}

.portal-nav-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--portal-text-muted);
    padding: 0.35rem 0.65rem 0.25rem;
}

.portal-nav-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.65rem;
    margin-bottom: 2px;
    border-radius: var(--portal-radius-sm);
    color: var(--portal-text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8125rem;
    transition: background var(--portal-transition), color var(--portal-transition);
}

.portal-nav-link:hover {
    background: var(--portal-bg);
    color: var(--portal-text);
}

.portal-nav-link.active {
    color: var(--portal-text);
    background: var(--portal-surface);
    box-shadow: var(--portal-shadow-xs);
}

.portal-nav-link i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
}

.portal-sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--portal-border);
}

.portal-user-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.portal-user-chip-text {
    min-width: 0;
    flex: 1;
}

.portal-sidebar-footer .admin-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--portal-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-user-role {
    font-size: 0.65rem;
    color: var(--portal-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--portal-bg);
}

.portal-topbar {
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: var(--portal-topbar-height);
    background: var(--portal-surface);
    border-bottom: 1px solid var(--portal-border);
    flex-shrink: 0;
    gap: 1rem;
}

.portal-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.portal-topbar-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-topbar-badge {
    font-size: 0.7rem;
    color: var(--portal-text-muted);
    background: var(--portal-bg);
    border: 1px solid var(--portal-border);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--portal-text-muted);
    flex-shrink: 0;
}

.portal-topbar-user {
    font-weight: 500;
    color: var(--portal-text);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-topbar-mobile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--portal-surface);
    border-bottom: 1px solid var(--portal-border);
}

@media (min-width: 992px) {
    .portal-topbar-mobile {
        display: none;
    }
}

.portal-content {
    flex: 1;
    padding: 1.25rem 1.5rem 2rem;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
}

.portal-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.portal-page-title {
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--portal-text);
}

.portal-page-subtitle {
    font-size: 0.8rem;
    color: var(--portal-text-muted);
    margin: 0.25rem 0 0;
}

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

.portal-card-body {
    padding: 1rem 1.25rem;
}

.portal-kpi-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .portal-kpi-row {
        grid-template-columns: repeat(4, 1fr);
    }
}

.portal-kpi {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-lg);
    padding: 1rem 1.125rem;
    box-shadow: var(--portal-shadow-xs);
    transition: box-shadow var(--portal-transition);
}

.portal-kpi:hover {
    box-shadow: var(--portal-shadow);
}

.portal-kpi-label {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--portal-text-muted);
    margin-bottom: 0.25rem;
}

.portal-kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--portal-text);
}

.portal-kpi-value.text-sm {
    font-size: 0.85rem;
    font-weight: 600;
}

.portal-segment {
    display: inline-flex;
    border: none;
    border-radius: var(--portal-radius-sm);
    overflow: hidden;
    background: var(--portal-bg);
    padding: 2px;
    gap: 2px;
}

.portal-segment input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.portal-segment label {
    padding: 0.4rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 500;
    margin: 0;
    cursor: pointer;
    border-radius: 4px;
    color: var(--portal-text-muted);
    transition: background var(--portal-transition), color var(--portal-transition), box-shadow var(--portal-transition);
}

.portal-segment input:checked + label {
    background: var(--portal-surface);
    color: var(--portal-text);
    box-shadow: var(--portal-shadow-xs);
}

.portal-segment--accent input:checked + label {
    background: var(--portal-accent);
    color: #fff;
    box-shadow: none;
}

.portal-chip {
    font-size: 0.75rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--portal-border);
    background: var(--portal-surface);
    color: var(--portal-text);
    cursor: pointer;
}

.portal-chip:hover {
    border-color: var(--portal-accent);
    color: var(--portal-accent);
}

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

.portal-details > summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.75rem 1rem;
    list-style: none;
}

.portal-details > summary::-webkit-details-marker {
    display: none;
}

.portal-details > summary::after {
    content: ' ▾';
    color: var(--portal-text-muted);
    font-weight: 400;
}

.portal-details[open] > summary::after {
    content: ' ▴';
}

.portal-table {
    width: 100%;
    margin-bottom: 0;
    font-size: 0.8125rem;
}

.portal-table thead th {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--portal-text-muted);
    border-bottom: 1px solid var(--portal-border);
    white-space: nowrap;
    padding: 0.7rem 0.85rem;
    background: var(--portal-surface);
}

.portal-table tbody td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--portal-border);
    vertical-align: middle;
}

.portal-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.portal-table code {
    font-size: 0.8em;
    background: var(--portal-bg);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.portal-avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--portal-accent-soft);
    color: var(--portal-accent);
    font-size: 0.65rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portal-status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.35rem;
}

.portal-status-dot.active {
    background: var(--portal-accent);
}

.portal-status-dot.inactive {
    background: #9ca3af;
}

.portal-chart {
    padding: 1rem 1.25rem;
}

.portal-chart-bars {
    display: flex;
    align-items: stretch;
    gap: 4px;
    height: 132px;
    padding-top: 0.25rem;
}

.portal-chart-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
}

.portal-chart-bar {
    width: 100%;
    max-width: 36px;
    min-width: 4px;
    background: #e5e7eb;
    border-radius: 4px 4px 0 0;
    flex-shrink: 0;
}

.portal-chart-bar.is-empty {
    background: transparent;
}

.portal-chart-bar.is-peak {
    background: var(--portal-accent);
}

.portal-chart-bar-label {
    font-size: 0.6rem;
    color: var(--portal-text-muted);
    text-align: center;
    margin-top: 0.35rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-chart-bars--hourly {
    gap: 2px;
}

.portal-chart-bars--hourly .portal-chart-bar-label {
    font-size: 0.5rem;
}

.portal-report-tabs {
    border-bottom: 1px solid var(--portal-border);
    gap: 0.25rem;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.portal-report-tabs .nav-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--portal-text-muted);
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0.55rem 0.85rem;
    white-space: nowrap;
}

.portal-report-tabs .nav-link:hover {
    color: var(--portal-text);
}

.portal-report-tabs .nav-link.active {
    color: var(--portal-accent);
    border-bottom-color: var(--portal-accent);
    background: transparent;
}

.portal-hbar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.portal-hbar-row:last-child {
    margin-bottom: 0;
}

.portal-hbar-label {
    width: 7.5rem;
    font-size: 0.72rem;
    color: var(--portal-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

.portal-hbar-track {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.portal-hbar-fill {
    height: 100%;
    background: var(--portal-accent);
    border-radius: 999px;
    min-width: 2px;
}

.portal-hbar-value {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--portal-text-muted);
    min-width: 2rem;
    text-align: right;
}

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

.portal-data-card .portal-table-toolbar {
    background: var(--portal-surface);
}

.portal-table-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.portal-table-meta {
    font-size: 0.75rem;
    color: var(--portal-text-muted);
}

.portal-table-scroll {
    overflow-x: auto;
}

.portal-table-footer {
    padding: 0.65rem 1.25rem;
    border-top: 1px solid var(--portal-border);
    background: var(--portal-surface);
}

.portal-table--data {
    margin-bottom: 0;
}

.portal-table--data thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f9fafb;
    border-bottom: 1px solid var(--portal-border);
    box-shadow: inset 0 -1px 0 var(--portal-border);
}

.portal-table--data tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.015);
}

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

.portal-table--data tbody td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--portal-border);
}

.portal-table-empty {
    text-align: center;
    color: var(--portal-text-muted);
    padding: 2.5rem 1rem !important;
}

.portal-th-sortable {
    white-space: nowrap;
    vertical-align: middle;
}

.portal-th-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--portal-text-muted);
    text-decoration: none;
    font-weight: 600;
}

.portal-th-sortable.is-sorted .portal-th-sort-link {
    color: var(--portal-text);
}

.portal-th-sort-link:hover {
    color: var(--portal-text);
}

.portal-th-sort-icons {
    display: inline-flex;
    flex-direction: column;
    line-height: 0.55;
    font-size: 0.55rem;
    opacity: 0.35;
}

.portal-th-sortable.is-sorted .portal-th-sort-icons {
    opacity: 1;
}

.portal-th-sort-icons .bi {
    display: block;
}

.portal-th-sort-icons .bi.is-on {
    color: var(--portal-accent);
    opacity: 1;
}

.portal-th-index,
.portal-th-actions,
.portal-td-actions {
    width: 1%;
    white-space: nowrap;
}

.portal-filter-card .form-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--portal-text-muted);
}

.portal-search-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.65rem;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-sm);
    background: var(--portal-surface);
}

.portal-search-input:focus-within {
    border-color: var(--portal-text);
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.06);
}

.portal-search-input i {
    color: var(--portal-text-muted);
    font-size: 0.85rem;
}

.portal-search-input .form-control {
    border: none;
    box-shadow: none;
    padding-left: 0;
    background: transparent;
}

.portal-search-input .form-control:focus {
    box-shadow: none;
}

.portal-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.75rem;
    min-height: 1.5rem;
}

.portal-filter-clear {
    color: var(--portal-text-muted);
    text-decoration: none;
}

.portal-filter-clear:hover {
    color: var(--portal-accent);
}

.portal-table-person {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.portal-table-person-name {
    font-weight: 500;
    min-width: 0;
}

.portal-code {
    font-size: 0.78rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
}

.portal-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}

.portal-status-pill.is-active {
    background: var(--portal-accent-soft);
    color: #1b5e20;
}

.portal-status-pill.is-inactive {
    background: #f3f4f6;
    color: #6b7280;
}

.portal-badge-neutral {
    background: #f3f4f6 !important;
    color: #4b5563 !important;
    font-weight: 500;
    border: 1px solid #e5e7eb;
}

.portal-filter-chip {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    margin-right: 0.35rem;
    margin-top: 0.15rem;
    border-radius: 999px;
    background: var(--portal-bg);
    border: 1px solid var(--portal-border);
    color: var(--portal-text);
}

.portal-employee-pick-card {
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-sm);
    padding: 0.65rem 0.75rem;
    background: var(--portal-accent-soft);
}

.portal-employee-pick-card .smaller {
    font-size: 0.72rem;
}

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

.portal-birthday-card {
    position: relative;
    display: flex;
    gap: 0.85rem;
    padding: 1rem;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.portal-birthday-card:hover {
    border-color: #c8e6c9;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.08);
}

.portal-birthday-card.is-today {
    border-color: var(--portal-accent);
    background: var(--portal-accent-soft);
}

.portal-birthday-card-date {
    flex-shrink: 0;
    width: 3.25rem;
    text-align: center;
    line-height: 1.1;
}

.portal-birthday-day {
    display: block;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--portal-accent);
}

.portal-birthday-month {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--portal-text-muted);
    letter-spacing: 0.04em;
}

.portal-birthday-card-body {
    flex: 1;
    min-width: 0;
}

.portal-birthday-card-link {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    z-index: 1;
}

.portal-birthday-org {
    color: var(--portal-text-muted);
    line-height: 1.35;
}

.filter-panel .form-label {
    font-size: 0.78rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.portal-form {
    max-width: 640px;
}

.portal-form--staff {
    max-width: 820px;
}

.portal-form .form-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--portal-text);
    margin-bottom: 0.25rem;
}

.portal-alert {
    border-radius: var(--portal-radius-sm);
    font-size: 0.85rem;
    padding: 0.65rem 0.875rem;
    margin-bottom: 1rem;
}

.portal-alert-success {
    background: var(--portal-accent-soft);
    border: 1px solid #c8e6c9;
    color: #1b5e20;
}

.portal-alert-danger {
    background: var(--portal-danger-soft);
    border: 1px solid #ffcdd2;
    color: var(--portal-danger);
}

.portal-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(160deg, var(--portal-bg-subtle) 0%, var(--portal-bg) 45%, var(--portal-accent-soft) 100%);
}

.portal-login-card {
    width: 100%;
    max-width: 400px;
}

.portal-login-card .portal-card {
    box-shadow: var(--portal-shadow-md);
    border: 1px solid var(--portal-border);
}

.portal-quick-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.125rem;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-lg);
    text-decoration: none;
    color: inherit;
    box-shadow: var(--portal-shadow-xs);
    height: 100%;
    transition: border-color var(--portal-transition), box-shadow var(--portal-transition), transform var(--portal-transition);
}

.portal-quick-card:hover {
    border-color: #c8e6c9;
    box-shadow: var(--portal-shadow);
    color: inherit;
    transform: translateY(-1px);
}

.portal-quick-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--portal-radius-sm);
    background: var(--portal-accent-soft);
    color: var(--portal-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.portal-quick-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.portal-quick-title {
    font-weight: 600;
    font-size: 0.875rem;
}

.portal-quick-desc {
    font-size: 0.75rem;
    color: var(--portal-text-muted);
    line-height: 1.35;
}

.portal-quick-chevron {
    color: var(--portal-text-muted);
    flex-shrink: 0;
}

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

.btn-primary {
    font-weight: 500;
    box-shadow: var(--portal-shadow-xs);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--portal-text);
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.08);
}

.portal-import-panel {
    max-width: 560px;
}

.portal-import-step {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--portal-border);
}

.portal-import-step:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.portal-import-step:first-child {
    padding-top: 0;
}

.portal-path-hint {
    font-size: 0.75rem;
    color: var(--portal-text-muted);
    background: var(--portal-bg);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-sm);
    padding: 0.5rem 0.75rem;
    margin-top: 0.75rem;
    word-break: break-all;
}

.portal-file-drop {
    border: 1px dashed var(--portal-border);
    border-radius: var(--portal-radius);
    padding: 1.25rem;
    text-align: center;
    background: var(--portal-bg);
    transition: border-color 0.15s ease;
}

.portal-file-drop:focus-within {
    border-color: var(--portal-accent);
    background: var(--portal-accent-soft);
}

.portal-file-drop input[type='file'] {
    font-size: 0.8rem;
    max-width: 100%;
}

.portal-card code,
.portal-import-panel code {
    font-size: 0.85em;
    color: var(--portal-text);
    background: var(--portal-bg);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.staff-search-results {
    max-height: 200px;
    overflow-y: auto;
    border-radius: var(--portal-radius-sm);
}

.selected-staff-tags .badge {
    font-weight: normal;
}

.filter-panel .form-label {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    color: var(--portal-text-muted);
}

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

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

.pagination {
    --bs-pagination-active-bg: var(--portal-accent);
    --bs-pagination-active-border-color: var(--portal-accent);
    margin-bottom: 0;
    font-size: 0.8rem;
}

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

:focus-visible {
    outline: 2px solid var(--portal-accent);
    outline-offset: 2px;
}

.portal-filter-popover-wrap {
    position: relative;
}

.portal-toolbar-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.portal-filter-popover-wrap.is-open .portal-toolbar-icon-btn {
    border-color: var(--portal-text);
    box-shadow: 0 0 0 2px rgba(26, 26, 26, 0.12);
}

.portal-filter-popover-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    margin-left: 0.25rem;
    padding: 0 0.3rem;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: var(--portal-text);
    border-radius: 999px;
}

.portal-filter-popover {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    z-index: 30;
    width: min(18.5rem, calc(100vw - 2rem));
    padding: 0.85rem 0.9rem 0.75rem;
    background: #fff;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.portal-filter-popover--wide {
    width: min(42rem, calc(100vw - 1.5rem));
}

.portal-filter-popover-scroll {
    max-height: min(32rem, calc(100vh - 10rem));
    overflow-y: auto;
    margin-right: -0.25rem;
    padding-right: 0.25rem;
}

.portal-filter-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    align-items: start;
}

.portal-filter-column {
    min-width: 0;
}

.portal-filter-column + .portal-filter-column {
    padding-left: 1.1rem;
    margin-left: 1.1rem;
    border-left: 1px solid var(--portal-border);
}

.portal-filter-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem 1rem;
    margin-top: 0.35rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--portal-border);
}

.portal-filter-section {
    margin-bottom: 0.85rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--portal-border);
}

.portal-filter-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.portal-filter-section--panel {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0.85rem;
}

.portal-filter-section--panel:last-child {
    margin-bottom: 0;
}

.portal-filter-check-list--tall {
    max-height: 11.5rem;
}

.portal-filter-check-list--short {
    max-height: 7.25rem;
}

@media (max-width: 640px) {
    .portal-filter-popover--wide {
        width: min(22.5rem, calc(100vw - 1.5rem));
    }

    .portal-filter-columns {
        grid-template-columns: 1fr;
    }

    .portal-filter-column + .portal-filter-column {
        padding-left: 0;
        margin-left: 0;
        border-left: none;
    }

    .portal-filter-meta {
        grid-template-columns: 1fr;
    }
}

.portal-filter-section-title {
    margin: 0 0 0.45rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--portal-text);
}

.portal-filter-check-list {
    list-style: none;
    margin: 0;
    padding: 0.25rem;
    max-height: 8.5rem;
    overflow-y: auto;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-sm);
    background: #fafafa;
}

.portal-filter-check-row {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.3rem 0.35rem;
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.35;
    cursor: pointer;
    border-radius: 4px;
}

.portal-filter-check-row:hover {
    background: #f3f4f6;
}

.portal-filter-check-row input {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.portal-filter-popover-title {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 700;
}

.portal-filter-popover-row {
    display: grid;
    grid-template-columns: 3.5rem 1fr;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.portal-filter-popover-label {
    margin: 0;
    font-size: 0.78rem;
    color: var(--portal-text-muted);
}

.portal-filter-popover-operator {
    margin: 0;
    font-size: 0.78rem;
    color: var(--portal-text-muted);
}

.portal-filter-popover-field {
    font-size: 0.82rem;
}

.portal-filter-popover-body {
    margin-bottom: 0.35rem;
}

.portal-filter-department-list {
    max-height: 9rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-sm);
    padding: 0.25rem;
    background: #fafafa;
}

.portal-filter-department-option {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    border-radius: 4px;
    padding: 0.35rem 0.45rem;
    font-size: 0.8rem;
    color: var(--portal-text);
}

.portal-filter-department-option:hover {
    background: #f3f4f6;
}

.portal-filter-department-option.is-selected {
    background: var(--portal-accent-soft);
    font-weight: 600;
}

.portal-filter-browse-fields {
    font-size: 0.78rem;
    text-decoration: none;
    color: var(--portal-text-muted) !important;
}

.portal-filter-browse-fields:hover {
    color: var(--portal-text) !important;
}

.portal-filter-field-list {
    list-style: none;
    margin: 0.25rem 0 0.5rem;
    padding: 0.35rem;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-sm);
    background: #fafafa;
    max-height: 8rem;
    overflow-y: auto;
}

.portal-filter-field-pick {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 0.3rem 0.35rem;
    font-size: 0.8rem;
    border-radius: 4px;
}

.portal-filter-field-pick:hover {
    background: #f3f4f6;
}

.portal-filter-popover-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    margin-top: 0.65rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--portal-border);
}