/* =========================================
   1. CORE SETTINGS & FONTS
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --color-brand: #0f172a; /* Slate 900 */
    --color-accent: #10b981; /* Emerald 500 */
    --color-border: #e2e8f0; /* Slate 200 */
    --color-bg: #f8fafc;     /* Slate 50 */
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--color-bg);
    color: #1e293b;
}

/* =========================================
   2. CUSTOM SCROLLBARS (SaaS Look)
   ========================================= */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1; /* Slate-300 */
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8; /* Slate-400 */
}

/* =========================================
   3. SHARED UI COMPONENTS
   ========================================= */

/* --- Standard Inputs --- */
.input-std {
    display: block;
    width: 100%;
    border-radius: 0.5rem; /* rounded-lg */
    border: 1px solid var(--color-border);
    background-color: #ffffff;
    padding: 0.75rem 1rem; /* py-3 px-4 */
    font-size: 0.875rem; /* text-sm */
    color: #1e293b;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease-in-out;
}

.input-std:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1); /* Brand Ring */
}

.input-std::placeholder {
    color: #94a3b8;
}

.input-std:disabled,
.input-std[readonly] {
    background-color: #f1f5f9; /* Slate-100 */
    color: #64748b; /* Slate-500 */
    cursor: not-allowed;
    border-color: #e2e8f0;
}

/* --- Labels --- */
.label-xs {
    display: block;
    font-size: 0.75rem; /* text-xs */
    line-height: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b; /* Slate-500 */
    margin-bottom: 0.375rem;
}

/* --- Category Switcher (Individual vs Company) --- */
.category-wrapper {
    display: flex;
    gap: 0.5rem;
    background-color: #ffffff;
    border-radius: 0.5rem;
}

.category-btn {
    flex: 1;
    padding: 0.625rem;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.category-btn.active {
    background-color: var(--color-brand);
    color: #ffffff;
    border-color: var(--color-brand);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.category-btn.inactive {
    background-color: #ffffff;
    color: #64748b;
    border-color: var(--color-border);
}

.category-btn.inactive:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

/* --- Checkbox Accent --- */
.accent-brand {
    accent-color: var(--color-brand);
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
}

/* =========================================
   4. MODALS & OVERLAYS
   ========================================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.75); /* Slate-900 @ 75% */
    backdrop-filter: blur(4px);
    z-index: 50; /* Above Header (30) and Sidebar (20) */
    display: none; /* Toggled via JS to 'flex' */
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    max-height: 90vh; /* Prevent overflow on small screens */
    width: 100%;
    overflow-y: auto;
    background: white;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* =========================================
   5. ANIMATIONS
   ========================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeOut {
    to { opacity: 0; }
}

/* =========================================
   6. RESPONSIVE UTILITIES
   ========================================= */

/* Sidebar Mobile Slide-in Transition */
#sidebar-panel {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* On mobile, hidden elements should be truly gone */
@media (max-width: 768px) {
    .hidden-mobile {
        display: none !important;
    }
    
    /* Ensure modals have breathing room on mobile */
    .modal-content {
        max-height: 85vh; 
    }
}

/* =========================================
   7. PRINT STYLES (For Statement Generation)
   ========================================= */
@media print {
    /* Hide the entire app UI */
    body > *:not(#print-area) {
        display: none !important;
    }

    /* Reset background colors for ink saving */
    body {
        background-color: white !important;
        color: black !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Show only the print container */
    #print-area {
        display: block !important;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        margin: 0;
        padding: 20px;
        background: white;
        z-index: 9999;
    }

    /* Table styling for print */
    #print-area table {
        width: 100%;
        border-collapse: collapse;
    }
    
    #print-area th, #print-area td {
        border-bottom: 1px solid #ddd;
        padding: 8px 0;
    }

    /* Hide Scrollbars */
    ::-webkit-scrollbar {
        display: none;
    }
}