.kds-manager { max-width: 1320px; margin: 0 auto; }
.kds-manager .page-heading h1 { font-size: clamp(25px, 3vw, 34px); }
.kds-manager-intro { display: flex; gap: 16px; padding: 20px 22px; margin-bottom: 24px; border: 1px solid #dfd8f2; border-radius: 16px; background: #f7f3ff; color: #514275; }
.kds-manager-intro > svg { width: 28px; height: 28px; flex-shrink: 0; margin-top: 3px; }
.kds-manager-intro strong { font-size: 17px; }
.kds-manager-intro p { margin: 7px 0; line-height: 1.8; font-size: 15px; }
.kds-manager-intro small { font-size: 13px; color: #746783; }
.kds-manager-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; color: #6c6878; font-size: 14px; }
.kds-screen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 20px; }
.kds-screen-card { display: flex; flex-direction: column; gap: 18px; padding: 23px; background: #fff; border: 1px solid #e2dfea; border-radius: 18px; box-shadow: 0 4px 16px #33234a05; }
.kds-screen-card-heading { display: flex; align-items: center; gap: 13px; }
.kds-screen-card-heading > div { display: flex; flex: 1; align-items: center; flex-wrap: wrap; gap: 10px; justify-content: space-between; min-width: 0; }
.kds-screen-card h2 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.kds-screen-symbol,.kds-pair-symbol,.kds-display-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 12px; background: #f2ecff; color: #7551c9; flex-shrink: 0; }
.kds-screen-filters { margin: 0; color: #726b7c; line-height: 1.8; font-size: 14px; overflow-wrap: anywhere; max-height: 120px; overflow: auto; }
.kds-screen-stats { display: flex; gap: 15px; flex-wrap: wrap; font-size: 13px; color: #77717e; margin-top: auto; padding-top: 5px; }
.kds-screen-stats strong { color: #32283d; }
.kds-screen-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 15px; border-top: 1px solid #eeebf3; }
.kds-screen-actions .button { min-height: 44px; }
.kds-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 52px 22px; text-align: center; background: #fff; border: 1px dashed #dcd5e7; border-radius: 18px; color: #776d83; }
.kds-empty > svg { width: 40px; height: 40px; color: #8a72b7; margin-bottom: 10px; }
.kds-empty h2 { font-size: 23px; color: #352940; margin: 0; }
.kds-empty p { max-width: 480px; line-height: 1.9; margin: 0 0 8px; font-size: 16px; }
.kds-error { background: #fff0ee; color: #9b3a32; border: 1px solid #f0cbc5; padding: 12px 14px; border-radius: 10px; font-size: 14px; line-height: 1.8; }
.kds-error[hidden],.kds-filter-fields[hidden],.kds-more[hidden],.kds-copy-notice[hidden] { display: none !important; }
.kds-muted { color: #797180; font-size: 14px; line-height: 1.8; }
.kds-dialog { position: fixed; inset: 0; margin: auto; width: min(620px, calc(100vw - 24px)); max-width: none; max-height: calc(var(--visual-height, 100dvh) - 24px); padding: 0; border: 1px solid #e6dfed; border-radius: 20px; color: #312b3b; background: white; box-shadow: 0 24px 90px #30233b30; overflow: hidden; }
.kds-dialog[open] { display: flex; flex-direction: column; }
.kds-dialog::backdrop { background: #261d3b55; backdrop-filter: blur(3px); }
.kds-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 17px 22px; border-bottom: 1px solid #ece8f0; flex: 0 0 auto; }
.kds-dialog-heading h2 { margin: 0; font-size: 21px; }
.kds-dialog-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 22px; overscroll-behavior: contain; }
.kds-dialog-body > p { line-height: 1.8; font-size: 16px; }
.kds-dialog-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 15px 22px; border-top: 1px solid #ece8f0; background: #faf9fc; flex: 0 0 auto; }
.kds-dialog-footer .button { min-height: 44px; }
.kds-dialog .field { display: flex; flex-direction: column; gap: 9px; font-size: 15px; margin-bottom: 18px; }
.kds-dialog input:not([type=checkbox]),.kds-pair-page input { box-sizing: border-box; min-height: 48px; width: 100%; font-size: 16px; background: #fff; color: #30283c; border: 1px solid #ddd6e7; border-radius: 9px; padding: 10px 13px; }
.kds-check { display: flex; align-items: center; min-height: 44px; gap: 12px; padding: 10px 7px; cursor: pointer; font-size: 15px; }
.kds-check input { flex: 0 0 19px; height: 19px; width: 19px; accent-color: #7551c9; }
.kds-check > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.6; }
.kds-check small { font-size: 12px; color: #847a8c; }
.kds-all { padding: 12px; background: #f7f3fc; border: 1px solid #e7def2; border-radius: 10px; margin-bottom: 18px; }
.kds-filter-fields fieldset { min-width: 0; border: 1px solid #e4ddec; border-radius: 12px; margin: 0 0 18px; padding: 10px 12px; }
.kds-filter-fields legend { padding: 0 7px; font-size: 15px; font-weight: 700; }
.kds-check-list { max-height: 230px; overflow-y: auto; overscroll-behavior: contain; }
.kds-filter-fields .search-field { width: 100%; margin: 5px 0 10px; }
.kds-filter-fields > small { color: #7b7284; font-size: 13px; line-height: 1.8; }
.kds-public-link { display: block; padding: 12px; text-align: center; border: 1px solid #dcd0f0; border-radius: 10px; background: #f7f3ff; font-weight: 600; color: #6842b3; margin: 17px 0; }
.kds-pair-code { display: grid; grid-template-columns: 1fr; gap: 8px; font-size: 14px; }
.kds-pair-code input { text-align: center; font-family: ui-monospace, monospace; font-size: 23px !important; font-weight: 700; letter-spacing: 2px; margin-bottom: 10px; }
.kds-pair-expiry { display: flex; gap: 8px; align-items: center; justify-content: center; color: #8c6b2a; background: #fff8e7; padding: 10px; border-radius: 10px; font-size: 13px !important; }
.kds-copy-notice { color: #497149; font-size: 14px; }

@media screen {
 body.kds-session { position: fixed; inset: 0; margin: 0; overflow: hidden; overscroll-behavior: none; }
 #app[data-role=kds] { position: absolute; top: var(--visual-top, 0px); inset-inline: 0; width: 100%; height: var(--visual-height, 100dvh); min-height: 0; overflow: hidden; background: #f6f5fa; }
 .kds-display { height: 100%; display: flex; flex-direction: column; overflow: hidden; padding: env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px); box-sizing: border-box; }
 .kds-display-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: 0 0 auto; min-height: 82px; padding: 14px 25px; background: #fff; border-bottom: 1px solid #e5dfed; }
 .kds-display-name { display: flex; gap: 13px; min-width: 0; align-items: center; }
 .kds-display-name h1 { font-size: clamp(20px, 2vw, 27px); margin: 0; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; max-width: 45vw; }
 .kds-display-name > div { min-width: 0; }
 .kds-display-name span:not(.kds-display-icon) { display: block; color: #7c7384; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45vw; margin-top: 5px; }
 .kds-display-tools { display: flex; align-items: center; gap: 10px; }
 .kds-display-tools .language-switcher { min-width: 165px; width: 100%; margin-bottom: 6px; }
 .kds-display-tools .icon-button,.kds-display-menu summary { min-width: 44px; height: 44px; border: 1px solid #e2dbea; border-radius: 10px; background: #faf8fd; }
 .kds-display-menu { position: relative; }
 .kds-display-menu summary { display: flex; justify-content: center; align-items: center; cursor: pointer; list-style: none; }
 .kds-display-menu summary::-webkit-details-marker { display: none; }
 .kds-display-menu > div { position: absolute; top: 52px; inset-inline-end: 0; width: 220px; background: #fff; box-shadow: 0 10px 30px #2f254a22; border: 1px solid #e1dbe8; border-radius: 12px; padding: 7px; z-index: 5; }
 .kds-display-menu button { display: block; text-align: start; width: 100%; min-height: 44px; padding: 10px; border: 0; background: transparent; border-radius: 7px; font-size: 14px; }
 .kds-display-menu button:hover { background: #f4effb; }
 .kds-display-status { padding: 8px 25px; min-height: 36px; flex: 0 0 auto; background: #f0f6f2; color: #52715d; font-size: 13px; border-bottom: 1px solid #e0e8e1; }
 .kds-display-status.is-stale { background: #fff5dd; color: #805a15; border-color: #f0dfb5; }
 .kds-board-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 25px 6px; gap: 15px; flex: 0 0 auto; }
 .kds-board-toolbar > small { font-size: 13px; color: #83798b; }
 .kds-tabs { display: flex; gap: 5px; padding: 4px; background: #ebe6f1; border-radius: 12px; }
 .kds-tabs button { display: flex; gap: 10px; align-items: center; justify-content: center; border: 0; background: transparent; min-height: 44px; border-radius: 9px; padding: 9px 20px; color: #73627e; font-weight: 700; font-size: 14px; }
 .kds-tabs button[aria-pressed=true] { background: #fff; color: #6543a7; box-shadow: 0 2px 7px #59436b10; }
 .kds-tabs button span { padding: 2px 8px; min-width: 25px; border-radius: 7px; font-size: 12px; background: #f1ebf9; }
 .kds-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%,280px),1fr)); grid-auto-rows: max-content; gap: 18px; align-content: start; align-items: start; flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 25px 25px; }
 .kds-board > .kds-empty { grid-column: 1 / -1; min-height: 300px; margin-top: 20px; }
 .kds-ticket { min-width: 0; background: #fff; border: 1px solid #e4ddea; border-top: 4px solid #8c6bcc; border-radius: 14px; overflow: hidden; box-shadow: 0 4px 14px #40285006; }
 .kds-ticket.status-preparing { border-top-color: #e1a448; }
 .kds-ticket.status-ready { border-top-color: #4c9776; }
 .kds-ticket > header { display: flex; justify-content: space-between; gap: 12px; padding: 16px 17px 8px; }
 .kds-ticket > header > div { min-width: 0; }
 .kds-ticket > header strong { display: block; font-size: 21px; overflow-wrap: anywhere; }
 .kds-ticket > header small { display: block; font-size: 12px; color: #8d8295; margin-top: 3px; overflow-wrap: anywhere; }
 .kds-ticket-age { flex: 0 0 auto; align-self: flex-start; color: #7756a9; background: #f5effd; border-radius: 8px; padding: 6px 9px; font-size: 14px; font-weight: 700; }
 .kds-ticket-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12px; color: #94889d; padding: 0 17px 14px; border-bottom: 1px solid #f0ebf4; }
 .kds-ticket-state { color: #80619b; font-weight: 600; }
 .status-preparing .kds-ticket-state { color: #94671c; }
 .status-ready .kds-ticket-state { color: #43815e; }
 .kds-offline-tag { color: #94671c; background: #fff5df; border-radius: 6px; padding: 3px 6px; }
 .kds-ticket-items { list-style: none; margin: 0; padding: 6px 17px; }
 .kds-ticket-items li { display: flex; gap: 13px; align-items: start; padding: 13px 0; border-bottom: 1px solid #f0ecf4; }
 .kds-ticket-items li:last-child { border-bottom: 0; }
 .kds-item-quantity { display: flex; align-items: center; justify-content: center; gap: 5px; flex: 0 0 auto; min-width: 35px; color: #5b456f; font-size: 21px; }
 .kds-item-quantity > span { font-size: 13px; color: #baacc9; }
 .kds-ticket-items li > div { min-width: 0; }
 .kds-ticket-items li > div > strong { display: block; font-size: 17px; line-height: 1.65; overflow-wrap: anywhere; }
 .kds-ticket-items small { color: #93869c; font-size: 12px; display: block; margin-top: 2px; }
 .kds-ticket > footer { display: flex; gap: 8px; background: #fcfbfd; padding: 12px; border-top: 1px solid #f0ebf4; }
 .kds-ticket > footer button { flex: 1; min-width: 0; min-height: 46px; padding: 9px; font-size: 14px; }
 .kds-ticket > footer svg { width: 19px; height: 19px; }
 .kds-more { margin: 6px 25px 0; padding: 9px 14px; border-radius: 9px; color: #8c641d; background: #fff5de; font-size: 13px; flex: 0 0 auto; }
 .kds-pair-page { height: 100%; overflow-y: auto; padding: calc(24px + env(safe-area-inset-top,0px)) max(24px, env(safe-area-inset-right,0px)) calc(30px + env(safe-area-inset-bottom,0px)) max(24px, env(safe-area-inset-left,0px)); background: radial-gradient(ellipse at 15% 10%,#ede2fc,transparent 55%),#f8f6fc; }
 .kds-pair-page > header { display: flex; align-items: center; justify-content: space-between; max-width: 1180px; margin: 0 auto 28px; gap: 15px; }
 .kds-pair-page .bizzy-wordmark { font-size: 30px; }
 .kds-pair-page .language-switcher { min-width: 170px; background: #fff; }
 .kds-pair-panel { max-width: 460px; margin: 4vh auto 0; background: white; border: 1px solid #e5ddec; border-radius: 24px; box-shadow: 0 12px 60px #45266108; padding: 35px; }
 .kds-pair-panel .eyebrow { display: block; margin: 19px 0 8px; color: #8e71b7; font-weight: 700; }
 .kds-pair-panel h1 { margin: 0 0 10px; font-size: 30px; }
 .kds-pair-panel > p { font-size: 15px; color: #887b94; line-height: 1.8; }
 .kds-pair-panel form { margin-top: 24px; }
 .kds-pair-panel .field { display: flex; flex-direction: column; gap: 9px; margin-bottom: 17px; font-size: 15px; font-weight: 600; }
 .kds-pair-panel form > .button { width: 100%; min-height: 50px; margin-top: 5px; }
 .kds-pair-panel > .button { width: 100%; min-height: 44px; margin-top: 12px; }
 @media(max-width:620px){
  .kds-display-header { padding: 11px 13px; gap: 8px; min-height: 76px; flex-wrap: wrap; }
  .kds-display-name { gap: 9px; flex: 1; }
  .kds-display-name h1 { max-width: 62vw; font-size: 22px; }
  .kds-display-icon { width: 40px; height: 40px; }
  .kds-display-tools { gap: 7px; }
  .kds-display-status { padding: 9px 13px; min-height: 36px; font-size: 13px; }
  .kds-board-toolbar { padding: 12px 13px 0; }
  .kds-board-toolbar > small { display: none; }
  .kds-tabs { width: 100%; }
  .kds-tabs button { flex: 1; padding-inline: 10px; }
  .kds-board { padding: 13px; gap: 14px; }
  .kds-more { margin-inline: 13px; }
  .kds-pair-page { padding-inline: 15px; }
  .kds-pair-page > header { margin-bottom: 18px; }
  .kds-pair-page .bizzy-wordmark { font-size: 25px; }
  .kds-pair-page .language-switcher { min-width: 140px; }
  .kds-pair-panel { padding: 26px 22px; margin-top: 0; }
  .kds-dialog-body { padding: 18px; }
  .kds-dialog-heading,.kds-dialog-footer { padding-inline: 18px; }
 }
 @media(max-height:540px){
  .kds-display-header { min-height: 64px; padding-block: 8px; }
  .kds-display-icon { width: 40px; height: 40px; }
  .kds-display-name h1 { font-size: 21px; }
  .kds-board-toolbar { padding-top: 9px; }
  .kds-board { padding-top: 10px; }
  .kds-pair-panel { margin-top: 0; }
 }
}
@media print { #app[data-role=kds] { display: none !important; } }
