/* ============================================
   FOOD CATALOG - FONT OVERRIDE (match sidebar Inter)
   ============================================ */
body[data-page="food-catalog"],
body[data-page="food-catalog"] .food-catalog-entry-card,
body[data-page="food-catalog"] .diet-view-item-name,
body[data-page="food-catalog"] .diet-view-item-qty,
body[data-page="food-catalog"] .catalog-section-label,
body[data-page="food-catalog"] .food-catalog-sticky-controls {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 400;
}

/* ============================================
   ADMIN PAGES - TAB BAR STYLES
   ============================================ */

.admin-tab-bar {
    background-color: transparent;
    border-bottom: none;
    padding: 0;
    margin-bottom: 22px;
    justify-content: center;
}

.admin-tab-bar .nav-link {
    color: #64748b;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 13px;
    margin: 0 4px;
    transition: all 0.2s ease;
}

.admin-tab-bar .nav-link:hover {
    color: #0f172a;
    background-color: rgba(15, 23, 42, 0.04);
}

.admin-tab-bar .nav-link.active {
    color: #0f172a;
    background-color: #e2e8f0;
    border-color: #cbd5e1;
}

/* ============================================
   DIET CHART PAGE - ADMIN GREETING
   ============================================ */

.admin-greeting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.admin-greeting-text {
    font-size: 14px;
    color: #475569;
    font-weight: 500;
}

.diet-view-save-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 8px 12px 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background-color: #e5e7eb;
    border: 1px solid #d1d5db;
}

.diet-view-save-text {
    font-size: 13px;
    color: #334155;
    font-weight: 600;
}

.diet-view-save-btn {
    border: none;
    border-radius: 999px;
    padding: 7px 14px;
    background-color: #f8fafc;
    color: #1f2937;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.diet-view-save-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.diet-header-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #0f172a;
    border-radius: 10px;
    padding: 8px 10px;
}

.diet-header-brand-logo {
    width: 108px;
    height: auto;
    display: block;
}

.diet-page-shell {
    max-width: 920px;
    margin: 0 auto;
}

.diet-page-card {
    background-color: #ffffff;
    border: 1px solid rgba(100, 116, 139, 0.12);
    border-radius: 26px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
    padding: 24px;
}

.diet-page-top {
    padding: 0 8px;
}

.diet-page-subtitle {
    font-size: 16px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 6px;
}

.diet-page-title {
    display: none;
}

.diet-page-copy {
    font-size: 14px;
    color: #64748b;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

body[data-page="diet-chart"] .tp-hero-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0 8px 18px;
}

body[data-page="diet-chart"] .tp-eyebrow {
    margin: 0 0 4px;
    color: #0f6fea;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2em;
}

body[data-page="diet-chart"] .tp-page-title {
    margin: 0;
    color: #101828;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.04;
    font-weight: 750;
    letter-spacing: -0.045em;
    display: block;
}

body[data-page="diet-chart"] .tp-page-subtitle {
    margin: 8px 0 0;
    color: #667085;
    font-size: 16px;
    line-height: 1.45;
    font-weight: 400;
}

/* ============================================
   DIET CHART PAGE - MEAL CARDS
   ============================================ */

.meal-card {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    margin-bottom: 20px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.meal-card-header {
    background-color: #f8f9fa;
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.meal-card-header input {
    flex: 1;
    min-width: 200px;
}

.meal-card-body {
    padding: 15px;
}

/* ============================================
   DIET CHART PAGE - FOOD ITEMS
   ============================================ */

.food-item-row {
    background-color: #f8f9fa;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 0.25rem;
    border-left: 3px solid #ffc107;
}

.food-item-row-header {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.food-item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.food-item-field {
    display: flex;
    flex-direction: column;
}

.food-item-field label {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.food-item-field input,
.food-item-field select {
    font-size: 14px;
}

/* ============================================
   DIET CHART PAGE - CALCULATED FIELDS
   ============================================ */

.calculated-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
}

.calculated-field {
    padding: 8px;
    background-color: #e7f3ff;
    border-radius: 0.25rem;
    text-align: center;
}

.calculated-field label {
    font-size: 11px;
    font-weight: 600;
    color: #495057;
    display: block;
    margin-bottom: 3px;
}

.calculated-field .value {
    font-size: 16px;
    font-weight: 700;
    color: #0056b3;
}

.btn-remove-item {
    padding: 0.25rem 0.5rem;
    font-size: 12px;
}

/* ============================================
   FOOD CATALOG PAGE
   ============================================ */

.food-list-card {
    height: auto;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.food-form-modal-content {
    border: 0;
    border-radius: 14px;
    overflow: hidden;
}

.food-form-modal-content .form-control,
.food-form-modal-content .input-group-text,
.food-form-modal-content .btn,
.food-form-modal-content .modal-header,
.food-form-modal-content .modal-footer,
.food-form-modal-content .form-control-file {
    border-radius: 8px;
}

.food-form-modal-content .modal-header {
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
    border-radius: 14px 14px 0 0;
}

.food-modal-title-wrap {
    display: grid;
    gap: 2px;
    margin-top: 7px;
}

.food-modal-subtitle {
    color: #6b7280;
    font-size: 12px;
}

.food-add-row-btn {
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fcff 0%, #eef6ff 100%);
    color: #2b6cb0;
    font-weight: 700;
    padding: 12px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.food-add-row-btn:hover {
    background: linear-gradient(180deg, #eef6ff 0%, #e3efff 100%);
    color: #1f4f80;
}

.food-form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.food-list-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.food-table-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.food-table-search {
    position: relative;
    min-width: 240px;
    flex: 1 1 260px;
    overflow: visible;
}

.food-table-search i {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: #4b6380;
    font-size: 13px;
    pointer-events: none;
}

.food-table-search .form-control {
    padding-left: 36px;
    height: 38px;
    border-radius: 999px;
    border-color: #c7d6e5;
    box-shadow: none;
    font-size: 14px;
}

.food-search-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background-color: #ffffff;
    border: 1px solid #d9e6f2;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
    z-index: 30;
    padding: 6px;
    max-height: 260px;
    overflow-y: auto;
}

.food-search-suggestion-item {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 10px 12px;
    font-size: 14px;
    color: #1f2937;
    border-radius: 10px;
}

.food-search-suggestion-item:hover,
.food-search-suggestion-item:focus {
    outline: none;
    background-color: #f3f8ff;
}

.food-sort-select {
    min-width: 210px;
    height: 38px;
    border-radius: 10px;
    border-color: #c7d6e5;
    box-shadow: none;
    font-size: 14px;
}

.food-sort-dropdown {
    flex: 0 0 auto;
}

.food-sort-icon-btn {
    height: 38px;
    width: 38px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-color: #9db6cf;
    color: #375a7f;
}

.food-sort-icon-btn i {
    font-size: 13px;
}

.food-refresh-btn {
    height: 38px;
    width: 38px;
    border-radius: 999px;
    border-color: #9db6cf;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.food-form-status {
    min-height: 1px;
}

.food-table-wrapper {
    overflow: visible;
}

.food-catalog-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.food-catalog-pick-row {
    width: 100%;
    border: 1px solid #d9e6f2;
    border-radius: 10px;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
}

.food-catalog-pick-row:hover {
    background-color: #f8fbff;
    border-color: #a5c4e6;
}

.food-catalog-pick-left {
    min-width: 0;
}

.food-catalog-pick-name {
    font-size: 14px;
    font-weight: 700;
    color: #0f4c81;
}

.food-catalog-pick-meta {
    font-size: 12px;
    color: #64748b;
}

.food-catalog-pick-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ── Catalog modal search ── */
/* ── Catalog modal header: light on mobile/tablet, dark on desktop ── */
#selectFoodModal .catalog-modal-header {
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
    border-radius: 14px 14px 0 0;
}

#addFoodModal .catalog-modal-header,
#foodFormModal .catalog-modal-header,
#customFoodModal .catalog-modal-header {
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
    border-radius: 14px 14px 0 0;
}

#selectFoodModal .catalog-modal-header .modal-title,
#selectFoodModal .catalog-modal-header .food-modal-title-wrap {
    color: #0f172a;
}

#addFoodModal .catalog-modal-header .modal-title,
#addFoodModal .catalog-modal-header .food-modal-title-wrap,
#foodFormModal .catalog-modal-header .modal-title,
#foodFormModal .catalog-modal-header .food-modal-title-wrap,
#customFoodModal .catalog-modal-header .modal-title,
#customFoodModal .catalog-modal-header .food-modal-title-wrap {
    color: #0f172a;
}

#selectFoodModal .catalog-modal-close {
    color: #374151;
    opacity: 0.7;
}

#addFoodModal .catalog-modal-close,
#foodFormModal .catalog-modal-close,
#customFoodModal .catalog-modal-close {
    color: #374151;
    opacity: 0.7;
}

#selectFoodModal .catalog-modal-close:hover {
    color: #0f172a;
    opacity: 1;
}

#addFoodModal .catalog-modal-close:hover,
#foodFormModal .catalog-modal-close:hover,
#customFoodModal .catalog-modal-close:hover {
    color: #0f172a;
    opacity: 1;
}

@media (min-width: 992px) {
    #selectFoodModal .catalog-modal-header {
        background: linear-gradient(135deg, #0f2744 0%, #1a3d6e 100%);
        border-bottom-color: rgba(255, 255, 255, 0.08);
    }

    #addFoodModal .catalog-modal-header,
    #foodFormModal .catalog-modal-header,
    #customFoodModal .catalog-modal-header {
        background: linear-gradient(135deg, #0f2744 0%, #1a3d6e 100%);
        border-bottom-color: rgba(255, 255, 255, 0.08);
    }

    #selectFoodModal .catalog-modal-header .modal-title,
    #selectFoodModal .catalog-modal-header .food-modal-title-wrap {
        color: #ffffff;
    }

    #addFoodModal .catalog-modal-header .modal-title,
    #addFoodModal .catalog-modal-header .food-modal-title-wrap,
    #foodFormModal .catalog-modal-header .modal-title,
    #foodFormModal .catalog-modal-header .food-modal-title-wrap,
    #customFoodModal .catalog-modal-header .modal-title,
    #customFoodModal .catalog-modal-header .food-modal-title-wrap {
        color: #ffffff;
    }

    #selectFoodModal .catalog-modal-close {
        color: rgba(255, 255, 255, 0.8);
        opacity: 1;
        text-shadow: none;
    }

    #addFoodModal .catalog-modal-close,
    #foodFormModal .catalog-modal-close,
    #customFoodModal .catalog-modal-close {
        color: rgba(255, 255, 255, 0.8);
        opacity: 1;
        text-shadow: none;
    }

    #selectFoodModal .catalog-modal-close:hover {
        color: #0f172a;
        opacity: 1;
    }

    #addFoodModal .catalog-modal-close:hover,
    #foodFormModal .catalog-modal-close:hover,
    #customFoodModal .catalog-modal-close:hover {
        color: #ffffff;
        opacity: 1;
    }
}

#customFoodModal .modal-body,
#foodFormModal .modal-body,
#addFoodModal .modal-body {
    background: linear-gradient(180deg, #fbfdff 0%, #f4f8fd 100%);
}

#customFoodModal .form-group label,
#foodFormModal .form-group label,
#addFoodModal .form-group label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #334155;
    text-transform: uppercase;
}

#customFoodModal .form-control,
#foodFormModal .form-control,
#addFoodModal .form-control {
    height: 42px;
    border-radius: 12px;
    border: 1px solid #c7d6e5;
    box-shadow: none;
    background: #f8fcff;
    color: #0f172a;
    font-size: 14px;
}

#customFoodModal .form-control:focus,
#foodFormModal .form-control:focus,
#addFoodModal .form-control:focus {
    border-color: #7bafd4;
    background: #ffffff;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.12);
}

#customFoodModal .input-group-text,
#foodFormModal .input-group-text,
#addFoodModal .input-group-text {
    border: 1px solid #c7d6e5;
    background: #eef5ff;
    color: #334155;
    font-weight: 600;
}

.unit-inside-wrap {
    position: relative;
}

.unit-inside-wrap .form-control {
    padding-right: 48px;
}

.unit-inside-suffix {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    pointer-events: none;
}

#customFoodModal .custom-food-scope-control {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #d3e2f2;
    background: #eef5ff;
}

#customFoodModal .custom-food-scope-top {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

#customFoodModal .scope-option {
    font-size: 12px;
    font-weight: 700;
    color: #3c526d;
}

#customFoodModal .custom-food-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

#customFoodModal .custom-food-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

#customFoodModal .custom-food-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #bfd7ee;
    transition: 0.2s;
    border-radius: 999px;
}

#customFoodModal .custom-food-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: 0.2s;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.22);
}

#customFoodModal .custom-food-switch input:checked + .custom-food-slider {
    background-color: #1d4ed8;
}

#customFoodModal .custom-food-switch input:checked + .custom-food-slider:before {
    transform: translateX(20px);
}

#customFoodModal .food-form-actions,
#foodFormModal .food-form-actions,
#addFoodModal .food-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 6px;
}

#customFoodModal .food-form-actions .btn,
#foodFormModal .food-form-actions .btn,
#addFoodModal .food-form-actions .btn {
    border-radius: 999px;
    font-weight: 700;
    padding: 8px 18px;
    min-width: 110px;
}

#customFoodModal .food-form-actions .btn-primary,
#foodFormModal .food-form-actions .btn-primary,
#addFoodModal .food-form-actions .btn-primary {
    background: linear-gradient(135deg, #2b6cb0 0%, #1a4f8a 100%);
    border-color: transparent;
}

#customFoodModal .food-form-actions .btn-primary:hover,
#foodFormModal .food-form-actions .btn-primary:hover,
#addFoodModal .food-form-actions .btn-primary:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

#customFoodModal .food-form-actions .btn-secondary,
#foodFormModal .food-form-actions .btn-secondary,
#addFoodModal .food-form-actions .btn-secondary {
    background: #eef2f7;
    color: #334155;
    border: 1px solid #d4dde8;
}

#customFoodModal .food-form-actions .btn-secondary:hover,
#foodFormModal .food-form-actions .btn-secondary:hover,
#addFoodModal .food-form-actions .btn-secondary:hover {
    background: #e5ebf3;
    color: #1f2937;
}

.catalog-search-wrap {
    position: relative;
}

.catalog-search-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: #4b6380;
    font-size: 13px;
    pointer-events: none;
}

.catalog-search-input {
    padding-left: 38px !important;
    height: 42px;
    border-radius: 999px !important;
    border-color: #c7d6e5 !important;
    box-shadow: none !important;
    font-size: 14px;
    background: #f8fcff;
}

.catalog-search-input:focus {
    border-color: #7bafd4 !important;
    background: #fff;
}

#selectFoodModal .catalog-search-wrap .catalog-search-suggestions {
    z-index: 1065;
    max-height: 240px;
}

#selectFoodModal .catalog-search-wrap .food-search-suggestion-item.is-active {
    background-color: #f3f8ff;
}

/* ── Diet-themed catalog pick cards ── */
.diet-catalog-pick-card {
    display: flex;
    flex-direction: column;
    background-color: #f8fafc;
    background-image: url('../assets/tyfit_img/food_card_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 14px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    position: relative;
    overflow: visible;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.diet-catalog-pick-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.76);
    z-index: 1;
    pointer-events: none;
}

.diet-catalog-pick-card > * {
    position: relative;
    z-index: 2;
}

.diet-catalog-pick-card:hover {
    border-color: #a5c4e6;
    box-shadow: 0 4px 16px rgba(15, 76, 129, 0.1);
}

.diet-catalog-pick-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.diet-catalog-pick-title {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex-wrap: wrap;
}

.diet-catalog-pick-name {
    font-weight: 700;
    color: #0f172a;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.diet-catalog-ref-qty {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: rgba(100, 116, 139, 0.1);
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 999px;
    padding: 1px 8px;
    white-space: nowrap;
    line-height: 1.6;
}

.diet-catalog-pick-calories {
    font-size: 13px;
    font-weight: 600;
    color: #9a3412;
    white-space: nowrap;
    flex-shrink: 0;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
}

.diet-catalog-pick-macros {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

/* ── Food card footer strip ── */
.diet-catalog-pick-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    margin-top: 8px;
    padding: 12px 12px;
    min-height: 56px;
    background: #e8f1fb;
    border: 1px solid #c8daef;
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    visibility: visible;
    opacity: 1;
    position: relative;
    z-index: 3;
}

.diet-catalog-qty-row {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 2px;
    background: #ffffff;
    border: 1px solid #d1dde9;
    border-radius: 999px;
    padding: 3px 6px;
}

.diet-catalog-qty-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #2b6cb0;
    font-size: 10px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

.diet-catalog-qty-btn:hover {
    background: #eef6ff;
}

.food-catalog-qty-input {
    width: 52px;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    padding: 0 2px !important;
}

.diet-catalog-unit-pill {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: rgba(100, 116, 139, 0.1);
    border: 1px solid rgba(100, 116, 139, 0.18);
    border-radius: 999px;
    padding: 1px 7px;
    white-space: nowrap;
    flex-shrink: 0;
}

.diet-catalog-add-btn {
    border: none;
    background: linear-gradient(135deg, #2b6cb0 0%, #1a4f8a 100%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
    flex-shrink: 0;
    white-space: nowrap;
}

.diet-catalog-add-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

#selectFoodModal #foodCatalogList {
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
    padding-bottom: 24px;
}

/* ── Styled modal footer buttons ── */
.food-form-modal-content .modal-footer {
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 14px 14px;
    background: #fafbfc;
}

.food-form-modal-content .modal-footer .btn-secondary {
    border-radius: 999px;
    padding: 7px 20px;
    font-weight: 600;
}

.food-form-modal-content .modal-footer .btn-danger {
    border-radius: 999px;
    padding: 7px 20px;
    font-weight: 600;
}

.food-form-modal-content .modal-footer .btn-outline-primary {
    border-radius: 999px;
    padding: 7px 18px;
    font-weight: 600;
}

.food-form-modal-content .modal-footer .btn-outline-secondary {
    border-radius: 999px;
    padding: 7px 18px;
    font-weight: 600;
}

/* ============================================
   DIET MODALS REDESIGN
   ============================================ */
#addFoodModal,
#customFoodModal,
#selectFoodModal {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.food-modal {
    background: #ffffff;
    border: 0;
    border-radius: 24px;
    overflow: hidden;
}

.food-modal-dialog {
    margin: 1.2rem auto;
}

#customFoodModal .food-modal-dialog,
#addFoodModal .food-modal-dialog {
    max-width: min(760px, 92vw);
}

#selectFoodModal .food-modal-dialog {
    max-width: min(860px, 94vw);
}

.food-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px;
    background: #ffffff;
    border-bottom: 1px solid #e6ecf5;
}

.food-modal-head-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.food-modal-badge {
    width: 50px;
    height: 50px;
    border-radius: 999px;
    background: #eaf3ff;
    color: #0f6fea;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.food-modal-title-wrap {
    display: grid;
    gap: 4px;
}

.food-modal-header .modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    color: #101828;
}

.food-modal-subtitle {
    color: #667085;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.food-modal-close-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid #e6ecf5;
    background: #ffffff;
    color: #667085;
    text-shadow: none;
    opacity: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.food-modal-close-btn:hover {
    background: #f8fbff;
    color: #101828;
}

.modal-content-scroll {
    background: #f7f9fc;
    padding: 20px 24px 24px;
}

#customFoodModal .form-group label,
#addFoodModal .form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #101828;
    letter-spacing: 0;
    text-transform: none;
    margin-bottom: 8px;
}

#customFoodModal .form-control,
#addFoodModal .form-control,
#selectFoodModal .catalog-search-input {
    height: 56px;
    border: 1px solid #e6ecf5;
    border-radius: 16px;
    background: #ffffff;
    padding: 0 16px;
    font-size: 15px;
    font-weight: 500;
    color: #101828;
    box-shadow: none;
}

#customFoodModal .form-control:focus,
#addFoodModal .form-control:focus,
#selectFoodModal .catalog-search-input:focus {
    border-color: #0f6fea;
    box-shadow: 0 0 0 4px rgba(15, 111, 234, 0.1);
    background: #ffffff;
}

.unit-inside-wrap .form-control {
    padding-right: 58px;
}

.unit-inside-suffix {
    font-size: 12px;
    font-weight: 600;
    color: #667085;
}

.custom-food-macro-grid {
    row-gap: 0;
}

.food-modal-note {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 14px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 500;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.food-modal-footer-actions,
.food-modal-footer {
    border-top: 1px solid #e6ecf5;
    background: #ffffff;
    padding: 14px 24px;
    margin-top: 0;
    gap: 10px;
}

#customFoodModal .food-form-actions .btn,
#addFoodModal .food-form-actions .btn {
    height: 56px;
    border-radius: 18px;
    font-weight: 600;
    min-width: 160px;
    padding: 0 22px;
}

#customFoodModal .food-form-actions .btn svg,
#addFoodModal .food-form-actions .btn svg {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    stroke-width: 2.2;
}

#customFoodModal .food-form-actions .btn-primary,
#addFoodModal .food-form-actions .btn-primary,
#selectFoodModal .food-modal-footer .btn-outline-primary {
    background: #0f6fea;
    border-color: #0f6fea;
    color: #ffffff;
}

#customFoodModal .food-form-actions .btn-secondary,
#addFoodModal .food-form-actions .btn-secondary,
#selectFoodModal .food-modal-footer .btn-secondary {
    border: 1px solid #e6ecf5;
    background: #ffffff;
    color: #344054;
}

#customFoodModal .diet-custom-food-form {
    gap: 0;
    padding: 0;
    overflow: visible;
}

#customFoodModal .diet-custom-food-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
    margin-bottom: 14px;
}

#customFoodModal .tyfit-standard-field--full {
    grid-column: 1 / -1;
}

#customFoodModal .tyfit-standard-field {
    min-height: 72px;
    padding-top: 10px;
}

#customFoodModal .tyfit-standard-field .tyfit-ui-unit-control {
    display: contents;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#customFoodModal .tyfit-standard-field::after {
    left: 42px;
}

#customFoodModal .tyfit-standard-input,
#customFoodModal .tyfit-standard-select {
    height: 40px;
    min-height: 40px;
    padding-right: 34px;
    font-size: 14px;
    font-weight: 440;
    color: #111827;
}

#customFoodModal .tyfit-ui-unit {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    align-self: center;
    min-width: auto;
    height: 24px;
    padding: 0 0 0 10px;
    border-left: 0;
    border-radius: 0;
    background: transparent;
    color: #8b95a7;
    font-size: 12px;
    font-weight: 650;
}

#customFoodModal .tyfit-ui-unit-control .tyfit-standard-input {
    padding-right: 48px;
}

#customFoodModal .diet-custom-food-fields .tyfit-standard-field:nth-child(1) .tyfit-ui-icon-tile {
    background: #f0edff;
    color: #6c63ff;
}

#customFoodModal .diet-custom-food-fields .tyfit-standard-field:nth-child(2) .tyfit-ui-icon-tile {
    background: #ecfdf3;
    color: #0f9d58;
}

#customFoodModal .diet-custom-food-fields .tyfit-standard-field:nth-child(3) .tyfit-ui-icon-tile {
    background: #eff6ff;
    color: #2563eb;
}

#customFoodModal .diet-custom-food-fields .tyfit-standard-field:nth-child(4) .tyfit-ui-icon-tile {
    background: #fff7ed;
    color: #ea580c;
}

#customFoodModal .diet-custom-food-fields .tyfit-standard-field:nth-child(5) .tyfit-ui-icon-tile {
    background: #f0fdf4;
    color: #16a34a;
}

#customFoodModal .diet-custom-food-fields .tyfit-standard-field:nth-child(6) .tyfit-ui-icon-tile {
    background: #eff6ff;
    color: #2563eb;
}

#customFoodModal .diet-custom-food-fields .tyfit-standard-field:nth-child(7) .tyfit-ui-icon-tile {
    background: #f5f3ff;
    color: #7c3aed;
}

#customFoodModal .food-modal-note {
    border-color: rgba(108, 99, 255, 0.16);
    background: rgba(108, 99, 255, 0.07);
    color: #5046e5;
}

#customFoodModal .food-form-actions .btn-primary,
#addFoodModal .food-form-actions .btn-primary,
#selectFoodModal .food-modal-footer .btn-outline-primary {
    background: linear-gradient(145deg, #6c63ff, #554bf5);
    border-color: transparent;
    color: #ffffff;
}

#customFoodModal .custom-food-switch input:checked + .custom-food-slider {
    background-color: #6c63ff;
}

@media (max-width: 767.98px) {
    #customFoodModal .diet-custom-food-fields {
        grid-template-columns: 1fr;
        column-gap: 0;
    }
}

.catalog-search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.catalog-filter-btn {
    width: 56px;
    height: 56px;
    border: 1px solid #e6ecf5;
    border-radius: 16px;
    background: #ffffff;
    color: #0f6fea;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.catalog-quick-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.catalog-chip {
    border: 1px solid #dbeafe;
    background: #f8fbff;
    color: #0f6fea;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

#selectFoodModal #foodCatalogList {
    max-height: 48vh;
    overflow-y: auto;
    padding-right: 2px;
    padding-bottom: 4px;
}

.diet-catalog-pick-card {
    border: 1px solid #e6ecf5;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: none;
    padding: 14px;
}

.diet-catalog-pick-card::before {
    display: none;
}

.diet-catalog-pick-main {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: start;
}

.food-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.food-icon.food-oil { background: #fff3e8; color: #f97316; }
.food-icon.food-grain { background: #ecfdf3; color: #16a34a; }
.food-icon.food-rice { background: #eaf3ff; color: #0f6fea; }
.food-icon.food-egg { background: #fff8e1; color: #d97706; }
.food-icon.food-veg { background: #ecfdf3; color: #15803d; }
.food-icon.food-fruit { background: #fff1f2; color: #e11d48; }
.food-icon.food-protein { background: #ecfeff; color: #0f766e; }
.food-icon.food-plate { background: #eef2ff; color: #4f46e5; }
.food-icon.food-default { background: #f1eeff; color: #6c63ff; }

.diet-catalog-pick-body {
    min-width: 0;
}

.diet-catalog-pick-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.diet-catalog-pick-name {
    font-size: 15px;
    font-weight: 600;
    color: #101828;
    padding-right: 86px;
}

.diet-catalog-ref-qty {
    background: #f2f4f7;
    border: 1px solid #e4e7ec;
    color: #667085;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
}

.diet-catalog-pick-macros {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.diet-catalog-pick-macros .diet-view-macro {
    margin: 0;
}

.diet-catalog-pick-calories {
    color: #101828;
    font-size: 13px;
    font-weight: 600;
    background: #f2f4f7;
    border-radius: 999px;
    padding: 5px 10px;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
}

.diet-catalog-pick-footer {
    margin-top: 12px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid #e6ecf5;
    background: #f8fbff;
}

.diet-catalog-qty-row {
    border: 1px solid #dbe3ee;
    background: #ffffff;
    border-radius: 12px;
    padding: 5px 8px;
    gap: 8px;
}

.diet-catalog-qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d1dde9;
    border-radius: 10px;
    background: #ffffff;
    overflow: hidden;
}

.food-catalog-qty-input {
    width: 64px;
    font-size: 14px;
    font-weight: 600;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 8px !important;
    text-align: center;
}

.diet-catalog-qty-stepper {
    display: inline-flex;
    flex-direction: column;
    border-left: 1px solid #dbe3ee;
}

.diet-catalog-qty-step-btn {
    width: 22px;
    height: 16px;
    border: none;
    background: #f8fbff;
    color: #0f6fea;
    font-size: 8px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.diet-catalog-qty-step-btn + .diet-catalog-qty-step-btn {
    border-top: 1px solid #dbe3ee;
}

.diet-catalog-qty-step-btn:hover {
    background: #eef6ff;
}

.diet-catalog-unit-pill {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: #1d4ed8;
}

.diet-catalog-add-btn {
    background: #0f6fea;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
}

@media (max-width: 1023px) {
    .modal-backdrop.show {
        background: #ffffff;
        opacity: 1;
    }

    .food-modal-dialog {
        width: 100vw;
        max-width: none;
        margin: 0;
        height: 100dvh;
    }

    .food-modal {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100dvh;
        max-width: none;
        max-height: none;
        border-radius: 0;
        box-shadow: none;
        display: flex;
        flex-direction: column;
    }

    .food-modal-header {
        position: sticky;
        top: 0;
        z-index: 5;
        padding: 24px;
    }

    .modal-content-scroll {
        flex: 1;
        overflow-y: auto;
        padding: 16px 20px 110px;
        background: #f7f9fc;
    }

    .food-modal-footer,
    .food-modal-footer-actions {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 6;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        margin: 0;
        flex-direction: column;
        align-items: stretch;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    #selectFoodModal .food-modal-footer,
    #customFoodModal .food-modal-footer-actions {
        padding-left: 16px;
        padding-right: 16px;
    }

    #customFoodModal .modal-content-scroll {
        padding-bottom: 150px;
    }

    #selectFoodModal .modal-content-scroll {
        padding-top: 0;
    }

    #selectFoodModal .catalog-search-row {
        position: sticky;
        top: 0;
        z-index: 7;
        margin: 0;
        padding: 12px 0 8px;
        background: #f7f9fc;
    }

    #selectFoodModal .catalog-quick-suggestions {
        position: static;
        top: auto;
        z-index: auto;
        margin: 0;
        padding: 0 0 10px;
        background: transparent;
    }

    .food-modal-footer .btn,
    .food-modal-footer-actions .btn,
    #customFoodModal .food-form-actions .btn,
    #addFoodModal .food-form-actions .btn {
        width: 100%;
        margin: 0;
        border-radius: 10px;
    }

    .food-modal-footer .mr-auto {
        margin-right: 0 !important;
    }

    .catalog-search-row {
        grid-template-columns: 1fr;
    }

    .catalog-filter-btn {
        display: none;
    }

    .diet-catalog-qty-stepper {
        display: none;
    }

    .food-catalog-qty-input {
        width: 82px;
    }

    .diet-catalog-pick-main {
        grid-template-columns: auto 1fr;
        position: relative;
    }

    .diet-catalog-pick-aside {
        grid-column: 1 / -1;
    }

    .diet-catalog-pick-calories {
        display: inline-flex;
    }

    #selectFoodModal #foodCatalogList {
        max-height: none;
        overflow-y: visible;
    }
}

@media (min-width: 1024px) {
    .modal-backdrop.show {
        background: rgba(16, 24, 40, 0.45);
        opacity: 1;
    }

    .food-modal {
        max-height: 90vh;
        border-radius: 24px;
        box-shadow: 0 24px 80px rgba(16, 24, 40, 0.18);
    }

    .food-modal-header {
        padding: 28px;
    }

    #selectFoodModal .catalog-modal-header,
    #customFoodModal .catalog-modal-header {
        background: linear-gradient(135deg, #1f3b53 0%, #2e5776 100%);
        border-bottom-color: rgba(255, 255, 255, 0.12);
    }

    #selectFoodModal .catalog-modal-header .modal-title,
    #selectFoodModal .catalog-modal-header .food-modal-title-wrap,
    #customFoodModal .catalog-modal-header .modal-title,
    #customFoodModal .catalog-modal-header .food-modal-title-wrap {
        color: #ffffff;
    }

    #selectFoodModal .catalog-modal-close,
    #customFoodModal .catalog-modal-close {
        color: rgba(255, 255, 255, 0.88);
        border-color: rgba(255, 255, 255, 0.26);
        background: rgba(255, 255, 255, 0.08);
    }

    #selectFoodModal .catalog-modal-close:hover,
    #customFoodModal .catalog-modal-close:hover {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.16);
    }

    .modal-content-scroll {
        max-height: calc(90vh - 180px);
        overflow-y: auto;
        padding: 22px 28px 26px;
    }

    .food-modal-footer,
    .food-modal-footer-actions {
        padding: 16px 28px;
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
    }

    #openAddFoodFromCatalogModalBtn,
    #selectFoodModal .food-modal-footer .btn-secondary,
    #customFoodSaveBtn,
    #customFoodCancelBtn {
        border-radius: 10px;
    }
}

@media (max-width: 1023px) {
    #openAddFoodFromCatalogModalBtn,
    #selectFoodModal .food-modal-footer .btn-secondary,
    #customFoodSaveBtn,
    #customFoodCancelBtn {
        border-radius: 10px;
    }
}

.food-catalog-row {
    position: relative;
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background-color: #f8fafc;
    background-image: url('../assets/tyfit_img/food_card_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.food-catalog-row::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 1;
}

.food-row-top {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 12px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.food-row-bottom {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.food-catalog-row:hover {
    border-color: rgba(125, 160, 197, 0.34);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.1);
}

.food-catalog-cell {
    min-width: 0;
}

.food-catalog-name-text {
    color: #0f172a;
    font-size: 15px;
    font-weight: 700;
}

.food-catalog-cell-calories {
    display: flex;
    align-items: center;
    justify-content: center;
}

.food-catalog-empty {
    padding: 24px 16px;
    text-align: center;
    color: #6c757d;
}

.food-macro-bars {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.food-macro-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border-radius: 0;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    color: #475569;
    background: transparent;
}

.food-macro-item i {
    font-size: 12px;
    flex-shrink: 0;
}

.food-macro-item-carbs {
    color: #475569;
    background-color: transparent;
}

.food-macro-item-carbs i {
    color: #c56a17;
}

.food-macro-item-protein {
    color: #475569;
    background-color: transparent;
}

.food-macro-item-protein i {
    color: #1f8f57;
}

.food-macro-item-fats {
    color: #475569;
    background-color: transparent;
}

.food-macro-item-fats i {
    color: #1f6db2;
}

.food-macro-item-fibre {
    color: #475569;
    background-color: transparent;
}

.food-macro-item-fibre i {
    color: #6b7280;
}

.food-catalog-meta {
    color: #6c757d;
    font-size: 13px;
}

.food-catalog-calories {
    font-weight: 600;
    color: #c53030;
    white-space: nowrap;
    font-size: 15px;
    line-height: 1;
    text-align: center;
}

.food-catalog-calories-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background-color: #fdecec;
}

.food-catalog-calories-wrap i {
    color: #dc2626;
    font-size: 14px;
}

.food-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.food-row-actions-mobile {
    display: none;
}

.food-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.78);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.food-action-btn i {
    font-size: 12px;
}

.food-action-btn-edit {
    color: #2b6cb0;
}

.food-action-btn-edit:hover {
    background-color: #ebf4ff;
    transform: translateY(-1px);
}

.food-action-btn-delete {
    color: #c53030;
}

.food-action-btn-delete:hover {
    background-color: #fff5f5;
    transform: translateY(-1px);
}

.food-item-menu-wrap {
    position: relative;
}

.food-item-menu-btn {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

.food-item-menu-btn:hover {
    background-color: rgba(148, 163, 184, 0.14);
    color: #334155;
}

.food-item-menu {
    position: fixed;
    min-width: 148px;
    padding: 6px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    z-index: 1050;
    display: none;
    backdrop-filter: blur(2px);
    background-clip: padding-box;
}

.food-item-menu.open {
    display: block;
}

.food-item-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: #ffffff;
    color: #334155;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.food-item-menu-item:hover {
    background-color: #f1f5f9;
}

.food-item-menu-item:not(.danger) i {
    color: #2563eb;
}

.food-item-menu-item.danger {
    color: #dc2626;
}

.food-item-menu-item.danger i {
    color: #dc2626;
}

.food-item-menu-item.danger:hover {
    background-color: rgba(220, 38, 38, 0.08);
}

.food-catalog-swipe-overlay {
    display: none;
}

.food-catalog-entry {
    margin-bottom: 12px;
}

.food-catalog-entry-card {
    margin: 0;
}

.food-catalog-entry-top-right {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.food-catalog-entry-card .diet-view-item-qty {
    margin-bottom: 10px;
}

.food-catalog-entry-card .diet-view-item-macros {
    margin-bottom: 0;
}

/* ============================================
   DIET CHART PAGE - MODERN LAYOUT
   ============================================ */

.diet-user-toolbar {
    display: grid;
    gap: 8px;
}

.diet-admin-toolbar-row {
    display: grid;
    gap: 8px;
}

.diet-admin-toolbar-head {
    display: flex;
    align-items: center;
}

.diet-admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(108, 99, 255, 0.11);
    border: 1px solid rgba(108, 99, 255, 0.22);
    color: #4D45CD;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 20px;
    line-height: 1;
    white-space: nowrap;
}

.diet-admin-badge i {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

.diet-user-select-wrap {
    width: 100%;
}

.diet-chart-switcher {
    display: grid;
    gap: 10px;
}

#dietChartPageStatus {
    font-family: "Manrope", sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}

.diet-chart-switcher-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.diet-chart-switcher-label {
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
}

.diet-chart-strip {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    overflow: visible;
}

.tp-plan-card-wrap {
    position: relative;
    display: inline-flex;
    overflow: visible;
}

.diet-chart-strip .tp-plan-card {
    border: 1px solid #d8e3ee;
    border-radius: 14px;
    padding: 11px 12px;
    background: #ffffff;
    color: #334155;
    display: grid;
    gap: 4px;
    min-width: 166px;
    text-align: center;
    justify-items: center;
    box-shadow: none;
    transition: all 0.2s ease;
    --diet-accent: #2f6fc7;
    --diet-accent-soft: rgba(47, 111, 199, 0.1);
    --diet-accent-line: rgba(47, 111, 199, 0.2);
}

.tp-plan-card-menu-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.15s, color 0.15s;
    z-index: 2;
}

.tp-plan-card-menu-btn svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.2;
}

.tp-plan-card-menu-btn:hover {
    background-color: rgba(148, 163, 184, 0.18);
    color: #475569;
}

.tp-plan-card-menu-btn.is-pinned,
.tp-plan-card-menu-btn:disabled {
    cursor: default;
    color: var(--diet-accent);
}

.tp-plan-card-menu-btn.is-pinned svg {
    width: 10px;
    height: 10px;
    stroke-width: 1.9;
    transform: rotate(30deg);
    fill: currentColor !important;
    stroke: currentColor !important;
}

.tp-plan-card-menu {
    position: absolute;
    top: 30px;
    right: 6px;
    left: auto;
    min-width: 150px;
    z-index: 40;
    border-radius: 10px;
    padding: 6px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.tp-plan-card-sheet[hidden] {
    display: none !important;
}

.tp-plan-card-sheet {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tp-plan-card-sheet-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(6px);
}

.tp-plan-card-sheet-panel {
    position: relative;
    z-index: 1;
    width: min(92vw, 440px);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 22px 58px rgba(15, 23, 42, 0.22);
    padding: 18px;
    border: 1px solid rgba(231, 228, 255, 0.95);
}

.tp-plan-card-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.tp-plan-card-sheet-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1A1F36;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tp-plan-card-sheet-close {
    border: 1px solid #dbe4ef;
    background: #ffffff;
    color: #334155;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tp-plan-card-sheet-actions {
    display: grid;
    gap: 8px;
}

.tp-plan-card-sheet-btn {
    width: 100%;
    border: 1px solid rgba(231, 228, 255, 0.9);
    border-radius: 16px;
    background: #ffffff;
    color: #1f2937;
    font-size: 14px;
    font-weight: 600;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    padding: 13px 14px;
    cursor: pointer;
}

.tp-plan-card-sheet-btn svg {
    width: 17px;
    height: 17px;
    stroke-width: 2.2;
}

.tp-plan-card-sheet-btn--danger {
    border-color: #fecaca;
    color: #b91c1c;
    background: #fff7f7;
}

@media (min-width: 768px) {
    #dietChartCardActionSheet {
        display: none !important;
    }
}

@media (max-width: 991px) {
    .tp-plan-card-sheet {
        align-items: flex-end;
        justify-content: center;
    }

    .tp-plan-card-sheet-backdrop {
        background: rgba(17, 24, 39, 0.44);
        backdrop-filter: blur(8px);
    }

    .tp-plan-card-sheet-panel {
        width: 100%;
        max-height: min(82vh, 520px);
        overflow-y: auto;
        border-radius: 28px 28px 0 0;
        padding: 24px 18px calc(18px + env(safe-area-inset-bottom));
        box-shadow: 0 -22px 58px rgba(15, 23, 42, 0.18);
    }

    .tp-plan-card-sheet-panel::before {
        content: "";
        position: absolute;
        top: 9px;
        left: 50%;
        width: 46px;
        height: 5px;
        transform: translateX(-50%);
        border-radius: 999px;
        background: rgba(148, 163, 184, 0.42);
    }

    .tp-plan-card-sheet-title {
        width: 100%;
        text-align: center;
    }
}

.diet-plan-icon {
    width: 28px;
    height: 28px;
    border-radius: 11px;
    background: var(--diet-accent-soft);
    color: var(--diet-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.diet-plan-icon svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.1;
    fill: none;
    stroke: currentColor;
}

.diet-plan-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.diet-chart-strip .tp-plan-card strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 124px;
    font-size: 14px;
    font-weight: 650;
    color: #0f172a;
    line-height: 1.2;
}

.diet-plan-current-badge {
    font-style: normal;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    color: #1d4ed8;
    background: #e7f0ff;
    border: 1px solid #cfe0ff;
    border-radius: 999px;
    padding: 4px 7px;
}

.diet-chart-strip .tp-plan-card:hover {
    border-color: var(--diet-accent);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
    transform: translateY(-1px);
}

.diet-chart-strip .tp-plan-card.is-active {
    border-color: var(--diet-accent-line);
    background: var(--diet-accent-soft);
    box-shadow: 0 12px 24px rgba(108, 99, 255, 0.08);
    transform: translateY(-1px);
}

.diet-chart-strip .tp-plan-card.is-active .diet-plan-icon {
    background: rgba(255, 255, 255, 0.74);
    color: var(--diet-accent);
}

.diet-chart-strip .tp-plan-card.tp-plan-create {
    min-width: 126px;
    border: 1px dashed rgba(108, 99, 255, 0.28);
    color: #5046e5;
    background: rgba(247, 244, 255, 0.72);
    padding: 11px 12px;
}

.diet-chart-strip .tp-plan-card.tp-plan-create .diet-plan-icon {
    margin-bottom: 4px;
}

.diet-chart-strip .tp-plan-card.tp-plan-create strong {
    color: #5046e5;
    line-height: 1.15;
}

.diet-chart-strip-empty {
    width: 100%;
    padding: 12px;
    border: 1px dashed #c7d6e5;
    border-radius: 10px;
    color: #64748b;
    font-size: 13px;
}

.diet-chart-actions-wrap {
    position: relative;
}

.diet-chart-actions-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid #d8e3ee;
    background: #ffffff;
    color: #475569;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

.diet-chart-actions-btn:hover {
    background: #f8fbff;
}

.diet-chart-actions-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 196px;
    z-index: 40;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
}

.diet-chart-actions-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.diet-chart-actions-item svg {
    width: 15px;
    height: 15px;
    stroke-width: 2.1;
}

.diet-chart-actions-item:not(.danger) svg {
    color: #2563eb;
}

.diet-chart-actions-menu.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.diet-chart-actions-item.danger {
    color: #b91c1c;
}

.diet-chart-actions-item.danger svg {
    color: #dc2626;
}

#dietChartEmptyState.tp-empty-state {
    padding: 48px 22px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 13px;
}

#dietChartEmptyState .tp-empty-icon {
    width: 70px;
    height: 70px;
    border-radius: 22px;
    background: #eaf3ff;
    color: #0f6fea;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-inline: auto;
    line-height: 0;
}

#dietChartEmptyState .tp-empty-icon i[data-lucide],
#dietChartEmptyState .tp-empty-icon svg {
    width: 32px;
    height: 32px;
    stroke-width: 1.9;
    display: block;
    margin: auto;
}

#dietChartEmptyState h4 {
    margin: 10px 0;
    color: #101828;
    font-size: 18px;
    font-weight: 700;
}

#dietChartEmptyState p {
    margin: 10px 0 15px;
    color: #667085;
    font-size: 14px;
    line-height: 1.5;
    max-width: 32ch;
}

#dietChartEmptyState .tp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 13px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: inherit;
}

#dietChartEmptyState .tp-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.3;
}

#dietChartEmptyState .tp-btn-primary {
    background: #0f6fea;
    color: #fff;
    box-shadow: 0 10px 22px rgba(15, 111, 234, 0.18);
}

#dietChartEmptyState .tp-btn-primary:hover {
    background: #0d63d4;
}

.diet-header-card {
    border: 1px solid #d9e6f2;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    padding: 14px;
}

.diet-meal-card {
    border: 1px solid #d9e6f2;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(43, 108, 176, 0.08);
}

.diet-meal-header {
    background: linear-gradient(180deg, #f5faff 0%, #edf5ff 100%);
    border-bottom: 1px solid #d9e6f2;
}

.diet-meal-name-input-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0;
    flex: 1;
    min-width: 0;
}

.diet-meal-name-icon {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.14);
    color: #4f46e5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 9px;
}

.diet-meal-name-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.1;
    fill: none;
    stroke: currentColor;
}

.diet-meal-name-icon[data-meal-icon="sun"],
.diet-view-meal-icon[data-lucide="sun"] {
    color: #ca8a04;
    background: rgba(250, 204, 21, 0.18);
}

.diet-meal-name-icon[data-meal-icon="cooking-pot"],
.diet-view-meal-icon[data-lucide="cooking-pot"] {
    color: #d97706;
    background: rgba(217, 119, 6, 0.14);
}

.diet-meal-name-icon[data-meal-icon="moon-star"],
.diet-view-meal-icon[data-lucide="moon-star"] {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.14);
}

.diet-meal-name-icon[data-meal-icon="donut"],
.diet-view-meal-icon[data-lucide="donut"] {
    color: #db2777;
    background: rgba(219, 39, 119, 0.14);
}

.diet-meal-name-icon[data-meal-icon="sandwich"],
.diet-view-meal-icon[data-lucide="sandwich"] {
    color: #fb7185;
    background: rgba(251, 113, 133, 0.14);
}

.diet-meal-name-icon[data-meal-icon="hamburger"],
.diet-view-meal-icon[data-lucide="hamburger"] {
    color: #16a34a;
    background: rgba(22, 163, 74, 0.14);
}

.diet-meal-name-icon[data-meal-icon="salad"],
.diet-view-meal-icon[data-lucide="salad"] {
    color: #0f766e;
    background: rgba(15, 118, 110, 0.14);
}

.diet-meal-name-icon[data-meal-icon="leafy-green"],
.diet-view-meal-icon[data-lucide="leafy-green"] {
    color: #15803d;
    background: rgba(21, 128, 61, 0.14);
}

.diet-meal-name-input-wrap .diet-meal-name {
    flex: 1;
    min-width: 0;
}

.diet-meal-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.diet-food-rows {
    display: grid;
    gap: 12px;
}

.diet-food-row {
    border: 1px solid #dde8f3;
    border-radius: 10px;
    padding: 10px;
    background-color: #ffffff;
}

.diet-food-row-main {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 100px 90px auto auto;
    gap: 8px;
    align-items: center;
}

.diet-food-ref-text {
    margin-top: 8px;
}

.diet-row-total-chips,
.diet-total-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.diet-mini-chip,
.diet-total-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    font-weight: 700;
    white-space: nowrap;
}

.diet-mini-chip {
    font-size: 12px;
    padding: 5px 10px;
    margin-top: 8px;
}

.diet-total-chip {
    font-size: 13px;
    padding: 6px 12px;
}

.diet-mini-chip.carbs,
.diet-total-chip.carbs {
    color: #c56a17;
    background-color: #fff2e5;
}

.diet-mini-chip.protein,
.diet-total-chip.protein {
    color: #1f8f57;
    background-color: #e8f8ef;
}

.diet-mini-chip.fats,
.diet-total-chip.fats {
    color: #1f6db2;
    background-color: #e8f2ff;
}

.diet-mini-chip.calories,
.diet-total-chip.calories {
    color: #c53030;
    background-color: #fdecec;
}

.diet-totals-card {
    border: 1px solid #d9e6f2;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    padding: 14px;
}

.diet-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.diet-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.diet-user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.diet-user-actions .btn-group .btn.active {
    color: #ffffff;
    background-color: #2b6cb0;
    border-color: #2b6cb0;
}

.diet-user-select-control {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #DDD8FF;
    border-radius: 12px;
    background: #F3F1FF;
}

.diet-user-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: auto;
    flex: 1;
    min-width: 0;
    border: none;
    border-radius: 0;
    background-color: transparent;
    box-shadow: none;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: #4B3FC7;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 44px;
}

.diet-user-select option {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    font-weight: 600;
}

.diet-user-select:focus {
    border-color: transparent;
    box-shadow: none;
}

.diet-user-leading-icon {
    width: 15px;
    height: 15px;
    color: rgba(108, 99, 255, 0.58);
    flex-shrink: 0;
}

.diet-user-chevron {
    width: 14px;
    height: 14px;
    color: rgba(108, 99, 255, 0.72);
    pointer-events: none;
    flex-shrink: 0;
}

/* ============================================
   DIET CHART PAGE - LOADING & INTERACTION
   ============================================ */

#dietChartLoadingSpinner {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    padding: 14px 12px;
    margin: 0 8px 12px 8px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.82);
    color: #475569;
}

#dietChartLoadingSpinner .spinner-border {
    width: 18px;
    height: 18px;
    border-width: 0.14em;
    color: #60a5fa;
}

#dietChartLoadingSpinner p {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
}

.diet-chart-section-loader {
    display: grid;
    gap: 14px;
    padding: 6px 0 18px;
}

.diet-chart-section-loader .shimmer {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: linear-gradient(110deg, #f4f2ff 8%, #ffffff 18%, #f4f2ff 33%);
    background-size: 220% 100%;
    border: 1px solid rgba(231, 228, 255, 0.72);
    box-shadow: 0 14px 34px rgba(108, 99, 255, 0.07);
    animation: dietSectionShimmer 1.15s linear infinite;
}

.diet-chart-section-loader__head {
    height: 42px;
    width: min(360px, 100%);
    justify-self: center;
}

.diet-chart-section-loader__macro {
    height: 146px;
}

.diet-chart-section-loader__meal {
    height: 138px;
}

@keyframes dietSectionShimmer {
    0% {
        background-position: 160% 0;
    }

    100% {
        background-position: -80% 0;
    }
}

.diet-view-container {
    background-color: #ffffff;
    border-radius: 28px;
    padding: 22px;
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.08);
    border: none;
}

.diet-view-chart-card {
    background-color: transparent;
    border-radius: 0;
    padding: 0;
    margin: 0 8px 20px 8px;
    border: none;
}

.diet-view-chart-title-wrap {
    display: flex;
    justify-content: center;
    margin: 0 12px;
}

.diet-view-chart-title {
    margin: 0;
    font-size: 20px;
    font-weight: 400;
    color: #0f172a;
    text-align: center;
}

.diet-view-chart-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 12px;
}

.diet-chart-wrapper {
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#dietMacroChart {
    max-width: 100%;
    max-height: 100%;
}

.diet-view-chart-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.chart-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 0;
    border-radius: 0;
    background-color: transparent;
    border: none;
    font-size: 14px;
    margin: 0 0 1px 0;
}

.chart-stat-row.calories {
    margin-top: 1px;
    padding-top: 1px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.chart-stat-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chart-stat-row.carbs .chart-stat-color {
    background-color: #d97706;
}

.chart-stat-row.protein .chart-stat-color {
    background-color: #16a34a;
}

.chart-stat-row.fats .chart-stat-color {
    background-color: #2563eb;
}

.chart-stat-row.calories .chart-stat-color {
    background-color: #dc2626;
}

.chart-stat-row .chart-stat-value {
    margin-left: auto;
    font-weight: 500;
    white-space: nowrap;
}

.chart-stat-label {
    color: #475569;
    font-weight: 500;
    white-space: nowrap;
}

.diet-chart-input-overlay .tp-form-group small {
    line-height: 1.35;
}

.diet-chart-input-helper {
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
}

.diet-chart-input-error {
    color: #b91c1c;
    font-size: 12px;
    font-weight: 600;
}

/* Tyfit input dialog style on diet page (mirrors training plan dialog pattern) */
.diet-chart-input-overlay.tp-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 24, 40, 0.45);
    padding: 12px;
}

.diet-chart-input-overlay.tp-modal-overlay[hidden] {
    display: none;
}

.diet-chart-input-overlay .tp-modal {
    width: min(100%, 560px);
    max-height: calc(100svh - 24px);
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 44px rgba(16, 24, 40, 0.22);
}

.diet-chart-input-overlay .tp-modal-header {
    padding: 22px 20px 16px;
    border-bottom: 1px solid #d9e1ee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-shrink: 0;
    background: #fff;
}

.diet-chart-input-overlay .tp-modal-header-main {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.diet-chart-input-overlay .tp-modal-badge {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.diet-chart-input-overlay .tp-modal-badge svg {
    width: 21px;
    height: 21px;
    stroke-width: 2.2;
}

.diet-chart-input-overlay .tp-modal-header h3 {
    margin: 0;
    color: #1A1F36;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.diet-chart-input-overlay .tp-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px;
}

.diet-chart-input-overlay .tp-modal-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid #d9e1ee;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
}

.diet-chart-input-overlay .tp-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.diet-chart-input-overlay .tp-form-group label {
    color: #111827;
    font-size: 13px;
    font-weight: 650;
}

.diet-chart-input-overlay .tp-form-group input {
    width: 100%;
    border: 1px solid #d9e1ee;
    border-radius: 15px;
    background: #fff;
    color: #111827;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    outline: 0;
    padding: 0 14px;
    height: 52px;
}

.diet-chart-input-overlay .tp-form-group input:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.25);
}

.diet-chart-input-overlay .tp-btn {
    border: 1px solid #d9e1ee;
    border-radius: 12px;
    height: 42px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 650;
}

.diet-chart-input-overlay .tp-btn.tp-btn-ghost {
    background: #fff;
    color: #334155;
}

.diet-chart-input-overlay .tp-btn.tp-btn-primary {
    background: #0f6fea;
    border-color: #0f6fea;
    color: #fff;
}

.diet-chart-input-overlay .tp-btn i,
.diet-chart-input-overlay .tp-btn svg {
    margin-right: 6px;
}

.diet-chart-input-overlay .tp-modal-close {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid #d9e1ee;
    background: #fff;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.diet-chart-input-overlay .tp-modal-close:hover {
    color: #0f6fea;
    background: #f6faff;
    border-color: #d6e6ff;
}

@media (min-width: 1024px) {
    .diet-chart-input-overlay.tp-modal-overlay {
        align-items: center;
    }

    .diet-chart-input-overlay .tp-modal {
        max-width: 560px;
        border-radius: 24px;
        max-height: 90vh;
        box-shadow: 0 24px 80px rgba(16, 24, 40, 0.18);
    }
}

.chart-stat-value.carbs {
    color: #b45309;
}

.chart-stat-value.protein {
    color: #15803d;
}

.chart-stat-value.fats {
    color: #1d4ed8;
}

.chart-stat-value.calories {
    color: #b91c1c;
}

.diet-view-meal-block {
    background-color: #ffffff;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.12);
    margin-bottom: 18px;
}

.diet-view-meal-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.diet-view-meal-label {
    display: inline-flex;
    align-items: center;
    gap: 0;
    font-size: 19px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: 0;
}

.diet-view-meal-icon {
    width: 38px;
    height: 38px;
    padding: 10px;
    box-sizing: border-box;
    border-radius: 999px;
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.14);
    stroke-width: 2.1;
    fill: none;
    stroke: currentColor;
    flex-shrink: 0;
    margin-right: 9px;
}

.diet-view-meal-label-text {
    display: inline-block;
    min-width: 0;
}

.diet-view-meal-label-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.diet-meal-replacement-badge {
    border: 1px solid rgba(29, 78, 216, 0.2);
    background: #eef4ff;
    color: #1d4ed8;
    border-radius: 999px;
    height: 30px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
}

.diet-meal-replacement-badge svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.2;
}

.diet-meal-replacement-badge:hover {
    background: #dbeafe;
}

.diet-meal-name-inline-input {
    min-width: 180px;
    max-width: 280px;
    height: 34px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    padding: 0 12px;
}

.diet-meal-name-edit-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.diet-meal-name-save-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: #22c55e;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.diet-meal-name-save-btn:hover,
.diet-meal-name-save-btn:focus {
    background: #16a34a;
    color: #ffffff;
}

.diet-view-meal-meta {
    font-size: 13px;
    color: #64748b;
}

.diet-view-meal-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.diet-meal-add-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background-color: #eaf2ff;
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.diet-meal-add-btn:hover {
    background-color: #dbeafe;
    color: #1e40af;
}

.diet-meal-menu-wrap {
    position: relative;
}

.diet-meal-menu-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.diet-meal-menu-btn:hover {
    background-color: rgba(148, 163, 184, 0.14);
    color: #334155;
}

.diet-meal-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 150px;
    padding: 6px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
    z-index: 12;
    display: none;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.diet-meal-menu.open {
    display: block;
}

.diet-meal-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: none;
    cursor: pointer;
    background: transparent;
    color: #334155;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 400;
    text-align: left;
}

.diet-meal-menu-item:hover {
    background-color: #f1f5f9;
}

.diet-meal-menu-item:not(.danger) i {
    color: #2563eb;
}

.diet-meal-menu-item.danger {
    color: #dc2626;
}

.diet-meal-menu-item.danger i {
    color: #dc2626;
}

.diet-meal-menu-item.danger:hover {
    background-color: rgba(220, 38, 38, 0.08);
}

.diet-view-add-meal-row {
    display: flex;
    justify-content: center;
    margin: 24px 0 8px 0;
}

.diet-view-add-meal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 24px;
    border-radius: 18px;
    border: 1px dashed rgba(108, 99, 255, 0.36);
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.08), rgba(255, 255, 255, 0.9));
    color: #5046e5;
    font-size: 14px;
    font-weight: 720;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(108, 99, 255, 0.07);
    transition: border-color 0.2s, color 0.2s, transform 0.2s ease;
}

.diet-view-add-meal-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(108, 99, 255, 0.58);
    color: #5046e5;
}

.diet-meal-replacement-overlay[hidden] {
    display: none !important;
}

.diet-meal-replacement-overlay {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
}

.diet-meal-replacement-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(6px);
}

.diet-meal-replacement-modal {
    position: relative;
    z-index: 1;
    width: min(94vw, 720px);
    max-height: min(92vh, 860px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    border: 1px solid #e8ecf3;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.diet-meal-replacement-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid #eceff5;
    padding: 16px 18px 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
    border-radius: 22px 22px 0 0;
}

.diet-meal-replacement-body {
    padding: 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #f5f8fd 100%);
    overflow-y: auto;
}

.diet-meal-replacement-title-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.diet-meal-replacement-title-wrap h3 {
    margin: 0;
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
}

.diet-meal-replacement-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}

.diet-meal-replacement-badge-title {
    display: none;
}

.diet-meal-replacement-badge-title svg {
    width: 15px;
    height: 15px;
    stroke-width: 2.1;
}

.diet-meal-replacement-close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    opacity: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.diet-meal-replacement-close:hover {
    color: #6c63ff;
    background: #f4f2ff;
    border-color: #dcd8ff;
}

.diet-meal-replacement-close svg {
    width: 20px;
    height: 20px;
}

.diet-replacement-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.diet-replacement-actions .tp-btn {
    min-height: 42px;
    border-radius: 14px;
    padding: 0 16px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.diet-replacement-actions .tp-btn-primary {
    background: linear-gradient(135deg, #6c63ff, #7c72ff);
    color: #ffffff;
    border-color: transparent;
}

.diet-replacement-actions .tp-btn-primary:hover {
    filter: brightness(0.96);
    transform: translateY(-1px);
}

.diet-replacement-actions .tp-btn-danger {
    background: #fff5f5;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.diet-replacement-actions .tp-btn-danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.diet-replacement-hint {
    display: none;
}

.diet-replacement-rows {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 12px;
}

.diet-replacement-row {
    --replacement-accent: #6c63ff;
    --replacement-accent-soft: #f4f2ff;
    --replacement-accent-line: #ddd9ff;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid #e8ecf3;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.diet-replacement-row-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.diet-replacement-row-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--replacement-accent-line);
    background: var(--replacement-accent-soft);
    color: var(--replacement-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.diet-replacement-row-icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.1;
}

.diet-replacement-row-name-wrap {
    min-width: 0;
}

.diet-replacement-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.diet-replacement-input-wrapper .form-control {
    flex: 1;
    padding-right: 34px;
}

.diet-replacement-input-label {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    pointer-events: none;
    background: transparent;
}

.diet-replacement-row .form-control {
    border: 1px solid #e8ecf3;
    border-radius: 15px;
    background: #ffffff;
    color: #111827;
    font-size: 14px;
    font-weight: 400;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    padding: 11px 12px;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.diet-replacement-row .form-control:focus {
    border-color: #bcb5ff;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.12);
}

.diet-replacement-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.diet-replacement-metric-card {
    padding: 10px;
    border-radius: 16px;
    border: 1px solid var(--replacement-accent-line);
    background: linear-gradient(180deg, #ffffff 0%, var(--replacement-accent-soft) 100%);
}

.diet-replacement-metric-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 7px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.diet-replacement-metric-label svg {
    width: 13px;
    height: 13px;
    color: var(--replacement-accent);
}

.diet-replacement-text-wrap textarea.form-control {
    min-height: 94px;
    resize: vertical;
    line-height: 1.5;
}

.diet-replacement-row textarea.form-control {
    background: #fbfcfe;
}

.diet-replacement-row-delete {
    width: 34px;
    height: 34px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #ef4444;
    background: #fff5f5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.diet-replacement-row-delete svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.1;
}

.diet-replacement-row-delete:hover {
    background: #fee2e2;
    border-color: #f87171;
    color: #dc2626;
}

.diet-replacement-add-row {
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, #6c63ff, #7c72ff);
    color: #ffffff;
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 10px 24px rgba(108, 99, 255, 0.26);
}

.diet-replacement-add-row svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.3;
}

.diet-replacement-add-row:hover {
    transform: translateY(-1px);
    filter: brightness(0.97);
}

.diet-replacement-view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.diet-replacement-card {
    --replacement-accent: #6c63ff;
    --replacement-accent-soft: #f4f2ff;
    --replacement-accent-line: #ddd9ff;
    border-radius: 20px;
    border: 1px solid #e8ecf3;
    padding: 16px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.diet-replacement-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.diet-replacement-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--replacement-accent-line);
    background: var(--replacement-accent-soft);
    color: var(--replacement-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.diet-replacement-card-icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.1;
}

.diet-replacement-card-title {
    color: #111827;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.diet-replacement-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.diet-replacement-card-stat {
    padding: 10px;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, var(--replacement-accent-soft) 100%);
    border: 1px solid var(--replacement-accent-line);
}

.diet-replacement-card-stat-label {
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.diet-replacement-card-stat-label svg {
    width: 13px;
    height: 13px;
    color: var(--replacement-accent);
}

.diet-replacement-card-stat-value {
    margin-top: 4px;
    color: #111827;
    font-size: 14px;
    font-weight: 700;
}

.diet-replacement-card-ingredients {
    margin-top: 14px;
    padding: 12px;
    border-radius: 15px;
    border: 1px solid var(--replacement-accent-line);
    background: var(--replacement-accent-soft);
}

.diet-replacement-card-ingredients-label {
    margin: 0 0 8px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.diet-replacement-ingredients-list {
    margin: 0;
    padding-left: 18px;
    color: #334155;
    font-size: 13px;
    line-height: 1.6;
}

.diet-replacement-view-note {
    margin: 14px 2px 4px;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

.diet-replacement-theme-green {
    --replacement-accent: #16a34a;
    --replacement-accent-soft: #ecfdf3;
    --replacement-accent-line: #bbf7d0;
}

.diet-replacement-theme-red {
    --replacement-accent: #ef4444;
    --replacement-accent-soft: #fff1f2;
    --replacement-accent-line: #fecdd3;
}

.diet-replacement-theme-blue {
    --replacement-accent: #2563eb;
    --replacement-accent-soft: #eff6ff;
    --replacement-accent-line: #bfdbfe;
}

.diet-replacement-theme-yellow {
    --replacement-accent: #ca8a04;
    --replacement-accent-soft: #fffbeb;
    --replacement-accent-line: #fde68a;
}

.diet-replacement-theme-purple {
    --replacement-accent: #6c63ff;
    --replacement-accent-soft: #f4f2ff;
    --replacement-accent-line: #ddd9ff;
}

@media (max-width: 767px) {
    .diet-meal-replacement-body {
        padding: 14px;
    }

    .diet-replacement-metrics-grid {
        grid-template-columns: 1fr;
    }

    .diet-replacement-actions {
        justify-content: stretch;
    }

    .diet-replacement-actions .tp-btn {
        flex: 1 1 100%;
    }

    .diet-replacement-view-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 992px) {
    .diet-meal-replacement-header {
        padding: 18px 22px 16px;
    }
}

.diet-replacement-empty {
    border-radius: 16px;
    border: 1px dashed #d7dfeb;
    background: #ffffff;
    color: #64748b;
    padding: 24px;
    text-align: center;
    font-size: 15px;
    font-weight: 400;
}

.diet-view-meal-content {
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.diet-view-item {
    margin-bottom: 0;
}

.diet-view-item-card {
    background-color: #f8fafc;
    background-image: url('../assets/tyfit_img/food_card_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 14px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    position: relative;
    overflow: hidden;
}

.diet-view-item-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 1;
}

.diet-view-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    position: relative;
    z-index: 2;
}

.diet-view-item-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.diet-item-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #16a34a;
    flex-shrink: 0;
}

.diet-view-item-name {
    font-weight: 500;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.diet-view-item-calories {
    font-size: 14px;
    color: #0f172a;
    font-weight: 700;
    white-space: nowrap;
}

.diet-view-item-qty {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background-color: rgba(15, 23, 42, 0.04);
    color: #475569;
    font-size: 13px;
    margin-bottom: 12px;
    width: fit-content;
    position: relative;
    z-index: 2;
}

.diet-item-qty-display,
.diet-item-qty-editor {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.diet-item-qty-editor {
    display: none;
}

.diet-view-item-qty.is-editing .diet-item-qty-display {
    display: none;
}

.diet-view-item-qty.is-editing .diet-item-qty-editor {
    display: inline-flex;
}

.diet-item-qty-input {
    width: 90px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    padding: 4px 8px;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    text-align: center;
}

.diet-item-qty-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.diet-item-qty-edit-btn,
.diet-item-qty-save-btn,
.diet-item-qty-cancel-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.diet-item-qty-edit-btn {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
}

.diet-item-qty-edit-btn:hover {
    background: rgba(37, 99, 235, 0.18);
}

.diet-item-qty-save-btn {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.diet-item-qty-save-btn:hover {
    background: rgba(22, 163, 74, 0.2);
}

.diet-item-qty-cancel-btn {
    background: rgba(148, 163, 184, 0.16);
    color: #475569;
}

.diet-item-qty-cancel-btn:hover {
    background: rgba(148, 163, 184, 0.24);
}

.diet-qty-sheet[hidden] {
    display: none !important;
}

.diet-qty-sheet {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
}

.diet-qty-sheet-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(6px);
}

.diet-qty-sheet-panel {
    position: relative;
    z-index: 1;
    width: min(92vw, 460px);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.22);
    padding: 16px;
}

.diet-qty-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.diet-qty-sheet-title {
    margin: 0;
    color: #1A1F36;
    font-size: 15px;
    font-weight: 400;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.diet-qty-sheet-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #dbe4ef;
    background: #ffffff;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.diet-qty-sheet-body {
    display: grid;
    gap: 8px;
}

.diet-qty-sheet-label {
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 0;
}

.diet-qty-sheet-input-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.diet-qty-sheet-input {
    width: 100%;
    height: 52px;
    border: 1px solid #d1dbe8;
    border-radius: 14px;
    background: #ffffff;
    color: #0f172a;
    font-size: 18px;
    font-weight: 650;
    padding: 0 14px;
}

.diet-qty-sheet-input:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.25);
}

.diet-qty-sheet-unit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 40px;
    border-radius: 10px;
    background: #eef6ff;
    border: 1px solid #dbeafe;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 700;
    padding: 0 10px;
}

.diet-qty-sheet-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

.diet-qty-sheet-btn {
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid #dbe4ef;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.diet-qty-sheet-btn--ghost {
    background: #ffffff;
    color: #334155;
}

.diet-qty-sheet-btn--primary {
    background: #0f6fea;
    border-color: #0f6fea;
    color: #ffffff;
}

.diet-catalog-qty-sheet[hidden] {
    display: none !important;
}

.diet-catalog-qty-sheet {
    position: fixed;
    inset: 0;
    z-index: 1310;
    display: flex;
    align-items: center;
    justify-content: center;
}

.diet-catalog-qty-sheet-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(6px);
}

.diet-catalog-qty-sheet-panel {
    position: relative;
    z-index: 1;
    width: min(92vw, 460px);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.22);
    padding: 16px;
}

.diet-catalog-qty-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.diet-catalog-qty-sheet-title {
    margin: 0;
    color: #1A1F36;
    font-size: 15px;
    font-weight: 400;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.diet-catalog-qty-sheet-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #dbe4ef;
    background: #ffffff;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.diet-catalog-qty-sheet-body {
    display: grid;
    gap: 8px;
}

.diet-catalog-qty-sheet-label {
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 0;
}

.diet-catalog-qty-sheet-input-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.diet-catalog-qty-sheet-input {
    width: 100%;
    height: 52px;
    border: 1px solid #d1dbe8;
    border-radius: 14px;
    background: #ffffff;
    color: #0f172a;
    font-size: 18px;
    font-weight: 650;
    padding: 0 14px;
}

.diet-catalog-qty-sheet-input:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.25);
}

.diet-catalog-qty-sheet-unit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 40px;
    border-radius: 10px;
    background: #eef6ff;
    border: 1px solid #dbeafe;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 700;
    padding: 0 10px;
}

.diet-catalog-qty-sheet-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

.diet-catalog-qty-sheet-btn {
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid #dbe4ef;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.diet-catalog-qty-sheet-btn--ghost {
    background: #ffffff;
    color: #334155;
}

.diet-catalog-qty-sheet-btn--primary {
    background: #0f6fea;
    border-color: #0f6fea;
    color: #ffffff;
}

.diet-item-quantity,
.diet-item-unit {
    display: inline-block;
}

.diet-view-item-macros {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
    position: relative;
    z-index: 2;
}

.diet-view-item-actions {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    position: relative;
    z-index: 2;
}

.diet-view-item-actions i {
    color: #64748b;
    font-size: 14px;
}

.diet-view-macro {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(248, 250, 252, 0.9);
}

.diet-view-macro svg {
    width: 13px;
    height: 13px;
    stroke-width: 2.2;
}

.diet-view-macro.carbs {
    color: #c05621;
    background: rgba(249, 115, 22, 0.07);
}

.diet-view-macro.protein {
    color: #15803d;
    background: rgba(34, 197, 94, 0.07);
}

.diet-view-macro.fats {
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.07);
}

.diet-view-macro.fibre {
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.07);
}

.diet-view-meal-totals {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed rgba(148, 163, 184, 0.35);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.diet-view-meal-total-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    background-color: rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    padding: 6px 10px;
}

.diet-view-meal-total-chip.protein {
    color: #15803d;
}

.diet-view-meal-total-chip.calories {
    color: #b45309;
}

.diet-view-item-actions .diet-item-delete-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.diet-view-item-actions .diet-item-delete-btn:hover {
    background-color: rgba(148, 163, 184, 0.16);
}

.diet-swipe-overlay {
    display: none;
}

/* Item Options Menu */
.item-options-menu {
    background-color: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    padding: 4px 0;
    min-width: 120px;
}

.item-option-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    text-align: left;
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    transition: background-color 0.2s;
}

.item-option-btn:hover {
    background-color: #f8fafc;
}

.item-option-btn.edit-btn {
    color: #2563eb;
}

.item-option-btn.edit-btn:hover {
    background-color: rgba(37, 99, 235, 0.1);
}

.item-option-btn.delete-btn {
    color: #dc2626;
}

.item-option-btn.delete-btn:hover {
    background-color: rgba(220, 38, 38, 0.1);
}

@media (max-width: 991px) {
    /* Mobile-specific diet chart changes */
    .diet-view-container {
        background-color: transparent;
        border-radius: 0;
        padding: 0;
        box-shadow: none;
        border: none;
        margin: 0;
    }

    .diet-view-chart-card {
        background-color: transparent;
        border-radius: 0;
        padding: 0;
        margin: 0 8px 20px 8px;
        border: none;
    }

    .diet-view-chart-title-wrap {
        margin: 0 12px;
    }

    .diet-view-chart-title {
        font-size: 18px;
    }

    .diet-view-chart-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        margin: 0 12px;
    }

    .diet-chart-wrapper {
        width: 110px;
        height: 110px;
        flex-shrink: 0;
    }

    .diet-view-chart-stats {
        display: flex;
        flex-direction: column;
        gap: 8px;
        flex: 1;
    }

    .chart-stat-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 2px 0;
        border-radius: 0;
        background-color: transparent;
        border: none;
        font-size: 14px;
        margin: 0 0 1px 0;
    }

    .chart-stat-row.calories {
        margin-top: 1px;
        padding-top: 1px;
        border-top: 1px solid rgba(148, 163, 184, 0.2);
    }

    .chart-stat-color {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        flex-shrink: 0;
    }

    .chart-stat-label {
        font-weight: 500;
        flex: 1;
    }

    .chart-stat-value {
        font-weight: 700;
        margin-left: auto;
    }

    /* Mobile meal boxes - remove all borders and padding */
    .diet-view-meal-block {
        background-color: transparent;
        border-radius: 0;
        padding: 0;
        margin: 0 8px 20px 8px;
        box-shadow: none;
        border: none;
    }

    .diet-view-meal-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 12px;
        gap: 10px;
        padding-bottom: 10px;
        border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    }

    .diet-view-meal-label {
        font-size: 17px;
        font-weight: 500;
        color: #0f172a;
        margin: 0;
    }

    .diet-view-meal-header-actions {
        gap: 8px;
    }

    .diet-meal-replacement-badge {
        height: 28px;
        padding: 0 8px;
    }

    .diet-meal-menu-btn {
        width: 30px;
        height: 30px;
        border-radius: 9px;
    }

    .diet-meal-menu {
        min-width: 142px;
    }

    .diet-meal-menu-item {
        font-size: 12px;
        padding: 8px 9px;
    }

    .diet-meal-replacement-modal {
        max-width: none;
        width: 100vw;
        height: 100dvh;
        max-height: none;
        margin: 0;
        border-radius: 0;
    }

    .diet-meal-replacement-overlay {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
    }

    .diet-meal-replacement-body {
        padding: 14px;
    }

    .diet-replacement-actions {
        padding-bottom: calc(env(safe-area-inset-bottom) + 4px);
        gap: 8px;
    }

    .diet-replacement-row {
        padding: 12px;
    }

    .diet-replacement-row-head {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 8px;
    }

    .diet-replacement-row-icon,
    .diet-replacement-card-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .diet-replacement-row .form-control {
        height: 42px;
        font-size: 14px;
    }

    .diet-replacement-row textarea.form-control {
        height: auto;
        min-height: 112px;
    }

    .diet-replacement-row-delete {
        width: 32px;
        height: 32px;
        border-radius: 10px;
    }

    .diet-replacement-card-grid {
        grid-template-columns: 1fr;
    }

    .diet-replacement-ingredients-list {
        font-size: 12px;
    }

    .diet-meal-name-inline-input {
        min-width: 140px;
        max-width: 180px;
        height: 30px;
        font-size: 16px;
    }

    .diet-meal-name-save-btn {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    .diet-meal-add-btn {
        background-color: #eaf2ff;
        color: #1d4ed8;
        border: none;
        border-radius: 50%;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background-color 0.2s, color 0.2s;
        flex-shrink: 0;
    }

    .diet-meal-add-btn:hover {
        background-color: #dbeafe;
        color: #1e40af;
    }

    .diet-view-meal-content {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding-top: 12px;
    }

    .diet-view-item {
        margin-bottom: 0;
    }

    /* Mobile food item layout - full width with minimal margins */
    .diet-view-item-card {
        background-color: rgba(15, 23, 42, 0.08);
        background-image: url('../assets/tyfit_img/food_card_bg.png');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        border-radius: 14px;
        padding: 14px;
        border: 1px solid rgba(148, 163, 184, 0.2);
        position: relative;
        margin: 0 4px;
    }

    .diet-view-item-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 8px;
    }

    .diet-view-item-title {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
        min-width: 0;
    }

    .diet-item-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: #16a34a;
        flex-shrink: 0;
    }

    .diet-view-item-name {
        font-weight: 500;
        color: #0f172a;
        font-size: 14px;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
    }

    .diet-view-item-calories {
        font-size: 13px;
        color: #0f172a;
        font-weight: 700;
        white-space: nowrap;
        margin-left: 8px;
    }

    .diet-view-item-qty {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 6px 10px;
        border-radius: 6px;
        background-color: rgba(15, 23, 42, 0.04);
        color: #475569;
        font-size: 12px;
        margin-bottom: 8px;
        width: fit-content;
    }

    .diet-item-qty-display,
    .diet-item-qty-editor {
        gap: 6px;
    }

    .diet-item-qty-input {
        width: 72px;
        font-size: 12px;
        padding: 3px 6px;
    }

    .diet-item-qty-edit-btn,
    .diet-item-qty-save-btn,
    .diet-item-qty-cancel-btn {
        width: 24px;
        height: 24px;
        border-radius: 6px;
    }

    .diet-view-item-macros {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        align-items: center;
        margin-bottom: 8px;
    }

    .diet-view-item-actions {
        display: none;
    }

    .diet-view-meal-totals {
        display: flex;
        gap: 8px;
        margin-top: 10px;
        padding-top: 10px;
    }

    .diet-view-meal-total-chip {
        font-size: 12px;
        padding: 5px 8px;
    }

    .diet-view-item-actions .diet-item-delete-btn {
        background: none;
        border: none;
        color: #94a3b8;
        font-size: 12px;
        cursor: pointer;
        padding: 2px;
        border-radius: 2px;
        transition: background-color 0.2s;
    }

    .diet-view-item-actions .diet-item-delete-btn:hover {
        background-color: rgba(148, 163, 184, 0.16);
    }

    .diet-view-item-qty.is-editing .diet-item-qty-display {
        display: inline-flex;
    }

    .diet-view-item-qty.is-editing .diet-item-qty-editor {
        display: none;
    }

    /* Swipe overlay for delete action */
    .diet-swipe-overlay {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 0;
        background-color: #dc2626;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 18px;
        transition: width 0.1s ease;
        border-radius: 8px;
        z-index: 4;
    }

    .diet-swipe-overlay i {
        opacity: 0.8;
    }

    /* Mobile margins for direct elements */
    .diet-user-toolbar {
        margin: 0 8px;
    }

    .diet-chart-switcher {
        margin: 0 8px;
    }

    #dietChartLoadingSpinner {
        margin: 0 8px;
    }

    #dietChartPageStatus {
        margin: 0 8px;
    }

    #dietChartEmptyState {
        margin: 0 8px;
    }
}


/* ============================================
   ADMIN PAGES - RESPONSIVE MEDIA QUERIES
   ============================================ */

@media (max-width: 768px) {
    .admin-tab-bar .nav-link {
        padding: 12px 15px;
        font-size: 14px;
    }

    .admin-greeting {
        flex-direction: column;
        align-items: flex-start;
    }

    .diet-view-save-bar {
        position: fixed;
        top: 58px;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 1050;
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 10px 12px;
        background-color: #9ca3af;
    }

    .diet-view-save-text {
        color: #111827;
    }

    .diet-view-save-btn {
        margin-left: auto;
        background-color: #f3f4f6;
        color: #111827;
    }

    .diet-header-brand {
        margin-bottom: 8px;
    }

    .diet-page-card {
        border: none;
        padding: 0;
        background-color: transparent;
        box-shadow: none;
    }

    .meal-card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .meal-card-header input {
        width: 100%;
    }

    .food-item-grid {
        grid-template-columns: 1fr;
    }

    .food-form-actions {
        flex-direction: column;
    }

    .food-form-actions .btn {
        width: 100%;
    }

    .food-list-actions {
        width: 100%;
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    .food-table-toolbar {
        width: auto;
        flex: 1 1 auto;
        flex-direction: row;
        align-items: center;
    }

    .food-table-search {
        min-width: 0;
        flex: 1 1 auto;
    }

    .food-sort-dropdown {
        flex: 0 0 auto;
    }

    .food-refresh-btn {
        width: 38px;
    }

    .food-macro-bars {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
    }

    .food-catalog-list {
        gap: 14px;
    }

    .food-catalog-row {
        gap: 10px;
        padding: 14px;
    }

    .food-row-top {
        grid-template-columns: 64px 1fr auto;
        align-items: start;
    }

    .food-row-bottom {
        grid-template-columns: 1fr;
        gap: 8px;
        padding-bottom: 34px;
        position: relative;
    }

    .food-row-actions {
        align-self: start;
    }

    .food-catalog-cell-calories {
        justify-content: center;
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
    }

    .food-catalog-calories-wrap {
        min-width: 160px;
        justify-content: center;
    }

    .diet-user-toolbar {
        align-items: stretch;
    }

    .diet-chart-switcher {
        align-items: stretch;
    }

    .diet-chart-switcher-head {
        align-items: center;
    }

    .diet-view-chart-stats {
        display: flex;
        flex-direction: column;
        gap: 8px;
        flex: 1;
    }

    .diet-chart-actions-menu {
        right: 0;
        left: auto;
    }

    .diet-chart-input-overlay.tp-modal-overlay {
        align-items: center;
        padding: 10px;
    }

    .diet-chart-input-overlay .tp-modal {
        border-radius: 18px;
        width: min(100%, 560px);
        max-height: calc(100svh - 20px);
    }

    .diet-user-select-wrap {
        flex: 1 1 100%;
    }

    .diet-user-actions {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    .diet-user-actions .btn {
        width: auto;
    }

    .diet-user-actions .btn-group {
        width: auto;
        flex: 1 1 auto;
    }

    .diet-user-actions .btn-group .btn {
        flex: 1 1 auto;
    }

    .diet-meal-header {
        flex-direction: column;
        align-items: stretch;
    }

    .diet-meal-header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .diet-food-row-main {
        grid-template-columns: 1fr;
    }

    .diet-food-row-main .btn {
        width: 100%;
    }

    .diet-editor-actions .btn {
        width: 100%;
    }

    .diet-view-meal-summary {
        justify-content: flex-start;
    }
}

@media (max-width: 991px) {
    .food-row-actions-desktop {
        display: none;
    }

    .food-row-actions-mobile {
        display: inline-flex;
        align-self: start;
    }

    .food-catalog-swipe-overlay {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 0;
        background-color: #dc2626;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #ffffff;
        font-size: 18px;
        transition: width 0.1s ease;
        border-radius: 14px;
        z-index: 4;
    }

    .food-catalog-swipe-overlay i {
        opacity: 0.9;
    }
}

@media (max-width: 991px) {
    .food-macro-bars {
        justify-content: center;
    }

    .food-catalog-entry-card {
        margin: 0;
    }

    .food-catalog-entry-card .food-macro-bars {
        width: 100%;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
        gap: 6px;
    }

    .food-catalog-entry-card .diet-view-macro {
        flex: 1 1 0;
        justify-content: center;
        white-space: nowrap;
        font-size: 11px;
        padding: 4px 6px;
    }

    .food-row-bottom {
        grid-template-columns: 1fr;
    }

    .food-catalog-cell-calories {
        justify-content: center;
    }
}


/* ============================================================
   ADMIN CONTENT TOP PADDING — override inline styles set for old navbar height
   The old navbar pushed content with padding: 120px on .admin-dashboard.
   New fixed headers are 70px (desktop) / 64px (mobile) + body padding-top handles offset.
   These rules normalise the extra gap.
   ============================================================ */

/* Desktop: body already has padding-top:70px; only 24px extra wanted */
.admin-dashboard {
    padding-top: 28px !important;
}

/* Diet chart / food catalog page shell */
.admin-section.diet-page-shell {
    padding-top: 28px !important;
}

/* Mobile/tablet: body already has padding-top:64px */
@media (max-width: 991.98px) {
    .admin-dashboard {
        padding-top: 20px !important;
        /* Catalog modal section labels */
        .catalog-section-label {
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            color: #64748b;
            padding: 4px 2px 6px;
        }

        /* Flash highlight for newly added custom food card */
        @keyframes catalogCardHighlight {
            0% { box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.5); }
            100% { box-shadow: none; }
        }
        .catalog-card-highlight {
            animation: catalogCardHighlight 1.2s ease-out forwards;
        }
        padding-bottom: 20px !important;
    }

    .admin-section.diet-page-shell {
        padding-top: 20px !important;
    }
}

.diet-page-skeleton {
    display: none !important;
}

.diet-page-skeleton__inner {
    max-width: 1180px;
    margin: 0 auto;
}

.diet-page-skeleton__hero,
.diet-page-skeleton__toolbar,
.diet-page-skeleton__chart,
.diet-page-skeleton__card {
    background: linear-gradient(90deg, rgba(226, 232, 240, 0.9) 25%, rgba(248, 250, 252, 1) 50%, rgba(226, 232, 240, 0.9) 75%);
    background-size: 200% 100%;
    border-radius: 24px;
}

.diet-page-skeleton__hero {
    height: 76px;
    width: min(420px, 100%);
    margin: 18px auto 24px;
}

.diet-page-skeleton__toolbar {
    height: 72px;
    margin-bottom: 24px;
}

.diet-page-skeleton__chart {
    height: 240px;
    margin-bottom: 24px;
}

.diet-page-skeleton__cards {
    display: grid;
    gap: 18px;
}

.diet-page-skeleton__card {
    height: 124px;
}

.shimmer {
    animation: dietPageShimmer 1.35s linear infinite;
}

body.diet-page-ready .admin-section.diet-page-shell,
body.diet-page-ready .tyfit-mobile-topbar,
body.diet-page-ready .tyfit-sidebar,
body.diet-page-ready .tyfit-sidebar-toggle-floating {
    animation: dietPageReveal 280ms ease-out both;
}

@keyframes dietPageShimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

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

@media (max-width: 991.98px) {
    .diet-page-skeleton {
        inset: 16px 16px auto;
    }

    .diet-page-skeleton__hero {
        height: 64px;
        margin-top: 8px;
    }

    .diet-page-skeleton__toolbar {
        height: 64px;
    }

    .diet-page-skeleton__chart {
        height: 200px;
    }

    .diet-page-skeleton__card {
        height: 108px;
    }
}

body.food-auth-pending .tyfit-main > *:not(.food-page-skeleton):not(.tyfit-desktop-actions) {
    display: none !important;
}

body:not(.food-auth-pending) .food-page-skeleton {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.food-auth-pending .food-page-skeleton {
    opacity: 1;
    visibility: visible;
}

.food-page-skeleton {
    position: absolute;
    inset: 24px 24px auto;
    z-index: 2;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.food-page-skeleton__inner {
    max-width: 1180px;
    margin: 0 auto;
}

.food-page-skeleton__hero,
.food-page-skeleton__toolbar,
.food-page-skeleton__table,
.food-table-skeleton {
    background: linear-gradient(90deg, rgba(226, 232, 240, 0.9) 25%, rgba(248, 250, 252, 1) 50%, rgba(226, 232, 240, 0.9) 75%);
    background-size: 200% 100%;
    border-radius: 20px;
}

.food-page-skeleton__hero {
    height: 76px;
    width: min(420px, 100%);
    margin: 18px auto 24px;
}

.food-page-skeleton__toolbar {
    height: 72px;
    margin-bottom: 24px;
}

.food-page-skeleton__table {
    height: 180px;
    margin-bottom: 18px;
}

.food-catalog-sticky-controls {
    position: sticky;
    top: 56px;
    z-index: 26;
    background: linear-gradient(180deg, #f8fbff 0%, rgba(248, 251, 255, 0.9) 72%, rgba(248, 251, 255, 0) 100%);
    padding: 4px 0 10px;
    margin-bottom: 8px;
}

.food-table-wrapper {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.food-load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.food-load-more-btn {
    border: 1px solid #d5deef;
    background: #fff;
    color: #334155;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.food-load-more-btn:hover {
    background: #f8fafc;
    border-color: #b7c6e4;
}

.food-table-skeleton-wrap {
    display: grid;
    gap: 14px;
    margin-top: 8px;
}

.food-table-skeleton {
    height: 88px;
    animation: dietPageShimmer 1.35s linear infinite;
}

body.food-page-ready .admin-section.diet-page-shell,
body.food-page-ready .tyfit-mobile-topbar,
body.food-page-ready .tyfit-sidebar,
body.food-page-ready .tyfit-sidebar-toggle-floating {
    animation: dietPageReveal 280ms ease-out both;
}

@media (max-width: 991.98px) {
    .food-page-skeleton {
        inset: 16px 16px auto;
    }

    .food-page-skeleton__hero {
        height: 64px;
        margin-top: 8px;
    }

    .food-page-skeleton__toolbar {
        height: 64px;
    }

    .food-page-skeleton__table {
        height: 150px;
    }

    .food-table-skeleton {
        height: 78px;
    }

    .food-catalog-sticky-controls {
        top: 0;
    }
}

.tybot-entry-card,
.tybot-sheet,
.tybot-plan-card,
.tybot-replacement-card {
    font-family: "Manrope", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tybot-entry-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 60px;
    margin: -2px 0 14px;
    padding: 11px 14px;
    border: 1px solid rgba(108, 99, 255, 0.18);
    border-radius: 20px;
    background:
        radial-gradient(circle at 88% 12%, rgba(139, 124, 255, 0.16), transparent 30%),
        linear-gradient(135deg, #ffffff 0%, #f7f4ff 100%);
    box-shadow: 0 10px 24px rgba(108, 99, 255, 0.08);
    cursor: pointer;
    overflow: hidden;
    user-select: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.tybot-entry-card::after {
    content: "";
    position: absolute;
    right: 44px;
    top: 9px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(108, 99, 255, 0.24);
    box-shadow:
        -17px 27px 0 rgba(108, 99, 255, 0.1),
        16px 26px 0 rgba(34, 197, 94, 0.11);
    pointer-events: none;
}

.tybot-entry-card:hover {
    border-color: rgba(108, 99, 255, 0.28);
    box-shadow: 0 16px 32px rgba(108, 99, 255, 0.1);
    transform: translateY(-1px);
}

.tybot-entry-card:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.12), 0 14px 30px rgba(108, 99, 255, 0.1);
}

.tybot-entry-avatar,
.tybot-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 18px;
    background: linear-gradient(145deg, #ffffff, #f0edff);
    border: 1px solid #e7e4ff;
    box-shadow: 0 12px 24px rgba(108, 99, 255, 0.12);
}

.tybot-entry-avatar {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    flex: 0 0 44px;
    background: linear-gradient(145deg, #ffffff, #efeaff);
    box-shadow: 0 10px 20px rgba(108, 99, 255, 0.12);
}

.tybot-entry-avatar::before {
    top: 7px;
    width: 17px;
}

.tybot-entry-avatar .tybot-entry-face {
    width: 29px;
    height: 23px;
    gap: 5px;
    margin-top: 7px;
    border-radius: 9px;
}

.tybot-entry-avatar .tybot-entry-face span {
    width: 4px;
    height: 4px;
}

.tybot-entry-avatar::before,
.tybot-avatar::before {
    content: "";
    position: absolute;
    top: 8px;
    width: 18px;
    height: 3px;
    border-radius: 999px;
    background: #6c63ff;
    opacity: 0.85;
}

.tybot-entry-face,
.tybot-face {
    display: flex;
    gap: 7px;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 24px;
    margin-top: 8px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid rgba(108, 99, 255, 0.18);
}

.tybot-entry-face span,
.tybot-face span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #6c63ff;
}

.tybot-entry-copy {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.tybot-entry-title,
.tybot-entry-copy h3 {
    margin: 0 0 3px;
    color: #111827;
    font-size: 15px;
    font-weight: 760;
    letter-spacing: 0;
    line-height: 1.1;
    white-space: nowrap;
}

.tybot-entry-subtitle,
.tybot-entry-copy p {
    margin: 0;
    color: #667085;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.35;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tybot-entry-sparkle {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: #8b7cff;
}

.tybot-entry-sparkle svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.2;
}

.tybot-entry-arrow,
.tybot-entry-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 999px;
    background: rgba(108, 99, 255, 0.11);
    color: #6c63ff;
}

.tybot-entry-arrow svg,
.tybot-entry-btn svg {
    width: 16px;
    height: 16px;
}

.tybot-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1055;
    background: rgba(17, 24, 39, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.tybot-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.tybot-sheet {
    position: fixed;
    z-index: 1056;
    right: 24px;
    bottom: 24px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(440px, calc(100vw - 48px));
    max-height: min(720px, calc(100vh - 48px));
    min-height: 620px;
    border: 1px solid #e7e4ff;
    border-radius: 28px;
    background: #ffffff;
    box-shadow: 0 28px 80px rgba(17, 24, 39, 0.24);
    overflow: hidden;
    transform: translateY(18px) scale(0.98);
    opacity: 0;
    pointer-events: none;
    transition: opacity 190ms ease, transform 190ms ease;
}

.tybot-sheet.is-open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.tybot-header,
.tybot-composer {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
}

.tybot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(231, 228, 255, 0.9);
}

.tybot-header-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.tybot-avatar {
    width: 44px;
    height: 44px;
}

.tybot-header h3 {
    margin: 0;
    color: #111827;
    font-size: 17px;
    font-weight: 800;
}

.tybot-header p {
    margin: 1px 0 0;
    color: #667085;
    font-size: 12px;
    font-weight: 600;
}

.tybot-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 14px;
    background: #f7f5ff;
    color: #4b5563;
    cursor: pointer;
}

.tybot-close svg {
    width: 18px;
    height: 18px;
}

.tybot-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    overflow-y: auto;
    background:
        radial-gradient(circle at 12% 8%, rgba(108, 99, 255, 0.08), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #faf9ff 100%);
}

.tybot-message {
    max-width: 88%;
    border-radius: 18px;
    padding: 11px 13px;
    font-size: 13.5px;
    line-height: 1.48;
    color: #1f2937;
    white-space: pre-wrap;
}

.tybot-message--user {
    align-self: flex-end;
    background: linear-gradient(145deg, #6c63ff, #554bf5);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(108, 99, 255, 0.16);
}

.tybot-message--bot {
    align-self: flex-start;
    background: #ffffff;
    border: 1px solid #e7e4ff;
    box-shadow: 0 12px 28px rgba(108, 99, 255, 0.07);
}

.tybot-quick-actions {
    display: grid;
    gap: 8px;
    width: 100%;
    margin-top: 3px;
}

.tybot-quick-action {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 0 13px;
    border: 1px solid #e7e4ff;
    border-radius: 16px;
    background: #ffffff;
    color: #111827;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(108, 99, 255, 0.05);
}

.tybot-quick-action svg {
    width: 17px;
    height: 17px;
    color: #6c63ff;
}

.tybot-typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.tybot-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #8b7cff;
    animation: tybotPulse 900ms ease-in-out infinite;
}

.tybot-typing span:nth-child(2) {
    animation-delay: 120ms;
}

.tybot-typing span:nth-child(3) {
    animation-delay: 240ms;
}

.tybot-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid rgba(231, 228, 255, 0.9);
}

.tybot-composer input {
    width: 100%;
    min-height: 48px;
    border: 1px solid #e7e4ff;
    border-radius: 16px;
    padding: 0 14px;
    background: #fbfaff;
    color: #111827;
    font-size: 14px;
    font-weight: 500;
    outline: none;
}

.tybot-composer input:focus {
    border-color: rgba(108, 99, 255, 0.58);
    box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.1);
}

.tybot-composer button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(145deg, #6c63ff, #554bf5);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(108, 99, 255, 0.18);
}

.tybot-composer button svg {
    width: 18px;
    height: 18px;
}

.tybot-composer button:disabled,
.tybot-entry-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tybot-card-list {
    display: grid;
    gap: 10px;
    width: 100%;
    margin-top: 6px;
}

.tybot-plan-card,
.tybot-replacement-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #e7e4ff;
    border-radius: 20px;
    padding: 14px;
    box-shadow: 0 14px 30px rgba(108, 99, 255, 0.08);
}

.tybot-plan-card h4,
.tybot-replacement-card h4 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 15px;
    font-weight: 800;
}

.tybot-plan-macros,
.tybot-replacement-macros {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.tybot-plan-macros span,
.tybot-replacement-macros span {
    border-radius: 999px;
    background: #f3eeff;
    color: #5046e5;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 750;
}

.tybot-meal-preview {
    display: grid;
    gap: 5px;
    margin-top: 10px;
}

.tybot-meal-preview strong {
    color: #111827;
    font-size: 12px;
}

.tybot-meal-preview p {
    margin: 0;
    color: #667085;
    font-size: 12px;
    line-height: 1.4;
}

.tybot-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tybot-action-btn {
    min-height: 38px;
    border: 0;
    border-radius: 13px;
    padding: 0 12px;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
}

.tybot-action-btn--primary {
    background: linear-gradient(145deg, #6c63ff, #554bf5);
    color: #ffffff;
}

.tybot-action-btn--ghost {
    border: 1px solid #e7e4ff;
    background: #ffffff;
    color: #5046e5;
}

@keyframes tybotPulse {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.45;
    }
    50% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

@media (max-width: 767.98px) {
    .tybot-entry-card {
        min-height: 60px;
        padding: 9px 11px;
        border-radius: 18px;
        gap: 10px;
    }

    .tybot-entry-avatar {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .tybot-entry-copy {
        display: grid;
        gap: 2px;
    }

    .tybot-entry-title {
        font-size: 14.5px;
    }

    .tybot-entry-subtitle {
        display: block;
        font-size: 11.2px;
    }

    .tybot-entry-sparkle {
        display: none;
    }

    .tybot-entry-arrow {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }

    .tybot-backdrop {
        z-index: 1090;
    }

    .tybot-sheet {
        z-index: 1091;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 85vh;
        min-height: 85vh;
        border-radius: 28px 28px 0 0;
        border-bottom: 0;
        transform: translateY(100%);
    }

    .tybot-sheet.is-open {
        transform: translateY(0);
    }

    .tybot-messages {
        padding: 14px;
    }
}

@media (max-width: 374px) {
    .tybot-entry-subtitle {
        display: none;
    }
}

/* Diet page standard modal surfaces */
.diet-standard-modal .diet-standard-dialog {
    max-width: 440px;
}

.diet-standard-modal .diet-standard-panel {
    position: relative;
    border: 1px solid rgba(231, 228, 255, 0.95);
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(17, 24, 39, 0.18);
    overflow: hidden;
}

.diet-standard-modal .diet-standard-body {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 26px 24px 14px;
    text-align: center;
}

.diet-standard-danger-icon {
    width: 50px;
    height: 50px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.95), rgba(255, 247, 247, 0.95));
}

.diet-standard-danger-icon svg {
    width: 23px;
    height: 23px;
    stroke-width: 2.3;
}

.diet-standard-modal h5 {
    margin: 0;
    color: #111827;
    font-size: 18px;
    font-weight: 700;
}

.diet-standard-modal p {
    margin: 0;
    max-width: 320px;
    color: #667085;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
}

.diet-standard-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 16px 20px 20px;
    border-top: 0;
}

.diet-standard-btn {
    min-height: 46px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.diet-standard-btn--ghost {
    border: 1px solid rgba(231, 228, 255, 0.95);
    background: #ffffff;
    color: #475569;
}

.diet-standard-btn--danger {
    border: 1px solid rgba(239, 68, 68, 0.18);
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    box-shadow: 0 14px 24px rgba(239, 68, 68, 0.18);
}

.diet-chart-input-overlay .tp-modal {
    position: relative;
    border: 1px solid rgba(231, 228, 255, 0.95);
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(17, 24, 39, 0.18);
}

.diet-chart-input-overlay .tp-modal-badge {
    background: #f0edff;
    color: #6C63FF;
}

.diet-chart-input-overlay .tp-modal-header {
    border-bottom-color: rgba(231, 228, 255, 0.85);
}

.diet-chart-input-overlay .tp-modal-footer {
    border-top-color: rgba(231, 228, 255, 0.85);
}

.diet-chart-input-overlay .tp-form-group {
    position: relative;
    gap: 6px;
}

.diet-chart-input-overlay .tp-form-group label {
    color: #667085;
    font-size: 12px;
    font-weight: 700;
}

.diet-chart-input-overlay .tp-form-group input {
    border: 0;
    border-radius: 0;
    background: transparent;
    border-bottom: 1px solid rgba(231, 228, 255, 0.95);
    color: #111827;
    padding: 0;
    height: 46px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: none;
}

.diet-chart-input-overlay .tp-form-group input:focus {
    border-color: rgba(108, 99, 255, 0.45);
    box-shadow: none;
}

.diet-chart-input-overlay .tp-btn {
    border-radius: 16px;
    height: 48px;
}

.diet-chart-input-overlay .tp-btn.tp-btn-primary {
    background: linear-gradient(135deg, #6C63FF, #8B7CFF);
    border-color: transparent;
    box-shadow: 0 14px 28px rgba(108, 99, 255, 0.18);
}

.diet-chart-input-overlay .tp-modal-close:hover {
    color: #6C63FF;
    background: #f5f3ff;
    border-color: rgba(108, 99, 255, 0.18);
}

body[data-page="diet-chart"] #tyfitDialogModal .modal-dialog {
    max-width: 440px;
}

body[data-page="diet-chart"] #tyfitDialogModal .tyfit-dialog-content {
    border: 1px solid rgba(231, 228, 255, 0.95);
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(17, 24, 39, 0.18);
    overflow: hidden;
}

body[data-page="diet-chart"] #tyfitDialogModal .tyfit-dialog-header {
    justify-content: center;
    padding: 24px 24px 8px;
    border-bottom: 0;
}

body[data-page="diet-chart"] #tyfitDialogModal .tyfit-dialog-title {
    color: #111827;
    font-size: 18px;
    font-weight: 700;
}

body[data-page="diet-chart"] #tyfitDialogModal .tyfit-dialog-body {
    padding: 6px 24px 14px;
    text-align: center;
}

body[data-page="diet-chart"] #tyfitDialogModal .tyfit-dialog-message {
    margin: 0 auto;
    max-width: 320px;
    color: #667085;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
}

body[data-page="diet-chart"] #tyfitDialogModal .tyfit-dialog-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 16px 20px 20px;
    border-top: 0;
}

body[data-page="diet-chart"] #tyfitDialogModal .tyfit-dialog-btn {
    min-height: 46px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 700;
}

body[data-page="diet-chart"] #tyfitDialogModal .tyfit-dialog-btn.btn-primary {
    background: linear-gradient(135deg, #6C63FF, #8B7CFF);
    border-color: transparent;
    box-shadow: 0 14px 28px rgba(108, 99, 255, 0.18);
}

body[data-page="diet-chart"] #tyfitDialogModal .tyfit-dialog-btn.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 14px 24px rgba(239, 68, 68, 0.18);
}

@media (max-width: 991px) {
    .diet-standard-modal {
        padding-right: 0 !important;
    }

    .diet-standard-modal .diet-standard-dialog {
        display: flex;
        align-items: flex-end;
        min-height: 100%;
        max-width: none;
        margin: 0;
    }

    .diet-standard-modal .diet-standard-panel {
        width: 100%;
        border-radius: 28px 28px 0 0;
        border-bottom: 0;
        box-shadow: 0 -22px 58px rgba(15, 23, 42, 0.18);
    }

    .diet-standard-modal .diet-standard-panel::before,
    .diet-chart-input-overlay .tp-modal::before {
        content: "";
        position: absolute;
        top: 9px;
        left: 50%;
        width: 46px;
        height: 5px;
        transform: translateX(-50%);
        border-radius: 999px;
        background: rgba(148, 163, 184, 0.42);
    }

    .diet-standard-modal .diet-standard-body {
        padding-top: 30px;
    }

    .diet-chart-input-overlay.tp-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .diet-chart-input-overlay .tp-modal {
        position: relative;
        width: 100%;
        max-width: none;
        max-height: 86vh;
        border-radius: 28px 28px 0 0;
        border-bottom: 0;
        box-shadow: 0 -22px 58px rgba(15, 23, 42, 0.18);
    }

    .diet-chart-input-overlay .tp-modal-header {
        padding-top: 28px;
    }

    .diet-chart-input-overlay .tp-modal-footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    body[data-page="diet-chart"] #tyfitDialogModal {
        padding-right: 0 !important;
    }

    body[data-page="diet-chart"] #tyfitDialogModal .modal-dialog {
        display: flex;
        align-items: flex-end;
        min-height: 100%;
        max-width: none;
        margin: 0;
    }

    body[data-page="diet-chart"] #tyfitDialogModal .tyfit-dialog-content {
        position: relative;
        width: 100%;
        border-radius: 28px 28px 0 0;
        border-bottom: 0;
        box-shadow: 0 -22px 58px rgba(15, 23, 42, 0.18);
    }

    body[data-page="diet-chart"] #tyfitDialogModal .tyfit-dialog-content::before {
        content: "";
        position: absolute;
        top: 9px;
        left: 50%;
        width: 46px;
        height: 5px;
        transform: translateX(-50%);
        border-radius: 999px;
        background: rgba(148, 163, 184, 0.42);
    }

    body[data-page="diet-chart"] #tyfitDialogModal .tyfit-dialog-header {
        padding-top: 30px;
    }
}
