/* ==========================================================================
   Westfield Contractors Claims Management System
   Exact Design System & Aesthetics (Matching westfield-contractors)
   ========================================================================== */

:root {
    /* Brand Colors */
    --color-navy: #1a1a24;
    --color-navy-light: #2a2a35;
    --color-navy-dark: #121218;
    --color-orange: #F37F31;
    --color-orange-hover: #D96A22;
    --color-white: #FFFFFF;
    --color-grey-light: #F4F5F7;
    --color-grey: #9AA0A6;

    /* Status Colors */
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;
    --color-info: #3B82F6;
    --color-purple: #8B5CF6;
    --color-teal: #14B8A6;

    /* Glassmorphism Variables */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-bg-card: rgba(42, 42, 53, 0.6);
    --glass-bg-hover: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(12px);

    /* Typography */
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Transitions & Shadows */
    --transition-smooth: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    --glow-shadow: 0 0 15px rgba(243, 127, 49, 0.4);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Light Theme Mode Overrides */
body.light-mode {
    --color-navy: #F1F5F9;
    --color-navy-light: #FFFFFF;
    --color-navy-dark: #E2E8F0;
    --color-white: #0F172A;
    --color-grey: #64748B;
    --glass-bg-card: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(203, 213, 225, 0.8);
    background: #F8FAFC;
    color: #0F172A;
}

body.light-mode .navbar {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid #E2E8F0;
}

body.light-mode .input-field, 
body.light-mode .select-field {
    background: #FFFFFF;
    border-color: #CBD5E1;
    color: #0F172A;
}

body.light-mode .custom-table th {
    background: #F1F5F9;
    color: #475569;
}

body.light-mode .custom-table td {
    background: #FFFFFF;
    color: #0F172A;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background: radial-gradient(circle at top right, #2a2a35 0%, #1a1a24 40%, #121218 100%);
    background-attachment: fixed;
    color: var(--color-white);
    line-height: 1.6;
    min-height: 100vh;
}

/* App Header & Navigation */
.navbar {
    background: rgba(18, 18, 24, 0.85);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--color-orange) 0%, #ff5e00 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-navy-dark);
    font-weight: 900;
    font-size: 20px;
    box-shadow: var(--glow-shadow);
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.brand-title span {
    color: var(--color-orange);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
}

.nav-link {
    color: var(--color-grey);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 14px;
    border-radius: 20px;
    transition: var(--transition-smooth);
}

.nav-link:hover, .nav-link.active {
    color: var(--color-white);
    background: var(--glass-bg-hover);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 6px 14px;
    border-radius: 30px;
}

.role-pill {
    background: var(--color-orange);
    color: var(--color-navy-dark);
    font-weight: 800;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

/* Layout Containers */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
}

/* Glass Cards */
.glass-card {
    background: var(--glass-bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: rgba(243, 127, 49, 0.3);
}

/* KPI Dashboard Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--color-orange);
}

.kpi-label {
    font-size: 0.875rem;
    color: var(--color-grey);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-white);
}

.kpi-subtext {
    font-size: 0.8rem;
    color: var(--color-grey);
    margin-top: 4px;
}

/* Analytics Charts Section */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Data Table Component */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.input-field, .select-field {
    width: 100%;
    background: rgba(26, 26, 36, 0.8);
    border: 1px solid var(--glass-border);
    color: var(--color-white);
    padding: 10px 16px;
    border-radius: 10px;
    font-family: var(--font-main);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

.input-field:focus, .select-field:focus {
    border-color: var(--color-orange);
    box-shadow: 0 0 0 2px rgba(243, 127, 49, 0.2);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.custom-table th {
    background: rgba(18, 18, 24, 0.9);
    color: var(--color-grey);
    font-weight: 600;
    padding: 14px 16px;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}

.custom-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--glass-border);
    vertical-align: middle;
    background: rgba(42, 42, 53, 0.2);
}

.custom-table tr:hover td {
    background: rgba(255, 255, 255, 0.04);
}

/* Status Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
    text-align: center;
}

.badge-in-progress { background: rgba(59, 130, 246, 0.2); color: #60A5FA; border: 1px solid rgba(59, 130, 246, 0.4); }
.badge-complete { background: rgba(16, 185, 129, 0.2); color: #34D399; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-closed { background: rgba(100, 116, 139, 0.2); color: #94A3B8; border: 1px solid rgba(100, 116, 139, 0.4); }
.badge-cancelled { background: rgba(239, 68, 68, 0.2); color: #F87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.badge-awaiting { background: rgba(245, 158, 11, 0.2); color: #FBBF24; border: 1px solid rgba(245, 158, 11, 0.4); }

.badge-invoiced { background: rgba(139, 92, 246, 0.2); color: #A78BFA; border: 1px solid rgba(139, 92, 246, 0.4); }
.badge-paid { background: rgba(16, 185, 129, 0.2); color: #34D399; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-pending { background: rgba(245, 158, 11, 0.2); color: #FBBF24; border: 1px solid rgba(245, 158, 11, 0.4); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-orange) 0%, #ff5e00 100%);
    color: var(--color-navy-dark);
    font-weight: 800;
    box-shadow: var(--glow-shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 127, 49, 0.6);
}

.btn-secondary {
    background: var(--glass-bg-hover);
    color: var(--color-white);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 20px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.page-numbers {
    display: flex;
    gap: 8px;
}

.page-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--color-white);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.page-btn.active, .page-btn:hover {
    background: var(--color-orange);
    color: var(--color-navy-dark);
    font-weight: 700;
}

/* Login Screen Styling */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(26, 26, 36, 0.9);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    backdrop-filter: var(--glass-blur);
}

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #F87171;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34D399;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 12px;
    }
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .custom-table th, .custom-table td {
        padding: 10px;
    }
}
