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

:root {
    --primary: #4338ca;
    --primary-dark: #3730a3;
    --primary-light: #e0e7ff;
    --secondary: #64748b;
    --success: #10b981;
    --info: #0ea5e9;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0f172a;
    --light: #f8fafc;
    --white: #ffffff;
    
    --sidebar-width: 280px;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    
    --topbar-height: 70px;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.2);
    
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.2s ease-in-out;
}

body {
    font-family: var(--font-body);
    background-color: #f1f5f9;
    color: #334155;
    overflow-x: hidden;
    line-height: 1.6;
    font-size: 0.9375rem; /* 15px */
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 0.95rem; }

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.fade-in { animation: fadeInUp 0.5s ease-out forwards; }

/* Sidebar Layout */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--white);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 2000;
    overflow-y: auto;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), transparent);
}

.sidebar-menu {
    padding: 1.5rem 0;
    list-style: none;
}

.sidebar-header-text {
    padding: 1.5rem 1.5rem 0.5rem;
    letter-spacing: 0.1em;
    font-weight: 700;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem; /* 14px */
    margin: 4px 12px;
    border-radius: var(--radius-md);
}

.sidebar-link i {
    width: 20px;
    font-size: 1rem;
    margin-right: 12px;
    display: flex;
    justify-content: center;
}

.sidebar-link:hover {
    color: var(--white);
    background: var(--sidebar-hover);
}

.sidebar-link.active {
    color: var(--white);
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(67, 56, 202, 0.3);
}

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

.topbar {
    height: var(--topbar-height);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.content-body {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Premium Cards */
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.02) 50%);
    border-radius: 0 0 0 100px;
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 16px -4px rgba(0,0,0,0.1);
}

.stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.15rem;
}

.stat-label {
    color: var(--secondary);
    font-weight: 500;
    font-size: 0.85rem;
}

/* Glass Components */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--white);
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f1f5f9;
    transform: scale(1.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-icon i {
    font-size: 0.85rem;
}

/* Form Styles */
.form-control {
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    background-color: #fff;
    font-size: 0.95rem;
}

.form-control:focus {
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.15);
    border-color: var(--primary);
}

.btn {
    border-radius: var(--radius-md);
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.75rem;
    gap: 6px;
}

.btn-primary {
    background-color: var(--primary);
    border: none;
    box-shadow: 0 4px 12px rgba(67, 56, 202, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(67, 56, 202, 0.3);
}

/* Tables */
.table-responsive {
    border-radius: var(--radius-lg);
    overflow: visible !important; /* Allow tooltips/dropdowns to overflow */
    box-shadow: var(--card-shadow);
    background: #fff;
    padding: 1px;
}

.table {
    margin-bottom: 0;
}

/* Action Buttons Alignment */
.table td.text-end {
    white-space: nowrap !important;
}

.table td.text-end .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    vertical-align: middle;
}

.table thead th {
    background-color: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    color: var(--secondary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1.25rem 1.5rem;
}

.table tbody td {
    padding: 1.25rem 1.5rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

/* Badges */
.badge {
    padding: 0.5em 0.8em;
    border-radius: 6px;
    font-weight: 600;
}

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

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1500;
    display: none;
}

/* Profile Dropdown */
.dropdown-menu {
    border: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-radius: var(--radius-lg);
    padding: 1rem 0.5rem;
    margin-top: 10px !important;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    font-weight: 500;
    color: var(--secondary);
}

.dropdown-item i {
    width: 20px;
    margin-right: 10px;
}

.dropdown-item:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.bg-primary-light { background-color: var(--primary-light) !important; color: var(--primary) !important; }
.bg-success-light { background-color: #dcfce7 !important; color: #15803d !important; }
.bg-info-light { background-color: #e0f2fe !important; color: #0369a1 !important; }
.bg-warning-light { background-color: #fef3c7 !important; color: #a16207 !important; }
.bg-danger-light { background-color: #fee2e2 !important; color: #b91c1c !important; }

/* Auth Pages - Premium Glassmorphism */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(67, 56, 202, 0.4)), 
                url('../img/login_bg.png'); /* Fallback name, I'll update login.php to use the real one */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 2rem;
}

.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 380px;
    color: var(--white);
    animation: fadeInUp 0.8s ease-out forwards;
}

.auth-brand {
    font-size: 2.5rem;
    background: linear-gradient(to bottom, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1.5px;
    margin-bottom: 0.25rem;
}

.glass-input-group {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-input-group:focus-within {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.glass-input-group .input-group-text {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding-left: 1.25rem;
}

.glass-input-group .form-control {
    background: transparent;
    border: none;
    color: var(--white);
    padding: 0.85rem 1rem;
    font-weight: 500;
}

.glass-input-group .form-control::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.glass-input-group .form-control:focus {
    box-shadow: none;
    background: transparent;
    color: var(--white);
}

.btn-premium {
    background: #ffffff;
    color: var(--dark);
    border: none;
    border-radius: var(--radius-md);
    padding: 0.85rem 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.2);
}

.btn-premium:hover {
    background: var(--primary-light);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3);
    color: var(--primary);
}

.btn-premium:active {
    transform: translateY(-1px);
}
