:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-glass: rgba(30, 41, 59, 0.7);
    --border-glass: rgba(255, 255, 255, 0.1);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, #0f172a 0%, #020617 100%);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Login */
.login-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-box {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    color: var(--accent);
}

/* Forms */
.input-group {
    text-align: left;
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.input-group .hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

input, select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-glass);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

input:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.btn-primary {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-outline {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
}

.error-msg {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 1rem;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 260px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    border-right: 1px solid var(--border-glass);
    border-top: none; border-bottom: none; border-left: none;
}

.sidebar nav {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
}

header {
    margin-bottom: 2rem;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 600;
}

.subtitle {
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

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

.stat-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card.highlight {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(30, 41, 59, 0.7) 100%);
    border-color: rgba(16, 185, 129, 0.3);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    display: flex;
    justify-content: center;
    align-items: center;
}
.stat-card.highlight .stat-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-info h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-info h2 {
    font-size: 1.5rem;
    margin-top: 0.25rem;
}

.charts-container {
    padding: 1.5rem;
    height: 400px;
}

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

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

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
}

th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge.green { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge.orange { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge.red { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.badge.admin { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-box {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
}

.modal-box h2 {
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    margin-right: 0.5rem;
}
.btn-small:hover {
    background: rgba(255,255,255,0.1);
}
.btn-small.del {
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}
.btn-small.del:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Password Toggle and Form Select */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.password-wrapper input {
    width: 100%;
    padding-right: 40px;
}
.icon-btn {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.icon-btn:hover {
    color: var(--text-primary);
}
.form-select {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
}
.form-select option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}
.form-input-date {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
}
/* Style the calendar icon in date inputs for webkit */
.form-input-date::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.6;
    cursor: pointer;
}
.form-input-date::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}
