:root {
    --pb-primary: #e11d48;
    --pb-primary-hover: #be123c;
    --pb-primary-light: #ffe4e6;
    --pb-secondary: #f97316;
    --pb-dark: #0f172a;
    --pb-sidebar: #1e293b;
    --pb-sidebar-hover: #334155;
    --pb-bg: #f8fafc;
    --pb-card: #ffffff;
    --pb-border: #e2e8f0;
    --pb-text-main: #1e293b;
    --pb-text-muted: #64748b;
}

body {
    background-color: var(--pb-bg);
    color: var(--pb-text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
}

/* App Wrapper */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: 260px;
    background-color: var(--pb-sidebar);
    color: #f8fafc;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    z-index: 1000;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-decoration: none;
}

.sidebar-brand i {
    color: #fb7185;
}

.sidebar-nav {
    padding: 1rem 0;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-heading {
    padding: 0.75rem 1.5rem 0.25rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    font-weight: 600;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 1.5rem;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    color: #ffffff;
    background-color: var(--pb-sidebar-hover);
    border-left-color: #fb7185;
}

.sidebar-nav .nav-link.active {
    color: #ffffff;
    background-color: rgba(225, 29, 72, 0.15);
    border-left-color: var(--pb-primary);
    font-weight: 600;
}

.sidebar-nav .nav-link i {
    width: 1.5rem;
    margin-right: 0.75rem;
    font-size: 1.1rem;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(15, 23, 42, 0.5);
}

/* Main Content Area */
.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top Navbar */
.app-topbar {
    height: 64px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--pb-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 900;
}

.outlet-switcher select {
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    font-weight: 600;
    color: var(--pb-text-main);
    font-size: 0.875rem;
    cursor: pointer;
}

.outlet-switcher select:focus {
    outline: none;
    border-color: var(--pb-primary);
    box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.2);
}

.outlet-badge-locked {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Content Body */
.app-content {
    padding: 1.5rem;
    flex-grow: 1;
}

/* Custom Cards */
.pb-card {
    background: var(--pb-card);
    border: 1px solid var(--pb-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 1.5rem;
}

.pb-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--pb-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #ffffff;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.pb-card-body {
    padding: 1.25rem;
}

/* KPI Stat Cards */
.kpi-card {
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--pb-border);
    background: #ffffff;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.kpi-icon.rose { background: #ffe4e6; color: #e11d48; }
.kpi-icon.amber { background: #fef3c7; color: #d97706; }
.kpi-icon.emerald { background: #d1fae5; color: #059669; }
.kpi-icon.sky { background: #e0f2fe; color: #0284c7; }
.kpi-icon.indigo { background: #e0e7ff; color: #4f46e5; }
.kpi-icon.slate { background: #f1f5f9; color: #475569; }

.kpi-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--pb-text-muted);
    letter-spacing: 0.025em;
    margin-bottom: 0.2rem;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--pb-text-main);
    line-height: 1.2;
}

/* Status Badges */
.status-badge {
    padding: 0.3rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.status-present { background: #d1fae5; color: #065f46; }
.status-late { background: #fef3c7; color: #92400e; }
.status-absent { background: #fee2e2; color: #991b1b; }
.status-halfday { background: #e0e7ff; color: #3730a3; }
.status-leave { background: #e0f2fe; color: #075985; }
.status-missing { background: #f1f5f9; color: #475569; }

/* Buttons */
.btn-pb-primary {
    background-color: var(--pb-primary);
    color: #ffffff;
    border: none;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: background-color 0.2s;
}

.btn-pb-primary:hover {
    background-color: var(--pb-primary-hover);
    color: #ffffff;
}

.btn-pb-outline {
    background-color: transparent;
    color: var(--pb-primary);
    border: 1px solid var(--pb-primary);
    font-weight: 600;
    border-radius: 8px;
    padding: 0.5rem 1rem;
}

.btn-pb-outline:hover {
    background-color: var(--pb-primary-light);
    color: var(--pb-primary);
}

/* Modern Tables */
.pb-table {
    width: 100%;
    margin-bottom: 0;
    vertical-align: middle;
}

.pb-table thead th {
    background-color: #f8fafc;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--pb-border);
}

.pb-table tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}

.pb-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Calculation Breakdown Console */
.calc-breakdown-box {
    background-color: #0f172a;
    color: #38bdf8;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.85rem;
    padding: 1.25rem;
    border-radius: 8px;
    white-space: pre-wrap;
    line-height: 1.5;
    max-height: 500px;
    overflow-y: auto;
}

/* Payslip printable styling */
@media print {
    .app-sidebar, .app-topbar, .no-print, .btn, .breadcrumb {
        display: none !important;
    }
    .app-main, .app-content {
        padding: 0 !important;
        margin: 0 !important;
    }
    body {
        background-color: #ffffff !important;
    }
    .payslip-container {
        border: none !important;
        box-shadow: none !important;
        width: 100% !important;
    }
}