/* Mobile-only operational layout for Ghazawy dashboard. */
.mobile-bottom-bar {
    display: none;
}

@media (max-width: 768px) {
    body[data-user-role="admin"] :is(
        .attendance-report-table,
        .directory-employment-table,
        .tickets-review-table,
        #full-payroll-table,
        #regularity-explorer-section .app-data-table,
        #insurance-explorer-section .app-data-table,
        #users-explorer-section .app-data-table,
        #deleted-tickets-section .app-data-table,
        #approved-tickets-section .app-data-table,
        .audit-logs-table,
        .import-logs-table,
        .advance-requests-table
    ).app-data-table,
    body[data-user-role="admin"] .tickets-review-table {
        display: table !important;
        width: max-content !important;
        table-layout: auto !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    body[data-user-role="admin"] .attendance-report-table.app-data-table { min-width: 2500px !important; }
    body[data-user-role="admin"] .directory-employment-table.app-data-table { min-width: 1750px !important; }
    body[data-user-role="admin"] #full-payroll-table.app-data-table { min-width: 1100px !important; }
    body[data-user-role="admin"] #insurance-explorer-section .app-data-table { min-width: 900px !important; }
    body[data-user-role="admin"] .audit-logs-table.app-data-table { min-width: 760px !important; }
    body[data-user-role="admin"] .import-logs-table.app-data-table { min-width: 900px !important; }
    body[data-user-role="admin"] .tickets-review-table { min-width: 980px !important; }

    body[data-user-role="admin"] :is(
        .attendance-report-table,
        .directory-employment-table,
        .tickets-review-table,
        #full-payroll-table,
        #regularity-explorer-section .app-data-table,
        #insurance-explorer-section .app-data-table,
        #users-explorer-section .app-data-table,
        #deleted-tickets-section .app-data-table,
        #approved-tickets-section .app-data-table,
        .audit-logs-table,
        .import-logs-table,
        .advance-requests-table
    ).app-data-table thead,
    body[data-user-role="admin"] .tickets-review-table thead {
        display: table-header-group !important;
    }

    body[data-user-role="admin"] :is(
        .attendance-report-table,
        .directory-employment-table,
        .tickets-review-table,
        #full-payroll-table,
        #regularity-explorer-section .app-data-table,
        #insurance-explorer-section .app-data-table,
        #users-explorer-section .app-data-table,
        #deleted-tickets-section .app-data-table,
        #approved-tickets-section .app-data-table,
        .audit-logs-table,
        .import-logs-table,
        .advance-requests-table
    ).app-data-table tbody,
    body[data-user-role="admin"] .tickets-review-table tbody {
        display: table-row-group !important;
    }

    body[data-user-role="admin"] :is(
        .attendance-report-table,
        .directory-employment-table,
        .tickets-review-table,
        #full-payroll-table,
        #regularity-explorer-section .app-data-table,
        #insurance-explorer-section .app-data-table,
        #users-explorer-section .app-data-table,
        #deleted-tickets-section .app-data-table,
        #approved-tickets-section .app-data-table,
        .audit-logs-table,
        .import-logs-table,
        .advance-requests-table
    ).app-data-table tr,
    body[data-user-role="admin"] .tickets-review-table tr {
        display: table-row !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    body[data-user-role="admin"] :is(
        .attendance-report-table,
        .directory-employment-table,
        .tickets-review-table,
        #full-payroll-table,
        #regularity-explorer-section .app-data-table,
        #insurance-explorer-section .app-data-table,
        #users-explorer-section .app-data-table,
        #deleted-tickets-section .app-data-table,
        #approved-tickets-section .app-data-table,
        .audit-logs-table,
        .import-logs-table,
        .advance-requests-table
    ).app-data-table tr.hidden,
    body[data-user-role="admin"] .tickets-review-table tr.hidden {
        display: none !important;
    }

    body[data-user-role="admin"] :is(
        .attendance-report-table,
        .directory-employment-table,
        .tickets-review-table,
        #full-payroll-table,
        #regularity-explorer-section .app-data-table,
        #insurance-explorer-section .app-data-table,
        #users-explorer-section .app-data-table,
        #deleted-tickets-section .app-data-table,
        #approved-tickets-section .app-data-table,
        .audit-logs-table,
        .import-logs-table,
        .advance-requests-table
    ).app-data-table th,
    body[data-user-role="admin"] :is(
        .attendance-report-table,
        .directory-employment-table,
        .tickets-review-table,
        #full-payroll-table,
        #regularity-explorer-section .app-data-table,
        #insurance-explorer-section .app-data-table,
        #users-explorer-section .app-data-table,
        #deleted-tickets-section .app-data-table,
        #approved-tickets-section .app-data-table,
        .audit-logs-table,
        .import-logs-table,
        .advance-requests-table
    ).app-data-table td,
    body[data-user-role="admin"] .tickets-review-table th,
    body[data-user-role="admin"] .tickets-review-table td {
        display: table-cell !important;
        width: auto !important;
        min-width: 100px !important;
        padding: 10px 12px !important;
        border: 0 !important;
        border-bottom: 1px solid var(--border-table) !important;
        text-align: center !important;
        white-space: normal !important;
        font-size: 0.8rem !important;
    }

    body[data-user-role="admin"] :is(
        .attendance-report-table,
        .directory-employment-table,
        .tickets-review-table,
        #full-payroll-table,
        #regularity-explorer-section .app-data-table,
        #insurance-explorer-section .app-data-table,
        #users-explorer-section .app-data-table,
        #deleted-tickets-section .app-data-table,
        #approved-tickets-section .app-data-table,
        .audit-logs-table,
        .import-logs-table,
        .advance-requests-table
    ).app-data-table td::before,
    body[data-user-role="admin"] .tickets-review-table td::before {
        content: none !important;
        display: none !important;
    }

    body[data-user-role="admin"] .directory-employment-table .dir-td-name,
    body[data-user-role="admin"] .attendance-report-table .employee-cell {
        min-width: 210px !important;
        text-align: start !important;
    }
}

@media (max-width: 720px) {
    .admin-command-head {
        align-items: stretch;
        flex-direction: column;
        overflow: visible;
        padding: 16px;
    }

    .admin-command-toolbar,
    .admin-command-lanes,
    .admin-command-analysis-grid {
        grid-template-columns: 1fr;
    }

    .admin-command-period-switch,
    .admin-command-month-field,
    .admin-command-field,
    .admin-command-refresh {
        width: 100%;
    }

    .admin-command-context,
    .admin-command-context-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-command-period-stats {
        white-space: normal;
    }

    .admin-command-lane {
        padding: 14px;
    }

    .admin-command-lane-cta,
    .admin-command-chip {
        min-height: 44px;
        width: 100%;
        justify-content: space-between;
    }

    .admin-operations-dashboard {
        gap: 10px;
    }

    .admin-operations-head,
    .admin-operations-panel {
        padding: 14px;
        border-radius: 10px;
    }

    .admin-operations-head h1 {
        font-size: 1.3rem;
    }

    .admin-operations-control-row {
        grid-template-columns: 1fr;
    }

    .admin-operations-control-row .dashboard-refresh-btn {
        width: 100%;
    }

    .admin-operation-card {
        min-height: 150px;
        padding: 15px;
        border-radius: 10px;
    }

    .admin-operations-panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-dashboard-response-item > strong {
        white-space: normal;
    }
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: 132px;
    }

    body:has(#mobile-bottom-bar:not(.hidden)) {
        padding-bottom: calc(78px + var(--safe-bottom));
        overflow-x: hidden;
        background: #F6F7F9;
    }

    body.app-modal-open {
        overflow: hidden;
    }

    body.app-modal-open .mobile-bottom-bar {
        display: none !important;
        pointer-events: none;
    }

    body[data-user-role="employee"] .modal {
        z-index: 1500 !important;
        align-items: stretch;
        padding: 0 !important;
    }

    body[data-user-role="employee"] .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100dvh;
        max-height: 100dvh !important;
        padding-top: calc(18px + var(--safe-top)) !important;
        padding-bottom: calc(24px + var(--safe-bottom)) !important;
        border-radius: 0 !important;
        overscroll-behavior: contain;
    }

    #app,
    .section-container {
        width: 100%;
        max-width: 100%;
    }

    #global-footer {
        display: none !important;
    }

    #top-nav {
        padding: calc(8px + var(--safe-top)) 0 0;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 4px 16px rgba(16, 24, 40, 0.07);
    }

    #top-nav .nav-container {
        padding: 0 12px 8px;
        gap: 8px;
        align-items: center;
    }

    #top-nav .logo-area {
        gap: 8px;
        min-width: 0;
    }

    #top-nav .logo-area img {
        height: 28px;
    }

    #top-nav .logo {
        max-width: 112px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.82rem;
    }

    #top-nav .user-info {
        gap: 6px;
        min-width: 0;
    }

    #top-nav .nav-icon-btn-v2 {
        width: 34px;
        height: 34px;
        min-height: 34px !important;
        border-radius: 8px;
    }

    #top-nav .nav-user-chip {
        max-width: 118px;
        padding: 4px 8px 4px 4px;
        gap: 6px;
    }

    #top-nav .nav-user-chip-avatar {
        width: 24px;
        height: 24px;
        font-size: 0.68rem;
    }

    #top-nav .nav-user-chip .nav-username {
        display: inline;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.76rem;
    }

    #top-nav .nav-user-chip .badge {
        display: none;
    }

    #top-nav #btn-logout {
        width: 100%;
        height: auto;
        min-height: 42px;
        padding: 8px 10px !important;
        border-radius: 8px;
        justify-content: flex-start;
    }

    #top-nav #btn-logout .logout-label {
        display: inline;
    }

    #top-nav .dashboard-sidebar,
    #dashboard-section .dashboard-sidebar {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 8px 12px 10px;
        overflow-x: auto;
        overflow-y: visible;
        border: 0;
        border-top: 1px solid var(--border);
        border-radius: 0;
        box-shadow: none;
        background: #FFFFFF;
        scrollbar-width: none;
    }

    body[data-user-role="employee"] #dashboard-section .dashboard-sidebar {
        display: none !important;
    }

    #top-nav .dashboard-sidebar::-webkit-scrollbar,
    #dashboard-section .dashboard-sidebar::-webkit-scrollbar {
        display: none;
    }

    #top-nav .dashboard-sidebar::before,
    #dashboard-section .dashboard-sidebar::before,
    #top-nav .dashboard-sidebar h4,
    #dashboard-section .dashboard-sidebar h4 {
        display: none !important;
    }

    #top-nav .dashboard-sidebar .qa-grid,
    #dashboard-section .dashboard-sidebar .qa-grid {
        display: flex !important;
        flex: 0 0 auto;
        flex-wrap: nowrap;
        gap: 8px;
        margin: 0;
    }

    #top-nav .dashboard-sidebar .qa-btn,
    #dashboard-section .dashboard-sidebar .qa-btn {
        width: auto !important;
        min-width: 126px;
        min-height: 40px;
        flex: 0 0 auto !important;
        gap: 8px;
        margin: 0 !important;
        padding: 8px 10px !important;
        border-radius: 8px;
        box-shadow: none;
    }

    #top-nav .dashboard-sidebar .qa-icon,
    #dashboard-section .dashboard-sidebar .qa-icon {
        width: 26px;
        height: 26px;
        border-radius: 8px;
    }

    #top-nav .dashboard-sidebar .qa-title,
    #dashboard-section .dashboard-sidebar .qa-title {
        max-width: 82px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.76rem;
    }

    #top-nav .dashboard-sidebar .qa-sub,
    #dashboard-section .dashboard-sidebar .qa-sub {
        display: none !important;
    }

    #top-nav #admin-controls:not(.hidden),
    #dashboard-section #admin-controls:not(.hidden) {
        display: flex !important;
        flex: 0 0 auto;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        overflow: visible;
    }

    #admin-controls > .admin-accordion {
        flex: 0 0 auto;
        overflow: visible !important;
    }

    #admin-controls .accordion-header {
        min-height: 40px;
        padding: 8px 10px;
        border-radius: 8px;
        font-size: 0.78rem;
        box-shadow: inset 0 -3px 0 var(--group-accent), var(--shadow-sm);
    }

    #admin-controls .accordion-header .icon-text {
        max-width: 132px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #admin-controls .accordion-body {
        position: fixed !important;
        right: 10px !important;
        left: 10px !important;
        top: auto !important;
        bottom: calc(72px + var(--safe-bottom)) !important;
        z-index: 1200;
        display: flex !important;
        flex-direction: column;
        gap: 0;
        width: auto !important;
        max-height: 55vh !important;
        padding: 8px 0 !important;
        overflow-y: auto !important;
        border: 1px solid var(--border) !important;
        border-radius: 10px !important;
        background: #FFFFFF !important;
        box-shadow: 0 20px 48px rgba(16, 24, 40, 0.18) !important;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(8px);
    }

    #admin-controls .accordion-body.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    #admin-controls .accordion-body .admin-action-btn {
        width: 100% !important;
        min-height: auto;
        margin: 0 !important;
        padding: 12px 16px !important;
        border: 0 !important;
        border-bottom: 1px solid var(--border) !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        color: var(--text-main) !important;
        transform: none !important;
    }

    #dashboard-section {
        padding: 12px 10px;
    }

    #main-dashboard-grid {
        gap: 12px;
    }

    #dashboard-section .grid-2,
    #dashboard-section .dashboard-grid,
    #dashboard-section .dashboard-content {
        display: flex !important;
        flex-direction: column;
        gap: 12px;
        width: 100%;
        min-width: 0;
    }

    .dashboard-overview {
        gap: 10px;
    }

    .dashboard-overview-head {
        align-items: stretch;
        gap: 10px;
        padding: 14px;
        border-radius: 8px;
    }

    .dashboard-overview-head h2 {
        font-size: 1.08rem;
    }

    .dashboard-overview-head p {
        font-size: 0.78rem;
        line-height: 1.6;
    }

    .dashboard-refresh-btn {
        width: 100%;
        min-height: 38px;
        border-radius: 8px;
    }

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

    .dashboard-kpi-tile {
        min-height: 92px;
        padding: 12px;
        border-radius: 8px;
    }

    .dashboard-kpi-tile span {
        font-size: 0.74rem;
    }

    .dashboard-kpi-tile strong {
        font-size: 1.65rem;
    }

    .dashboard-kpi-tile small {
        font-size: 0.7rem;
    }

    .dashboard-insight-strip {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .dashboard-insight-strip > div {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
        padding: 10px 12px;
        border-radius: 8px;
    }

    body[data-user-role="employee"] .dashboard-overview-head {
        padding: 12px;
    }

    body[data-user-role="employee"] .dashboard-overview-head p {
        max-width: 30rem;
    }

    body[data-user-role="employee"] .profile-hero-card {
        align-items: flex-start;
        padding: 14px;
    }

    body[data-user-role="employee"] .profile-hero-card > div:nth-child(2) {
        min-width: 0 !important;
        width: 100%;
    }

    body[data-user-role="employee"] .profile-hero-meta {
        gap: 8px;
        margin-top: 9px;
    }

    body[data-user-role="employee"] .profile-hero-meta-item:nth-child(n + 2) {
        display: none;
    }

    .employee-self-service-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
        margin-top: 12px;
    }

    .employee-self-service-actions button {
        display: grid;
        place-items: center;
        gap: 5px;
        min-width: 0;
        min-height: 58px;
        padding: 8px 5px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--surface);
        color: var(--text-main);
        font-family: var(--font-ui);
    }

    .employee-self-service-actions button span {
        font-size: 1rem;
    }

    .employee-self-service-actions button strong {
        font-size: 0.68rem;
        line-height: 1.35;
        text-align: center;
    }

    .employee-self-service-actions button:disabled {
        color: #047857;
        background: #ECFDF5;
        opacity: 1;
    }

    .employee-detail-section {
        padding: 12px 10px;
    }

    .employee-detail-card {
        gap: 14px;
        padding: 14px 12px;
    }

    .employee-detail-header {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        padding-bottom: 14px;
    }

    .employee-detail-title {
        font-size: 1.08rem;
    }

    .employee-detail-header p {
        font-size: 0.78rem;
    }

    .employee-detail-back {
        width: 100%;
    }

    #employee-regularity-section .ui-style-213 {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    #employee-regularity-section table,
    #employee-regularity-section tbody,
    #employee-regularity-section tr,
    #employee-regularity-section td {
        display: block;
        width: 100%;
    }

    #employee-regularity-section thead {
        display: none;
    }

    #employee-regularity-section tr {
        margin-bottom: 10px;
        padding: 10px 12px;
        border: 1px solid var(--border) !important;
        border-radius: 8px;
        background: var(--surface);
    }

    #employee-regularity-section td {
        display: grid;
        grid-template-columns: 105px minmax(0, 1fr);
        gap: 10px;
        padding: 7px 0 !important;
        border-bottom: 1px solid var(--border-table);
        text-align: right !important;
    }

    #employee-regularity-section td:last-child {
        border-bottom: 0;
    }

    #employee-regularity-section td::before {
        content: attr(data-label);
        color: var(--text-muted);
        font-size: 0.72rem;
        font-weight: 800;
    }

    .tickets-workspace-card,
    .advance-admin-shell,
    .employee-advance-log-card,
    .card {
        border-radius: 8px;
    }

    .tickets-workspace-head,
    .advance-admin-header,
    .employee-advance-log-head {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .advance-admin-header {
        padding: 18px;
    }

    .advance-admin-title-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .tickets-workspace-head h2,
    .advance-admin-header h2,
    .employee-advance-log-head h2 {
        font-size: 1.05rem;
    }

    .tickets-section-subtitle,
    .advance-admin-header p,
    .employee-advance-log-head p {
        font-size: 0.78rem;
        line-height: 1.6;
    }

    .tickets-toolbar,
    .advance-admin-toolbar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        width: 100%;
    }

    .advance-admin-toolbar {
        padding: 14px;
    }

    .advance-admin-shell.is-supervisor-view .advance-admin-toolbar {
        grid-template-columns: 1fr;
    }

    .tickets-toolbar select,
    .advance-admin-toolbar input,
    .advance-admin-toolbar select {
        width: 100%;
        min-height: 40px;
        border-radius: 8px;
        font-size: 0.82rem;
    }

    .app-table-wrap {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .app-data-table,
    .app-data-table thead,
    .app-data-table tbody,
    .app-data-table tr,
    .app-data-table td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .app-data-table {
        border-collapse: separate !important;
        border-spacing: 0 10px !important;
    }

    .app-data-table thead {
        display: none !important;
    }

    .app-data-table tr {
        margin-bottom: 10px;
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: #FFFFFF !important;
        box-shadow: var(--shadow-sm);
    }

    .app-data-table td {
        display: grid !important;
        grid-template-columns: 92px minmax(0, 1fr);
        align-items: start;
        gap: 10px;
        padding: 8px 0 !important;
        border: 0 !important;
        border-bottom: 1px solid var(--border-table) !important;
        text-align: right !important;
        white-space: normal !important;
        max-width: none !important;
        font-size: 0.82rem;
    }

    .app-data-table td:last-child {
        border-bottom: 0 !important;
    }

    .app-data-table td::before {
        content: attr(data-label);
        color: var(--text-muted);
        font-size: 0.7rem;
        font-weight: 800;
        line-height: 1.5;
    }

    .app-data-table td:not([data-label])::before {
        content: '';
    }

    .tickets-review-table td[data-label="إجراءات"],
    .advance-requests-table td[data-label="إجراءات"],
    .advance-requests-table td[data-label="قرار الإدارة"],
    .advance-requests-table td[data-label="رأي المشرف"],
    .advance-requests-table td[data-label="التنفيذ"] {
        display: block !important;
    }

    .tickets-review-table td[data-label="إجراءات"]::before,
    .advance-requests-table td[data-label="إجراءات"]::before,
    .advance-requests-table td[data-label="قرار الإدارة"]::before,
    .advance-requests-table td[data-label="رأي المشرف"]::before,
    .advance-requests-table td[data-label="التنفيذ"]::before {
        display: block;
        margin-bottom: 8px;
    }

    .ticket-action-btn,
    .advance-admin-shell .advance-actions button,
    .advance-admin-shell .btn-advance-opinion,
    .advance-admin-shell .btn-advance-execute,
    .advance-admin-shell .btn-advance-edit,
    .advance-admin-shell .btn-advance-delete {
        min-height: 36px;
        margin: 0 0 6px 6px;
        padding: 8px 10px;
        border-radius: 8px;
        font-size: 0.78rem;
    }

    .advance-admin-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        width: 100%;
    }

    .advance-admin-stats span {
        justify-content: center;
        min-height: 34px;
        padding: 7px;
        border-radius: 8px;
        font-size: 0.72rem;
        text-align: center;
    }

    .advance-bulk-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        width: 100%;
        justify-content: stretch;
    }

    .advance-bulk-actions button,
    .advance-bulk-actions span {
        width: 100%;
        justify-content: center;
    }

    .advance-edit-grid {
        grid-template-columns: 1fr;
    }

    .advance-history-item,
    .advance-calculation-preview {
        align-items: flex-start;
        flex-direction: column;
    }

    .mobile-bottom-bar {
        position: fixed !important;
        top: auto !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        right: 10px;
        bottom: calc(10px + var(--safe-bottom));
        left: 10px;
        z-index: 1300;
        display: flex;
        gap: 8px;
        align-items: center;
        justify-content: flex-start;
        padding: 8px;
        overflow-x: auto;
        border: 1px solid rgba(229, 231, 235, 0.95);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 18px 44px rgba(16, 24, 40, 0.18);
        backdrop-filter: blur(14px);
        scrollbar-width: none;
    }

    .mobile-bottom-bar::-webkit-scrollbar {
        display: none;
    }

    .mobile-bottom-bar.hidden {
        display: none !important;
    }

    .mobile-bottom-bar button {
        display: grid;
        place-items: center;
        gap: 3px;
        flex: 1 0 auto;
        min-width: 86px;
        min-height: 42px;
        padding: 8px 10px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: #FFFFFF;
        color: var(--text-main);
        font-family: var(--font-ui);
        font-size: 0.76rem;
        font-weight: 900;
        white-space: nowrap;
    }

    .mobile-bottom-bar .mobile-nav-icon {
        font-size: 0.95rem;
        line-height: 1;
    }

    body[data-user-role="employee"] .mobile-bottom-bar {
        overflow: hidden;
    }

    body[data-user-role="employee"] .mobile-bottom-bar button {
        flex: 1 1 0;
        min-width: 0;
        padding-inline: 4px;
        font-size: 0.7rem;
    }

    .mobile-bottom-bar button:not(.hidden):first-of-type {
        border-color: rgba(185, 28, 28, 0.2);
        background: var(--primary-light);
        color: var(--primary);
    }

    .mobile-bottom-bar button.hidden {
        display: none !important;
    }

    .mobile-bottom-bar button:disabled {
        opacity: 0.55;
    }
}

/* Menu mark: three bars, becoming a close mark while the drawer is open. */
body[data-user-role="admin"] #top-nav #admin-nav-menu-toggle {
    padding: 0 !important;
    border: 1px solid rgba(185, 28, 28, 0.24);
    color: var(--brand-red);
}
.admin-nav-bars {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 18px;
    height: 18px;
}
.admin-nav-bars i {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 180ms ease, opacity 180ms ease;
}
#admin-nav-menu-toggle[aria-expanded="true"] .admin-nav-bars,
.admin-nav-bars.is-open {
    gap: 0;
}
#admin-nav-menu-toggle[aria-expanded="true"] .admin-nav-bars i:nth-child(1),
.admin-nav-bars.is-open i:nth-child(1),
#admin-nav-menu-toggle[aria-expanded="true"] .admin-nav-bars i:nth-child(3),
.admin-nav-bars.is-open i:nth-child(3) {
    position: absolute;
    inset-inline: 0;
    top: 8px;
}
#admin-nav-menu-toggle[aria-expanded="true"] .admin-nav-bars i:nth-child(1),
.admin-nav-bars.is-open i:nth-child(1) {
    transform: rotate(45deg);
}
#admin-nav-menu-toggle[aria-expanded="true"] .admin-nav-bars i:nth-child(2),
.admin-nav-bars.is-open i:nth-child(2) {
    opacity: 0;
}
#admin-nav-menu-toggle[aria-expanded="true"] .admin-nav-bars i:nth-child(3),
.admin-nav-bars.is-open i:nth-child(3) {
    transform: rotate(-45deg);
}
.admin-navigation-heading { display: none; }

/* Manager navigation: preserve existing action controls while organizing them as a drawer. */
.admin-nav-menu-toggle,
.admin-nav-scrim,
.admin-navigation-home {
    display: none;
}

body[data-user-role="admin"] #admin-nav-menu-toggle {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px !important;
    margin-inline-end: 4px;
    border-color: var(--brand-red);
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--brand-red);
}

body[data-user-role="admin"] #admin-nav-menu-toggle:hover,
body[data-user-role="admin"] #admin-nav-menu-toggle:focus-visible {
    background: var(--primary-light);
    color: var(--brand-red-dark);
    border-color: var(--brand-red);
}

body[data-user-role="admin"] #admin-nav-menu-toggle:focus-visible {
    outline: 2px solid var(--brand-red);
    outline-offset: 2px;
}

.admin-navigation-home {
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-main);
    text-align: start;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
}

.admin-navigation-home:hover,
.admin-navigation-home:focus-visible {
    border-color: var(--brand-red);
    background: var(--primary-light);
    color: var(--brand-red-dark);
}

.admin-navigation-home-icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: var(--primary-light);
    color: var(--brand-red);
}

@media (min-width: 1025px) {
    body[data-user-role="admin"] #admin-navigation {
        position: fixed !important;
        top: var(--admin-nav-offset, 78px);
        right: 0;
        bottom: 0;
        left: auto;
        z-index: 40;
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 10px;
        width: 300px;
        max-width: none;
        height: auto;
        max-height: none;
        margin: 0;
        padding: 14px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        border: 0;
        border-inline-end: 1px solid var(--border);
        border-radius: 0;
        background: var(--surface);
        box-shadow: none;
        transform: translateX(100%);
        visibility: hidden;
        pointer-events: none;
        transition: transform 180ms ease, visibility 180ms ease;
    }

    body.admin-nav-open[data-user-role="admin"] #admin-navigation {
        transform: none;
        visibility: visible;
        pointer-events: auto;
    }

    body[data-user-role="admin"] .admin-nav-scrim {
        display: none !important;
    }

    body.admin-nav-open[data-user-role="admin"] #app {
        padding-inline-start: 300px;
        transition: padding-inline-start 180ms ease;
    }

    body[data-user-role="admin"] #admin-navigation #admin-nav-close {
        display: none !important;
    }

    body[data-user-role="admin"] #admin-navigation .admin-navigation-home {
        display: flex;
    }

    body[data-user-role="admin"] #admin-navigation .qa-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
        justify-content: stretch;
    }

    body[data-user-role="admin"] #admin-navigation .qa-btn {
        justify-content: flex-start;
        width: 100% !important;
        min-width: 0;
        min-height: 44px;
        padding: 8px 10px !important;
        text-align: start;
    }

    body[data-user-role="admin"] #admin-navigation .qa-sub {
        display: none;
    }

    body[data-user-role="admin"] #admin-navigation #admin-controls:not(.hidden) {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 7px;
        width: 100%;
        margin: 0 !important;
        padding: 10px 0 0 !important;
        border-top: 1px solid var(--border) !important;
    }

    body[data-user-role="admin"] #admin-navigation #admin-controls > h4 {
        display: none !important;
    }

    body[data-user-role="admin"] #admin-navigation #admin-controls > .admin-accordion {
        width: 100%;
    }

    body[data-user-role="admin"] #admin-navigation .admin-accordion .accordion-header {
        width: 100%;
        min-height: 40px;
        justify-content: space-between;
        padding: 8px 10px;
        text-align: start;
    }

    body[data-user-role="admin"] #admin-navigation .admin-accordion .accordion-body::before {
        content: none;
        display: none;
    }

    body[data-user-role="admin"] #admin-navigation .admin-accordion .accordion-body {
        position: static !important;
        display: block;
        width: 100%;
        max-height: 0 !important;
        margin: 0;
        padding: 0 8px;
        overflow: hidden;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
    }

    body[data-user-role="admin"] #admin-navigation .admin-accordion .accordion-body.open {
        max-height: none !important;
        padding: 8px;
        border-top: 1px solid var(--border);
    }

    body[data-user-role="admin"] #admin-navigation .admin-accordion .accordion-body .admin-action-btn {
        width: 100% !important;
        min-width: 0;
        min-height: 44px;
    }

    body[data-user-role="admin"] #admin-navigation .accordion-body .admin-btn-title {
        white-space: normal;
        overflow-wrap: break-word;
        word-break: normal;
    }
}

@media (max-width: 1024px) {
    body[data-user-role="admin"] #admin-navigation {
        position: fixed !important;
        top: var(--admin-nav-offset, 64px);
        right: 0;
        bottom: 0;
        left: auto;
        z-index: 1901;
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 9px;
        width: min(88vw, 340px);
        height: auto;
        max-height: none;
        margin: 0;
        padding: 16px 14px calc(18px + var(--safe-bottom));
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        border: 0;
        border-inline-start: 1px solid var(--border);
        border-radius: 0;
        background: var(--surface);
        box-shadow: var(--shadow-xl);
        transform: translateX(105%);
        visibility: hidden;
        transition: transform 180ms ease, visibility 180ms ease;
    }

    body[data-user-role="admin"] #admin-navigation .admin-navigation-home {
        display: flex;
    }

    body[data-user-role="admin"] #admin-navigation .qa-grid {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 6px;
        margin: 0 0 4px;
    }

    body[data-user-role="admin"] #admin-navigation .qa-btn {
        justify-content: flex-start;
        width: 100% !important;
        min-width: 0;
        min-height: 44px;
        padding: 8px 10px !important;
        text-align: start;
    }

    body[data-user-role="admin"] #admin-navigation .qa-sub {
        display: none;
    }

    body[data-user-role="admin"] #admin-navigation #admin-controls:not(.hidden) {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 7px;
        margin: 0 !important;
        padding-top: 10px !important;
        border-top: 1px solid var(--border) !important;
    }

    body[data-user-role="admin"] #admin-navigation #admin-controls > .admin-accordion {
        overflow: hidden;
    }

    body[data-user-role="admin"] #admin-navigation .accordion-body {
        position: static !important;
        display: block;
        width: 100%;
        max-height: 0 !important;
        padding: 0 8px;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
        overflow: hidden;
    }

    body[data-user-role="admin"] #admin-navigation .accordion-body::before {
        content: none;
        display: none;
    }

    body[data-user-role="admin"] #admin-navigation .accordion-body.open {
        max-height: none !important;
        padding: 8px;
    }

    body.admin-nav-open[data-user-role="admin"] #admin-navigation {
        transform: translateX(0);
        visibility: visible;
    }

    body[data-user-role="admin"] .admin-nav-scrim {
        position: fixed;
        top: var(--admin-nav-offset, 64px);
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1900;
        display: block;
        background: rgba(16, 24, 40, 0.48);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
    }

    body.admin-nav-open[data-user-role="admin"] .admin-nav-scrim {
        opacity: 1;
        pointer-events: auto;
    }

    body.admin-nav-open[data-user-role="admin"] {
        overflow: hidden;
    }
}

/* Admin drawer presentation, scoped away from employee/supervisor navigation. */
body[data-user-role="admin"] #admin-navigation .qa-grid.hidden,
body[data-user-role="admin"] #admin-navigation .accordion-body:not(.open) {
    display: none !important;
}
body[data-user-role="admin"] #admin-navigation .admin-navigation-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 2px 14px;
    border-bottom: 1px solid var(--border);
}
.admin-navigation-heading strong { display: block; font-size: 1rem; color: var(--text-main); }
.admin-navigation-heading small { display: block; margin-top: 4px; font-size: 0.72rem; color: var(--text-muted); }
body[data-user-role="admin"] #admin-navigation #admin-nav-close {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft, #F8FAFC);
    color: var(--text-muted);
    font-size: 26px;
    cursor: pointer;
}
body[data-user-role="admin"] #admin-navigation .admin-accordion .accordion-header {
    min-height: 48px;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--surface);
    box-shadow: none;
    color: var(--text-main);
    font-size: 0.84rem;
    transition: background 140ms ease;
}
body[data-user-role="admin"] #admin-navigation .admin-accordion .accordion-header:hover {
    background: var(--surface-soft, #F8FAFC);
}
body[data-user-role="admin"] #admin-navigation .admin-accordion .accordion-header.has-current,
body[data-user-role="admin"] #admin-navigation .admin-navigation-home.is-current {
    border-color: rgba(185, 28, 28, 0.2);
    background: var(--primary-light);
    color: var(--brand-red-dark);
    box-shadow: none;
}
body[data-user-role="admin"] #admin-navigation .admin-accordion .accordion-header.active {
    background: var(--surface-soft, #F8FAFC);
}
body[data-user-role="admin"] #admin-navigation .admin-accordion .accordion-body.open {
    margin: 4px 0 6px;
    padding: 4px 8px;
    border: 0;
    border-inline-start: 2px solid var(--border);
}
body[data-user-role="admin"] #admin-navigation .accordion-body .admin-action-btn.is-current {
    background: var(--primary-light) !important;
    color: var(--brand-red-dark) !important;
    border-radius: 8px !important;
}
body[data-user-role="admin"] #admin-navigation .nav-glyph {
    display: inline-flex;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    color: #667085;
}
body[data-user-role="admin"] #admin-navigation .nav-glyph svg {
    width: 18px;
    height: 18px;
}
body[data-user-role="admin"] #admin-navigation .accordion-header.has-current .nav-glyph,
body[data-user-role="admin"] #admin-navigation .accordion-header.has-current .arrow {
    color: var(--brand-red);
}
body[data-user-role="admin"] #admin-navigation .accordion-header .arrow {
    color: #98A2B3;
    background: transparent;
}
body[data-user-role="admin"] #admin-navigation #admin-controls > .admin-accordion {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
body[data-user-role="admin"] #admin-navigation .qa-icon {
    width: 24px;
    height: 24px;
    border-radius: 0;
    background: transparent !important;
    color: #667085 !important;
}
body[data-user-role="admin"] #admin-navigation .qa-btn.is-current {
    border-color: rgba(185, 28, 28, 0.2);
    background: var(--primary-light);
    box-shadow: none;
    color: var(--brand-red-dark);
}
body[data-user-role="admin"] #admin-navigation .qa-btn.is-current .qa-icon {
    color: var(--brand-red) !important;
}
body[data-user-role="admin"] #admin-navigation .admin-action-btn,
body[data-user-role="admin"] #admin-navigation .admin-btn-export {
    background: transparent !important;
    color: var(--text-main) !important;
    border-color: transparent !important;
    box-shadow: none !important;
}
body[data-user-role="admin"] #admin-navigation .admin-action-btn svg {
    width: 18px;
    height: 18px;
    color: #667085 !important;
}
body[data-user-role="admin"] #admin-navigation .admin-action-btn.is-current svg {
    color: var(--brand-red) !important;
}
body[data-user-role="admin"] #admin-navigation button:focus-visible {
    outline: 2px solid var(--brand-red);
    outline-offset: -2px;
}
body[data-user-role="admin"] #admin-navigation .qa-grid:has(> .hidden):not(:has(> :not(.hidden))) { display: none !important; }
@media (min-width: 1025px) {
    body[data-user-role="admin"] #admin-navigation {
        width: 300px;
        bottom: 0;
        max-height: none;
        box-shadow: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    body[data-user-role="admin"] #admin-navigation,
    body[data-user-role="admin"] .admin-nav-scrim,
    body.admin-nav-open[data-user-role="admin"] #app,
    .admin-nav-bars i {
        transition: none !important;
    }
}

@media (max-width: 768px) {
    body[data-user-role="admin"] .admin-payroll-review-available {
        align-items: stretch;
        flex-direction: column;
    }

    body[data-user-role="admin"] .admin-payroll-review-available button {
        width: 100%;
        min-height: 44px;
    }

    body[data-user-role="admin"] #global-footer:not(.hidden),
    body[data-user-role="supervisor"] #global-footer:not(.hidden) {
        display: block !important;
        margin-bottom: 0;
    }

    body[data-user-role="admin"] #global-footer .app-footer-inner {
        justify-content: center;
        padding: 10px 14px;
        font-size: 0.72rem;
        text-align: center;
    }

    body[data-user-role="admin"] .advance-table-wrap {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    body[data-user-role="admin"] #tickets-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    body[data-user-role="admin"] .tickets-review-table.app-data-table {
        display: table !important;
        width: max-content !important;
        min-width: 1120px !important;
        table-layout: auto !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    body[data-user-role="admin"] .tickets-review-table.app-data-table thead {
        display: table-header-group !important;
    }

    body[data-user-role="admin"] .tickets-review-table.app-data-table tbody {
        display: table-row-group !important;
    }

    body[data-user-role="admin"] .tickets-review-table.app-data-table tr {
        display: table-row !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    body[data-user-role="admin"] .tickets-review-table.app-data-table th,
    body[data-user-role="admin"] .tickets-review-table.app-data-table td {
        display: table-cell !important;
        min-width: 110px !important;
        padding: 10px 12px !important;
        border: 0 !important;
        border-bottom: 1px solid var(--border-table) !important;
        text-align: right !important;
        white-space: normal !important;
        font-size: 0.82rem !important;
    }

    body[data-user-role="admin"] .tickets-review-table.app-data-table td::before {
        content: none !important;
        display: none !important;
    }

    body[data-user-role="admin"] .tickets-review-table.app-data-table td:first-child {
        min-width: 190px !important;
    }

    body[data-user-role="admin"] .tickets-review-table.app-data-table td:nth-child(6) {
        min-width: 240px !important;
    }

    body[data-user-role="admin"] .tickets-review-table.app-data-table td:last-child {
        min-width: 290px !important;
    }

    body[data-user-role="admin"] .advance-requests-table.app-data-table {
        display: table !important;
        width: max-content !important;
        min-width: 1500px !important;
        table-layout: auto !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    body[data-user-role="admin"] .advance-requests-table.app-data-table thead {
        display: table-header-group !important;
    }

    body[data-user-role="admin"] .advance-requests-table.app-data-table tbody {
        display: table-row-group !important;
    }

    body[data-user-role="admin"] .advance-requests-table.app-data-table tr {
        display: table-row !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    body[data-user-role="admin"] .advance-requests-table.app-data-table tr.hidden {
        display: none !important;
    }

    body[data-user-role="admin"] .advance-requests-table.app-data-table th,
    body[data-user-role="admin"] .advance-requests-table.app-data-table td {
        display: table-cell !important;
        min-width: 105px !important;
        padding: 10px 12px !important;
        border: 0 !important;
        border-bottom: 1px solid var(--border-table) !important;
        text-align: center !important;
        white-space: normal !important;
        font-size: 0.82rem !important;
    }

    body[data-user-role="admin"] .advance-requests-table.app-data-table td::before {
        content: none !important;
        display: none !important;
    }

    body[data-user-role="admin"] .advance-requests-table.app-data-table td:nth-child(3) {
        min-width: 205px !important;
        text-align: right !important;
    }

    body[data-user-role="admin"] .advance-requests-table.app-data-table td:nth-child(8),
    body[data-user-role="admin"] .advance-requests-table.app-data-table td:nth-child(9),
    body[data-user-role="admin"] .advance-requests-table.app-data-table td:nth-child(12),
    body[data-user-role="admin"] .advance-requests-table.app-data-table td:nth-child(13),
    body[data-user-role="admin"] .advance-requests-table.app-data-table td:nth-child(14) {
        min-width: 210px !important;
    }

    body[data-user-role="admin"] .admin-table-pagination {
        align-items: stretch;
        flex-direction: column;
        padding: 12px;
    }

    body[data-user-role="admin"] .admin-table-pagination > div {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    body[data-user-role="admin"] .admin-table-pagination button {
        min-height: 42px;
    }
}

.salary-report-action-col {
    min-width: 116px;
    white-space: nowrap !important;
}

.salary-report-detail-trigger {
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid rgba(124, 58, 237, 0.24);
    border-radius: 8px;
    background: rgba(124, 58, 237, 0.06);
    color: #6D28D9;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.salary-report-detail-trigger:hover,
.salary-report-detail-trigger:focus-visible {
    border-color: #7C3AED;
    background: rgba(124, 58, 237, 0.12);
    outline: none;
}

.salary-report-detail-dialog {
    width: min(1120px, 96vw) !important;
    max-width: none !important;
    min-width: 0 !important;
    max-height: calc(100dvh - 32px) !important;
    padding: 0 !important;
    overflow: auto;
}

@media (min-width: 761px) {
    .salary-report-detail-modal {
        align-items: stretch;
        justify-content: flex-start;
        padding: 12px;
    }

    .salary-report-detail-dialog {
        align-self: stretch;
        width: min(760px, 58vw) !important;
        max-height: none !important;
        border-radius: 14px;
        box-shadow: 0 18px 48px rgba(16, 24, 40, 0.24);
    }
}

.salary-report-detail-header,
.salary-report-detail-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-table-odd);
}

.salary-report-detail-header > div > span {
    color: var(--brand-red);
    font-size: 0.74rem;
    font-weight: 900;
}

.salary-report-detail-header h2 {
    margin: 3px 0 0;
    font-size: 1.1rem;
}

.salary-report-detail-close {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.salary-report-detail-body {
    padding: 18px 20px;
}

.salary-report-detail-identity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.salary-report-detail-identity h3 {
    margin: 0;
    font-size: 1.1rem;
}

.salary-report-detail-identity p,
.salary-report-detail-identity > span {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.salary-report-detail-totals {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 13px;
}

.salary-report-detail-totals article {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.salary-report-detail-totals article > span {
    color: var(--text-muted);
    font-size: 0.73rem;
    font-weight: 800;
}

.salary-report-detail-totals article > strong {
    color: var(--text-main);
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.salary-report-detail-totals article > strong.is-deduction {
    color: var(--danger);
}

.salary-report-detail-totals article.is-net {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.055);
}

.salary-report-detail-totals article.is-net > strong {
    color: #047857;
}

.salary-report-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 10px;
}

.salary-report-detail-panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.salary-report-detail-panel h4 {
    margin: 0;
    padding: 11px 13px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-table-odd);
    font-size: 0.84rem;
}

.salary-report-detail-panel.is-additions h4 { color: #047857; }
.salary-report-detail-panel.is-deductions h4 { color: var(--brand-red); }

.salary-report-detail-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 41px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-table);
    font-size: 0.76rem;
}

.salary-report-detail-line span { color: var(--text-muted); }
.salary-report-detail-line strong { white-space: nowrap; }

.salary-report-detail-note {
    margin: 0;
    padding: 10px 12px;
    background: rgba(124, 58, 237, 0.045);
    color: var(--text-muted);
    font-size: 0.73rem;
    line-height: 1.7;
}

.salary-report-detail-panel .payroll-summary-value-row {
    min-height: 40px;
    padding: 8px 12px;
}

.salary-report-detail-panel .payroll-summary-value-row span,
.salary-report-detail-panel .payroll-summary-value-row strong {
    font-size: 0.74rem;
}

.salary-report-detail-position {
    margin-top: 11px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.salary-report-detail-navigation {
    border-top: 1px solid var(--border);
    border-bottom: 0;
}

.salary-report-detail-navigation > span {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.salary-report-detail-navigation button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

@media (max-width: 900px) {
    #salary-report-employee-table.salary-report-table.app-data-table {
        min-width: 1040px !important;
    }
}

@media (max-width: 760px) {
    .salary-report-detail-modal {
        align-items: stretch;
        padding: 0 !important;
        padding-top: var(--safe-top) !important;
        padding-bottom: var(--safe-bottom) !important;
    }

    .salary-report-detail-dialog {
        width: 100% !important;
        max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom)) !important;
        border-radius: 0 !important;
    }

    .salary-report-detail-header,
    .salary-report-detail-navigation {
        padding: 12px 14px;
    }

    .salary-report-detail-body {
        padding: 13px;
    }

    .salary-report-detail-identity {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .salary-report-detail-totals {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .salary-report-detail-totals article {
        padding: 10px;
    }

    .salary-report-detail-totals article > strong {
        font-size: 0.9rem;
    }

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

    .salary-report-detail-navigation button {
        min-height: 38px;
        padding-inline: 9px;
        font-size: 0.74rem;
    }
}

/* Keep financial comparison tables tabular on narrow screens; scroll inside the report panel. */
.salary-report-scroll-hint {
    display: none;
}

@media (max-width: 900px) {
    .salary-report-table-wrap.app-table-wrap {
        max-width: 100%;
        overflow-x: auto !important;
        overflow-y: auto !important;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
    }

    .salary-report-scroll-hint {
        display: block;
        padding: 8px 12px;
        border-bottom: 1px solid var(--border);
        background: var(--bg-table-odd);
        color: var(--text-muted);
        font-size: 0.72rem;
        font-weight: 700;
        text-align: right;
    }

    .salary-report-table.app-data-table {
        display: table !important;
        width: max-content !important;
        min-width: 900px !important;
        table-layout: auto !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    .salary-report-table.app-data-table thead {
        display: table-header-group !important;
    }

    .salary-report-table.app-data-table tbody {
        display: table-row-group !important;
        width: auto !important;
    }

    .salary-report-table.app-data-table tr {
        display: table-row !important;
        width: auto !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .salary-report-table.app-data-table tr.hidden,
    .salary-report-table.app-data-table .salary-change-expanded-row.hidden {
        display: none !important;
    }

    .salary-report-table.app-data-table th,
    .salary-report-table.app-data-table td {
        display: table-cell !important;
        width: auto !important;
        min-width: 76px !important;
        padding: 10px 12px !important;
        border: 0 !important;
        border-bottom: 1px solid var(--border-table) !important;
        text-align: center !important;
        white-space: normal !important;
        font-size: 0.8rem;
    }

    .salary-report-table.app-data-table td::before {
        content: none !important;
        display: none !important;
    }

    .salary-report-table.app-data-table td.salary-report-name,
    .salary-report-table.app-data-table td.salary-report-scope-cell,
    .salary-report-table.app-data-table td.salary-change-summary-cell {
        min-width: 190px !important;
        text-align: right !important;
        white-space: normal !important;
    }

    .salary-report-table.app-data-table td.salary-report-code,
    .salary-report-table.app-data-table td[dir="ltr"],
    .salary-report-table.app-data-table td.salary-report-total-cell {
        white-space: nowrap !important;
    }

    .salary-report-table.app-data-table.salary-change-employee-table {
        min-width: 1080px !important;
    }

    .salary-report-table.app-data-table.salary-change-employee-table th,
    .salary-report-table.app-data-table.salary-change-employee-table td {
        min-width: 96px !important;
    }

    .salary-report-table.app-data-table.salary-change-employee-table td.salary-change-details-cell {
        min-width: 370px !important;
        white-space: normal !important;
    }

    .salary-report-table.app-data-table .salary-change-expanded-row > td {
        min-width: 0 !important;
        white-space: normal !important;
    }
}

.appearance-settings-shell {
    width: 100%;
}

@media (max-width: 720px) {
    .appearance-settings-shell {
        padding: 16px;
    }

    .appearance-choice-grid,
    .appearance-size-grid {
        grid-template-columns: 1fr;
    }

    .appearance-settings-actions .btn-primary,
    .appearance-settings-actions .btn-outline {
        width: 100%;
    }
}
