/* ── Sidebar ──────────────────────────────────────────────── */
#sidebar {
    width: 240px;
    min-height: 100vh;
    background-color: #0C2240;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.25s ease;
}

.main-area {
    margin-left: 240px;
    min-height: 100vh;
}

.sidebar-link {
    color: rgba(255, 255, 255, 0.75);
    padding: 10px 16px;
    border-left: 3px solid transparent;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.15s;
    font-size: 0.9rem;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
}

.sidebar-link.active {
    background: rgba(75, 184, 232, 0.25);
    border-left-color: #4BB8E8;
    color: #4BB8E8;
    font-weight: 600;
}

.sidebar-link-trash {
    opacity: 0.65;
    font-size: 0.8rem;
}

.sidebar-logout-btn {
    text-decoration: none;
    opacity: 0.7;
}

.sidebar-logout-btn:hover {
    opacity: 1;
}

.border-sidebar {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.sidebar-logo-img {
    height: 36px;
    object-fit: contain;
}

.sidebar-brand-text {
    font-size: 1.1rem;
    letter-spacing: 0.02em;
}

/* ── Mobile ──────────────────────────────────────────────── */
.mobile-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 900;
}

@media (max-width: 767.98px) {
    #sidebar {
        transform: translateX(-100%);
    }
    #sidebar.sidebar-open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }
    .main-area {
        margin-left: 0;
    }
}

/* ── Department badges ──────────────────────────────────── */
.badge-marketing  { background-color: #dbeafe !important; color: #1d4ed8 !important; }
.badge-digitizing { background-color: #ede9fe !important; color: #6d28d9 !important; }
.badge-emerald    { background-color: #d1fae5 !important; color: #065f46 !important; }
.badge-partner    { background-color: #fef3c7 !important; color: #92400e !important; }

/* ── Department card selectors ──────────────────────────── */
.dept-card {
    cursor: pointer;
    border: 2px solid;
    border-radius: 0.75rem;
    transition: all 0.15s;
}
.dept-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.dept-card.active { box-shadow: 0 0 0 3px; }

.dept-card-marketing  { border-color: #93c5fd; background-color: #eff6ff; }
.dept-card-marketing.active  { border-color: #3b82f6; background-color: #dbeafe; box-shadow: 0 0 0 3px #93c5fd; }
.dept-card-digitizing { border-color: #c4b5fd; background-color: #f5f3ff; }
.dept-card-digitizing.active { border-color: #7c3aed; background-color: #ede9fe; box-shadow: 0 0 0 3px #c4b5fd; }
.dept-card-emerald    { border-color: #6ee7b7; background-color: #f0fdf4; }
.dept-card-emerald.active    { border-color: #059669; background-color: #d1fae5; box-shadow: 0 0 0 3px #6ee7b7; }
.dept-card-partner    { border-color: #fcd34d; background-color: #fffbeb; }
.dept-card-partner.active    { border-color: #d97706; background-color: #fef3c7; box-shadow: 0 0 0 3px #fcd34d; }

/* ── Calc preview row ───────────────────────────────────── */
.calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
    background: rgba(255,255,255,0.7);
    font-size: 0.8125rem;
    margin-bottom: 0.25rem;
}
.calc-row .calc-label { color: #6b7280; }
.calc-row .calc-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.calc-row.calc-total { background-color: #d1fae5; border-color: #6ee7b7; }
.calc-row.calc-total .calc-value { color: #065f46; font-size: 0.9375rem; font-weight: 900; }
.calc-row .calc-negative { color: #dc2626; }
.calc-row .calc-dim { color: #9ca3af; }

/* ── Payslip card ───────────────────────────────────────── */
.payslip-card { max-width: 680px; }
.payslip-section-header {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}
.payslip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
}
.payslip-row:last-child { border-bottom: none; }
.payslip-label { color: #6b7280; }
.payslip-value { font-weight: 500; }
.payslip-deduction { color: #dc2626; }

/* ── Print styles ───────────────────────────────────────── */
@media print {
    #sidebar, .mobile-header, .no-print { display: none !important; }
    .main-area { margin-left: 0 !important; }
    .print-only { display: block !important; }
}
.print-only { display: none; }

/* ── Attendance calendar ────────────────────────────────── */
.att-table { font-size: 0.75rem; }
.att-table th, .att-table td { white-space: nowrap; padding: 4px 6px; text-align: center; }
.att-table .col-name { text-align: left; font-weight: 600; min-width: 120px; position: sticky; left: 0; background: #fff; z-index: 1; }
.att-cell { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.625rem; font-weight: 600; transition: all 0.1s; }
.att-cell:hover { transform: scale(1.15); }
.att-present { background-color: #d1fae5; color: #065f46; }
.att-absent  { background-color: #fee2e2; color: #991b1b; }
.att-weekend { background-color: #f3f4f6; color: #9ca3af; }
.att-empty   { background-color: #f9fafb; color: #d1d5db; }
.att-sticky  { position: sticky; background: #f9fafb; font-weight: 700; font-size: 0.7rem; }

/* ── Misc ───────────────────────────────────────────────── */
.section-header-badge {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem 0.5rem 0 0;
    font-size: 0.8125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.stat-card { border-left: 4px solid; border-radius: 0.75rem; }
.loading-spinner { display: flex; align-items: center; justify-content: center; padding: 3rem; }

/* ── Purple (Digitizing) utilities not in Bootstrap 5 ──── */
.text-purple { color: #6d28d9 !important; }
.bg-purple { background-color: #7c3aed !important; }
.bg-purple-subtle { background-color: #f5f3ff !important; }
.border-purple { border-color: #c4b5fd !important; }

/* ── Bonus / expandable cards ───────────────────────────── */
.bonus-period-card { border-radius: 0.5rem; border: 1px solid #e5e7eb; background: #fff; }
.bonus-period-card.paid { border-color: #6ee7b7; background: #f0fdf4; }
.bonus-period-card.dismissed { border-color: #fca5a5; background: #fef2f2; }

/* ── Expense color tags (hash-based) ────────────────────── */
.expense-tag { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px; font-size: 0.75rem; font-weight: 600; }
