:root {
    /* Color Palette */
    --primary: #4F46E5; /* Indigo */
    --primary-hover: #4338CA;
    --secondary: #06B6D4; /* Cyan - AI feel */
    --accent: #8B5CF6; /* Violet */
    --bg-body: #F3F4F6;
    --bg-card: #FFFFFF;
    --bg-sidebar: #111827;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --text-light: #F9FAFB;
    --border: #E5E7EB;
    
    /* Status Colors */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Shadows & Radius */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition: all 0.2s ease;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
p { margin: 0; line-height: 1.5; color: var(--text-muted); }

/* Layout Structure */
.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    padding: var(--spacing-lg);
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    padding: var(--spacing-xl);
    overflow-y: auto;
}

/* Sidebar Components */
.brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-light);
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 12px 16px;
    color: #9CA3AF;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-weight: 500;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.2) 0%, rgba(79, 70, 229, 0) 100%);
    color: var(--primary-light);
    border-left: 3px solid var(--secondary);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: var(--bg-card);
    padding: 6px 16px 6px 6px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

/* Cards & Containers */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--spacing-lg);
    border: 1px solid rgba(0,0,0,0.02);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-lg);
}

/* Stats */
.stat-card {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
}

.stat-trend {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

/* AI Camera Interface */
.camera-container {
    position: relative;
    width: 100%;
    height: 500px;
    background-color: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-feed-sim {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    background: linear-gradient(45deg, #1f2937, #111827);
    position: relative;
}

.scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.face-box {
    position: absolute;
    border: 2px solid var(--secondary);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
    border-radius: 4px;
}

.face-label {
    position: absolute;
    top: -30px;
    left: -2px;
    background: var(--secondary);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.face-confidence {
    background: rgba(0,0,0,0.2);
    padding: 1px 4px;
    border-radius: 2px;
}

.live-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Tables */
.table-container {
    overflow-x: auto;
}

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

th {
    text-align: left;
    padding: 16px;
    border-bottom: 2px solid var(--border);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

tr:hover td {
    background-color: #F9FAFB;
}

/* Badges & Buttons */
.badge {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #4338CA 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--text-muted);
    background: #F9FAFB;
}

/* Utilities */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-col { display: flex; flex-direction: column; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.w-full { width: 100%; }

/* Placeholders */
.placeholder-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #E5E7EB;
}

.placeholder-icon {
    width: 20px;
    height: 20px;
    background-color: currentColor;
    opacity: 0.7;
    mask-size: contain;
    mask-position: center;
    mask-repeat: no-repeat;
}
