/**
 * IMT Tracker Design System - Dashboard Styles
 * Styles specific to the manager dashboard interface
 */

/* =============================================
   APP LAYOUT
   ============================================= */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
    width: var(--sidebar-width);
    background: var(--ink);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: var(--z-sticky);
}

.sidebar-header {
    padding: var(--space-2xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-header .logo-img {
    height: 64px;
    width: auto;
    margin-bottom: var(--space-sm);
}

.sidebar .logo {
    font-family: var(--serif);
    font-size: var(--text-4xl);
    margin-bottom: var(--space-xs);
}

.logo-sub {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.5;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-xl) var(--space-md);
    overflow-y: auto;
}

.nav-section {
    margin-bottom: var(--space-2xl);
}

.nav-label {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    padding: 0 var(--space-md);
    margin-bottom: var(--space-sm);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: var(--text-md);
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.nav-item.active {
    background: var(--accent);
    color: white;
}

.nav-item.active .nav-badge {
    background: white;
    color: var(--accent);
}

.nav-icon {
    font-size: var(--text-2xl);
    width: var(--space-2xl);
    text-align: center;
    flex-shrink: 0;
}

.nav-item .nav-badge {
    position: absolute;
    right: var(--space-md);
}

.sidebar-footer {
    padding: var(--space-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: var(--text-md);
    font-weight: var(--font-medium);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 12px;
    opacity: 0.6;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--space-3xl) var(--space-4xl);
    min-height: 100vh;
}

.page-header {
    margin-bottom: var(--space-3xl);
}

.page-header h1 {
    font-family: var(--serif);
    font-size: var(--text-5xl);
    font-weight: var(--font-normal);
    margin-bottom: var(--space-sm);
}

.page-header p {
    color: var(--muted);
    font-size: var(--text-lg);
    margin-bottom: 0;
}

/* =============================================
   STATS GRID
   ============================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xl);
    margin-bottom: var(--space-3xl);
}

/* =============================================
   PERIOD BAR
   ============================================= */
.period-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: 1px solid var(--border);
    padding: var(--space-lg) var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.period-info {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.period-dates {
    font-family: var(--mono);
    font-size: var(--text-base);
    color: var(--muted);
}

.period-actions {
    display: flex;
    gap: var(--space-md);
}

/* =============================================
   CONTENT SECTIONS
   ============================================= */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* =============================================
   USERS GRID
   ============================================= */
.users-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
}

/* =============================================
   SETUP GRID
   ============================================= */
.setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
}

/* =============================================
   REPORTS GRID
   ============================================= */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}

/* =============================================
   HOUR TYPE COLOR DOT (Setup)
   ============================================= */
.hour-type-color {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-sm);
    display: inline-block;
}

/* =============================================
   TIMESHEET TABLE
   ============================================= */
.timesheet-table {
    background: white;
    border: 1px solid var(--border);
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border);
}

.table-title {
    font-family: var(--serif);
    font-size: var(--text-xl);
    font-weight: var(--font-normal);
}

.table-filters {
    display: flex;
    gap: var(--space-sm);
}

.filter-btn {
    padding: var(--space-sm) var(--space-md);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    cursor: pointer;
    transition: all var(--transition-base);
}

.filter-btn:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.filter-btn.active {
    background: var(--ink);
    border-color: var(--ink);
    color: white;
}

.timesheet-table table {
    width: 100%;
    border-collapse: collapse;
}

.timesheet-table th,
.timesheet-table td {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.timesheet-table th {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--paper);
}

.timesheet-table tbody tr:hover {
    background: var(--paper);
}

.employee-cell {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.employee-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: var(--text-sm);
    color: white;
    flex-shrink: 0;
}

.employee-name {
    font-weight: var(--font-medium);
}

.employee-id {
    font-size: var(--text-sm);
    color: var(--muted);
}

.hours-breakdown {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hours-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
}

.hours-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.hours-dot.imt {
    background: var(--accent);
}

.hours-dot.station {
    background: var(--success);
}

.action-btns {
    display: flex;
    gap: var(--space-sm);
}

.action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: var(--text-base);
}

.action-btn:hover {
    border-color: var(--ink);
}

.action-btn.approve:hover {
    background: var(--success-light);
    border-color: var(--success);
    color: var(--success);
}

.action-btn.reject:hover {
    background: var(--error-light);
    border-color: var(--error);
    color: var(--error);
}

.loading-cell,
.empty-cell,
.error-cell {
    text-align: center;
    color: var(--muted);
    padding: var(--space-3xl) !important;
}

/* =============================================
   TIMESHEET DETAIL MODAL
   ============================================= */
.detail-header {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.detail-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: var(--text-xl);
    color: white;
}

.detail-info h3 {
    font-size: var(--text-xl);
    font-weight: var(--font-medium);
    margin-bottom: 4px;
}

.detail-info p {
    font-size: var(--text-sm);
    color: var(--muted);
}

.detail-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.detail-stat {
    background: var(--paper);
    padding: var(--space-lg);
    text-align: center;
}

.detail-stat-label {
    font-family: var(--mono);
    font-size: var(--text-sm);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}

.detail-stat-value {
    font-size: var(--text-3xl);
    font-weight: var(--font-semibold);
}

.detail-stat-value.imt {
    color: var(--accent);
}

.detail-stat-value.station {
    color: var(--success);
}

.rejection-notice {
    background: var(--error-light);
    color: var(--error);
    padding: var(--space-md);
    margin-bottom: var(--space-xl);
    border-left: 3px solid var(--error);
}

.week-breakdown {
    margin-bottom: var(--space-xl);
}

.week-breakdown h4 {
    font-family: var(--sans);
    font-size: var(--text-md);
    font-weight: var(--font-medium);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border);
}

.day-row {
    display: grid;
    grid-template-columns: 90px auto 1fr 1fr;
    gap: var(--space-sm);
    padding: 10px 0;
    font-size: var(--text-base);
    align-items: center;
}

.day-row:not(:last-child) {
    border-bottom: 1px dashed var(--border);
}

.day-name-col {
    font-weight: var(--font-medium);
    font-size: var(--text-base);
}

.day-date-col {
    color: var(--muted);
    font-family: var(--mono);
    font-size: var(--text-base);
}

.hours-col {
    text-align: right;
    font-family: var(--mono);
    font-size: var(--text-base);
    white-space: nowrap;
}

.hours-col.imt {
    color: var(--accent);
}

.hours-col.station {
    color: var(--success);
}

/* =============================================
   REPORT CARDS
   ============================================= */
.report-card {
    background: white;
    border: 1px solid var(--border);
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.report-card:hover {
    border-color: var(--ink);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.report-card.selected {
    border-color: var(--accent);
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(196, 90, 59, 0.15);
    background: rgba(196, 90, 59, 0.02);
}

.report-card.selected:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(196, 90, 59, 0.2);
}

.report-icon {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-sm);
}

.report-card h3 {
    font-size: var(--text-lg);
    font-weight: var(--font-medium);
    margin-bottom: var(--space-sm);
}

.report-card p {
    font-size: var(--text-sm);
    color: var(--muted);
    margin-bottom: var(--space-sm);
}

.report-meta {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--muted);
}

/* =============================================
   USER CARDS
   ============================================= */
.user-card {
    background: white;
    border: 1px solid var(--border);
    padding: var(--space-xl);
    position: relative;
}

.user-card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.user-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: var(--text-lg);
    color: white;
}

.user-card-info h3 {
    font-size: var(--text-lg);
    font-weight: var(--font-medium);
    margin-bottom: 2px;
}

.user-card-info p {
    font-size: var(--text-sm);
    color: var(--muted);
}

.user-card-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.meta-item {
    font-size: var(--text-sm);
}

.meta-label {
    color: var(--muted);
    margin-bottom: 2px;
}

.meta-value {
    font-weight: var(--font-medium);
}

/* =============================================
   SETUP CARDS
   ============================================= */
.setup-card {
    background: white;
    border: 1px solid var(--border);
}

.setup-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border);
}

.setup-card-header h3 {
    font-family: var(--serif);
    font-size: var(--text-xl);
    font-weight: var(--font-normal);
}

.setup-card-body {
    padding: var(--space-xl);
}

.setup-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border);
}

.setup-row:last-child {
    border-bottom: none;
}

.setup-label {
    font-size: var(--text-base);
    color: var(--muted);
}

.setup-value {
    font-family: var(--mono);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
}

/* =============================================
   RESPONSIVE - Large Desktop (1200px+)
   Default styles above apply
   ============================================= */

/* Medium Desktop (900px - 1199px) */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .users-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .reports-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet / Small Desktop (768px - 899px) */
@media (max-width: 900px) {
    /* Collapse sidebar to icons only */
    .sidebar {
        width: var(--sidebar-collapsed);
    }

    .sidebar-header {
        padding: var(--space-lg);
        text-align: center;
    }

    .sidebar .logo {
        font-size: var(--text-2xl);
    }

    .logo-sub,
    .nav-label,
    .nav-item span:not(.nav-icon):not(.nav-badge),
    .user-details {
        display: none;
    }

    .nav-item {
        justify-content: center;
        padding: var(--space-md);
    }

    .nav-item .nav-badge {
        position: absolute;
        top: 4px;
        right: 4px;
        padding: 2px 5px;
        font-size: var(--text-xs);
        min-width: auto;
    }

    .sidebar-footer {
        padding: var(--space-md);
        display: flex;
        justify-content: center;
    }

    .main-content {
        margin-left: var(--sidebar-collapsed);
        padding: var(--space-2xl);
    }

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

/* Mobile (640px and below) */
@media (max-width: 640px) {
    .stats-grid,
    .users-grid,
    .reports-grid {
        grid-template-columns: 1fr;
    }

    .period-bar {
        flex-direction: column;
        gap: var(--space-lg);
        align-items: stretch;
    }

    .period-info {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .period-actions {
        justify-content: stretch;
    }

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

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

    /* Hide sidebar completely on mobile */
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: var(--space-lg);
    }

    .page-header h1 {
        font-size: var(--text-4xl);
    }

    /* Table responsive */
    .timesheet-table {
        overflow-x: auto;
    }

    .table-header {
        flex-direction: column;
        gap: var(--space-md);
        align-items: flex-start;
    }

    .table-filters {
        width: 100%;
        overflow-x: auto;
    }
}

/* =============================================
   RANKS & PAY RATES
   ============================================= */

/* Summary in Payroll Setup card */
.ranks-summary-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

.rank-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    background: var(--paper-warm);
    border-radius: var(--radius-sm);
    font-family: var(--mono);
    font-size: var(--text-xs);
}

.rank-badge.more {
    background: var(--border);
    color: var(--muted);
}

/* Ranks list in modal */
.ranks-section {
    margin-bottom: var(--space-lg);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.section-header h3 {
    font-family: var(--serif);
    font-size: var(--text-xl);
    margin: 0;
}

.ranks-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.rank-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.rank-row.inactive {
    opacity: 0.6;
}

.rank-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.rank-name {
    font-weight: 500;
}

.rank-code {
    font-family: var(--mono);
    font-size: var(--text-sm);
    color: var(--muted);
}

.rank-actions {
    display: flex;
    gap: var(--space-xs);
}

/* Pay Rates Matrix */
.pay-rates-section {
    margin-top: var(--space-lg);
}

.pay-rates-matrix {
    overflow-x: auto;
}

.pay-rates-table {
    width: 100%;
    border-collapse: collapse;
}

.pay-rates-table th,
.pay-rates-table td {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border: 1px solid var(--border);
}

.pay-rates-table th {
    background: var(--paper-warm);
    font-family: var(--mono);
    font-size: var(--text-sm);
    font-weight: 500;
}

.pay-rates-table .rank-cell {
    font-weight: 500;
    white-space: nowrap;
}

.pay-rates-table .rate-cell {
    text-align: center;
}

.pay-rates-table .rate-cell.flat {
    background: var(--paper);
    color: var(--muted);
    font-family: var(--mono);
    font-size: var(--text-sm);
}

.pay-rates-table .default-row {
    background: var(--paper);
}

.pay-rates-table .default-row .rank-cell {
    font-weight: normal;
    font-style: italic;
}

.rate-input {
    width: 80px;
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--mono);
    font-size: var(--text-sm);
    text-align: right;
}

.rate-input:focus {
    outline: none;
    border-color: var(--accent);
}

.rate-input::placeholder {
    color: var(--muted);
}

/* =============================================
   LOGIN PAGE STYLES (Dashboard context)
   ============================================= */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

.login-card {
    background: white;
    border: 1px solid var(--border);
    width: 100%;
    max-width: 400px;
    padding: var(--space-4xl);
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.login-header .logo-img {
    height: 80px;
    width: auto;
    margin-bottom: var(--space-md);
}

.login-header .logo {
    font-family: var(--serif);
    font-size: var(--text-4xl);
    margin-bottom: var(--space-sm);
}

.login-header p {
    color: var(--muted);
    font-size: var(--text-md);
    margin-bottom: 0;
}

.login-form .btn {
    width: 100%;
    padding: var(--space-lg);
    margin-top: var(--space-lg);
}

.login-error {
    background: var(--error-light);
    color: var(--error);
    padding: var(--space-md);
    margin-bottom: var(--space-xl);
    font-size: var(--text-md);
    border-left: 3px solid var(--error);
}

.login-footer {
    text-align: center;
    margin-top: var(--space-2xl);
    padding-top: var(--space-2xl);
    border-top: 1px solid var(--border);
}

.login-footer a {
    color: var(--accent);
    font-size: var(--text-md);
}

.login-footer a:hover {
    text-decoration: underline;
}

/* =============================================
   PAGE HEADER ROW (with button)
   ============================================= */
.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

/* =============================================
   USERS TOOLBAR
   ============================================= */
.users-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
}

.users-filters {
    display: flex;
    gap: var(--space-sm);
}

/* =============================================
   USER CARD ACTIONS
   ============================================= */
.user-card {
    cursor: pointer;
    transition: all var(--transition-base);
}

.user-card:hover {
    border-color: var(--ink);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.user-card-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.user-card-actions .btn {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
}

/* =============================================
   FORM ROW (Two columns)
   ============================================= */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

/* =============================================
   REPORT PERIOD BAR
   ============================================= */
.report-period-bar {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
    flex-wrap: wrap;
    background: white;
    border: 1px solid var(--border);
    padding: var(--space-md) var(--space-lg);
}

.report-period-type,
.report-period-value {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.report-period-bar label {
    font-family: var(--mono);
    font-size: var(--text-sm);
    color: var(--muted);
    white-space: nowrap;
}

.report-period-bar .form-input {
    min-width: 160px;
}

.report-period-custom {
    gap: var(--space-md);
}

.report-period-custom .form-input {
    min-width: 140px;
}

/* =============================================
   REPORT CARD ACTIONS
   ============================================= */
.report-actions {
    margin-top: auto;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border);
}

.report-actions .btn {
    padding: var(--space-xs) var(--space-sm);
    font-size: 10px;
}

/* =============================================
   TEMP PASSWORD BOX
   ============================================= */
.temp-password-box {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--paper);
    padding: var(--space-md);
    margin: var(--space-md) 0;
}

.temp-password-box code {
    font-family: var(--mono);
    font-size: var(--text-lg);
    flex: 1;
}

.help-text {
    font-size: var(--text-sm);
    color: var(--muted);
    margin-top: var(--space-sm);
}

/* =============================================
   SETUP ROW WITH ACTIONS
   ============================================= */
.setup-row-actions {
    display: flex;
    gap: var(--space-sm);
}

.setup-row-actions .action-btn {
    width: 28px;
    height: 28px;
    font-size: var(--text-sm);
}

/* =============================================
   PAY PERIOD ROW
   ============================================= */
.pay-period-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: var(--space-lg);
    align-items: center;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border);
}

.pay-period-row:last-child {
    border-bottom: none;
}

.pay-period-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pay-period-name {
    font-weight: var(--font-medium);
}

.pay-period-dates {
    font-family: var(--mono);
    font-size: var(--text-sm);
    color: var(--muted);
}

/* =============================================
   LOADING/EMPTY STATES
   ============================================= */
.loading-placeholder,
.empty-placeholder,
.error-placeholder {
    text-align: center;
    padding: var(--space-3xl);
    color: var(--muted);
}

/* =============================================
   REPORT PREVIEW TABLE
   ============================================= */
.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.report-table th,
.report-table td {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.report-table th {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--paper);
}

.report-table tbody tr:hover {
    background: var(--paper);
}

/* Clickable rows for drill-down */
.report-table tbody tr.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.report-table tbody tr.clickable-row:hover {
    background: var(--paper-warm);
}

/* Large modal for wide content */
.modal.modal-lg {
    max-width: 900px;
}

.modal.modal-lg .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* Sticky first column for horizontal scrolling tables */
.report-table-sticky {
    position: relative;
}

.report-table-sticky th:first-child,
.report-table-sticky td:first-child {
    position: sticky;
    left: 0;
    background: var(--paper);
    z-index: 1;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.report-table-sticky thead th:first-child {
    z-index: 2;
}

.report-table-sticky tbody tr:hover td:first-child {
    background: var(--paper);
}

.report-table-sticky tfoot td:first-child {
    background: var(--paper-warm);
}

/* =============================================
   STATUS BADGE VARIANTS
   ============================================= */
.status-badge.active {
    background: var(--success-light);
    color: var(--success);
}

.status-badge.inactive {
    background: var(--paper-warm);
    color: var(--muted);
}

/* =============================================
   PAYROLL SETUP GRID (2x2)
   ============================================= */
.payroll-setup-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2xl);
}

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

/* =============================================
   FREQUENCY CARDS - Radio Selection
   ============================================= */
.frequency-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}

@media (max-width: 640px) {
    .frequency-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

.frequency-card {
    position: relative;
    cursor: pointer;
}

.frequency-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.frequency-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xl) var(--space-md);
    border: 2px solid var(--border);
    background: white;
    text-align: center;
    transition: all var(--transition-base);
}

.frequency-card:hover .frequency-card-content {
    border-color: var(--ink);
}

.frequency-card input:checked + .frequency-card-content {
    background: var(--ink);
    border-color: var(--ink);
    color: white;
}

.frequency-abbrev {
    font-family: var(--mono);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
}

.frequency-name {
    font-family: var(--mono);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.frequency-periods {
    font-family: var(--mono);
    font-size: var(--text-xs);
    opacity: 0.7;
}

/* =============================================
   DAY TOGGLE BUTTONS
   ============================================= */
.day-toggle-group {
    display: flex;
    border: 1px solid var(--border);
    width: fit-content;
}

@media (max-width: 640px) {
    .day-toggle-group {
        flex-wrap: wrap;
        width: 100%;
    }
}

.day-toggle {
    padding: var(--space-sm) var(--space-lg);
    font-family: var(--mono);
    font-size: var(--text-sm);
    text-transform: uppercase;
    background: white;
    border: none;
    border-right: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--transition-base);
}

.day-toggle:last-child {
    border-right: none;
}

.day-toggle:hover {
    background: var(--paper);
}

.day-toggle.active {
    background: var(--ink);
    color: white;
}

/* =============================================
   TOGGLE SWITCH COMPONENT
   ============================================= */
.toggle-setting {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--border);
}

.toggle-setting:last-child {
    border-bottom: none;
}

.toggle-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.toggle-label {
    font-weight: var(--font-medium);
}

.toggle-desc {
    font-size: var(--text-sm);
    color: var(--muted);
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    border-radius: 24px;
    transition: var(--transition-base);
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition-base);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--success);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-with-input {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.form-input-sm {
    width: 100px;
    padding: var(--space-xs) var(--space-sm);
}

/* =============================================
   SETUP VALUE STATUS COLORS
   ============================================= */
.setup-value.enabled {
    color: var(--success);
}

.setup-value.disabled {
    color: var(--muted);
}

/* =============================================
   UPCOMING PERIODS LIST
   ============================================= */
.upcoming-period-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border);
}

.upcoming-period-item:last-child {
    border-bottom: none;
}

.period-info-row {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.period-name {
    font-family: var(--mono);
    font-weight: var(--font-medium);
}

.period-dates-small {
    font-size: var(--text-sm);
    color: var(--muted);
}

.period-status {
    font-family: var(--mono);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.period-status.current {
    color: var(--accent);
}

.period-status.upcoming {
    color: var(--muted);
}

/* =============================================
   PERIOD PREVIEW LIST
   ============================================= */
.period-preview-list {
    max-height: 300px;
    overflow-y: auto;
}

.preview-period {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border);
    font-family: var(--mono);
    font-size: var(--text-sm);
}

.preview-period:last-child {
    border-bottom: none;
}

.preview-info {
    margin-bottom: var(--space-lg);
    color: var(--muted);
}

/* =============================================
   HOUR TYPE ROW (Enhanced)
   ============================================= */
.hour-type-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border);
}

.hour-type-row:last-child {
    border-bottom: none;
}

.hour-type-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.hour-type-color {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-sm);
}

.ot-badge {
    font-family: var(--mono);
    font-size: 10px;
    padding: 2px 6px;
    background: var(--warning);
    color: white;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: var(--space-lg) 0;
}

.input-with-hint {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.input-hint {
    font-size: var(--text-sm);
    color: var(--muted);
}

.ot-multiplier-group {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--paper-warm);
    border-radius: var(--radius-md);
}

.hour-type-name {
    font-weight: var(--font-medium);
}

.hour-type-rate {
    font-family: var(--mono);
    font-size: var(--text-sm);
    color: var(--muted);
}

/* =============================================
   ADMIN ACTIONS IN DETAIL MODAL
   ============================================= */
.admin-actions {
    display: flex;
    gap: var(--space-sm);
    margin-left: auto;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

/* =============================================
   ADMIN EDIT TIMESHEET MODAL
   ============================================= */
.edit-timesheet-header {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.edit-notice {
    background: var(--warning-light);
    color: var(--warning-text);
    padding: var(--space-md);
    margin-bottom: var(--space-xl);
    border-left: 3px solid var(--warning);
    font-size: var(--text-base);
}

.edit-day-row {
    display: grid;
    grid-template-columns: 90px auto 1fr 1fr;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    align-items: center;
}

.edit-day-row:not(:last-child) {
    border-bottom: 1px dashed var(--border);
}

.edit-input-col {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    justify-content: flex-end;
}

.edit-hour-input {
    width: 70px;
    padding: var(--space-sm);
    font-family: var(--mono);
    font-size: var(--text-md);
    text-align: center;
    border: 1px solid var(--border);
    background: var(--paper);
    transition: all var(--transition-base);
}

.edit-hour-input:focus {
    outline: none;
    border-color: var(--ink);
    background: white;
}

.edit-hour-input.imt:focus {
    border-color: var(--accent);
}

.edit-hour-input.station:focus {
    border-color: var(--success);
}

.edit-input-label {
    font-family: var(--mono);
    font-size: var(--text-sm);
    color: var(--muted);
    min-width: 50px;
}

.edit-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--paper);
    padding: var(--space-lg);
    margin-top: var(--space-xl);
    border-top: 2px solid var(--border);
}

.edit-summary-label {
    font-family: var(--mono);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.edit-summary-values {
    display: flex;
    gap: var(--space-xl);
    font-family: var(--mono);
    font-size: var(--text-md);
}

.edit-summary-values .imt {
    color: var(--accent);
}

.edit-summary-values .station {
    color: var(--success);
}

/* =============================================
   AUDIT LOG MODAL
   ============================================= */
.audit-log-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.audit-log-entry {
    background: var(--paper);
    padding: var(--space-lg);
    border-left: 3px solid var(--border);
}

.audit-log-entry.approved {
    border-left-color: var(--success);
}

.audit-log-entry.rejected {
    border-left-color: var(--error);
}

.audit-log-entry.edited {
    border-left-color: var(--warning);
}

.audit-log-entry.submitted {
    border-left-color: var(--accent);
}

.audit-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.audit-action {
    font-weight: var(--font-medium);
    font-size: var(--text-md);
}

.audit-date {
    font-family: var(--mono);
    font-size: var(--text-sm);
    color: var(--muted);
}

.audit-log-meta {
    display: flex;
    gap: var(--space-lg);
    font-size: var(--text-sm);
    color: var(--muted);
    margin-bottom: var(--space-sm);
}

.audit-user {
    font-weight: var(--font-medium);
}

.audit-ip {
    font-family: var(--mono);
}

.audit-details {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px dashed var(--border);
}

.audit-reason {
    font-size: var(--text-base);
    margin-bottom: var(--space-sm);
}

.audit-changes {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

.audit-change-item {
    display: flex;
    gap: var(--space-lg);
    font-family: var(--mono);
    font-size: var(--text-sm);
    padding: var(--space-xs) var(--space-sm);
    background: white;
}

.change-date {
    min-width: 60px;
    color: var(--muted);
}

.change-type {
    min-width: 60px;
    font-weight: var(--font-medium);
}

.change-value {
    color: var(--accent);
}

/* =============================================
   APPROVED PAYROLL SECTION
   ============================================= */

/* Completed status badge */
.status-badge.completed {
    background: var(--success);
    color: white;
}

.stat-card.completed {
    border-top-color: var(--success);
}

.stat-card.completed .stat-value {
    color: var(--success);
}

/* Payroll table - same as timesheet table */
.payroll-table {
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* Payroll detail modal */
.payroll-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
    margin: var(--space-xl) 0;
}

.payroll-summary-section {
    padding: var(--space-lg);
    background: var(--paper);
    border-radius: var(--radius-lg);
}

.payroll-summary-section h4 {
    font-family: var(--mono);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: var(--space-md);
}

.payroll-line {
    display: flex;
    justify-content: space-between;
    padding: var(--space-xs) 0;
    font-size: var(--text-sm);
}

.payroll-line.total {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 2px solid var(--ink);
    font-size: var(--text-base);
}

.payroll-rates {
    margin: var(--space-xl) 0;
    padding: var(--space-lg);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.payroll-rates h4,
.payroll-totals h4 {
    font-family: var(--mono);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: var(--space-md);
}

.payroll-totals {
    margin-top: var(--space-xl);
    padding: var(--space-lg);
    background: var(--paper-warm);
    border-radius: var(--radius-lg);
}

/* =============================================
   BUDGET CONFIGURATION
   ============================================= */

.budget-report-controls {
    display: flex;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.budget-report-controls .form-group {
    flex: 1;
    max-width: 200px;
}

.budget-report-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.budget-report-card {
    padding: var(--space-xl);
    background: var(--paper);
    border-radius: var(--radius-xl);
}

.budget-report-card h4 {
    font-family: var(--mono);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: var(--space-lg);
}

.budget-progress {
    height: 8px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.budget-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.budget-numbers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.budget-numbers > div {
    text-align: center;
}

.budget-label {
    display: block;
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: var(--space-xs);
}

.budget-value {
    font-family: var(--mono);
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
}

.budget-value.positive {
    color: var(--success);
}

.budget-value.negative {
    color: var(--error);
}

.budget-percent {
    margin-top: var(--space-lg);
    text-align: center;
    font-size: var(--text-sm);
    color: var(--muted);
}

.budget-monthly-breakdown {
    margin-top: var(--space-xl);
}

.budget-monthly-breakdown h4 {
    font-family: var(--mono);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: var(--space-md);
}

.budget-table {
    width: 100%;
    border-collapse: collapse;
}

.budget-table th,
.budget-table td {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.budget-table th {
    font-family: var(--mono);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    background: var(--paper);
}

.budget-table td {
    font-family: var(--mono);
    font-size: var(--text-sm);
}
