/**
 * Style principal de RestaurantApp
 * Thème dark/light avec variables CSS
 * Design moderne, élégant et gastronomique
 */

/* ==================== Variables CSS ==================== */
:root {
    /* Mode Light */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-light: #adb5bd;

    /* Couleurs du thème gastronomique */
    --color-primary: #e65100;
    --color-primary-dark: #bf360c;
    --color-primary-light: #ff6f00;
    --color-accent: #ffb74d;
    --color-accent-light: #ffd54f;
    --color-success: #43a047;
    --color-warning: #fb8c00;
    --color-danger: #e53935;
    --color-info: #039be5;

    /* Ombres */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);

    /* Bordures */
    --border-radius-sm: 6px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --border-radius-round: 50px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Mode Dark */
[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #000000;
    --bg-tertiary: #111111;
    --text-primary: #f5f5f5;
    --text-secondary: #b0b0b0;
    --text-light: #808080;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* FIX: Force navbar background in dark mode */
[data-theme="dark"] .navbar,
[data-theme="dark"] .nav-container,
[data-theme="dark"] nav {
    background-color: #000000 !important;
    background: #000000 !important;
    border-bottom: 1px solid var(--bg-tertiary);
}

/* ==================== Reset & Base ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.4;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    overflow-x: hidden;
    font-size: 0.85rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

h1 {
    font-size: 1.5rem;
}

/* Réduit de 1.8rem */
h2 {
    font-size: 1.25rem;
}

/* Réduit de 2rem */
h3 {
    font-size: 1.1rem;
}

/* Réduit de 1.75rem */

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ==================== Navigation ==================== */
.navbar {
    background-color: var(--bg-primary);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color var(--transition-normal);
    margin-bottom: 0;
    /* Ensure no spacing below */
}

/* Wrapper for page content */
.page-wrapper {
    margin: 0 !important;
    padding: 0 !important;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 15px;
    /* Augmenté pour un look plus imposant et premium */
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.logo img {
    height: 32px;
    width: auto;
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    /* Réduit de 1.25rem */
    font-weight: 700;
    color: var(--color-primary);
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.9rem;
    /* Espacement ajusté entre les boutons de navigation */
    align-items: center;
    flex-wrap: nowrap;
    /* Prevent wrapping if possible */
    justify-content: flex-end;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    /* Reduced from 0.4rem */
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.3rem 0.5rem;
    /* Reduced from 0.5rem 0.75rem */
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    font-size: 0.75rem;
    /* Reduced from 0.9rem */
    white-space: nowrap;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    position: relative;
}

/* Export Buttons Global Style */
.btn-export-excel {
    background-color: var(--color-success) !important;
    color: #ffffff !important;
    border-color: var(--color-success) !important;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-export-excel:hover {
    background-color: #2e7d32 !important;
    border-color: #2e7d32 !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-export-pdf {
    background-color: var(--color-danger) !important;
    color: #ffffff !important;
    border-color: var(--color-danger) !important;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-export-pdf:hover {
    background-color: #c62828 !important;
    border-color: #c62828 !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.nav-link:hover {
    color: var(--color-primary);
    background-color: var(--bg-secondary);
}

.nav-link i {
    font-size: 0.85rem;
    /* Reduced from 0.9rem */
}

.nav-more {
    position: relative;
}

.nav-more-toggle {
    border: none;
    background: transparent;
    cursor: pointer;
}

.nav-more-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    list-style: none;
    margin: 0;
    padding: 0.25rem 0;
    min-width: 160px;
    display: none;
    z-index: 1000;
}

.nav-more:hover .nav-more-menu {
    display: block;
}

.btn-commande {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: white !important;
    padding: 0.4rem 0.8rem;
    border-radius: var(--border-radius-round);
    font-weight: 600;
}

/* Global Badge Styling */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1;
    min-width: 1.2rem;
}

/* Absolute Protection for Amounts & Badges */
.amount-nowrap,
.price,
.stat-value,
td strong,
.total-val,
.total-row span,
.product-price,
.cart-item-price {
    white-space: nowrap !important;
    display: inline-block;
}


@media (max-width: 768px) {

    /* ========== FORCE ABSOLUE FOND BLANC MENU MOBILE ========== */
    /* ========== FORCE ABSOLUE FOND BLANC MENU MOBILE ========== */
    .nav-menu,
    ul.nav-menu,
    #navMenu {
        background-color: var(--bg-primary);
        /* Use variable instead of fixed white */
    }

    /* Remove specific dark mode overrides that forced white */

    .nav-menu.active,
    ul.nav-menu.active,
    #navMenu.active {
        background-color: var(--bg-primary) !important;
    }

    /* ========== FIN FORCE FOND BLANC ========== */

    .amount-nowrap,
    .price,
    .product-price,
    .cart-item-price {
        font-size: 0.9em !important;
    }
}

@media (max-width: 480px) {

    .amount-nowrap,
    .price,
    .product-price,
    .cart-item-price {
        font-size: 0.8em !important;
    }

    .total-row {
        font-size: 0.85rem !important;
    }
}

.btn-commande:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Menu burger pour mobile */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

/* Bouton de changement de thème */
.theme-toggle {
    background-color: var(--bg-secondary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    margin-left: 0.25rem;
}

.theme-toggle:hover {
    background-color: var(--color-primary);
    transform: rotate(180deg);
}

.theme-toggle i {
    font-size: 1rem;
    /* Gardé à 1rem */
    color: var(--text-primary);
}

@media (min-width: 769px) and (max-width: 1100px) {
    .nav-container {
        flex-wrap: wrap;
        padding: 0.5rem 15px;
    }

    .logo {
        order: 1;
        flex: 0 0 auto;
    }

    .theme-toggle {
        order: 2;
        flex: 0 0 auto;
    }

    .nav-menu {
        order: 3;
        width: 100%;
        margin-top: 0.5rem;
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* ==================== Messages Flash ==================== */
.flash-messages-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
}

.flash-message {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.4s ease;
    background-color: var(--bg-secondary);
}

.flash-success {
    border-left: 4px solid var(--color-success);
}

.flash-error {
    border-left: 4px solid var(--color-danger);
}

.flash-warning {
    border-left: 4px solid var(--color-warning);
}

.flash-info {
    border-left: 4px solid var(--color-info);
}

.flash-close {
    margin-left: auto;
    background: transparent;
    border: none;
    font-size: 1.2rem;
    /* Réduit de 1.5rem */
    cursor: pointer;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.flash-close:hover {
    color: var(--text-primary);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== Page Wrapper ==================== */
.page-wrapper {
    min-height: calc(100vh - 200px);
    padding: 1.25rem 0;
}

/* ==================== Grilles Produits (Menu) ==================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
}

.product-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
    overflow: hidden;
    border: 1px solid var(--bg-tertiary);
    display: flex;
    /* Flex layout for image + content */
}

.product-card,
.product-info,
.card,
.feature-item,
.stat-card,
.dashboard-card,
.form-card,
.section,
.flash-message {
    min-width: 0;
}

.product-card,
.product-info,
.card,
.feature-item,
.stat-card,
.dashboard-card,
.form-card,
.section,
.flash-message,
.btn,
.badge,
.status-badge,
.data-table td,
.data-table th {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* ==================== Smart Filter Bar (Unified Design) ==================== */
.smart-filter-bar {
    background: var(--bg-secondary);
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--bg-tertiary);
    margin-bottom: 2.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.search-wrapper {
    position: relative;
    flex: 1.5;
    min-width: 250px;
}

.search-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1rem;
}

.search-wrapper input {
    width: 100%;
    padding: 0.75rem 1.2rem 0.75rem 2.8rem !important;
    border: 1.5px solid var(--bg-tertiary) !important;
    border-radius: 12px !important;
    background: var(--bg-primary) !important;
    color: var(--text-primary);
    font-size: 0.95rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-wrapper input:focus {
    border-color: var(--color-primary) !important;
    outline: none;
    box-shadow: 0 0 0 4px rgba(var(--color-primary-rgb), 0.15);
    background: var(--bg-primary) !important;
}

.smart-filter-bar select {
    padding: 0.75rem 1.2rem !important;
    border: 1.5px solid var(--bg-tertiary) !important;
    border-radius: 12px !important;
    font-size: 0.95rem !important;
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    height: auto !important;
    min-width: 180px;
    cursor: pointer;
    transition: all 0.3s;
}

.smart-filter-bar select:focus {
    border-color: var(--color-primary) !important;
    outline: none;
    box-shadow: 0 0 0 4px rgba(var(--color-primary-rgb), 0.15);
}

@media (max-width: 768px) {
    .smart-filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem;
    }

    .smart-filter-bar select {
        width: 100%;
    }
}

/* ==================== Boutons génériques ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--border-radius-round);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    font-size: 0.75rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-info {
    background: linear-gradient(135deg, var(--color-info), #0277bd);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #0277bd, var(--color-info));
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(3, 155, 229, 0.3);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--bg-tertiary);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover {
    background-color: var(--color-primary);
    color: white;
}

/* Petite taille de bouton */
.btn-sm {
    padding: 0.15rem 0.4rem;
    font-size: 0.7rem;
}

.btn i {
    font-size: 0.8em;
}

/* ==================== Action Buttons ==================== */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    /* Circular buttons */
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: white;
    margin: 0 0.2rem;
    font-size: 0.9rem;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-edit {
    background-color: #ffc107;
    /* Yellow */
    color: #000;
    /* Black text for better contrast on yellow */
}

.btn-edit:hover {
    background-color: #ffca2c;
}

.btn-delete {
    background-color: var(--color-danger);
    /* Red */
    color: white;
}

.btn-delete:hover {
    background-color: #c62828;
}

.btn-view {
    background-color: var(--color-info);
    color: white;
}

.btn-view:hover {
    background-color: #0288d1;
}

/* ==================== Status Badges & States ==================== */
.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-ready {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    box-shadow: 0 3px 10px rgba(46, 204, 113, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-ready::before {
    content: "";
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

.status-preparing {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--bg-tertiary);
}

.status-badge i {
    font-size: 0.9em;
}

/* ==================== Footer ==================== */
.footer {
    background-color: var(--bg-secondary);
    padding: 2rem 0 1rem;
    margin-top: 4rem;
    border-top: 1px solid var(--bg-tertiary);
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--color-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    /* Réduit de 1.25rem */
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.footer-section a:hover {
    color: var(--color-primary);
}

.footer-section i {
    margin-right: 0.5rem;
    color: var(--color-primary);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.social-links a:hover {
    background-color: var(--color-primary);
    transform: translateY(-3px);
}

.social-links i {
    color: var(--text-primary);
    margin: 0;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--bg-tertiary);
    color: var(--text-secondary);
}

/* ==================== Formulaires ==================== */
.form-card {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--border-radius-md);
    margin-bottom: 1.5rem;
    border: 1px solid var(--bg-tertiary);
    box-shadow: var(--shadow-sm);
}

.form-group {
    margin-bottom: 0.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    font-family: inherit;
    font-size: 0.85rem;
    min-height: 32px;
}

.form-control:focus {
    border-color: var(--color-primary);
    background: var(--bg-primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(var(--color-primary-rgb), 0.1);
    /* Glow effect */
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

/* --- Global Admin Layout --- */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .top-bar-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

.section {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid var(--bg-tertiary);
    margin-bottom: 2rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--bg-tertiary);
    text-align: left;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 10px;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    background: var(--bg-secondary);
    border-radius: 15px;
}

/* ==================== Dashboard Layouts ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--bg-tertiary);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}

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

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1.1;
    word-break: break-word;
    white-space: normal;
}

.stat-card .trend {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    display: block;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: var(--bg-secondary);
    padding: 0.9rem;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--bg-tertiary);
}

.dashboard-card h2 {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Responsive Tables to Cards --- */
@media (max-width: 768px) {
    .data-table thead {
        display: none;
        /* Cache les en-têtes sur mobile */
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        background: var(--bg-secondary);
        margin-bottom: 1rem;
        border: 1px solid var(--bg-tertiary);
        border-radius: 12px;
        padding: 0.5rem;
        box-shadow: var(--shadow-sm);
    }

    .data-table td {
        text-align: right !important;
        padding: 0.75rem 1rem;
        position: relative;
        border-bottom: 1px solid var(--bg-tertiary);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .data-table td:last-child {
        border-bottom: none;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-secondary);
        font-size: 0.8rem;
        text-transform: uppercase;
    }
}

/* ==================== Modals ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.modal-content {
    background-color: var(--bg-secondary);
    margin: 5vh auto;
    padding: 2.5rem;
    border: 1px solid var(--bg-tertiary);
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bg-tertiary);
}

.close {
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.close:hover {
    color: var(--color-danger);
}

/* ==================== User Avatars ==================== */
.user-avatar-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar-circle {
    width: 24px;
    height: 24px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

.user-avatar-name {
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* ==================== Finance Grid Layout ==================== */
.finance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ==================== Stat Cards Row (Finance) ==================== */
.stat-card-row {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.8rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--bg-tertiary);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card-row:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
}

.stat-info h3 {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-info p {
    margin: 0 0 0.25rem;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-info small {
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Global Mobile Badge Positioning */
.mobile-nav-item {
    position: relative;
}

.mobile-nav-item .notification-badge {
    position: absolute !important;
    top: 2px !important; /* Higher up */
    right: 50% !important;
    margin: 0 !important;
    transform: translateX(120%) !important; /* Move slightly more right */
    font-size: 0.5rem !important; /* Smaller font */
    padding: 1px 3px !important; /* Smaller padding */
    min-width: 12px !important; /* Smaller min-width */
    height: 12px !important; /* Smaller height */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    line-height: 1 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    z-index: 10;
    border: 1px solid var(--bg-secondary); /* Add border for better separation */
}