/* Xero Payroll Dashboard Styles */

/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f1f5f9;
    color: #1e293b;
    line-height: 1.5;
}

.container { max-width: 1600px; margin: 0 auto; padding: 20px; }

/* Header */
.header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.header-left { display: flex; flex-direction: column; gap: 4px; }
.header h1 { font-size: 24px; font-weight: 700; color: #0f172a; }
.back-link { font-size: 13px; color: #64748b; text-decoration: none; transition: color 0.15s; }
.back-link:hover { color: #13b5ea; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Buttons (shared base - also in dashboard.css) */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary { background: #13b5ea; color: white; }
.btn-primary:hover { background: #0ea5e0; }

/* Freshness */
.freshness-indicator { font-size: 12px; color: #64748b; background: #f8fafc; padding: 6px 12px; border-radius: 6px; border: 1px solid #e2e8f0; }
.freshness-fresh { color: #16a34a; border-color: #bbf7d0; background: #f0fdf4; }
.freshness-stale { color: #d97706; border-color: #fde68a; background: #fffbeb; }
.freshness-old { color: #dc2626; border-color: #fecaca; background: #fef2f2; }
.freshness-none { color: #94a3b8; }

/* Tabs */
.tab-nav { display: flex; gap: 2px; background: #e2e8f0; border-radius: 8px; padding: 3px; margin-bottom: 20px; overflow-x: auto; }
.tab-btn { flex: 1; padding: 10px 16px; border: none; background: transparent; border-radius: 6px; font-size: 14px; font-weight: 500; color: #64748b; cursor: pointer; transition: all 0.15s; white-space: nowrap; min-width: 100px; text-align: center; }
.tab-btn:hover { color: #1e293b; background: rgba(255,255,255,0.5); }
.tab-btn.active { background: #fff; color: #13b5ea; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.tab-separator { width: 1px; background: #cbd5e1; margin: 6px 4px; flex-shrink: 0; }
.tab-link { text-decoration: none; color: #64748b; }
.tab-nav + .sub-tab-nav { margin-top: -16px; }
.sub-tab-nav { display: flex; gap: 2px; background: #f1f5f9; border-radius: 8px; padding: 3px; margin-bottom: 20px; margin-left: 24px; overflow-x: auto; }
.sub-tab-nav .tab-btn { flex: 0; padding: 8px 16px; font-size: 13px; min-width: auto; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Loading — simple spinner (kept for non-payroll contexts) */
.loading { text-align: center; padding: 60px 20px; color: #64748b; }
.loading-spinner { width: 32px; height: 32px; border: 3px solid #e2e8f0; border-top-color: #13b5ea; border-radius: 50%; animation: pl-spin 0.8s linear infinite; margin: 0 auto 12px; }

/* Payroll loader — interlocking cogs with Xero messaging */
.payroll-loader { text-align: center; padding: 80px 20px 60px; }
.payroll-loader-cogs { position: relative; width: 120px; height: 120px; margin: 0 auto; }
.payroll-loader-msg { color: #334155; font-size: 16px; font-weight: 600; margin-top: 32px; animation: pl-text-pulse 2s ease-in-out infinite; }
.payroll-loader-sub { color: #94a3b8; font-size: 13px; margin-top: 6px; }
@keyframes pl-text-pulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

/* Cog base */
.pl-cog { position: absolute; border-radius: 50%; }
.pl-cog-lg { width: 80px; height: 80px; top: 0; left: 0; border: 4px solid #13b5ea; animation: pl-spin 3s linear infinite; }
.pl-cog-sm { width: 52px; height: 52px; bottom: 0; right: 0; border: 4px solid #f59e0b; animation: pl-spin-rev 2s linear infinite; }

/* Cog center dot */
.pl-dot { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); border-radius: 50%; }
.pl-cog-lg .pl-dot { width: 14px; height: 14px; background: #13b5ea; }
.pl-cog-sm .pl-dot { width: 10px; height: 10px; background: #f59e0b; }

/* Cog teeth */
.pl-tooth { position: absolute; border-radius: 2px; top: 50%; left: 50%; }
.pl-cog-lg .pl-tooth { width: 10px; height: 20px; background: #13b5ea; }
.pl-cog-sm .pl-tooth { width: 8px; height: 16px; background: #f59e0b; }
.pl-cog-lg .pl-tooth:nth-child(1) { transform: translate(-50%, -50%) rotate(0deg) translateY(-38px); }
.pl-cog-lg .pl-tooth:nth-child(2) { transform: translate(-50%, -50%) rotate(60deg) translateY(-38px); }
.pl-cog-lg .pl-tooth:nth-child(3) { transform: translate(-50%, -50%) rotate(120deg) translateY(-38px); }
.pl-cog-lg .pl-tooth:nth-child(4) { transform: translate(-50%, -50%) rotate(180deg) translateY(-38px); }
.pl-cog-lg .pl-tooth:nth-child(5) { transform: translate(-50%, -50%) rotate(240deg) translateY(-38px); }
.pl-cog-lg .pl-tooth:nth-child(6) { transform: translate(-50%, -50%) rotate(300deg) translateY(-38px); }
.pl-cog-sm .pl-tooth:nth-child(1) { transform: translate(-50%, -50%) rotate(0deg) translateY(-24px); }
.pl-cog-sm .pl-tooth:nth-child(2) { transform: translate(-50%, -50%) rotate(60deg) translateY(-24px); }
.pl-cog-sm .pl-tooth:nth-child(3) { transform: translate(-50%, -50%) rotate(120deg) translateY(-24px); }
.pl-cog-sm .pl-tooth:nth-child(4) { transform: translate(-50%, -50%) rotate(180deg) translateY(-24px); }
.pl-cog-sm .pl-tooth:nth-child(5) { transform: translate(-50%, -50%) rotate(240deg) translateY(-24px); }
.pl-cog-sm .pl-tooth:nth-child(6) { transform: translate(-50%, -50%) rotate(300deg) translateY(-24px); }

@keyframes pl-spin { to { transform: rotate(360deg); } }
@keyframes pl-spin-rev { to { transform: rotate(-360deg); } }
.empty-state { text-align: center; padding: 60px 20px; color: #94a3b8; }

/* KPI Cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card { background: #fff; border-radius: 10px; padding: 16px 20px; border: 1px solid #e2e8f0; }
.kpi-label { font-size: 12px; color: #64748b; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.kpi-value { font-size: 22px; font-weight: 700; color: #0f172a; }
.kpi-sub { font-size: 12px; color: #94a3b8; margin-top: 2px; }

/* Charts */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 20px; margin-bottom: 24px; }
.chart-container { background: #fff; border-radius: 10px; padding: 20px; border: 1px solid #e2e8f0; margin-bottom: 24px; }
.chart-container h3 { font-size: 15px; font-weight: 600; color: #0f172a; margin-bottom: 16px; }
.chart-placeholder { padding: 40px; text-align: center; color: #94a3b8; }

/* Tables */
.table-container { background: #fff; border-radius: 10px; padding: 16px; border: 1px solid #e2e8f0; overflow-x: auto; margin-bottom: 20px; }
.section-title { font-size: 15px; font-weight: 600; color: #0f172a; margin-bottom: 12px; margin-top: 12px; }
.amount-cell { text-align: right !important; }

.simple-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.simple-table th { background: #f8fafc; padding: 8px 12px; text-align: left; font-weight: 600; color: #475569; border-bottom: 2px solid #e2e8f0; }
.simple-table td { padding: 8px 12px; border-bottom: 1px solid #f1f5f9; }

/* Status pills */
.status-pill { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.status-posted, .status-processed { background: #dcfce7; color: #16a34a; }
.status-draft { background: #f1f5f9; color: #64748b; }
.status-active { background: #dcfce7; color: #16a34a; }
.status-terminated { background: #fee2e2; color: #dc2626; }
.status-pending, .status-scheduled { background: #fef3c7; color: #d97706; }
.status-approved, .status-completed { background: #dbeafe; color: #2563eb; }
.status-rejected { background: #fee2e2; color: #dc2626; }

/* Filter badges */
.filter-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.filter-badge { display: inline-block; padding: 4px 12px; border-radius: 16px; font-size: 12px; font-weight: 500; background: #f1f5f9; color: #64748b; cursor: pointer; border: 1px solid #e2e8f0; transition: all 0.15s; }
.filter-badge:hover { background: #e2e8f0; color: #1e293b; }
.filter-badge.active { background: #13b5ea; color: #fff; border-color: #13b5ea; }

/* Clickable rows */
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: #f8fafc; }

/* DataTables overrides */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate { font-size: 13px; color: #64748b; }

table.dataTable thead th { font-size: 12px; font-weight: 600; color: #475569; text-transform: uppercase; letter-spacing: 0.03em; }
table.dataTable tbody td { font-size: 13px; padding: 10px 12px; }

/* Responsive */
@media (max-width: 768px) {
    .container { padding: 12px; }
    .header { flex-direction: column; }
    .header h1 { font-size: 20px; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .chart-grid { grid-template-columns: 1fr; }
    .tab-btn { padding: 6px 12px; font-size: 12px; }
}

@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .kpi-value { font-size: 18px; }
    .payroll-loader-cogs { width: 90px; height: 90px; }
    .pl-cog-lg { width: 60px; height: 60px; }
    .pl-cog-sm { width: 40px; height: 40px; }
    .pl-cog-lg .pl-tooth { width: 8px; height: 16px; }
    .pl-cog-sm .pl-tooth { width: 6px; height: 12px; }
    .pl-cog-lg .pl-tooth:nth-child(1) { transform: translate(-50%, -50%) rotate(0deg) translateY(-28px); }
    .pl-cog-lg .pl-tooth:nth-child(2) { transform: translate(-50%, -50%) rotate(60deg) translateY(-28px); }
    .pl-cog-lg .pl-tooth:nth-child(3) { transform: translate(-50%, -50%) rotate(120deg) translateY(-28px); }
    .pl-cog-lg .pl-tooth:nth-child(4) { transform: translate(-50%, -50%) rotate(180deg) translateY(-28px); }
    .pl-cog-lg .pl-tooth:nth-child(5) { transform: translate(-50%, -50%) rotate(240deg) translateY(-28px); }
    .pl-cog-lg .pl-tooth:nth-child(6) { transform: translate(-50%, -50%) rotate(300deg) translateY(-28px); }
    .pl-cog-sm .pl-tooth:nth-child(1) { transform: translate(-50%, -50%) rotate(0deg) translateY(-18px); }
    .pl-cog-sm .pl-tooth:nth-child(2) { transform: translate(-50%, -50%) rotate(60deg) translateY(-18px); }
    .pl-cog-sm .pl-tooth:nth-child(3) { transform: translate(-50%, -50%) rotate(120deg) translateY(-18px); }
    .pl-cog-sm .pl-tooth:nth-child(4) { transform: translate(-50%, -50%) rotate(180deg) translateY(-18px); }
    .pl-cog-sm .pl-tooth:nth-child(5) { transform: translate(-50%, -50%) rotate(240deg) translateY(-18px); }
    .pl-cog-sm .pl-tooth:nth-child(6) { transform: translate(-50%, -50%) rotate(300deg) translateY(-18px); }
}

/* New Pay Run Tab */
.newpayrun-calendar-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 20px;
}

.newpayrun-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.newpayrun-card-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.newpayrun-emp-count {
    font-size: 13px;
    color: #64748b;
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 12px;
}

.newpayrun-period-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.newpayrun-period-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 4px;
}

.newpayrun-period-dates {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
}

.newpayrun-payment-date {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}

.newpayrun-action {
    margin-bottom: 28px;
}

.newpayrun-create-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 20px 28px;
    background: #f0fdf4;
    border: 2px dashed #86efac;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.newpayrun-create-btn:hover {
    background: #dcfce7;
    border-color: #22c55e;
}

/* Draft pay run banner */
.newpayrun-draft-banner {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 12px;
}
.newpayrun-draft-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #ea580c;
    margin-bottom: 4px;
}
.newpayrun-draft-period {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}
.newpayrun-draft-info {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

/* Continue draft button */
.newpayrun-draft-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px 28px;
    background: #ea580c;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-decoration: none;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}
.newpayrun-draft-btn:hover {
    background: #c2410c;
}
.newpayrun-draft-btn:visited { color: #fff; }
.newpayrun-draft-btn .newpayrun-btn-text { color: #fff; }

/* Split action row (continue + delete) */
.newpayrun-action-split {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.newpayrun-action-split .newpayrun-draft-btn {
    flex: 1;
}

/* Delete draft button on new pay run tab */
.newpayrun-delete-btn {
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 600;
    background: #fff;
    color: #dc2626;
    border: 1px solid #fca5a5;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.newpayrun-delete-btn:hover { background: #fef2f2; border-color: #dc2626; }

.newpayrun-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #22c55e;
    color: #fff;
    border-radius: 50%;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    flex-shrink: 0;
}

.newpayrun-btn-text {
    font-size: 18px;
    font-weight: 600;
    color: #15803d;
}

.newpayrun-last-run {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

.newpayrun-last-header {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 10px;
}

.newpayrun-last-period {
    font-size: 15px;
    font-weight: 600;
    color: #334155;
}

.newpayrun-last-status {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}

.newpayrun-last-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.newpayrun-last-kpi {
    background: #f8fafc;
    border-radius: 8px;
    padding: 10px 14px;
}

.newpayrun-last-kpi-label {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.newpayrun-last-kpi-value {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 2px;
}

.newpayrun-net {
    color: #16a34a;
}

@media (max-width: 640px) {
    .newpayrun-last-kpis { grid-template-columns: repeat(2, 1fr); }
    .newpayrun-period-dates { font-size: 15px; }
    .newpayrun-create-btn { padding: 16px 20px; }
    .newpayrun-plus { width: 40px; height: 40px; font-size: 24px; }
    .newpayrun-btn-text { font-size: 16px; }
}

/* Refresh Banner */
.xero-refresh-banner { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; border-radius: 8px; margin: 0; }
.xero-refresh-banner.xrb-visible { max-height: 80px; margin: 0 0 12px 0; }
.xrb-inner { display: flex; align-items: center; gap: 14px; padding: 14px 20px; min-height: 56px; border-radius: 8px; }
.xrb-icon { font-size: 22px; flex-shrink: 0; width: 32px; text-align: center; }
.xrb-body { flex: 1; min-width: 0; }
.xrb-title { font-size: 15px; font-weight: 600; line-height: 1.3; }
.xrb-step { font-size: 13px; opacity: 0.85; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xrb-progress { flex-shrink: 0; width: 180px; }
.xrb-bar { height: 8px; background: rgba(255,255,255,0.3); border-radius: 4px; overflow: hidden; }
.xrb-fill { height: 100%; border-radius: 4px; transition: width 0.5s; width: 0; background: rgba(255,255,255,0.8); }
.xrb-dismiss { flex-shrink: 0; background: none; border: none; font-size: 22px; cursor: pointer; opacity: 0.6; padding: 4px 8px; line-height: 1; color: inherit; }
.xrb-dismiss:hover { opacity: 1; }
.xrb-running .xrb-inner { background: linear-gradient(135deg, #0369a1, #0ea5e9); color: white; }
.xrb-running .xrb-icon { animation: xrb-spin 1.2s linear infinite; }
@keyframes xrb-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.xrb-complete .xrb-inner { background: linear-gradient(135deg, #15803d, #22c55e); color: white; }
.xrb-complete .xrb-fill { background: rgba(255,255,255,0.5); }
.xrb-failed .xrb-inner { background: linear-gradient(135deg, #991b1b, #dc2626); color: white; }
.xrb-failed .xrb-fill { background: rgba(255,255,255,0.3); }
@media (max-width: 600px) { .xrb-progress { display: none; } .xrb-step { white-space: normal; } }

/* TOIL Tracking Cards */
.toil-tracking-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.toil-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; min-width: 150px; flex: 1; text-align: center; }
.toil-card-name { font-weight: 600; font-size: 14px; color: #0f172a; margin-bottom: 8px; }
.toil-card-balance { font-size: 28px; font-weight: 700; color: #f59e0b; }
.toil-card-label { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }
.toil-card-sub { font-size: 12px; color: #94a3b8; margin-top: 4px; }

/* Stale Data Warning Banner */
.stale-data-banner { background: #fef3cd; border: 1px solid #ffc107; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; color: #856404; font-size: 14px; }
.stale-data-icon { font-size: 16px; margin-right: 4px; }

/* Draft Alert Banner */
.draft-alert-banner { background: #e3f2fd; border: 1px solid #2196f3; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; color: #0d47a1; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.draft-alert-icon { font-size: 16px; }
.draft-alert-link { color: #1565c0; font-weight: 600; text-decoration: none; margin-left: auto; }
.draft-alert-link:hover { text-decoration: underline; }

/* Leave Balance Warnings */
.leave-warning-banner { background: #fff3e0; border: 1px solid #ff9800; border-radius: 8px; padding: 16px; margin-bottom: 20px; }
.leave-warning-title { color: #e65100; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.leave-warning-list { display: flex; flex-direction: column; gap: 6px; }
.leave-warning-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; background: rgba(255,152,0,0.08); border-radius: 4px; }
.leave-warning-name { font-weight: 600; color: #bf360c; font-size: 13px; }
.leave-warning-detail { color: #e65100; font-size: 13px; }

/* Bulk Leave Action Bar */
.bulk-action-bar { display: flex; align-items: center; gap: 12px; background: #e8f5e9; border: 1px solid #4caf50; border-radius: 8px; padding: 10px 16px; margin-bottom: 12px; }
.bulk-action-bar span { font-weight: 600; color: #2e7d32; font-size: 13px; }
.bulk-check-col { width: 30px; text-align: center; }

/* Audit Log */
.audit-filter-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.audit-filter-bar select { padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 13px; background: #fff; }
.audit-filter-bar input { padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 13px; flex: 1; min-width: 150px; }
.audit-count { font-size: 12px; color: #64748b; margin-left: auto; }
.audit-log-table { font-size: 13px; }
.audit-timestamp { font-family: monospace; font-size: 12px; color: #64748b; white-space: nowrap; }
.audit-action-badge { display: inline-block; background: #e2e8f0; color: #334155; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-family: monospace; }
.audit-target-id { font-family: monospace; font-size: 11px; color: #94a3b8; }
.audit-detail { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: #64748b; }
.audit-pagination { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 12px; }
.audit-page-info { font-size: 12px; color: #64748b; }

/* ===== Dark Mode ===== */
[data-theme="dark"] body { background: #0f172a; color: #e2e8f0; }
[data-theme="dark"] .header h1 { color: #f1f5f9; }

[data-theme="dark"] .btn-primary { background: #38bdf8; color: #0c4a6e; }
[data-theme="dark"] .btn-primary:hover { background: #7dd3fc; }

[data-theme="dark"] .freshness-indicator { background: #1e293b; border-color: #334155; color: #94a3b8; }
[data-theme="dark"] .freshness-fresh { color: #4ade80; border-color: #14532d; background: #052e16; }
[data-theme="dark"] .freshness-stale { color: #fbbf24; border-color: #422006; background: #1c1a05; }
[data-theme="dark"] .freshness-old { color: #f87171; border-color: #450a0a; background: #2a0a0a; }

[data-theme="dark"] .tab-nav { background: #1e293b; }
[data-theme="dark"] .tab-btn { color: #94a3b8; }
[data-theme="dark"] .tab-btn:hover { color: #e2e8f0; background: rgba(255,255,255,0.05); }
[data-theme="dark"] .tab-btn.active { background: #334155; color: #38bdf8; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
[data-theme="dark"] .sub-tab-nav { background: #0f172a; }

[data-theme="dark"] .kpi-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .kpi-label { color: #94a3b8; }
[data-theme="dark"] .kpi-value { color: #f1f5f9; }
[data-theme="dark"] .kpi-sub { color: #64748b; }

[data-theme="dark"] .chart-container { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .chart-container h3 { color: #f1f5f9; }
[data-theme="dark"] .chart-placeholder { color: #64748b; }

[data-theme="dark"] .table-container { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .section-title { color: #f1f5f9; }

[data-theme="dark"] .simple-table th { background: #0f172a; color: #94a3b8; border-bottom-color: #334155; }
[data-theme="dark"] .simple-table td { border-bottom-color: #1e293b; color: #e2e8f0; }

[data-theme="dark"] .status-posted, [data-theme="dark"] .status-processed { background: #14532d; color: #4ade80; }
[data-theme="dark"] .status-draft { background: #334155; color: #94a3b8; }
[data-theme="dark"] .status-active { background: #14532d; color: #4ade80; }
[data-theme="dark"] .status-terminated { background: #450a0a; color: #f87171; }
[data-theme="dark"] .status-pending, [data-theme="dark"] .status-scheduled { background: #422006; color: #fbbf24; }
[data-theme="dark"] .status-approved, [data-theme="dark"] .status-completed { background: #1e3a5f; color: #60a5fa; }
[data-theme="dark"] .status-rejected { background: #450a0a; color: #f87171; }

[data-theme="dark"] .filter-badge { background: #334155; color: #94a3b8; border-color: #475569; }
[data-theme="dark"] .filter-badge:hover { background: #475569; color: #e2e8f0; }
[data-theme="dark"] .filter-badge.active { background: #13b5ea; color: #fff; border-color: #13b5ea; }

[data-theme="dark"] .clickable-row:hover td { background: #334155 !important; }

[data-theme="dark"] table.dataTable thead th { color: #94a3b8; border-bottom-color: #334155 !important; }
[data-theme="dark"] table.dataTable tbody td { color: #e2e8f0; border-bottom-color: #1e293b !important; }
[data-theme="dark"] table.dataTable tbody tr { background: #1e293b; }
[data-theme="dark"] table.dataTable tbody tr:hover { background: #334155 !important; }
[data-theme="dark"] table.dataTable.stripe tbody tr.odd { background: #1e293b; }
[data-theme="dark"] table.dataTable.stripe tbody tr.even { background: #162033; }

[data-theme="dark"] .dataTables_wrapper .dataTables_length,
[data-theme="dark"] .dataTables_wrapper .dataTables_filter,
[data-theme="dark"] .dataTables_wrapper .dataTables_info,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate { color: #94a3b8; }

[data-theme="dark"] .dataTables_wrapper .dataTables_filter input,
[data-theme="dark"] .dataTables_wrapper .dataTables_length select { background: #0f172a; border-color: #334155; color: #e2e8f0; }

[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button { color: #94a3b8 !important; }
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current { background: #334155 !important; border-color: #475569 !important; color: #f1f5f9 !important; }

[data-theme="dark"] .tab-separator { background: #475569; }
[data-theme="dark"] .tab-link { color: #94a3b8; }

[data-theme="dark"] .newpayrun-calendar-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .newpayrun-card-header h3 { color: #f1f5f9; }
[data-theme="dark"] .newpayrun-emp-count { background: #334155; color: #94a3b8; }
[data-theme="dark"] .newpayrun-period-info { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .newpayrun-period-label { color: #94a3b8; }
[data-theme="dark"] .newpayrun-period-dates { color: #f1f5f9; }
[data-theme="dark"] .newpayrun-payment-date { color: #64748b; }
[data-theme="dark"] .newpayrun-create-btn { background: #14532d33; border-color: #166534; }
[data-theme="dark"] .newpayrun-create-btn:hover { background: #14532d66; border-color: #22c55e; }
[data-theme="dark"] .newpayrun-draft-banner { background: #431407; border-color: #9a3412; }
[data-theme="dark"] .newpayrun-draft-label { color: #fb923c; }
[data-theme="dark"] .newpayrun-draft-period { color: #f1f5f9; }
[data-theme="dark"] .newpayrun-draft-info { color: #94a3b8; }
[data-theme="dark"] .newpayrun-draft-btn { background: #ea580c; }
[data-theme="dark"] .newpayrun-draft-btn:hover { background: #c2410c; }
[data-theme="dark"] .newpayrun-delete-btn { background: #1e293b; color: #f87171; border-color: #7f1d1d; }
[data-theme="dark"] .newpayrun-delete-btn:hover { background: #450a0a; border-color: #dc2626; }
[data-theme="dark"] .newpayrun-plus { background: #16a34a; }
[data-theme="dark"] .newpayrun-btn-text { color: #4ade80; }
[data-theme="dark"] .newpayrun-draft-btn .newpayrun-btn-text { color: #fff; }
[data-theme="dark"] .newpayrun-last-run { border-top-color: #334155; }
[data-theme="dark"] .newpayrun-last-header { color: #94a3b8; }
[data-theme="dark"] .newpayrun-last-period { color: #e2e8f0; }
[data-theme="dark"] .newpayrun-last-status { color: #94a3b8; }
[data-theme="dark"] .newpayrun-last-kpi { background: #0f172a; }
[data-theme="dark"] .newpayrun-last-kpi-label { color: #94a3b8; }
[data-theme="dark"] .newpayrun-last-kpi-value { color: #f1f5f9; }
[data-theme="dark"] .newpayrun-net { color: #4ade80; }

[data-theme="dark"] .xrb-running .xrb-inner { background: linear-gradient(135deg, #0c4a6e, #075985); }
[data-theme="dark"] .xrb-complete .xrb-inner { background: linear-gradient(135deg, #14532d, #166534); }
[data-theme="dark"] .xrb-failed .xrb-inner { background: linear-gradient(135deg, #7f1d1d, #991b1b); }

[data-theme="dark"] .stale-data-banner { background: #422006; border-color: #92400e; color: #fbbf24; }
[data-theme="dark"] .draft-alert-banner { background: #0c4a6e; border-color: #0369a1; color: #7dd3fc; }
[data-theme="dark"] .draft-alert-link { color: #38bdf8; }
[data-theme="dark"] .leave-warning-banner { background: #431407; border-color: #9a3412; }
[data-theme="dark"] .leave-warning-title { color: #fb923c; }
[data-theme="dark"] .leave-warning-item { background: rgba(251,146,60,0.1); }
[data-theme="dark"] .leave-warning-name { color: #fb923c; }
[data-theme="dark"] .leave-warning-detail { color: #fdba74; }
[data-theme="dark"] .bulk-action-bar { background: #052e16; border-color: #166534; }
[data-theme="dark"] .bulk-action-bar span { color: #4ade80; }
[data-theme="dark"] .audit-filter-bar select { background: #1e293b; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .audit-filter-bar input { background: #1e293b; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .audit-action-badge { background: #334155; color: #94a3b8; }
[data-theme="dark"] .audit-timestamp { color: #94a3b8; }
[data-theme="dark"] .audit-detail { color: #94a3b8; }
[data-theme="dark"] .toil-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .toil-card-name { color: #f1f5f9; }
[data-theme="dark"] .toil-card-balance { color: #fbbf24; }
[data-theme="dark"] .payroll-loader-msg { color: #e2e8f0; }
[data-theme="dark"] .payroll-loader-sub { color: #64748b; }
[data-theme="dark"] .pl-cog-lg { border-color: #38bdf8; }
[data-theme="dark"] .pl-cog-sm { border-color: #fbbf24; }
[data-theme="dark"] .pl-cog-lg .pl-dot { background: #38bdf8; }
[data-theme="dark"] .pl-cog-sm .pl-dot { background: #fbbf24; }
[data-theme="dark"] .pl-cog-lg .pl-tooth { background: #38bdf8; }
[data-theme="dark"] .pl-cog-sm .pl-tooth { background: #fbbf24; }
