:root {
    /* Clean White & Royal Blue Design System */
    --bg-primary: #f8fafc;
    --bg-surface: #ffffff;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #ffffff;
    
    --border-color: #e2e8f0;
    --border-subtle: #edf2f7;
    --border-glow: rgba(37, 99, 235, 0.25);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --accent-blue: #2563eb;
    --accent-blue-hover: #1d4ed8;
    --accent-blue-light: #eff6ff;
    --accent-blue-border: #bfdbfe;
    
    --accent-purple: #7c3aed;
    --accent-purple-light: #f5f3ff;
    --accent-emerald: #059669;
    --accent-emerald-light: #ecfdf5;
    --accent-amber: #d97706;
    --accent-amber-light: #fffbeb;
    --accent-rose: #e11d48;
    --accent-rose-light: #fff1f2;
    
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --gradient-hero: linear-gradient(135deg, #eff6ff 0%, #ffffff 50%, #f0fdf4 100%);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
    --shadow-card: 0 2px 12px rgba(15, 23, 42, 0.06);
    --shadow-hover: 0 12px 24px -4px rgba(37, 99, 235, 0.12);
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Subtle background accent glow */
body::before {
    content: '';
    position: fixed;
    top: -150px;
    right: -150px;
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.06) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
    z-index: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    line-height: 1.25;
}

p {
    color: var(--text-secondary);
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: all 0.2s ease;
}
a:hover {
    color: var(--accent-blue-hover);
}

/* Main Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: #ffffff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
    box-shadow: 1px 0 3px rgba(0,0,0,0.02);
}

.sidebar-header {
    padding: 22px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-badge {
    background: var(--gradient-primary);
    color: white;
    font-weight: 800;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.brand-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.06em;
}

.sidebar-nav {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 12px 10px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.18s ease;
    border: 1px solid transparent;
}

.nav-item:hover {
    background-color: var(--bg-secondary);
    color: var(--accent-blue);
    transform: translateX(2px);
}

.nav-item.active {
    background-color: var(--accent-blue-light);
    color: var(--accent-blue);
    border-color: var(--accent-blue-border);
    font-weight: 600;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.user-snippet {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-role-badge {
    font-size: 10px;
    color: var(--accent-emerald);
    font-weight: 600;
    text-transform: uppercase;
}

/* Main Content Area */
.main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 100vh;
}

.topbar {
    height: 64px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.search-box-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 13px;
    width: 380px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-box-trigger:hover {
    background: #ffffff;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.kbd-shortcut {
    margin-left: auto;
    background: #e2e8f0;
    color: var(--text-secondary);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-weight: 600;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Content Container */
.content-body {
    padding: 32px;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    flex-grow: 1;
}

/* Clean White Card */
.glass-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: all 0.25s ease;
    position: relative;
}

.glass-card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-family: var(--font-sans);
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-primary);
    border-color: var(--border-color);
    box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: #cbd5e1;
    color: var(--accent-blue);
}

.btn-emerald {
    background: #059669;
    color: white !important;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}
.btn-emerald:hover {
    background: #047857;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--accent-rose-light);
    color: var(--accent-rose) !important;
    border-color: #fecdd3;
}
.btn-danger:hover {
    background: #e11d48;
    color: white !important;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
    border-radius: var(--radius-md);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-blue { background: var(--accent-blue-light); color: var(--accent-blue); border: 1px solid var(--accent-blue-border); }
.badge-emerald { background: var(--accent-emerald-light); color: #047857; border: 1px solid #a7f3d0; }
.badge-amber { background: var(--accent-amber-light); color: #b45309; border: 1px solid #fde68a; }
.badge-rose { background: var(--accent-rose-light); color: #be123c; border: 1px solid #fecdd3; }
.badge-purple { background: var(--accent-purple-light); color: #6d28d9; border: 1px solid #ddd6fe; }

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-xs);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

select.form-control {
    background-color: #ffffff;
}

textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

/* Flash Messages */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid transparent;
}
.alert-success { background: var(--accent-emerald-light); border-color: #a7f3d0; color: #065f46; }
.alert-danger { background: var(--accent-rose-light); border-color: #fecdd3; color: #9f1239; }
.alert-warning { background: var(--accent-amber-light); border-color: #fde68a; color: #92400e; }
.alert-info { background: var(--accent-blue-light); border-color: var(--accent-blue-border); color: #1e40af; }

/* Grid Utilities */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; }
    .grid-2, .grid-4 { grid-template-columns: 1fr; }
    .content-body { padding: 16px; }
    .search-box-trigger { width: 100%; }
}
