/* ============================================================
   Sravya Holidays CRM - Modern Travel Agency Styles
   ============================================================ */

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --topbar-height: 60px;
    --primary: #0d6efd;
    --primary-dark: #0a58ca;
    --accent: #00b4d8;
    --success: #198754;
    --warning: #ffc107;
    --danger: #dc3545;
    --sidebar-bg: #1a1d29;
    --sidebar-text: #a0aec0;
    --sidebar-active: #ffffff;
    --card-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075);
    --card-shadow-hover: 0 0.5rem 1rem rgba(0,0,0,.1);
    --border-radius: 0.75rem;
    --transition: all 0.25s ease;
}

[data-bs-theme="dark"] {
    --sidebar-bg: #0f1117;
    --bs-body-bg: #12141c;
    --bs-body-color: #e2e8f0;
    --bs-border-color: #2d3748;
}

/* Base */
* { box-sizing: border-box; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bs-body-bg, #f4f6f9);
    overflow-x: hidden;
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow: hidden;
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
}

.sidebar-brand i {
    font-size: 1.5rem;
    color: var(--accent);
}

.sidebar-close {
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 1.2rem;
}

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

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--sidebar-text);
    padding: 0.65rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.15rem;
    transition: var(--transition);
    font-size: 0.9rem;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    box-shadow: 0 4px 12px rgba(13,110,253,0.3);
}

.sidebar-nav .nav-link i {
    font-size: 1.15rem;
    width: 1.4rem;
    text-align: center;
}

.nav-header {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(160,174,192,0.6);
    padding: 1rem 1rem 0.4rem;
    font-weight: 600;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.user-name { color: #fff; font-size: 0.85rem; font-weight: 600; }
.user-role { font-size: 0.7rem; color: var(--sidebar-text); }

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

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: var(--bs-body-bg, #fff);
    border-bottom: 1px solid var(--bs-border-color, #e9ecef);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-left, .topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-toggle {
    font-size: 1.4rem;
    color: var(--bs-body-color);
    padding: 0.25rem;
}

.search-box {
    position: relative;
    width: 320px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
}

.search-box input {
    padding-left: 2.2rem;
    border-radius: 2rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    background: var(--bs-tertiary-bg, #f8f9fa);
    font-size: 0.875rem;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    box-shadow: var(--card-shadow-hover);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1050;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.notification-btn { position: relative; font-size: 1.2rem; }
.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.65rem;
    padding: 0.15em 0.4em;
}

/* Page Content */
.page-content {
    padding: 1.5rem;
    flex: 1;
}

/* Stat Cards */
.stat-card {
    background: var(--bs-body-bg, #fff);
    border-radius: var(--border-radius);
    border: 1px solid var(--bs-border-color, #e9ecef);
    padding: 1.25rem;
    transition: var(--transition);
    height: 100%;
}

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

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

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.15rem;
}

.stat-icon.bg-primary-soft { background: rgba(13,110,253,0.12); color: var(--primary); }
.stat-icon.bg-success-soft { background: rgba(25,135,84,0.12); color: var(--success); }
.stat-icon.bg-warning-soft { background: rgba(255,193,7,0.15); color: #b8860b; }
.stat-icon.bg-danger-soft { background: rgba(220,53,69,0.12); color: var(--danger); }
.stat-icon.bg-info-soft { background: rgba(13,202,240,0.12); color: #0aa2c0; }
.stat-icon.bg-purple-soft { background: rgba(111,66,193,0.12); color: #6f42c1; }

/* Cards */
.card {
    border: 1px solid var(--bs-border-color, #e9ecef);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

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

/* Tables */
.table-responsive {
    border-radius: var(--border-radius);
}

.table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    font-weight: 600;
    border-bottom-width: 1px;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Badges */
.badge-status {
    font-weight: 500;
    padding: 0.35em 0.7em;
    border-radius: 2rem;
    font-size: 0.75rem;
}

.badge-hot { background: #fee2e2; color: #b91c1c; }
.badge-warm { background: #fef3c7; color: #b45309; }
.badge-cold { background: #e0e7ff; color: #3730a3; }

/* Buttons */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    opacity: 0.4;
    margin-bottom: 1rem;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Login page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1d29 0%, #0d6efd 50%, #00b4d8 100%);
    padding: 1.5rem;
}

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

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

.login-card .brand i {
    font-size: 2.5rem;
    color: var(--primary);
}

.login-card .brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.4rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--bs-border-color, #dee2e6);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.25rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.35rem;
    top: 0.35rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-item .time {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Priority indicators */
.priority-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.priority-hot { background: #dc3545; }
.priority-warm { background: #ffc107; }
.priority-cold { background: #0d6efd; }

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1035;
        display: none;
    }
    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 575.98px) {
    .page-content {
        padding: 1rem;
    }
    .stat-card .stat-value {
        font-size: 1.3rem;
    }
}

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

.animate-fade-in {
    animation: fadeInUp 0.35s ease forwards;
}

/* Chart containers */
.chart-container {
    position: relative;
    height: 280px;
}

/* Form improvements */
.form-label {
    font-weight: 500;
    font-size: 0.875rem;
}

.form-control, .form-select {
    border-radius: 0.5rem;
}

/* Action buttons in tables */
.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}
