/* Workspace hierarchy: station navigation, section navigation, then the task. */
:root {
  --selection-surface: #F8EBDD;
  --selection-ink: #87430D;
  --selection-border: #E6C7A7;
}
.app-shell { padding-left: 0; }
.topbar { position: sticky; inset: 0 0 auto; width: 100%; border: 0; border-bottom: 1px solid var(--border-strong); background: #fff; }
.topbar-in.wrap { height: 64px; align-items: center; padding: 0 28px; flex-direction: row; gap: 22px; }
.brand { margin: 0 20px 0 0; }
.brand b { font-size: 34px; }
.topnav { width: auto; flex-direction: row; gap: 4px; height: 100%; }
.topnav a { flex-direction: row; height: 100%; padding: 0 18px; gap: 8px; font-size: 14px; border-radius: 0; }
.topnav a.active { background: transparent; box-shadow: inset 0 -3px var(--orange); font-weight: 600; }
.topnav a .ic { width: 18px; height: 18px; }
.topbar-in > .spacer { display: block; }
.session-name { font-size: 12px; color: var(--muted); }
.context-navigation { background: #fff; border-bottom: 1px solid var(--border); }
.context-navigation .subnav { margin: 0 auto; padding: 0 34px; gap: 26px; min-height: 48px; align-items: stretch; }
.subnav .chip { border: 0; border-radius: 0; background: transparent; padding: 0 2px; height: auto; box-shadow: none; }
.subnav .chip.active { box-shadow: inset 0 -2px var(--ink); color: var(--ink); }
.container { padding-top: 28px; }
.pagehead { align-items: center; margin-bottom: 24px; }
.pagehead h1 { font-size: 34px; }
.pagehead > .btn { margin-left: auto; }
.shell2 { grid-template-columns: 236px minmax(0,1fr); }
.admin-navigation { top: 64px; max-height: calc(100dvh - 64px); padding: 22px 18px; border-right: 1px solid var(--border); background: #FAFAF7; }
.main-col { padding-left: 30px; }
.sidenav a { padding: 8px 10px; gap: 10px; min-height: 36px; font-size: 13px; font-weight: 450; letter-spacing: -.1px; border-radius: 5px; }
.sidenav a.active { background: var(--selection-surface); color: var(--selection-ink); box-shadow: inset 2px 0 var(--orange); font-weight: 500; }
.sidenav a.active .ic { color: var(--selection-ink); }
.sidenav a.active::after { content: ""; margin-left: auto; width: 5px; height: 5px; border-top: 1px solid var(--selection-ink); border-right: 1px solid var(--selection-ink); transform: rotate(45deg); }
.sidenav .sgroup { margin: 0; padding: 20px 10px 8px; color: #71756C; font-size: 10px; line-height: 1.4; letter-spacing: .06em; font-weight: 500; text-transform: uppercase; }
.floor-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; border-bottom: 1px solid var(--border-strong); }
.status-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.status-tabs a { display: flex; gap: 8px; align-items: center; padding: 14px 12px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.status-tabs a b { font-size: 12px; background: #E5E6E1; border-radius: 3px; padding: 0 5px; }
.status-tabs a.active { color: var(--ink); border-color: var(--orange); font-weight: 600; }
.status-tabs a.active b { background: var(--cream); }
.area-filter { display: flex; align-items: center; gap: 10px; flex-shrink: 0; font-size: 12px; }
.area-filter select { width: auto; min-height: 36px; height: 36px; }
.floor { grid-template-columns: repeat(auto-fill,minmax(210px,1fr)); gap: 16px; }
.mesa-card { border-top-width: 1px; overflow: visible; }
.mesa-card .m-link { padding: 18px; }
.mesa-card .m-num { font-size: 30px; }
.table-options { border-top: 1px solid var(--border); }
.table-options summary { padding: 10px 18px; font-size: 12px; color: var(--muted); cursor: pointer; }
.table-options[open] { background: #F4F4EF; }
.table-options .m-foot { border: 0; flex-wrap: wrap; }
.table-options .m-foot select { min-width: 0; flex: 1; }
.cash-workspace { display: grid; grid-template-columns: minmax(0,1fr) 292px; gap: 28px; align-items: start; }
.cash-queue { min-width: 0; }
.cash-context { border-left: 1px solid var(--border-strong); padding-left: 24px; }
.cash-context .panel { background: transparent; border: 0; padding: 0 0 24px; margin: 0 0 24px; border-bottom: 1px solid var(--border); }
.cash-context h2 { font-size: 16px; }
.shift-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 18px; }
.text-link { font-size: 13px; color: var(--ink); text-underline-offset: 4px; }
.cash-context .cash-summary { display: flex; flex-direction: column; gap: 0; border: 0; }
.cash-context .cash-summary .stat { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border: 0; border-bottom: 1px solid var(--border); background: transparent; border-radius: 0; }
.cash-context .cash-summary .s-k { color: var(--muted); order: -1; margin: 0; font-size: 12px; }
.cash-context .cash-summary .s-v { font-family: Barlow,sans-serif; font-size: 17px; }
.bill { border-radius: 6px; box-shadow: none; margin-bottom: 18px; }
.bill-head { flex-wrap: wrap; }
.bill-detail summary { padding: 12px 20px; cursor: pointer; font-size: 13px; color: var(--muted); }
.bill-foot { gap: 8px; border-top: 1px solid var(--border); padding: 14px 20px; }
.bill-foot .btn { font-size: 12px; }
.history-disclosure { margin-top: 28px; border: 1px solid var(--border-strong); border-radius: 6px; background: #fff; scroll-margin-top: 84px; }
.history-disclosure > summary, .kitchen-filters > summary { cursor: pointer; padding: 18px 20px; font-weight: 600; }
.history-disclosure > summary span, .kitchen-filters > summary span { margin-left: 16px; font-weight: 400; font-size: 12px; color: var(--muted); }
.history-body.panel { margin: 0; border: 0; border-top: 1px solid var(--border); }
.kitchen-filters { border: 1px solid var(--border); border-radius: 5px; background: #fff; }
.kitchen-filters form { padding: 0 20px 20px; }
.kitchen-status .stat { display: flex; align-items: center; gap: 12px; padding: 12px 18px; }
.kitchen-status .s-v { font-size: 25px; }
.kitchen-status .s-k { margin: 0; }
@media(max-width:1050px) {
  .topbar-in.wrap { gap: 10px; padding: 0 22px; }
  .topnav a { padding: 0 12px; }
  .session-name { display: none; }
  .floor-toolbar { flex-wrap: wrap; padding-bottom: 12px; gap: 10px; }
  .cash-workspace { grid-template-columns: minmax(0,1fr) 246px; gap: 20px; }
  .cash-context { padding-left: 18px; }
}
@media(min-width:701px) and (max-width:1000px) {
  .shell2 { grid-template-columns: 212px minmax(0,1fr); padding-left: 0; }
  .admin-navigation .nav-toggle { display: none; }
  .admin-navigation .sidenav { display: block; border: 0; padding: 0; }
  .sidenav .sgroup { display: flex; }
}
@media(max-width:700px) {
  .app-shell { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .topbar-in.wrap { height: 54px; padding: 0 16px; gap: 12px; }
  .brand b { font-size: 30px; }
  .topbar .iconbtn { width: 40px; height: 40px; }
  .topnav { height: calc(64px + env(safe-area-inset-bottom)); width: 100%; gap: 2px; background: #fff; border-top: 1px solid var(--border-strong); }
  .topnav a { height: 56px; flex-direction: column; padding: 6px 0; font-size: 11px; gap: 4px; }
  .topnav a.active { background: var(--cream); box-shadow: inset 0 2px var(--orange); border-radius: 4px; }
  .context-navigation .subnav { flex-wrap: wrap; display: flex; gap: 4px 18px; padding: 0 16px; min-height: 44px; overflow: visible; }
  .context-navigation .subnav .chip { min-height: 44px; font-size: 13px; }
  .context-navigation .cash-subnav .chip { flex: 1; }
  .container { padding-top: 20px; }
  .pagehead { gap: 12px; margin-bottom: 20px; }
  .pagehead h1 { font-size: 31px; }
  .pagehead .sub { font-size: 13px; margin-top: 6px; }
  .pagehead > .btn { margin-left: 0; }
  .pagehead .actions { gap: 8px; }
  .pagehead .actions .btn { min-height: 42px; }
  .shell2 { display: block; padding-left: 16px; padding-right: 16px; }
  .admin-navigation { position: static; max-height: none; padding: 0; border: 0; background: transparent; }
  .main-col { padding-left: 0; }
  .sidenav a { min-height: 44px; }
  .floor-toolbar { margin-bottom: 16px; padding-bottom: 12px; }
  .status-tabs { gap: 2px; width: 100%; }
  .status-tabs a { padding: 10px 8px; font-size: 12px; gap: 5px; min-height: 44px; }
  .area-filter { width: 100%; justify-content: space-between; }
  .area-filter select { min-height: 42px; flex: 1; max-width: 230px; }
  .floor { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .mesa-card .m-link { padding: 13px; }
  .mesa-card .m-top { flex-wrap: wrap; gap: 8px; }
  .mesa-card .m-num { font-size: 26px; }
  .mesa-card .m-flag { margin-left: 0; }
  .table-options summary { padding: 12px; min-height: 44px; }
  .cash-workspace { display: flex; flex-direction: column; gap: 20px; }
  .cash-queue, .cash-context { width: 100%; }
  .cash-context { border-left: 0; border-top: 1px solid var(--border-strong); padding: 20px 0 0; }
  .cash-context .panel { margin-bottom: 12px; padding-bottom: 18px; }
  .cash-context .cash-summary .stat { padding: 10px 0; }
  .bill-head { padding: 14px; gap: 8px; }
  .bill-total { width: 100%; margin-left: 0; display: flex; align-items: baseline; justify-content: space-between; }
  .bill-detail summary { padding: 12px 14px; min-height: 44px; }
  .bill-foot { padding: 12px; display: grid; grid-template-columns: minmax(0,1fr); }
  .bill-foot .inline { grid-column: 1 / -1; order: 1; }
  .bill-foot .btn { width: 100%; min-height: 44px; }
  .history-disclosure { margin-top: 16px; scroll-margin-top: 68px; }
  .history-disclosure > summary span, .kitchen-filters > summary span { display: block; margin: 4px 0 0 16px; }
  .kitchen-status { gap: 6px; }
  .kitchen-status .stat { flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px; }
}

/* Grid items must be allowed to shrink before their content wraps. */
.admin-dash > * { min-width: 0; }
@media(max-width:700px) {
  .admin-dash { grid-template-columns: minmax(0,1fr); }
  .admin-dash .cash-records tbody td { height: auto; padding: 0; }
}

/* Typography and navigation identity. Local font, no third-party requests. */
@font-face { font-family: 'IBM Plex Sans'; src: url('../fonts/IBMPlexSans-Variable.ttf') format('truetype'); font-weight: 100 900; font-stretch: 75% 100%; font-display: swap; }
.app-shell { font-family: 'IBM Plex Sans', sans-serif; font-size: 13px; }
.app-shell .pagehead h1 { font-family: 'IBM Plex Sans', sans-serif; font-weight: 500; font-size: 29px; line-height: 1.2; letter-spacing: -1px; }
.app-shell .pagehead .sub { font-size: 12px; line-height: 1.6; }
.app-shell .eyebrow { font-size: 10px; letter-spacing: .06em; margin-bottom: 8px; }
.app-shell h2 { font-weight: 500; }
.app-shell .kpi .v[class] { font: 500 30px/1.2 'IBM Plex Sans', sans-serif; letter-spacing: -1.1px; }
.app-shell .stat .s-v { font-family: 'IBM Plex Sans', sans-serif; font-weight: 500; }
.app-shell .btn { font-weight: 500; }
.app-shell .topnav a { font-size: 13px; font-weight: 450; }
.app-shell .topnav a.active { font-weight: 600; }
.app-shell .topnav a .ic { width: 17px; height: 17px; }
.nav-identity { padding: 0 10px 17px; }
.nav-identity strong { display: block; font-size: 14px; font-weight: 500; letter-spacing: -.25px; }
.nav-identity span { display: block; margin-top: 3px; font-size: 10px; color: var(--muted); }
.nav-search { position: relative; margin: 0 4px 4px; }
.nav-search .ic { position: absolute; left: 10px; top: 11px; width: 14px; height: 14px; color: #71756C; pointer-events: none; }
.nav-search input { width: 100%; height: 36px; min-height: 36px; padding: 0 8px 0 31px; border: 1px solid #DEDFD9; border-radius: 5px; background: #F0F1EC; font-size: 11px; }
.nav-search input:focus { background: #fff; }
.nav-search input::placeholder { color: #666C62; opacity: 1; }
.nav-no-results { margin: 16px 10px; font-size: 12px; color: var(--muted); }
.sidenav .ic { width: 15px; height: 15px; color: #797E74; }
.sidenav a { transition: background-color 120ms ease, color 120ms ease; }
.sidenav a:hover:not(.active) { background: #EBEDE5; color: #252622; }
@media(max-width:700px) {
  .app-shell .pagehead h1 { font-size: 25px; letter-spacing: -.65px; }
  .app-shell .topnav a { font-size: 10px; }
  .app-shell .kpi .v[class] { font-size: 25px; }
  .admin-navigation .sidenav { display: block; padding: 14px 0; }
  .admin-navigation .nav-toggle[aria-expanded='false'] + .sidenav { display: none; }
  .nav-identity { display: none; }
  .nav-search { margin: 0 0 6px; }
  .nav-search input { min-height: 44px; font-size: 16px; }
  .nav-search .ic { top: 15px; }
  .nav-sections { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 12px; }
  .sidenav .sgroup { display: block; padding: 18px 8px 6px; font-size: 9px; }
  .sidenav a { padding: 10px 8px; min-height: 44px; font-size: 11px; gap: 7px; }
  .sidenav a.active::after { display: none; }
  .sidenav .nbadge { padding: 1px 5px; }
}
@media(prefers-reduced-motion:reduce) { .sidenav a { transition: none; } }

/* Shared warm accents connect navigation, filters and the daily total. */
.app-shell .eyebrow { display: flex; align-items: center; gap: 8px; }
.app-shell .eyebrow::before { content: ''; width: 14px; height: 2px; background: var(--orange); flex-shrink: 0; }
.app-shell .kpi.kpi-total { background: #FBF4E9; box-shadow: inset 0 2px var(--orange); }
.app-shell .kpi.kpi-total .k { color: var(--selection-ink); font-weight: 500; }
.app-shell .chips:not(.subnav) > .chip.active { color: var(--selection-ink); background: var(--selection-surface); border-color: var(--selection-border); }
.app-shell .subnav .chip.active { box-shadow: inset 0 -2px var(--orange); }
.quick-actions .btn:hover, .quick-actions .btn:focus-visible { color: var(--selection-ink); background: #FBF4E9; }
.sidenav a.active:hover { background: #F3E1CC; }
@media(max-width:700px) {
  .topnav a.active { background: var(--selection-surface); color: var(--selection-ink); }
}

/* Depth: a quieter canvas underneath raised work surfaces. */
.app-shell {
  --bg: #EBEDE7;
  --secondary: #E5E8DF;
  --border: #CFD3C8;
  --muted: #5E6458;
  --surface-shadow: 0 1px 2px rgb(37 44 28 / 5%), 0 6px 18px -7px rgb(37 44 28 / 16%);
  background: var(--bg);
}
.app-shell .topbar { box-shadow: 0 2px 8px rgb(37 44 28 / 5%); }
.app-shell .admin-navigation { background: #F4F5F0; border-right-color: #CDD1C5; }
.app-shell :is(.panel, .card, .table-wrap, .kpis, .bill, .mesa-card, .history-disclosure) { box-shadow: var(--surface-shadow); }
/* Nested content stays on its parent's surface rather than stacking shadows. */
.app-shell :is(.panel, .card) :is(.panel, .card, .table-wrap),
.app-shell .cash-context .panel,
.app-shell .form-sheet .panel,
.app-shell .history-body.panel { box-shadow: none; }
.app-shell .tbl thead th { color: #50574A; }
.app-shell .modal { box-shadow: 0 24px 70px rgb(20 26 16 / 24%), 0 4px 14px rgb(20 26 16 / 12%); }
@media(max-width:700px) {
  .app-shell .admin-navigation { background: transparent; }
  .app-shell .topnav { box-shadow: 0 -3px 12px rgb(37 44 28 / 7%); }
  .app-shell .table-wrap:has(> .cash-records) { box-shadow: none; }
}

/* Page headings: a consistent editorial signature with a warm rule. */
.app-shell .pagehead {
  position: relative;
  align-items: center;
  padding: 2px 0 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid #BDC3B5;
  gap: 24px;
}
.app-shell .pagehead::after {
  content: ''; position: absolute; bottom: -1px; left: 0;
  width: 48px; height: 3px; background: var(--orange);
}
.app-shell .pagehead h1 {
  font-size: 34px; line-height: 1.15; font-weight: 550;
  font-stretch: 95%; letter-spacing: -1.15px;
}
.app-shell .pagehead .eyebrow {
  color: var(--selection-ink); font-size: 10px; font-weight: 500;
  letter-spacing: .09em; margin: 0 0 9px;
}
.app-shell .pagehead .eyebrow::before { display: none; }
.app-shell .pagehead .sub { margin-top: 10px; max-width: 620px; color: #535C4C; }
.app-shell .pagehead .actions {
  border-left: 1px solid #CDD1C5; padding-left: 22px;
  justify-content: flex-end; flex-shrink: 0;
}
.app-shell .pagehead > div:first-child { min-width: 0; }
.app-shell .pagehead + .section { margin-top: 0; }
.app-shell .section > h2, .app-shell .sectiontitle h2 {
  font-size: 17px; font-weight: 550; letter-spacing: -.35px;
}
@media(max-width:1000px) {
  .app-shell .pagehead .actions { flex-shrink: 1; }
}
@media(max-width:700px) {
  .app-shell .pagehead { padding-bottom: 20px; margin-bottom: 22px; gap: 16px; align-items: stretch; }
  .app-shell .pagehead h1 { font-size: 28px; letter-spacing: -.8px; }
  .app-shell .pagehead .eyebrow { font-size: 9px; margin-bottom: 7px; }
  .app-shell .pagehead .actions { border-left: 0; padding-left: 0; justify-content: flex-start; }
  .app-shell .pagehead .sub { margin-top: 8px; }
}

/* Floor objects: table and seats convey the purpose before reading the data. */
.service-floor { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.service-floor .mesa-card { --table-tone: #52654B; --table-fill: #F2F5ED; border-top: 1px solid var(--border); border-radius: 9px; }
.service-floor .st-ocupada { --table-tone: #985419; --table-fill: #FAEBD9; }
.service-floor .st-reservada { --table-tone: #86651D; --table-fill: #FBF3D8; }
.service-floor .st-en_limpieza { --table-tone: #64727A; --table-fill: #ECF0F1; }
.service-floor .st-cuenta { --table-tone: #9C4809; --table-fill: #F9E1C5; }
.service-floor .m-link { padding: 15px 16px 17px; }
.service-floor .m-top { justify-content: space-between; gap: 8px; margin: 0; }
.table-area { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.service-floor .m-flag { margin-left: auto; }
.service-floor .m-flag .badge { background: transparent; border: 0; color: var(--table-tone); font-size: 11px; padding: 0; display: flex; align-items: center; gap: 5px; }
.service-floor .m-flag .badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.table-scene { margin: 19px auto 15px; width: 146px; display: grid; justify-items: stretch; gap: 5px; }
.table-surface { min-height: 70px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--table-tone); background: var(--table-fill); border-radius: 13px; box-shadow: 0 3px 0 #0000000B; }
.service-floor .m-num { font: 500 24px/1.2 'IBM Plex Sans',sans-serif; letter-spacing: -.8px; color: var(--table-tone) !important; overflow-wrap: anywhere; white-space: normal; text-align: center; }
.table-surface .ic { color: var(--table-tone); }
.table-seats { display: flex; justify-content: space-evenly; gap: 4px; padding: 0 12px; height: 7px; }
.table-seats span { width: 24px; min-width: 0; border: 1px solid var(--table-tone); background: var(--table-fill); border-radius: 4px 4px 1px 1px; }
.seats-bottom span { border-radius: 1px 1px 4px 4px; }
.service-floor .m-info { text-align: center; font-size: 11px; color: var(--muted); }
.service-floor .m-live { justify-content: center; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); gap: 4px 10px; }
.service-floor .m-total { font-size: 18px; font-weight: 500; color: var(--table-tone); }
.service-floor .m-time { font-size: 11px; }
.service-floor .table-options { background: #F6F7F2; border-radius: 0 0 9px 9px; }
.service-floor .table-options summary { font-size: 11px; }
.service-floor .mesa-card:has(.m-link:hover), .service-floor .mesa-card:has(.m-link:focus-visible) { border-color: var(--table-tone); }
.service-floor .m-link:hover .table-surface { box-shadow: 0 3px 0 #0000000B, 0 0 0 3px var(--table-fill); }
.sr-table-code { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.takeaway-counter { background: #F8F3E9; border: 1px solid #D5C9B6; border-left: 3px solid var(--orange); border-radius: 8px; padding: 16px 20px; }
.takeaway-counter .t-icon { width: 52px; height: 52px; border: 1px dashed #BD9D74; border-radius: 8px; color: var(--selection-ink); background: #FFF9EF; }
.takeaway-counter > .ic { border-left: 1px dashed #BD9D74; box-sizing: content-box; padding-left: 18px; }
@media(max-width:700px) {
  .service-floor { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .service-floor .m-link { padding: 12px 10px; }
  .service-floor .m-top { align-items: flex-start; }
  .table-scene { width: min(100%, 124px); margin: 16px auto 12px; }
  .table-surface { min-height: 64px; border-radius: 11px; }
  .service-floor .m-num { font-size: 21px; }
  .service-floor .m-flag .badge, .table-area { font-size: 10px; }
  .service-floor .table-options summary { padding: 12px 10px; }
}
