/* Gwin Y Mor Backend — base styles. No external dependencies, works offline. */

:root {
    --wine: #6b1f2a;
    --wine-dark: #4a151d;
    --sand: #f6f2ec;
    --ink: #262220;
    --muted: #7a7168;
    --border: #e3dccf;
    --ok: #2e7d4f;
    --warn: #b45309;
    --danger: #b3261e;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--sand);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--wine); }

.topbar {
    background: var(--wine);
    color: #fff;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.topbar .brand {
    font-weight: 700;
    font-size: 1.1rem;
    padding: 14px 0;
    color: #fff;
    text-decoration: none;
}

.topbar .staff-badge {
    color: #f3e4e6;
    font-size: 0.9rem;
}

.topbar .staff-badge a { color: #fff; margin-left: 10px; }

nav.mainnav {
    background: var(--wine-dark);
    display: flex;
    flex-wrap: wrap;
    padding: 0 12px;
}

nav.mainnav a, nav.mainnav span.disabled {
    display: inline-block;
    padding: 10px 14px;
    color: #f0e3e5;
    text-decoration: none;
    font-size: 0.92rem;
    white-space: nowrap;
}

nav.mainnav a:hover { background: rgba(255,255,255,0.1); }

nav.mainnav span.disabled {
    color: rgba(240,227,229,0.45);
    cursor: not-allowed;
}

nav.mainnav a.active {
    background: rgba(255,255,255,0.16);
    font-weight: 600;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 0 0 14px; }
.subtitle { color: var(--muted); margin: 0 0 20px; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.tile {
    display: block;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    text-decoration: none;
    color: var(--ink);
    transition: box-shadow .15s, transform .15s;
}
.tile:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); transform: translateY(-1px); }
.tile .tile-title { font-weight: 700; margin-bottom: 4px; }
.tile .tile-desc { color: var(--muted); font-size: 0.88rem; }
.tile.disabled { opacity: 0.5; cursor: not-allowed; }
.tile.disabled:hover { box-shadow: none; transform: none; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
th, td {
    text-align: left;
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
}
th { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:hover td { background: #fbfaf7; }

.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}
.badge.ok { background: #e5f3ea; color: var(--ok); }
.badge.warn { background: #fdf0dd; color: var(--warn); }
.badge.danger { background: #fbe7e5; color: var(--danger); }
.badge.muted { background: #eee9e2; color: var(--muted); }

form.inline { display: inline; }

label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 4px; }
input[type=text], input[type=url], input[type=search], input[type=number], input[type=password], input[type=date],
input[type=time], input[type=datetime-local], input[type=email], select, textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    background: #fff;
    color: var(--ink);
    font-family: inherit;
}
textarea { resize: vertical; }
.field { margin-bottom: 14px; }

.btn {
    display: inline-block;
    background: var(--wine);
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: var(--wine-dark); }
.btn.secondary { background: #efe9e0; color: var(--ink); }
.btn.secondary:hover { background: #e5ddd0; }
.btn.danger { background: var(--danger); }
.btn.small { padding: 5px 10px; font-size: 0.82rem; }

.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    font-size: 0.92rem;
}
.flash.success { background: #e5f3ea; color: var(--ok); }
.flash.error { background: #fbe7e5; color: var(--danger); }

.login-wrap {
    max-width: 380px;
    margin: 90px auto;
    padding: 0 20px;
}
.login-wrap .card { text-align: center; }

.muted { color: var(--muted); }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }

.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.tabs a {
    padding: 9px 14px;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
}
.tabs a.active { color: var(--wine); border-bottom-color: var(--wine); font-weight: 600; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }

/* =========================================================================
   Booking system (staff) + alerts
   ========================================================================= */
.bk-page .container { max-width: 1500px; }

.bk-toolbar {
    display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 10px 14px; margin-bottom: 12px;
}
.bk-group { display: flex; align-items: center; gap: 6px; }
.bk-group input[type=date] { width: auto; }
.bk-right { margin-left: auto; }
.bk-timegroup input[type=range] { width: 200px; accent-color: #41a285; }
.bk-timelabel { min-width: 3.2em; text-align: center; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.btn.active { background: #1e2e5b; color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.bk-banner {
    background: #1e2e5b; color: #fff; padding: 10px 14px; border-radius: var(--radius);
    margin-bottom: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}

.bk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
@media (max-width: 1000px) { .bk-layout { grid-template-columns: 1fr; } }

.bk-mapwrap { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.bk-floor { width: 100%; height: auto; display: block; user-select: none; -webkit-user-select: none; touch-action: pan-y pinch-zoom; }
.bk-floor.editing { touch-action: none; }
.bk-floor text { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; pointer-events: none; }

.f-wall { fill: #faf9f6; stroke: #1e2e5b; stroke-width: 3; }
.f-block { fill: #d9d6cf; stroke: #b1a086; stroke-width: 2; }
.f-bar { fill: #b1a086; stroke: #8f7f66; stroke-width: 2; }
.f-label { font-size: 28px; fill: #1e2e5b; font-weight: 600; letter-spacing: .06em; }
.f-window { fill: #9ecfc1; stroke: #41a285; stroke-width: 1; }
.f-door { fill: #1e2e5b; }
.f-doorline { stroke: #1e2e5b; stroke-width: 8; stroke-linecap: round; }
.f-small { font-size: 18px; fill: #5d6475; }

.tbl { cursor: pointer; }
.tbl .shape { fill: #e3f2ed; stroke: #41a285; stroke-width: 3; transition: fill .15s, stroke .15s; }
.tbl .t-label { font-size: 20px; font-weight: 700; fill: #1e2e5b; opacity: .75; }
.tbl .t-cap circle { fill: #fff; stroke: #1e2e5b; stroke-width: 2; opacity: .85; }
.tbl .t-cap text { font-size: 17px; font-weight: 700; fill: #1e2e5b; }
.tbl .t-free { font-size: 24px; fill: #2f7f68; font-weight: 600; }
.tbl .t-next { font-size: 18px; fill: #1e2e5b; }
.tbl .t-name { font-size: 25px; font-weight: 700; fill: #fff; }
.tbl .t-sub { font-size: 19px; fill: #dfe4f2; }
.tbl .t-note { font-size: 20px; fill: #ffd37a; }

.tbl.st-booked .shape { fill: #1e2e5b; stroke: #14204a; }
.tbl.st-booked .t-label { fill: #fff; }
.tbl.st-seated .shape { fill: #b1a086; stroke: #8f7f66; }
.tbl.st-seated .t-name { fill: #1e2e5b; }
.tbl.st-seated .t-sub, .tbl.st-seated .t-label { fill: #3a3a3a; }
.tbl.late .shape { stroke: #d6453d; stroke-width: 7; }
.tbl.held .shape { stroke-dasharray: 10 7; }
.tbl.inactive { opacity: .35; }
.tbl.sel .shape { stroke: #e3a400; stroke-width: 7; }
.tbl.has-booking { cursor: grab; }
.tbl.link-suggest .shape { stroke: #41a285; stroke-width: 7; stroke-dasharray: 12 8; }
.tbl.drop-ok .shape { stroke: #2e9e4f; stroke-width: 9; fill: #c8ecd6; }
.tbl.drop-warn .shape { stroke: #e3a400; stroke-width: 9; fill: #fbeccc; }
.tbl.drop-swap .shape { stroke: #6a4fc1; stroke-width: 9; }
.link-bar { stroke: #1e2e5b; stroke-width: 18; stroke-linecap: round; opacity: .35; pointer-events: none; }
.bk-floor.linking .tbl { cursor: copy; }
.bk-floor.editing .tbl { cursor: move; }
.bk-floor.editing .tbl .shape { stroke-dasharray: 8 6; }

.bk-dragging, .bk-dragging * { cursor: grabbing !important; user-select: none; }
.bk-ghost {
    position: fixed; z-index: 3000; pointer-events: none; background: #1e2e5b; color: #fff;
    padding: 8px 14px; border-radius: 999px; font-weight: 700; box-shadow: 0 6px 18px rgba(0,0,0,.3);
}

.bk-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 8px 6px 2px; font-size: .85rem; color: var(--muted); }
.bk-legend .sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; border: 2px solid; }
.sw-free { background: #e3f2ed; border-color: #41a285; }
.sw-booked { background: #1e2e5b; border-color: #14204a; }
.sw-seated { background: #b1a086; border-color: #8f7f66; }
.sw-late { background: #fff; border-color: #d6453d; }
.sw-held { background: #fff; border-color: #41a285; border-style: dashed; }

.bk-side { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; max-height: calc(100vh - 150px); overflow-y: auto; position: sticky; top: 8px; }
@media (max-width: 1000px) { .bk-side { position: static; max-height: none; } }
.bk-tip { font-size: .82rem; margin: 4px 0 10px; }
.bk-closed { background: #f7f4ee; border-left: 5px solid #b1a086; padding: 8px 10px; border-radius: 4px; font-size: .85rem; margin-bottom: 10px; }

.bk-card {
    position: relative; display: grid; grid-template-columns: 22px 54px 1fr; gap: 6px; align-items: start;
    border: 1px solid var(--border); border-left: 6px solid #1e2e5b; border-radius: 8px; padding: 9px 10px 9px 6px; margin-bottom: 8px;
    background: #fff; cursor: pointer;
}
.bk-card:hover { background: #fbfaf7; }
.bk-card.sel { box-shadow: 0 0 0 3px #e3a400; }
.bk-card.st-seated { border-left-color: #b1a086; }
.bk-card.st-completed, .bk-card.st-cancelled, .bk-card.st-no_show { border-left-color: #c9c4b8; opacity: .75; }
.bk-card.is-new { background: #eef8f4; border-left-color: #41a285; }
.bk-card.is-late { border-left-color: #d6453d; }
.bk-grip { color: #a9a49a; font-size: 1.4rem; line-height: 1; cursor: grab; touch-action: none; padding: 4px 0; text-align: center; user-select: none; }
.bk-time { font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.bk-name { line-height: 1.35; }
.bk-party { font-weight: 700; color: #1e2e5b; }
.bk-tbl { background: #ecebe8; border-radius: 4px; padding: 0 6px; font-size: .8rem; font-weight: 600; }
.bk-meta { font-size: .82rem; color: var(--muted); margin-top: 2px; word-break: break-word; }
.bk-req { font-size: .85rem; background: #fff7e0; border-radius: 4px; padding: 5px 8px; margin-top: 5px; }
.bk-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; grid-column: 1 / -1; }
.bk-card .bk-body { grid-column: 3; }
.bk-card .bk-actions { grid-column: 3; }
.bk-done { margin-top: 12px; }
.bk-done summary { cursor: pointer; color: var(--muted); font-size: .88rem; margin-bottom: 8px; }
.tag { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .04em; border-radius: 999px; padding: 1px 7px; vertical-align: 1px; background: #ecebe8; color: #1e2e5b; text-transform: uppercase; }
.tag-new { background: #41a285; color: #fff; }
.tag-late { background: #d6453d; color: #fff; }
.tag-cancelled, .tag-no_show { background: #f3d9d7; color: #a3302b; }
.tag-seated { background: #b1a086; color: #1e2e5b; }

.bk-toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 4000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.bk-toast { background: #1e2e5b; color: #fff; padding: 10px 18px; border-radius: 999px; box-shadow: 0 6px 18px rgba(0,0,0,.25); transition: opacity .4s; max-width: 90vw; }
.bk-toast.err { background: #a3302b; }
.bk-toast.ok { background: #2f7f68; }
.bk-toast.out { opacity: 0; }

.bk-modal-bg { position: fixed; inset: 0; z-index: 2500; pointer-events: none; }
.bk-modal { position: fixed; top: 72px; right: 16px; pointer-events: auto; background: #fff; border-radius: 10px; padding: 20px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 90px); overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,.35); border: 1px solid var(--border, #d9dce6); }
.bk-drag-handle { cursor: move; touch-action: none; user-select: none; -webkit-user-select: none; background: #f1f3f9; margin: -20px -20px 14px !important; padding: 12px 20px; border-radius: 10px 10px 0 0; }
.bk-grip { opacity: .5; margin-right: 4px; }
.bk-modal h2 { margin: 0 0 14px; }
.bk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; }
.bk-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.bk-check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 6px 0; }
.bk-check input { width: auto; }
.bk-tablepick { display: flex; flex-wrap: wrap; gap: 6px; }
.bk-tablepick .chip {
    border: 2px solid #ddd5c6; background: #fff; border-radius: 8px; padding: 6px 10px; min-width: 62px; cursor: pointer; font: inherit; text-align: center; line-height: 1.2;
}
.bk-tablepick .chip small { display: block; font-size: .7rem; color: var(--muted); }
.bk-tablepick .chip[aria-pressed="true"] { background: #1e2e5b; border-color: #1e2e5b; color: #fff; }
.bk-tablepick .chip[aria-pressed="true"] small { color: #cfd6ea; }
.bk-tablepick .chip[disabled] { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.bk-tablepick .chip.static { cursor: default; display: inline-flex; align-items: center; gap: 8px; }
.bk-tablepick .chip .x { border: 0; background: transparent; font-size: 1.2rem; cursor: pointer; color: #a3302b; padding: 0 2px; }
.bk-tform h3 { margin: 16px 0 8px; }
.bk-joins { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0 8px; max-height: 190px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; }
.err { color: #a3302b; }
.form-err { font-weight: 600; min-height: 1.2em; }

/* Alerts */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.alert-btn { background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 999px; padding: 4px 11px; margin-right: 10px; cursor: pointer; font-size: 1rem; position: relative; }
.alert-btn.muted .ab-icon { opacity: .6; }
.alert-btn.offline { background: #a3302b; }
.alert-btn .ab-count { background: #41a285; color: #fff; border-radius: 999px; font-size: .75rem; font-weight: 700; padding: 0 7px; margin-left: 4px; }
.alert-btn.has-alerts { animation: gymPulse 1s ease-in-out infinite; }
.alert-panel { position: absolute; right: 12px; z-index: 2800; background: #fff; color: var(--ink); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; width: 320px; max-width: calc(100vw - 24px); box-shadow: 0 12px 30px rgba(0,0,0,.2); }
.alert-panel h3 { margin: 0 0 8px; }
.ap-status { margin: 0 0 8px; font-size: .9rem; }
.ap-actions { margin: 6px 0 10px; }
.ap-check { display: flex; gap: 8px; font-weight: 400; align-items: flex-start; font-size: .9rem; }
.ap-check input { width: auto; margin-top: 4px; }

.alert-overlay {
    position: fixed; inset: 0; z-index: 5000; display: flex; align-items: center; justify-content: center; padding: 16px;
    background: rgba(20,32,74,.78); animation: gymFlashBg 1s ease-in-out infinite;
}
.alert-overlay[hidden] { display: none; }
.ao-card { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border: 8px solid #41a285; animation: gymBorder 1s ease-in-out infinite; }
.ao-head { background: #1e2e5b; color: #fff; padding: 14px 18px; font-size: 1.6rem; font-weight: 700; letter-spacing: .04em; }
.ao-n { background: #41a285; border-radius: 999px; padding: 0 12px; margin-left: 8px; }
.ao-list { padding: 8px 18px; }
.ao-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.ao-item:last-child { border-bottom: 0; }
.ao-title { font-size: .78rem; font-weight: 700; letter-spacing: .12em; color: #2f7f68; }
.ao-item.cancelled .ao-title { color: #a3302b; }
.ao-main { font-size: 1.5rem; }
.ao-when { font-size: 1.15rem; margin: 2px 0 4px; }
.ao-req { background: #fff7e0; border-radius: 6px; padding: 6px 10px; margin: 6px 0; }
.ao-phone { color: var(--muted); }
.ao-btns { display: flex; gap: 8px; margin-top: 8px; }
.ao-foot { padding: 10px 18px 18px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ao-sound { width: 100%; margin: 0 0 4px; font-weight: 600; color: #a3302b; }
.ao-sound[hidden] { display: block; visibility: hidden; }  /* keep the space so the buttons never jump under a finger */
body.alert-active { overflow: hidden; }

@keyframes gymPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(65,162,133,.9); } 50% { box-shadow: 0 0 0 8px rgba(65,162,133,0); } }
@keyframes gymFlashBg { 0%,100% { background: rgba(20,32,74,.78); } 50% { background: rgba(20,32,74,.9); } }
@keyframes gymBorder { 0%,100% { border-color: #41a285; } 50% { border-color: #e3a400; } }
@media (prefers-reduced-motion: reduce) {
    .alert-overlay, .ao-card, .alert-btn.has-alerts { animation: none; }
}

.bk-banner[hidden] { display: none; }

/* ===== Stock, display, stock take, glassware ===== */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.disp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.disp-card { border: 1px solid var(--border); border-left: 6px solid #b1a086; border-radius: 10px; padding: 12px 14px; background: #fff; }
.disp-card.soon { border-left-color: #e0a526; }
.disp-card.late { border-left-color: #c0392b; background: #fdf3f1; }
.disp-card.ok { border-left-color: #41a285; }
.disp-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.1rem; }
.disp-qty { font-weight: 700; color: #1e2e5b; }
.disp-warn { color: #a3302b; font-weight: 600; margin-top: 4px; }
.disp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
tr.day-start td { border-top: 2px solid var(--border); }

.st-search input { width: 100%; font-size: 1.05rem; padding: 12px 14px; }
.st-sup > summary { cursor: pointer; list-style: none; }
.st-sup > summary::-webkit-details-marker { display: none; }
.st-sup > summary h2 { margin: 0; }
.st-sup > summary h2::after { content: '▾'; float: right; color: #888; }
.st-sup:not([open]) > summary h2::after { content: '▸'; }
.st-group { margin: 16px 0 4px; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: #6b6f7a; }
.st-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 6px; border-top: 1px solid var(--border); transition: background .4s; }
.st-row[hidden] { display: none; }
.st-row.flash-ok { background: #e3f3ed; }
.st-name { flex: 1 1 220px; font-size: 1.05rem; }
.st-status { margin-left: 8px; background: #41a285; color: #fff; border-radius: 999px; padding: 2px 10px; font-size: .8rem; }
.st-status[hidden] { display: none; }
.st-ctl { display: flex; align-items: center; gap: 6px; }
.st-qty { width: 64px; text-align: center; font-size: 1.1rem; padding: 10px 4px; }
.st-ctl .btn { min-width: 44px; min-height: 44px; }
.st-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1e2e5b; color: #fff; padding: 12px 20px; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 50; }
.st-toast.bad { background: #a3302b; }
.st-toast[hidden] { display: none; }

.gw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.gw-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.gw-thumb { display: flex; align-items: center; justify-content: center; background: #fff; height: 200px; border-bottom: 1px solid var(--border); }
.gw-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gw-noimg { color: #999; font-size: .9rem; }
.gw-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.gw-title { margin: 0; font-size: 1.05rem; }
.gw-title a { color: #1e2e5b; text-decoration: none; }
.gw-desc { margin: 0; color: #555; font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gw-price { margin: 0; font-weight: 700; }
.gw-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.st-ctl input.st-qty { width: 64px; text-align: center; font-size: 1.1rem; padding: 10px 4px; }
.st-ctl .btn.st-order { min-width: 84px; white-space: nowrap; padding: 10px 14px; }
.st-ctl .btn.st-inc, .st-ctl .btn.st-dec { padding: 10px 14px; }
.audit-filter input[type=date] { width: auto; }

/* cleaning list */
.cl-days { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; background: #fff; cursor: pointer; font-weight: 500; }
.cl-chip input { width: auto; margin: 0; }
.cl-chip:has(input:checked) { background: #e3f3ed; border-color: #41a285; }
.cl-every { font-weight: 700; }
.cl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.cl-card { background: #fff; border: 1px solid var(--border); border-top: 6px solid #b1a086; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.cl-card.complete { border-top-color: #41a285; }
.cl-head { display: flex; justify-content: space-between; align-items: baseline; }
.cl-head h2 { margin: 0; }
.cl-count { font-weight: 700; color: #1e2e5b; font-size: 1.1rem; }
.cl-bar { height: 8px; background: #ece7dd; border-radius: 999px; overflow: hidden; }
.cl-bar span { display: block; height: 100%; background: #41a285; }
.cl-todo { margin: 0; padding-left: 18px; flex: 1; }
.cl-card .btn { align-self: flex-start; margin-top: auto; }

/* Opening/closing: sign-all bar */
.sign-all{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.sign-all .muted{font-size:.9rem}

/* Booking info button + panel */
.bk-info{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;margin-left:4px;border-radius:50%;border:1px solid var(--border,#ccc);background:#fff;color:inherit;font:italic 700 13px/1 Georgia,serif;cursor:pointer;vertical-align:middle}
.bk-info:hover{background:#eef3f8}
.bk-infotable{width:100%;border-collapse:collapse;margin:8px 0 12px}
.bk-infotable th{text-align:left;width:32%;padding:6px 8px 6px 0;vertical-align:top;font-weight:600;color:#555}
.bk-infotable td{padding:6px 0;vertical-align:top}

/* Epos product links */
.link-search{width:100%;max-width:420px}
.link-results{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.chip-form{display:inline-block;margin:0 6px 6px 0}

/* Drag to reorder (checklist setup) */
.drag-grip { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; text-align: center; font-size: 1.3rem; color: var(--muted, #7a8099); width: 34px; }
tr.dragging { background: #eef3ff; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
tr.dragging .drag-grip { cursor: grabbing; }
tr.row-off td { opacity: .55; }
#orderTable.saved { outline: 2px solid #41a285; outline-offset: 2px; }

/* ---- Financials ---- */
.fin-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fin-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fin-chips .chip { padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; font-size: .9rem; }
.fin-chips .chip.on { background: var(--wine); border-color: var(--wine); color: #fff; }
.fin-custom { gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.fin-custom label { font-size: .85rem; color: var(--muted); }
.fin-status { min-height: 24px; margin: 6px 0 12px; font-size: .9rem; }
.fin-status progress { vertical-align: middle; width: 160px; }
.fin-err { color: var(--danger); }
.fin-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.fin-kpi { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.fin-kpi-label { color: var(--muted); font-size: .85rem; }
.fin-kpi-value { font-size: 1.6rem; font-weight: 700; margin: 2px 0; }
.fin-delta { font-size: .8rem; color: var(--muted); }
.fin-delta.good { color: var(--ok); }
.fin-delta.bad { color: var(--danger); }
.fin-kpi-note { font-size: .8rem; }
.fin-chart { position: relative; height: 260px; }
.fin-chart.tall { height: 320px; }
.fin-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.fin-grid:has(> div:nth-child(2) .fin-chart.tall) { grid-template-columns: 1fr 1fr; }
@media (max-width: 800px) { .fin-grid, .fin-grid:has(> div:nth-child(2) .fin-chart.tall) { grid-template-columns: 1fr; } }
.fin-h3 { font-size: .95rem; margin: 0 0 6px; color: var(--muted); font-weight: 600; }
.fin-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 8px 0 12px; }
.fin-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.fin-check { display: inline-flex; align-items: center; gap: 5px; font-size: .9rem; cursor: pointer; }
.fin-check .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 7px 12px; cursor: pointer; font: inherit; color: var(--ink); }
.seg button.on { background: var(--wine); color: #fff; }
.fin-heat-wrap { overflow-x: auto; }
.fin-heat { border-collapse: separate; border-spacing: 2px; font-size: .78rem; width: 100%; min-width: 520px; }
.fin-heat th { font-weight: 500; color: var(--muted); padding: 2px 4px; text-align: center; }
.fin-heat tbody th { text-align: right; }
.fin-heat td { text-align: center; padding: 8px 2px; border-radius: 3px; min-width: 28px; }
table td.r, table th.r { text-align: right; }
