:root {
    --primary-color: #0f172a;
    --accent-blue: #007bff;
    --border-ledger: #000000;
    --bg-light: #f1f5f9;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--primary-color);
}

/* --- Navigation & Menu --- */
.navbar-brand { font-size: 1.25rem; }

@media (max-width: 991.98px) {
    .navbar-collapse {
        background: white;
        padding: 1rem;
        border-radius: 8px;
        margin-top: 10px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    .nav-link { padding: 0.75rem 0 !important; border-bottom: 1px solid #f1f5f9; }
}

/* --- Dashboard Cards --- */
.stat-card-pro {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    height: 100%;
}
.stat-card-pro .label { font-size: 0.7rem; font-weight: 700; color: #64748b; text-transform: uppercase; margin-bottom: 8px; display: block; }
.stat-card-pro .value { font-size: 1.5rem; font-weight: 800; color: var(--primary-color); }

/* --- OFFICIAL BRANDED PAYSLIP OUTPUT --- */
.payslip-wrapper {
    background: #fff;
    padding: 2rem; /* Flexible padding */
    width: 100%;
    max-width: 850px;
    margin: 10px auto;
    border: 1px solid #dee2e6;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

@media (max-width: 576px) {
    .payslip-wrapper { padding: 1rem; border: none; }
    .brand-title { font-size: 1.3rem; }
    .net-amount { font-size: 1.5rem; }
}

/* Brand Header Styling */
.brand-title { font-weight: 900; color: #1e293b; letter-spacing: 0.5px; margin-bottom: 2px; }
.brand-subtitle { font-size: 0.75rem; color: #64748b; font-weight: 600; margin-bottom: 12px; }

.pay-period-pill {
    display: inline-block;
    background-color: var(--accent-blue);
    color: white;
    padding: 6px 20px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.7rem;
    text-transform: uppercase;
}

/* Personnel Grid - Responsive Columns */
.employee-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid #dee2e6;
    margin: 20px 0;
}

@media (max-width: 480px) {
    .employee-info-grid { grid-template-columns: 1fr; }
}

.info-item {
    padding: 10px 15px;
    border: 0.5px solid #f1f3f5;
    font-size: 0.8rem;
    color: #334155;
}

/* Side-by-Side Table Layout */
.ledger-table {
    width: 100%;
    border-collapse: collapse;
}

.ledger-table th {
    background: #f8f9fa;
    padding: 10px;
    font-size: 0.7rem;
    text-transform: uppercase;
    border-bottom: 2px solid #dee2e6;
}

.ledger-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
}

/* Summary and Totals */
.summary-row td {
    font-weight: 800;
    background: #f8fafc;
    border-top: 2px solid #000;
    padding: 12px 10px;
}

/* Net Payout Section */
.net-section {
    margin-top: 25px;
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
}
.net-label { font-weight: 800; color: var(--accent-blue); font-size: 0.75rem; }
.net-amount { font-weight: 900; color: var(--accent-blue); }

/* Watermark */
.logo-watermark {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 200px; height: 200px;
    background: url('logo.png') no-repeat center;
    background-size: contain;
    opacity: 0.03;
    z-index: 0;
    pointer-events: none;
}

/* Table Responsiveness Hack */
@media (max-width: 768px) {
    .ledger-table thead { display: none; } /* Hide headers on mobile to save space */
    .ledger-table tr { display: block; margin-bottom: 15px; border-bottom: 2px solid #eee; }
    .ledger-table td { display: flex; justify-content: space-between; text-align: right; }
    .ledger-table td::before { content: attr(data-label); font-weight: bold; text-align: left; }
}

/* Section Switching & Print */
.section { display: none; }
.section.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

@media print {
    .no-print { display: none !important; }
    body { background: white; }
    .payslip-wrapper { border: none; padding: 0; margin: 0; box-shadow: none; width: 100%; max-width: 100%; }
}
