:root {
    --bg-color: #f8f9fa;
    --text-primary: #202124;
    --text-muted: #5f6368;
    --primary-color: #1a73e8;
    --primary-hover: #174ea6;
    --glass-bg: #ffffff;
    --glass-border: #dadce0;
    --warning: #f9ab00;
    --danger: #ea4335;
    --success: #34a853;
    --card-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

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

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Gradients */
.bg-shape {
    display: none;
}

.shape-1 {
    display: none;
}

.shape-2 {
    display: none;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    padding: 1rem;
    gap: 1.5rem;
}

/* Glassmorphism */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}

/* Sidebar */
.sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    flex-shrink: 0;
    position: sticky;
    top: 1rem;
    height: calc(100vh - 2rem);
}

.brand {
    font-family: 'Roboto', sans-serif;
    font-size: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.brand-icon {
    color: #2563eb;
}

.nav-menu {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nav-section {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.hidden {
    display: none !important;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0 24px 24px 0;
    margin-left: -1.5rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.nav-item:hover {
    background: #f1f3f4;
    color: var(--text-primary);
}

.nav-item.active {
    background: #e8f0fe;
    color: var(--primary-color);
    font-weight: 600;
}

/* User Profile Sidebar */
.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 1.1rem;
    color: white;
}

.user-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.logout-btn:hover {
    color: var(--danger);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    min-width: 0;
}

.main-content::-webkit-scrollbar {
    width: 6px;
}
.main-content::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.2);
    border-radius: 10px;
}

/* Loader */
.loader-container {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    gap: 1.5rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(15, 23, 42, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

/* Header */
.top-header {
    margin-bottom: 2.5rem;
    margin-top: 1rem;
}

.gradient-text {
    font-family: 'Roboto', sans-serif;
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: box-shadow 0.2s ease;
}

.stat-card:hover {
    box-shadow: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.stat-icon.info { background: rgba(37, 99, 235, 0.1); color: var(--primary-color); border: 1px solid rgba(37, 99, 235, 0.2); }
.stat-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }

.stat-content h3 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.stat-value {
    font-family: 'Roboto', sans-serif;
    font-size: 2rem;
    font-weight: 400;
}

/* Alerts */
.alert-box {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    margin-bottom: 2rem;
    border-radius: 12px;
}

.alert-box.warning {
    background: rgba(245, 158, 11, 0.05);
    border-left: 4px solid var(--warning);
}

.alert-box.warning svg { color: var(--warning); }
.alert-box h4 { margin-bottom: 0.25rem; font-size: 1rem; }
.alert-box p { color: var(--text-muted); font-size: 0.9rem; }

/* Dashboard Tables */
.table-container {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.tabs {
    display: flex;
    gap: 2rem;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 0;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
    transition: color 0.2s;
}

.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--text-primary); }
/* Tabs */
.tab-content { display: none; }
.tab-content.active { display: block; }
.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

/* Demo Role Switcher */
.demo-switcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    padding: 0.75rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    border-radius: 12px;
}
.demo-switcher select {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    outline: none;
}
.demo-switcher select option { background: var(--bg-color); }

.badge {
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 12px;
    margin-left: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 600;
}

.badge-grey {
    background: #cbd5e1;
    color: #475569;
}

@keyframes spin { 
    100% { transform: rotate(360deg); } 
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
}

.data-table td {
    padding: 1rem;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
    vertical-align: middle;
}

.data-table tr:hover {
    background: rgba(15, 23, 42, 0.02);
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.tag-danger { background: rgba(239, 68, 68, 0.1); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.tag-warning { background: rgba(249, 115, 22, 0.1); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.3); }
.tag-info { background: rgba(59, 130, 246, 0.1); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.tag-success { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }

/* Buttons */
.btn {
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}
.btn-primary:hover { 
    background: var(--primary-hover);
    box-shadow: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid #dadce0;
}
.btn-secondary:hover { background: #f1f3f4; border-color: transparent; }

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal {
    padding: 2rem;
    max-width: 450px;
    width: 90%;
}

.modal-title { font-size: 1.25rem; margin-bottom: 1rem; }
.modal p { color: var(--text-muted); margin-bottom: 2rem; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 1rem; }

/* Utilities */
.p-6 { padding: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.text-warning { color: var(--warning); }

/* Modern Pill Filters */
.filter-pill {
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 9999px;
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.03);
    color: var(--text-muted);
    padding: 0.45rem 1.25rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    user-select: none;
}
.filter-pill:hover {
    background: rgba(15, 23, 42, 0.08);
}

/* Default Blue */
.filter-pill input:checked + span { color: var(--primary-color); }
.filter-pill:has(input:checked) { background: rgba(37, 99, 235, 0.1); border-color: rgba(37, 99, 235, 0.3); color: var(--primary-color); }

/* Danger (Red) */
.filter-pill[data-risk="danger"] input:checked + span { color: #f87171; }
.filter-pill[data-risk="danger"]:has(input:checked) { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); }

/* Warning (Orange) */
.filter-pill[data-risk="warning"] input:checked + span { color: #fb923c; }
.filter-pill[data-risk="warning"]:has(input:checked) { background: rgba(249, 115, 22, 0.1); border-color: rgba(249, 115, 22, 0.3); }

/* Info (Blue) */
.filter-pill[data-risk="info"] input:checked + span { color: #60a5fa; }
.filter-pill[data-risk="info"]:has(input:checked) { background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.3); }

/* Card List Container */
.risk-list { display: flex; flex-direction: column; gap: 1rem; padding: 1rem 0; }
.risk-card { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-radius: 8px; border: 1px solid var(--glass-border); transition: box-shadow 0.2s; background: #ffffff; }
.risk-card:hover { box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15); }

.risk-card-info { background: rgba(59, 130, 246, 0.05); border-color: rgba(59, 130, 246, 0.2); }
.risk-card-info .rc-icon { color: #3b82f6; }
.risk-card-info .rc-subtitle { color: #60a5fa; } 

.risk-card-warning { background: rgba(245, 158, 11, 0.05); border-color: rgba(245, 158, 11, 0.2); }
.risk-card-warning .rc-icon { color: #f59e0b; }
.risk-card-warning .rc-subtitle { color: #f59e0b; } 

.risk-card-danger { background: rgba(239, 68, 68, 0.05); border-color: rgba(239, 68, 68, 0.2); }
.risk-card-danger .rc-icon { color: #ef4444; }
.risk-card-danger .rc-subtitle { color: #ef4444; font-weight: 500; }

.risk-card-left { display: flex; align-items: center; gap: 1.25rem; }
.rc-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; }
.rc-icon svg { width: 28px; height: 28px; }
.rc-details { display: flex; flex-direction: column; gap: 0.25rem; }
.rc-title { font-weight: 700; font-size: 1rem; margin: 0; color: var(--text-primary); }
.rc-subtitle { font-size: 0.85rem; margin: 0; }
.risk-card-actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }

.btn-action-fix { background: #e11d48; color: white; padding: 0.6rem 1.5rem; border-radius: 8px; font-weight: 700; border: none; cursor: pointer; transition: 0.2s; white-space: nowrap;}
.btn-action-fix:hover { background: #be123c; }

.btn-action-fix-warning { background: #f59e0b; color: white; padding: 0.6rem 1.5rem; border-radius: 8px; font-weight: 700; border: none; cursor: pointer; transition: 0.2s; white-space: nowrap;}
.btn-action-fix-warning:hover { background: #d97706; }

.btn-action-fix-info { background: #2563eb; color: white; padding: 0.6rem 1.5rem; border-radius: 8px; font-weight: 700; border: none; cursor: pointer; transition: 0.2s; white-space: nowrap;}
.btn-action-fix-info:hover { background: #1d4ed8; }

.btn-accept { background: rgba(148, 163, 184, 0.1) !important; color: #94a3b8 !important; border: 1px solid rgba(148, 163, 184, 0.2) !important; font-weight: 600; padding: 0.6rem 1.5rem; border-radius: 8px; cursor: pointer; transition: 0.2s; white-space: nowrap;}
.btn-accept:hover { background: rgba(148, 163, 184, 0.2) !important; color: var(--text-primary) !important; }

/* Switch Toggle Styling */
.switch input:checked + .slider {
    background-color: var(--primary-color) !important;
}

.switch input:checked + .slider:before {
    transform: translateX(22px);
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
