/* Shared Gayatri interface: leaf green, slate text, white surfaces and saffron actions. */
:root{--green:#176747;--green-dark:#104c35;--green-light:#edf6f1;--orange:#bd571a;--orange-dark:#974215;--gray-900:#20332b;--radius:14px;--shadow:0 4px 20px #183d2b09;--top-nav-height:68px}
body{background:#f3f6f5;color:var(--gray-900);font-family:"Segoe UI",Arial,sans-serif;line-height:1.5}
h1,h2,.page-title,.section-label,.brand-name{font-family:"Trebuchet MS","Segoe UI",sans-serif;letter-spacing:-.025em}
.top-nav{min-height:68px;padding:10px 28px;box-shadow:0 2px 15px #102e2220}
.brand-logo{max-height:44px;object-fit:contain;border-radius:8px}.brand small{letter-spacing:.13em;font-size:9px}
.main{padding:28px}.page-title{font-size:clamp(24px,2.5vw,34px);line-height:1.2;margin-bottom:10px}
.card{border:1px solid #dfe8e2;border-radius:16px;box-shadow:var(--shadow)}
.section-label{font-size:18px;color:var(--green-dark);margin-bottom:12px}
.btn{min-height:40px;border-radius:9px;font-weight:600;transition:background .16s,box-shadow .16s}
.btn:hover{box-shadow:0 3px 9px #163c221c}.btn:disabled{cursor:not-allowed;opacity:.55}
input:not([type=checkbox]):not([type=radio]),select,textarea{border-radius:8px;border-color:#cbd9d0}
input[type=checkbox],input[type=radio]{width:18px;height:18px;accent-color:var(--green);flex-shrink:0;cursor:pointer}
:is(a,button,input,select,textarea,summary):focus-visible{outline:3px solid #ca8b24;outline-offset:3px}
.data-table-card,.review-table-wrap{overflow-x:auto;border-radius:12px;border:1px solid #dfe8e2}
table th{background:#f1f6f3;color:#456353;font-weight:650;font-size:12px;letter-spacing:.025em}
table td,table th{padding:13px 16px}tbody tr:hover{background:#f7faf8}
.order-card{padding:28px}.order-layout{gap:26px}.order-steps{border-radius:14px;background:#fff;border:1px solid #dfe8e2;padding:16px}
.wizard-step.active .wizard-step-num{background:var(--green);box-shadow:0 0 0 5px var(--green-light)}
.meal-period-first{padding:22px;background:var(--green-light);border-left:4px solid var(--green);border-radius:10px;margin-bottom:24px}
.meal-period-first>label{display:block;font-weight:700;font-size:19px}.meal-period-first p{margin:4px 0 14px}.meal-period-first select{max-width:440px;min-height:48px;background:white}
.pkg-card,.preset-card{border-radius:14px;box-shadow:none;overflow:hidden}.pkg-card:hover,.preset-card:hover{border-color:var(--green);box-shadow:var(--shadow)}
.pkg-name,.preset-name{font-size:19px;line-height:1.4;text-transform:none;letter-spacing:0}
.included-quantity-note{padding:16px;background:var(--green-light);border-radius:10px;margin-bottom:18px;color:var(--green-dark)}
.combined-utensils-section>.actions{margin-bottom:18px;flex-wrap:wrap}.charge-detail{display:block;color:#607768;font-size:11px}
.fixed-menu-row{padding:16px;border:1px solid #dce7df;border-radius:10px;margin:8px 0;background:#fff;align-items:center}
.fixed-menu-row:has(input[type=checkbox]:checked){background:#f2f9f4;border-color:#81b397}
.fixed-menu-name{font-weight:650;display:flex;gap:10px;align-items:center;flex-wrap:wrap}.fixed-menu-check-wrap{padding:10px}
.menu-select-with-type:has(.menu-option-card){display:flex;flex-wrap:wrap;gap:8px;align-items:stretch;padding:0}
.menu-option-card{display:flex;align-items:center;gap:10px;cursor:pointer;border:1px solid #cad9cf;padding:12px 14px;border-radius:10px;background:#fff;min-width:180px;flex:1}
.menu-option-card:has(input:checked){border-color:var(--green);background:var(--green-light)}
.review-top{display:grid;grid-template-columns:150px minmax(0,1fr);gap:28px;align-items:start;padding:24px 0;border-bottom:2px solid var(--green)}
.review-logo{max-width:150px;max-height:100px;width:100%;object-fit:contain}.review-title{font-size:23px;margin-bottom:8px}
.review-contact{display:flex;align-items:flex-start;gap:10px;margin-top:7px;font-size:13px;line-height:1.6;overflow-wrap:anywhere;text-align:left}
.review-contact i{color:var(--green);width:18px;padding-top:4px;flex-shrink:0}.review-line{text-align:left!important;line-height:1.6}
.contact-svg{width:18px;height:18px;flex:0 0 18px;color:var(--green);margin-top:3px}
.order-main,#orderStepWrap,#orderStepContent,.review-sheet,.review-section{min-width:0;max-width:100%}
.page-header>div:first-child{min-width:0}.page-subtitle{white-space:normal;overflow-wrap:anywhere}
.review-section{margin-top:22px}.review-details-grid{gap:24px}.review-sheet{padding:28px;border-radius:16px}
.pdf-hero{border-radius:20px;min-height:430px;padding:48px}.pdf-hero h1{max-width:700px;font-size:clamp(32px,4vw,52px);line-height:1.08}
.pdf-hero p{max-width:740px;line-height:1.8}.pdf-section{padding:38px 28px;margin-top:26px;border:1px solid #e1e9e3;border-radius:18px;background:#fff}
.pdf-section.peach{background:#f1f6f3}.pdf-item{border:1px solid #e1e9e3;border-radius:14px;overflow:hidden;background:#fff;box-shadow:none}.pdf-item img{aspect-ratio:4/3;object-fit:cover}
.home-hall-section{border-radius:18px}.app-footer{border-top:1px solid #d7e4da}.footer-contact{line-height:1.7}
.portal-content-settings{margin:24px 0;padding:26px}.portal-content-settings>p{margin-bottom:20px}.content-mapping{border:1px solid #dfe8e2;border-radius:10px;margin:14px 0}
.content-mapping summary{cursor:pointer;padding:16px;font-weight:650;background:#f4f8f5}.content-image-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:18px;padding:18px}
.content-image-field{display:flex;flex-direction:column;gap:8px;font-weight:600}.content-image-field img{height:100px;max-width:100%;object-fit:contain;background:#f4f7f4;border-radius:8px}.content-image-field input{width:100%;font-weight:400}
.content-mapping-list{max-height:440px;overflow:auto;padding:18px}.content-mapping fieldset{padding:14px;margin-bottom:14px;border:1px solid #dce6df;border-radius:8px}.content-mapping legend{padding:0 6px;font-weight:600;font-size:14px}
.meal-checkboxes{display:flex;gap:18px;flex-wrap:wrap}.meal-checkboxes label{display:flex;gap:8px;align-items:center}.portal-content-settings [role=status]{margin:12px 0;color:var(--green-dark)}
@media(max-width:900px){.main{padding:18px}.top-nav{padding:10px 16px}.order-layout{display:flex;flex-direction:column}.order-summary-box{position:static;width:100%}.order-card{padding:20px}.wizard-step-label{font-size:11px}.pdf-hero{padding:28px}.review-top{grid-template-columns:110px minmax(0,1fr);gap:18px}}
@media(max-width:600px){.main{padding:12px}.order-steps{padding:12px 6px;gap:6px}.order-card,.review-sheet{padding:16px}.review-top{grid-template-columns:1fr}.review-logo{max-height:70px;width:auto}.fixed-menu-row{grid-template-columns:36px minmax(0,1fr)}.fixed-menu-qty-cell,.fixed-menu-notes-cell{grid-column:2}.pdf-hero{padding:24px}.pdf-section{padding:24px 16px}.nav-profile-meta{max-width:120px}.content-image-grid{grid-template-columns:1fr}.menu-option-card{min-width:100%}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
@media print{.review-top{break-inside:avoid}.review-sheet{box-shadow:none;border:0}.review-contact{color:#222}}
@media(max-width:900px){
 body.customer-mode[data-page="order"] .order-layout{display:block;width:100%;min-width:0}
 body.customer-mode[data-page="order"] .order-main{width:100%;min-width:0;padding-right:0}
 body.customer-mode[data-page="order"] .order-summary-box{position:static;width:100%;margin-top:22px;max-height:none}
 body.customer-mode[data-page="order"] .order-steps{grid-template-columns:repeat(4,minmax(0,1fr));width:100%;min-width:0}
 body.customer-mode[data-page="order"] .wizard-step{grid-column:auto;min-width:0;display:flex;flex-direction:column;gap:6px}
 body.customer-mode[data-page="order"] .wizard-step-label{display:block;font-size:10px;text-align:center;line-height:1.3}
 .review-sheet.report-review .review-split{grid-template-columns:minmax(0,1fr)}
 .review-sheet.report-review .review-quote-meta{flex-wrap:wrap;justify-content:flex-start;gap:8px}
 .review-sheet.report-review .review-top{grid-template-columns:minmax(0,1fr)}
 .review-sheet.report-review .review-line .review-title{font-size:26px;overflow-wrap:anywhere}
 .review-sheet.report-review .review-logo{width:130px;max-height:90px}
 .review-table-wrap{display:block;max-width:100%}
 .top-nav{flex-wrap:nowrap;gap:12px}.top-nav .brand{min-width:0;flex:1}.brand-name{font-size:15px}.brand small{font-size:8px}
 .nav-user{margin-left:auto}.top-nav .brand-logo{max-width:50px}
}

/* ---- Customer navigation, quick contact & confirmation (portal UX pass) ---- */
.nav-link.active{background:rgba(255,255,255,.20);border-color:rgba(255,255,255,.38);font-weight:600}
.nav-link-cta,.nav-link-cta.active{background:var(--orange,#e8681a);border-color:transparent;font-weight:600}
.nav-link-cta:hover,.nav-link-cta.active:hover{background:#cf5a12}
.nav-toggle{display:none;padding:8px 10px;border-radius:8px;background:rgba(255,255,255,.12);color:#fff;
    border:1px solid rgba(255,255,255,.28);line-height:1}

.quick-contact{position:fixed;right:16px;bottom:18px;z-index:1200;display:flex;flex-direction:column;gap:10px}
.quick-contact-btn{display:inline-flex;align-items:center;gap:8px;padding:12px 16px;border-radius:999px;color:#fff;
    text-decoration:none;font-weight:600;font-size:.92rem;box-shadow:0 8px 20px rgba(0,0,0,.22);transition:transform .18s,box-shadow .18s}
.quick-contact-btn:hover{transform:translateY(-2px);box-shadow:0 12px 26px rgba(0,0,0,.28);color:#fff;text-decoration:none}
.quick-contact-btn:focus-visible{outline:2px solid #fff;outline-offset:2px}
.quick-contact-btn i{font-size:1.15rem}
.quick-contact-whatsapp{background:#25d366}
.quick-contact-call{background:#e8681a}
@media(max-width:600px){
    .quick-contact{right:12px;bottom:12px}
    .quick-contact-btn{padding:13px;border-radius:50%}
    .quick-contact-label{display:none}
}
@media print{.quick-contact{display:none}}

/* Below 900px the bar has no room for six links, so they collapse into a panel
   that drops out of the nav grid entirely and overlays the page instead. */
@media(max-width:900px){
    body.customer-mode .top-nav{position:sticky}
    body.customer-mode .nav-toggle{display:inline-flex;justify-self:end;align-self:center}
    body.customer-mode .nav-links{display:none;position:absolute;top:100%;left:0;right:0;
        flex-direction:column;align-items:stretch;gap:6px;margin:0;padding:12px 16px;
        background:var(--green-dark,#1f3d2b);box-shadow:0 10px 22px rgba(0,0,0,.22);z-index:199}
    body.customer-mode .nav-links.open{display:flex}
    body.customer-mode .nav-link{text-align:center;padding:11px 12px}
}
@media(max-width:520px){
    body.customer-mode .nav-toggle{grid-area:center}
}

/* ---- Back to top ---- */
.back-to-top{position:fixed;left:18px;bottom:18px;z-index:1200;width:46px;height:46px;border-radius:50%;
    border:1px solid #d3e2d9;background:rgba(255,255,255,.95);color:var(--green-dark,#14532d);cursor:pointer;
    display:grid;place-items:center;box-shadow:0 8px 20px rgba(20,74,43,.18);transition:transform .18s,box-shadow .18s}
.back-to-top svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.back-to-top:hover{transform:translateY(-2px);box-shadow:0 12px 26px rgba(20,74,43,.24)}
.back-to-top:focus-visible{outline:2px solid var(--green,#238048);outline-offset:2px}
.back-to-top[hidden]{display:none}
@media(max-width:600px){.back-to-top{left:12px;bottom:12px;width:42px;height:42px}}
@media print{.back-to-top{display:none}}

/* Ghost CTA used inside the dark page heroes (menu, packages). */
.btn-hero-ghost{background:rgba(255,255,255,.12);color:#fff;border:1px solid rgba(255,255,255,.42)}
.btn-hero-ghost:hover,.btn-hero-ghost:focus{background:rgba(255,255,255,.22);color:#fff;text-decoration:none}
.btn-hero-ghost:focus-visible{outline:2px solid #fff;outline-offset:2px}

/* ---- Customer footer: end of page, not a fixed bar ----
   The top navigation is sticky and always reachable, so a fixed footer
   repeating the same links only duplicated it and took ~64px off every
   screen. On customer pages the footer now sits at the end of the content. */
body.customer-mode{--app-footer-height:0px}
body.customer-mode .app-footer{position:relative;z-index:100;height:auto;margin-top:32px;
    padding:22px 24px;box-shadow:none}
body.customer-mode .app-footer .footer-content{align-items:center}
@media(max-width:760px){
    body.customer-mode .app-footer{height:auto;padding:18px 16px}
}
/* At the end of the page the fixed back-to-top (left) and WhatsApp/Call
   buttons (right) sit over the footer, so keep its text clear of them. */
body.customer-mode .app-footer{padding-left:84px;padding-right:190px}
body[data-page="order"].customer-mode .app-footer{padding-left:190px;padding-right:24px}
@media(max-width:760px){
    body.customer-mode .app-footer,
    body[data-page="order"].customer-mode .app-footer{padding:18px 76px 18px 64px}
}

/* Admin audit: constrain column-flex children so wide tables scroll inside cards. */
@media(max-width:900px){
 body.admin-mode .main{width:100%;min-width:0;box-sizing:border-box;margin:0}
 body.admin-mode .panel-actions{min-width:0;max-width:100%;flex-wrap:wrap}
 body.admin-mode .app-header-filter{min-width:0;max-width:100%;flex-wrap:wrap}
 body.admin-mode .app-header-filter input,body.admin-mode .app-header-filter select{min-width:0;max-width:100%;box-sizing:border-box}
 body.admin-mode .page-header-actions{max-width:100%;flex-wrap:wrap}
 body.admin-mode .table-wrap,body.admin-mode .tbl-wrap{width:100%;min-width:0;overflow-x:auto}
}
@media(max-width:600px){
 body.admin-mode .panel-actions>.app-header-filter{flex-basis:100%;width:100%}
 body.admin-mode .app-header-filter .tbl-search{width:100%}
 body.admin-mode .form-row{grid-template-columns:minmax(0,1fr)!important}
}

@media(max-width:600px){body.admin-mode .top-nav{overflow-x:clip}}
.home-slide-editor{min-width:0}.home-slide-editor label{display:block;margin:8px 0}.home-slide-editor input:not([type=checkbox]){width:100%}.slide-actions{display:flex;gap:6px;flex-wrap:wrap}.content-mapping>p,.content-mapping>#addHomeSlide{margin:14px}.home-slide-editor img{width:100%;height:120px;object-fit:cover}.home-slide-editor legend{font-weight:700;color:#14533e}

/* The admin footer email link kept the browser blue on the dark band. */
body.admin-mode .app-footer a{color:#e7f0ea;text-decoration:underline;text-underline-offset:3px}
body.admin-mode .app-footer a:hover{color:#f6b27c}

/* ---------------------------------------------------------------------------
   Admin density pass. Staff screens are lists, and the old spacing spent the
   top quarter of the screen on a title and gave each 12px row 50px of height,
   so only ten records were ever in view. Type sizes stay readable; the empty
   space around them is what goes.
   ------------------------------------------------------------------------- */
body.admin-mode .main { padding: 14px 18px 8px; }
body.admin-mode .page-header { margin-bottom: 8px; gap: 10px; }
body.admin-mode .page-title { font-size: 21px; line-height: 1.15; margin-bottom: 1px; }
body.admin-mode .page-subtitle { font-size: 12.5px; line-height: 1.35; margin: 0; }

/* Card and panel headings above a table. */
body.admin-mode :is(.card, .panel, .table-wrap, .tbl-wrap) > :is(.card-head, .panel-head, .card-header, .panel-header) { padding: 10px 14px; }
body.admin-mode :is(.card-title, .panel-title, .card-head h2, .panel-head h2, .card-head h3, .panel-head h3) { font-size: 15px; margin: 0; }
body.admin-mode .card + .card, body.admin-mode .panel + .panel { margin-top: 12px; }

/* The rows themselves: this is where the screen is won. */
body.admin-mode .tbl th { padding: 6px 12px; font-size: 11px; }
body.admin-mode .tbl td { padding: 5px 12px; font-size: 13px; line-height: 1.35; }
body.admin-mode .tbl td .btn, body.admin-mode .tbl td .row-actions .btn { padding: 3px 8px; font-size: 12px; min-height: 0; }
body.admin-mode .tbl td :is(.badge, .status-pill, .chip) { padding: 2px 8px; font-size: 11px; }
body.admin-mode .datatable-footer { padding: 8px 12px; font-size: 12.5px; }

/* Left menu: twenty-four entries that used to need scrolling. */
body.admin-mode .sidebar-item { padding: 6px 12px; font-size: 12.5px; gap: 8px; }
body.admin-mode .sidebar-item .icon { font-size: 14px; width: 18px; }
body.admin-mode .sidebar-section { padding: 10px 12px 4px; font-size: 10.5px; }

/* Filter bars and the order board. */
body.admin-mode .app-header-filter { gap: 8px; font-size: 12.5px; }
body.admin-mode .app-header-filter :is(input, select) { padding: 5px 9px; font-size: 12.5px; min-height: 0; }
body.admin-mode :is(.kanban-column, .board-column, .order-stage) { min-height: 0; }
body.admin-mode :is(.kanban-column, .board-column, .order-stage) :is(.empty, .muted, .empty-state) { padding: 10px 12px; font-size: 12.5px; }

/* The row action button was 36px tall and set the height of every row. */
body.admin-mode .tbl td .row-actions { gap: 4px; }
body.admin-mode .tbl td .row-actions > * { min-height: 0; height: auto; padding: 3px 8px; font-size: 12px; line-height: 1.3; }
body.admin-mode .tbl td :is(.badge-pill, .badge, .status-pill) { padding: 2px 9px; font-size: 11px; line-height: 1.5; }

/* Dashboard tiles were 164px tall for a single number, so nine of them filled
   the screen before any list appeared. */
body.admin-mode .stats-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
body.admin-mode .stat-card { padding: 11px 14px; border-radius: 12px; border-top-width: 4px; }
body.admin-mode .stat-value { font-size: 24px; line-height: 1.15; }
body.admin-mode .stat-label { font-size: 12px; letter-spacing: .04em; }
body.admin-mode .stat-sub { font-size: 11.5px; line-height: 1.35; min-height: 0; }
body.admin-mode :is(.kpi-grid, .dashboard-skeleton-kpis) { gap: 10px; margin-bottom: 12px; }
body.admin-mode .dashboard-section, body.admin-mode .alerts-section { margin-top: 12px; }
body.admin-mode .stat-card { min-height: 0; }
body.admin-mode .stat-value { margin-bottom: 4px; }
body.admin-mode .stat-sub { margin-top: 3px; min-height: 0; }

/* Order board: a column held 400px of nothing when its stage was empty, and
   each order card reserved 180px whatever it contained. */
body.admin-mode .orders-board-column { min-height: 150px; padding: 10px; }
body.admin-mode .orders-board-card { min-height: 0; padding: 9px 10px; gap: 5px; }
body.admin-mode .orders-board-column > .muted { padding: 6px 2px; font-size: 12.5px; }

/* ---------------------------------------------------------------------------
   Admin lists: a fixed table viewport. The column header used to scroll away
   after a dozen rows (the wrapper's overflow broke position:sticky), so on a
   long list you could no longer tell which column you were reading. The table
   body now scrolls inside the card with the header pinned above it, and the
   pagination stays put at the bottom.
   ------------------------------------------------------------------------- */
/* The table fills whatever is left between the toolbar and the footer. An
   earlier version guessed that height in JavaScript, which squeezed the rows
   into a short box while the page itself still scrolled and left a strip of
   empty space under the footer. The shell is now the viewport, and the table
   is the only thing that scrolls. */
body.admin-mode :is(.table-wrap, .tbl-wrap) {
    flex: 1 1 auto;
    min-height: 120px;
    overflow: auto;
    overscroll-behavior: contain;
}
body.admin-mode :is(.table-wrap, .tbl-wrap) .tbl thead th {
    position: sticky;
    top: 0;
    z-index: 3;
}

/* Reading a wide row across the screen needs a guide for the eye. */
body.admin-mode .tbl tbody tr:nth-child(even) { background: #fbfdfc; }
body.admin-mode .tbl tbody tr:hover { background: #eef7f1; }
body.admin-mode .tbl tbody tr:hover td { border-bottom-color: #cfe6d8; }

/* Thin scrollbars so the table viewport does not gain a chunky grey bar. */
body.admin-mode :is(.table-wrap, .tbl-wrap, .sidebar) { scrollbar-width: thin; scrollbar-color: #c3d6ca transparent; }
body.admin-mode :is(.table-wrap, .tbl-wrap, .sidebar)::-webkit-scrollbar { width: 9px; height: 9px; }
body.admin-mode :is(.table-wrap, .tbl-wrap, .sidebar)::-webkit-scrollbar-thumb { background: #c3d6ca; border-radius: 6px; }
body.admin-mode :is(.table-wrap, .tbl-wrap, .sidebar)::-webkit-scrollbar-track { background: transparent; }

/* On a phone, a tablet or a short window the page should scroll as one piece
   rather than trapping rows in a small box. */
@media (max-width: 1024px), (max-height: 620px) {
    body.admin-mode :is(.table-wrap, .tbl-wrap) { max-height: none; min-height: 0; overflow: auto visible; }
}

/* The pagination lives inside the scrolling table, so it used to scroll out of
   reach on a long list. Pinned to the bottom of the table viewport instead. */
body.admin-mode :is(.table-wrap, .tbl-wrap) .datatable-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-top: 0;
    padding: 7px 12px;
    background: #fff;
    border-top: 1px solid #e3ece6;
    box-shadow: 0 -4px 10px rgba(15, 23, 42, .045);
}

/* Board cards: the amount panel and its gaps made each order 260px tall, so a
   stage showed two and a half orders at a time. */
body.admin-mode .orders-board-cards { gap: 6px; }
body.admin-mode .orders-board-card-amounts { margin-top: 2px; gap: 4px; padding: 6px 8px; }
body.admin-mode .orders-board-card-balance { padding-bottom: 4px; }
body.admin-mode .orders-board-card-meta { margin-top: 2px; }
body.admin-mode .orders-board-card .btn { padding: 5px 10px; font-size: 12px; min-height: 0; }

/* Everything stacked above a list — page header, tab strip, toolbar — used to
   take 327px before the first row on a laptop screen. */
body.admin-mode .orders-tab-strip { padding: 4px; gap: 4px; margin-bottom: 8px; }
body.admin-mode .orders-tab-btn { padding: 6px 14px; font-size: 13px; min-height: 0; }
body.admin-mode .orders-tab-icon { font-size: 14px; }
body.admin-mode :is(.panel-header, .card-head, .card-header) { padding: 8px 14px; gap: 8px; }
body.admin-mode .panel-title { font-size: 15px; }
body.admin-mode :is(.orders-view-strip, .view-toggle) { padding: 3px; }
body.admin-mode :is(.orders-view-btn, .view-toggle button) { padding: 5px 12px; font-size: 13px; min-height: 0; }
body.admin-mode .panel-header :is(input, select, .btn) { min-height: 0; padding: 6px 12px; font-size: 13px; }
body.admin-mode .app-header-filter label { font-size: 12px; }
body.admin-mode .card { margin-top: 8px; }

/* Order list rows carry three lines per cell; they do not need extra leading. */
body.admin-mode #ordersListPanel .tbl td { padding: 4px 10px; line-height: 1.3; }
body.admin-mode #ordersListPanel .tbl td :is(small, .muted, .sub, .table-sub) { font-size: 11.5px; line-height: 1.3; }

/* Title and filters share one line where they fit, instead of the filters
   wrapping onto a second row and costing another 40px of the list. */
body.admin-mode .page-header { align-items: center; row-gap: 6px; }
body.admin-mode .page-header-actions { gap: 8px; }
body.admin-mode .app-header-filter { gap: 5px; }
body.admin-mode .app-header-filter :is(input, select) { padding: 4px 8px; font-size: 12.5px; }
body.admin-mode .app-header-filter label { font-size: 11.5px; white-space: nowrap; }

/* ---------------------------------------------------------------------------
   Short screens (a laptop, or any window at 125-175% browser zoom). Every
   pixel above the table costs a row, and at this height the page had room for
   three. The descriptive lines go; the controls stay.
   ------------------------------------------------------------------------- */
@media (max-height: 780px) {
    body.admin-mode .main { padding: 8px 14px 6px; }
    body.admin-mode .page-subtitle { display: none; }
    body.admin-mode .page-title { font-size: 18px; }
    body.admin-mode .page-header { margin-bottom: 4px; }
    body.admin-mode .card { margin-top: 4px; }

    /* "Manage Orders" repeats the page title directly above it. */
    body.admin-mode .panel-title { display: none; }
    body.admin-mode :is(.panel-header, .card-head, .card-header) { padding: 6px 10px; }
    body.admin-mode .orders-tab-strip { padding: 3px; margin-bottom: 4px; }
    body.admin-mode .orders-tab-btn { padding: 4px 12px; font-size: 12.5px; }
    body.admin-mode .tbl td { padding: 3px 10px; }
    body.admin-mode .tbl th { padding: 4px 10px; }
    body.admin-mode #ordersListPanel .tbl td { padding: 3px 10px; line-height: 1.25; }
    body.admin-mode .datatable-footer { padding: 5px 10px; font-size: 12px; }
    body.admin-mode .app-footer { padding: 6px 14px; font-size: 12px; }
    body.admin-mode .app-footer :is(.footer-contact, .footer-address, address) { display: none; }
}

@media (max-height: 780px) {
    /* Title and the filter row share one line; the filters shrink rather than
       wrap, because a wrapped filter row costs a whole record. */
    body.admin-mode .page-header { flex-wrap: nowrap; gap: 10px; }
    body.admin-mode .page-header > div:first-child { flex: 0 0 auto; }
    body.admin-mode .page-header-actions { flex: 1 1 auto; min-width: 0; flex-wrap: wrap; row-gap: 4px; }
    body.admin-mode .app-header-filter { gap: 4px; }
    body.admin-mode .app-header-filter :is(input, select) { padding: 3px 7px; font-size: 12px; }
    body.admin-mode .app-header-filter label { font-size: 11px; }
    body.admin-mode .orders-tab-strip { margin-bottom: 2px; }
    body.admin-mode .orders-tab-btn { padding: 3px 11px; font-size: 12px; }
    body.admin-mode .orders-tab-icon { display: none; }
    body.admin-mode .card > :first-child { margin-top: 0; }
    body.admin-mode #ordersListPanel > :first-child { padding-top: 6px; }
}

@media (max-height: 780px) {
    /* The orders list carries a tab strip and a toolbar that the master lists
       do not, which is why it showed three records where they showed ten. */
    body.admin-mode .orders-tab-strip { padding: 2px; }
    body.admin-mode .orders-tab-btn { padding: 3px 10px; font-size: 11.5px; }
    body.admin-mode :is(.panel-header, .card-head, .card-header) { padding: 4px 10px; }
    body.admin-mode .panel-header :is(input, select, .btn) { padding: 4px 10px; font-size: 12px; }
    body.admin-mode :is(.orders-view-btn, .view-toggle button) { padding: 3px 10px; font-size: 12px; }

    /* Two lines per cell, with no leading to spare. */
    body.admin-mode #ordersListPanel .tbl td { padding: 2px 9px; line-height: 1.2; font-size: 12.5px; }
    body.admin-mode #ordersListPanel .tbl td .muted { font-size: 10.5px; line-height: 1.2; }
    body.admin-mode #ordersListPanel .tbl td .badge { padding: 1px 7px; font-size: 10.5px; }
    body.admin-mode #ordersListPanel .tbl td .row-actions > * { padding: 2px 7px; font-size: 11.5px; }
}

@media (max-height: 780px) {
    /* The enquiries calendar was 564px tall and pushed the enquiry list right
       off the screen. The month still reads; the day cells just lose padding. */
    body.admin-mode .enquiry-calendar-card { margin-bottom: 8px; }
    body.admin-mode .calendar-cell { min-height: 40px; padding: 3px 4px; gap: 2px; font-size: 11px; }
    body.admin-mode .calendar-grid { gap: 4px; padding: 0 10px 10px; }
    body.admin-mode .calendar-head { padding: 2px; font-size: 10px; }
    body.admin-mode .calendar-legend { padding: 4px 10px; font-size: 11px; }
}

/* ---------------------------------------------------------------------------
   Card screens (Users, and anything else built from cards rather than rows).
   Two cards per row at 174px each meant four people on a screen; the email and
   contact sat in bordered boxes with their own labels.
   ------------------------------------------------------------------------- */
body.admin-mode #usersCards { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 10px; }
body.admin-mode .user-card { padding: 9px 10px; border-radius: 12px; }
body.admin-mode .user-card-top { gap: 8px; }
body.admin-mode .user-card-name { font-size: 14px; }
body.admin-mode .user-card-code { font-size: 11px; }
body.admin-mode .user-card-tags { margin-top: 4px; }
body.admin-mode .user-card-tags .badge { padding: 1px 8px; font-size: 10.5px; }
body.admin-mode .user-card-meta-grid { margin-top: 5px; gap: 4px; }
body.admin-mode .user-card-detail { border: 0; padding: 0; border-radius: 0; background: none; }
body.admin-mode .user-card-detail label { font-size: 9.5px; letter-spacing: .04em; }
body.admin-mode .user-card-detail > div { font-size: 12px; line-height: 1.3; overflow-wrap: anywhere; }
body.admin-mode #usersCards .user-card img { width: 32px !important; height: 32px !important; min-width: 32px !important; max-width: 32px !important; min-height: 32px !important; max-height: 32px !important; }

@media (max-height: 780px) {
    body.admin-mode #usersCards { gap: 8px; }
    body.admin-mode .user-card { padding: 7px 9px; }
}

/* Kitchen Queue: dates, actions and search sat on three separate lines. */
body.admin-mode .kitchen-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
body.admin-mode .kitchen-filters { gap: 8px; }
body.admin-mode .kitchen-search-shell { margin: 0; }
body.admin-mode .kitchen-subtitle { font-size: 12.5px; margin-bottom: 4px; }
body.admin-mode :is(.kitchen-filter-group, .kitchen-search-group) label { font-size: 11.5px; margin-bottom: 2px; }
body.admin-mode .kitchen-toolbar :is(input, .btn) { padding: 5px 10px; font-size: 12.5px; min-height: 0; }

@media (max-height: 780px) {
    body.admin-mode .kitchen-subtitle { display: none; }
    body.admin-mode .kitchen-toolbar { gap: 8px; }
}

/* Reports: a tile for a one-line report took 120px, and the badge repeated the
   group heading directly above it. */
body.admin-mode .reports-cards-container { gap: 8px; }
body.admin-mode .report-card-header { padding: 8px 9px; }
body.admin-mode .report-card-footer { padding: 5px 9px; }
body.admin-mode .report-card-title { font-size: 13.5px; }
body.admin-mode .report-card-description { font-size: 11.5px; line-height: 1.3; }
body.admin-mode .report-card-icon { width: 32px; height: 32px; font-size: 14px; }
body.admin-mode .report-card-action { padding: 4px 10px; font-size: 12px; min-height: 0; }
body.admin-mode .report-card-badge { padding: 2px 7px; font-size: 10.5px; }

@media (max-height: 780px) {
    body.admin-mode .report-card-description { display: none; }
    body.admin-mode .report-card-badge { display: none; }
    body.admin-mode .reports-cards-container { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
}

/* ---------------------------------------------------------------------------
   Pagination. The old bar mixed a wide "Rows per page" control with chunky
   « ‹ 1 › » buttons of different sizes. It now reads as one quiet strip:
   the range on the left, square page buttons on the right.
   ------------------------------------------------------------------------- */
body.admin-mode .datatable-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
body.admin-mode .datatable-info { color: var(--gray-500, #6b7280); font-size: 12.5px; }
body.admin-mode .datatable-info strong { color: var(--green-dark, #123f28); font-weight: 700; }
body.admin-mode .datatable-controls { display: flex; align-items: center; gap: 12px; }
body.admin-mode .datatable-page-size label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--gray-500, #6b7280); }
body.admin-mode .datatable-page-size-select { padding: 3px 24px 3px 8px; font-size: 12.5px; border-radius: 7px; min-height: 0; }
body.admin-mode .datatable-pagination { gap: 3px; }
body.admin-mode .datatable-page-btn {
    min-width: 28px;
    height: 28px;
    padding: 0 7px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-color: #dfe8e2;
}
body.admin-mode .datatable-page-btn:hover:not(:disabled) { background: #eef7f1; border-color: #bcd9c8; transform: none; }
body.admin-mode .datatable-page-btn.active { box-shadow: none; transform: none; }
body.admin-mode .datatable-page-btn.disabled { opacity: .4; }
body.admin-mode .datatable-page-dots { padding: 0 2px; font-size: 12.5px; }

/* ---------------------------------------------------------------------------
   Orders list columns. Ten columns needed 1256px and the table scrolled
   sideways, which hides whichever half of the record you are not looking at.
   The row counter goes (the order number already identifies the row), the
   money column carries the payment state, and the rest are held to a width.
   ------------------------------------------------------------------------- */

/* The orders table asks for min-width 1240px, with a minimum on every column,
   which is what forced the sideways scrollbar on anything under a wide
   monitor. Below that width the columns share what there is. */


/* A long email or code has no spaces to break at, so a single address could
   push a whole table past the screen and bring back the sideways scrollbar. */
@media (max-width: 1500px) {
    body.admin-mode .tbl { min-width: 0; }
    body.admin-mode .tbl td { overflow-wrap: anywhere; }
    body.admin-mode #ordersTable td { overflow-wrap: normal; }
}

/* ---------------------------------------------------------------------------
   Admin shell: the window is the page. The header and footer stay put, the
   work area between them scrolls, and a list card stretches to the footer so
   no space is left over below it.
   ------------------------------------------------------------------------- */
@media screen and (min-width: 1025px) and (min-height: 560px) {
    body.admin-mode { height: 100dvh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
    /* As a flex item the wrapper shrank to its content and its auto side
       margins centred it, leaving a white band down each side of the screen. */
    body.admin-mode .portal-wrap { flex: 1 1 auto; min-height: 0; width: 100%; align-self: stretch; }
    body.admin-mode .main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
    body.admin-mode .app-footer { flex: 0 0 auto; }

    /* A card holding a table takes the remaining height; other cards keep
       their natural size so forms and dashboards are unaffected. */
    body.admin-mode .main > .card:has(> .table-wrap),
    body.admin-mode .main > .card:has(> .tbl-wrap),
    body.admin-mode .main > .card:has(.datatable-footer) {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }
    body.admin-mode .main > .card:has(.datatable-footer) > :is(.table-wrap, .tbl-wrap) { min-height: 0; }
}

/* Between 1150px and a wide monitor there is room for every column; the table
   only needs its forced 1240px minimum lifted so it can share the space. */

/* ---------------------------------------------------------------------------
   Orders list columns. The table demanded a fixed 1240px, so anything short of
   a wide monitor scrolled sideways. The columns now share the width in
   proportion, which keeps every column on screen at any size: names and
   packages shorten with an ellipsis, money never does.
   ------------------------------------------------------------------------- */
@media (max-width: 1500px) {
    body.admin-mode #ordersTable { min-width: 0; table-layout: fixed; width: 100%; }
    body.admin-mode #ordersTable :is(th, td) { min-width: 0 !important; max-width: none; }
    body.admin-mode #ordersTable :is(th, td):nth-child(2) { display: none; }   /* row counter */
    body.admin-mode #ordersTable :is(th, td):nth-child(1) { width: 34px !important; }
    body.admin-mode #ordersTable :is(th, td):nth-child(3) { width: 11% !important; }
    body.admin-mode #ordersTable :is(th, td):nth-child(5) { width: 24% !important; }
    body.admin-mode #ordersTable :is(th, td):nth-child(6) { width: 13% !important; white-space: nowrap; }
    body.admin-mode #ordersTable :is(th, td):nth-child(7) { width: 13% !important; }
    body.admin-mode #ordersTable :is(th, td):nth-child(8) { width: 10% !important; }
    body.admin-mode #ordersTable :is(th, td):nth-child(9) { width: 10% !important; }
    body.admin-mode #ordersTable :is(th, td):nth-child(10) { width: 11% !important; white-space: nowrap; }
    body.admin-mode #ordersTable :is(th, td):nth-child(11) { width: 46px !important; }

    /* One line each, with an ellipsis, so a long name cannot treble the row. */
    body.admin-mode #ordersTable td:nth-child(5) strong,
    body.admin-mode #ordersTable td:nth-child(5) .muted { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    /* A td must stay a table cell: display:block took it out of the column
       layout and collapsed the package column to a few pixels. */
    body.admin-mode #ordersTable td:nth-child(7) { white-space: nowrap; }
    body.admin-mode #ordersTable td:nth-child(7) .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    body.admin-mode #ordersTable td { overflow-wrap: normal; }
}

@media (max-width: 1500px) {
    /* A date and time on one nowrap line ran a few pixels past its cell, which
       was enough to bring the sideways scrollbar back. */
    body.admin-mode #ordersTable :is(th, td) { overflow: hidden; text-overflow: ellipsis; }
    body.admin-mode #ordersTable td:nth-child(6) .muted { font-size: 10.5px; }
}

/* ---------------------------------------------------------------------------
   Inside a card that fills the screen, only the scrolling area may flex. The
   tab strip was being squeezed from 34px to 18px and its labels clipped.
   ------------------------------------------------------------------------- */
@media screen and (min-width: 1025px) and (min-height: 560px) {
    body.admin-mode .main > .card:has(.datatable-footer) > *,
    body.admin-mode .main > .card:has(> .table-wrap) > *,
    body.admin-mode .main > .card:has(> .tbl-wrap) > * { flex: 0 0 auto; }
    body.admin-mode .main > .card > :is(.table-wrap, .tbl-wrap) { flex: 1 1 auto !important; }

    /* The board is the scrolling area on the board tab. */
    body.admin-mode .main > .card:has(.orders-board-view) { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
    body.admin-mode .orders-board-view { flex: 1 1 auto; min-height: 0; }
}

/* ---------------------------------------------------------------------------
   Order board. Five fixed 280px columns needed 1448px, so on anything but a
   wide monitor the stages ran off the side and the board had to be dragged
   left and right to see whether anything was waiting in the kitchen. The
   stages now share the width, and each one scrolls its own orders.
   ------------------------------------------------------------------------- */
body.admin-mode .orders-board-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
    align-items: stretch;
    height: 100%;
}
body.admin-mode .orders-board-view { overflow: hidden; padding: 6px 0 2px; }
body.admin-mode .orders-board-column {
    min-height: 0;
    padding: 8px;
    border-width: 2px;
    display: flex;
    flex-direction: column;
}
body.admin-mode .orders-board-column-header { padding-bottom: 6px; margin-bottom: 8px; border-bottom-width: 2px; font-size: 12px; }
body.admin-mode .orders-board-column:nth-child(n) .orders-board-column-header { padding: 6px 8px; margin: -8px -8px 8px -8px; }
body.admin-mode .orders-board-cards { flex: 1 1 auto; min-height: 0; overflow: auto; gap: 6px; padding-right: 2px; }

/* The card: an order is four short facts and one action. */
body.admin-mode .orders-board-card { padding: 8px; border-radius: 10px; gap: 4px; }
body.admin-mode .orders-board-card-order { font-size: 12.5px; }
body.admin-mode .orders-board-card-customer { font-size: 11.5px; }
body.admin-mode .orders-board-card-meta { font-size: 10px; }
body.admin-mode .orders-board-card-amounts { padding: 5px 7px; gap: 3px; }
body.admin-mode .orders-board-card-amount-value { font-size: 12px; }
body.admin-mode .orders-board-card-label { font-size: 8.5px; }
body.admin-mode .orders-board-card .btn { padding: 4px 8px; font-size: 11.5px; }

@media screen and (min-width: 1025px) and (min-height: 560px) {
    /* The board is the scrolling area on its tab, the same way the table wrap
       is on the list tab, so it has to be excepted from the rule above. */
    body.admin-mode .main > .card > .orders-board-view { flex: 1 1 auto !important; min-height: 0; }
}

/* The stack of orders inside a stage is a list, not a grid: as a grid with a
   constrained height the rows shared the space and every card was squashed to
   a sliver. Each card keeps its own height and the stage scrolls. */
body.admin-mode .orders-board-cards { display: flex; flex-direction: column; }
body.admin-mode .orders-board-card { flex: 0 0 auto; }
body.admin-mode .orders-board-column { min-height: 0; height: 100%; }
body.admin-mode .orders-board-column > .muted { flex: 0 0 auto; }

/* With one amount line the divider under it is just a rule with nothing to
   separate. */
body.admin-mode .orders-board-card-amounts > .orders-board-card-balance:only-child { padding-bottom: 0; border-bottom: 0; }

/* The dashboard's recent-orders table carries the same forced 1180px minimum
   the full orders list had, so it scrolled sideways inside its card on any
   screen narrower than a wide monitor. */
@media (max-width: 1500px) {
    body.admin-mode #recentOrdersTable { min-width: 0; table-layout: fixed; width: 100%; }
    body.admin-mode #recentOrdersTable :is(th, td) { min-width: 0 !important; overflow: hidden; text-overflow: ellipsis; }
    body.admin-mode #recentOrdersTable :is(th, td):nth-child(1) { width: 42px !important; }
    body.admin-mode #recentOrdersTable :is(th, td):nth-child(2) { width: 15% !important; }
    body.admin-mode #recentOrdersTable :is(th, td):nth-child(3) { width: auto !important; }
    body.admin-mode #recentOrdersTable :is(th, td):nth-child(4) { width: 13% !important; }
    body.admin-mode #recentOrdersTable :is(th, td):nth-child(5) { width: 12% !important; }
    body.admin-mode #recentOrdersTable :is(th, td):nth-child(6) { width: 12% !important; }
    body.admin-mode #recentOrdersTable :is(th, td):nth-child(7) { width: 11% !important; white-space: nowrap; }
}
