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

:root {
    /* Color Palette - Premium Criteria Blue */
    --primary: #1e3a8a;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --primary-gradient: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    --accent: #0ea5e9;
    
    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Neutrals - Light Mode (Default) */
    --bg-main: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.7);
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-on-primary: #ffffff;
    
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Layout Constants */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
}

[data-theme="dark"] {
    --bg-main: #020617;
    --bg-sidebar: #0f172a;
    --bg-card: #1e293b;
    --bg-glass: rgba(15, 23, 42, 0.7);
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    
    --border: #334155;
    --border-light: #1e293b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Login Specific Styles */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    animation: fadeIn 0.5s ease-out;
}

.login-container {
    width: 100%;
    max-width: 440px;
    animation: slideIn 0.5s ease-out;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-xl);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    display: block;
}

.login-btn {
    width: 100%;
    padding: 14px;
    margin-top: 12px;
    font-size: 1rem;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.qr-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.qr-placeholder {
    width: 120px;
    height: 120px;
    margin: 16px auto;
    background: var(--border-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border: 2px dashed var(--border);
}

/* Dashboard Layout Styles (from styles.css) */
#app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition-base);
    overflow-y: auto;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items:center;
    padding: 0 24px;
    gap: 12px;
}

.logo-img { width: 32px; height: 32px; object-fit: contain; }
.brand-name { font-weight: 800; font-size: 1.25rem; background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.nav-menu { padding: 12px; flex-grow: 1; }
.nav-group-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 16px 12px 8px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.925rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
}

.nav-item:hover { background: var(--border-light); color: var(--primary-light); }
.nav-item.active { background: var(--primary-gradient); color: white; box-shadow: var(--shadow-md); }

.nav-icon { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; }

.submenu { padding-left: 32px; display: none; }
.submenu.open { display: block; }
.submenu .nav-item { padding: 8px 12px; font-size: 0.875rem; }

.main-layout {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

header {
    height: var(--header-height);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.content-body { padding: 32px; flex-grow: 1; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin-bottom: 32px; }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.table-container { 
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-top: 24px;
}

table { width: 100%; border-collapse: collapse; text-align: left; }
thead { background: var(--bg-main); }
th { padding: 16px 24px; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
td { padding: 16px 24px; border-top: 1px solid var(--border); font-size: 0.875rem; color: var(--text-main); }
tr:hover { background: var(--border-light); }

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

.btn-primary { background: var(--primary-gradient); color: white; }
.btn-primary:hover { opacity: 0.9; box-shadow: var(--shadow-md); }

.btn-secondary { background: var(--border-light); color: var(--text-main); }
.btn-secondary:hover { background: var(--border); }

.badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-info { background: rgba(59, 130, 246, 0.1); color: var(--info); }

@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.screen { animation: slideIn 0.3s ease-out forwards; display: none; }
.screen.active { display: block; }

.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.form-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 1rem;
    transition: all var(--transition-fast);
}
.form-input:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 80px;
    }
    .nav-label, .brand-name, .nav-group-label { display: none; }
    .nav-item { justify-content: center; padding: 12px; }
    .sidebar-header { justify-content: center; padding: 0; }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 260px;
    }
    .sidebar { position: fixed; left: -100%; top: 0; height: 100vh; z-index: 1000; }
    .sidebar.open { left: 0; }
    .main-layout { width: 100%; }
    .nav-label, .brand-name, .nav-group-label { display: flex; }
    
    .mobile-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 8px;
        cursor: pointer;
        margin-right: 12px;
    }
}

/* Modal System */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    animation: slideIn 0.3s ease-out;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.mobile-toggle { display: none; }
