*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scrollbar-gutter: stable;
}

html, body {
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    max-width: 100vw;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.35);
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.65);
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.progress-bar-fill {
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

.meal-card {
    transition: transform 0.22s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.22s cubic-bezier(0.2, 0, 0, 1), border-color 0.2s ease;
}

.meal-drag-handle, .item-drag-handle {
    touch-action: none;
    cursor: grab;
}

.meal-drag-handle:active, .item-drag-handle:active {
    cursor: grabbing;
}

.sortable-ghost-meal {
    opacity: 0.35;
    background: rgba(16, 185, 129, 0.08) !important;
    border: 2px dashed #10b981 !important;
    transform: scale(0.98);
}

.sortable-chosen-meal {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(16, 185, 129, 0.2) !important;
}

.sortable-drag-meal {
    opacity: 0.96 !important;
    transform: rotate(1deg) scale(1.015);
    z-index: 50;
}

.sortable-ghost-item {
    opacity: 0.4;
    background: rgba(16, 185, 129, 0.12) !important;
    border: 1px dashed #10b981 !important;
}

.sortable-drag-item {
    box-shadow: 0 12px 20px -4px rgba(0, 0, 0, 0.22) !important;
    transform: scale(1.01);
}

.collapsible-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr;
    min-width: 0;
    max-width: 100%;
    opacity: 1;
    transition: grid-template-rows 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease, margin-top 0.28s ease;
}

.collapsible-wrapper.is-collapsed {
    grid-template-rows: 0fr;
    opacity: 0;
    margin-top: 0 !important;
    pointer-events: none;
}

.collapsible-inner {
    overflow: hidden;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.collapsible-wrapper:not(.is-collapsed) > .collapsible-inner {
    overflow: visible;
}

.chevron-icon {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.is-collapsed-chevron {
    transform: rotate(-90deg);
}

.btn-interactive {
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn-interactive:hover {
    transform: translateY(-1.5px);
}

.btn-interactive:active {
    transform: translateY(0px) scale(0.96);
}

.card-hover-lift {
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

@keyframes modalPopIn {
    0% { opacity: 0; transform: scale(0.95) translateY(8px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-animate-in {
    animation: modalPopIn 0.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes dropdownFadeIn {
    0% { opacity: 0; transform: translateY(-6px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.custom-dropdown-menu {
    z-index: 60;
    animation: dropdownFadeIn 0.16s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.sidebar-nav-btn {
    border: 1px solid transparent;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.sidebar-nav-btn.is-active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(20, 184, 166, 0.12));
    color: #059669;
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 2px 10px -2px rgba(16, 185, 129, 0.15);
}

.dark .sidebar-nav-btn.is-active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(20, 184, 166, 0.12));
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.4);
}

@keyframes tabFadeIn {
    0% { opacity: 0; transform: translateY(4px); }
    100% { opacity: 1; transform: translateY(0); }
}

.tab-panel-animate {
    animation: tabFadeIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}


