/* =========================================
   1. LAYOUT WRAPPER & RESETS
   ========================================= */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background-color: var(--bg-body);
    overflow-x: hidden;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-normal);
}

/* =========================================
   2. SIDEBAR
   ========================================= */
.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    z-index: var(--z-sidebar);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-normal);
}

/* Sidebar Header */
.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.brand-info {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
    opacity: 1;
    transition: opacity var(--transition-normal);
}

.brand-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
}

.brand-tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Sidebar Nav */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1rem;
}

.nav-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 1.5rem 0 0.5rem 0.75rem;
    font-weight: 600;
    display: block;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    height: 44px; /* Fixed height for consistency */
    color: var(--text-muted);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    text-decoration: none; /* Remove default underline */
}

.nav-link i {
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}

.nav-link:hover i {
    color: var(--brand-primary);
}

.nav-link.active {
    background: var(--brand-primary); /* Solid Indigo background */
    color: #ffffff; /* White text for high contrast */
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.4); /* Glow effect */
}

.nav-link.active i {
    color: #ffffff; /* White icon */
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.user-profile-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-hover);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    min-height: 60px;
    transition: all var(--transition-fast);
}

.avatar-circle {
    width: 36px;
    height: 36px;
    background: var(--brand-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Settings Button (No border) */
.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-active);
    color: var(--brand-primary);
}

/* =========================================
   3. SIDEBAR COLLAPSED STATE
   ========================================= */
.app-sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.app-sidebar.collapsed .brand-info,
.app-sidebar.collapsed .nav-link span,
.app-sidebar.collapsed .nav-header,
.app-sidebar.collapsed .user-details,
.app-sidebar.collapsed .dropup {
    display: none;
}

.app-sidebar.collapsed .nav-link {
    justify-content: center;
    width: 44px;
    margin: 0 auto 0.25rem auto;
}

.app-sidebar.collapsed .logo-icon {
    margin: 0 auto;
}
.app-sidebar.collapsed .brand-container {
    justify-content: center;
    width: 100%;
}

.app-sidebar.collapsed .user-profile-card {
    justify-content: center;
    padding: 0;
    background: transparent;
    border: none;
    width: 100%;
}

.app-sidebar.collapsed .avatar-circle {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
}

.app-main.expanded {
    margin-left: var(--sidebar-collapsed-width);
}

/* =========================================
   4. HEADER
   ========================================= */
.app-header {
    height: var(--header-height);
    background: var(--bg-header);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: var(--z-header);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-sidebar-toggle {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
}

.btn-sidebar-toggle:hover {
    color: var(--brand-primary);
    background: var(--bg-hover);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

/* Theme Selector Button */
.btn-theme-selector {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    transition: all var(--transition-fast);
}

.btn-theme-selector:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

/* =========================================
   5. CONTENT & CARDS
   ========================================= */
.content-body {
    padding: 2rem;
    flex: 1;
}

/* Custom Alert Styles */
.flash-container {
    position: relative;
    z-index: 1050;
}

.custom-alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    word-wrap: break-word;
}

.alert-icon {
    flex-shrink: 0;
    font-size: 1.25rem;
    margin-top: 0.125rem;
}

.alert-message {
    flex: 1;
    line-height: 1.6;
}

.alert-message strong {
    font-weight: 600;
    margin-right: 0.25rem;
}

.alert-message br {
    display: block;
    margin: 0.5rem 0;
    content: "";
}

.custom-alert .btn-close {
    flex-shrink: 0;
    padding: 0.5rem;
    margin: -0.5rem -0.5rem -0.5rem auto;
    opacity: 0.7;
}

.custom-alert .btn-close:hover {
    opacity: 1;
}

.alert-success { 
    background: var(--alert-success-bg); 
    color: var(--alert-success-text); 
}

.alert-danger { 
    background: var(--alert-danger-bg); 
    color: var(--alert-danger-text); 
}

.alert-warning { 
    background: var(--alert-warning-bg); 
    color: var(--alert-warning-text); 
}

.alert-info {
    background: var(--bg-active);
    color: var(--text-main);
    border-left: 4px solid var(--brand-primary);
}

/* Card Utilities (Matches your Dashboard Cards) */
.card-custom {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* =========================================
   6. RESPONSIVE
   ========================================= */
@media (max-width: 992px) {
    .app-sidebar { 
        transform: translateX(-100%); 
        width: 260px; 
    }
    .app-main { margin-left: 0; }
    
    /* When open on mobile */
    .app-sidebar.collapsed {
        transform: translateX(0);
        width: 260px; /* Full width when open on mobile */
    }
    
    /* Show details on mobile when open */
    .app-sidebar.collapsed .brand-info,
    .app-sidebar.collapsed .nav-link span,
    .app-sidebar.collapsed .nav-header,
    .app-sidebar.collapsed .user-details {
        display: flex;
    }
    
    .app-sidebar.collapsed .nav-link {
        justify-content: flex-start;
        width: auto;
        margin-bottom: 0.25rem;
    }
}
/* =========================================
   7. DASHBOARD SPECIFIC STYLES
   ========================================= */

/* The Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-hover));
    color: var(--text-on-brand);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

/* Abstract shapes for visual interest in banner */
.welcome-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.welcome-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.welcome-subtitle {
    opacity: 0.9;
    font-size: 1rem;
    max-width: 600px;
    margin-bottom: 1.5rem;
}

/* Dashboard Action Buttons (White on Banner) */
.btn-glass {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-1px);
}

/* Stat Cards */
.stat-card {
    height: 100%;
    padding: 1.5rem;
    position: relative;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-primary);
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Color variants for icons */
.icon-primary { background: var(--bg-active); color: var(--brand-primary); }
.icon-success { background: var(--alert-success-bg); color: var(--alert-success-text); }
.icon-warning { background: var(--alert-warning-bg); color: var(--alert-warning-text); }
.icon-info    { background: #eff6ff; color: #3b82f6; } /* Blue-500 equivalent */

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

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-trend {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.trend-up { background: var(--alert-success-bg); color: var(--alert-success-text); }
.trend-down { background: var(--alert-danger-bg); color: var(--alert-danger-text); }
.trend-neutral { background: var(--bg-body); color: var(--text-muted); }

.stat-link {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-link:hover {
    text-decoration: underline;
}
/* =========================================
   8. LOGIN PAGE (SPLIT LAYOUT)
   ========================================= */
.login-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* LEFT SIDE: Brand Hero */
.login-hero {
    flex: 1;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 2rem;
    overflow: hidden;
}

/* Abstract Background Pattern */
.login-hero::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    top: -50%;
    left: -50%;
    animation: rotate 60s linear infinite;
}

.login-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 400px;
}

.hero-logo {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* RIGHT SIDE: Form Area */
.login-form-section {
    flex: 0 0 500px; /* Fixed width for form side */
    background: var(--bg-body);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: background-color var(--transition-normal);
}

.login-header-controls {
    display: flex;
    justify-content: flex-end;
    padding: 1.5rem;
}

.login-form-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    max-width: 440px;
    margin: 0 auto;
    width: 100%;
}

.login-welcome {
    margin-bottom: 2rem;
}

.login-welcome h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.login-welcome p {
    color: var(--text-muted);
}

/* Form Elements */
.form-floating-custom {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-floating-custom .form-control {
    height: 52px;
    background: var(--bg-input);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding-left: 1rem;
    color: var(--text-main);
    font-weight: 500;
}

.form-floating-custom .form-control:focus {
    background: var(--bg-surface);
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px var(--bg-active);
}

.form-floating-custom label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    display: block;
}

/* Custom Select Dropdown */
.form-select-custom {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-main);
    background-color: var(--bg-input);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

.form-select-custom:focus {
    border-color: var(--brand-primary);
    outline: 0;
    box-shadow: 0 0 0 4px var(--bg-active);
}

/* =========================================
   FIX DROPDOWN OPTIONS IN DARK MODE
   ========================================= */
select option {
    background-color: var(--bg-surface); /* Dark Grey */
    color: var(--text-main);             /* White text */
}

/* Specific fix for the custom select class */
.form-select-custom option {
    background-color: var(--bg-surface);
    color: var(--text-main);
    padding: 10px; /* Optional: adds breathing room */
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 38px; /* Adjusted for label height */
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.password-toggle-btn:hover {
    color: var(--brand-primary);
}

.btn-login-lg {
    width: 100%;
    height: 52px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-hover));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-login-lg:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-login-lg:active {
    transform: translateY(0);
}

.login-footer-credits {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-subtle);
}

/* ANIMATION */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* MOBILE RESPONSIVE */
@media (max-width: 992px) {
    .login-hero { display: none; } /* Hide hero on tablet/mobile */
    .login-form-section { flex: 1; } /* Form takes full width */
    .login-form-container { padding: 2rem; }
}
/* =========================================
   9. DATA TABLES & LISTS
   ========================================= */

/* The Container (White card effect) */
.table-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden; /* Clips the table corners */
    margin-bottom: 1.5rem;
}

/* Header & Actions Toolbar */
.table-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--bg-surface);
}

.table-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

/* The Table Itself */
.table-responsive {
    scrollbar-width: thin;
}

.table-modern {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead th {
    background: var(--bg-body); /* Slightly darker than card */
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.table-modern tbody td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
    font-size: 0.9rem;
    vertical-align: middle;
    background: var(--bg-surface);
    transition: background-color var(--transition-fast);
}

.table-modern tbody tr:last-child td {
    border-bottom: none;
}

.table-modern tbody tr:hover td {
    background: var(--bg-hover);
}

/* Status Badges */
.status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.status-badge.success { background: var(--alert-success-bg); color: var(--alert-success-text); }
.status-badge.warning { background: var(--alert-warning-bg); color: var(--alert-warning-text); }
.status-badge.danger  { background: var(--alert-danger-bg); color: var(--alert-danger-text); }
.status-badge.neutral { background: var(--bg-body); color: var(--text-muted); border: 1px solid var(--border-subtle); }

/* Table Actions (Edit/Delete buttons) */
.action-btn {
    width: 38px; /* Bigger touch target */
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 1.2rem; /* Make icons 20% larger */
    transition: all var(--transition-fast);
    background: transparent;
    border: 1px solid transparent; /* Prepare for border on hover */
}

.action-btn:hover {
    background: var(--bg-hover);
    color: var(--brand-primary);
    border-color: var(--border-subtle);
    transform: scale(1.1); /* Slight zoom on hover */
}

.action-btn.delete:hover {
    background: var(--alert-danger-bg);
    color: var(--alert-danger-text);
}

/* Code Pill Badge */
.code-pill {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.25rem 0.6rem;
    
    /* key change: use variable instead of hardcoded white */
    background: var(--bg-surface); 
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    letter-spacing: 0.5px;
    display: inline-block;
}

/* =========================================
   FIXES FOR DARK MODE & BADGES
   ========================================= */

/* 1. Neutral Badge for "Total Counts" (Replaces the Blue one) */
.badge-subtle {
    background: var(--bg-hover);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

/* 3. Fix "Show per page" wrapping */
.text-nowrap-custom {
    white-space: nowrap;
}

/* 4. Make the Settings Card content flow better */
.settings-card-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Pagination Customization */
.pagination {
    margin: 0;
    gap: 0.25rem;
}

.page-link {
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-link:hover {
    background: var(--bg-hover);
    color: var(--brand-primary);
}

.page-item.active .page-link {
    background: var(--brand-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.page-item.disabled .page-link {
    opacity: 0.5;
    background: transparent;
}

/* =========================================
   FOOTER REFINEMENT
   ========================================= */
.app-footer {
    padding: 2rem 0;          /* More breathing room top/bottom */
    text-align: center;       /* Center the text */
    width: 100%;
    margin-top: auto;         /* Push to bottom if content is short */
    border-top: none;         /* Remove border if it looks cluttered */
}

.footer-inner {
    display: flex;
    flex-direction: column;   /* Stack the copyright and credits */
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted); /* Ensure text is subtle */
    font-size: 0.85rem;
}

.heart-pulse {
    display: inline-block;
    color: #ef4444;           /* Red Heart */
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.2); }
    30% { transform: scale(1); }
    45% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* =========================================
   FIX INPUT VISIBILITY (HIGH CONTRAST)
   ========================================= */

/* 1. Make inputs darker than their container in Dark Mode */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-select-custom {
    background-color: #111827 !important; /* Very dark (almost black) */
    border-color: #4b5563 !important;     /* Visible grey border */
    color: #f9fafb !important;            /* White text */
}

/* 2. Ensure distinct focus state */
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] .form-select-custom:focus {
    background-color: #0f172a !important; /* Keep it dark on focus */
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.25) !important;
}

/* 3. Fix the placeholder text color so it's not invisible */
[data-theme="dark"] ::placeholder {
    color: #9ca3af !important; /* Light grey placeholder */
    opacity: 1;
}

/* =========================================
   INPUT GROUP STYLING (For Search Fields)
   ========================================= */
.input-group-text {
    background-color: var(--bg-input);
    border: 2px solid var(--border-subtle);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.input-group .form-control {
    border-left: none;
}

.input-group .form-control:focus {
    border-left: 2px solid var(--brand-primary);
    padding-left: 0.75rem;
}

.input-group:focus-within .input-group-text {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}
/* =========================================
   UPLOAD DROPZONE
   ========================================= */
.upload-dropzone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    background-color: var(--bg-input);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-dropzone:hover {
    border-color: var(--brand-primary);
    background-color: var(--bg-surface);
}

.upload-dropzone.dragover {
    border-color: var(--brand-primary);
    background-color: var(--bg-active);
    transform: scale(1.01);
}
/* =========================================
   DASHBOARD & ANALYTICS
   ========================================= */

/* Hero Section */
.dashboard-hero {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    padding: 3rem 2.5rem;
    border-radius: var(--radius-lg);
    color: white;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

/* Stat Cards */
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: transform var(--transition-fast);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-primary);
}

.stat-icon-box {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

/* Report Menu Links (The list of reports) */
.report-menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-body);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    color: var(--text-main);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.report-menu-link:hover {
    background: var(--bg-surface);
    border-color: var(--brand-primary);
    transform: translateX(4px);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

.report-menu-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

/* Fix Bootstrap Progress Bar for Dark Mode */
[data-theme="dark"] .progress {
    background-color: var(--bg-input);
}
/* =========================================
   FILTER BAR FIXES
   ========================================= */
/* 1. Force exact height alignment for everything in the filter row */
.filter-row .form-control,
.filter-row .form-select,
.filter-row .form-select-custom,
.filter-row .input-group-text,
.filter-row .btn {
    height: 42px !important; /* Force uniform height */
    display: flex;
    align-items: center;
}

/* 2. Make the Search Bar look like one seamless box */
.filter-search-group .input-group-text {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-right: none; /* Remove line between icon and input */
    color: var(--text-muted);
}

.filter-search-group .form-control {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-left: none; /* Remove line between icon and input */
    color: var(--text-main);
}

/* Fix focus state for the seamless group */
.filter-search-group .form-control:focus {
    border-color: var(--border-subtle);
    box-shadow: none; /* Optional: remove glow or apply to parent */
}
/* Highlight the whole group when input is focused (Optional advanced styling) */
.filter-search-group:focus-within .input-group-text,
.filter-search-group:focus-within .form-control {
    border-color: var(--brand-primary);
}