/* Tiko OS — Pedidos e KDS do bar */
.orders-toolbar,
.kds-toolbar{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:end;
  margin:18px 0;
}

.orders-toolbar label,
.kds-toolbar label{
  margin:0;
  min-width:210px;
}

.orders-card-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.order-list-card{position:relative;overflow:hidden;border:1px solid rgba(183,123,44,.5);border-radius:9px;padding:17px;background:linear-gradient(145deg,rgba(90,50,18,.15),transparent 35%),linear-gradient(180deg,#19140f,#100d0b);box-shadow:inset 0 0 0 2px rgba(0,0,0,.4),0 9px 22px rgba(0,0,0,.2)}
.order-list-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.order-list-head h3{margin:2px 0 4px;font:700 20px Georgia,serif;color:#f0ce86}
.order-card-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:13px 0}
.order-card-detail{min-width:0;padding:8px;border:1px solid rgba(134,91,43,.32);border-radius:7px;background:rgba(4,3,2,.35)}
.order-card-detail span{display:block;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.06em}
.order-card-detail strong{display:block;margin-top:3px;overflow-wrap:anywhere;font-size:13px}
.order-card-detail.is-total strong{color:var(--gold);font-size:16px}.order-card-detail.is-muted strong{color:#aaa093;font-weight:500}.order-card-detail.is-wide{grid-column:1/-1}

.order-code{
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:12px;
  color:var(--muted);
}

.order-status.accepted,
.kds-status.queued{
  background:#493715;
  color:#ffd77d;
}

.order-status.in_production,
.kds-status.in_progress{
  background:#30265b;
  color:#cbbcff;
}

.order-status.ready,
.kds-status.ready{
  background:#17403c;
  color:#77ead9;
}

.order-status.completed,
.kds-status.delivered{
  background:#173b2b;
  color:#7ee2ae;
}

.order-status.cancelled,
.kds-status.cancelled{
  background:#431b20;
  color:#ff9ea5;
}

.order-status.reconciliation_required{
  background:#4d2918;
  color:#ffc89b;
}

.order-detail-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px 18px;
  margin:12px 0 18px;
}

.order-detail-grid article{
  border:1px solid var(--line);
  border-radius:10px;
  padding:12px;
  background:#120e16;
}

.order-items-list{
  display:grid;
  gap:10px;
}

.order-item-card{
  border:1px solid var(--line);
  border-radius:12px;
  padding:13px;
  background:#15101a;
}

.order-item-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
}

.order-options{
  margin:8px 0 0 18px;
  color:var(--muted);
}

.order-events{
  display:grid;
  gap:8px;
  margin-top:12px;
}

.order-event{
  border-left:3px solid var(--gold);
  padding:8px 10px;
  background:#120e16;
  border-radius:0 8px 8px 0;
}

.kds-board{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}

.kds-ticket{
  border:1px solid rgba(183,123,44,.55);
  border-radius:9px;
  padding:16px;
  background:linear-gradient(145deg,rgba(91,52,18,.16),transparent 35%),linear-gradient(180deg,#19140f,#100d0b);
  box-shadow:inset 0 0 0 2px rgba(0,0,0,.42),0 8px 20px rgba(0,0,0,.22);
}

.kds-ticket-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}

.kds-ticket h3{
  margin:0 0 4px;
  font:23px Georgia,serif;
}

.kds-ticket-items{
  display:grid;
  gap:8px;
  margin:14px 0;
}

.kds-ticket-item{
  padding:9px 10px;
  border:1px solid var(--line);
  border-radius:9px;
  background:#120e16;
}
.kds-ticket-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 10px;margin:11px 0;color:var(--muted);font-size:11px}
.kds-item-copy{display:grid;gap:4px}.kds-item-note,.kds-order-note{color:#ffd090!important}.kds-item-contract-note{margin:10px 0;padding:8px;border-left:3px solid #77509e;background:rgba(73,43,95,.25);color:#baaec4;font-size:11px}
.kds-item-check{width:18px;height:18px;margin:1px 0 0;accent-color:#7c43cc}.kds-ticket-item{display:grid;grid-template-columns:auto 1fr;align-items:start;gap:9px}

.kds-ticket-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

@media(max-width:1050px){
  .kds-board{grid-template-columns:repeat(2,minmax(0,1fr))}.orders-card-list{grid-template-columns:1fr}
}

@media(max-width:700px){
  .order-detail-grid{grid-template-columns:1fr}
  .kds-board{grid-template-columns:1fr}
  .order-list-card,.kds-ticket{padding:13px}.order-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.order-list-head h3{font-size:18px}.kds-ticket-meta{grid-template-columns:1fr}
  .orders-toolbar label,
  .kds-toolbar label{min-width:100%;width:100%}
  .orders-toolbar .btn,
  .kds-toolbar .btn{width:100%}
}

/* KDS dedicado — operação contínua de cozinha e bar */
body.kds-mode{background:#080604;overflow-x:hidden}
body.kds-mode #appView{display:block;min-height:100vh}
body.kds-mode .sidebar,
body.kds-mode .topbar,
body.kds-mode .admin-footer,
body.kds-mode .mobile-bottom-nav{display:none!important}
body.kds-mode .main{width:100%;max-width:none;min-height:100vh;padding:0!important;margin:0!important}
body.kds-mode #kdsPage{display:block!important;min-height:100vh;padding:0;background:radial-gradient(circle at 50% -20%,rgba(117,67,21,.22),transparent 42%),#080604}
body.kds-mode #kdsPage::before{display:none}

body.kds-mode .kds-command-shell{min-height:100vh;color:#f4e6ca}
body.kds-mode .kds-command-header{position:sticky;z-index:20;top:0;display:grid;grid-template-columns:minmax(290px,1fr) auto auto;align-items:center;gap:22px;padding:14px 22px;border-bottom:2px solid #8d5a20;background:linear-gradient(180deg,rgba(26,18,11,.98),rgba(11,8,5,.98));box-shadow:0 8px 26px rgba(0,0,0,.48)}
body.kds-mode .kds-command-header::after{content:"";position:absolute;inset:auto 0 -5px;height:3px;background:linear-gradient(90deg,transparent,#6b3c17 12%,#c28b38 50%,#6b3c17 88%,transparent)}
body.kds-mode .kds-command-brand{display:flex;align-items:center;gap:14px;min-width:0}
body.kds-mode .kds-command-brand img{width:72px;height:72px;object-fit:contain;filter:drop-shadow(0 5px 12px rgba(0,0,0,.65))}
body.kds-mode .kds-command-brand span,
body.kds-mode .kds-view-heading span{display:block;color:#c9903e;font-size:10px;font-weight:800;letter-spacing:.17em}
body.kds-mode .kds-command-brand h2{margin:2px 0 1px;color:#f4c96e;font:700 clamp(25px,2.4vw,38px)/1 Georgia,serif}
body.kds-mode .kds-command-brand small{color:#b9aa91}
body.kds-mode .kds-command-state{display:flex;align-items:center;gap:9px;padding:9px 13px;border:1px solid rgba(97,130,53,.45);border-radius:8px;background:rgba(26,48,18,.28)}
body.kds-mode .kds-command-state b,
body.kds-mode .kds-command-state small{display:block;white-space:nowrap}
body.kds-mode .kds-command-state b{color:#a9d66e;font-size:12px}
body.kds-mode .kds-command-state small{margin-top:2px;color:#a89c88;font-size:10px}
body.kds-mode .kds-live-dot{width:9px;height:9px;border-radius:50%;background:#7bc745;box-shadow:0 0 0 4px rgba(123,199,69,.12),0 0 12px rgba(123,199,69,.5)}
body.kds-mode .kds-command-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
body.kds-mode .kds-command-actions .btn{min-height:42px;border-radius:6px;font-weight:700}
body.kds-mode .kds-command-actions .active{border-color:#c38b39;background:#3a230e;color:#ffd77b}
body.kds-mode .kds-leave{border:1px solid rgba(145,107,60,.45);background:transparent;color:#b9aa91}
body.kds-mode .kds-system-note{margin:18px 22px 0;padding:10px 14px;border:1px solid rgba(108,67,144,.4);border-radius:7px;background:rgba(58,31,78,.22);color:#c8b5d2;font-size:12px}
body.kds-mode .kds-command-status{margin:8px 22px 0;color:#a89b86;font-size:12px}
body.kds-mode .kds-command-status.alert{padding:10px;border:1px solid #7c3038;background:#3a171c;color:#ffb0b5}
body.kds-mode .kds-view{padding:14px 22px 28px}
body.kds-mode .kds-view[hidden]{display:none!important}
body.kds-mode .kds-view-heading{display:flex;align-items:end;justify-content:space-between;gap:16px;margin-bottom:12px;padding-bottom:10px;border-bottom:1px solid rgba(157,104,35,.35)}
body.kds-mode .kds-view-heading h3{margin:2px 0 0;color:#efd096;font:700 25px Georgia,serif}
body.kds-mode .kds-view-heading small{color:#857968}

body.kds-mode .kds-board{display:grid;grid-template-columns:repeat(3,minmax(280px,1fr));gap:13px;align-items:start}
body.kds-mode .kds-production-ticket,
body.kds-mode .kds-history-ticket{position:relative;overflow:hidden;margin:0;padding:0;border:2px solid #82551f;border-radius:8px;background:linear-gradient(145deg,rgba(80,45,15,.13),transparent 36%),linear-gradient(180deg,#18120c,#0d0a07);box-shadow:inset 0 0 0 2px #070504,0 10px 26px rgba(0,0,0,.32)}
body.kds-mode .kds-production-ticket::before,
body.kds-mode .kds-history-ticket::before{content:"";position:absolute;inset:4px;pointer-events:none;border:1px solid rgba(225,166,76,.13)}
body.kds-mode .kds-ticket-head,
body.kds-mode .kds-history-head{position:relative;display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:13px 14px 11px;border-bottom:1px solid rgba(151,96,31,.55);background:linear-gradient(90deg,rgba(111,63,19,.28),rgba(18,13,8,.3))}
body.kds-mode .kds-ticket h3,
body.kds-mode .kds-history-ticket h3{margin:5px 0 0;color:#f2c264;font:700 24px Georgia,serif;overflow-wrap:anywhere}
body.kds-mode .kds-origin-badge{display:inline-flex;width:max-content;padding:4px 7px;border-radius:4px;background:#352413;color:#e5b55f;font-size:10px;font-weight:900;letter-spacing:.1em}
body.kds-mode .kds-origin-badge.origin-ifood{background:#8e181d;color:#fff;border:1px solid #e34a50}
body.kds-mode .kds-origin-badge.origin-own-delivery{background:#3c214e;color:#e6c5ff;border:1px solid #7f4b99}
body.kds-mode .kds-origin-badge.origin-tablet{background:#173b31;color:#9ee8cf}
body.kds-mode .kds-production-ticket.origin-ifood{border-color:#b92e34;box-shadow:inset 0 0 0 2px #070504,0 0 25px rgba(174,31,37,.16)}
body.kds-mode .kds-deadline{display:grid;gap:2px;min-width:112px;padding:7px 9px;border:1px solid #5f492b;border-radius:6px;background:#18130c;text-align:right}
body.kds-mode .kds-deadline b{font-size:11px;text-transform:uppercase;letter-spacing:.05em}
body.kds-mode .kds-deadline small{font-size:10px;color:#b6a78e}
body.kds-mode .kds-production-ticket.deadline-warning{border-color:#c99b25}
body.kds-mode .kds-production-ticket.deadline-warning .kds-ticket-head{background:linear-gradient(90deg,rgba(146,105,14,.43),rgba(30,22,7,.45))}
body.kds-mode .kds-deadline.deadline-warning{border-color:#d4a72d;background:#3a2d0c;color:#ffe173}
body.kds-mode .kds-production-ticket.deadline-late{border-color:#c43d36;box-shadow:inset 0 0 0 2px #070504,0 0 28px rgba(192,44,37,.22)}
body.kds-mode .kds-production-ticket.deadline-late .kds-ticket-head{background:linear-gradient(90deg,rgba(132,30,25,.54),rgba(37,9,8,.5))}
body.kds-mode .kds-deadline.deadline-late{border-color:#d14a43;background:#481512;color:#ffaaa3}
body.kds-mode .kds-ticket-identity{position:relative;display:flex;gap:6px 12px;flex-wrap:wrap;padding:10px 14px 0}
body.kds-mode .kds-ticket-identity span{color:#e4d4b8;font-size:12px;font-weight:700}
body.kds-mode .kds-ticket-meta,
body.kds-mode .kds-history-meta{position:relative;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 10px;margin:0;padding:10px 14px;color:#a99a81;font-size:11px}
body.kds-mode .kds-ticket-items{position:relative;display:grid;gap:7px;margin:0;padding:2px 14px 11px}
body.kds-mode .kds-ticket-item{display:grid;grid-template-columns:auto 1fr;gap:10px;align-items:start;padding:11px;border:1px solid rgba(131,91,42,.55);border-radius:5px;background:#0b0906}
body.kds-mode .kds-ticket-item.is-complete{opacity:.56;background:#10100b}
body.kds-mode .kds-ticket-item.is-complete b{text-decoration:line-through}
body.kds-mode .kds-item-check{width:20px;height:20px;margin:1px 0 0;accent-color:#6ba84a}
body.kds-mode .kds-item-copy b{display:block;color:#f0e2c6;font-size:17px;line-height:1.2}
body.kds-mode .kds-item-progress{display:block;margin-top:5px;color:#8fd16d;font-size:13px}
body.kds-mode .kds-item-station{display:block;margin-top:4px;color:#8f826e;font-size:10px;text-transform:uppercase;letter-spacing:.06em}
body.kds-mode .kds-item-note{display:block;margin-top:6px;color:#ffcb70!important;font-size:12px}
body.kds-mode .kds-item-units{display:grid;gap:6px;margin-top:9px}
body.kds-mode .kds-unit{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 8px;border:1px solid #45351f;border-radius:4px;background:#171108;color:#d9c9ae;font-size:12px}
body.kds-mode .kds-unit.status-ready{border-color:#547d37;color:#a9dc8c}
body.kds-mode .kds-unit.status-delivered,body.kds-mode .kds-unit.status-cancelled{opacity:.62}
body.kds-mode .kds-unit .btn{min-height:32px;padding:5px 10px;font-size:11px}
body.kds-mode .kds-order-note{position:relative;margin:0 14px 10px!important;padding:9px 10px;border-left:3px solid #c2842f;background:rgba(104,59,16,.2);color:#e9bd70!important;font-size:12px!important}
body.kds-mode .kds-ticket-actions{position:relative;display:flex;margin:0;padding:0 14px 14px}
body.kds-mode .kds-unit-guidance{color:#9d917e}
body.kds-mode .operation-empty{grid-column:1/-1;margin:0;padding:42px;border-color:#5a4022;background:rgba(19,14,9,.6)}

body.kds-mode .kds-history-board{display:grid;grid-template-columns:repeat(2,minmax(320px,1fr));gap:13px}
body.kds-mode .kds-history-ticket{padding-bottom:14px;border-color:#4e6234}
body.kds-mode .kds-history-ticket>.btn{position:relative;margin:4px 14px 0}
body.kds-mode .kds-reopen-note{position:relative;display:block;margin:7px 14px 0;color:#9d917e}

/* Hotfix HML: KDS compacto para 1366x768 e entrega direta por unidade física. */
body.kds-mode #tikoAssistantLauncher,
body.kds-mode #tikoAssistantPanel{display:none!important}
body.kds-mode .kds-command-header{grid-template-columns:minmax(210px,1fr) auto auto;gap:10px;padding:7px 12px;border-bottom-width:1px}
body.kds-mode .kds-command-header::after{bottom:-3px;height:2px}
body.kds-mode .kds-command-brand{gap:8px}
body.kds-mode .kds-command-brand img{width:38px;height:38px}
body.kds-mode .kds-command-brand span{font-size:8px;letter-spacing:.13em}
body.kds-mode .kds-command-brand h2{margin:0;color:#f4c96e;font:700 21px/1 Georgia,serif}
body.kds-mode .kds-command-brand small{font-size:10px}
body.kds-mode .kds-command-state{gap:7px;padding:5px 8px}
body.kds-mode .kds-command-state b{font-size:10px}
body.kds-mode .kds-command-state small{font-size:9px}
body.kds-mode .kds-live-dot{width:7px;height:7px;box-shadow:0 0 0 3px rgba(123,199,69,.12)}
body.kds-mode .kds-command-actions{gap:5px;flex-wrap:nowrap;min-width:0}
body.kds-mode .kds-command-actions select{min-width:100px;max-width:160px;min-height:36px;padding:5px 7px}
body.kds-mode .kds-command-actions .btn{min-width:0;min-height:36px;padding:6px 9px;font-size:11px;white-space:nowrap}
body.kds-mode .kds-system-note{margin:7px 12px 0;padding:5px 8px;font-size:10px}
body.kds-mode .kds-command-status{margin:4px 12px 0;font-size:10px}
body.kds-mode .kds-view{padding:7px 12px 18px}
body.kds-mode .kds-view-heading{margin-bottom:6px;padding-bottom:5px}
body.kds-mode .kds-view-heading span{font-size:8px}
body.kds-mode .kds-view-heading h3{font-size:18px}
body.kds-mode .kds-view-heading small{font-size:10px}
body.kds-mode .kds-board{grid-template-columns:repeat(auto-fill,minmax(min(100%,285px),1fr));gap:8px}
body.kds-mode .kds-ticket-head,
body.kds-mode .kds-history-head{gap:7px;padding:7px 9px 6px}
body.kds-mode .kds-ticket h3,
body.kds-mode .kds-history-ticket h3{margin:3px 0 0;font:700 18px/1.1 Georgia,serif;overflow-wrap:normal}
body.kds-mode .kds-origin-badge{padding:2px 5px;font-size:8px}
body.kds-mode .kds-ticket-code{display:block;margin-top:2px;color:#887d6c;font:9px/1.2 ui-monospace,SFMono-Regular,Consolas,monospace}
body.kds-mode .kds-deadline{min-width:88px;padding:4px 6px}
body.kds-mode .kds-deadline b{font-size:9px}
body.kds-mode .kds-deadline small{font-size:8px}
body.kds-mode .kds-ticket-identity{padding:5px 9px 0}
body.kds-mode .kds-ticket-identity:empty{display:none}
body.kds-mode .kds-ticket-identity span{font-size:10px}
body.kds-mode .kds-ticket-meta,
body.kds-mode .kds-history-meta{display:flex;justify-content:space-between;gap:6px;margin:0;padding:5px 9px;font-size:9px}
body.kds-mode .kds-ticket-items{gap:4px;padding:1px 9px 6px}
body.kds-mode .kds-ticket-item{display:block;padding:5px;border-radius:4px}
body.kds-mode .kds-ticket-item.is-complete{opacity:1;background:#0d100a}
body.kds-mode .kds-item-copy{gap:3px}
body.kds-mode .kds-item-progress{margin:0 2px 3px;text-align:right;font-size:10px}
body.kds-mode .kds-item-units{gap:4px;margin:0}
body.kds-mode .kds-unit{min-width:0;min-height:38px;padding:4px 5px;font-size:12px}
body.kds-mode .kds-unit-name{min-width:0;color:#f0e2c6;font-weight:750;line-height:1.15;overflow-wrap:anywhere}
body.kds-mode .kds-unit .btn{flex:0 0 auto;min-height:34px;padding:5px 9px;font-size:11px}
body.kds-mode .kds-delivered-state{flex:0 0 auto;color:#8ed6a9;font-size:11px;white-space:nowrap}
body.kds-mode .kds-cancelled-state{flex:0 0 auto;color:#d18d91;font-size:10px;white-space:nowrap}
body.kds-mode .kds-pending-state{color:#a99a81;font-size:10px}
body.kds-mode .kds-item-details{display:grid;gap:1px;margin:4px 3px 0;padding:3px 5px;border-left:2px solid #5b4630;color:#a99a81}
body.kds-mode .kds-item-option,
body.kds-mode .kds-item-option-note{font-size:10px;line-height:1.25}
body.kds-mode .kds-item-note{margin-top:2px;font-size:10px}
body.kds-mode .kds-order-note{margin:0 9px 6px!important;padding:5px 7px;font-size:10px!important}
body.kds-mode .kds-ticket-actions{padding:0 9px 7px}
body.kds-mode .kds-ticket-actions .btn{min-height:34px;padding:5px 9px;font-size:11px}
body.kds-mode .kds-unit-guidance{font-size:10px}

@media(min-width:1650px){body.kds-mode .kds-board{grid-template-columns:repeat(4,minmax(300px,1fr))}}
@media(max-width:1100px){
  body.kds-mode .kds-command-header{grid-template-columns:1fr auto}
  body.kds-mode .kds-command-state{grid-column:1/-1;grid-row:2;width:max-content}
  body.kds-mode .kds-board{grid-template-columns:repeat(2,minmax(260px,1fr))}
  body.kds-mode .kds-history-board{grid-template-columns:1fr}
}
@media(max-width:700px){
  body.kds-mode .kds-command-header{position:relative;grid-template-columns:1fr;padding:10px 12px;gap:9px}
  body.kds-mode .kds-command-brand img{width:52px;height:52px}
  body.kds-mode .kds-command-brand h2{font-size:25px}
  body.kds-mode .kds-command-state{grid-column:auto;grid-row:auto;width:100%;padding:7px 10px}
  body.kds-mode .kds-command-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}
body.kds-mode .kds-command-actions .btn{width:100%;min-width:0;padding:9px 7px;font-size:12px}
body.kds-mode .kds-command-actions select{min-height:40px;border:1px solid #6b4b27;border-radius:5px;background:#161009;color:#f0e2c6;padding:7px 9px}
  body.kds-mode .kds-command-actions .kds-leave{grid-column:1/-1}
  body.kds-mode .kds-system-note{margin:10px 9px 0;padding:8px 10px;font-size:11px}
  body.kds-mode .kds-command-status{margin:7px 10px 0}
  body.kds-mode .kds-view{padding:10px 9px 24px}
  body.kds-mode .kds-view-heading{align-items:flex-start;flex-direction:column}
  body.kds-mode .kds-view-heading .btn{width:100%}
  body.kds-mode .kds-board,
  body.kds-mode .kds-history-board{grid-template-columns:1fr;gap:10px}
  body.kds-mode .kds-ticket h3,
  body.kds-mode .kds-history-ticket h3{font-size:21px}
  body.kds-mode .kds-deadline{min-width:100px;padding:6px}
  body.kds-mode .kds-ticket-meta,
  body.kds-mode .kds-history-meta{grid-template-columns:1fr;gap:4px}
  body.kds-mode .kds-item-copy b{font-size:16px}
}
