/* Dashboard styles for Optus Bill Monitoring - Corporate Theme */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f4f6f9;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

/* Supplier Tabs */
.supplier-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 4px;
}
.supplier-tab {
    padding: 6px 20px;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    background: #f7fafc;
    color: #718096;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 6px 6px 0 0;
    transition: background 0.15s, color 0.15s;
    margin-right: -1px;
}
.supplier-tab:hover {
    background: #edf2f7;
    color: #2d3748;
}
.supplier-tab.active {
    background: #fff;
    color: #3182ce;
    border-bottom-color: #fff;
    position: relative;
    z-index: 1;
}

/* Holder note in Job/Notes column */
.holder-note {
    color: #718096;
    font-style: italic;
    font-size: 12px;
}

/* Header / Tabs */
.header {
    background: #ffffff;
    color: #2d3748;
    padding: 10px 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.header h1 {
    font-size: 1.2em;
    margin-bottom: 6px;
    font-weight: 700;
    color: #1a365d;
}

/* Single nav row: month | tabs ... | tally | action buttons */
.nav-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    border-bottom: 2px solid #e2e8f0;
}
.nav-left {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}
.nav-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    padding-bottom: 6px;
}

.tabs {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
}
.tab {
    padding: 8px 18px 6px;
    background: transparent;
    color: #718096;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: #2d3748; border-bottom-color: #cbd5e0; }
.tab.active { color: #3182ce; font-weight: 600; border-bottom-color: #3182ce; }

/* Month selector */
.month-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding-bottom: 6px;
}
.month-selector label {
    font-size: 12px;
    color: #718096;
    font-weight: 600;
}
.month-selector select {
    padding: 5px 10px;
    background: #fff;
    color: #2d3748;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}
.month-selector select:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 2px rgba(49,130,206,0.15);
}
.trends-toggle {
    padding: 5px 14px;
    background: #edf2f7;
    color: #718096;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.trends-toggle:hover {
    background: #e2e8f0;
    color: #2d3748;
}
.trends-toggle.active {
    background: #3182ce;
    color: #fff;
    border-color: #3182ce;
}

/* Process Bills button */
.process-btn {
    background: #f0fff4 !important;
    color: #276749 !important;
    border-color: #9ae6b4 !important;
}
.process-btn:hover {
    background: #c6f6d5 !important;
    color: #22543d !important;
}
.process-btn.processing {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

/* Process overlay */
.process-overlay-content {
    max-width: 640px;
    text-align: left;
}
.process-overlay-content h2 {
    margin-bottom: 16px;
    font-size: 1.2em;
    color: #1a365d;
}
.process-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e2e8f0;
    border-top-color: #3182ce;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.process-result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 13px;
}
.process-result-table th,
.process-result-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}
.process-result-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #4a5568;
    font-size: 11px;
    text-transform: uppercase;
}
.process-result-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.process-new-badge {
    display: inline-block;
    background: #c6f6d5;
    color: #276749;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 600;
    margin-left: 4px;
}
.process-new-row {
    background: #f0fff4;
}
.process-error {
    color: #e53e3e;
    font-weight: 600;
}
.process-success {
    color: #38a169;
    font-weight: 600;
}

/* Tab total (billing amount inside tab buttons) */
.tab-total {
    display: block;
    font-size: 10px;
    font-weight: 400;
    color: #a0aec0;
    line-height: 1.2;
}
.tab.active .tab-total { color: #63b3ed; }
.tab:hover .tab-total { color: #718096; }

/* Status Tally Bar */
.status-tally {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
    padding-bottom: 6px;
}
.tally-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.tally-total { background: #e2e8f0; color: #2d3748; }
.tally-active { background: #c6f6d5; color: #22543d; }
.tally-idle { background: #feebc8; color: #7b341e; }
.tally-sub { font-weight: 400; opacity: 0.75; font-size: 11px; }

/* Filters */
.filters {
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
}
.filters select, .filters input {
    padding: 6px 10px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
}
.filters select:focus, .filters input:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 2px rgba(49,130,206,0.15);
}
.filters label {
    font-size: 12px;
    color: #718096;
    font-weight: 600;
}
.filter-right {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Status filter toggles */
.status-toggles {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.status-toggle {
    padding: 4px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    background: #f7fafc;
    color: #718096;
    transition: all 0.15s;
}
.status-toggle:hover { border-color: #a0aec0; }
.status-toggle-active.active { background: #c6f6d5; color: #22543d; border-color: #9ae6b4; }
.status-toggle-device.active { background: #e6ffec; color: #276749; border-color: #9ae6b4; }
.status-toggle-transfer.active { background: #fefcbf; color: #744210; border-color: #f6e05e; }
.status-toggle-idle-office.active { background: #d4edda; color: #2d3748; border-color: #a3cfbb; }
.status-toggle-idle-field.active { background: #feebc8; color: #7b341e; border-color: #f6ad55; }
.status-toggle-missing.active { background: #fed7d7; color: #9b2c2c; border-color: #fc8181; }
.status-toggle-inactive.active { background: #edf2f7; color: #718096; border-color: #cbd5e0; }

/* Main content */
.content {
    padding: 16px 20px;
}

/* DataTables overrides */
.dataTables_wrapper {
    background: #fff;
    border-radius: 6px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.dataTables_filter { margin-bottom: 10px; }
.dataTables_filter input {
    padding: 6px 10px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 13px;
}
.dataTables_length select {
    padding: 4px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
}
table.dataTable { width: 100% !important; border-collapse: collapse; }
table.dataTable thead th {
    background: #f7fafc;
    color: #2d3748;
    padding: 8px 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 700;
}
table.dataTable tbody td {
    padding: 6px 10px;
    font-size: 13px;
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle;
}
table.dataTable tbody tr { cursor: pointer; transition: background 0.15s; }
table.dataTable tbody tr:hover { background: #ebf4ff !important; }

/* Status colors - row backgrounds */
tr.status-active { background-color: #c6f6d5 !important; }
tr.status-active td { color: #22543d; }
tr.status-device { background-color: #e6ffec !important; }
tr.status-device td { color: #2d3748; }
tr.status-transfer { background-color: #fefcbf !important; }
tr.status-transfer td { color: #744210; }
tr.status-idle-office { background-color: #d4edda !important; }
tr.status-idle-office td { color: #2d3748; }
tr.status-idle-field { background-color: #feebc8 !important; }
tr.status-idle-field td { color: #7b341e; }
tr.status-missing { background-color: #fed7d7 !important; }
tr.status-missing td { color: #9b2c2c; }
tr.status-inactive { background-color: #f7fafc !important; color: #a0aec0; }
tr.status-inactive td { color: #a0aec0; }

/* Status badge for column */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-active { background: #c6f6d5; color: #22543d; }
.badge-device { background: #e6ffec; color: #276749; }
.badge-transfer { background: #fefcbf; color: #744210; }
.badge-idle-office { background: #d4edda; color: #2d3748; }
.badge-idle-field { background: #feebc8; color: #7b341e; }
.badge-missing { background: #fed7d7; color: #9b2c2c; }
.badge-inactive { background: #edf2f7; color: #a0aec0; }

/* Service detail overlay */
.overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.overlay.active { display: flex; }
.overlay-content {
    background: #f7fafc;
    border-radius: 10px;
    max-width: 960px;
    width: 94%;
    max-height: 96vh;
    overflow-y: auto;
    padding: 20px 28px;
    position: relative;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
.overlay-close {
    position: absolute;
    top: 12px; right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #a0aec0;
    line-height: 1;
    z-index: 1;
}
.overlay-close:hover { color: #2d3748; }
.overlay-content h2 {
    font-size: 1.3em;
    margin-bottom: 2px;
    color: #1a365d;
}
.overlay-content .meta {
    font-size: 12px;
    color: #a0aec0;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

/* Section blocks with colored backgrounds */
.overlay-section {
    background: #fff;
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 8px;
    border: 1px solid #e2e8f0;
}
.overlay-section.section-service { border-left: 4px solid #3182ce; }
.overlay-section.section-contract { border-left: 4px solid #d69e2e; }
.overlay-section.section-assignment { border-left: 4px solid #38a169; }
.overlay-section.section-notes { border-left: 4px solid #805ad5; }
.overlay-section.section-plan { border-left: 4px solid #718096; }
.overlay-section.section-charges { border-left: 4px solid #e53e3e; }
.overlay-section.section-history { border-left: 4px solid #3182ce; }

.overlay-content .section-title {
    font-weight: 700;
    font-size: 11px;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 6px 0;
    padding: 0;
    border-bottom: none;
}
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px 16px;
}
.detail-item .dlabel {
    font-size: 10px;
    color: #a0aec0;
    text-transform: uppercase;
    line-height: 1.3;
}
.detail-item .dvalue {
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.charge-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 4px;
}
.charge-table th, .charge-table td {
    padding: 5px 8px;
    text-align: left;
    font-size: 12px;
    border-bottom: 1px solid #edf2f7;
}
.charge-table th { color: #718096; font-weight: 600; background: #f7fafc; }
.charge-table .amount { text-align: right; font-family: monospace; }
.charge-table .credit { color: #38a169; }

/* Notes editing in overlay */
.notes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}
.notes-field label {
    display: block;
    font-size: 10px;
    color: #a0aec0;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 3px;
}
.notes-field input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
}
.notes-field input:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 2px rgba(49,130,206,0.15);
}
.notes-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.notes-save-btn {
    padding: 6px 20px;
    background: #3182ce;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}
.notes-save-btn:hover { background: #2c5282; }
.notes-save-btn:disabled { background: #a0aec0; cursor: default; }
.notes-save-status {
    font-size: 11px;
    color: #38a169;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
}
.loading-spinner {
    display: inline-block;
    width: 40px; height: 40px;
    border: 3px solid #edf2f7;
    border-top-color: #3182ce;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 768px) {
    .summary-bar { flex-direction: column; }
    .summary-card { min-width: auto; }
    .filters { flex-direction: column; align-items: stretch; }
    .filter-right { flex-direction: column; align-items: stretch; }
    .status-toggles { gap: 3px; }
    .status-toggle { font-size: 10px; padding: 3px 7px; }
    .header h1 { font-size: 1em; }
    .nav-row { flex-direction: column; align-items: stretch; }
    .nav-left { flex-direction: column; }
    .nav-actions { justify-content: flex-start; flex-wrap: wrap; }
    .tab { padding: 5px 10px; font-size: 12px; }
    .content { padding: 10px; }
    table.dataTable thead th { font-size: 11px; padding: 6px 6px; }
    table.dataTable tbody td { font-size: 12px; padding: 4px 6px; }
    .dataTables_wrapper { padding: 8px; overflow-x: auto; }
    .detail-grid { grid-template-columns: 1fr; }
    .overlay-content { padding: 16px; width: 95%; max-width: none; }
    .overlay-nav { right: 44px; }
    .notes-grid { grid-template-columns: 1fr; }
    .supplier-tabs { flex-wrap: wrap; }
}

/* Camera column */
table.dataTable td.camera-cell,
table.history-dt td.camera-cell {
    font-size: 12px;
    color: #4a5568;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Camera image last-modified time */
.image-time {
    font-size: 11px;
    color: #a0aec0;
    line-height: 1.2;
}

/* Mobile last-ping time (when camera last updated the mobile mapping) */
.ping-time {
    font-size: 11px;
    color: #e53e3e;
    line-height: 1.2;
}
.ping-time-recent {
    color: #38a169;
    font-weight: 700;
}

/* Contract status badges */
.badge-contract-out {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    background: #c6f6d5;
    color: #22543d;
}
.badge-contract-active {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    background: #fed7d7;
    color: #9b2c2c;
}
.badge-contract-expiring {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    background: #fefcbf;
    color: #744210;
}
.badge-contract-na {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    background: #edf2f7;
    color: #a0aec0;
}

/* Service history in detail overlay */
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}
.history-table th, .history-table td {
    padding: 4px 8px;
    text-align: left;
    font-size: 12px;
    border-bottom: 1px solid #edf2f7;
}
.history-table th {
    color: #718096;
    font-weight: 600;
}
.history-table td.amount {
    text-align: right;
    font-family: monospace;
}

/* History view - usage tables */
.history-view {
    padding: 16px 20px;
}
.history-account-section {
    margin-bottom: 24px;
}
.history-account-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #3182ce;
}
.history-account-header h2 {
    font-size: 1.1em;
    color: #1a365d;
    font-weight: 700;
}
.history-account-header .acct-meta {
    font-size: 12px;
    color: #a0aec0;
}
.history-table-wrap {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow-x: auto;
    border: 1px solid #e2e8f0;
}
.history-table-wrap .dataTables_wrapper {
    padding: 8px 12px;
}
/* Data usage cells */
table.history-dt tbody td.data-cell {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    text-align: right;
    white-space: nowrap;
    padding: 4px 8px;
}
/* Cost cells in history table */
table.history-dt tbody td.cost-cell {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    text-align: right;
    white-space: nowrap;
    padding: 4px 8px;
    color: #4a5568;
}
table.history-dt thead th {
    background: #f7fafc;
    color: #2d3748;
    padding: 6px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 700;
}
table.history-dt tbody td {
    padding: 4px 8px;
    font-size: 12px;
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle;
}
table.history-dt tbody tr { cursor: pointer; transition: background 0.15s; }
table.history-dt tbody tr:hover { background: #ebf4ff !important; }
/* Trend arrow indicators */
.trend-up { color: #e53e3e; font-weight: 700; }
.trend-down { color: #38a169; font-weight: 700; }
.trend-flat { color: #a0aec0; }
.trend-new { color: #3182ce; font-style: italic; }
/* Data change highlighting */
.data-cell.usage-high { background: #fff5f5; }
.data-cell.usage-zero { color: #cbd5e0; }
.history-search {
    display: flex;
    gap: 10px;
    padding: 0 20px 12px 20px;
    align-items: center;
}
.history-search label {
    font-size: 12px;
    color: #718096;
    font-weight: 600;
}
.history-search input {
    padding: 6px 10px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    width: 250px;
}
.history-search input:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 2px rgba(49,130,206,0.15);
}

/* Toggle switch for Keep/Cancel in history table */
.sim-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}
.sim-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.sim-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e0;
    transition: background-color 0.2s;
    border-radius: 20px;
}
.sim-toggle-slider:before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    transition: transform 0.2s;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.sim-toggle input:checked + .sim-toggle-slider {
    background-color: #38a169;
}
.sim-toggle input:checked + .sim-toggle-slider:before {
    transform: translateX(16px);
}

/* Toggle cell in history table */
.toggle-cell {
    text-align: center !important;
    padding: 4px 6px !important;
    width: 50px !important;
}

/* Deactivated row in history table */
@keyframes deactivated-glow {
    0%, 100% { box-shadow: inset 0 2px 0 0 rgba(229, 62, 62, 0.7), inset 0 -2px 0 0 rgba(229, 62, 62, 0.7); }
    50% { box-shadow: inset 0 2px 0 0 rgba(229, 62, 62, 0.1), inset 0 -2px 0 0 rgba(229, 62, 62, 0.1); }
}
tr.sim-deactivated {
    background: repeating-linear-gradient(
        -45deg,
        #fff5f5,
        #fff5f5 6px,
        #ffe0e0 6px,
        #ffe0e0 7px
    ) !important;
}
tr.sim-deactivated td {
    color: #9b2c2c !important;
    animation: deactivated-glow 1.5s ease-in-out infinite;
}
tr.sim-deactivated td.toggle-cell {
    text-decoration: none;
}
tr.sim-deactivated .sim-toggle-slider {
    background-color: #e2e8f0;
}

/* Lightbox header row with toggle */
.overlay-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.overlay-header-row h2 {
    margin: 0;
}
.lightbox-toggle {
    flex-shrink: 0;
}

/* Overlay prev/next navigation */
.overlay-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    top: 14px;
    right: 52px;
}
.overlay-nav-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    background: #f7fafc;
    color: #4a5568;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-family: inherit;
}
.overlay-nav-btn:hover {
    background: #edf2f7;
    border-color: #a0aec0;
    color: #2d3748;
}
.overlay-nav-pos {
    font-size: 11px;
    color: #a0aec0;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

@media (max-width: 768px) {
    .month-selector { flex-wrap: wrap; }
    .trends-toggle { margin-left: 0; margin-top: 4px; }
    .history-view { padding: 10px; }
    .history-account-header { flex-direction: column; gap: 2px; }
    table.history-dt thead th { font-size: 10px; padding: 4px 4px; }
    table.history-dt tbody td { font-size: 11px; padding: 3px 4px; }
    .history-search input { width: 100%; }
}

/* =============================================
   DARK MODE
   ============================================= */
/* Dark mode: Supplier Tabs */
[data-theme="dark"] .supplier-tab {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}
[data-theme="dark"] .supplier-tab:hover {
    background: #334155;
    color: #e2e8f0;
}
[data-theme="dark"] .supplier-tab.active {
    background: #0f172a;
    color: #60a5fa;
    border-bottom-color: #0f172a;
}
[data-theme="dark"] .holder-note {
    color: #94a3b8;
}

[data-theme="dark"] body {
    background: #0f172a;
    color: #e2e8f0;
}

[data-theme="dark"] .header {
    color: #e2e8f0;
}

[data-theme="dark"] .header h1 {
    color: #e2e8f0;
}

[data-theme="dark"] .tab-total {
    color: #64748b;
}
[data-theme="dark"] .tab.active .tab-total {
    color: #93c5fd;
}

[data-theme="dark"] .nav-row {
    border-bottom-color: #334155;
}

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

[data-theme="dark"] .tab:hover {
    color: #e2e8f0;
    border-bottom-color: #475569;
}

[data-theme="dark"] .tab.active {
    color: #60a5fa;
    border-bottom-color: #60a5fa;
}

[data-theme="dark"] table.dataTable {
    border-color: #334155;
}

[data-theme="dark"] table.dataTable thead th {
    background: #0f172a;
    color: #94a3b8;
    border-bottom-color: #334155;
}

[data-theme="dark"] table.dataTable tbody td {
    background: #1e293b;
    color: #e2e8f0;
    border-bottom-color: #334155;
}

[data-theme="dark"] table.dataTable tbody tr:hover td {
    background: #334155 !important;
}

[data-theme="dark"] table.dataTable tbody tr.status-green td {
    background: rgba(74, 222, 128, 0.08);
}

[data-theme="dark"] table.dataTable tbody tr.status-yellow td {
    background: rgba(251, 191, 36, 0.08);
}

[data-theme="dark"] table.dataTable tbody tr.status-orange td {
    background: rgba(251, 146, 60, 0.08);
}

[data-theme="dark"] table.dataTable tbody tr.status-red td {
    background: rgba(248, 113, 113, 0.08);
}

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

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

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

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

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

[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #3b82f6 !important;
    color: #ffffff !important;
    border-color: #3b82f6;
}

[data-theme="dark"] .overlay-content {
    background: #1e293b;
    color: #e2e8f0;
}

[data-theme="dark"] .overlay-section {
    background: #0f172a;
    border-color: #334155;
}

[data-theme="dark"] .badge-active {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}

[data-theme="dark"] .badge-dormant {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

[data-theme="dark"] .badge-suspended {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}


[data-theme="dark"] .nav-row a {
    color: #60a5fa;
}

[data-theme="dark"] .nav-row a:hover {
    color: #93c5fd;
}

[data-theme="dark"] .process-btn {
    background: rgba(74, 222, 128, 0.1) !important;
    color: #4ade80 !important;
    border-color: #166534 !important;
}
[data-theme="dark"] .process-btn:hover {
    background: rgba(74, 222, 128, 0.2) !important;
    color: #86efac !important;
}
[data-theme="dark"] .process-overlay-content h2 {
    color: #e2e8f0;
}
[data-theme="dark"] .process-result-table th {
    background: #1e293b;
    color: #94a3b8;
}
[data-theme="dark"] .process-result-table td {
    border-color: #334155;
}
[data-theme="dark"] .process-result-table th {
    border-color: #334155;
}
[data-theme="dark"] .process-new-badge {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}
[data-theme="dark"] .process-spinner {
    border-color: #334155;
    border-top-color: #60a5fa;
}
[data-theme="dark"] .process-new-row {
    background: rgba(74, 222, 128, 0.08);
}

/* Dark mode: Status Tally Bar */
[data-theme="dark"] .tally-total { background: #334155; color: #e2e8f0; }
[data-theme="dark"] .tally-active { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
[data-theme="dark"] .tally-idle { background: rgba(251, 146, 60, 0.15); color: #fb923c; }

/* Dark mode: Status Filter Toggles */
[data-theme="dark"] .status-toggle {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}
[data-theme="dark"] .status-toggle:hover { border-color: #475569; color: #e2e8f0; }
[data-theme="dark"] .status-toggle-active.active { background: rgba(74, 222, 128, 0.15); color: #4ade80; border-color: #166534; }
[data-theme="dark"] .status-toggle-device.active { background: rgba(74, 222, 128, 0.1); color: #86efac; border-color: #166534; }
[data-theme="dark"] .status-toggle-transfer.active { background: rgba(251, 191, 36, 0.15); color: #fbbf24; border-color: #854d0e; }
[data-theme="dark"] .status-toggle-idle-office.active { background: rgba(74, 222, 128, 0.1); color: #86efac; border-color: #166534; }
[data-theme="dark"] .status-toggle-idle-field.active { background: rgba(251, 146, 60, 0.15); color: #fb923c; border-color: #9a3412; }
[data-theme="dark"] .status-toggle-missing.active { background: rgba(248, 113, 113, 0.15); color: #f87171; border-color: #991b1b; }
[data-theme="dark"] .status-toggle-inactive.active { background: #334155; color: #94a3b8; border-color: #475569; }

/* Dark mode: Overlay Navigation */
[data-theme="dark"] .overlay-nav-btn {
    background: #334155;
    border-color: #475569;
    color: #94a3b8;
}
[data-theme="dark"] .overlay-nav-btn:hover {
    background: #475569;
    color: #e2e8f0;
}
[data-theme="dark"] .overlay-nav-pos {
    color: #64748b;
}
