/* ============================================
   MOBILE BOTTOM NAV – PREMIUM BLUE
   ============================================ */

/* Hide bottom nav on desktop */
.bottom-nav {
    display: none;
}

@media (max-width: 768px) {

    /* ====== HIDE TOP NAVBAR LINKS ON MOBILE ====== */
    .navbar .nav-links,
    .navbar .user-badge,
    .navbar .logout,
    .navbar .upgrade-btn,
    .navbar > *:not(.logo) {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        width: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        pointer-events: none !important;
    }

    /* ====== LOGO LEFT-ALIGNED ====== */
    .navbar .logo {
        display: flex !important;
        justify-content: flex-start;
        width: auto;
        font-size: 22px !important;
    }
    .navbar .logo img {
        height: 28px !important;
        width: auto !important;
    }
    .navbar {
        flex-direction: row !important;
        justify-content: flex-start !important;
        padding: 10px 0 !important;
        border-bottom: 1px solid #E8EDF2;
        margin-bottom: 16px !important;
    }

    /* ====== BOTTOM NAV ====== */
    .bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #FFFFFF;
        border-top: 1px solid #E8EDF2;
        justify-content: space-around;
        align-items: center;
        padding: 6px 0 10px;
        z-index: 1000;
        height: 60px;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    }

    .bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        text-decoration: none;
        color: #8A9AAB;
        font-size: 10px;
        font-weight: 500;
        min-width: 50px;
        padding: 2px 10px;
        transition: all 0.2s ease;
        flex: 1;
    }

    .bottom-nav a .icon {
        font-size: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #8A9AAB;
        transition: all 0.2s ease;
        width: 28px;
        height: 28px;
    }

    .bottom-nav a .icon img {
        max-height: 24px;
        max-width: 24px;
        object-fit: contain;
        opacity: 0.5;
    }

    .bottom-nav a .fallback {
        font-size: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #8A9AAB;
        transition: all 0.2s ease;
    }

    .bottom-nav a span:last-child {
        font-size: 10px;
        color: #8A9AAB;
        transition: all 0.2s ease;
        line-height: 1.2;
    }

    .bottom-nav a.active .icon {
        color: #4F7CFF;
    }
    .bottom-nav a.active .icon img {
        opacity: 1;
    }
    .bottom-nav a.active .fallback {
        color: #4F7CFF;
    }
    .bottom-nav a.active span:last-child {
        color: #4F7CFF;
        font-weight: 600;
    }
    .btn-secondary {
    background: #F8FAFC;
    border: 1px solid #E8EDF2;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    color: #5E6F82;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}
.btn-secondary:hover {
    background: #EEF2F7;
}

    /* ====== PADDING SO CONTENT ISN'T HIDDEN ====== */
    .app-container,
    .main-content,
    .container {
        padding-bottom: 76px !important;
    }

    /* ====== <i class="fas fa-check-circle"></i> KEEP 2×2 GRID FOR METRIC CARDS ====== */
    .metrics-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
        margin-bottom: 16px !important;
    }

    .metric-card {
        padding: 14px 16px !important;
        border-radius: 12px !important;
    }

    .metric-card .label {
        font-size: 10px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.04em !important;
    }

    .metric-card .value {
        font-size: 20px !important;
        font-weight: 700 !important;
        margin-top: 2px !important;
    }

    .metric-card .sub {
        font-size: 11px !important;
        margin-top: 2px !important;
    }

    /* ====== TOP BAR ====== */
    .top-bar {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
        margin-bottom: 16px !important;
    }
    .top-bar h1 {
        font-size: 20px !important;
    }
    .top-bar h1 span {
        font-size: 14px !important;
    }
    .top-bar-actions {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    .top-bar-actions .date {
        font-size: 12px !important;
    }
    .btn-primary {
        padding: 8px 16px !important;
        font-size: 13px !important;
    }

    /* ====== USAGE RINGS ====== */
    .usage-rings-container {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 16px !important;
        padding: 14px 16px !important;
        justify-content: flex-start !important;
        margin: 16px 0 !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .ring-wrapper {
        width: 80px !important;
        height: 80px !important;
        flex-shrink: 0 !important;
    }
    .ring-wrapper .track,
    .ring-wrapper .progress-fill {
        stroke-width: 8 !important;
    }
    .ring-label .ring-count {
        font-size: 18px !important;
    }
    .ring-label .ring-name {
        font-size: 9px !important;
    }
    .ring-limit {
        font-size: 9px !important;
        margin-top: 4px !important;
    }

    /* ====== SPLIT PANEL (Deals & Expenses) ====== */
    .split-panel {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        margin-bottom: 16px !important;
    }

    .panel {
        padding: 14px !important;
        border-radius: 12px !important;
    }

    .panel-header h3 {
        font-size: 14px !important;
    }

    .deal-item,
    .expense-item {
        padding: 10px 0 !important;
    }

    .deal-brand,
    .expense-vendor {
        font-size: 13px !important;
    }

    .deal-amount,
    .expense-amount {
        font-size: 13px !important;
    }

    /* ====== MAIN CONTENT ====== */
    .main-content {
        padding: 12px !important;
        padding-top: 56px !important;
        padding-bottom: 76px !important;
        margin-left: 0 !important;
    }

    /* ====== SIDEBAR ====== */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 2px 0 24px rgba(0, 0, 0, 0.08);
        transition: transform 0.3s ease;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 999;
    }
    .sidebar-overlay.active {
        display: block !important;
    }
    .menu-toggle {
        display: block !important;
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 1001;
        background: #FFFFFF;
        border: 1px solid #E8EDF2;
        border-radius: 8px;
        padding: 8px 12px;
        color: #000000;
        font-size: 18px;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    /* ====== TOUCH-FRIENDLY INPUTS ====== */
    button,
    .btn-primary,
    .btn-secondary,
    .btn-save,
    .btn-cancel,
    input,
    select,
    textarea {
        font-size: 16px !important;
        min-height: 44px;
    }
    input,
    select,
    textarea {
        padding: 10px 14px !important;
    }

    /* ====== MODALS ====== */
    .modal-overlay.active {
        align-items: flex-end !important;
    }
    .modal {
        max-height: 85vh;
        border-radius: 16px 16px 0 0 !important;
        margin: 0 !important;
        padding: 20px 16px 28px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .modal h2 {
        font-size: 20px !important;
    }
    .modal-actions {
        flex-direction: column !important;
        gap: 8px !important;
    }

    /* ====== CARDS ====== */
    .card,
    .panel,
    .deal-card,
    .invoice-card,
    .profile-card {
        padding: 14px !important;
        border-radius: 12px !important;
        margin-bottom: 12px !important;
    }

    /* ====== LAYOUT ====== */
    .profile-grid {
        grid-template-columns: 1fr !important;
    }
    .stats-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }
    .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    .page-header h1 {
        font-size: 22px !important;
    }
    .search-filter-row {
        flex-direction: column !important;
    }
    .table-container {
        overflow-x: auto !important;
    }
    table {
        font-size: 12px !important;
    }
    th,
    td {
        padding: 8px 10px !important;
    }
    .form-actions {
        flex-direction: column !important;
    }
    .form-actions button {
        width: 100% !important;
    }
    .invoice-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .invoice-card {
        padding: 16px !important;
    }
    .invoice-card .amount {
        font-size: 20px !important;
    }
}

/* ====== VERY SMALL SCREENS (under 480px) ====== */
@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .metric-card {
        padding: 12px !important;
    }

    .metric-card .value {
        font-size: 18px !important;
    }

    .top-bar h1 {
        font-size: 18px !important;
    }

    .usage-rings-container {
        gap: 12px !important;
        padding: 10px 12px !important;
    }

    .ring-wrapper {
        width: 65px !important;
        height: 65px !important;
    }
    .ring-wrapper .track,
    .ring-wrapper .progress-fill {
        stroke-width: 6 !important;
    }
    .ring-label .ring-count {
        font-size: 16px !important;
    }
    .ring-label .ring-name {
        font-size: 8px !important;
    }
    .ring-limit {
        font-size: 8px !important;
        margin-top: 3px !important;
    }

    .stats-row {
        grid-template-columns: 1fr 1fr !important;
    }

    .bottom-nav {
        height: 56px !important;
        padding: 4px 0 8px !important;
    }
    .bottom-nav a .icon {
        font-size: 22px !important;
        height: 24px !important;
        width: 24px !important;
    }
    .bottom-nav a span:last-child {
        font-size: 9px !important;
    }

    .main-content {
        padding: 10px !important;
        padding-top: 48px !important;
        padding-bottom: 72px !important;
    }

    .modal {
        padding: 16px 14px 24px !important;
    }
}

@media (max-width: 380px) {
    .metrics-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .metric-card {
        padding: 10px !important;
    }

    .metric-card .value {
        font-size: 16px !important;
    }

    .usage-rings-container {
        justify-content: flex-start !important;
        overflow-x: auto !important;
        gap: 10px !important;
        padding: 8px 12px !important;
    }
    .ring-item {
        flex: 0 0 auto !important;
    }

    .bottom-nav a {
        min-width: 40px !important;
        padding: 2px 6px !important;
    }
    .bottom-nav a .icon {
        font-size: 20px !important;
        height: 22px !important;
        width: 22px !important;
    }
    .bottom-nav a span:last-child {
        font-size: 8px !important;
    }
    .bottom-nav {
        height: 52px !important;
        padding: 3px 0 6px !important;
    }
}