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

:root {
    /* Color Palette - Premium Indigo Theme */
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #3730a3;
    --secondary: #0ea5e9;
    --accent: #f43f5e;
    
    /* Backgrounds */
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-sidebar: rgba(255, 255, 255, 0.8);
    
    /* Text */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-inverse: #ffffff;
    
    /* Borders & Shadows */
    --border-color: #e2e8f0;
    --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);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 70px;
    --transition: all 0.3s ease;
}

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

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
    /* Soft background blob pattern for premium feel */
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,0) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,0) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,0) 0, transparent 50%);
}

/* Glassmorphism Utilities */
.glass {
    background: var(--bg-sidebar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    box-shadow: var(--glass-shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    left: calc(-1 * var(--sidebar-width));
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand span {
    color: var(--text-main);
    margin-left: 0.5rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1rem;
}

.nav-item {
    list-style: none;
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
    transform: translateX(5px);
}

.nav-link i {
    margin-right: 1rem;
    font-size: 1.25rem;
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-wrapper.expanded {
    margin-left: 0;
}

/* Header */
.header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: var(--shadow-sm);
    z-index: 90;
    position: sticky;
    top: 0;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
}

.toggle-btn {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.toggle-btn:hover {
    color: var(--primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* Content Area */
.content {
    padding: 2rem;
    flex: 1;
}

.page-title {
    margin-bottom: 2rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-right: 1.5rem;
}

.stat-icon.blue { background: rgba(14, 165, 233, 0.1); color: var(--secondary); }
.stat-icon.indigo { background: rgba(79, 70, 229, 0.1); color: var(--primary); }
.stat-icon.red { background: rgba(244, 63, 94, 0.1); color: var(--accent); }
.stat-icon.green { background: rgba(16, 185, 129, 0.1); color: #10b981; }

.stat-details h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-details h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--text-inverse);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

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

/* Tables */
.table-container {
    background: var(--bg-surface);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-top: 1rem;
}

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

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

.table th {
    background-color: rgba(248, 250, 252, 0.8);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tbody tr {
    transition: var(--transition);
}

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

/* Forms */
.form-container {
    background: var(--bg-surface);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    margin-top: 1rem;
    max-width: 800px;
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    transition: var(--transition);
    background-color: #f8fafc;
}

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

.invalid-feedback {
    color: var(--accent);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
}

/* Action Buttons */
.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.btn-secondary {
    background-color: #e2e8f0;
    color: var(--text-main);
}
.btn-secondary:hover {
    background-color: #cbd5e1;
}

.btn-danger {
    background-color: rgba(244, 63, 94, 0.1);
    color: var(--accent);
}
.btn-danger:hover {
    background-color: var(--accent);
    color: white;
}

.btn-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: #d97706;
}
.btn-warning:hover {
    background-color: #f59e0b;
    color: white;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}
.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Dropdown menu */
.nav-dropdown {
    display: none;
    padding-left: 2rem;
    margin-top: 0.25rem;
}
.nav-item.has-dropdown.open .nav-dropdown {
    display: block;
}
.nav-item.has-dropdown .nav-link .bx-chevron-down {
    margin-left: auto;
    margin-right: 0;
    transition: var(--transition);
}
.nav-item.has-dropdown.open .nav-link .bx-chevron-down {
    transform: rotate(180deg);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        left: calc(-1 * var(--sidebar-width));
    }
    .sidebar.mobile-open {
        left: 0;
    }
    .main-wrapper {
        margin-left: 0;
    }
}

/* Login Page Specific Styles */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 450px;
    z-index: 10;
}

.login-card {
    padding: 3rem 2.5rem;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-lg);
}

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

.login-logo {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    color: white;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.4);
}

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

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

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.25rem;
}

.input-with-icon .form-control {
    padding-left: 2.75rem;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-top: -0.5rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-muted);
}

.checkbox-container input {
    margin-right: 0.5rem;
    accent-color: var(--primary);
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}

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