﻿/* ================================================
   Lập thực đơn tuần - GMS.QLNA
   ================================================ */
:root {
    --green: #087b39;
    --dark: #064d29;
    --border: #dce5df;
    --soft: #f3faf5;
    --danger: #d92d20;
    --danger-light: #fdecec;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: #f8faf9;
    color: #23322a;
    font: 14px "Segoe UI", Arial, sans-serif;
}

/* ── Topbar ── */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.breadcrumb { color: #66756c; }
.breadcrumb span, h1, h2 { color: var(--dark); }
h1 { margin: 10px 0 0; font-size: 30px; }
h2 { margin: 0 0 16px; font-size: 18px; }
.top-actions { display: flex; gap: 16px; }

/* ── Buttons ── */
.btn {
    min-width: 138px;
    padding: 11px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: opacity .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-outline-success {
    border: 1px solid var(--green);
    background: #fff;
    color: var(--dark);
}
.btn-outline-success:hover:not(:disabled) { background: var(--soft); }
.btn-success {
    border: 1px solid var(--green);
    background: var(--green);
    color: #fff;
}
.btn-success:hover:not(:disabled) { background: var(--dark); }
.btn-danger {
    border: 1px solid var(--danger);
    background: var(--danger);
    color: #fff;
    min-width: 100px;
}
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

/* ── Main ── */
main { padding: 16px; }

.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 20px;
}

/* ── Overview Grid ── */
.overview-grid {
    display: grid;
    grid-template-columns: 2.1fr 1fr;
    gap: 12px;
}

/* ── Form ── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 20px;
}
.field-full {
    grid-column: 1 / -1;
}
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.field label {
    font-weight: 600;
    color: #44544b;
    font-size: 13px;
}
.field input, .field select, .field textarea, .field .date-range {
    width: 100%;
}
.field textarea {
    min-height: 60px;
    resize: vertical;
}
input, select, textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ccd7d0;
    border-radius: 6px;
    background: #fff;
    font: inherit;
    transition: border-color .2s;
    height: auto;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--green);
}
.date-range { display: flex; align-items: center; gap: 8px; }
.date-range i { color: #888; font-style: normal; }

.status {
    display: inline-block;
    width: max-content;
    padding: 6px 17px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 13px;
    margin-top: 3px;
}
.drafting { border: 1px solid #f4a329; color: #db6c00; background: #fff9ed; }
.approved { border: 1px solid var(--green); color: var(--green); background: #eef8f1; }
.cancelled { border: 1px solid #c8d0cb; color: #5d6962; background: #f1f3f2; }

/* ── Aside: Metrics ── */
aside { display: grid; gap: 12px; }

.metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 16px;
}
.metric-item {
    text-align: center;
    border-right: 1px solid var(--border);
    padding: 8px 4px;
}
.metric-item:last-child { border-right: 0; }
.metric-icon {
    display: inline-block;
    width: 44px;
    height: 44px;
    line-height: 44px;
    border-radius: 50%;
    background: #eaf1eb;
    color: var(--green);
    margin-bottom: 8px;
    border: 2px solid #b6d4c1;
}
.metric-icon svg { vertical-align: middle; }
.metric-icon-label {
    display: block;
    font-size: 11px;
    color: #66756c;
    margin-bottom: 4px;
}
.metric-item strong {
    display: block;
    color: var(--dark);
    font-size: 26px;
    line-height: 1.2;
}
.metric-label {
    font-size: 12px;
    color: #66756c;
}

/* ── Aside: Checks ── */
.checks p { margin: 14px 0; }
.check-item { font-size: 14px; }
.check-item.ok { color: var(--green); font-weight: 600; }
.check-item.fail { color: var(--danger); }
.check-icon-ok {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    margin-right: 6px;
    vertical-align: middle;
}
.check-icon-fail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #eee;
    color: #999;
    font-size: 13px;
    font-weight: 700;
    margin-right: 6px;
    vertical-align: middle;
}

/* ── Menu Panel ── */
.menu-panel { margin-top: 12px; }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
}
.section-head p { margin: 0; color: #6b776f; }

/* ── Day Grid ── */
.day-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-top: 18px;
}

/* ── Day Card ── */
.day-card {
    border: 1px solid #cbd9cf;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.day-title {
    text-align: center;
    padding: 10px;
    background: #eaf6ed;
    color: var(--dark);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.3px;
}
.day-body {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Day header: label + check */
.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
    color: #66756c;
    font-weight: 600;
}
.check-ok {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

/* Template name (text, not select) */
.day-template-name {
    padding: 8px 10px;
    border: 1px solid #ccd7d0;
    border-radius: 6px;
    background: #f9fbfa;
    font-size: 12px;
    color: var(--dark);
    font-weight: 500;
    word-break: break-word;
    line-height: 1.4;
}

/* Edit / Delete icon buttons */
.day-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 8px 0;
}
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #ccd7d0;
    background: #fff;
    cursor: pointer;
    transition: all .15s;
    color: #5a6b61;
}
.btn-icon:hover { background: var(--soft); border-color: var(--green); color: var(--dark); }
.btn-delete-day { color: var(--danger); border-color: #f5c6c6; }
.btn-delete-day:hover { background: var(--danger-light); border-color: var(--danger); }

/* Dish table */
.dish-table {
    flex: 1;
    margin-bottom: 8px;
}
.dish-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 6px;
    padding: 6px 2px;
    border-top: 1px solid #edf1ee;
    font-size: 12px;
    align-items: baseline;
}
.dish-type {
    color: #5a6b61;
    font-weight: 600;
    white-space: nowrap;
    font-size: 11px;
}
.dish-name {
    color: #23322a;
    word-break: break-word;
}
.dish-qty {
    color: #68736c;
    text-align: right;
    white-space: nowrap;
    font-weight: 500;
}

/* Price tag */
.day-price {
    margin: 8px auto 6px;
    padding: 7px 12px;
    text-align: center;
    border: 1px solid #aad0b4;
    border-radius: 7px;
    background: var(--soft);
    color: var(--dark);
    font-weight: 600;
    font-size: 12px;
}

/* Detail link */
.day-detail-link {
    display: block;
    text-align: center;
    color: var(--green);
    font-size: 12px;
    text-decoration: none;
    padding: 4px 0 2px;
}
.day-detail-link:hover { text-decoration: underline; }

/* Empty day state */
.empty {
    padding: 22px 5px;
    text-align: center;
    color: #7a847d;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Info bar ── */
.info {
    margin-top: 14px;
    padding: 13px;
    border: 1px solid #b8d9ff;
    border-radius: 7px;
    background: #f2f8ff;
    color: #2465a7;
}

/* ── Messages ── */
.message { display: none; margin-bottom: 12px; padding: 12px; border-radius: 6px; }
.message.success, .message.error { display: block; }
.message.success { background: #e8f6ec; color: var(--dark); }
.message.error { background: #fdecec; color: #a32222; }

/* ── Modals ── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    padding: 30px;
    background: rgba(0,0,0,.45);
    overflow: auto;
    z-index: 1000;
}
.modal.open { display: flex; align-items: center; justify-content: center; }
.modal-box {
    width: 100%;
    margin: auto;
    padding: 24px;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
}
.modal-xl { max-width: 1200px; }
.modal-lg { max-width: 900px; }
.modal-sm { max-width: 440px; }
.close {
    border: 0;
    background: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
}
.close:hover { color: #333; }
.modal-body { padding: 16px 0; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* Template preview table inside modal */
.template-select-wrap { margin-bottom: 20px; max-width: 500px; }
.template-preview-table {
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.styled-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.styled-table th, .styled-table td {
    padding: 10px 14px;
    border: 1px solid var(--border);
}
.styled-table th {
    background: #f4f6f5;
    color: #55625a;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}
.styled-table th.num { text-align: right; }
.styled-table td.num { text-align: right; }
.styled-table .row-group {
    background: #ffebd9;
    font-weight: 700;
    color: #a34e00;
}
.styled-table .row-group td { border-color: #f7dac1; }
.styled-table .row-total {
    background: #eaf6ed;
    font-weight: 700;
    color: var(--dark);
}
.styled-table .row-total td { border-color: #c9e6d2; }
.styled-table tbody tr:not(.row-group):not(.row-total):hover {
    background: #fcfcfc;
}

/* ── Menu Editor Modal Layout ── */
.menu-editor-grid {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 6px;
    height: 65vh;
    min-height: 400px;
    background: #fff;
}

#modalSelectMenu .modal-box {
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 32px);
    overflow: hidden;
}

#modalSelectMenu .modal-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

#modalSelectMenu .menu-editor-grid {
    flex: 1;
    height: auto;
    min-height: 0;
}
.menu-editor-list {
    width: 240px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background: #fcfcfc;
    min-height: 0;
}
.thucdon-list-header {
    padding: 10px 14px;
    background: #f4f6f5;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: #55625a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.btn-add-small {
    background: #fff;
    border: 1px solid #ccd7d0;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: var(--green);
}
.btn-add-small:hover {
    background: var(--soft);
}
.thucdon-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    overflow-y: auto;
}
.thucdon-list li {
    padding: 10px 14px;
    border-bottom: 1px solid #edf1ee;
    cursor: pointer;
    display: flex;
    gap: 10px;
    align-items: center;
}
.thucdon-list li:hover {
    background: #f0f7f2;
}
.thucdon-list li.active {
    background: #e3f2e8;
    border-left: 3px solid var(--green);
    font-weight: 600;
}
.thucdon-list .stt {
    background: #ccd7d0;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}
.thucdon-list li.active .stt {
    background: var(--green);
}
.thucdon-list .rename-input {
    flex: 1;
    min-width: 0;
    padding: 2px 4px;
    border: 1px solid var(--green);
    border-radius: 3px;
    font-size: inherit;
    font-family: inherit;
}
.list-hint {
    padding: 10px;
    font-size: 11px;
    color: #888;
    background: #f9f9f9;
    border-top: 1px solid var(--border);
    margin: 0;
}
.menu-editor-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}
.menu-editor-detail-head {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.menu-editor-detail-head strong {
    font-size: 16px;
    color: var(--dark);
}
.locked-badge {
    background: #fff3cd;
    color: #856404;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    border: 1px solid #ffeeba;
}
.warning-text {
    padding: 8px 16px;
    background: #fdecec;
    color: #a32222;
    font-size: 13px;
    border-bottom: 1px solid #f5c6c6;
}
.menu-detail-wrap {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px;
}
.detail-actions {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: #fcfcfc;
    display: flex;
    gap: 10px;
    align-items: center;
}
.detail-actions select {
    width: auto;
    flex: 1;
    max-width: 300px;
}

/* Modal Table Inputs */
.styled-table .field-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ccd7d0;
    border-radius: 4px;
    font: inherit;
    font-size: 13px;
}
.styled-table .field-input:focus {
    border-color: var(--green);
    outline: none;
}
.styled-table .field-input:disabled {
    background: #f4f6f5;
    color: #888;
}
.qty-input {
    display: flex;
    gap: 4px;
}
.input-donvi {
    width: 50px !important;
}
.dongia-caption {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: #fff;
    border: 1px solid #ccd7d0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    padding: 4px 0;
    z-index: 2000;
    min-width: 150px;
}
.context-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 16px;
    background: none;
    border: none;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    color: #23322a;
}
.context-menu button:hover {
    background: var(--soft);
    color: var(--green);
}
.context-menu button.danger:hover {
    background: #fdecec;
    color: #a32222;
}

/* ── Select2 overrides ── */
.select2-container--default .select2-selection--single {
    height: 38px !important;
    border: 1px solid #ccd7d0 !important;
    border-radius: 6px !important;
    padding: 4px 8px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 28px !important;
    color: #23322a !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
}
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--green) !important;
}
.select2-dropdown { border-color: #ccd7d0 !important; border-radius: 6px !important; }
.select2-results__option--highlighted { background-color: var(--soft) !important; color: var(--dark) !important; }
.select2-results__option--selected { background-color: #e3f2e8 !important; }

/* ── Flatpickr overrides ── */
.flatpickr-input { cursor: pointer; background: #fff !important; }
.flatpickr-day.selected { background: var(--green) !important; border-color: var(--green) !important; }
.flatpickr-day:hover { background: var(--soft) !important; }

/* ── Day Card Thumbnail ── */
.day-card-thumb {
    width: 100%;
    height: 60px;
    border-radius: 4px;
    background: #f2f6f3;
    border: 1px solid #e5ebe7;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 6px 0;
    overflow: hidden;
}
.day-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.day-card-thumb .thumb-placeholder {
    color: #b0c0b5;
    font-size: 11px;
    text-align: center;
}
.day-card-thumb .thumb-placeholder svg {
    display: block;
    margin: 0 auto 2px;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
    .day-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 800px) {
    .topbar, .section-head {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
    }
    .top-actions { flex-wrap: wrap; }
    .overview-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .notes { grid-column: auto; }
    .day-grid { grid-template-columns: 1fr; }
    .metrics { grid-template-columns: 1fr; }
    .metric-item {
        padding: 8px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
}

/* ── Day cards list layout ── */
#dayCards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 14px;
}

.day-card.list-layout {
    display: grid;
    grid-template-columns: 108px 1fr;
    gap: 0;
    border: 1px solid #dde8e1;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

/* Cột ngày (bên trái) */
.day-card.list-layout .day-date-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 16px 8px 16px;
    background: #f3faf5;
    border-right: 1px solid #dde8e1;
    font-weight: 700;
    color: var(--dark);
    font-size: 13px;
    text-align: center;
    line-height: 1.55;
    gap: 2px;
    flex-shrink: 0;
}
.day-card.list-layout .day-date-col .day-label {
    font-size: 11px;
    font-weight: 600;
    color: #5a7a66;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.day-card.list-layout .day-date-col .day-date {
    font-size: 15px;
    font-weight: 800;
    color: var(--dark);
}

/* Cột nội dung (bên phải) */
.day-menus-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 12px 14px;
}
.day-menus-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    min-height: 28px;
}
.day-menu-count {
    color: #6a7a70;
    font-size: 12px;
}
.day-actions {
    display: flex;
    gap: 6px;
}

/* Hàng ngang các thực đơn */
.day-menu-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: #c4d8ca transparent;
}
.day-menu-row::-webkit-scrollbar { height: 4px; }
.day-menu-row::-webkit-scrollbar-thumb { background: #c4d8ca; border-radius: 2px; }

/* Mỗi thẻ thực đơn */
.day-menu-option {
    flex: 0 0 260px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    border: 1px solid #dde8e1;
    border-radius: 8px;
    background: #fbfdfb;
}
.day-menu-option-head {
    margin-bottom: 8px;
    min-width: 0;
}
.day-menu-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #2e7d4f;
    margin-bottom: 2px;
}
.day-menu-name {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #174d31;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.day-menu-option-body {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.day-menu-thumb {
    width: 72px;
    height: 64px;
    flex: 0 0 72px;
    border-radius: 6px;
    border: 1px solid #dde8e1;
    background: #f2f6f3;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.day-menu-thumb img { width: 100%; height: 100%; object-fit: cover; }
.day-menu-thumb .thumb-placeholder {
    color: #9aaaa0;
    font-size: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.day-menu-option .day-dish-list {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 72px;
    overflow: hidden;
}
.day-menu-option .day-dish-list li {
    font-size: 12px;
    color: #4d5d53;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.day-menu-option .day-dish-list .lbl { color: #7b8a81; }
.day-menu-option-foot {
    margin-top: 8px;
    text-align: right;
}
.day-menu-price {
    font-size: 12px;
    font-weight: 700;
    color: var(--dark);
}

/* Trạng thái chưa có thực đơn */
.empty-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    color: #c0292a;
    font-style: italic;
    font-size: 13px;
}

@media (max-width: 700px) {
    .day-card.list-layout { grid-template-columns: 1fr; }
    .day-card.list-layout .day-date-col {
        flex-direction: row;
        justify-content: flex-start;
        border-right: none;
        border-bottom: 1px solid #dde8e1;
        padding: 10px 14px;
        gap: 8px;
    }
    .day-menu-option { flex-basis: 240px; }
}



.day-card.list-layout .day-date-col {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    padding-top: 4px;
    width: 90px;
    flex-shrink: 0;
}
.day-card.list-layout .day-img-col {
    width: 140px;
    height: 105px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.day-card.list-layout .day-det-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0; /* important to prevent flex child overflow */
}
.day-card.list-layout .day-main-dish {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 6px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.day-card.list-layout .day-dish-list li {
    font-size: 13px;
    color: #495057;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.day-card.list-layout .empty-menu {
    color: #dc3545;
    font-style: italic;
    font-size: 13px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.day-card.list-layout .day-img-col img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.day-card.list-layout .thumb-placeholder {
    color: #999;
    text-align: center;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.day-card.list-layout .day-det-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.day-card.list-layout .day-main-dish {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 8px 0;
}
.day-card.list-layout .day-dish-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.day-card.list-layout .day-dish-list li {
    font-size: 14px;
    color: #495057;
}
.day-card.list-layout .day-dish-list .lbl {
    color: #6c757d;
}
.day-card.list-layout .day-actions-wrap {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.day-card.list-layout .photo-label {
    font-size: 13px;
    color: #6c757d;
}
.day-card.list-layout .day-actions {
    display: flex;
    gap: 8px;
}
.day-card.list-layout .empty-menu {
    color: #dc3545;
    font-style: italic;
    font-size: 14px;
    display: flex;
    align-items: center;
    height: 100%;
}

/* Day cards - multi-menu layout */
.day-card.list-layout {
    display: flex;
    flex-direction: row;
    gap: 0;
    align-items: flex-start;
}
.day-menus-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.day-menu-row {
    display: flex;
    flex-direction: row;
    gap: 16px;
    padding: 12px 0;
    align-items: flex-start;
}
hr.menu-divider {
    margin: 0;
    border: none;
    border-top: 1px dashed #dee2e6;
}
.day-menu-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #2e7d4f;
    margin-bottom: 4px;
}

/* ── Toast dùng chung cho danh sách và màn hình lập thực đơn ── */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    bottom: auto;
    left: auto;
    z-index: 10000;
    max-width: min(520px, calc(100vw - 32px));
    padding: 12px 18px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 8px 24px rgba(18, 44, 29, .22);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #087b39; }
.toast-error { background: #c62828; }

/* ── Danh sách ngày: mỗi ngày hiển thị toàn bộ thực đơn theo hàng ngang ── */
#dayCards {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-top: 18px;
}
.day-card.list-layout {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 0;
    padding: 0;
    align-items: stretch;
    overflow: hidden;
    background: #fff;
    border-color: #d6e2da;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(22, 73, 44, .05);
}
.day-card.list-layout .day-date-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    min-height: 100%;
    padding: 24px 12px;
    background: #f2f9f4;
    border-right: 1px solid #dce8df;
    color: var(--dark);
    text-align: center;
}
.day-card.list-layout .day-date-col .day-label {
    margin-bottom: 6px;
    color: #587063;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}
.day-card.list-layout .day-date-col .day-date {
    color: var(--dark);
    font-size: 18px;
    font-weight: 700;
}
.day-menus-wrap {
    min-width: 0;
    width: 100%;
    padding: 16px 18px 18px;
}
.day-menus-head {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.day-menu-count { color: #66786d; font-size: 13px; }
.day-actions { display: flex; gap: 10px; margin: 0; }
.day-menu-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 14px;
    overflow-x: auto;
    padding: 0 2px 7px;
    scrollbar-color: #b9cfc0 transparent;
}
.day-menu-option {
    flex: 1 1 0;
    min-width: 270px;
    min-height: 172px;
    display: flex;
    flex-direction: column;
    padding: 14px;
    border: 1px solid #d9e6dd;
    border-radius: 10px;
    background: linear-gradient(180deg, #fff 0%, #fbfdfb 100%);
}
.day-menu-option-head { min-width: 0; margin-bottom: 10px; }
.day-menu-option-head .day-menu-label { display: block; margin: 0 0 3px; }
.day-menu-name {
    display: block;
    overflow: hidden;
    color: #174d31;
    font-size: 16px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.day-menu-option-body { display: flex; align-items: flex-start; gap: 12px; min-width: 0; flex: 1; }
.day-menu-thumb {
    width: 96px;
    height: 82px;
    flex: 0 0 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #e1e9e3;
    border-radius: 7px;
    background: #f4f8f5;
}
.day-menu-thumb img { width: 100%; height: 100%; object-fit: cover; }
.day-menu-thumb .thumb-placeholder { color: #93a49a; font-size: 10px; text-align: center; }
.day-menu-thumb .thumb-placeholder svg { display: block; margin: 0 auto 3px; }
.day-menu-option .day-dish-list {
    flex: 1;
    min-width: 0;
    max-height: 86px;
    overflow: auto;
    margin: 0;
    padding: 0;
    list-style: none;
}
.day-menu-option .day-dish-list li {
    overflow: hidden;
    color: #4d5d53;
    font-size: 13px;
    line-height: 1.6;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.day-menu-option .day-dish-list .lbl { color: #7b8a81; }
.day-menu-option-foot { margin-top: 10px; min-height: 20px; text-align: right; }
.day-menu-price { color: var(--dark); font-size: 13px; font-weight: 700; }
.menu-detail-table .price-source {
    color: #77877c;
    font-size: 10px;
    font-weight: 400;
    white-space: nowrap;
}
.day-card.list-layout .empty-menu { height: auto; min-height: 92px; gap: 12px; }

.menu-panel > .section-head {
    align-items: center;
    gap: 20px;
    padding-bottom: 17px;
    border-bottom: 1px solid #edf2ee;
}
.menu-panel > .section-head h2 { margin-bottom: 7px; }
.optional-label { color: #7a897f; font-size: 12px; font-weight: 400; }
button > .button-icon { margin-right: 7px; font-size: 13px; pointer-events: none; }
.page-actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    padding: 18px 16px 24px;
}
.page-actions .btn { min-width: 120px; }
.revoke-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    vertical-align: middle;
    background: url('/images/revoke.svg?v=1') center / contain no-repeat;
    pointer-events: none;
}
.warning-text.error { background: #fdecec; color: #a32222; }
.row-total.price-over-limit td {
    background: #fff0f0;
    color: #b42318;
    font-weight: 700;
}

@media (max-width: 700px) {
    .modal { padding: 8px; }
    #modalSelectMenu .modal-box { max-height: calc(100dvh - 16px); padding: 14px; }
    #modalSelectMenu .menu-editor-grid { flex-direction: column; }
    #modalSelectMenu .menu-editor-list {
        width: 100%;
        max-height: 150px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
    #modalSelectMenu .menu-editor-detail-head { flex-wrap: wrap; }
    #modalSelectMenu .menu-detail-wrap { padding: 8px; overflow: auto; }
    #modalSelectMenu .menu-detail-table { min-width: 760px; }
    #modalSelectMenu .detail-actions { flex-wrap: wrap; }

    .toast {
        top: auto;
        right: auto;
        bottom: 20px;
        left: 50%;
        transform: translate(-50%, 12px);
    }
    .toast.show { transform: translate(-50%, 0); }

    .menu-panel > .section-head { align-items: stretch; flex-direction: column; }
    .menu-panel > .section-head .btn { width: 100%; }
    .day-card.list-layout { grid-template-columns: 1fr; }
    .day-card.list-layout .day-date-col {
        min-height: 0;
        flex-direction: row;
        justify-content: space-between;
        padding: 12px 16px;
        border-right: 0;
        border-bottom: 1px solid #dce8df;
        text-align: left;
    }
    .day-card.list-layout .day-date-col .day-label { margin: 0; }
    .day-menus-wrap { padding: 12px 14px 14px; }
    .day-menu-option { flex: 0 0 280px; min-width: 280px; }
    .page-actions { flex-wrap: wrap; }
    .page-actions .btn { flex: 1 1 140px; }
}

/* Chi tiết gọn: ưu tiên vùng chọn ngày và vùng nhập món. */
#detailPage .topbar { padding: 14px 20px; }
#detailPage .page-main { padding: 12px 16px; }
#detailPage .overview-section { margin-bottom: 12px; }
#detailPage .overview-section > summary {
    cursor: pointer; padding: 10px 14px; color: var(--dark); font-weight: 600;
    border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
#detailPage .overview-section > summary span { float: right; font-size: 12px; color: #66786d; font-weight: 400; }
#detailPage .overview-section[open] > summary { margin-bottom: 8px; }
#detailPage .overview-grid { grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr); }
#detailPage .overview-grid .panel { padding: 14px; margin-bottom: 0; }
#detailPage .overview-grid h2 { font-size: 15px; margin-bottom: 12px; }
#detailPage .form-grid { gap: 10px 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
#detailPage .field { min-width: 0; gap: 4px; }
#detailPage .field input, #detailPage .field select { min-height: 36px; padding: 7px 10px; }
#detailPage .field textarea { min-height: 38px; height: 38px; resize: vertical; }
#detailPage .field input:focus, #detailPage .field select:focus, #detailPage .field textarea:focus {
    outline: 2px solid #98cfad; outline-offset: 1px; border-color: var(--green);
}
#detailPage .menu-panel { padding: 14px; }
#detailPage .menu-panel > .section-head { padding-bottom: 10px; gap: 12px; }
#detailPage .menu-panel > .section-head h2 { font-size: 17px; margin-bottom: 4px; }
#detailPage .btn { min-width: auto; padding: 8px 12px; }
#detailPage .day-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 0; }
#detailPage .day-paging { display: flex; align-items: center; gap: 12px; }
#detailPage .day-paging .btn { min-width: 36px; font-size: 20px; padding: 2px 10px; }
#dayPageInfo { color: #526459; font-size: 13px; font-variant-numeric: tabular-nums; }
#detailPage .compact-days #dayCards { gap: 8px; margin-top: 10px; }
#detailPage .compact-days .day-card { grid-template-columns: 86px minmax(0, 1fr); box-shadow: none; }
#detailPage .compact-days .day-date-col { padding: 12px 8px; }
#detailPage .compact-days .day-date { font-size: 17px; }
#detailPage .compact-days .day-menus-wrap { padding: 8px 10px; }
#detailPage .compact-days .day-menus-head { min-height: 28px; margin-bottom: 5px; }
#detailPage .compact-days .day-actions { gap: 6px; }
#detailPage .compact-days .day-actions .btn-icon { width: 30px; height: 30px; }
#detailPage .compact-days .day-menu-row { gap: 8px; padding-bottom: 3px; }
#detailPage .compact-days .day-menu-option { min-height: 0; min-width: 210px; padding: 8px 10px; border-radius: 6px; }
#detailPage .compact-days .day-menu-option-head { margin-bottom: 4px; }
#detailPage .compact-days .day-menu-name { font-size: 14px; white-space: normal; overflow-wrap: anywhere; }
#detailPage .compact-days .day-menu-label { font-size: 11px; }
#detailPage .compact-days .day-menu-thumb { display: none; }
#detailPage .compact-days .day-dish-list { max-height: none; overflow: visible; }
#detailPage .compact-days .day-dish-list li { display: inline; white-space: normal; line-height: 1.5; font-size: 12px; }
#detailPage .compact-days .day-dish-list li + li::before { content: ' · '; color: #91a398; }
#detailPage .compact-days .day-dish-list .lbl { display: none; }
#detailPage .compact-days .day-menu-option-foot { margin-top: 5px; min-height: 0; }
#detailPage .compact-days .empty-menu { min-height: 40px; flex-direction: row; justify-content: flex-start; }
#detailPage .page-actions {
    position: sticky; bottom: 0; z-index: 20; padding: 10px 16px;
    background: #fff; border-top: 1px solid var(--border); box-shadow: 0 -3px 12px #163d2510;
}
#modalSelectMenu .modal-box { width: min(1400px, 96vw); max-width: 1400px; height: min(820px, calc(100dvh - 24px)); padding: 14px; }
#modalSelectMenu .modal-body { padding: 10px 0; }
#modalSelectMenu .menu-editor-list { width: 180px; flex-shrink: 0; }
#modalSelectMenu .menu-editor-detail-head { padding: 8px 12px; flex-wrap: wrap; }
#modalSelectMenu .menu-detail-wrap { padding: 0; min-height: 100px; overflow: auto; }
#modalSelectMenu .menu-detail-table { table-layout: fixed; width: 100%; min-width: 690px; margin: 0; }
#modalSelectMenu .menu-detail-table th:nth-child(1) { width: 40px; }
#modalSelectMenu .menu-detail-table th:nth-child(2) { width: 110px; }
#modalSelectMenu .menu-detail-table th:nth-child(4),
#modalSelectMenu .menu-detail-table th:nth-child(5) { width: 110px; }
#modalSelectMenu .menu-detail-table th:nth-child(6) { width: 125px; }
#modalSelectMenu .menu-detail-table thead th { position: sticky; top: 0; z-index: 2; background: #edf6f0; color: var(--dark); padding: 9px 8px; }
#modalSelectMenu .menu-detail-table td { padding: 7px 8px; vertical-align: middle; }
#modalSelectMenu .menu-detail-table tr:focus-within > td { background: #eef8f1; }
#modalSelectMenu .field-input { min-height: 36px; border-color: #b8cbbf; background: #fff; }
#modalSelectMenu input[type=number] { text-align: right; font-variant-numeric: tabular-nums; }
#modalSelectMenu .field-input:focus { outline: 2px solid #8bcca3; outline-offset: 1px; border-color: var(--green); }
#modalSelectMenu .field-input:disabled { color: #59685f; background: #f1f4f2; border-color: #e2e8e4; }
#modalSelectMenu .detail-actions { flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
#modalSelectMenu .modal-footer { padding-top: 10px; margin-top: 0; }
#modalSelectMenu .select2-container { max-width: 100%; }
@media (max-width: 1100px) {
    #detailPage .overview-grid { grid-template-columns: minmax(0, 1fr); }
    #detailPage .overview-grid aside { grid-template-columns: 1fr 1fr; }
    #detailPage .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    #modalSelectMenu .menu-editor-list { width: 150px; }
}
@media (max-width: 700px) {
    #detailPage .page-main { padding: 8px; }
    #detailPage .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #detailPage .form-grid .field:nth-child(2) { grid-column: 1 / -1; }
    #detailPage .overview-grid aside { grid-template-columns: 1fr; }
    #detailPage .day-toolbar { flex-wrap: wrap; }
    #detailPage .compact-days .day-card { grid-template-columns: minmax(0, 1fr); }
    #detailPage .compact-days .day-date-col { flex-direction: row; padding: 8px 10px; }
    #detailPage .compact-days .day-menu-option { flex: 0 0 230px; }
    #modalSelectMenu .modal-box { width: 100%; padding: 8px; }
    #modalSelectMenu .menu-editor-list { width: 100%; max-height: 100px; flex: 0 0 auto; }
    #modalSelectMenu .list-hint { display: none; }
    #modalSelectMenu .thucdon-list { display: flex; overflow-x: auto; }
    #modalSelectMenu .thucdon-list li { flex-shrink: 0; }
    #detailPage .overview-section > summary span { display: none; }
}
#modalSelectMenu .qty-input { align-items: center; gap: 6px; }
#modalSelectMenu .qty-input .field-input { min-width: 0; }
#modalSelectMenu .quantity-unit { flex: 0 0 auto; color: #687b6f; font-size: 11px; line-height: 1; }
