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

:root {
    --primary: #0A4784;
    --primary-light: #1664B1;
    --primary-dark: #052C54;
    --primary-subtle: #E8F1FA;
    --primary-gradient: linear-gradient(135deg, #0A4784 0%, #1664B1 100%);

    --background: #F4F7FA;
    --surface: #FFFFFF;
    
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;

    --border: #E2E8F0;
    --border-light: #F1F5F9;

    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.02);
    --shadow-float: 0 20px 25px -5px rgba(10, 71, 132, 0.1), 0 10px 10px -5px rgba(10, 71, 132, 0.04);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 9999px;

    --sidebar-width: 280px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables */
[data-bs-theme="dark"] {
    --primary: #38bdf8;
    --primary-light: #7dd3fc;
    --primary-dark: #0284c7;
    --primary-subtle: rgba(56, 189, 248, 0.1);
    --primary-gradient: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);

    --background: #0f172a;
    --surface: #1e293b;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;

    --border: #334155;
    --border-light: #1e293b;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.3);
}

/* Base Styles */

[data-bs-theme="dark"] .bg-white {
    background-color: var(--surface) !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: var(--background) !important;
}

[data-bs-theme="dark"] .text-dark {
    color: var(--text-primary) !important;
}

body {
    background-color: var(--background);
    color: var(--text-primary);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Utilities */
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.bg-primary-gradient { background: var(--primary-gradient) !important; color: white; }

/* Buttons */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: var(--transition);
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    color: white;
    box-shadow: 0 4px 12px rgba(10, 71, 132, 0.2);
}

.btn-primary:hover, .btn-primary:focus {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(10, 71, 132, 0.3);
    background: linear-gradient(135deg, #1664B1 0%, #0A4784 100%);
    color: white;
}

.btn-light {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.btn-light:hover {
    background: var(--background);
    border-color: #CBD5E1;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--surface);
    border-right: 1px solid var(--border-light);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
    box-shadow: 1px 0 10px rgba(0,0,0,0.02);
}

.sidebar-header {
    padding: 2rem 1.5rem 1.5rem;
}

.sidebar-menu {
    padding: 1rem 1rem;
    overflow-y: auto;
    height: calc(100vh - 160px);
}

.sidebar-label {
    padding: 1.5rem 1rem 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
    margin-bottom: 0.25rem;
}

.sidebar-item i {
    font-size: 1.1rem;
    width: 28px;
    transition: var(--transition);
}

.sidebar-item:hover {
    color: var(--primary);
    background-color: var(--primary-subtle);
    transform: translateX(3px);
}

.sidebar-item.active {
    color: var(--primary);
    background-color: var(--primary-subtle);
    font-weight: 600;
}

.sidebar-item.active i {
    color: var(--primary);
}

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

/* Navbar */
.top-navbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

[data-bs-theme="dark"] .top-navbar {
    background: rgba(30, 41, 59, 0.85);
}

.search-container input {
    background: var(--background);
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    padding-left: 2.5rem;
    transition: var(--transition);
}

.search-container input:focus {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10, 71, 132, 0.1);
}

.search-container i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Cards */
.card {
    background-color: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-light);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.stat-card {
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--primary-subtle);
    color: var(--primary);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.stat-card:hover .stat-icon {
    transform: scale(1.05) rotate(-3deg);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-title {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
}

/* Status Indicators */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.8);
}
.status-dot.active { background-color: var(--success); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
.status-dot.inactive { background-color: var(--warning); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }
.status-dot.error { background-color: var(--danger); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); }

/* Tables */
.table {
    margin-bottom: 0;
}
.table th {
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    border-top: none;
    padding: 1rem 1.5rem;
    background-color: var(--surface);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}
.table td {
    padding: 1.25rem 1.5rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}
.table tbody tr {
    transition: var(--transition);
}
.table tbody tr:hover {
    background-color: var(--background);
}
[data-bs-theme="dark"] .table {
    --bs-table-bg: var(--surface);
    --bs-table-color: var(--text-primary);
    border-color: var(--border-light);
}

/* Badges */
.badge {
    padding: 0.4em 0.8em;
    font-weight: 500;
    border-radius: var(--radius-pill);
}

/* Forms */
.form-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}
.form-control, .form-select {
    border: 1px solid #CBD5E1;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    color: var(--text-primary);
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10, 71, 132, 0.1);
}

/* Floating Alerts / Toasts */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
}
.alert-float {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    background: var(--surface);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    animation: slideInRight 0.3s ease-out forwards;
}
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
}
