/**
 * Bengal Haven Group - Property Management System
 * Modern Dark Theme with Golden Accents
 */

/* ========================================
   Google Fonts Import (must be at top)
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ========================================
   CSS Variables & Root Settings
   ======================================== */
:root {
    /* Dark Theme Colors */
    --bg-primary: #0a0e14;
    --bg-secondary: #12171f;
    --bg-tertiary: #1a2029;
    --bg-card: #151b24;
    --bg-hover: #1e2633;
    
    /* Golden Accent Colors */
    --accent-primary: #d4a853;
    --accent-secondary: #f0c674;
    --accent-light: #ffedc2;
    --accent-dark: #a67c2e;
    
    /* Text Colors */
    --text-primary: #e8e8e8;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-dark: #1f2937;
    
    /* Status Colors */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.15);
    --cancelled: #6b7280;
    --cancelled-bg: rgba(107, 114, 128, 0.15);
    
    /* Border & Shadow */
    --border-color: #2a3441;
    --border-light: #374151;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(212, 168, 83, 0.2);
    
    /* Spacing */
    --sidebar-width: 280px;
    --header-height: 70px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ========================================
   Base Styles
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========================================
   Scrollbar Styling
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ========================================
   Layout Structure
   ======================================== */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-normal);
}

.content-wrapper {
    flex: 1;
    padding: 24px;
    margin-top: var(--header-height);
}

/* ========================================
   Sidebar Styles
   ======================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal), margin-left var(--transition-normal);
}

/* Sidebar toggle on desktop - slide out */
@media (min-width: 1025px) {
    .sidebar {
        transform: translateX(0);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active,
    body.sidebar-open .sidebar {
        transform: translateX(0);
    }
    
    body:not(.sidebar-open) .sidebar:not(.active) {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: var(--sidebar-width);
        transition: margin-left 0.3s ease;
    }
    
    body:not(.sidebar-open) .main-content {
        margin-left: 0;
    }
}

/* Mobile Sidebar - Hidden by default */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%); /* Hidden by default */
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.active {
        transform: translateX(0); /* Slide in */
    }
    
    /* Overlay for mobile */
    .sidebar.active::before {
        display: none;
        content: '';
        position: fixed;
        top: 0;
        left: 100%; /* Position it to the right of the sidebar */
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(2px);
        z-index: 999;
    }
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand .logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-dark) 100%);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--bg-primary);
    box-shadow: var(--shadow-glow);
}

.sidebar-brand .brand-text {
    flex: 1;
}

.sidebar-brand .brand-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.sidebar-brand .brand-tagline {
    font-size: 11px;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    margin-bottom: 4px;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--accent-primary);
    border-radius: 0 3px 3px 0;
    transition: height var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--accent-primary);
}

.nav-link.active::before {
    height: 24px;
}

.nav-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-link .badge {
    margin-left: auto;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    background: var(--danger);
    color: white;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.user-profile:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--bg-primary);
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* ========================================
   Header Styles
   ======================================== */
.header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: rgba(10, 14, 20, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 999;
    transition: left var(--transition-normal);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius-sm);
    transition: background var(--transition-fast);
    width: 40px;
    height: 40px;
}

.menu-toggle:hover {
    background: var(--bg-hover);
}

.menu-toggle:active {
    transform: scale(0.95);
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-search {
    flex: 1;
    max-width: 480px;
    margin: 0 40px;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.search-results.active {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-hover);
}

.search-result-item .video-code {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--accent-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.header-btn {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.header-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.header-btn .badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 50%;
}

/* ========================================
   Card Styles
   ======================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--accent-primary);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

/* ========================================
   Stats Cards
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon.primary {
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.2) 0%, rgba(212, 168, 83, 0.1) 100%);
    color: var(--accent-primary);
}

.stat-icon.success {
    background: var(--success-bg);
    color: var(--success);
}

.stat-icon.warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-icon.danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.stat-icon.info {
    background: var(--info-bg);
    color: var(--info);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
}

.stat-trend.up {
    color: var(--success);
}

.stat-trend.down {
    color: var(--danger);
}

/* ========================================
   Table Styles
   ======================================== */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-tertiary);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.data-table td {
    font-size: 14px;
    color: var(--text-primary);
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.video-code-cell {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(212, 168, 83, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.phone-cell {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
}

/* ========================================
   Badge Styles
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-primary {
    background: rgba(212, 168, 83, 0.15);
    color: var(--accent-primary);
}

.badge-secondary {
    background: rgba(156, 163, 175, 0.15);
    color: var(--text-secondary);
}

.badge-cancelled {
    background: var(--cancelled-bg);
    color: var(--cancelled);
    border: 1px solid var(--cancelled);
}

/* ========================================
   Button Styles
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-dark) 100%);
    color: var(--bg-primary);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon i {
    color: inherit;
    font-size: 16px;
    display: inline-block;
    line-height: 1;
}

.btn-secondary.btn-icon {
    color: var(--text-primary) !important;
}

.btn-secondary.btn-icon:hover {
    color: var(--accent-primary) !important;
}

.btn-secondary.btn-icon i {
    color: var(--text-primary);
}

.btn-secondary.btn-icon:hover i {
    color: var(--accent-primary);
}

/* Specific fix for secondary button icons */
a.btn.btn-sm.btn-secondary.btn-icon i.bi,
button.btn.btn-sm.btn-secondary.btn-icon i.bi {
    color: var(--text-primary) !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
    font-size: 16px !important;
}

a.btn.btn-sm.btn-secondary.btn-icon:hover i.bi,
button.btn.btn-sm.btn-secondary.btn-icon:hover i.bi {
    color: var(--accent-primary) !important;
}

.btn-group {
    display: flex;
    gap: 8px;
}

/* ========================================
   Form Styles
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-label.required::after {
    content: '*';
    color: var(--danger);
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.input-group {
    display: flex;
}

.input-group .form-control {
    border-radius: 0;
}

.input-group .form-control:first-child {
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
}

.input-group .form-control:last-child {
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

.input-group-text {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 14px;
    white-space: nowrap;
}

/* ========================================
   Reminder Panel Styles
   ======================================== */
.reminder-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.reminder-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.reminder-tab {
    flex: 1;
    padding: 16px;
    text-align: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
}

.reminder-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.reminder-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.reminder-tab .count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 6px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.reminder-tab.active .count {
    background: rgba(212, 168, 83, 0.2);
    color: var(--accent-primary);
}

.reminder-list {
    max-height: 400px;
    overflow-y: auto;
}

.reminder-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.reminder-item:last-child {
    border-bottom: none;
}

.reminder-item:hover {
    background: var(--bg-hover);
}

.reminder-item.overdue {
    background: var(--danger-bg);
    border-left: 3px solid var(--danger);
}

.reminder-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.reminder-icon.call {
    background: var(--info-bg);
    color: var(--info);
}

.reminder-icon.meeting {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.reminder-icon.visit {
    background: var(--success-bg);
    color: var(--success);
}

.reminder-content {
    flex: 1;
    min-width: 0;
}

.reminder-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reminder-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.reminder-meta i {
    font-size: 11px;
}

.reminder-actions {
    display: flex;
    gap: 6px;
}

/* ========================================
   Modal Styles
   ======================================== */
/* Bootstrap Modal Support */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}

.modal.show {
    display: block !important;
}

.modal.fade {
    transition: opacity 0.15s linear;
}

.modal.fade:not(.show) {
    opacity: 0;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    max-width: 500px;
    pointer-events: none;
}

.modal.show .modal-dialog {
    pointer-events: auto;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: var(--bg-card);
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    outline: 0;
    box-shadow: var(--shadow-lg);
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop.active {
    display: flex !important;
}

/* Custom modal styles (for notification modal) - separate from Bootstrap modals */
.modal-backdrop .modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ========================================
   Alert/Toast Styles
   ======================================== */
.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-danger {
    background: var(--danger-bg);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning);
    color: var(--warning);
}

.alert-info {
    background: var(--info-bg);
    border: 1px solid var(--info);
    color: var(--info);
}

.toast-container {
    position: fixed;
    top: 90px;
    right: 24px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 12px;
    display: none;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: toastSlideIn 0.3s ease;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   Quick Actions Floating Button
   ======================================== */
.quick-actions {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.quick-actions-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-dark) 100%);
    border: none;
    color: var(--bg-primary);
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transition: all var(--transition-fast);
}

.quick-actions-btn:hover {
    transform: scale(1.1);
}

.quick-actions-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 8px 0;
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    display: none;
}

.quick-actions-menu.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.quick-actions-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background var(--transition-fast);
}

.quick-actions-item:hover {
    background: var(--bg-hover);
}

.quick-actions-item i {
    width: 24px;
    color: var(--accent-primary);
}

/* ========================================
   Mobile Responsiveness Fixes
   ======================================== */

/* FAB Button Mobile Improvements */
@media (max-width: 768px) {
    .quick-actions {
        bottom: 16px;
        right: 16px;
    }

    .quick-actions-btn {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }

    .quick-actions-menu {
        min-width: 180px;
        right: -10px;
        bottom: 65px;
    }

    .quick-actions-item {
        padding: 14px 16px;
        font-size: 14px;
    }

    .quick-actions-item i {
        width: 20px;
        font-size: 16px;
    }
}

/* Stat Cards - Better mobile experience */
@media (min-width: 769px) {
    .stat-card {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .stat-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
}

@media (max-width: 768px) {
    .stat-card {
        transition: none;
        transform: none;
    }

    .stat-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* Better touch targets for mobile */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        padding: 12px 16px;
    }

    .header-btn {
        width: 44px;
        height: 44px;
    }

    .form-control {
        min-height: 44px;
    }

    .select2-container--default .select2-selection--single {
        min-height: 44px;
    }

    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 42px;
    }
}

/* Improved table scrolling on mobile */
@media (max-width: 768px) {
    .table-responsive {
        margin: 0 -16px;
        padding: 0 16px;
    }

    .table-responsive .table {
        min-width: 600px;
    }
}

/* Modal improvements for mobile */
@media (max-width: 480px) {
    .modal {
        margin: 10px;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
    }

    .modal-dialog {
        margin: 0;
        max-width: none;
    }

    .modal-content {
        border-radius: 8px 8px 0 0;
    }
}

/* Form improvements for very small screens */
@media (max-width: 480px) {
    .form-row {
        gap: 12px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .btn-group-vertical .btn {
        margin-bottom: 8px;
    }

    /* Better spacing for stacked elements */
    .d-flex.flex-column > * {
        margin-bottom: 8px;
    }

    .d-flex.flex-column > *:last-child {
        margin-bottom: 0;
    }
}

/* Search and filter improvements */
@media (max-width: 768px) {
    .header-search {
        margin: 0 16px 0 8px;
        max-width: none;
        flex: 1;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        padding: 10px 40px 10px 16px;
    }
}

/* Card improvements for mobile */
@media (max-width: 768px) {
    .card {
        margin-bottom: 16px;
        border-radius: var(--border-radius);
    }

    .card-header {
        padding: 14px 16px;
        border-radius: var(--border-radius) var(--border-radius) 0 0;
    }

    .card-body {
        padding: 16px;
    }
}

/* Toast notifications mobile */
@media (max-width: 480px) {
    .toast-container {
        left: 10px;
        right: 10px;
        bottom: 80px;
    }

    .toast {
        max-width: none;
        width: 100%;
    }
}

/* Page transitions mobile */
@media (max-width: 768px) {
    #pageTransitionOverlay {
        padding: 20px;
    }

    #pageTransitionOverlay > div {
        font-size: 14px;
    }
}

/* Additional mobile improvements */
@media (max-width: 768px) {
    /* Better scrolling for long content */
    body {
        -webkit-overflow-scrolling: touch;
    }

    /* Improve readability on small screens */
    .content-wrapper {
        font-size: 14px;
    }

    /* Better button spacing */
    .btn-group .btn {
        margin-right: 4px;
        margin-bottom: 4px;
    }

    .btn-group .btn:last-child {
        margin-right: 0;
    }

    /* Improve select dropdowns */
    select.form-control {
        background-position: right 12px center;
        padding-right: 40px;
    }

    /* Better input focus styles */
    .form-control:focus {
        border-color: var(--accent-primary);
        box-shadow: 0 0 0 2px rgba(212, 168, 83, 0.2);
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    /* Stack all flex items vertically on very small screens */
    .d-flex {
        flex-direction: column;
    }

    .d-flex > * {
        width: 100%;
        margin-bottom: 8px;
    }

    .d-flex > *:last-child {
        margin-bottom: 0;
    }

    /* Better modal handling */
    .modal-backdrop {
        padding: 0;
    }

    /* Adjust FAB for very small screens */
    .quick-actions {
        bottom: 12px;
        right: 12px;
    }

    .quick-actions-btn {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--text-muted);
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ========================================
   Login Page Styles
   ======================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(212, 168, 83, 0.05) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.login-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
}

.login-brand {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-dark) 100%);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    color: var(--bg-primary);
    box-shadow: var(--shadow-glow);
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

/* ========================================
   Responsive Styles
   ======================================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
        top:80px;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .header {
        left: 0;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .header-search {
        display: none;
    }
    
    /* Scale down cards and tables */
    .card {
        border-radius: var(--border-radius-sm);
    }
    
    .card-header {
        padding: 16px 20px;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .data-table {
        font-size: 14px;
    }
    
    .table-container {
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 16px;
    }
    
    .header {
        padding: 12px 16px;
        height: auto;
        min-height: 60px;
    }
    
    .header-left {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    .header-right {
        gap: 6px;
    }
    
    .header-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-control {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .card-header {
        padding: 14px 16px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    .card-title {
        font-size: 15px;
    }
    
    .data-table {
        font-size: 13px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
    
    .login-card {
        padding: 32px 24px;
    }
    
    /* Modal adjustments */
    .modal {
        max-width: 95%;
        margin: 10px;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-footer {
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        padding: 12px;
    }
    
    .header {
        padding: 10px 12px;
        z-index: 9999;
    }
    
    .page-title {
        font-size: 16px;
    }
    
    .header-date-time {
        font-size: 12px !important;
        margin-left: 8px !important;
    }
    
    .header-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-card {
        padding: 14px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .reminder-tabs {
        flex-wrap: wrap;
    }
    
    .reminder-tab {
        flex: 1 1 33%;
        font-size: 12px;
        padding: 8px 6px;
    }
    
    .card-header {
        padding: 12px 14px;
    }
    
    .card-body {
        padding: 14px;
    }
    
    .card-title {
        font-size: 14px;
    }
    
    .form-control {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .form-label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .btn-sm {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }
    
    .table-container {
        margin: 0 -12px;
        padding: 0 12px;
    }
    
    .modal {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }
    
    .modal-backdrop {
        padding: 0;
    }
    
    .modal-header {
        padding: 14px;
    }
    
    .modal-title {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 14px;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }
    
    .modal-footer {
        padding: 10px 14px;
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* Button groups mobile */
    .button-row {
        gap: 8px;
    }
    
    .btn-option {
        padding: 10px 14px;
        font-size: 13px;
        flex: 1 1 calc(50% - 4px);
        min-width: calc(50% - 4px);
    }
    
    /* Search box mobile */
    .search-box {
        max-width: 100%;
    }
    
    /* Badge mobile */
    .badge {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* ========================================
   Utility Classes
   ======================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--accent-primary); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

.w-100 { width: 100%; }

/* Additional Mobile Responsive Styles for Entire App */
@media (max-width: 768px) {
    /* Tables */
    .table-container {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
    }
    
    /* Cards scaling */
    .card {
        margin-bottom: 16px;
    }
    
    /* Form elements */
    .form-select {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    textarea.form-control {
        min-height: 80px;
    }
    
    /* Buttons */
    .btn-group {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    /* Stats */
    .stats-grid {
        margin-bottom: 16px;
    }
    
    /* Empty states */
    .empty-state {
        padding: 40px 16px;
    }
    
    .empty-state-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    /* Alerts */
    .alert {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    /* Header adjustments */
    .header-right {
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    /* Further mobile optimizations */
    h1, h2, h3, h4, h5, h6 {
        font-size: calc(1em + 0.5vw);
    }
    
    /* Smaller text on mobile */
    .text-muted {
        font-size: 12px;
    }
    
    small {
        font-size: 11px;
    }
    
    /* Compact spacing */
    .mb-3 {
        margin-bottom: 16px;
    }
    
    .mt-3 {
        margin-top: 16px;
    }
    
    /* Navigation */
    .nav-link {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    /* Sidebar mobile */
    .sidebar {
        width: 100%;
        max-width: 280px;
    }
    
    /* Tables - make scrollable on mobile */
    .table-container {
        margin: 0 -12px;
        padding: 0 12px;
    }
    
    .data-table {
        min-width: 600px; /* Force horizontal scroll on very small screens */
    }
    
    /* Compact buttons */
    .btn-icon {
        width: 32px;
        height: 32px;
        padding: 0;
    }
    
    /* Stats compact */
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    /* Navigation compact */
    .nav-section-title {
        font-size: 11px;
        padding: 8px 12px;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .nav-link i {
        font-size: 16px;
        width: 20px;
    }
    
    /* User profile compact */
    .user-profile {
        padding: 10px 12px;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .user-name {
        font-size: 13px;
    }
    
    .user-role {
        font-size: 11px;
    }
}

