/* ============================================================
   WizClub — "The Estate" theme
   Warm ivory canvas · forest green · brass · engraved serif figures
   Component overrides are layered on Bootstrap (loaded before this
   file) so every existing view inherits the look with no markup change.
   ============================================================ */
:root {
    /* The Estate palette */
    --estate-ground: #f3efe6;   /* app canvas (warm ivory) */
    --estate-surface: #fbf9f4;  /* cards / panels */
    --estate-ink: #1c2a22;      /* text (deep pine) */
    --estate-muted: #6e6a5f;    /* warm grey */
    --estate-line: #e3dccb;     /* hairlines */
    --estate-green: #1f4a38;    /* primary */
    --estate-green-2: #163a2b;  /* primary hover / deep */
    --estate-brass: #a8842f;    /* metal accent */
    --estate-gold: #e6c66f;     /* bright brass (on dark) */
    --estate-tint: #efe9dc;     /* subtle fill on ivory */
    --estate-input-bg: #fff;    /* form field background */

    --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Legacy aliases — existing component CSS re-tints automatically */
    --wizclub-navy: var(--estate-green);
    --wizclub-navy-2: var(--estate-green-2);
    --wizclub-accent: var(--estate-brass);
    --wizclub-line: var(--estate-line);

    /* Bootstrap variable overrides */
    --bs-body-bg: var(--estate-ground);
    --bs-body-color: var(--estate-ink);
    --bs-body-font-family: var(--sans);
    --bs-primary: #1f4a38;
    --bs-primary-rgb: 31, 74, 56;
    --bs-link-color: #1f4a38;
    --bs-link-color-rgb: 31, 74, 56;
    --bs-link-hover-color: #163a2b;
    --bs-border-color: var(--estate-line);
    --bs-border-color-translucent: var(--estate-line);
    --bs-emphasis-color: var(--estate-ink);
    --bs-secondary-color: var(--estate-muted);
    --bs-tertiary-bg: var(--estate-tint);
}

html { font-size: 14px; }
body { background: var(--estate-ground); color: var(--estate-ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: var(--serif); color: var(--estate-ink); font-weight: 600; letter-spacing: -.01em;
}
a { color: var(--estate-green); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--estate-green-2); }
.text-muted { color: var(--estate-muted) !important; }
code, .font-monospace { color: var(--estate-green-2); }

/* ---------------- App shell: forest sidebar + ivory content --------------- */
.app { display: flex; min-height: 100vh; align-items: stretch; }
.app-sidebar { width: 252px; background: var(--estate-green); color: #d7d1c1; }
@media (min-width: 992px) {
    .app-sidebar { flex: 0 0 252px; position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto; }
}
@media (max-width: 991.98px) {
    .app-sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 272px; z-index: 1050; overflow-y: auto;
        transform: translateX(-100%); transition: transform .25s ease; }
    .app-sidebar.open { transform: none; box-shadow: 0 0 44px rgba(11,15,13,.45); }
    .app-backdrop { position: fixed; inset: 0; background: rgba(15,23,20,.5); z-index: 1040; display: none; }
    .app-backdrop.show { display: block; }
}
.app-sidebar-inner { display: flex; flex-direction: column; min-height: 100%; padding: 16px 14px 14px; }
.sidebar-close { background: transparent; border: 0; color: #cfc9b9; font-size: 1.5rem; line-height: 1; padding: 0 6px; }
.sidebar-close:hover { color: #fff; }
.app-brand { font-family: var(--serif); font-size: 1.42rem; color: #fff; text-decoration: none; padding: 4px 8px 14px; display: block; letter-spacing: .01em; }
.app-brand span { color: var(--estate-gold); }
.app-brand:hover { color: #fff; }

.nav-label { font-size: .6rem; letter-spacing: .17em; text-transform: uppercase; color: #8aa99a; padding: 15px 10px 5px; font-weight: 700; }
.app-nav { display: flex; flex-direction: column; gap: 1px; }
.app-nav a { display: flex; align-items: center; gap: 11px; padding: 8px 11px; border-radius: 8px; color: #cfc9b9; text-decoration: none; font-size: .875rem; font-weight: 500; line-height: 1.2; }
.app-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.app-nav a.active { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 2px 0 0 var(--estate-gold); font-weight: 600; }
.nav-ic { width: 16px; height: 16px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.app-side-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.13); padding-top: 12px; margin-top: 18px; }
.app-side-foot .who { color: #fff; font-weight: 600; font-size: .9rem; }
.app-side-foot .roles { color: #8aa99a; font-size: .7rem; margin-bottom: 10px; line-height: 1.3; }
.app-side-foot .side-link { display: inline-flex; align-items: center; gap: 7px; color: #cfc9b9; font-size: .8rem; text-decoration: none; padding: 5px 0; }
.app-side-foot .side-link:hover { color: #fff; }
.app-side-foot .btn-signout { width: 100%; margin-top: 8px; border: 1px solid rgba(255,255,255,.28); color: #eee7d6; background: transparent; border-radius: 8px; padding: 7px; font-size: .82rem; font-weight: 600; }
.app-side-foot .btn-signout:hover { background: rgba(255,255,255,.1); color: #fff; }

.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-topbar { background: var(--estate-green); color: #fff; display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.app-topbar .app-brand { padding: 0; font-size: 1.2rem; }
.app-topbar .burger { background: transparent; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 8px; width: 38px; height: 34px; display: grid; place-items: center; }
.app-content { padding: 22px clamp(15px, 2.4vw, 34px) 40px; width: 100%; max-width: 1440px; }
.app-foot { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--estate-line); color: var(--estate-muted); font-size: .78rem; }

/* Unauthenticated (login) shell */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px;
    background: radial-gradient(1200px 600px at 15% -10%, #24543f 0%, var(--estate-green) 45%, var(--estate-green-2) 100%); }
.auth-shell .card { width: 100%; max-width: 400px; }

/* ------------------------------- Components ------------------------------- */
.card { --bs-card-bg: var(--estate-surface); --bs-card-border-color: var(--estate-line); --bs-card-cap-bg: var(--estate-surface);
    border: 1px solid var(--estate-line); border-radius: 12px; box-shadow: 0 1px 2px rgba(28,42,34,.05); }
.card-header { font-family: var(--serif); font-weight: 600; background: var(--estate-surface); border-bottom: 1px solid var(--estate-line); color: var(--estate-ink); }

.table { --bs-table-bg: transparent; --bs-table-color: var(--estate-ink); --bs-table-border-color: var(--estate-line); }
.table > thead th, .table > thead td { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--estate-muted); font-weight: 700; }
.table-light, .table > thead.table-light th { --bs-table-bg: var(--estate-tint); background-color: var(--estate-tint); }
.table-hover > tbody > tr:hover > * { --bs-table-hover-bg: var(--estate-tint); }
.table td, .table th { border-color: var(--estate-line); }

.btn { --bs-btn-border-radius: 8px; font-weight: 600; }
.btn-primary { --bs-btn-bg: var(--estate-green); --bs-btn-border-color: var(--estate-green); --bs-btn-color: #fff;
    --bs-btn-hover-bg: var(--estate-green-2); --bs-btn-hover-border-color: var(--estate-green-2); --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--estate-green-2); --bs-btn-active-border-color: var(--estate-green-2); }
.btn-outline-primary { --bs-btn-color: var(--estate-green); --bs-btn-border-color: var(--estate-green);
    --bs-btn-hover-bg: var(--estate-green); --bs-btn-hover-border-color: var(--estate-green); --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--estate-green); --bs-btn-active-border-color: var(--estate-green); }
.btn-outline-secondary { --bs-btn-color: var(--estate-muted); --bs-btn-border-color: var(--estate-line);
    --bs-btn-hover-bg: var(--estate-tint); --bs-btn-hover-border-color: var(--estate-line); --bs-btn-hover-color: var(--estate-ink);
    --bs-btn-active-bg: var(--estate-tint); --bs-btn-active-color: var(--estate-ink); --bs-btn-active-border-color: var(--estate-line); }
.btn-success { --bs-btn-bg: #2f7d5b; --bs-btn-border-color: #2f7d5b; --bs-btn-hover-bg: #276a4d; --bs-btn-hover-border-color: #276a4d; --bs-btn-active-bg: #276a4d; }
.btn-outline-success { --bs-btn-color: #2f7d5b; --bs-btn-border-color: #2f7d5b; --bs-btn-hover-bg: #2f7d5b; --bs-btn-hover-border-color: #2f7d5b; }
.btn-warning { --bs-btn-bg: #d9a13a; --bs-btn-border-color: #d9a13a; --bs-btn-color: #3a2a06; --bs-btn-hover-bg: #c8912e; --bs-btn-hover-border-color: #c8912e; }

/* Soft status pills */
.badge { font-weight: 700; letter-spacing: .02em; border-radius: 999px; padding: .34em .72em; }
.text-bg-success { background: #e4efe6 !important; color: #256b48 !important; }
.text-bg-warning { background: #f6ead2 !important; color: #8a5c14 !important; }
.text-bg-danger  { background: #f5e0dd !important; color: #9a382f !important; }
.text-bg-secondary { background: #e9e3d5 !important; color: #6e6a5f !important; }
.text-bg-info    { background: #e2eaf0 !important; color: #355a77 !important; }
.text-bg-light   { background: var(--estate-tint) !important; color: #6e6a5f !important; }
.text-bg-primary { background: var(--estate-green) !important; color: #fff !important; }
.text-bg-dark    { background: var(--estate-ink) !important; color: #fff !important; }
.bg-warning-subtle { background: #f6ead2 !important; }

/* Forms */
.form-control, .form-select { border-color: var(--estate-line); color: var(--estate-ink); background-color: var(--estate-input-bg); }
.form-control:focus, .form-select:focus { border-color: var(--estate-green); box-shadow: 0 0 0 .2rem rgba(31,74,56,.15); }
.form-label { font-weight: 600; color: var(--estate-ink); }
.form-check-input:checked { background-color: var(--estate-green); border-color: var(--estate-green); }
.input-group-text { background: var(--estate-tint); border-color: var(--estate-line); color: var(--estate-muted); }

/* Alerts */
.alert-success { --bs-alert-bg: #e4efe6; --bs-alert-border-color: #cfe1d4; --bs-alert-color: #215f40; }
.alert-info { --bs-alert-bg: #eef3f6; --bs-alert-border-color: #d6e2ea; --bs-alert-color: #355a77; }
.alert-secondary { --bs-alert-bg: var(--estate-tint); --bs-alert-border-color: var(--estate-line); --bs-alert-color: var(--estate-muted); }

/* Nav tabs / pills, list groups, dropdowns, progress */
.nav-link { color: var(--estate-green); }
.nav-tabs .nav-link.active { color: var(--estate-green); border-color: var(--estate-line) var(--estate-line) var(--estate-surface); font-weight: 600; }
.nav-pills .nav-link.active { background: var(--estate-green); }
.list-group-item { background: var(--estate-surface); border-color: var(--estate-line); color: var(--estate-ink); }
.dropdown-menu { --bs-dropdown-bg: var(--estate-surface); --bs-dropdown-border-color: var(--estate-line);
    --bs-dropdown-link-active-bg: var(--estate-green); --bs-dropdown-link-hover-bg: var(--estate-tint); }
.progress { background: var(--estate-tint); }

/* -------- Module components (kept; re-tinted via aliases + tweaks) -------- */
.kpi { border-radius: 12px; padding: 1rem 1.15rem; background: var(--estate-surface); border: 1px solid var(--estate-line); height: 100%; }
.kpi .kpi-label { color: var(--estate-muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.kpi .kpi-value { font-family: var(--serif); font-size: 1.75rem; font-weight: 600; color: var(--estate-ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi.accent { border-top: 2px solid var(--estate-brass); }

.module-card { display: block; text-decoration: none; color: inherit; height: 100%; transition: transform .08s ease, box-shadow .08s ease; }
.module-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(28,42,34,.1); }
.module-card .badge-tag { font-size: .68rem; }

.insight { background: #fbf3dd; border: 1px solid #ead9ab; border-radius: 10px; padding: .6rem .8rem; margin-bottom: .5rem; }

/* ============================= Modern POS ============================= */
/* Floor: shift stat bar */
.pos-statbar { display: flex; flex-wrap: wrap; gap: 1.75rem; align-items: center;
    background: linear-gradient(120deg, var(--estate-green), var(--estate-green-2)); color: #fff; border-radius: 16px; padding: 1rem 1.4rem; }
.pos-statbar .stat .l { font-size: .66rem; text-transform: uppercase; letter-spacing: .09em; color: var(--estate-gold); }
.pos-statbar .stat .v { font-size: 1.2rem; font-weight: 700; font-family: var(--serif); }
.pos-statbar .spacer { flex: 1; }

/* Floor: table tiles */
.pos-room-label { font-family: var(--serif); color: var(--estate-muted); text-transform: uppercase; letter-spacing: .08em; font-size: .74rem; margin: 1.25rem 0 .5rem; }
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .9rem; }
.pos-table { position: relative; border-radius: 14px; padding: 1.1rem .9rem; min-height: 110px; display: flex; flex-direction: column; justify-content: center;
    text-align: center; text-decoration: none; border: 1px solid var(--estate-line); background: var(--estate-surface); color: var(--estate-ink);
    font-weight: 700; font-size: 1.2rem; font-family: var(--serif); transition: transform .08s ease, box-shadow .15s ease, border-color .15s; }
.pos-table:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(28,42,34,.14); }
.pos-table small { display: block; font-weight: 500; font-size: .72rem; color: var(--estate-muted); margin-top: .15rem; font-family: var(--sans); }
.pos-table .amt { font-family: var(--serif); font-weight: 700; color: var(--estate-green); font-size: 1rem; margin-top: .25rem; }
.pos-table::before { content: ""; position: absolute; top: .65rem; right: .65rem; width: .62rem; height: .62rem; border-radius: 50%; background: #7bbf95; box-shadow: 0 0 0 3px rgba(123,191,149,.2); }
.pos-table.free:hover { border-color: var(--estate-brass); }
.pos-table.occupied { background: #f5e0dd; border-color: #e6bdb6; color: #7d2b23; }
.pos-table.occupied::before { background: #d0574a; box-shadow: 0 0 0 3px rgba(208,87,74,.2); }
.pos-table.reserved { background: #e6eef4; border-color: #bfd0de; color: #2c516e; }
.pos-table.reserved::before { background: #5a8fb8; box-shadow: 0 0 0 3px rgba(90,143,184,.2); }
.pos-table.dirty { background: #f6ead2; border-color: #e2d0a4; color: #7a5010; }
.pos-table.dirty::before { background: #c79a30; box-shadow: 0 0 0 3px rgba(199,154,48,.2); }

/* Floor: service pulse strip */
.pos-pulse { display: flex; flex-wrap: wrap; align-items: stretch; background: var(--estate-tint);
    border: 1px solid var(--estate-line); border-bottom: 2px solid var(--estate-brass); border-radius: 12px; overflow: hidden; margin-bottom: 1rem; }
.pos-pulse .p { padding: .6rem 1.15rem; border-right: 1px solid var(--estate-line); min-width: 128px; }
.pos-pulse .p:last-child { border-right: none; }
.pos-pulse .p .l { font-size: .58rem; text-transform: uppercase; letter-spacing: .1em; color: var(--estate-muted); font-weight: 700; }
.pos-pulse .p .v { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; color: var(--estate-green); line-height: 1.15; font-variant-numeric: tabular-nums; }
.pos-pulse .p .v.gold { color: var(--estate-brass); }
.pos-pulse .p .s { font-size: .64rem; color: var(--estate-muted); }

/* Floor: legend swatches */
.pos-legend .sw { display: inline-block; width: .62rem; height: .62rem; border-radius: 2px; vertical-align: middle; }

/* Floor: living-check occupied card */
.pos-table.live { justify-content: flex-start; text-align: left; align-items: stretch; gap: .3rem;
    padding: .65rem .75rem .6rem 1rem; font-size: 1rem; background: var(--estate-surface); border-color: var(--estate-line); color: var(--estate-ink); }
.pos-table.live:hover { border-color: var(--estate-brass); }
.pos-table.live::before { display: none; }
.pos-table.live .tstripe { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; border-radius: 14px 0 0 14px; background: var(--st, var(--estate-line)); }
.pos-table.live.st-seated { --st: #c68a2e; } .pos-table.live.st-ordered { --st: #3f6ea3; } .pos-table.live.st-dining { --st: #2f8a7f; }
.pos-table.live.over { box-shadow: inset 0 0 0 2px #a83c34; }
.pos-table .trow { display: flex; align-items: center; justify-content: space-between; }
.pos-table .tnm { font-family: var(--serif); font-weight: 700; font-size: 1.35rem; color: var(--estate-green); line-height: 1; }
.pos-table .tcov { font-family: var(--sans); font-weight: 600; font-size: .74rem; color: var(--estate-muted); }
.pos-table .tbadge { align-self: flex-start; font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: #fff; background: var(--st, #888); border-radius: 3px; padding: 2px 7px; font-family: var(--sans); }
.pos-table .tmeta { display: flex; align-items: center; justify-content: space-between; margin-top: .1rem; }
.pos-table .tsvr { width: 22px; height: 22px; border-radius: 50%; background: var(--estate-green); color: #fff;
    display: grid; place-items: center; font-size: .58rem; font-weight: 700; font-family: var(--sans); }
.pos-table .ttime { font-family: var(--sans); font-weight: 700; font-size: .78rem; color: var(--estate-muted); }
.pos-table .ttime.warn { color: #c68a2e; } .pos-table .ttime.hot { color: #a83c34; }
.pos-table .titems { font-size: .68rem; color: var(--estate-muted); font-family: var(--sans); font-weight: 500; }
.pos-table .tamt { font-family: var(--serif); font-weight: 700; font-size: 1rem; color: var(--estate-ink); }

/* Order screen: two-pane layout */
.pos { display: grid; grid-template-columns: 1fr 384px; gap: 1rem; align-items: start; }
@media (max-width: 991px) { .pos { grid-template-columns: 1fr; } }

/* Category tabs */
.pos-cats { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .55rem; margin-bottom: .8rem; scrollbar-width: thin; }
.pos-cat { flex: 0 0 auto; border: 1px solid var(--estate-line); background: var(--estate-surface); color: var(--estate-ink); border-radius: 999px;
    padding: .55rem 1.15rem; font-weight: 600; cursor: pointer; white-space: nowrap; font-size: .9rem; }
.pos-cat:hover { border-color: var(--estate-brass); }
.pos-cat.active { background: var(--estate-green); color: #fff; border-color: var(--estate-green); }
.pos-panel { display: none; }
.pos-panel.active { display: block; }

/* Item tiles */
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: .7rem; }
.pos-item { display: flex; flex-direction: column; justify-content: space-between; min-height: 96px; border-radius: 14px; border: 1px solid var(--estate-line);
    background: var(--estate-surface); color: var(--estate-ink); padding: .75rem .8rem; text-align: left; text-decoration: none; font-weight: 600; width: 100%;
    transition: transform .08s ease, box-shadow .15s ease, border-color .15s; position: relative; overflow: hidden; }
.pos-item:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(28,42,34,.13); border-color: var(--estate-brass); color: var(--estate-ink); }
.pos-item .nm { font-size: .95rem; line-height: 1.2; padding-left: .3rem; }
.pos-item .pr { margin-top: .55rem; font-family: var(--serif); font-weight: 700; color: var(--estate-green); padding-left: .3rem; }
.pos-item .stn { position: absolute; top: 0; left: 0; width: 4px; height: 100%; }
.pos-item .stn.Kitchen { background: #d0874a; } .pos-item .stn.Grill { background: #c0532f; }
.pos-item .stn.Bar { background: #3f7d9a; } .pos-item .stn.Cold { background: #4f9d8e; } .pos-item .stn.Dessert { background: #9a6bbf; }
.pos-item.mods .nm::after { content: " ▸"; color: var(--estate-muted); }
.pos-item.eightsix { opacity: .5; cursor: not-allowed; }
.pos-item .flag { position: absolute; top: .4rem; right: .5rem; font-size: .7rem; }

/* Ticket rail (dark) */
.pos-ticket { position: sticky; top: 1rem; background: linear-gradient(180deg, var(--estate-green), var(--estate-green-2)); color: #f1ede2;
    border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 10px 28px rgba(22,58,43,.25); }
.pos-ticket-head { padding: .9rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.12); display: flex; justify-content: space-between; align-items: center; }
.pos-ticket-head .n { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; color: #fff; }
.pos-ticket-head small { color: #c9d6cd; }
.pos-ticket-lines { overflow-y: auto; padding: .4rem; max-height: 46vh; }
.pos-line { display: grid; grid-template-columns: auto 1fr auto; gap: .55rem; padding: .5rem; border-radius: 10px; align-items: start; }
.pos-line + .pos-line { border-top: 1px solid rgba(255,255,255,.07); }
.pos-line .q { background: rgba(255,255,255,.16); color: #fff; border-radius: 8px; min-width: 1.7rem; height: 1.7rem; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .82rem; }
.pos-line .nm { font-size: .92rem; color: #f4f1e8; }
.pos-line .sub { color: #b9c8bf; font-size: .74rem; }
.pos-line .pr { font-family: var(--serif); font-weight: 600; color: #fff; white-space: nowrap; }
.pos-line.void { opacity: .5; }
.pos-line.void .nm { text-decoration: line-through; }
.pos-line .acts { display: flex; gap: .25rem; margin-top: .3rem; }
.pos-line .btn-ico { background: rgba(255,255,255,.14); border: none; color: #fff; border-radius: 7px; min-width: 1.55rem; height: 1.55rem; line-height: 1; padding: 0 .4rem; font-weight: 700; font-size: .8rem; }
.pos-line .btn-ico:hover { background: rgba(255,255,255,.28); }
.pos-line .btn-ico.danger:hover { background: #c0532f; }
.pos-empty { text-align: center; color: #b9c8bf; padding: 2.5rem 1rem; }
.pos-ticket-foot { padding: .75rem 1.1rem; border-top: 1px solid rgba(255,255,255,.14); background: rgba(0,0,0,.14); }
.pos-ticket-foot .row-l { display: flex; justify-content: space-between; font-size: .82rem; color: #d3ddd6; padding: .12rem 0; }
.pos-ticket-foot .tot { display: flex; justify-content: space-between; font-family: var(--serif); font-size: 1.4rem; font-weight: 700; color: #fff; margin-top: .4rem; padding-top: .4rem; border-top: 1px solid rgba(255,255,255,.14); }
.pos-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding: .75rem; }
.pos-actions .btn { font-weight: 700; padding: .7rem; border-radius: 10px; }
.pos-actions .btn-settle { grid-column: 1 / -1; background: var(--estate-gold); border: none; color: #3a2f10; font-size: 1.05rem; }
.pos-actions .btn-settle:hover { filter: brightness(1.05); color: #3a2f10; }
.pos-line-mgr { background: var(--estate-surface); border-radius: 10px; padding: .5rem; margin: 0 .4rem .4rem; }

/* ---- Concept 2: order terminal (check on the left, menu on the right) ---- */
.pos-term { display: grid; grid-template-columns: 404px 1fr; gap: 1rem; align-items: start; }
@media (max-width: 991px) { .pos-term { grid-template-columns: 1fr; } }
.pos-mem { margin-top: .55rem; background: rgba(255,255,255,.07); border: 1px solid rgba(230,198,111,.4); border-radius: 12px; padding: .5rem .6rem; display: flex; gap: .55rem; align-items: center; }
.pos-mem .av { width: 34px; height: 34px; border-radius: 50%; background: var(--estate-gold); color: #3a2f10; display: grid; place-items: center; font-weight: 700; font-family: var(--serif); flex: 0 0 auto; }
.pos-mem .who { flex: 1; min-width: 0; }
.pos-mem .who .nm { font-weight: 600; color: #fff; font-size: .92rem; }
.pos-mem .who .no { font-size: .7rem; color: #c9d6cd; font-variant-numeric: tabular-nums; }
.pos-mem .lvl { font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: var(--estate-gold); color: #3a2f10; border-radius: 5px; padding: .12rem .38rem; align-self: flex-start; }
.pos-mem .btn-x { background: rgba(255,255,255,.16); border: none; color: #fff; border-radius: 7px; font-size: .66rem; padding: .18rem .45rem; align-self: flex-start; }
.pos-attach { margin-top: .55rem; display: flex; gap: .4rem; }
.pos-attach input { flex: 1; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.92); color: var(--estate-ink); padding: .32rem .5rem; font-size: .82rem; }
.pos-attach button { border: none; border-radius: 8px; background: var(--estate-gold); color: #3a2f10; font-weight: 700; font-size: .78rem; padding: .32rem .6rem; white-space: nowrap; }
.pos-alerts { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .45rem; }
.pos-alert { font-size: .65rem; font-weight: 700; background: #7d2b23; color: #ffdfd9; border-radius: 6px; padding: .16rem .42rem; }
.pos-alert.diet { background: rgba(255,255,255,.12); color: #e7f1ea; }
.pos-line .pr .was { display: block; font-size: .66rem; color: #9fb2a6; text-decoration: line-through; font-weight: 400; text-align: right; }
.pos-line .sub.warn { color: #ffb3aa; font-weight: 600; }
.pos-search { display: flex; align-items: center; gap: .5rem; background: var(--estate-surface); border: 1px solid var(--estate-line); border-radius: 10px; padding: .38rem .7rem; margin-bottom: .7rem; color: var(--estate-muted); }
.pos-search input { border: none; background: transparent; outline: none; flex: 1; color: var(--estate-ink); font-size: .9rem; }
.pos-cell { position: relative; display: flex; }
.pos-cell > form { display: flex; width: 100%; }
.pos-item .pr .was { font-size: .72rem; color: var(--estate-muted); text-decoration: line-through; margin-left: .3rem; font-weight: 400; }
.pos-item .memtag { position: absolute; top: .35rem; right: .4rem; font-size: .52rem; font-weight: 700; background: var(--estate-gold); color: #3a2f10; border-radius: 4px; padding: .08rem .3rem; letter-spacing: .02em; }
.pos-item .aller { position: absolute; top: .3rem; right: .4rem; font-size: .74rem; }
.pos-86 { position: absolute; bottom: .35rem; right: .4rem; z-index: 2; margin: 0; }
.pos-86 button { font-size: .55rem; color: var(--estate-muted); border: 1px solid var(--estate-line); border-radius: 5px; padding: .04rem .32rem; background: #fff; opacity: 0; transition: opacity .1s; font-weight: 700; }
.pos-cell:hover .pos-86 button { opacity: 1; }
.pos-86 button:hover { border-color: #c0532f; color: #c0532f; }
.pos-menu.searching .pos-panel { display: block; }
.pos-menu.searching .pos-cats { opacity: .5; pointer-events: none; }
.pos-cell.hidden { display: none; }

/* ---- Concept 3: settle pad ---- */
.pos-pad { display: grid; grid-template-columns: 320px 1fr 300px; gap: 1rem; align-items: start; }
@media (max-width: 1200px) { .pos-pad { grid-template-columns: 1fr 1fr; } }
@media (max-width: 767px) { .pos-pad { grid-template-columns: 1fr; } }
.pay-memcard { background: linear-gradient(180deg, var(--estate-green), var(--estate-green-2)); color: #eef3ee; border-radius: 12px; padding: .7rem .8rem; }
.pay-memcard .nm { font-family: var(--serif); font-size: 1.05rem; color: #fff; }
.pay-memcard .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .55rem; }
.pay-memcard .k { font-size: .56rem; text-transform: uppercase; letter-spacing: .06em; color: #bcd0c4; }
.pay-memcard .v { font-family: var(--serif); font-size: 1.05rem; color: #fff; font-variant-numeric: tabular-nums; }
.pay-memcard .v.gold { color: var(--estate-gold); }
.pay-memcard .v.red { color: #ffb3aa; }
.tenders { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.tender-tile { border: 1px solid var(--estate-line); background: var(--estate-surface); border-radius: 12px; padding: .6rem .35rem; text-align: center; font-weight: 600; font-size: .8rem; cursor: pointer; display: flex; flex-direction: column; gap: .22rem; align-items: center; color: var(--estate-ink); user-select: none; }
.tender-tile .ic { font-size: 1.1rem; }
.tender-tile:hover { border-color: var(--estate-brass); }
.tender-tile.sel { border-color: var(--estate-green); box-shadow: inset 0 0 0 1px var(--estate-green); background: #eef4f0; }
.tender-tile.house { border-color: var(--estate-brass); }
.amt-display { display: flex; align-items: center; justify-content: space-between; margin: .7rem 0 .5rem; background: var(--estate-tint); border: 1px solid var(--estate-line); border-radius: 10px; padding: .45rem .8rem; }
.amt-display .l { font-size: .64rem; text-transform: uppercase; letter-spacing: .06em; color: var(--estate-muted); font-weight: 700; }
.amt-display .v { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; color: var(--estate-ink); font-variant-numeric: tabular-nums; }
.keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.keypad button { border: 1px solid var(--estate-line); background: #fff; border-radius: 10px; padding: .6rem; text-align: center; font-size: 1rem; font-weight: 600; font-family: var(--serif); color: var(--estate-ink); }
.keypad button:hover { border-color: var(--estate-brass); }
.keypad button.wide { grid-column: span 2; }
.keypad button.act { background: var(--estate-tint); }
.applied { margin-top: .7rem; }
.applied .a { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; padding: .25rem 0; border-bottom: 1px solid var(--estate-line); }
.applied .a .rm { border: none; background: none; color: var(--estate-muted); font-weight: 700; cursor: pointer; }
.remain { display: flex; justify-content: space-between; font-family: var(--serif); font-weight: 700; margin-top: .5rem; font-size: 1.05rem; }
.remain .ok { color: #2f8a7f; } .remain .due { color: #a83c34; }
.split-opt { border: 1px solid var(--estate-line); border-radius: 9px; padding: .5rem .6rem; font-size: .85rem; display: flex; justify-content: space-between; align-items: center; background: var(--estate-surface); text-decoration: none; color: var(--estate-ink); margin-bottom: .4rem; }
.split-opt:hover { border-color: var(--estate-brass); color: var(--estate-ink); }

.d-contents { display: contents; }
.menu-btn { width: 100%; text-align: left; margin-bottom: .4rem; }
.kot-card { border-left: 4px solid var(--estate-brass); }
.status-pill { font-size: .72rem; padding: .2rem .5rem; border-radius: 1rem; }

.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--estate-green); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.2rem; letter-spacing: 1px; font-family: var(--serif); }

.timeline { list-style: none; padding-left: 0; margin: 0; }
.timeline li { padding: .35rem 0 .35rem 1rem; border-left: 2px solid var(--estate-line); position: relative; }
.timeline li:before { content: ""; position: absolute; left: -5px; top: .8rem; width: 8px; height: 8px; border-radius: 50%; background: var(--estate-brass); }
.timeline .t-type { font-weight: 600; color: var(--estate-green); margin-right: .3rem; }

.bar { background: var(--estate-tint); border-radius: 4px; height: 10px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--estate-green); }
.bar.danger > span { background: #9a382f; }

/* Membership card (re-tinted to the Estate; brass foil accents) */
.member-card { width: 100%; max-width: 380px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--estate-green), var(--estate-green-2)); box-shadow: 0 8px 24px rgba(22,58,43,.3); overflow: hidden; }
.member-card .mc-top { display: flex; justify-content: space-between; align-items: flex-start; padding: 14px 16px 0; }
.member-card .mc-club { font-family: var(--serif); font-weight: 700; letter-spacing: 1px; font-size: .8rem; }
.member-card .mc-type { font-size: .72rem; opacity: .8; }
.member-card .mc-os { font-family: var(--serif); font-weight: 700; }
.member-card .mc-os span { color: var(--estate-gold); }
.member-card .mc-body { display: flex; justify-content: space-between; align-items: flex-end; padding: 10px 16px 16px; gap: 12px; }
.member-card .mc-name { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.member-card .mc-no { font-family: monospace; letter-spacing: 1px; opacity: .9; }
.member-card .mc-meta { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.member-card .mc-exp { font-size: .72rem; opacity: .85; }
.member-card .mc-qr { background: #fff; padding: 5px; border-radius: 8px; width: 92px; height: 92px; flex: 0 0 auto; }
.member-card .mc-qr svg { width: 100%; height: 100%; display: block; }

/* ------------------------------- Dark mode -------------------------------- */
/* The layout stamps data-theme + data-bs-theme on <html> from a saved choice or
   the OS setting; the @media block is a no-JS fallback for the core tokens. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --estate-ground: #151d18; --estate-surface: #1e2823; --estate-ink: #e9e4d6; --estate-muted: #9aa79e;
        --estate-line: #2d3a32; --estate-green: #245741; --estate-green-2: #1c4634; --estate-brass: #c6a24e;
        --estate-tint: #26312b; --estate-input-bg: #141c17;
    }
}
:root[data-theme="dark"] {
    --estate-ground: #151d18; --estate-surface: #1e2823; --estate-ink: #e9e4d6; --estate-muted: #9aa79e;
    --estate-line: #2d3a32; --estate-green: #245741; --estate-green-2: #1c4634; --estate-brass: #c6a24e;
    --estate-tint: #26312b; --estate-input-bg: #141c17;
}
:root[data-theme="dark"] .text-bg-success { background: #1d3a2b !important; color: #8ed3a8 !important; }
:root[data-theme="dark"] .text-bg-warning { background: #3a3016 !important; color: #e6c477 !important; }
:root[data-theme="dark"] .text-bg-danger  { background: #3d211d !important; color: #f0a79c !important; }
:root[data-theme="dark"] .text-bg-secondary { background: #2b332c !important; color: #b6c0b6 !important; }
:root[data-theme="dark"] .text-bg-info    { background: #1e2f3a !important; color: #96c2e0 !important; }
:root[data-theme="dark"] .text-bg-light   { background: #26312b !important; color: #c7cfc6 !important; }
:root[data-theme="dark"] .bg-warning-subtle { background: #3a3016 !important; }
:root[data-theme="dark"] .alert-success { --bs-alert-bg: #1d3a2b; --bs-alert-border-color: #2b5140; --bs-alert-color: #9fe0bd; }
:root[data-theme="dark"] .alert-info { --bs-alert-bg: #1e2f3a; --bs-alert-border-color: #2c4655; --bs-alert-color: #a9d3ec; }
:root[data-theme="dark"] .alert-secondary { --bs-alert-bg: #26312b; --bs-alert-border-color: #2d3a32; --bs-alert-color: #b6c0b6; }
:root[data-theme="dark"] .insight { background: #2a2a17; border-color: #4a4522; color: #e9e4d6; }
:root[data-theme="dark"] .pos-table.occupied { background: #3d211d; border-color: #5a2f28; color: #f0a79c; }
:root[data-theme="dark"] .pos-table.reserved { background: #1e2f3a; border-color: #2c4655; color: #96c2e0; }
:root[data-theme="dark"] .pos-table.dirty { background: #3a3016; border-color: #544824; color: #e6c477; }
:root[data-theme="dark"] .card { box-shadow: none; }

.theme-toggle { display: inline-flex; align-items: center; gap: 7px; color: #cfc9b9; font-size: .8rem; text-decoration: none; padding: 5px 0; background: none; border: 0; cursor: pointer; }
.theme-toggle:hover { color: #fff; }
.theme-toggle .moon { display: inline; } .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; } :root[data-theme="dark"] .theme-toggle .sun { display: inline; }

@media print {
    .app-sidebar, .app-topbar, .app-foot, .btn, form { display: none !important; }
    .app, .app-main, .app-content { display: block !important; padding: 0 !important; }
    body { background: #fff; }
    .statement, .card { box-shadow: none !important; border: none !important; }
}
