:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --bg-color: #F1F5F9; /* Light mode background base */
    --surface-color: rgba(255, 255, 255, 0.65); /* Glassmorphism light surface */
    --border-color: rgba(255, 255, 255, 0.8); /* Solid white border for light glass */
    --text-primary: #0F172A; /* Dark slate text */
    --text-secondary: #475569; /* Medium slate text */
    --danger: #EF4444;
    --success: #10B981;
    --warning: #F59E0B;
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Animated vibrant light gradient */
    background: linear-gradient(-45deg, #F8FAFC, #E0E7FF, #C7D2FE, #F1F5F9);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    background-attachment: fixed;
}

/* Background gradient animation */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Glassmorphism */
.glass-panel {
    background: var(--surface-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 12px;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary {
    color: #fff;
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

.btn-success {
    color: #fff;
    background-color: var(--success);
    border-color: var(--success);
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.4);
}

.btn-block {
    display: block;
    width: 100%;
}

/* Utilities */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #DC2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

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

.sidebar {
    width: 250px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 15px -5px rgba(0,0,0,0.05);
    z-index: 10;
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

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

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 600;
}

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

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.topbar {
    height: 70px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: 0 4px 15px -5px rgba(0,0,0,0.02);
    z-index: 5;
}

.content-area {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

/* Cards */
.card {
    background: var(--surface-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.08);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background: transparent;
}

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

.table th {
    font-weight: 700;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table tbody tr {
    transition: background-color 0.2s;
}

.table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

/* Flex utilities for forms */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.75rem;
}

.col-md-6 {
    width: 50%;
    padding: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1rem;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .sidebar-header {
        padding: 0;
        margin: 0;
        border: none;
    }
    
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        width: 100%;
        margin-top: 1rem;
    }
    
    .sidebar-nav ul {
        display: flex;
    }
    
    .sidebar-nav li a {
        padding: 0.5rem 1rem;
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
    }
    
    .sidebar-nav li a:hover, .sidebar-nav li a.active {
        border-left: none;
        border-bottom: 3px solid var(--primary);
        background: transparent;
    }
    
    .topbar {
        padding: 0 1rem;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .col-md-6 {
        width: 100%;
    }
}
