:root {
    /* Core Palette - Subtle Enterprise */
    --primary-h: 224;
    --primary-s: 76%;
    --primary-l: 48%;
    --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
    --primary-hover: hsl(var(--primary-h), var(--primary-s), calc(var(--primary-l) - 8%));
    --primary-light: hsl(var(--primary-h), var(--primary-s), 96%);
    
    --slate-50:  hsl(210, 40%, 98%);
    --slate-100: hsl(210, 40%, 96%);
    --slate-200: hsl(214, 32%, 91%);
    --slate-300: hsl(213, 27%, 84%);
    --slate-400: hsl(215, 16%, 47%);
    --slate-500: hsl(215, 16%, 47%);
    --slate-600: hsl(215, 25%, 27%);
    --slate-700: hsl(215, 25%, 23%);
    --slate-800: hsl(217, 33%, 17%);
    --slate-900: hsl(222, 47%, 11%);

    --bg-main: var(--slate-50);
    --bg-card: #ffffff;
    --text-main: var(--slate-800);
    --text-muted: var(--slate-500);
    --border: var(--slate-200);
    
    --success: hsl(142, 70%, 45%);
    --danger:  hsl(0, 72%, 51%);
    --warning: hsl(38, 92%, 50%);
    
    /* Shadows & Depth */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px hwb(224 0% 90% / 0.1), 0 2px 4px -2px hwb(224 0% 90% / 0.1);
    --shadow-lg: 0 10px 15px -3px hwb(224 0% 90% / 0.08), 0 4px 6px -4px hwb(224 0% 90% / 0.08);
    --shadow-xl: 0 20px 25px -5px hwb(224 0% 90% / 0.1), 0 8px 10px -6px hwb(224 0% 90% / 0.1);
    
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
}

[x-cloak] { display: none !important; }

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.011em;
    line-height: 1.6;
}

/* Premium Component Foundations */
.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.dashboard-card:hover {
    box-shadow: 0 20px 40px -10px rgba(37, 99, 235, 0.12), 0 10px 20px -5px rgba(0,0,0,0.06);
    border-color: var(--primary);
}

.btn-premium {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    box-shadow: 0 10px 15px -3px hwb(224 0% 0% / 0.15);
}

.btn-premium:hover {
    background: var(--primary-hover);
    box-shadow: 0 20px 25px -5px hwb(224 0% 0% / 0.2);
    transform: translateY(-1px);
}

.btn-premium:active { transform: scale(0.97); }

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    border-width: 1px;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-submitted { background: hsl(210, 100%, 97%); color: hsl(210, 100%, 45%); border-color: hsl(210, 100%, 90%); }
.status-verified { background: hsl(250, 100%, 97%); color: hsl(250, 100%, 60%); border-color: hsl(250, 100%, 90%); }
.status-ready_to_release { background: hsl(280, 100%, 97%); color: hsl(280, 100%, 50%); border-color: hsl(280, 100%, 90%); }
.status-bank_released { background: hsl(190, 80%, 96%); color: hsl(190, 90%, 35%); border-color: hsl(190, 80%, 90%); }
.status-settled { background: hsl(142, 70%, 96%); color: hsl(142, 70%, 30%); border-color: hsl(142, 70%, 90%); }
.status-rejected { background: #fee2e2; color: #dc2626; border-color: #fecaca; }

/* Quick Access Filter Chips */
.filter-chip {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: 1px solid var(--slate-200);
    background: white;
    font-size: 10px;
    font-weight: 900;
    color: var(--slate-600);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.filter-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

/* Status-Specific Visual Logic */
.chip-pending:hover, .chip-pending.active { border-color: var(--primary); color: var(--primary); background: hsl(var(--primary-h), var(--primary-s), 98%); }
.chip-verified:hover, .chip-verified.active { border-color: #6366f1; color: #4f46e5; background: #f5f3ff; }
.chip-release:hover, .chip-release.active { border-color: #a855f7; color: #9333ea; background: #faf5ff; }
.chip-settling:hover, .chip-settling.active { border-color: #0ea5e9; color: #0284c7; background: #f0f9ff; }
.chip-approved:hover, .chip-approved.active { border-color: #10b981; color: #059669; background: #f0fdf4; }
.chip-rejected:hover, .chip-rejected.active { border-color: #ef4444; color: #dc2626; background: #fef2f2; }

/* Table styling - Premium Data Grid */
.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.custom-table th {
    text-align: left;
    color: var(--slate-500);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 1.25rem 1.5rem;
    background: var(--slate-50);
}

.custom-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--slate-100);
    transition: background 0.2s ease;
}

.custom-table tr:hover td {
    background: var(--slate-50);
}

/* App Shell Components - Locked Enterprise Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-main);
}

.sidebar {
    width: 240px;
    background: white;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    z-index: 50;
}

.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.content-container {
    width: 100%;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.sidebar-header {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
}

.sidebar-nav {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    color: var(--slate-600);
    text-decoration: none;
    font-size: 0.825rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background: var(--slate-50);
    color: var(--primary);
}

.sidebar-item.active {
    background: #e0ecff;
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 700;
}

.sidebar-item i {
    transition: transform 0.3s ease;
}

.sidebar-item:hover i {
    color: var(--primary);
}

.sidebar-title {
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--slate-400);
    padding: 0 1.25rem;
    margin: 1rem 0 0.25rem 0;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Animations */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-slide-up {
    animation: slideUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.glass-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

/* Google-Style Identity Portal */
.google-card {
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 48px 40px 36px;
    box-shadow: none;
}

.google-input {
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 13px 15px;
    font-size: 16px;
    width: 100%;
    transition: border 0.2s, box-shadow 0.2s;
}

.google-input:focus {
    border-color: #1a73e8;
    box-shadow: inset 0 0 0 1px #1a73e8;
    outline: none;
}

.google-btn {
    background-color: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.google-btn:hover {
    background-color: #1b66ca;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.302), 0 1px 3px 1px rgba(60,64,67,0.149);
}

/* ─── Animation Definitions (Fix for continuous repaint / "blinking") ─── */
/* These classes are used throughout the app but were missing definitions.  */
/* Without them, the browser tried to resolve them on every paint cycle.    */

@keyframes __fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

@keyframes __shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-5px); }
    40%       { transform: translateX(5px); }
    60%       { transform: translateX(-3px); }
    80%       { transform: translateX(3px); }
}

.animate-fade-in {
    animation: __fadeIn 0.4s ease-out forwards;
}

.animate-fade-in-up {
    animation: __fadeInUp 0.45s ease-out both;
}

.animate-shake {
    animation: __shake 0.35s ease-in-out;
}

/* ─── Enterprise Printing Engine ─── */
/* Restores rigid browser layouts into flowing, multi-page paper documents */
@media print {
    body {
        background-color: white !important;
        color: black !important;
    }
    
    .app-container {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
        background: white !important;
    }
    
    .main-content {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .content-container {
        padding: 0 !important;
        max-width: 100% !important;
    }
    
    .dashboard-card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #e2e8f0 !important;
        background-color: white !important;
    }

    /* Force background colors to print (Chrome/Safari) */
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}
