/* ===============================
   GLOBAL RESET
================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    width: 100%;
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f3f4f6;
    color: #111827;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

/* ===============================
   APP / AUTH LAYOUT
================================ */

.app-shell {
    padding: 30px;
}

.auth-shell {
    min-height: 100vh;
    padding: 0;
}

/* ===============================
   PAGE HEADER
================================ */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0;
    font-size: 34px;
    line-height: 1.15;
    letter-spacing: -0.8px;
    color: #111827;
}

.page-header p {
    margin: 6px 0 0;
    color: #6b7280;
    font-size: 17px;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ===============================
   BUTTONS
================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 14px;
    border-radius: 9px;
    background: #e5e7eb;
    color: #111827;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    transition: all 0.18s ease;
}

.btn:hover {
    background: #d1d5db;
}

.btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    min-height: 31px;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 8px;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

/* ===============================
   ALERTS
================================ */

.alert {
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    font-weight: 600;
}

.alert ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

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

.alert.error,
.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

/* ===============================
   TOP NAVIGATION
================================ */

.top-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: #111827;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.top-nav-inner {
    min-height: 66px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-brand a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    text-decoration: none;
    white-space: nowrap;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.brand-text {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.nav-menu {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding: 6px 0;
}

.nav-menu::-webkit-scrollbar {
    height: 4px;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 10px;
    color: #d1d5db;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.18s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

.nav-user {
    text-align: right;
    line-height: 1.2;
}

.nav-user-name {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-user-role {
    margin-top: 3px;
    color: #9ca3af;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.logout-form {
    margin: 0;
}

.logout-btn {
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid rgba(248, 113, 113, 0.45);
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.logout-btn:hover {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    width: 42px;
    height: 38px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
}

/* ===============================
   FORMS / CARDS
================================ */

.form-card {
    background: #ffffff;
    padding: 24px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.form-section {
    margin-bottom: 26px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section h3 {
    margin: 0 0 14px;
    font-size: 18px;
}

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

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field label {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: #111827;
    background: #ffffff;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.field input[readonly],
.field textarea[readonly] {
    background: #f9fafb;
    color: #6b7280;
}

.checkbox-line {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #374151;
}

.checkbox-line input {
    width: auto;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.mt-4 {
    margin-top: 24px;
}

/* ===============================
   LOGIN PAGE
================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 34%),
        radial-gradient(circle at bottom right, rgba(124, 58, 237, 0.14), transparent 36%),
        #f3f4f6;
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 30px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
}

.login-logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    letter-spacing: 0.5px;
}

.login-brand h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.1;
    color: #111827;
}

.login-brand p {
    margin: 6px 0 0;
    color: #6b7280;
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-btn {
    width: 100%;
    min-height: 46px;
    margin-top: 4px;
    font-size: 15px;
}

.login-hint {
    margin-top: 18px;
    padding: 14px;
    border-radius: 14px;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    color: #374151;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.login-hint strong {
    color: #111827;
}

/* ===============================
   SUMMARY CARDS
================================ */

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

.summary-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.summary-card span {
    display: block;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
}

.summary-card strong {
    display: block;
    font-size: 20px;
    color: #111827;
}

/* ===============================
   TABLES - GLOBAL
================================ */

.table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.table-wrapper::-webkit-scrollbar {
    height: 12px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 999px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 999px;
    border: 2px solid #f1f5f9;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

.payroll-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.payroll-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #111827;
    color: #ffffff;
    text-align: left;
    padding: 12px;
    white-space: nowrap;
}

.payroll-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
    vertical-align: middle;
}

.payroll-table tbody tr:hover {
    background: #f9fafb;
}

.payroll-table tbody tr:last-child td {
    border-bottom: none;
}

.empty-state {
    text-align: center;
    padding: 30px;
    color: #6b7280;
}

.empty-box {
    padding: 24px;
    text-align: center;
}

.empty-box h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.empty-box p {
    margin: 0 0 14px;
    color: #6b7280;
}

.compact-table {
    min-width: 1000px;
}

/* ===============================
   TABLE TOOLBAR
================================ */

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-bottom: none;
    border-radius: 14px 14px 0 0;
    padding: 16px;
}

.table-toolbar h2 {
    margin: 0;
    font-size: 18px;
}

.table-toolbar p {
    margin: 4px 0 0;
    color: #6b7280;
    font-size: 13px;
}

.table-toolbar-right {
    min-width: 280px;
}

.table-search {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
}

.table-search:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ===============================
   TABLE WIDTHS BY MODULE
================================ */

.payroll-summary-table {
    min-width: 2600px;
}

.employees-table {
    min-width: 1100px;
}

.employee-doc-table {
    min-width: 1050px;
}

.payroll-history-table {
    min-width: 720px;
}

.reports-table {
    min-width: 900px;
}

.loans-table,
.allowances-table,
.leaves-table,
.users-table,
.periods-table {
    min-width: 1000px;
}

/* ===============================
   STICKY ACTION COLUMN
================================ */

.sticky-action {
    position: sticky;
    right: 0;
    z-index: 3;
    background: #ffffff;
    box-shadow: -6px 0 12px rgba(15, 23, 42, 0.06);
}

thead .sticky-action {
    background: #111827;
}

.action-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* ===============================
   BADGES / STATUS
================================ */

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    line-height: 1.2;
}

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

.status-muted {
    background: #f3f4f6;
    color: #4b5563;
}

.status-warning {
    background: #fef3c7;
    color: #92400e;
}

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

.mini-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
}

.fw-semibold {
    font-weight: 700;
}

.text-muted {
    color: #6b7280;
}

.net-pay-cell {
    background: #ecfdf5;
    color: #065f46;
}

/* ===============================
   REPORTS PAGE
================================ */

.report-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.report-stat-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.report-stat-card span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 6px;
}

.report-stat-card strong {
    font-size: 22px;
    color: #111827;
}

.report-section {
    margin-bottom: 22px;
}

.report-section h2 {
    margin: 0 0 14px;
    font-size: 20px;
}

/* ===============================
   EMPLOYEE PROFILE / 201 FILE
================================ */

.employee-profile-header {
    align-items: flex-start;
}

.eyebrow {
    margin-bottom: 6px;
    color: #2563eb;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
}

.profile-card {
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-header h2 {
    margin: 0;
    font-size: 22px;
    color: #111827;
}

.section-header p {
    margin: 5px 0 0;
    color: #6b7280;
}

.document-upload-form {
    display: grid;
    grid-template-columns: 1.4fr 180px 240px 1fr auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 18px;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

.document-submit-field {
    min-width: 130px;
}

.employee-doc-table-wrapper,
.payroll-history-wrapper {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    border-radius: 14px;
}

.employee-doc-table {
    table-layout: fixed;
}

.employee-doc-table th,
.employee-doc-table td {
    vertical-align: middle;
    white-space: nowrap;
}

.employee-doc-table th:nth-child(1),
.employee-doc-table td:nth-child(1) {
    width: 260px;
}

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

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

.employee-doc-table th:nth-child(4),
.employee-doc-table td:nth-child(4) {
    width: 260px;
}

.employee-doc-table th:nth-child(5),
.employee-doc-table td:nth-child(5) {
    width: 130px;
}

.employee-doc-table th:nth-child(6),
.employee-doc-table td:nth-child(6) {
    width: 290px;
}

.doc-name-cell,
.doc-remarks-cell {
    white-space: normal !important;
    word-break: break-word;
}

.doc-action-col {
    white-space: nowrap;
}

.doc-status-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 6px 0 0;
}

.doc-status-form select {
    min-width: 140px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 7px 8px;
    font-size: 13px;
}

.profile-card iframe,
.profile-card embed,
.profile-card object,
.employee-doc-table iframe,
.employee-doc-table embed,
.employee-doc-table object {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* ===============================
   PAYSLIP PAGE
================================ */

.payslip-page {
    min-height: 100vh;
    background: #f3f4f6;
    padding: 24px;
}

.payslip-actions {
    width: 520px;
    max-width: 100%;
    margin: 0 auto 16px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.payslip-sheet {
    width: 520px;
    max-width: 100%;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #9ca3af;
    padding: 18px 20px;
    font-family: "Times New Roman", serif;
    font-size: 14px;
    color: #111827;
}

.payslip-row {
    display: grid;
    grid-template-columns: 1fr 160px;
    min-height: 21px;
    align-items: center;
}

.payslip-row > div:first-child {
    padding-right: 8px;
}

.payslip-period {
    margin-top: 4px;
}

.payslip-label {
    min-height: 21px;
    margin-top: 2px;
}

.indent div:first-child {
    padding-left: 105px;
}

.amount {
    text-align: right;
    border-left: 1px solid #d1d5db;
    padding-left: 8px;
}

.payslip-line {
    border-top: 1px solid #9ca3af;
    margin: 8px 0;
}

.net-pay {
    font-weight: 700;
    font-size: 15px;
}

/* ===============================
   PRINT
================================ */

@media print {
    body {
        background: #ffffff;
    }

    .no-print,
    .top-nav {
        display: none !important;
    }

    .app-shell,
    .payslip-page {
        padding: 0;
        background: #ffffff;
    }

    .payslip-sheet {
        margin: 0 auto;
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* ===============================
   RESPONSIVE
================================ */

@media (max-width: 1200px) {
    .document-upload-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .document-submit-field {
        grid-column: span 2;
    }
}

@media (max-width: 1100px) {
    .top-nav-inner {
        flex-wrap: wrap;
        padding: 14px 18px;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-menu {
        display: none;
        flex-basis: 100%;
        order: 4;
        flex-wrap: wrap;
        overflow: visible;
        padding-top: 10px;
    }

    .nav-menu.show {
        display: flex;
    }

    .nav-right {
        margin-left: 0;
    }

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

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .table-toolbar-right {
        min-width: 0;
    }
}

@media (max-width: 900px) {
    .app-shell {
        padding: 18px;
    }

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

    .page-actions {
        width: 100%;
    }

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

@media (max-width: 700px) {
    .top-nav-inner {
        gap: 12px;
    }

    .nav-brand {
        flex: 1;
    }

    .brand-text {
        font-size: 16px;
    }

    .nav-right {
        width: 100%;
        justify-content: space-between;
        order: 5;
    }

    .nav-user {
        text-align: left;
    }

    .page-header h1 {
        font-size: 28px;
    }

    .page-header p {
        font-size: 15px;
    }

    .summary-cards,
    .report-stats {
        grid-template-columns: 1fr;
    }

    .page-actions .btn {
        flex: 1;
    }

    .section-header {
        flex-direction: column;
    }

    .document-upload-form {
        grid-template-columns: 1fr;
    }

    .document-submit-field {
        grid-column: span 1;
    }

    .payslip-row {
        grid-template-columns: 1fr 140px;
    }

    .indent div:first-child {
        padding-left: 35px;
    }
}

@media (max-width: 600px) {
    .login-page {
        padding: 18px;
    }

    .login-card {
        padding: 22px;
        border-radius: 18px;
    }

    .login-brand h1 {
        font-size: 24px;
    }
}
/* ===============================
   PROFESSIONAL LOGIN PAGE
================================ */

.auth-shell {
    min-height: 100vh;
    padding: 0;
}

.auth-login-page {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px;
    background:
        linear-gradient(135deg, #0f172a 0%, #111827 42%, #1e1b4b 100%);
}

.auth-bg-shape {
    position: absolute;
    border-radius: 999px;
    filter: blur(8px);
    opacity: 0.55;
    pointer-events: none;
}

.auth-bg-shape-one {
    width: 360px;
    height: 360px;
    left: -120px;
    top: -110px;
    background: rgba(37, 99, 235, 0.35);
}

.auth-bg-shape-two {
    width: 420px;
    height: 420px;
    right: -130px;
    bottom: -160px;
    background: rgba(124, 58, 237, 0.36);
}

.auth-login-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 980px;
    min-height: 560px;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.32);
}

.auth-login-left {
    padding: 44px;
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(79, 70, 229, 0.92)),
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.25), transparent 38%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-logo-wrap {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.auth-logo {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    letter-spacing: 0.8px;
    color: #ffffff;
}

.auth-logo-wrap h1 {
    margin: 0;
    font-size: 34px;
    line-height: 1.08;
    letter-spacing: -0.8px;
}

.auth-logo-wrap p {
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 15px;
    line-height: 1.6;
    max-width: 390px;
}

.auth-feature-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.auth-feature-item span {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.auth-feature-item p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.45;
}

.auth-login-right {
    padding: 44px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-form-header {
    margin-bottom: 26px;
}

.auth-form-header h2 {
    margin: 0;
    font-size: 30px;
    line-height: 1.1;
    letter-spacing: -0.6px;
    color: #111827;
}

.auth-form-header p {
    margin: 8px 0 0;
    color: #6b7280;
    font-size: 15px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-login-right .field input {
    min-height: 46px;
    border-radius: 12px;
}

.auth-login-btn {
    width: 100%;
    min-height: 48px;
    margin-top: 2px;
    border-radius: 12px;
    font-size: 15px;
}

.auth-default-box {
    margin-top: 20px;
    padding: 15px;
    border-radius: 16px;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.auth-default-box strong {
    color: #111827;
    font-size: 13px;
}

.auth-default-box div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-default-box span {
    color: #6b7280;
    font-size: 13px;
}

.auth-default-box code {
    color: #1d4ed8;
    font-size: 13px;
    background: #eff6ff;
    border-radius: 8px;
    padding: 5px 7px;
}

@media (max-width: 900px) {
    .auth-login-card {
        grid-template-columns: 1fr;
        max-width: 520px;
    }

    .auth-login-left {
        padding: 30px;
        gap: 30px;
    }

    .auth-login-right {
        padding: 30px;
    }
}

@media (max-width: 560px) {
    .auth-login-page {
        padding: 18px;
    }

    .auth-login-card {
        border-radius: 22px;
    }

    .auth-logo-wrap {
        flex-direction: column;
    }

    .auth-logo-wrap h1 {
        font-size: 28px;
    }

    .auth-form-header h2 {
        font-size: 26px;
    }

    .auth-default-box div {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }
}
/* ===============================
   BULK PAYSLIP DOWNLOAD
================================ */

.bulk-payslip-card {
    margin-bottom: 18px;
}

.bulk-payslip-form {
    display: grid;
    grid-template-columns: minmax(260px, 420px) auto;
    gap: 14px;
    align-items: end;
}

.bulk-payslip-note {
    margin: 10px 0 0;
    color: #6b7280;
    font-size: 13px;
}

@media (max-width: 700px) {
    .bulk-payslip-form {
        grid-template-columns: 1fr;
    }
}
.payslip-company-header {
    text-align: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #9ca3af;
}

.payslip-company-header h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}

.payslip-company-header p {
    margin: 3px 0 0;
    font-size: 12px;
    color: #4b5563;
}
.companies-table {
    min-width: 1200px;
}
.status-paid {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-select {
    min-height: 31px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 5px 8px;
    font-size: 12px;
    background: #ffffff;
}
.bulk-payslip-form-3 {
    grid-template-columns: minmax(220px, 360px) minmax(220px, 360px) auto;
}

@media (max-width: 900px) {
    .bulk-payslip-form-3 {
        grid-template-columns: 1fr;
    }
}
/* ===============================
   Employee Photo - 2x2 style
================================ */

.employee-profile-photo {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.employee-profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.employee-profile-photo span {
    font-size: 28px;
    font-weight: 700;
    color: #6b7280;
}

/* Photo in employee form */
.employee-photo-preview {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.employee-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.employee-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.employee-photo-placeholder span {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
}

/* Photo in employee table */
.employee-table-photo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
}

.employee-table-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.employee-table-photo span {
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
}

.employee-photo-form-row {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}
/* ===============================
   Navbar Change Password Link
================================ */

.nav-change-password {
    display: inline-block;
    margin-top: 3px;
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
}

.nav-change-password:hover {
    color: #ffffff;
    text-decoration: underline;
}

.nav-link-mobile-only {
    display: none;
}

/* Keep user block neat beside logout */
.nav-user {
    text-align: right;
}

.nav-user-name {
    line-height: 1.2;
}

.nav-user-role {
    line-height: 1.2;
}

/* Mobile: show Change Password inside nav menu instead */
@media (max-width: 900px) {
    .nav-change-password {
        display: none;
    }

    .nav-link-mobile-only {
        display: block;
    }

    .nav-user {
        text-align: left;
    }
}
/* ===============================
   Dashboard Summary Cards - 1 Row
================================ */

.summary-cards {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.summary-card {
    min-width: 0;
    padding: 20px;
}

.summary-card span {
    display: block;
    font-size: 14px;
    line-height: 1.3;
    white-space: normal;
}

.summary-card strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
    line-height: 1.1;
}

/* Medium screens: 3 per row */
@media (max-width: 1200px) {
    .summary-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Tablet: 2 per row */
@media (max-width: 768px) {
    .summary-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile: 1 per row */
@media (max-width: 520px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   MOBILE UX FIXES
   Added to improve phone layout for navbar, cards, forms,
   tables, and profile sections.
========================================================= */

@media (max-width: 900px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-shell {
        padding: 16px;
    }

    .top-nav {
        position: sticky;
        top: 0;
    }

    .top-nav-inner {
        min-height: auto;
        padding: 10px 14px;
        gap: 10px;
        flex-wrap: wrap;
    }

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

    .nav-brand a {
        gap: 9px;
    }

    .brand-icon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        flex: 0 0 38px;
    }

    .brand-text {
        font-size: 17px;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        order: 2;
        margin-left: 0;
        flex: 0 0 42px;
    }

    .nav-menu {
        order: 4;
        flex: 0 0 100%;
        width: 100%;
        display: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 10px 0 2px;
        overflow: visible;
    }

    .nav-menu.show {
        display: grid;
    }

    .nav-link {
        width: 100%;
        min-height: 38px;
        justify-content: flex-start;
        padding: 9px 10px;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.06);
        font-size: 13px;
    }

    .nav-right {
        order: 3;
        flex: 0 0 100%;
        width: 100%;
        margin-left: 0;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        justify-content: space-between;
        gap: 10px;
    }

    .nav-user {
        min-width: 0;
        text-align: left;
    }

    .nav-user-name {
        max-width: 190px;
        font-size: 13px;
    }

    .nav-user-role {
        font-size: 11px;
    }

    .logout-btn {
        min-height: 36px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .nav-change-password {
        display: none;
    }

    .nav-link-mobile-only {
        display: flex;
    }

    .page-header {
        gap: 12px;
        margin-bottom: 16px;
    }

    .page-header h1 {
        font-size: 28px;
        letter-spacing: -0.4px;
    }

    .page-header p {
        font-size: 15px;
    }

    .page-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-actions .btn {
        width: 100%;
    }

    .form-card {
        padding: 16px;
        border-radius: 14px;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .field input,
    .field select,
    .field textarea {
        min-height: 42px;
        font-size: 16px;
    }

    .summary-cards,
    .report-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        margin-bottom: 16px;
    }

    .summary-card,
    .report-stat-card {
        padding: 14px;
        border-radius: 14px;
    }

    .summary-card span,
    .report-stat-card span {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .summary-card strong,
    .report-stat-card strong {
        font-size: 21px;
    }

    .table-toolbar {
        padding: 14px;
        border-radius: 14px 14px 0 0;
    }

    .table-wrapper {
        border-radius: 12px;
    }

    .payroll-table th,
    .payroll-table td {
        padding: 10px;
        font-size: 12px;
    }

    .action-cell {
        align-items: stretch;
        gap: 6px;
    }

    .action-cell .btn,
    .action-cell button,
    .action-cell select {
        min-height: 34px;
    }

    .employee-profile-hero {
        align-items: stretch;
    }

    .employee-profile-main {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 14px;
    }

    .employee-profile-photo {
        width: 88px;
        height: 88px;
        border-radius: 12px;
    }

    .employee-info-grid {
        grid-template-columns: 1fr;
    }

    .document-upload-form {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .employee-photo-form-row {
        align-items: flex-start;
    }

    .employee-photo-preview {
        width: 96px;
        height: 96px;
    }

    .bulk-payslip-form,
    .bulk-payslip-form-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .app-shell {
        padding: 14px 12px;
    }

    .top-nav-inner {
        padding: 9px 12px;
    }

    .brand-text {
        font-size: 16px;
        max-width: 130px;
    }

    .nav-right {
        align-items: center;
    }

    .nav-user-name {
        max-width: 160px;
    }

    .nav-menu {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 26px;
    }

    .page-header p {
        font-size: 14px;
    }

    .page-actions {
        grid-template-columns: 1fr;
    }

    .summary-cards,
    .report-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .summary-card {
        padding: 12px;
    }

    .summary-card span {
        font-size: 11px;
    }

    .summary-card strong {
        font-size: 20px;
    }

    .section-header {
        gap: 10px;
    }

    .section-header h2 {
        font-size: 19px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .payslip-actions {
        flex-direction: column;
    }

    .payslip-actions .btn {
        width: 100%;
    }

    .payslip-sheet {
        padding: 14px 12px;
        font-size: 12px;
    }

    .payslip-row {
        grid-template-columns: 1fr 115px;
    }

    .indent div:first-child {
        padding-left: 18px;
    }
}

@media (max-width: 380px) {
    .summary-cards,
    .report-stats {
        grid-template-columns: 1fr;
    }

    .brand-text {
        max-width: 110px;
    }

    .nav-user-name {
        max-width: 135px;
    }
}
/* ===============================
   PREMIUM ANIMATED LOGIN PAGE
================================ */

.premium-login-page {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 38px;
    background:
        radial-gradient(circle at 20% 20%, rgba(96, 165, 250, 0.28), transparent 28%),
        radial-gradient(circle at 80% 10%, rgba(168, 85, 247, 0.24), transparent 30%),
        radial-gradient(circle at 50% 90%, rgba(20, 184, 166, 0.18), transparent 28%),
        linear-gradient(135deg, #020617 0%, #0f172a 45%, #111827 100%);
}

.premium-login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
    pointer-events: none;
}

.login-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(4px);
    opacity: 0.55;
    animation: floatingOrb 8s ease-in-out infinite;
}

.login-orb-one {
    width: 280px;
    height: 280px;
    top: -80px;
    left: -80px;
    background: rgba(37, 99, 235, 0.48);
}

.login-orb-two {
    width: 340px;
    height: 340px;
    right: -110px;
    bottom: -120px;
    background: rgba(124, 58, 237, 0.45);
    animation-delay: -2.5s;
}

.login-orb-three {
    width: 180px;
    height: 180px;
    left: 48%;
    bottom: 10%;
    background: rgba(14, 165, 233, 0.25);
    animation-delay: -5s;
}

@keyframes floatingOrb {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(18px, -22px, 0) scale(1.08);
    }
}

.premium-login-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1120px;
    min-height: 620px;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    border-radius: 34px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow:
        0 40px 120px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(22px);
    animation: loginCardIn 0.8s ease both;
}

@keyframes loginCardIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }

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

.premium-login-left {
    position: relative;
    padding: 48px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(124, 58, 237, 0.15)),
        rgba(255, 255, 255, 0.04);
}

.premium-login-left::after {
    content: "";
    position: absolute;
    inset: auto -120px -160px auto;
    width: 320px;
    height: 320px;
    border-radius: 999px;
    background: rgba(96, 165, 250, 0.18);
    filter: blur(2px);
}

.premium-brand-row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

.premium-brand-icon {
    width: 62px;
    height: 62px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(124, 58, 237, 0.92));
    color: #ffffff;
    font-size: 19px;
    font-weight: 900;
    letter-spacing: 0.5px;
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.35);
    animation: logoPulse 3.5s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 0 18px 40px rgba(37, 99, 235, 0.35);
    }

    50% {
        transform: translateY(-4px);
        box-shadow: 0 24px 56px rgba(124, 58, 237, 0.48);
    }
}

.premium-brand-row h1 {
    margin: 0;
    font-size: 36px;
    line-height: 1.05;
    letter-spacing: -1px;
}

.premium-brand-row p {
    margin: 10px 0 0;
    color: rgba(226, 232, 240, 0.82);
    font-size: 15px;
    line-height: 1.55;
    max-width: 430px;
}

.premium-hero-copy {
    position: relative;
    z-index: 1;
    max-width: 520px;
    animation: fadeSlideUp 0.9s ease 0.1s both;
}

.premium-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(147, 197, 253, 0.28);
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.premium-hero-copy h2 {
    margin: 0;
    font-size: 46px;
    line-height: 1.02;
    letter-spacing: -1.4px;
}

.premium-hero-copy p {
    margin: 18px 0 0;
    color: rgba(226, 232, 240, 0.82);
    font-size: 16px;
    line-height: 1.7;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

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

.premium-feature-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.premium-feature-card {
    padding: 15px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.13);
    animation: fadeSlideUp 0.9s ease both;
}

.premium-feature-card:nth-child(2) {
    animation-delay: 0.12s;
}

.premium-feature-card:nth-child(3) {
    animation-delay: 0.22s;
}

.premium-feature-card span {
    display: block;
    color: #93c5fd;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 8px;
}

.premium-feature-card strong {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
}

.premium-feature-card p {
    margin: 0;
    color: rgba(226, 232, 240, 0.72);
    font-size: 12px;
    line-height: 1.45;
}

.premium-login-right {
    padding: 38px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    display: flex;
    align-items: center;
    justify-content: center;
}

.premium-login-panel {
    width: 100%;
    max-width: 420px;
    animation: fadeSlideUp 0.9s ease 0.18s both;
}

.premium-login-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.premium-mini-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    background: #eff6ff;
    font-size: 20px;
}

.premium-login-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 34px;
    line-height: 1.05;
    letter-spacing: -0.9px;
}

.premium-login-header p {
    margin: 7px 0 0;
    color: #64748b;
    font-size: 15px;
}

.premium-login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.premium-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.premium-field label {
    color: #1f2937;
    font-size: 13px;
    font-weight: 800;
}

.premium-input-wrap {
    position: relative;
}

.premium-input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 14px;
    pointer-events: none;
}

.premium-input-wrap input {
    width: 100%;
    min-height: 54px;
    padding: 13px 15px 13px 42px;
    border-radius: 16px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    font-size: 15px;
    outline: none;
    transition: all 0.18s ease;
}

.premium-input-wrap input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.premium-login-button {
    margin-top: 4px;
    min-height: 54px;
    width: 100%;
    border: none;
    border-radius: 16px;
    background:
        linear-gradient(135deg, #2563eb, #4f46e5);
    color: #ffffff;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.32);
    transition: all 0.2s ease;
}

.premium-login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 52px rgba(37, 99, 235, 0.42);
}

.premium-login-button:active {
    transform: translateY(0);
}

.premium-button-arrow {
    transition: transform 0.2s ease;
}

.premium-login-button:hover .premium-button-arrow {
    transform: translateX(4px);
}

.premium-login-note {
    margin-top: 22px;
    padding: 14px 15px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.premium-login-note strong {
    color: #0f172a;
    font-size: 13px;
}

.premium-login-note span {
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
}

/* ===============================
   PREMIUM LOGIN RESPONSIVE
================================ */

@media (max-width: 980px) {
    .premium-login-card {
        max-width: 620px;
        grid-template-columns: 1fr;
    }

    .premium-login-left {
        min-height: 420px;
        gap: 34px;
    }

    .premium-feature-grid {
        grid-template-columns: 1fr;
    }

    .premium-hero-copy h2 {
        font-size: 38px;
    }
}

@media (max-width: 620px) {
    .premium-login-page {
        padding: 16px;
        align-items: flex-start;
    }

    .premium-login-card {
        min-height: auto;
        border-radius: 24px;
    }

    .premium-login-left {
        padding: 28px;
        min-height: auto;
    }

    .premium-login-right {
        padding: 28px;
    }

    .premium-brand-row {
        flex-direction: column;
    }

    .premium-brand-row h1 {
        font-size: 30px;
    }

    .premium-hero-copy h2 {
        font-size: 32px;
    }

    .premium-login-header h2 {
        font-size: 28px;
    }

    .premium-input-wrap input {
        min-height: 50px;
    }

    .premium-login-button {
        min-height: 50px;
    }
}

/* =========================================================
   MODERN EMPLOYEE SHOW / PROFILE PAGE
   Full-page redesign for views/employees/show.ejs
========================================================= */

.employee-show-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.employee-show-hero {
    position: relative;
    overflow: hidden;
    min-height: 250px;
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(191, 219, 254, 0.72), transparent 30%),
        radial-gradient(circle at bottom left, rgba(219, 234, 254, 0.9), transparent 36%),
        linear-gradient(135deg, #ffffff 0%, #f8fbff 48%, #eef4ff 100%);
    color: #0f172a;
    border: 1px solid #dbeafe;
    box-shadow: 0 22px 56px rgba(15, 23, 42, 0.10);
}

.employee-show-hero-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(37, 99, 235, 0.04), transparent 22%, transparent 78%, rgba(37, 99, 235, 0.04));
    pointer-events: none;
}

.employee-show-hero::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: -70px;
    top: -70px;
    border-radius: 999px;
    background: rgba(147, 197, 253, 0.28);
    filter: blur(6px);
    pointer-events: none;
}

.employee-show-hero-content {
    position: relative;
    z-index: 1;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 34px;
}

.employee-show-profile-block {
    display: flex;
    align-items: center;
    gap: 22px;
    min-width: 0;
}

.employee-show-photo {
    width: 132px;
    height: 132px;
    border-radius: 28px;
    border: 4px solid #ffffff;
    background: #f8fafc;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.10);
}

.employee-show-photo span {
    color: #2563eb;
    font-size: 34px;
    font-weight: 900;
}

.employee-show-identity {
    min-width: 0;
}

.employee-show-kicker,
.profile-panel-eyebrow {
    display: inline-flex;
    align-items: center;
    margin-bottom: 9px;
    color: #2563eb;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.employee-show-identity h1 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(32px, 4vw, 52px);
    line-height: 1;
    letter-spacing: -1.4px;
    word-break: break-word;
}

.employee-show-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    color: #475569;
}

.employee-show-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid #dbeafe;
    font-size: 13px;
    font-weight: 700;
}

.employee-show-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 15px;
}

.employee-soft-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    color: #1e3a8a;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    font-size: 12px;
    font-weight: 800;
}

.employee-show-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.employee-show-back-btn {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #cbd5e1;
}

.employee-show-back-btn:hover {
    background: #f8fafc;
}

.employee-profile-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: -22px;
    padding: 0 24px;
    position: relative;
    z-index: 2;
}

.employee-profile-metric-card {
    position: relative;
    overflow: hidden;
    min-height: 122px;
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.92);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.11);
}

.employee-profile-metric-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #2563eb;
}

.employee-profile-metric-card.primary::before {
    background: linear-gradient(180deg, #2563eb, #7c3aed);
}

.employee-profile-metric-card span {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.employee-profile-metric-card strong {
    display: block;
    margin-top: 9px;
    color: #0f172a;
    font-size: 28px;
    line-height: 1.05;
    letter-spacing: -0.7px;
}

.employee-profile-metric-card small {
    display: block;
    margin-top: 8px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.35;
}

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

.employee-show-main-column,
.employee-show-side-column {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.profile-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.08);
}

.profile-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.profile-panel-header.compact {
    margin-bottom: 16px;
}

.profile-panel-eyebrow {
    color: #2563eb;
    margin-bottom: 7px;
}

.profile-panel-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 24px;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.profile-panel-header p {
    margin: 7px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

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

.employee-detail-item {
    min-height: 92px;
    padding: 16px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.employee-detail-item span {
    display: block;
    margin-bottom: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.employee-detail-item strong {
    display: block;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.45;
    word-break: break-word;
}

.employee-detail-wide {
    grid-column: span 2;
}

.document-panel-header form {
    flex: 0 0 auto;
}

.document-progress-card {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
    border: 1px solid #dbeafe;
}

.document-progress-card span {
    display: block;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.document-progress-card strong {
    display: block;
    margin-top: 5px;
    color: #0f172a;
    font-size: 25px;
    line-height: 1;
}

.document-progress-card p {
    margin: 0;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
}

.document-progress-track {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #dbeafe;
}

.document-progress-track div {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
}

.employee-document-upload-form {
    grid-template-columns: 1.25fr 170px 220px 1fr auto;
    margin-bottom: 18px;
    box-shadow: none;
}

.employee-doc-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.employee-doc-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.employee-doc-card:hover {
    transform: translateY(-1px);
    border-color: #bfdbfe;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.employee-doc-card-main {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.employee-doc-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.05em;
}

.employee-doc-card h3 {
    margin: 0;
    color: #0f172a;
    font-size: 16px;
    line-height: 1.25;
    word-break: break-word;
}

.employee-doc-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.employee-doc-card p {
    margin: 9px 0 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
}

.employee-doc-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.employee-doc-status-form {
    margin: 0;
}

.employee-no-file {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 31px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.employee-empty-panel {
    padding: 34px 18px;
    text-align: center;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
}

.employee-empty-panel.compact {
    padding: 28px 14px;
}

.employee-empty-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 13px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 900;
}

.employee-empty-panel h3 {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
}

.employee-empty-panel p {
    margin: 8px auto 0;
    max-width: 420px;
    color: #64748b;
    line-height: 1.5;
}

.payroll-panel,
.payroll-history-panel {
    position: static;
    top: auto;
}

.latest-payroll-card {
    padding: 18px;
    border-radius: 20px;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.18), transparent 38%),
        linear-gradient(135deg, #0f172a, #1e293b);
    color: #ffffff;
    margin-bottom: 14px;
}

.latest-payroll-card > span {
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.latest-payroll-card > strong {
    display: block;
    margin-top: 10px;
    font-size: 34px;
    line-height: 1;
    letter-spacing: -1px;
}

.latest-payroll-card > small {
    display: block;
    margin-top: 9px;
    color: rgba(226, 232, 240, 0.78);
}

.latest-payroll-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.latest-payroll-split div {
    padding: 12px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.latest-payroll-split span {
    display: block;
    color: rgba(226, 232, 240, 0.78);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.latest-payroll-split strong {
    display: block;
    margin-top: 6px;
    color: #ffffff;
    font-size: 15px;
}

.employee-full-btn {
    width: 100%;
}

.payroll-timeline-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.payroll-timeline-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.payroll-timeline-item div:first-child {
    min-width: 0;
}

.payroll-timeline-item strong,
.payroll-timeline-item span {
    display: block;
}

.payroll-timeline-item strong {
    color: #0f172a;
    font-size: 14px;
    line-height: 1.25;
}

.payroll-timeline-item span {
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.25;
}

.payroll-timeline-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.employee-side-note {
    margin: 12px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
}

/* Better mobile behavior for the new profile page */
@media (max-width: 1180px) {
    .employee-profile-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .payroll-panel,
    .payroll-history-panel {
        position: static;
    }

    .employee-show-side-column {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
    }
}

@media (max-width: 980px) {
    .employee-show-hero-content {
        align-items: flex-start;
        flex-direction: column;
        padding: 26px;
    }

    .employee-show-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .employee-show-actions .btn {
        flex: 1;
    }

    .employee-document-upload-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .employee-document-upload-form .document-submit-field {
        grid-column: span 2;
    }

    .employee-doc-card {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .employee-doc-card-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .employee-show-hero {
        border-radius: 22px;
    }

    .employee-show-hero-content {
        min-height: auto;
        padding: 22px;
    }

    .employee-show-profile-block {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
    }

    .employee-show-photo {
        width: 104px;
        height: 104px;
        border-radius: 22px;
    }

    .employee-show-identity h1 {
        font-size: 32px;
    }

    .employee-profile-metrics {
        grid-template-columns: 1fr;
        margin-top: -28px;
        padding: 0 14px;
    }

    .employee-show-side-column {
        grid-template-columns: 1fr;
    }

    .profile-panel {
        padding: 17px;
        border-radius: 20px;
    }

    .profile-panel-header,
    .document-panel-header {
        flex-direction: column;
        align-items: stretch;
    }

    .document-panel-header .btn,
    .document-panel-header form {
        width: 100%;
    }

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

    .employee-detail-wide {
        grid-column: auto;
    }

    .document-progress-card {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .document-progress-card p {
        text-align: left;
    }

    .employee-document-upload-form {
        grid-template-columns: 1fr;
    }

    .employee-document-upload-form .document-submit-field {
        grid-column: auto;
    }

    .employee-doc-card-main {
        flex-direction: column;
    }

    .employee-doc-card-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .employee-doc-card-actions .btn,
    .employee-doc-card-actions .inline-form,
    .employee-doc-card-actions .inline-form button,
    .employee-doc-status-form,
    .employee-doc-status-form select,
    .employee-doc-status-form button {
        width: 100%;
    }

    .employee-doc-status-form {
        display: grid;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .employee-show-page {
        gap: 14px;
    }

    .employee-show-hero-content {
        padding: 18px;
    }

    .employee-show-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .employee-show-meta span,
    .employee-show-badges span {
        max-width: 100%;
    }

    .employee-profile-metric-card {
        min-height: auto;
        padding: 16px;
    }

    .employee-profile-metric-card strong {
        font-size: 25px;
    }

    .latest-payroll-card > strong {
        font-size: 29px;
    }

    .latest-payroll-split,
    .payroll-timeline-item {
        grid-template-columns: 1fr;
    }

    .payroll-timeline-item {
        align-items: stretch;
        flex-direction: column;
    }

    .payroll-timeline-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .payroll-timeline-actions .btn {
        width: 100%;
    }
}


/* Employee show v2 desktop fix */
.employee-show-side-column {
    align-self: start;
}

/* =========================================================
   EMPLOYEE DIRECTORY / INDEX PAGE
   Search, filters, CSV export, and responsive table layout
========================================================= */

.employee-index-header {
    align-items: flex-end;
    margin-bottom: 18px;
}

.employee-index-header .eyebrow {
    color: #2563eb;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.employee-index-header h1 {
    margin-top: 6px;
    font-size: clamp(32px, 3.5vw, 46px);
    letter-spacing: -1.3px;
}

.employee-index-header p {
    max-width: 680px;
    color: #64748b;
}

.employee-index-actions {
    align-items: center;
    justify-content: flex-end;
}

.employee-directory-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.employee-directory-stat-card {
    position: relative;
    overflow: hidden;
    min-height: 104px;
    padding: 18px;
    border-radius: 20px;
    background:
        radial-gradient(circle at top right, rgba(191, 219, 254, 0.58), transparent 42%),
        #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
}

.employee-directory-stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, #2563eb, #7c3aed);
}

.employee-directory-stat-card span {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.employee-directory-stat-card strong {
    display: block;
    margin-top: 10px;
    color: #0f172a;
    font-size: 32px;
    line-height: 1;
    letter-spacing: -0.8px;
}

.employee-directory-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.employee-directory-toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
    gap: 16px;
    align-items: end;
    padding: 20px;
    background:
        linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border-bottom: 1px solid #e2e8f0;
}

.employee-search-field,
.employee-filter-grid .field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.employee-search-field label,
.employee-filter-grid label,
.employee-filter-buttons label {
    color: #334155;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.employee-search-field input,
.employee-filter-grid select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 11px 13px;
    background: #ffffff;
    color: #0f172a;
    font-size: 14px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.employee-search-field input:focus,
.employee-filter-grid select:focus {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13);
}

.employee-filter-grid {
    display: grid;
    grid-template-columns: minmax(150px, 0.9fr) minmax(180px, 1fr) minmax(220px, 1.15fr) auto;
    gap: 12px;
    align-items: end;
}

.employee-filter-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.employee-filter-buttons .btn {
    min-height: 46px;
    border-radius: 14px;
    padding-inline: 16px;
}

.employee-directory-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 20px;
    color: #475569;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
}

.employee-directory-results-bar strong {
    color: #0f172a;
}

.employee-directory-table-wrapper {
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow-x: auto;
}

.employee-directory-table {
    min-width: 1180px;
}

.employee-directory-table th {
    padding: 15px 14px;
    background: #0f172a;
    color: #ffffff;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.employee-directory-table td {
    padding: 14px;
    color: #0f172a;
    font-size: 13px;
    vertical-align: middle;
}

.employee-directory-table tbody tr {
    transition: background 0.18s ease;
}

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

.employee-id-cell {
    color: #1e3a8a;
    font-weight: 800;
}

.employee-name-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
}

.employee-name-cell strong {
    color: #0f172a;
    font-size: 14px;
    line-height: 1.25;
}

.employee-name-cell span {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.employee-directory-table .employee-table-photo {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    border-color: #e2e8f0;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.employee-directory-table .employee-table-photo span {
    color: #2563eb;
    background: #eff6ff;
}

.employee-directory-table .action-cell {
    gap: 7px;
    background: #ffffff;
}

.employee-directory-table tbody tr:hover .action-cell {
    background: #f8fafc;
}

.employee-directory-table .sticky-action {
    min-width: 310px;
}

.employee-directory-table th.sticky-action {
    background: #0f172a;
}

.employee-directory-table td.sticky-action {
    right: 0;
    z-index: 4;
}

.employee-directory-table .btn-sm {
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
}

.employee-hidden-row {
    display: none !important;
}

/* When old/simple markup is still being rendered, improve spacing too */
.table-wrapper > .employees-table:not(.employee-directory-table) {
    min-width: 1120px;
}

.table-wrapper > .employees-table:not(.employee-directory-table) th {
    padding: 15px 14px;
    background: #0f172a;
    color: #ffffff;
}

.table-wrapper > .employees-table:not(.employee-directory-table) td {
    padding: 14px;
}

@media (max-width: 1280px) {
    .employee-directory-toolbar {
        grid-template-columns: 1fr;
    }

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

    .employee-filter-buttons {
        grid-column: span 2;
    }

    .employee-filter-buttons .btn {
        width: 100%;
    }
}

@media (max-width: 1100px) {
    .employee-index-header {
        align-items: flex-start;
    }

    .employee-index-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .employee-index-actions .btn {
        width: 100%;
    }

    .employee-directory-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .employee-directory-card {
        border-radius: 18px;
    }

    .employee-directory-toolbar {
        padding: 16px;
    }

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

    .employee-filter-buttons {
        grid-column: auto;
    }

    .employee-directory-results-bar {
        align-items: flex-start;
        flex-direction: column;
        padding: 13px 16px;
    }

    .employee-directory-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .employee-directory-stat-card {
        min-height: auto;
        padding: 16px;
    }

    .employee-directory-stat-card strong {
        font-size: 28px;
    }
}

@media (max-width: 560px) {
    .employee-index-actions {
        grid-template-columns: 1fr;
    }

    .employee-search-field input,
    .employee-filter-grid select {
        font-size: 16px;
    }
}


/* =========================================================
   EMPLOYEE DIRECTORY ICON ACTION BUTTONS
   Use this with the updated employees/index.ejs action buttons.
========================================================= */

.employee-action-cell {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    min-width: 230px;
}

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

.employee-action-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border: none;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e5e7eb;
    color: #0f172a;
    text-decoration: none;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.employee-action-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.employee-action-profile {
    background: #2563eb;
    color: #ffffff;
}

.employee-action-edit {
    background: #eef2ff;
    color: #3730a3;
}

.employee-action-inactive {
    background: #fef3c7;
    color: #92400e;
}

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

.employee-action-delete {
    background: #fee2e2;
    color: #991b1b;
}

.employee-action-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Tighten the action column because icon buttons need less space */
.employee-directory-table .sticky-action {
    min-width: 230px;
}

@media (max-width: 760px) {
    .employee-directory-table {
        min-width: 980px;
    }

    .employee-action-cell {
        gap: 6px;
        min-width: 178px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .employee-directory-table .sticky-action {
        min-width: 178px;
    }

    .employee-action-icon {
        width: 34px;
        height: 34px;
        min-width: 34px;
        border-radius: 10px;
        font-size: 14px;
    }
}

@media (max-width: 520px) {
    .employee-directory-table {
        min-width: 900px;
    }

    .employee-action-cell {
        gap: 5px;
        min-width: 160px;
    }

    .employee-directory-table .sticky-action {
        min-width: 160px;
    }

    .employee-action-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
        border-radius: 9px;
        font-size: 13px;
    }
}
/* ===============================
   Employee Index - Action Column Width
================================ */

.employee-directory-table th.sticky-action,
.employee-directory-table td.sticky-action {
    width: 190px;
    min-width: 190px;
    max-width: 190px;
}

.employee-action-cell {
    width: 190px;
    min-width: 190px;
    max-width: 190px;
    justify-content: center;
    gap: 8px;
    padding-left: 10px !important;
    padding-right: 10px !important;
}

.employee-action-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 12px;
}

/* Mobile: make it even tighter */
@media (max-width: 760px) {
    .employee-directory-table th.sticky-action,
    .employee-directory-table td.sticky-action {
        width: 160px;
        min-width: 160px;
        max-width: 160px;
    }

    .employee-action-cell {
        width: 160px;
        min-width: 160px;
        max-width: 160px;
        gap: 6px;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .employee-action-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
        border-radius: 10px;
        font-size: 13px;
    }
}


/* =========================================================
   ANALYTICS PAGE - FILTERS, COMPARISON, ANIMATIONS, MOBILE
========================================================= */

.analytics-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.analytics-header {
    align-items: flex-end;
}

.analytics-header h1 {
    font-size: clamp(32px, 4vw, 46px);
    letter-spacing: -1.2px;
}

.analytics-header p {
    max-width: 860px;
    line-height: 1.45;
}

.analytics-filter-panel,
.analytics-comparison-card,
.analytics-panel,
.analytics-metric-card {
    animation: analyticsFadeUp 0.55s ease both;
}

@keyframes analyticsFadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

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

.analytics-filter-panel {
    padding: 18px;
    border-radius: 22px;
    background:
        radial-gradient(circle at top right, rgba(191, 219, 254, 0.48), transparent 36%),
        #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.analytics-filter-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 14px;
    align-items: end;
}

.analytics-filter-form .field select,
.analytics-filter-form .field input {
    min-height: 44px;
    border-radius: 12px;
}

.analytics-filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: end;
}

.analytics-filter-actions label {
    grid-column: span 2;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
}

.analytics-filter-actions .btn {
    min-height: 44px;
}

.analytics-filter-suggestions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    color: #64748b;
    font-size: 13px;
}

.analytics-filter-suggestions strong {
    color: #0f172a;
}

.analytics-filter-suggestions span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 800;
    font-size: 12px;
}

.analytics-comparison-card {
    min-width: 0;
    padding: 20px;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.07);
}

.analytics-comparison-chart-wrap {
    height: 330px;
}

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

.analytics-metric-card {
    position: relative;
    overflow: hidden;
    min-height: 128px;
    padding: 18px;
    border-radius: 20px;
    background:
        radial-gradient(circle at top right, rgba(191, 219, 254, 0.55), transparent 42%),
        #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.analytics-metric-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #2563eb;
}

.analytics-metric-card.primary::before {
    background: linear-gradient(180deg, #2563eb, #7c3aed);
}

.analytics-metric-card.danger::before {
    background: #dc2626;
}

.analytics-metric-card.warning::before {
    background: #f59e0b;
}

.analytics-metric-card.success::before {
    background: #16a34a;
}

.analytics-metric-card span {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.analytics-metric-card strong {
    display: block;
    margin-top: 10px;
    color: #0f172a;
    font-size: 28px;
    line-height: 1.08;
    letter-spacing: -0.8px;
}

.analytics-metric-card small {
    display: block;
    margin-top: 8px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.35;
}

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

.analytics-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analytics-panel {
    min-width: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 20px;
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.07);
}

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

.analytics-panel-header span {
    display: inline-flex;
    margin-bottom: 6px;
    color: #2563eb;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.analytics-panel-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 20px;
    line-height: 1.15;
    letter-spacing: -0.4px;
}

.chart-panel {
    min-height: 360px;
}

.chart-panel canvas {
    width: 100% !important;
    height: 280px !important;
}

.analytics-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.analytics-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 13px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.analytics-list-row span {
    color: #334155;
    font-weight: 700;
}

.analytics-list-row strong {
    color: #0f172a;
    font-size: 16px;
}

.analytics-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
}

.analytics-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 13px;
}

.analytics-table th {
    background: #0f172a;
    color: #ffffff;
    padding: 12px;
    text-align: left;
    white-space: nowrap;
}

.analytics-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.analytics-table tr:last-child td {
    border-bottom: none;
}

.analytics-table td span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
}

.analytics-empty,
.analytics-empty-cell {
    margin: 0;
    padding: 18px;
    color: #64748b;
    text-align: center;
}

@media (max-width: 1200px) {
    .analytics-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .analytics-grid,
    .analytics-grid.compact {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .analytics-header {
        align-items: flex-start;
    }

    .analytics-header .page-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

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

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

    .analytics-filter-actions label {
        display: none;
    }

    .analytics-filter-panel,
    .analytics-comparison-card,
    .analytics-panel {
        padding: 16px;
        border-radius: 18px;
    }

    .analytics-metric-grid {
        grid-template-columns: 1fr;
    }

    .analytics-comparison-chart-wrap {
        height: 300px;
    }

    .chart-panel {
        min-height: 320px;
    }

    .chart-panel canvas {
        height: 240px !important;
    }

    .analytics-metric-card {
        min-height: auto;
    }

    .analytics-metric-card strong {
        font-size: 25px;
    }
}

@media (max-width: 420px) {
    .analytics-header h1 {
        font-size: 29px;
    }

    .analytics-filter-suggestions {
        align-items: flex-start;
        flex-direction: column;
    }

    .analytics-filter-suggestions span {
        width: 100%;
        justify-content: center;
    }
}


/* =========================================================
   NAV DROPDOWN FIX
   Required for grouped navigation. Keep this at the BOTTOM
   of public/css/style.css so it overrides older nav styles.
========================================================= */

.top-nav {
    overflow: visible !important;
}

.top-nav-inner {
    min-height: 64px;
    gap: 18px;
    overflow: visible !important;
}

.nav-brand {
    flex: 0 0 auto;
}

.nav-brand a {
    min-width: max-content;
}

.nav-menu {
    flex: 1 1 auto;
    min-width: 0;
    overflow: visible !important;
    gap: 6px;
}

.nav-link {
    min-height: 38px;
}

.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dropdown-btn {
    min-height: 38px;
    border: none !important;
    appearance: none;
    -webkit-appearance: none;
    background: transparent !important;
    color: #d1d5db !important;
    font-family: inherit;
    cursor: pointer;
    gap: 6px;
}

.nav-dropdown-btn:hover,
.nav-dropdown-btn[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

.nav-caret {
    margin-left: 2px;
    font-size: 11px;
    opacity: 0.85;
}

.nav-dropdown-menu {
    display: none !important;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 3000;
    min-width: 220px;
    padding: 8px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.22);
}

.nav-dropdown-menu.show {
    display: block !important;
}

.nav-dropdown-menu::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 18px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-left: 1px solid #e5e7eb;
    border-top: 1px solid #e5e7eb;
    transform: rotate(45deg);
}

.nav-dropdown-menu a {
    position: relative;
    z-index: 1;
    display: flex !important;
    align-items: center;
    min-height: 38px;
    padding: 9px 11px;
    border-radius: 10px;
    color: #111827 !important;
    background: transparent !important;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav-dropdown-menu a:hover {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    transform: translateX(2px);
}

.nav-right {
    flex: 0 0 auto;
}

@media (max-width: 1180px) {
    .top-nav-inner {
        padding-left: 18px;
        padding-right: 18px;
        gap: 12px;
    }

    .brand-text {
        font-size: 16px;
    }

    .nav-link {
        padding-left: 10px;
        padding-right: 10px;
        font-size: 13px;
    }

    .nav-user-name {
        max-width: 140px;
    }
}

@media (max-width: 980px) {
    .top-nav-inner {
        flex-wrap: wrap;
        align-items: center;
        padding: 12px 14px;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        order: 2;
        margin-left: auto;
    }

    .nav-menu {
        order: 4;
        flex: 0 0 100%;
        width: 100%;
        display: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 10px 0 2px;
    }

    .nav-menu.show {
        display: grid;
    }

    .nav-link,
    .nav-dropdown,
    .nav-dropdown-btn {
        width: 100%;
    }

    .nav-link,
    .nav-dropdown-btn {
        justify-content: space-between;
        background: rgba(255, 255, 255, 0.06) !important;
    }

    .nav-dropdown {
        display: block;
    }

    .nav-dropdown-menu {
        position: static;
        min-width: 0;
        width: 100%;
        margin-top: 6px;
        padding: 6px;
        border-radius: 12px;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.10);
    }

    .nav-dropdown-menu::before {
        display: none;
    }

    .nav-dropdown-menu a {
        color: #e5e7eb !important;
        background: rgba(255, 255, 255, 0.04) !important;
    }

    .nav-dropdown-menu a:hover {
        color: #ffffff !important;
        background: rgba(255, 255, 255, 0.10) !important;
        transform: none;
    }

    .nav-right {
        order: 3;
        flex: 0 0 100%;
        width: 100%;
        margin-left: 0;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        justify-content: space-between;
    }

    .nav-change-password {
        display: none;
    }

    .nav-link-mobile-only {
        display: flex;
    }
}

@media (max-width: 560px) {
    .nav-menu {
        grid-template-columns: 1fr;
    }

    .brand-text {
        max-width: 160px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}



/* =========================================================
   PAYROLL RECORDS CENTER - RESTORED CLEAN LAYOUT
========================================================= */

.payroll-records-header {
    align-items: flex-end;
    margin-bottom: 18px;
}

.payroll-records-header .page-actions {
    align-self: flex-start;
}

.payroll-filter-card {
    margin-bottom: 18px;
    padding: 20px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.payroll-filter-form {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(150px, 1fr)) auto;
    gap: 14px;
    align-items: end;
}

.payroll-filter-form .field {
    min-width: 0;
}

.payroll-filter-form .field label {
    display: block;
    margin-bottom: 6px;
    color: #111827;
    font-size: 12px;
    font-weight: 800;
}

.payroll-filter-form input,
.payroll-filter-form select {
    width: 100%;
    min-height: 42px;
    border-radius: 11px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #111827;
    padding: 9px 12px;
    font-size: 14px;
}

.payroll-filter-form input:focus,
.payroll-filter-form select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.payroll-search-field {
    min-width: 220px;
}

.payroll-filter-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.payroll-filter-actions .btn {
    min-height: 42px;
    white-space: nowrap;
}

.payroll-bulk-row {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.payroll-bulk-row strong {
    display: block;
    color: #111827;
    font-size: 14px;
}

.payroll-bulk-row span {
    display: block;
    margin-top: 3px;
    color: #6b7280;
    font-size: 13px;
}

.payroll-bulk-inline-form {
    margin: 0;
    flex: 0 0 auto;
}

.payroll-period-summary,
.summary-cards.payroll-period-summary {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.payroll-period-summary .summary-card {
    min-height: 92px;
    padding: 18px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.payroll-period-summary .summary-card span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
}

.payroll-period-summary .summary-card strong {
    display: block;
    margin-top: 10px;
    color: #0f172a;
    font-size: 24px;
    line-height: 1.1;
}

.payroll-records-toolbar {
    padding: 16px 18px;
    border-radius: 16px 16px 0 0;
    margin-bottom: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-bottom: none;
}

.payroll-records-toolbar h2 {
    margin: 0;
    font-size: 20px;
    color: #111827;
}

.payroll-records-toolbar p {
    margin: 4px 0 0;
    color: #6b7280;
    font-size: 13px;
}

.payroll-records-wrapper {
    overflow-x: auto !important;
    border-radius: 0 0 16px 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.payroll-clean-table {
    width: 100%;
    min-width: 1180px !important;
    table-layout: fixed !important;
    border-collapse: separate;
    border-spacing: 0;
}

.payroll-clean-table th,
.payroll-clean-table td {
    white-space: normal !important;
    vertical-align: top !important;
    padding: 14px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.payroll-clean-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #111827;
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
    text-align: left;
}

.payroll-clean-table tbody tr:hover {
    background: #f9fafb;
}

.payroll-clean-table th:nth-child(1),
.payroll-clean-table td:nth-child(1) {
    width: 285px !important;
    min-width: 285px !important;
}

.payroll-clean-table th:nth-child(2),
.payroll-clean-table td:nth-child(2) {
    width: 160px !important;
    min-width: 160px !important;
}

.payroll-clean-table th:nth-child(3),
.payroll-clean-table td:nth-child(3) {
    width: 235px !important;
    min-width: 235px !important;
}

.payroll-clean-table th:nth-child(4),
.payroll-clean-table td:nth-child(4) {
    width: 175px !important;
    min-width: 175px !important;
}

.payroll-clean-table th:nth-child(5),
.payroll-clean-table td:nth-child(5) {
    width: 125px !important;
    min-width: 125px !important;
}

.payroll-clean-table th:nth-child(6),
.payroll-clean-table td:nth-child(6) {
    width: 82px !important;
    min-width: 82px !important;
    text-align: center;
}

.payroll-clean-table th:nth-child(7),
.payroll-clean-table td:nth-child(7) {
    width: 235px !important;
    min-width: 235px !important;
}

.payroll-employee-cell {
    line-height: 1.25 !important;
}

.payroll-employee-stack {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start;
    gap: 4px;
    max-width: 100%;
}

.payroll-employee-stack strong,
.payroll-employee-cell strong {
    display: block;
    color: #111827;
    font-size: 14px;
    line-height: 1.25;
    word-break: break-word;
}

.payroll-employee-id {
    display: inline-flex !important;
    width: fit-content;
    margin-top: 0 !important;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8 !important;
    font-size: 11px !important;
    font-weight: 900 !important;
}

.payroll-employee-stack small,
.payroll-employee-stack em,
.payroll-employee-cell small,
.payroll-employee-cell em {
    display: block;
    margin-top: 0 !important;
    color: #6b7280;
    font-size: 11.5px;
    font-style: normal;
    line-height: 1.25;
    word-break: break-word;
}

.payroll-employee-stack em,
.payroll-employee-cell em {
    margin-top: 2px !important;
    color: #111827;
    font-weight: 800;
}

.reporting-location-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 4px 9px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 10.5px;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: 1.2;
    word-break: break-word;
}

.payroll-mini-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    width: 100%;
    color: #374151;
    font-size: 12px;
    line-height: 1.25;
}

.payroll-mini-list span {
    display: grid !important;
    grid-template-columns: minmax(95px, 1fr) auto;
    align-items: start;
    gap: 8px;
    padding-bottom: 4px;
    border-bottom: 1px dashed #eef2f7;
    white-space: normal !important;
}

.payroll-mini-list span:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.payroll-mini-list b {
    color: #111827;
    white-space: nowrap;
}

.payroll-mini-total {
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid #d1d5db;
    font-weight: 900;
    color: #065f46;
}

.payroll-clean-net strong {
    display: block;
    color: #065f46;
    font-size: 16px;
    line-height: 1.2;
}

.payroll-clean-net span {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
}

.payroll-clean-action-header {
    text-align: center !important;
}

.payroll-clean-action-cell {
    display: grid !important;
    grid-template-columns: 34px 34px 78px 34px 34px !important;
    align-items: center;
    justify-content: center;
    gap: 8px !important;
    min-width: 270px !important;
    padding-left: 12px !important;
    padding-right: 14px !important;
    overflow: visible !important;
}

.payroll-clean-status-form {
    display: contents !important;
}

.payroll-clean-delete-form {
    display: inline-flex !important;
    margin: 0 !important;
}

.payroll-clean-status-select {
    width: 78px !important;
    min-width: 78px !important;
    max-width: 78px !important;
    min-height: 34px;
    padding: 6px 20px 6px 8px !important;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-size: 12px;
}

.payroll-action-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border: none;
    border-radius: 10px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    color: #111827;
    background: #e5e7eb;
    text-decoration: none !important;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.payroll-action-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
}

.payroll-action-payslip,
.payroll-action-pdf {
    background: #2563eb;
    color: #ffffff;
}

.payroll-action-edit {
    background: #e5e7eb;
    color: #111827;
}

.payroll-action-update {
    background: #dcfce7;
    color: #166534;
}

.payroll-action-delete {
    background: #fee2e2;
    color: #991b1b;
}

.payroll-action-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

.payroll-pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 14px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.payroll-pagination-info {
    color: #4b5563;
    font-size: 13px;
    font-weight: 700;
}

.payroll-pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.payroll-page-btn {
    min-width: 36px;
    min-height: 34px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    background: #ffffff;
    color: #111827;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.payroll-page-btn:hover:not(.disabled) {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.payroll-page-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.payroll-page-btn.disabled {
    opacity: 0.45;
    pointer-events: none;
}

@media (max-width: 1250px) {
    .payroll-filter-form {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .payroll-filter-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .payroll-filter-form {
        grid-template-columns: 1fr !important;
    }

    .payroll-bulk-row {
        align-items: stretch;
        flex-direction: column;
    }

    .payroll-bulk-inline-form .btn {
        width: 100%;
    }

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

    .payroll-pagination-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .payroll-pagination-controls {
        justify-content: center;
    }
}

@media (max-width: 760px) {
    .payroll-clean-table {
        min-width: 1080px !important;
    }

    .payroll-clean-table th:nth-child(1),
    .payroll-clean-table td:nth-child(1) {
        width: 260px !important;
        min-width: 260px !important;
    }

    .payroll-clean-table th:nth-child(2),
    .payroll-clean-table td:nth-child(2),
    .payroll-clean-table th:nth-child(3),
    .payroll-clean-table td:nth-child(3) {
        width: 215px !important;
        min-width: 215px !important;
    }

    .payroll-clean-action-cell {
        grid-template-columns: 31px 31px 70px 31px 31px !important;
        min-width: 250px !important;
        gap: 7px !important;
    }

    .payroll-clean-status-select {
        width: 70px !important;
        min-width: 70px !important;
        max-width: 70px !important;
    }
}

@media (max-width: 560px) {
    .payroll-period-summary,
    .summary-cards.payroll-period-summary {
        grid-template-columns: 1fr;
    }
}



/* =========================================================
   REPORTING LOCATIONS MANAGEMENT
========================================================= */

.reporting-location-header {
    align-items: flex-end;
}

.reporting-location-create-card {
    margin-bottom: 18px;
}

.reporting-location-form-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.8fr 1.5fr 0.8fr auto;
    gap: 14px;
    align-items: end;
}

.reporting-location-active-field .checkbox-line {
    min-height: 42px;
    align-items: center;
}

.reporting-location-submit-field .btn {
    min-height: 42px;
    white-space: nowrap;
}

.reporting-location-list-card {
    margin-top: 18px;
}

.reporting-location-table {
    min-width: 980px;
}

.reporting-location-table th,
.reporting-location-table td {
    vertical-align: middle;
}

.reporting-location-name {
    color: #111827;
    font-size: 14px;
    letter-spacing: 0.02em;
}

.reporting-location-code {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 900;
}

.reporting-location-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.reporting-location-edit-details {
    position: relative;
}

.reporting-location-edit-details summary {
    list-style: none;
    cursor: pointer;
}

.reporting-location-edit-details summary::-webkit-details-marker {
    display: none;
}

.reporting-location-inline-edit {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 10px;
    min-width: 360px;
}

.reporting-location-inline-edit .checkbox-line {
    align-items: center;
}

.reporting-location-inline-edit .btn {
    align-self: end;
}

@media (max-width: 1100px) {
    .reporting-location-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reporting-location-submit-field {
        grid-column: 1 / -1;
    }

    .reporting-location-submit-field .btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .reporting-location-form-grid,
    .reporting-location-inline-edit {
        grid-template-columns: 1fr;
    }

    .reporting-location-inline-edit {
        min-width: 260px;
    }
}



/* =========================================================
   ANALYTICS REPORTING LOCATION DASHBOARD
========================================================= */

.analytics-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.analytics-header {
    align-items: flex-end;
}

.analytics-filter-panel {
    padding: 20px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.analytics-filter-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr)) auto;
    gap: 14px;
    align-items: end;
}

.analytics-filter-form .field label {
    display: block;
    margin-bottom: 6px;
    color: #111827;
    font-size: 12px;
    font-weight: 900;
}

.analytics-filter-form input,
.analytics-filter-form select {
    width: 100%;
    min-height: 42px;
    border-radius: 11px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #111827;
    padding: 9px 12px;
    font-size: 14px;
}

.analytics-filter-form input:focus,
.analytics-filter-form select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.analytics-filter-actions {
    display: grid;
    gap: 8px;
}

.analytics-filter-actions .btn {
    min-height: 42px;
    white-space: nowrap;
}

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

.analytics-kpi-card {
    position: relative;
    overflow: hidden;
    min-height: 126px;
    padding: 20px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.analytics-kpi-card::after {
    content: "";
    position: absolute;
    right: -34px;
    bottom: -34px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.1);
}

.analytics-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.1);
}

.analytics-kpi-card.accent::after {
    background: rgba(5, 150, 105, 0.12);
}

.analytics-kpi-card.warning::after {
    background: rgba(245, 158, 11, 0.15);
}

.analytics-kpi-card span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    font-weight: 800;
}

.analytics-kpi-card strong {
    display: block;
    margin-top: 10px;
    color: #0f172a;
    font-size: 30px;
    line-height: 1.05;
    letter-spacing: -0.8px;
}

.analytics-kpi-card small {
    display: block;
    margin-top: 8px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
}

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

.analytics-chart-card {
    padding: 18px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.analytics-chart-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.1);
}

.analytics-chart-card.wide {
    grid-column: 1 / -1;
}

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

.analytics-card-header span {
    display: block;
    color: #2563eb;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.analytics-card-header h2 {
    margin: 4px 0 0;
    color: #111827;
    font-size: 18px;
    line-height: 1.2;
}

.analytics-card-header small {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 900;
}

.analytics-chart-card canvas {
    width: 100%;
    min-height: 220px;
    cursor: pointer;
}

.analytics-lists-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 16px;
}

.analytics-list-card {
    padding: 18px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.analytics-list-card h2 {
    margin: 0 0 14px;
    color: #111827;
    font-size: 18px;
}

.analytics-mini-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.analytics-mini-table > div,
.analytics-summary-list > div {
    padding: 12px;
    border-radius: 14px;
    background: #f9fafb;
    border: 1px solid #eef2f7;
}

.analytics-mini-table strong,
.analytics-summary-list strong {
    display: block;
    color: #111827;
    font-weight: 900;
}

.analytics-mini-table span,
.analytics-summary-list span {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
}

.analytics-mini-table em {
    display: block;
    margin-top: 6px;
    color: #065f46;
    font-style: normal;
    font-weight: 900;
}

.analytics-summary-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.chart-tooltip {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    padding: 9px 11px;
    border-radius: 12px;
    background: #111827;
    color: #ffffff;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.24);
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.chart-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.chart-tooltip strong {
    display: block;
    font-size: 12px;
}

.chart-tooltip span {
    display: block;
    margin-top: 3px;
    font-size: 13px;
    font-weight: 900;
}

@media (max-width: 1200px) {
    .analytics-filter-form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .analytics-filter-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 860px) {
    .analytics-filter-form,
    .analytics-chart-grid,
    .analytics-lists-grid {
        grid-template-columns: 1fr;
    }

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

    .analytics-kpi-grid {
        grid-template-columns: 1fr;
    }

    .analytics-header {
        align-items: stretch;
    }

    .analytics-card-header {
        flex-direction: column;
    }

    .analytics-summary-list {
        grid-template-columns: 1fr;
    }
}



/* =========================================================
   FINAL ANALYTICS COMPACT CHART OVERRIDE
   Keeps analytics readable and prevents oversized charts.
========================================================= */

.analytics-page {
    gap: 14px !important;
}

.analytics-filter-panel {
    padding: 16px !important;
    border-radius: 16px !important;
}

.analytics-filter-form {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(150px, 1fr)) auto !important;
    gap: 12px !important;
    align-items: end !important;
}

.analytics-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 12px !important;
}

.analytics-kpi-card {
    min-height: 96px !important;
    padding: 14px 16px !important;
    border-radius: 16px !important;
}

.analytics-kpi-card strong {
    font-size: 22px !important;
}

.analytics-kpi-card small {
    margin-top: 6px !important;
    font-size: 11px !important;
}

.analytics-chart-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
    align-items: start !important;
}

.analytics-chart-card {
    min-height: auto !important;
    padding: 14px !important;
    border-radius: 16px !important;
}

.analytics-chart-card.wide {
    grid-column: span 2 !important;
}

.analytics-card-header {
    margin-bottom: 8px !important;
}

.analytics-card-header h2 {
    font-size: 15px !important;
    line-height: 1.2 !important;
}

.analytics-card-header span {
    font-size: 10px !important;
}

.analytics-card-header small {
    font-size: 10px !important;
    padding: 4px 8px !important;
}

/*
   This is the important part:
   your older analytics block had min-height: 220px, which makes the charts huge.
*/
.analytics-chart-card canvas {
    display: block !important;
    width: 100% !important;
    height: 145px !important;
    min-height: 0 !important;
    max-height: 145px !important;
}

.analytics-chart-card.wide canvas {
    height: 165px !important;
    max-height: 165px !important;
}

/* Also control older analytics classes in case an old analytics view is still loaded. */
.chart-panel {
    min-height: 220px !important;
}

.chart-panel canvas {
    width: 100% !important;
    height: 170px !important;
    min-height: 0 !important;
    max-height: 170px !important;
}

.analytics-lists-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 14px !important;
}

/* Keep Daily Rate masking CSS if you are using the Daily Rate unlock feature. */
.daily-rate-cell {
    min-width: 130px;
}

.masked-rate-btn {
    min-width: 112px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 900;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.masked-rate-btn:hover {
    transform: translateY(-1px);
    background: #dbeafe;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
}

.masked-rate-btn.is-unlocked {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #047857;
}

.masked-rate-icon {
    line-height: 1;
}

.sensitive-rate-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.sensitive-rate-modal.show {
    display: flex;
}

.sensitive-rate-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(4px);
}

.sensitive-rate-dialog {
    position: relative;
    width: min(420px, 100%);
    padding: 26px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
    animation: sensitiveRateModalIn 0.2s ease;
}

.sensitive-rate-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    color: #111827;
    font-size: 22px;
    cursor: pointer;
}

.sensitive-rate-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    border-radius: 16px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 22px;
}

.sensitive-rate-dialog h2 {
    margin: 0;
    color: #111827;
    font-size: 24px;
}

.sensitive-rate-dialog p {
    margin: 8px 0 18px;
    color: #6b7280;
    line-height: 1.5;
}

.sensitive-rate-submit {
    width: 100%;
    margin-top: 8px;
}

.sensitive-rate-error {
    min-height: 18px;
    margin-top: 8px;
    color: #dc2626;
    font-size: 13px;
    font-weight: 700;
}

.sensitive-rate-dialog small {
    display: block;
    margin-top: 12px;
    color: #6b7280;
    text-align: center;
}

@keyframes sensitiveRateModalIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

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

@media (max-width: 1200px) {
    .analytics-filter-form {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .analytics-chart-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .analytics-chart-card.wide {
        grid-column: 1 / -1 !important;
    }

    .analytics-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 760px) {
    .analytics-filter-form,
    .analytics-chart-grid,
    .analytics-lists-grid {
        grid-template-columns: 1fr !important;
    }

    .analytics-chart-card.wide {
        grid-column: 1 / -1 !important;
    }

    .analytics-chart-card canvas,
    .analytics-chart-card.wide canvas,
    .chart-panel canvas {
        height: 155px !important;
        max-height: 155px !important;
    }

    .analytics-kpi-grid {
        grid-template-columns: 1fr !important;
    }

    .masked-rate-btn {
        min-width: 96px;
        padding: 7px 8px;
    }

    .sensitive-rate-dialog {
        padding: 22px;
    }
}



/* ===============================
   AUTO PAYROLL / ALLOWANCE LOAN RULE BOX
================================ */
.allowance-rule-box { margin-top: 16px; padding: 13px 15px; border-radius: 14px; border: 1px solid #bfdbfe; background: #eff6ff; color: #1e3a8a; font-size: 13px; line-height: 1.45; }
.allowance-rule-box strong { display: block; margin-bottom: 3px; font-weight: 900; }


/* ===============================
   SECURITY / WORKFLOW UX POLISH
================================ */
.csrf-hidden { display: none !important; }
.workflow-lock-note {
    padding: 12px 14px;
    border-radius: 14px;
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
    font-weight: 800;
    margin-bottom: 14px;
}
.status-locked { background: #111827; color: #ffffff; }
.status-released { background: #ede9fe; color: #5b21b6; }
.status-approved { background: #e0f2fe; color: #075985; }


/* =========================================================
   ATTENDANCE MODULE + SCHEDULE FIELDS
========================================================= */

.workday-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #f9fafb;
}

.mini-checkbox-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
}

.mini-checkbox-line input {
    width: auto;
}

.reporting-location-schedule-grid,
.reporting-location-grace-grid,
.attendance-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.reporting-location-workdays-field {
    grid-column: span 2;
}

.reporting-location-schedule-table,
.reporting-location-grace-table {
    min-width: 1250px;
}

.reporting-location-inline-schedule-edit,
.reporting-location-inline-grace-edit {
    min-width: 760px;
}

.attendance-filter-card {
    margin-bottom: 18px;
}

.attendance-filter-submit-field {
    align-self: end;
}

.attendance-table {
    min-width: 1450px;
}

.attendance-status-present,
.status-present {
    background: #dcfce7;
    color: #166534;
}

.attendance-status-late,
.status-late {
    background: #fef3c7;
    color: #92400e;
}

.attendance-status-absent,
.status-absent {
    background: #fee2e2;
    color: #991b1b;
}

.attendance-status-on-leave,
.status-on-leave {
    background: #dbeafe;
    color: #1d4ed8;
}

.attendance-status-incomplete,
.status-incomplete {
    background: #f3f4f6;
    color: #4b5563;
}

@media (max-width: 1200px) {
    .reporting-location-schedule-grid,
    .reporting-location-grace-grid,
    .attendance-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reporting-location-workdays-field {
        grid-column: span 2;
    }
}

@media (max-width: 700px) {
    .reporting-location-schedule-grid,
    .reporting-location-grace-grid,
    .attendance-filter-grid {
        grid-template-columns: 1fr;
    }

    .reporting-location-workdays-field {
        grid-column: span 1;
    }

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


/* Employee schedule note */
.schedule-note-box {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}
.employee-schedule-note {
    grid-column: span 3;
}
@media (max-width: 900px) {
    .employee-schedule-note {
        grid-column: span 1;
    }
}

/* =========================================================
   FINAL CLEANUP OVERRIDES - 2026-05
   Keeps dashboard cards stable, improves mobile layout, and
   avoids older duplicate rules from forcing awkward columns.
========================================================= */

.summary-cards {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.summary-card {
    min-width: 0;
    padding: 18px;
    border-radius: 16px;
}

.summary-card span {
    display: block;
    font-size: 13px;
    line-height: 1.35;
    white-space: normal;
}

.summary-card strong {
    display: block;
    margin-top: 8px;
    font-size: clamp(20px, 2vw, 26px);
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.table-wrapper {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.action-cell {
    flex-wrap: wrap;
}

.page-actions {
    min-width: 0;
}

.page-actions .btn {
    min-width: 0;
}

.nav-menu,
.table-wrapper,
.employee-doc-table-wrapper,
.payroll-history-wrapper {
    scrollbar-width: thin;
}

@media (max-width: 1200px) {
    .summary-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-shell {
        padding: 16px;
    }

    .page-header {
        gap: 12px;
        margin-bottom: 16px;
    }

    .page-header h1 {
        font-size: 28px;
        letter-spacing: -0.4px;
    }

    .page-header p {
        font-size: 15px;
    }

    .page-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .page-actions .btn {
        width: 100%;
    }

    .form-card {
        padding: 16px;
    }

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

    .field input,
    .field select,
    .field textarea {
        min-height: 42px;
        font-size: 16px;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .table-toolbar-right {
        min-width: 0;
    }

    .payroll-table th,
    .payroll-table td {
        padding: 10px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .summary-cards,
    .report-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .app-shell {
        padding: 14px 12px;
    }

    .summary-cards,
    .report-stats,
    .page-actions {
        grid-template-columns: 1fr;
    }

    .summary-card,
    .report-stat-card {
        padding: 14px;
    }

    .summary-card strong,
    .report-stat-card strong {
        font-size: 21px;
    }

    .brand-text {
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-menu.show {
        display: grid;
        grid-template-columns: 1fr;
    }

    .nav-link {
        justify-content: flex-start;
    }

    .payslip-row {
        grid-template-columns: 1fr 120px;
    }
}


/* =========================================================
   FINAL PAYROLL RECORDS COMPACT OVERRIDE
   Keeps Attendance and Earnings columns smaller so the
   action/delete icons are visible with much less horizontal scroll.
   This intentionally uses higher-specificity selectors because some
   payroll/index.ejs versions contain page-level !important styles.
========================================================= */
body .app-shell .payroll-records-wrapper table.payroll-clean-table {
    width: 100% !important;
    min-width: 1180px !important;
    table-layout: fixed !important;
}

body .app-shell .payroll-records-wrapper table.payroll-clean-table th,
body .app-shell .payroll-records-wrapper table.payroll-clean-table td {
    padding: 10px 10px !important;
    vertical-align: top !important;
}

body .app-shell .payroll-records-wrapper table.payroll-clean-table th:nth-child(1),
body .app-shell .payroll-records-wrapper table.payroll-clean-table td:nth-child(1) {
    width: 285px !important;
    min-width: 285px !important;
}

body .app-shell .payroll-records-wrapper table.payroll-clean-table th:nth-child(2),
body .app-shell .payroll-records-wrapper table.payroll-clean-table td:nth-child(2) {
    width: 160px !important;
    min-width: 160px !important;
}

body .app-shell .payroll-records-wrapper table.payroll-clean-table th:nth-child(3),
body .app-shell .payroll-records-wrapper table.payroll-clean-table td:nth-child(3) {
    width: 190px !important;
    min-width: 190px !important;
}

body .app-shell .payroll-records-wrapper table.payroll-clean-table th:nth-child(4),
body .app-shell .payroll-records-wrapper table.payroll-clean-table td:nth-child(4) {
    width: 175px !important;
    min-width: 175px !important;
}

body .app-shell .payroll-records-wrapper table.payroll-clean-table th:nth-child(5),
body .app-shell .payroll-records-wrapper table.payroll-clean-table td:nth-child(5) {
    width: 125px !important;
    min-width: 125px !important;
}

body .app-shell .payroll-records-wrapper table.payroll-clean-table th:nth-child(6),
body .app-shell .payroll-records-wrapper table.payroll-clean-table td:nth-child(6) {
    width: 82px !important;
    min-width: 82px !important;
    max-width: 82px !important;
    text-align: center !important;
}

body .app-shell .payroll-records-wrapper table.payroll-clean-table th:nth-child(7),
body .app-shell .payroll-records-wrapper table.payroll-clean-table td:nth-child(7) {
    width: 235px !important;
    min-width: 235px !important;
}

body .app-shell .payroll-records-wrapper .payroll-clean-action-cell {
    display: grid !important;
    grid-template-columns: 32px 32px 74px 32px 32px !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    min-width: 235px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    overflow: visible !important;
}

body .app-shell .payroll-records-wrapper .payroll-clean-status-select {
    width: 74px !important;
    min-width: 74px !important;
    max-width: 74px !important;
    padding-left: 7px !important;
    padding-right: 18px !important;
    font-size: 12px !important;
}

body .app-shell .payroll-records-wrapper .payroll-employee-stack {
    gap: 3px !important;
}

body .app-shell .payroll-records-wrapper .payroll-employee-stack strong,
body .app-shell .payroll-records-wrapper .payroll-employee-cell strong {
    font-size: 13px !important;
    line-height: 1.2 !important;
}

body .app-shell .payroll-records-wrapper .payroll-employee-stack small,
body .app-shell .payroll-records-wrapper .payroll-employee-stack em,
body .app-shell .payroll-records-wrapper .payroll-employee-cell small,
body .app-shell .payroll-records-wrapper .payroll-employee-cell em {
    font-size: 11px !important;
    line-height: 1.2 !important;
}

body .app-shell .payroll-records-wrapper .payroll-mini-list {
    gap: 4px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
}

body .app-shell .payroll-records-wrapper .payroll-mini-list span {
    grid-template-columns: minmax(76px, 1fr) auto !important;
    gap: 6px !important;
    padding-bottom: 3px !important;
}

body .app-shell .payroll-records-wrapper .payroll-clean-net strong {
    font-size: 16px !important;
}

@media (max-width: 760px) {
    body .app-shell .payroll-records-wrapper table.payroll-clean-table {
        min-width: 1080px !important;
    }

    body .app-shell .payroll-records-wrapper table.payroll-clean-table th:nth-child(1),
    body .app-shell .payroll-records-wrapper table.payroll-clean-table td:nth-child(1) {
        width: 250px !important;
        min-width: 250px !important;
    }

    body .app-shell .payroll-records-wrapper table.payroll-clean-table th:nth-child(2),
    body .app-shell .payroll-records-wrapper table.payroll-clean-table td:nth-child(2) {
        width: 145px !important;
        min-width: 145px !important;
    }

    body .app-shell .payroll-records-wrapper table.payroll-clean-table th:nth-child(3),
    body .app-shell .payroll-records-wrapper table.payroll-clean-table td:nth-child(3) {
        width: 170px !important;
        min-width: 170px !important;
    }

    body .app-shell .payroll-records-wrapper table.payroll-clean-table th:nth-child(4),
    body .app-shell .payroll-records-wrapper table.payroll-clean-table td:nth-child(4) {
        width: 155px !important;
        min-width: 155px !important;
    }

    body .app-shell .payroll-records-wrapper table.payroll-clean-table th:nth-child(7),
    body .app-shell .payroll-records-wrapper table.payroll-clean-table td:nth-child(7) {
        width: 220px !important;
        min-width: 220px !important;
    }

    body .app-shell .payroll-records-wrapper .payroll-clean-action-cell {
        grid-template-columns: 30px 30px 68px 30px 30px !important;
        min-width: 220px !important;
        gap: 5px !important;
    }

    body .app-shell .payroll-records-wrapper .payroll-clean-status-select {
        width: 68px !important;
        min-width: 68px !important;
        max-width: 68px !important;
    }
}


/* ===============================
   LIGHT / DARK MODE SYSTEM
================================ */

:root {
    --app-bg: #f3f4f6;
    --app-bg-soft: #f9fafb;
    --app-card: #ffffff;
    --app-text: #111827;
    --app-text-strong: #111827;
    --app-muted: #6b7280;
    --app-border: #e5e7eb;
    --app-border-strong: #d1d5db;
    --app-input-bg: #ffffff;
    --app-input-text: #111827;
    --app-table-head: #111827;
    --app-table-head-text: #ffffff;
    --app-hover: #f9fafb;
    --app-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] {
    --app-bg: #07111f;
    --app-bg-soft: #0b1627;
    --app-card: #0f172a;
    --app-text: #e5e7eb;
    --app-text-strong: #f8fafc;
    --app-muted: #94a3b8;
    --app-border: #1f2937;
    --app-border-strong: #334155;
    --app-input-bg: #020617;
    --app-input-text: #e5e7eb;
    --app-table-head: #020617;
    --app-table-head-text: #f8fafc;
    --app-hover: #111827;
    --app-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

body {
    background: var(--app-bg);
    color: var(--app-text);
    transition: background-color 0.18s ease, color 0.18s ease;
}

.theme-toggle-btn {
    position: relative;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 1px solid rgba(148, 163, 184, 0.38);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.theme-toggle-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.38);
}

.theme-icon {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 18px;
    line-height: 1;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

html[data-theme="light"] .theme-icon-moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

html[data-theme="light"] .theme-icon-sun {
    opacity: 0;
    transform: scale(0.45) rotate(-90deg);
}

html[data-theme="dark"] .theme-icon-moon {
    opacity: 0;
    transform: scale(0.45) rotate(90deg);
}

html[data-theme="dark"] .theme-icon-sun {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

html[data-theme="dark"] .app-shell,
html[data-theme="dark"] .payslip-page {
    background: var(--app-bg);
}

html[data-theme="dark"] .form-card,
html[data-theme="dark"] .summary-card,
html[data-theme="dark"] .table-wrapper,
html[data-theme="dark"] .table-toolbar,
html[data-theme="dark"] .report-stat-card,
html[data-theme="dark"] .profile-card,
html[data-theme="dark"] .employee-directory-card,
html[data-theme="dark"] .employee-directory-stat-card,
html[data-theme="dark"] .payroll-filter-card,
html[data-theme="dark"] .payroll-bulk-row,
html[data-theme="dark"] .payroll-pagination-bar,
html[data-theme="dark"] .rl-list-card,
html[data-theme="dark"] .rl-create-card,
html[data-theme="dark"] .period-card,
html[data-theme="dark"] .company-card,
html[data-theme="dark"] .analytics-card {
    background: var(--app-card) !important;
    border-color: var(--app-border) !important;
    color: var(--app-text) !important;
    box-shadow: var(--app-shadow) !important;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] .page-header h1,
html[data-theme="dark"] .form-section h3,
html[data-theme="dark"] .table-toolbar h2,
html[data-theme="dark"] .summary-card strong,
html[data-theme="dark"] .report-stat-card strong,
html[data-theme="dark"] .section-header h2,
html[data-theme="dark"] .empty-box h3,
html[data-theme="dark"] .employee-clean-person-info strong,
html[data-theme="dark"] .employee-clean-mini-list em,
html[data-theme="dark"] .payroll-employee-stack strong,
html[data-theme="dark"] .payroll-clean-net strong {
    color: var(--app-text-strong) !important;
}

html[data-theme="dark"] p,
html[data-theme="dark"] .page-header p,
html[data-theme="dark"] .table-toolbar p,
html[data-theme="dark"] .summary-card span,
html[data-theme="dark"] .report-stat-card span,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .field label,
html[data-theme="dark"] .employee-clean-person-info small,
html[data-theme="dark"] .employee-clean-mini-list b,
html[data-theme="dark"] .employee-salary-stack small,
html[data-theme="dark"] .payroll-mini-list b,
html[data-theme="dark"] .payroll-employee-stack small,
html[data-theme="dark"] .payroll-employee-stack em,
html[data-theme="dark"] .bulk-payslip-note {
    color: var(--app-muted) !important;
}

html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .table-search,
html[data-theme="dark"] .status-select,
html[data-theme="dark"] .payroll-clean-status-select,
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="time"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: var(--app-input-bg) !important;
    color: var(--app-input-text) !important;
    border-color: var(--app-border-strong) !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #64748b !important;
}

html[data-theme="dark"] .field input[readonly],
html[data-theme="dark"] .field textarea[readonly],
html[data-theme="dark"] #dailyRateInput[readonly] {
    background: #111827 !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] .payroll-table th {
    background: var(--app-table-head) !important;
    color: var(--app-table-head-text) !important;
}

html[data-theme="dark"] .payroll-table td {
    border-bottom-color: var(--app-border) !important;
    color: var(--app-text) !important;
    background: transparent;
}

html[data-theme="dark"] .payroll-table tbody tr:hover {
    background: var(--app-hover) !important;
}

html[data-theme="dark"] .sticky-action {
    background: var(--app-card) !important;
    box-shadow: -6px 0 12px rgba(0, 0, 0, 0.25) !important;
}

html[data-theme="dark"] thead .sticky-action {
    background: var(--app-table-head) !important;
}

html[data-theme="dark"] .btn {
    background: #1f2937;
    color: #e5e7eb;
}

html[data-theme="dark"] .btn:hover {
    background: #334155;
}

html[data-theme="dark"] .btn-primary {
    background: #2563eb;
    color: #ffffff;
}

html[data-theme="dark"] .btn-primary:hover {
    background: #1d4ed8;
}

html[data-theme="dark"] .btn-danger {
    background: #dc2626;
    color: #ffffff;
}

html[data-theme="dark"] .mini-badge,
html[data-theme="dark"] .employee-clean-pills span,
html[data-theme="dark"] .employee-salary-type,
html[data-theme="dark"] .reporting-location-badge,
html[data-theme="dark"] .payroll-employee-id {
    background: #172554 !important;
    color: #bfdbfe !important;
    border-color: #1e3a8a !important;
}

html[data-theme="dark"] .employee-clean-pills span:nth-child(2) {
    background: #1f2937 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .sensitive-rate-dialog {
    background: var(--app-card) !important;
    color: var(--app-text) !important;
    border: 1px solid var(--app-border) !important;
}

html[data-theme="dark"] .sensitive-rate-dialog h2 {
    color: var(--app-text-strong) !important;
}

html[data-theme="dark"] .sensitive-rate-dialog p,
html[data-theme="dark"] .sensitive-rate-dialog small {
    color: var(--app-muted) !important;
}

html[data-theme="dark"] .sensitive-rate-close {
    background: #1f2937 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .sensitive-rate-icon {
    background: #172554 !important;
    color: #bfdbfe !important;
}

html[data-theme="dark"] .masked-rate-btn,
html[data-theme="dark"] .masked-netpay-btn {
    background: #111827 !important;
    border-color: #334155 !important;
    color: #e5e7eb !important;
}

html[data-theme="dark"] .masked-rate-btn:hover,
html[data-theme="dark"] .masked-netpay-btn:hover {
    background: #172554 !important;
    border-color: #2563eb !important;
    color: #bfdbfe !important;
}

html[data-theme="dark"] .masked-rate-btn.is-unlocked,
html[data-theme="dark"] .masked-netpay-btn.is-unlocked {
    background: #052e16 !important;
    border-color: #166534 !important;
    color: #bbf7d0 !important;
}

html[data-theme="dark"] .payroll-mini-list span,
html[data-theme="dark"] .employee-clean-mini-list span {
    border-bottom-color: #1f2937 !important;
}

html[data-theme="dark"] .payroll-mini-total,
html[data-theme="dark"] .payroll-clean-net {
    background: rgba(22, 101, 52, 0.16) !important;
    color: #bbf7d0 !important;
}

html[data-theme="dark"] .auth-login-right,
html[data-theme="dark"] .login-card {
    background: var(--app-card) !important;
    color: var(--app-text) !important;
}

html[data-theme="dark"] .auth-form-header h2,
html[data-theme="dark"] .login-brand h1 {
    color: var(--app-text-strong) !important;
}

html[data-theme="dark"] .auth-form-header p,
html[data-theme="dark"] .login-brand p {
    color: var(--app-muted) !important;
}

html[data-theme="dark"] .auth-default-box,
html[data-theme="dark"] .login-hint {
    background: var(--app-bg-soft) !important;
    border-color: var(--app-border) !important;
    color: var(--app-text) !important;
}

html[data-theme="dark"] .payslip-sheet {
    background: #ffffff !important;
    color: #111827 !important;
}

@media (max-width: 700px) {
    .theme-toggle-btn {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }
}

