/*
Theme Name: DPS ERP
Theme URI: https://example.com/dps-erp
Author: DPS Solutions
Author URI: https://example.com
Description: DPS Workforce ERP interface theme.
Version: 1.5.29
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: dps-erp
*/

/* Custom Styles for DPS Workforce ERP */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #142B63;
    --secondary-color: #1E4F9C;
    --accent-color: #2F80ED;
    --bg-color: #FFFFFF;
    --light-bg-color: #EAF4FF;
    --success-color: #22C55E;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --text-dark: #1E293B;
    --text-muted: #64748B;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --transition-speed: 0.3s;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #F8FAFC;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #F1F5F9;
}
::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Enhanced scrollbar for horizontally scrollable tables */
.table-responsive, .attendance-grid-wrap {
    overflow-x: auto !important; /* Keep horizontal scroll active */
    overflow-y: hidden !important; /* Hide inner vertical scroll to prevent double scrollbars */
    max-height: none !important; /* Allow natural expansion */
    scrollbar-color: #64748B #E2E8F0;
    scrollbar-width: auto;
    -webkit-overflow-scrolling: touch;
}
.table-responsive::-webkit-scrollbar, .attendance-grid-wrap::-webkit-scrollbar {
    height: 12px; /* Thicker scrollbar to make dragging easy */
}
.table-responsive::-webkit-scrollbar-track, .attendance-grid-wrap::-webkit-scrollbar-track {
    background: #E2E8F0;
    border-radius: 6px;
}
.table-responsive::-webkit-scrollbar-thumb, .attendance-grid-wrap::-webkit-scrollbar-thumb {
    background: #94A3B8; /* Darker color to stand out */
    border: 2px solid #E2E8F0; /* Adds breathing space around thumb */
    border-radius: 6px;
}
.table-responsive::-webkit-scrollbar-thumb:hover, .attendance-grid-wrap::-webkit-scrollbar-thumb:hover {
    background: #475569; /* Even darker color on hover to show clickability */
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--primary-color);
    color: #FFFFFF;
    z-index: 1000;
    transition: width var(--transition-speed) ease;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.15);
}

.sidebar-brand {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo-image {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: block;
    object-fit: contain;
    image-rendering: auto;
    background: #FFFFFF;
    border-radius: 7px;
    padding: 3px;
}

.sidebar-brand strong {
    color: #FFFFFF;
    font-weight: 700;
}

.sidebar-brand span {
    color: var(--accent-color);
}

.nav-menu {
    list-style: none;
    padding: 15px 0;
    margin: 0;
}

.nav-item-header {
    padding: 10px 20px 5px 20px;
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
}

.nav-link-custom {
    display: flex;
    align-items: center;
    padding: 11px 20px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-link-custom i {
    width: 20px;
    margin-right: 12px;
    font-size: 1.1rem;
    text-align: center;
}

.nav-link-custom:hover {
    color: #FFFFFF;
    background-color: rgba(255, 255, 255, 0.05);
    border-left-color: var(--accent-color);
}

.nav-link-custom.active {
    color: #FFFFFF;
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent-color);
    font-weight: 600;
}

.sidebar-dropdown {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-dropdown-toggle {
    width: 100%;
    background: transparent;
    border: 0;
}

.sidebar-dropdown-toggle .dropdown-caret {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.sidebar-dropdown.open .dropdown-caret {
    transform: rotate(180deg);
}

.sidebar-dropdown-menu {
    list-style: none;
    margin: 6px 0 0 14px;
    padding: 0 0 0 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    display: none;
}

.sidebar-dropdown.open .sidebar-dropdown-menu {
    display: block;
}

.sidebar-dropdown-menu .nav-link-custom {
    padding-left: 0;
    font-size: 0.9rem;
}

/* Main Content Area */
.main-wrapper {
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-speed) ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar Header */
.topbar {
    height: 70px;
    background-color: #FFFFFF;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.content-body {
    flex: 1;
    padding: 30px;
    background-color: #F8FAFC;
}

/* Cards Design */
.card-stat {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background-color: #FFFFFF;
}

.card-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.4rem;
}

.stat-icon.primary { background-color: var(--light-bg-color); color: var(--primary-color); }
.stat-icon.secondary { background-color: #EAF4FF; color: var(--secondary-color); }
.stat-icon.accent { background-color: rgba(47, 128, 237, 0.1); color: var(--accent-color); }
.stat-icon.success { background-color: rgba(34, 197, 94, 0.1); color: var(--success-color); }
.stat-icon.warning { background-color: rgba(245, 158, 11, 0.1); color: var(--warning-color); }
.stat-icon.danger { background-color: rgba(239, 68, 68, 0.1); color: var(--danger-color); }

/* Custom Buttons */
.btn-primary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    font-weight: 500;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-accent {
    background-color: var(--accent-color);
    color: white;
}
.btn-accent:hover {
    background-color: var(--secondary-color);
    color: white;
}

/* Tables styling */
.table-responsive {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #E2E8F0;
    background-color: #FFFFFF;
}

.custom-table {
    margin-bottom: 0;
}

.custom-table th {
    background-color: #F8FAFC;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 20px;
    border-bottom: 1px solid #E2E8F0;
}

.custom-table td {
    padding: 14px 20px;
    vertical-align: middle;
    font-size: 0.9rem;
    border-bottom: 1px solid #F1F5F9;
}

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

.overtime-sheet-table {
    table-layout: fixed;
    width: 100%;
    font-size: 0.82rem;
}

.overtime-sheet-table th,
.overtime-sheet-table td {
    white-space: normal;
    word-break: break-word;
    vertical-align: middle;
    padding: 8px 6px;
}

.overtime-sheet-table thead th {
    line-height: 1.2;
}

.attendance-sheet-wrap {
    overflow-x: scroll !important;
    overflow-y: visible;
    max-width: 100%;
    padding-bottom: 10px;
    scrollbar-gutter: stable both-edges;
    scroll-behavior: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

.attendance-scroll-shell { position: relative; }

.attendance-register-card { overflow: visible !important; }
.attendance-register-contract-heading {
    position: relative;
    z-index: 2;
    margin: 0 0 8px;
    padding: 10px 12px;
    border: 1px solid #dbe5f1;
    border-radius: 8px;
    background: #f8fafc;
    color: #1e293b;
    font-size: 0.82rem;
    font-weight: 700;
}

.attendance-sheet-table {
    table-layout: fixed;
    width: max-content;
    min-width: 100%;
    font-size: 0.72rem;
    border-collapse: collapse;
}

.attendance-sheet-table th,
.attendance-sheet-table td {
    white-space: nowrap;
    vertical-align: middle;
    padding: 4px 6px;
    border-color: #111 !important;
    text-align: center;
}

.attendance-sheet-table thead th {
    font-weight: 700;
    line-height: 1.1;
}

.attendance-sheet-table tbody td:nth-child(3) {
    font-weight: 700;
}

.attendance-sheet-table td.table-danger,
.attendance-sheet-table td.table-warning,
.attendance-sheet-table td.table-info,
.attendance-sheet-table td.bg-success-subtle {
    font-weight: 600;
}

.attendance-sheet-table td.table-danger { background-color: #d88f8f !important; }
.attendance-sheet-table td.table-warning { background-color: #fff200 !important; }
.attendance-sheet-table td.table-info { background-color: #17a9e1 !important; color: #000 !important; }
.attendance-sheet-table td.bg-success-subtle { background-color: #9cd44f !important; }

.attendance-col-sticky {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #fff !important;
    background-clip: padding-box;
    isolation: isolate;
}

.attendance-sheet-table th.attendance-col-sticky {
    z-index: 5;
    background: #f8fbff;
}

.attendance-sticky-group-heading {
    position: sticky;
    left: 0;
    z-index: 7;
    min-width: 484px;
    width: 484px;
    background: #fff !important;
    box-shadow: 2px 0 0 #111;
}

.attendance-col-sticky.sno { left: 0; width: 48px; min-width: 48px; }
.attendance-col-sticky.empid { left: 48px; width: 78px; min-width: 78px; }
.attendance-col-sticky.name { left: 126px; width: 135px; min-width: 135px; }
.attendance-col-sticky.parent { left: 261px; width: 135px; min-width: 135px; }
.attendance-col-sticky.sex { left: 396px; width: 42px; min-width: 42px; }
.attendance-col-sticky.hold { left: 438px; width: 46px; min-width: 46px; }
.attendance-col-sticky.hold { box-shadow: 3px 0 0 #111, 8px 0 10px rgba(15, 23, 42, .08); }

.attendance-day-col { width: 38px; min-width: 38px; }
.attendance-total-col { width: 52px; min-width: 52px; }
.attendance-remarks-col { width: 125px; min-width: 125px; }

.attendance-sheet-table thead tr:first-child th {
    background: #ffffff;
}

.attendance-sheet-table thead tr:nth-child(2) th {
    background: #f0f5fb;
}

.attendance-grid-wrap {
    overflow: auto;
    max-width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}

@media (min-width: 1400px) {
    .attendance-sheet-table { font-size: 0.74rem; }
    .attendance-month-grid thead th.att-date-head,
    .att-grid-day { min-width: 132px; width: 132px; }
}

@media (max-width: 991.98px) {
    .attendance-register-contract-heading { font-size: 0.76rem; line-height: 1.35; }
    .attendance-sheet-table { font-size: 0.68rem; }
    .attendance-col-sticky.name { width: 125px; min-width: 125px; }
    .attendance-col-sticky.parent { left: 251px; width: 115px; min-width: 115px; }
    .attendance-col-sticky.sex { left: 366px; }
    .attendance-col-sticky.hold { left: 408px; }
    .attendance-month-grid thead th.att-date-head,
    .att-grid-day { min-width: 122px; width: 122px; }
}

.attendance-upload-card {
    min-height: 0;
    height: auto;
}

.attendance-control-card {
    min-height: 180px;
    height: 100%;
}

#screen-attendance > .row.align-items-start {
    align-items: flex-start !important;
}

.attendance-sheet-card {
    min-height: calc(100vh - 170px);
    margin-top: 4px;
}

.attendance-month-grid {
    table-layout: fixed;
    width: max-content;
    min-width: 100%;
    font-size: 0.82rem;
    background: #fff;
    margin-bottom: 0;
}

.attendance-month-grid th,
.attendance-month-grid td {
    border-color: #d9e2ec;
    vertical-align: middle;
}

.attendance-month-grid thead th {
    background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.35px;
    text-align: center;
}

.attendance-month-grid thead th.att-date-head {
    min-width: 148px;
    width: 148px;
    padding: 10px 8px 12px;
    font-size: 0.7rem;
}

.att-head-day {
    font-size: 0.9rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.att-head-name {
    font-size: 0.67rem;
    color: #64748b;
    line-height: 1.1;
    margin-top: 2px;
}

.att-head-holiday {
    background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%) !important;
}

.att-sticky-col {
    position: sticky;
    z-index: 3;
    background: #fff;
}

.attendance-month-grid thead .att-sticky-col {
    z-index: 5;
}

.att-sno {
    left: 0;
    min-width: 66px;
    width: 66px;
    text-align: center;
}

.att-empid {
    left: 66px;
    min-width: 148px;
    width: 148px;
}

.att-name {
    left: 214px;
    min-width: 230px;
    width: 230px;
    font-weight: 600;
}

.attendance-month-grid tbody td.att-sticky-col {
    box-shadow: 1px 0 0 #e2e8f0;
    background: #ffffff;
}

.att-grid-day {
    min-width: 148px;
    width: 148px;
    padding: 10px 8px;
    text-align: center;
}

.att-day-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 4px;
}

.att-holiday-toggle,
.att-holiday-head-btn {
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    color: #4338ca;
    border-radius: 8px;
    min-height: 24px;
    min-width: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    font-size: 0.72rem;
    line-height: 1;
    margin-top: 5px;
}

.att-holiday-head-btn {
    font-weight: 800;
}

.att-cell-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.1;
}

.att-cell-line {
    font-size: 0.78rem;
    font-weight: 600;
    color: #1e293b;
}

.att-cell-empty {
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 600;
}

.att-mini-input {
    width: 100%;
    min-width: 100%;
    font-size: 0.8rem;
    padding: 0.38rem 0.5rem;
    text-align: center;
    border-radius: 9px;
    border-color: #d8e0ea;
    background: #fbfdff;
}

.att-time-in {
    background: #effaf3;
    border-color: #bfe3ca;
    color: #166534;
}

.att-time-out {
    background: #fff7ed;
    border-color: #f6d5b3;
    color: #9a3412;
}

.att-grid-holiday {
    background: #dbeafe !important;
    color: #1d4ed8;
    text-align: center;
    font-weight: 800;
}

.att-grid-holiday .att-holiday-btn {
    width: 100%;
    min-height: 56px;
    border-radius: 10px;
    border: 1px solid #93c5fd;
    background: #bfdbfe;
    color: #1d4ed8;
    font-weight: 800;
}

.att-grid-weekend .att-weekend-btn {
    width: 100%;
    min-height: 56px;
    border-radius: 10px;
    border: 1px solid #facc15;
    background: #fef08a;
    color: #854d0e;
    font-weight: 800;
}

.att-head-weekend {
    background: #fef08a !important;
    color: #854d0e;
}

.att-grid-overtime {
    background: #f3e8ff !important;
    box-shadow: inset 0 0 0 2px #a855f7;
}
.att-ot-badge {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:28px;
    padding:2px 6px;
    border-radius:999px;
    background:#7e22ce;
    color:#fff;
    font-size:.62rem;
    font-weight:800;
}
.att-grid-absent {
    background:#fee2e2 !important;
    box-shadow:inset 0 0 0 1px #fca5a5;
}
.att-department-select {
    min-width:132px;
    font-size:.68rem;
    border-color:#cbd5e1;
    background:#fff;
}
.att-cell-overtime {
    background:#e9d5ff !important;
    color:#6b21a8 !important;
    font-weight:800;
}
.department-attendance-summary {
    padding:12px;
    border:1px solid #dbe5f1;
    border-radius:12px;
    background:#f8fbff;
}

.attendance-month-save-select {
    min-width: 180px;
    height: 48px;
}

.attendance-header-row {
    gap: 12px;
}

.attendance-top-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

.attendance-footer-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.attendance-top-actions .btn,
.attendance-top-actions .form-select {
    border-radius: 12px;
    height: 48px;
}

.attendance-top-actions .btn {
    min-height: 48px;
    min-width: 190px;
    padding-inline: 16px;
    white-space: nowrap;
}

.attendance-top-actions .legend-pill {
    margin-left: 2px;
    min-width: 145px;
    min-height: 48px;
    justify-content: center;
    white-space: nowrap;
}

.attendance-top-actions .legend-pill:first-of-type {
    margin-left: auto;
}

.attendance-tools {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 10px 10px 8px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.attendance-tools .form-select-sm {
    border-radius: 10px;
    min-height: 42px;
    font-size: 0.92rem;
    border-color: #d7dfea;
}

.attendance-tools .form-select-sm:focus {
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.12);
}

.attendance-legend {
    align-items: center;
}

.legend-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    padding: 0.5rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.legend-pill-in { background: #e8f5ee; color: #166534; border-color: #cdeed8; }
.legend-pill-out { background: #fff4e5; color: #9a3412; border-color: #ffe2bc; }
.legend-pill-note { background: #eef2ff; color: #3730a3; border-color: #dbe4ff; }

/* Client role is a read-only viewer for registers and payslips. */
.role-viewer .erp-screen input,
.role-viewer .erp-screen select,
.role-viewer .erp-screen textarea {
    pointer-events: none;
    background-color: #f8fafc !important;
}

.role-viewer .erp-screen .btn:not(.btn-link) {
    pointer-events: none;
    opacity: 0.65;
}

.attendance-month-grid tbody tr:hover td {
    background: #f8fbff;
}

.attendance-summary {
    align-items: center;
    justify-content: flex-end;
}

.summary-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.74rem;
    font-weight: 700;
    border: 1px solid #dbe4ee;
}

.attendance-sheet-card .card-body,
.attendance-upload-card .card-body {
    padding: 0;
}

.attendance-sheet-card .attendance-grid-wrap {
    min-height: calc(100vh - 245px);
    overflow: auto;
}

.upload-rect-btn {
    width: 100%;
    min-height: 46px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.92rem;
}

.attendance-month-grid col.attendance-day-col {
    width: 148px;
}

.attendance-month-grid thead th.att-date-head span {
    font-size: 0.68rem;
    line-height: 1.05;
}

/* Badges */
.badge-status {
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-active { background-color: rgba(34, 197, 94, 0.1); color: var(--success-color); }
.badge-inactive { background-color: rgba(239, 68, 68, 0.1); color: var(--danger-color); }
.badge-pending { background-color: rgba(245, 158, 11, 0.1); color: var(--warning-color); }

/* OCR Upload Zone */
.upload-zone {
    border: 2px dashed #CBD5E1;
    background-color: #F8FAFC;
    border-radius: 14px;
    padding: 22px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 150px;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent-color);
    background-color: var(--light-bg-color);
}

/* Login Overlay Styles */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--primary-color);
    background-image: radial-gradient(circle at 10% 20%, rgb(30, 79, 156) 0%, rgb(20, 43, 99) 90%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background-color: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.login-logo i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

/* Profile Tab Design */
.profile-tabs .nav-link {
    color: var(--text-muted);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 12px 20px;
    font-weight: 500;
}
.profile-tabs .nav-link.active {
    color: var(--secondary-color);
    border-bottom: 2px solid var(--secondary-color);
    background-color: transparent;
}

/* Print Invoice styles */
@media print {
    body * {
        visibility: hidden;
    }
    #invoice-print-area, #invoice-print-area * {
        visibility: visible;
    }
    #invoice-print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
}

/* Mobile Responsiveness */
@media (max-width: 991.98px) {
    .sidebar {
        left: -var(--sidebar-width);
    }
    .sidebar.show {
        left: 0;
    }
    .main-wrapper {
        margin-left: 0 !important;
    }
    .topbar {
        padding: 0 15px;
    }

    .attendance-header-row,
    .attendance-footer-row {
        align-items: stretch;
    }

    .attendance-top-actions {
        justify-content: flex-start;
        width: 100%;
        flex-wrap: wrap;
    }

    .attendance-top-actions .legend-pill:first-of-type {
        margin-left: 2px;
    }

    .attendance-tools {
        padding: 12px 12px 10px;
    }

    .attendance-tools .row > [class*="col-"] {
        margin-bottom: 6px;
    }

    .attendance-month-save-select {
        width: 100%;
        min-width: 100%;
    }
}

@media (max-width: 767.98px) {
    .topbar {
        height: auto;
        min-height: 70px;
        padding: 12px 12px;
        gap: 10px;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .content-body {
        padding: 16px;
    }

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

    .topbar > .d-flex {
        width: 100%;
        justify-content: space-between;
    }

    .topbar .d-flex.align-items-center.gap-3 {
        gap: 8px !important;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .card-stat,
    .card,
    .table-responsive,
    .login-card {
        border-radius: 10px;
    }

    .attendance-upload-card,
    .attendance-control-card,
    .attendance-sheet-card {
        min-height: auto;
        height: auto;
    }

    .attendance-header-row {
        gap: 8px;
    }

    .attendance-footer-row {
        gap: 10px;
    }

    .attendance-top-actions,
    .attendance-legend {
        width: 100%;
    }

    .attendance-top-actions .btn,
    .attendance-top-actions .form-select {
        width: 100%;
    }

    .attendance-top-actions .legend-pill {
        width: 100%;
        justify-content: flex-start;
    }

    .attendance-legend {
        justify-content: flex-start !important;
    }

    .attendance-month-grid {
        width: max-content;
        min-width: 100%;
    }

    .attendance-grid-wrap {
        border-radius: 12px;
    }

    .d-flex.justify-content-between.align-items-center.mb-4,
    .d-flex.justify-content-between.align-items-center.mb-3 {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px;
    }

    .d-flex.justify-content-between.align-items-center.mb-4 > div:last-child,
    .d-flex.justify-content-between.align-items-center.mb-3 > div:last-child {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-start;
    }

    .row.g-3 > [class*="col-"] {
        min-width: 0;
    }

    .form-control,
    .form-select,
    .btn {
        font-size: 0.92rem;
    }

    .table-responsive {
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

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

    .attendance-sheet-table {
        font-size: 0.66rem;
    }

    .attendance-control-card .text-muted.small {
        line-height: 1.35;
    }

    .attendance-col-sticky.name,
    .attendance-col-sticky.parent {
        width: 120px;
        min-width: 120px;
    }

    #wagesRegisterTable {
        min-width: 2500px;
    }
}

@media (max-width: 575.98px) {
    .sidebar {
        width: min(85vw, var(--sidebar-width));
    }

    .sidebar-header {
        padding: 0 16px;
    }

    .nav-link-custom {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .content-body {
        padding: 12px;
    }

    .topbar {
        padding: 10px 12px;
    }

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

    .attendance-tools {
        padding: 10px 10px 8px;
    }

    .attendance-tools .form-select-sm,
    .attendance-top-actions .btn,
    .attendance-top-actions .form-select {
        min-height: 40px;
    }

    .login-card {
        padding: 24px 18px;
        margin: 0 12px;
    }

    .table-responsive {
        border-radius: 10px;
    }

    #wagesRegisterTable td input {
        min-width: 70px;
    }

    .attendance-month-grid thead th.att-date-head,
    .att-grid-day {
        min-width: 128px;
        width: 128px;
    }

    .att-name {
        min-width: 180px;
        width: 180px;
    }

    .att-empid {
        min-width: 120px;
        width: 120px;
    }
}

/* Wages Register table styling */
#wagesRegisterTable td {
    padding: 6px 8px;
    white-space: nowrap;
    vertical-align: middle;
}
#wagesRegisterTable input {
    width: 100%;
    min-width: 80px;
    padding: 4px 6px;
    border: 1px solid transparent;
    background: transparent;
    text-align: center;
    border-radius: 4px;
    transition: all 0.2s;
}
#wagesRegisterTable input:focus, #wagesRegisterTable input:hover {
    background: #ffffff;
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(47, 128, 237, 0.15);
}

/* Compact wizard custom tables */
.custom-table th, .custom-table td {
    padding: 5px 8px !important;
    font-size: 0.85rem !important;
    vertical-align: middle !important;
}

.custom-table input.form-control {
    padding: 3px 6px !important;
    font-size: 0.82rem !important;
    height: auto !important;
}

/* Print stylesheet for A4 single-page payslip generation */
@media print {
    @page {
        margin: 1cm;
        size: portrait;
    }
    body {
        background: #ffffff;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    body * {
        visibility: hidden;
    }
    #payslipPreviewContainer, #payslipPreviewContainer * {
        visibility: visible;
    }
    #payslipPreviewContainer {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }
    .payslip-page-break {
        page-break-after: always;
        break-after: page;
    }
}

/* Manually checked row highlight style */
.table-checked-highlight {
    background-color: rgba(40, 167, 69, 0.15) !important;
    transition: background-color 0.25s ease;
}

/* Rate Chart Builder Specific Premium Styles */
.rate-chart-summary-card {
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-left: 5px solid var(--accent-color);
}
.rate-chart-excel-table th {
    background-color: #f1f5f9 !important;
    color: #334155;
    font-weight: 600;
}
.rate-chart-excel-table input.form-control, 
.rate-chart-excel-table select.form-select {
    border: 1px solid transparent;
    background-color: transparent;
    padding: 4px 6px;
    border-radius: 4px;
}
.rate-chart-excel-table input.form-control:focus, 
.rate-chart-excel-table select.form-select:focus {
    border-color: var(--accent-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 2px rgba(30, 79, 156, 0.1);
}
.rate-chart-excel-table tr:hover {
    background-color: #f8fafc;
}
.rate-chart-excel-table td {
    vertical-align: middle;
}
.formula-token {
    display: inline-block;
    background-color: #e2e8f0;
    color: #1e293b;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    margin: 2px;
    cursor: pointer;
}
.formula-token:hover {
    background-color: #cbd5e1;
}
.formula-operator {
    display: inline-block;
    background-color: #fee2e2;
    color: #991b1b;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    margin: 2px;
    cursor: pointer;
}
.formula-operator:hover {
    background-color: #fecaca;
}
.circular-error-panel {
    background-color: #fef2f2;
    border: 1px solid #fee2e2;
    color: #991b1b;
    border-radius: 8px;
    padding: 12px;
}

/* Distinct light green styling for Paid Leave (L) cells */
.att-cell-leave {
    background-color: #D1E7DD !important;
    color: #0F5132 !important;
    font-weight: bold !important;
}
/* Dashboard visual system */
.dashboard-screen { background: linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%); border-radius: 20px; padding: 6px; }
.dashboard-hero { padding: 18px 22px; background: linear-gradient(120deg, #eef5ff, #ffffff 65%); border: 1px solid #e2eaf5; border-radius: 18px; }
.dashboard-eyebrow { display: block; color: #6e7f98; font-size: .68rem; font-weight: 800; letter-spacing: .12em; margin-bottom: 5px; }
.dashboard-live { color: #168a55; background: #e9f8ef; border: 1px solid #bfead1; border-radius: 999px; padding: 7px 11px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.dashboard-live i { font-size: .5rem; }
.dashboard-kpi { min-height: 112px; border: 1px solid #e7edf5 !important; border-radius: 16px !important; box-shadow: 0 8px 22px rgba(31,55,88,.06) !important; transition: transform .18s ease, box-shadow .18s ease; }
.dashboard-kpi:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(31,55,88,.12) !important; }
.dashboard-kpi h6 { letter-spacing: .06em; font-size: .67rem; margin-bottom: 8px; }
.dashboard-kpi h3 { font-size: 1.42rem; letter-spacing: -.02em; }
.dashboard-kpi.kpi-primary { border-top: 3px solid #2758a6 !important; }
.dashboard-kpi.kpi-success { border-top: 3px solid #20a464 !important; }
.dashboard-kpi.kpi-danger { border-top: 3px solid #dc5861 !important; }
.dashboard-kpi.kpi-secondary { border-top: 3px solid #69758b !important; }
.dashboard-kpi.kpi-accent { border-top: 3px solid #8b6ee8 !important; }
.dashboard-kpi.kpi-warning { border-top: 3px solid #e8a52b !important; }
.dashboard-panel { border: 1px solid #e5ebf4 !important; box-shadow: 0 8px 24px rgba(31,55,88,.06) !important; }
.dashboard-panel-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dashboard-panel-title > i { color: #2b5ba7; background: #edf4ff; padding: 9px; border-radius: 10px; }
.dashboard-panel canvas { min-height: 250px; }
.dashboard-panel .table { --bs-table-hover-bg: #f5f8fc; }
.dashboard-panel .table thead th { color: #71819a; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid #e5ebf4; white-space: nowrap; }
.dashboard-panel .table tbody td { border-color: #eef2f7; vertical-align: middle; }
#dash-activity-log, #dash-pending-approvals { max-height: 245px; overflow-y: auto; }
#dash-activity-log .list-group-item, #dash-pending-approvals .list-group-item { padding: .75rem .2rem; }
.dashboard-activity-row { border-bottom: 1px solid #eef2f7 !important; }
.dashboard-activity-row:last-child { border-bottom: 0 !important; }
@media (max-width: 576px) {
  .dashboard-hero { align-items: flex-start !important; flex-direction: column; gap: 14px; }
  .dashboard-hero .btn { width: 100%; }
  .dashboard-live { align-self: flex-start; }
  .dashboard-panel canvas { min-height: 220px; }
}
/*
Theme Name: DPS ERP
Theme URI: https://dpssolutions.in/
Author: DPS Solutions
Description: Exact visual theme shell for the DPS Workforce ERP. Data persistence and server-side permissions will be provided by the DPS ERP plugin.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.1
Text Domain: dps-erp
*/
/* Standard two-copy payslip, matched to the approved Housekeeper, Runner Boy and Store Keeper PDFs. */
.hkp-a4-sheet { width: 210mm; margin: 0 auto 18px; background: #fff; padding: 7mm 9mm; color: #000; font-family: Arial, Helvetica, sans-serif; }
.hkp-payslip-copy { height: 136mm; border: 2px solid #000; box-sizing: border-box; font-size: 8.7px; line-height: 1.15; overflow: hidden; display:grid; grid-template-rows:23mm 26mm 63mm 5mm minmax(0,1fr) 4.8mm; }
.hkp-payslip-copy + .hkp-payslip-copy { margin-top: 7mm; }
.hkp-header { height: 23mm; display: flex; align-items: center; border-bottom: 2px solid #000; padding: 1.5mm 2mm; box-sizing: border-box; text-align: center; }
.hkp-header img { width: 17mm; height: 19mm; object-fit: contain; margin-right: 7mm; }.hkp-header > div { flex: 1; }.hkp-header h2 { font-family: Georgia, 'Times New Roman', serif; font-size: 12.5px; margin: 0; font-weight: 900; line-height: 1.05; }.hkp-header h3 { font-size: 11.5px; font-style: italic; margin: 1.5mm 0 1mm; }.hkp-header p { margin: 0; font-weight: 700; }
.hkp-details,.hkp-pay { display: grid; grid-template-columns: 1fr 1.09fr; }.hkp-details { height:26mm; }.hkp-column { padding: 1.1mm 1.5mm; }.hkp-column + .hkp-column,.hkp-earn + .hkp-deduct { border-left: 2px solid #000; }.hkp-column p,.hkp-pay p { display: flex; justify-content: space-between; gap: 2mm; margin: 0 0 1.1mm; white-space: nowrap; }.hkp-column span { text-align: right; }.hkp-account p { display:grid; grid-template-columns: 27mm 1fr auto auto; column-gap:1.5mm; }.hkp-account p:not(:first-child):not(:nth-child(3)):not(:nth-child(4)):not(:nth-child(5)) { grid-template-columns:27mm 1fr; }
.hkp-pay { height:63mm; border-top: 2px solid #000; }.hkp-earn,.hkp-deduct { padding: 1.7mm; position: relative; }.hkp-pay h4 { font-size: 9.5px; margin: 0 0 1.5mm; text-decoration: underline; }.hkp-earn p { margin: 0 0 3mm; }.hkp-deduct p { margin-bottom: 3.3mm; }.hkp-store-payslip .hkp-overtime { background:#fff200; padding:1px 2px; }.hkp-total { position: absolute; left: 1.7mm; right: 1.7mm; bottom: 1mm; border-bottom: 3px double #000; font-weight: 700; }.hkp-line { border-bottom: 3px double #000; margin-top: .4mm !important; }
.hkp-words { height:5mm; box-sizing:border-box; border-top: 2px solid #000; border-bottom: 2px solid #000; padding: .8mm 1.7mm; display: flex; gap: 4mm; }.hkp-words span { font-size:8.2px; font-weight:700; }.hkp-payment { min-height:0; overflow:hidden; padding: 1.3mm 1.7mm; box-sizing:border-box; }.hkp-payment p { margin: 1mm 0; }.hkp-payment p span { margin-left: 28mm; }.hkp-signatures { display: flex; justify-content: space-between; padding-top: 4.5mm; }.hkp-payslip-copy footer { height:4.8mm; box-sizing:border-box; border-top: 2px solid #000; display: grid; grid-template-columns: 1fr auto; align-items: center; padding: .45mm 1.7mm; white-space:nowrap; }.hkp-payslip-copy footer b:last-child { justify-self: end; text-align: right; }
@media print { .hkp-a4-sheet { width: 210mm; height: 297mm; margin: 0; padding: 7mm 9mm; page-break-after: always; } .hkp-payslip-copy + .hkp-payslip-copy { margin-top: 7mm; } }

/* GST tax invoice layout matching the approved DPS invoice format. */
.gst-invoice-sheet { background:#fff; color:#111; font-family:Arial,Helvetica,sans-serif; font-size:11px; max-width:210mm; margin:auto; border:1px solid #111; }
.gst-invoice-head { display:flex; align-items:center; gap:12px; padding:18px 18px 8px; text-align:center; }.gst-invoice-head img { width:75px; height:75px; object-fit:contain; }.gst-invoice-head div { flex:1; min-width:0; }.gst-invoice-head h2 { color:#31599c; font-size:17px; line-height:1.1; margin:0; white-space:nowrap; letter-spacing:-.2px; }.gst-invoice-head p { color:#bd570f; font-weight:700; margin:5px 0; line-height:1.35; }.gst-invoice-head strong { color:#405f31; font-size:13px; }
.gst-title { margin:0; border-top:1px solid #111; border-bottom:1px solid #111; text-align:center; padding:5px; font-size:18px; }.gst-meta { display:grid; grid-template-columns:105px minmax(140px,1fr) 48px 96px 150px; gap:5px; align-items:center; border-bottom:1px solid #111; padding:6px; }.gst-meta small { font-size:8px; font-weight:700; }.gst-meta .invoice-number-value { white-space:nowrap; overflow:visible; font-variant-numeric:tabular-nums; }.gst-department-head { grid-template-columns:auto minmax(120px,1fr) auto auto auto auto; }
.invoice-ot-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; padding:10px; border:1px solid #dce6f4; border-radius:14px; background:linear-gradient(135deg,#f8fbff,#fff); }.invoice-ot-card { min-width:0; min-height:94px; border:1px solid #dbe7f5; border-radius:11px; padding:12px 14px; display:flex; flex-direction:column; justify-content:space-between; gap:8px; background:#fff; box-shadow:0 3px 10px rgba(27,62,119,.05); }.invoice-ot-card span { color:#53657e; font-size:.74rem; font-weight:800; letter-spacing:.02em; text-transform:uppercase; line-height:1.35; }.invoice-ot-card span i { margin-right:5px; }.invoice-ot-card > output { display:block; min-width:0; overflow:hidden; color:#172f60; font-size:clamp(1.45rem,2.25vw,2.05rem); font-weight:800; line-height:1; font-variant-numeric:tabular-nums; text-overflow:ellipsis; white-space:nowrap; }.invoice-ot-minutes { border-left:4px solid #4b77be; }.invoice-ot-earnings { border-left:4px solid #218b5a; }.invoice-ot-earnings > output { color:#187447; font-size:clamp(1.25rem,2vw,1.85rem); }.invoice-ot-service { border-left:4px solid #d48420; }.invoice-service-input { display:flex; align-items:center; justify-content:space-between; gap:8px; min-width:0; }.invoice-service-input label { display:flex; align-items:center; gap:5px; margin:0; }.invoice-service-input b { color:#9a4b10; font-size:1rem; }.invoice-service-input input { width:64px; min-width:64px; border:1px solid #ebd4ae; border-radius:7px; padding:5px 6px; text-align:center; font-weight:800; color:#9a4b10; outline:0; }.invoice-service-input em { min-width:0; overflow:hidden; color:#9a4b10; font-style:normal; font-size:clamp(1rem,1.65vw,1.3rem); font-weight:800; white-space:nowrap; text-overflow:ellipsis; }.invoice-service-input output { font-variant-numeric:tabular-nums; }
@media (max-width:767px) { .invoice-ot-summary { grid-template-columns:1fr; gap:8px; }.invoice-ot-card { min-height:72px; } }
.invoice-workforce-builder { border:1px solid #dbe5f1; background:#f8fbff; border-radius:12px; }.invoice-line-list { font-size:.78rem; background:#fff; border:1px solid #e3eaf3; }.invoice-line-list th { color:#607089; background:#f1f5fa; }.gst-department-head { display:grid; grid-template-columns:auto minmax(120px,1fr) auto auto auto auto; gap:8px; padding:6px; border-bottom:1px solid #111; align-items:center; }.gst-workforce-lines { table-layout:auto; font-size:8px; }.gst-workforce-lines th,.gst-workforce-lines td { padding:4px 2px; }.gst-workforce-lines .gst-service { width:auto; min-height:0; line-height:1.25; }
.gst-addresses { display:grid; grid-template-columns:1.4fr 1fr; border-bottom:1px solid #111; }.gst-addresses section { padding:6px; min-height:93px; }.gst-addresses section+section { border-left:1px solid #111; }.gst-addresses p { margin:5px 0; }
.gst-lines { width:100%; border-collapse:collapse; font-size:10px; }.gst-lines th,.gst-lines td { border:1px solid #111; padding:5px 3px; text-align:center; vertical-align:middle; }.gst-lines .gst-service { width:32%; text-align:left; min-height:95px; line-height:1.6; }.gst-lines tfoot th { text-align:right; }
.gst-bottom { display:grid; grid-template-columns:1.5fr .8fr .85fr; border-top:1px solid #111; }.gst-bottom section { min-height:145px; padding:7px; }.gst-bottom section+section { border-left:1px solid #111; }.gst-bottom p { margin:8px 0; display:flex; justify-content:space-between; gap:8px; }.gst-invoice-sheet footer { border-top:1px solid #111; text-align:center; padding:4px; font-weight:700; }
@media print { .gst-invoice-sheet { width:210mm; max-width:none; border:0; font-size:9px; }.gst-invoice-head { padding:10px 18px 5px; }.gst-invoice-head h2 { font-size:18px; }.gst-invoice-head img { width:58px; height:58px; }.gst-lines { font-size:8px; }.gst-bottom section { min-height:105px; } }

/* Site Supervisor: assigned-client operational workspace only. */
.role-site-supervisor .employee-admin-action { display:none !important; }
.role-site-supervisor #profileTabs .nav-item:not(:first-child) { display:none !important; }
.role-site-supervisor #profileTabsContent > .tab-pane:not(#tab-personal) { display:none !important; }
.role-site-supervisor #screen-attendance-register input[data-section="attendance"] {
    pointer-events:none;
    user-select:none;
    background-color:transparent !important;
    cursor:default;
}
