body {
    min-height: 100vh;
}

.card,
.form-control,
.form-select,
.btn {
    border-radius: 14px;
}

.stat-card {
    border: 0;
    box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,.08);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-head {
    font-weight: 700;
    text-align: center;
    padding: 10px 6px;
    background: #e9f7ef;
    border-radius: 12px;
}

.calendar-cell {
    background: #fff;
    min-height: 90px;
    padding: 10px;
    border-radius: 14px;
    position: relative;
    box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,.06);
}

.calendar-cell.has-entry {
    border: 2px solid #198754;
}

.calendar-cell.empty {
    background: transparent;
    box-shadow: none;
}

.autocomplete-list {
    position: relative;
    z-index: 50;
}

.autocomplete-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 1055;
}

.autocomplete-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow-y: auto;
    max-height: 260px;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.12);
}

.autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f1f1;
    touch-action: manipulation;
}

.autocomplete-item:last-child {
    border-bottom: 0;
}

.autocomplete-item:hover {
    background: #f8f9fa;
}


@media (max-width: 767.98px) {
    .autocomplete-box {
        max-height: 260px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 767.98px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .calendar-cell {
        min-height: 72px;
        padding: 8px;
        font-size: 12px;
    }

    .btn-lg {
        padding-top: 0.85rem;
        padding-bottom: 0.85rem;
    }
}

.chart-wrap {
    position: relative;
    width: 100%;
    height: 260px;
}

@media (max-width: 767.98px) {
    .chart-wrap {
        height: 220px;
    }
}

.table td,
.table th {
    vertical-align: middle;
}

@media (max-width: 767.98px) {
    .table-responsive {
        font-size: 13px;
    }

    .autocomplete-box {
        max-height: 260px;
        overflow-y: auto;
    }
}

.serving-buttons .btn {
    border-radius: 999px;
}

@media (max-width: 767.98px) {
    .serving-buttons .btn {
        padding: 0.35rem 0.7rem;
        font-size: 12px;
    }
}

.nav-link {
    transition: all 0.2s ease;
}

@media (min-width: 992px) {
    .app-subnav .nav-link {
        border-radius: 999px;
        font-weight: 500;
        color: #212529;
    }

    .app-subnav .nav-link:hover {
        background: rgba(25, 135, 84, 0.08);
        color: #198754 !important;
    }

    .app-subnav .nav-link.active {
        background: #198754;
        color: #fff !important;
    }
}

.nav-link {
    transition: all 0.2s ease;
}

.app-topbar .navbar-brand {
    letter-spacing: 0.2px;
}

.brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffd54f;
    display: inline-block;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.app-topbar .btn {
    border-radius: 999px;
}

.app-subnav-wrap {
    backdrop-filter: blur(6px);
}

@media (min-width: 992px) {
    .app-subnav .nav-link {
        border-radius: 999px;
        font-weight: 500;
        color: #212529;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .app-subnav .nav-link:hover {
        background: rgba(25, 135, 84, 0.08);
        color: #198754 !important;
    }

    .app-subnav .nav-link.active {
        background: #198754;
        color: #fff !important;
        box-shadow: 0 4px 14px rgba(25, 135, 84, 0.18);
    }
}

@media (max-width: 991.98px) {
    .app-topbar .btn {
        justify-content: center;
    }
}

.food-entry-card {
    border-radius: 1rem;
}

.food-entry-card .form-label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.food-entry-card .form-control,
.food-entry-card .form-select {
    min-height: 44px;
    border-radius: 0.85rem;
}

.food-entry-card .btn {
    border-radius: 999px;
}

.food-entry-card .serving-buttons .btn {
    min-height: 40px;
    padding-inline: 0.9rem; 
}

.food-total-box {
    border-color: #e9ecef !important;
}


@media (max-width: 767.98px) {
    .food-entry-card .card-body {
        padding: 1rem;
    }

    .food-entry-card .remove-row {
        font-size: 0.85rem;
    }
}

.autocomplete-load-more {
    position: sticky;
    bottom: 0;
}
