:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --success-color: #10b981;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Layout */
.app-container {
    display: flex;
    flex: 1;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    background: var(--glass-bg);
    border-right: 1px solid var(--glass-border);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
}

.sidebar .brand {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav ul li a {
    display: block;
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: background 0.3s, padding-left 0.3s;
}

.sidebar nav ul li a:hover, .sidebar nav ul li a.active {
    background: rgba(255, 255, 255, 0.05);
    border-left: 4px solid var(--primary-color);
    padding-left: 24px;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

/* Typography & General */
h1, h2, h3 {
    margin-bottom: 20px;
    font-weight: 600;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

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

label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #cbd5e1;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    transition: background 0.3s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    text-decoration: none;
}

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

.btn-info {
    background-color: #0ea5e9;
    color: white;
}
.btn-info:hover {
    background-color: #0284c7;
    text-decoration: none;
}

.btn-secondary {
    background-color: #64748b;
    color: white;
}
.btn-secondary:hover {
    background-color: #475569;
    text-decoration: none;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

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

table th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
}

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

/* Auth Layout */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.auth-box {
    width: 100%;
    max-width: 400px;
}

/* Alerts */
.alert {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}
.alert-danger {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--danger-color);
    color: #fca5a5;
}
.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--success-color);
    color: #6ee7b7;
}

/* Micro animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Mobile Responsiveness */
.mobile-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.brand-mobile {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.menu-toggle {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.close-sidebar {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 2rem;
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    line-height: 1;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    backdrop-filter: blur(3px);
}
.sidebar-overlay.active {
    display: block;
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .mobile-header {
        display: flex;
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 260px;
        z-index: 9999;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.5);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar .brand {
        margin-top: 30px; /* space for close button */
    }
    
    .close-sidebar {
        display: block;
    }
    
    .main-content {
        padding: 15px;
    }

    .form-group, .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* override some inner button flex containers if any */
    .btn {
        justify-content: center;
    }

    .glass-panel {
        padding: 15px;
    }
    
    table th, table td {
        padding: 10px;
        font-size: 0.85rem;
    }
}
