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

:root {
    /* Stitch 'Crystal Light' Design System */
    --bg-main: #f8f9ff; 
    --bg-white: #ffffff;
    --sidebar-bg: #ffffff;
    --sidebar-hover: #f1f7fe;
    --sidebar-border: rgba(191, 199, 210, 0.15);
    --sidebar-text: #334155;
    --sidebar-active-text: #006194;
    --sidebar-active-bg: #eff4ff;
    --sidebar-shadow: 0 12px 32px -4px rgba(13, 28, 47, 0.04);
    
    --accent: #006194;
    --accent-hover: #004b73;
    --accent-soft: rgba(0, 97, 148, 0.08);
    
    --text-main: #0d1c2f;
    --text-muted: #3f4850;
    --text-light: #707881;
    
    --border-light: rgba(191, 199, 210, 0.15);
    --border-card: rgba(191, 199, 210, 0.1);
    
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --sunlight-shadow: 0 12px 32px -4px rgba(13, 28, 47, 0.06);
    --glass-blur: blur(12px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
    font-size: 14px;
    line-height: normal;
}

/* Sidebar Refinement */
.sidebar {
    width: 250px;
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
    z-index: 1000;
    transition: width 0.3s ease;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    margin: 0.2rem 0.85rem;
    border-radius: 10px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    position: relative;
    transition: background 0.2s ease, color 0.2s ease;
    border: 1px solid transparent;
    opacity: 1 !important; /* Ensure always visible */
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-active-text);
    border-color: rgba(0, 78, 245, 0.1);
}

.nav-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 700;
    border-color: rgba(0, 78, 245, 0.2);
    box-shadow: 0 2px 4px rgba(0, 78, 245, 0.05);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 3px;
    background: var(--accent);
    border-radius: 0 4px 4px 0;
}

.nav-link i, .nav-link svg {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
    opacity: 1 !important;
}

.nav-link span {
    opacity: 1 !important;
}

.nav-link svg,
.nav-link i {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

.nav-link.active i,
.nav-link.active svg {
    opacity: 1;
}

/* Section Sidebar Headers */
.section-header {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    padding: 1.75rem 1.5rem 0.5rem;
    transition: color 0.3s ease;
}

.section-header:hover {
    color: var(--accent);
}

/* Header / Top Bar */
header {
    background: rgba(255, 255, 255, 0.8);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-light);
    padding: 0.75rem 2rem;
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
}

.glass-bg {
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--sunlight-shadow);
}

.glass {
    background: #ffffff;
    border: 1px solid var(--border-light);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.card-modal {
    background: #ffffff;
    border: 1px solid var(--border-light);
    box-shadow: 0 25px 50px -12px rgba(13, 28, 47, 0.15);
}

/* Card - Minimalist Style (Stitch) */
.card-white {
    background: var(--bg-white);
    border: none;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--sunlight-shadow);
    transition: transform 0.3s ease;
}

.card-white:hover {
    transform: translateY(-2px);
}

/* KPI / Stat Cards */
.stat-card {
    background: var(--bg-white);
    border: none;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--sunlight-shadow);
}

/* Tables - Professional Refinement */
.table-container {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead tr {
    background: #f8fafc;
    border-bottom: 1px solid var(--border-light);
}

th {
    padding: 1rem;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-card);
    font-size: 13.5px;
    color: var(--text-main);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #f9fafb;
}

/* Professional Inputs */
.input-field {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 14px;
    color: var(--text-main);
    transition: all 0.2s ease;
    width: 100%;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Badge Styles */
.badge {
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* Buttons Refinement */
.btn-primary {
    background: var(--accent);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 13.5px;
    transition: background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 78, 245, 0.2);
}

/* Print Utilities */
@media print {
    .sidebar, header, .no-print { display: none !important; }
    main { margin-left: 0 !important; }
    body { background: white !important; }
    .card-white { border: 1px solid #ddd !important; box-shadow: none !important; }
}