/* ===== Global styles for all pages ===== */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 1rem;
}


/* ===== STICKY NAV STACK ===== */

.nav-stack {
    position: sticky;
    top: 0;
    z-index: 1020;
}


/* ── Row 1: App bar ── */

.app-bar {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 0 0.75rem;
    height: 46px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Home / account dropdown trigger */
.menu-trigger {
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #495057;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.menu-trigger:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}
.menu-trigger .caret {
    font-size: 0.6rem;
    opacity: 0.5;
}

/* Dropdown menu */
.menu-trigger + .dropdown-menu {
    min-width: 220px;
    padding: 0.5rem 0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.dropdown-user-info {
    padding: 0.5rem 1rem 0.6rem;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 0.25rem;
}
.dropdown-user-email {
    font-size: 0.8rem;
    color: #495057;
    font-weight: 500;
}
.dropdown-item {
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
}

/* Brand */
.app-brand {
    font-weight: 700;
    font-size: 1rem;
    color: #212529;
    white-space: nowrap;
    margin-right: 0.25rem;
}

/* Project section tabs */
.app-section-tabs {
    border: none;
    margin-bottom: 0;
}
.app-section-tabs .nav-link {
    border: none;
    padding: 0.6rem 0.75rem;
    font-size: 0.875rem;
    color: #6c757d;
    border-bottom: 2px solid transparent;
}
.app-section-tabs .nav-link:hover {
    color: #212529;
    border-bottom-color: #adb5bd;
}
.app-section-tabs .nav-link.active {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
    background: transparent;
}


/* ── Budget summary (right side of app bar) ── */

.budget-summary {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.8rem;
    white-space: nowrap;
}
.budget-summary-item {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
}
.budget-summary-label {
    color: #6c757d;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.budget-summary-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #495057;
}
.budget-summary-divider {
    width: 1px;
    height: 20px;
    background: #ced4da;
}
.budget-summary-total .budget-summary-value {
    font-weight: 700;
    font-size: 0.9rem;
    color: #212529;
}


/* ── Row 2: Sub-bar (budget tabs, DMP tabs, etc.) ── */

.sub-bar {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0 0.75rem;
    height: 38px;
    display: flex;
    align-items: center;
}
.sub-bar .nav-tabs {
    border: none;
    margin-bottom: 0;
}
.sub-bar .nav-tabs .nav-link {
    border: none;
    padding: 0.4rem 0.65rem;
    font-size: 0.8rem;
    color: #6c757d;
    border-bottom: 2px solid transparent;
}
.sub-bar .nav-tabs .nav-link:hover {
    color: #212529;
    border-bottom-color: #adb5bd;
}
.sub-bar .nav-tabs .nav-link.active {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
    background: transparent;
}


/* ===== TOAST NOTIFICATIONS (flash messages) ===== */

.toast-container {
    z-index: 9999;
}

.toast {
    min-width: 300px;
    max-width: 500px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-header {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-weight: 600;
}

.toast-body {
    padding: 1rem;
    font-size: 0.95rem;
    color: #212529;
}

.toast-header.bg-success { background-color: #28a745 !important; }
.toast-header.bg-danger  { background-color: #dc3545 !important; }
.toast-header.bg-info    { background-color: #17a2b8 !important; }


/* ===== RESPONSIVE ===== */

@media (max-width: 992px) {
    .app-bar {
        flex-wrap: wrap;
        height: auto;
        padding: 0.35rem 0.75rem;
        gap: 0.25rem;
    }
    .budget-summary {
        margin-left: 0;
        width: 100%;
        padding: 0.3rem 0;
        gap: 0.6rem;
    }
}

@media (max-width: 576px) {
    .budget-summary {
        font-size: 0.7rem;
        gap: 0.4rem;
    }
    .budget-summary-label {
        display: none;
    }
}