/* ============================================
   CobraExpress Admin Panel Styles
   ============================================ */

:root {
    --sidebar-width: 250px;
    --navbar-height: 56px;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --dark: #1e293b;
    --darker: #0f172a;
    --light-bg: #f1f5f9;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

body {
    background: var(--light-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background: var(--dark);
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-nav {
    padding: 0.5rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.05);
    color: #e2e8f0;
}

.sidebar-link.active {
    background: rgba(37,99,235,0.15);
    color: #60a5fa;
    border-left-color: var(--primary);
}

.sidebar-link i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--navbar-height);
    padding: 1.5rem;
    transition: margin-left 0.3s ease;
    min-height: calc(100vh - var(--navbar-height));
}

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

/* Cards */
.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Data table */
.data-table {
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.data-table .table {
    margin-bottom: 0;
}

.data-table .table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    color: #475569;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.data-table .table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}

.data-table .table tbody tr:hover {
    background: #f8fafc;
}

.table-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Search & Filters */
.filters-bar {
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.search-input {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.75rem center;
}

/* Login page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 50%, var(--primary-dark) 100%);
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-card .logo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    text-align: center;
    margin-bottom: 0.25rem;
}

.login-card .logo i {
    color: #f59e0b;
}

/* Progress bars */
.progress-thin {
    height: 6px;
    border-radius: 3px;
}

/* Detail page layout */
.detail-header {
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.detail-section {
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.detail-section h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item label {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.info-item span {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--dark);
}

/* Calendar overrides */
.fc .fc-toolbar-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.fc .fc-daygrid-event {
    font-size: 0.75rem;
    border-radius: 4px;
    padding: 1px 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar:not(.collapsed) {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .stat-card .stat-value {
        font-size: 1.2rem;
    }
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Clickable rows */
.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background: #eef2ff !important;
}

/* Modal improvements */
.modal-header {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

/* Approve/reject buttons */
.btn-approve {
    background: #16a34a;
    border: none;
    color: white;
}
.btn-approve:hover { background: #15803d; color: white; }

.btn-reject {
    background: #dc2626;
    border: none;
    color: white;
}
.btn-reject:hover { background: #b91c1c; color: white; }

/* ============================================
   Theme System - CSS Variables
   ============================================ */
:root {
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #e2e8f0;
    --sidebar-active-bg: rgba(37,99,235,0.15);
    --sidebar-active-text: #60a5fa;
    --sidebar-active-border: #2563eb;
    --sidebar-divider: rgba(255,255,255,0.1);
    --navbar-bg: #1e293b;
    --navbar-text: #ffffff;
}

.sidebar { background: var(--sidebar-bg) !important; }
.sidebar-link { color: var(--sidebar-text) !important; }
.sidebar-link:hover { color: var(--sidebar-text-hover) !important; background: rgba(255,255,255,0.05); }
.sidebar-link.active {
    color: var(--sidebar-active-text) !important;
    background: var(--sidebar-active-bg) !important;
    border-left-color: var(--sidebar-active-border) !important;
}
.sidebar-header small { color: var(--sidebar-text) !important; }
.sidebar hr { border-color: var(--sidebar-divider) !important; }

.navbar { background: var(--navbar-bg) !important; }
.navbar .navbar-brand, .navbar .btn, .navbar .dropdown-toggle,
.navbar .badge { color: var(--navbar-text) !important; }

/* Theme swatches */
.theme-swatch {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
}
.theme-swatch:hover { transform: scale(1.12); }
.theme-swatch.selected { border-color: #3b82f6; box-shadow: 0 0 0 2px #3b82f6; }
.theme-swatch i { font-size: 13px; display: none; }
.theme-swatch.selected i { display: inline; }
.theme-swatch.light-swatch { border: 2px solid #d1d5db; }
.theme-swatch.light-swatch.selected { border-color: #3b82f6; }

/* Print styles */
@media print {
    .sidebar, .navbar, .filters-bar, .no-print { display: none !important; }
    .main-content { margin: 0; padding: 0; }
}
