body { background: #082920; color: #f8fafc; }
.hidden { display: none !important; }

.kds-shell { max-width: 1440px; margin: 0 auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }

/* TOP RUSH BAR */
.kds-bar {
  background: #0d3b2e; border: 1px solid rgba(232,199,128,0.28); border-radius: 18px;
  padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
}
.kds-bar-left { display: flex; align-items: center; gap: 12px; }
.kds-live-dot { width: 12px; height: 12px; border-radius: 999px; background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,0.22); }
.kds-title { font-size: 15px; font-weight: 900; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kds-chip { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(16,185,129,0.16); color: #34d399; }
.kds-sub { font-size: 11.5px; color: #9ca3af; margin-top: 2px; }

.kds-bar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.k-btn {
  padding: 10px 14px; border-radius: 12px; font-size: 12.5px; font-weight: 800;
  background: #1f242c; border: 1px solid #323945; color: #f4f4f5;
  min-height: 44px; transition: all .15s;
}
.k-btn:hover { background: #2a313c; }
.k-btn.amber { background: rgba(245,158,11,0.18); border-color: rgba(245,158,11,0.45); color: #fcd34d; }
.k-btn.green { background: rgba(16,185,129,0.18); border-color: rgba(16,185,129,0.45); color: #6ee7b7; }
.k-btn.ghost { background: transparent; border-color: #323945; color: #cbd5e1; }

/* BANNERS */
.k-banner {
  border-radius: 14px; padding: 11px 16px; font-size: 13px; font-weight: 800;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px;
}
.k-banner.red { background: #dc2626; color: #fff; }
.k-banner.amber { background: #d97706; color: #111; }
.k-banner-btn { padding: 7px 14px; border-radius: 9px; border: 0; background: #fff; color: #111; font-weight: 900; font-size: 12px; }

/* 3-COLUMN KDS GRID */
.kds-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 860px) { .kds-grid { grid-template-columns: 1fr; } }

.kds-col {
  background: #0b3126; border: 1px solid rgba(255,255,255,0.12); border-radius: 18px; padding: 12px;
  display: flex; flex-direction: column; gap: 12px; min-height: 70vh;
}
.kds-col-head {
  display: flex; justify-content: space-between; align-items: center; padding: 4px 6px;
}
.kds-col-head h2 { margin: 0; font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.kds-col-head.amber h2 { color: #e8c780; }
.kds-col-head.sky h2 { color: #93c5fd; }
.kds-col-head.green h2 { color: #6ee7b7; }
.k-count { font-size: 12px; font-weight: 900; padding: 2px 9px; border-radius: 999px; background: rgba(255,255,255,0.14); color: #fff; }
.kds-list { display: flex; flex-direction: column; gap: 12px; }

/* PAPER TICKET CARD — CRISP PURE WHITE + MINERAL SAGE BORDER */
.k-ticket {
  background: #ffffff; color: #0f241d; border-radius: 16px; border: 2px solid #d4e2da;
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.k-ticket.warn { border-color: #f59e0b; }
.k-ticket.urgent { border-color: #ef4444; }
.k-ticket.canceled { background: #3b0d0d; color: #fff; border-color: #ef4444; }

.k-t-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.k-t-id { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.k-t-code { font-size: 18px; font-weight: 900; letter-spacing: -0.02em; }
.k-mode { font-size: 11px; font-weight: 900; padding: 3px 8px; border-radius: 7px; }
.k-mode.del { background: #0891b2; color: #fff; }
.k-mode.pic { background: #f59e0b; color: #111; }
.k-timer { font-size: 12px; font-weight: 900; padding: 3px 9px; border-radius: 8px; }
.k-timer.ok { background: #059669; color: #fff; }
.k-timer.warn { background: #f59e0b; color: #111; }
.k-timer.urgent { background: #dc2626; color: #fff; }

.k-t-meta {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; opacity: .82; padding-bottom: 8px; border-bottom: 1px dashed rgba(0,0,0,0.2);
}
.k-ticket.canceled .k-t-meta { border-color: rgba(255,255,255,0.25); }

.k-t-lines { display: flex; flex-direction: column; gap: 8px; }
.k-line-title { font-size: 14.5px; font-weight: 900; }
.k-line-opts { padding-left: 14px; font-size: 12.5px; font-weight: 600; color: #3f3f46; line-height: 1.4; }
.k-ticket.canceled .k-line-opts { color: #fecaca; }

.k-note { background: #fde047; color: #18181b; padding: 8px 10px; border-radius: 10px; font-size: 12.5px; font-weight: 900; }

.k-courier-box {
  border-radius: 11px; padding: 9px 11px; font-size: 12px; font-weight: 800;
  display: flex; flex-direction: column; gap: 4px;
}
.k-courier-box.info { background: #ecfeff; border: 1px solid #67e8f9; color: #155e75; }
.k-courier-box.warn { background: #fffbeb; border: 1px solid #f59e0b; color: #92400e; }
.k-courier-box.danger { background: #dc2626; color: #fff; text-align: center; font-size: 13px; padding: 11px; }

.k-t-actions { display: flex; flex-direction: column; gap: 7px; padding-top: 4px; }
.k-t-row { display: flex; gap: 6px; flex-wrap: wrap; }
.k-action {
  flex: 1; min-height: 44px; padding: 10px 12px; border-radius: 11px; border: 0;
  font-size: 13px; font-weight: 900; transition: opacity .15s;
}
.k-action:hover { opacity: .92; }
.k-action.amber { background: #f59e0b; color: #111; }
.k-action.green { background: #059669; color: #fff; }
.k-action.cyan { background: #0891b2; color: #fff; }
.k-action.red { background: #dc2626; color: #fff; }
.k-action.dark { background: #18181b; color: #fff; }
.k-action.ghost { background: #eaf2ed; color: #0d3b2e; }
.k-action.sm { min-height: 36px; padding: 7px 10px; font-size: 11.5px; flex: 0 1 auto; }
.k-action.full { width: 100%; }

/* MODALS */
.k-modal {
  background: #161a20; color: #f4f4f5; border: 1px solid #2e3440; border-radius: 20px;
  max-width: 440px; width: 100%; padding: 20px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 28px 70px rgba(0,0,0,0.6); max-height: 88vh; overflow: hidden;
}
.k-modal.wide { max-width: 640px; }
.k-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.k-modal-head h3 { margin: 0; font-size: 17px; font-weight: 900; }
.k-close { padding: 7px 12px; border-radius: 9px; border: 1px solid #323945; background: #232832; color: #fff; font-weight: 800; font-size: 12px; }
.k-modal-row { display: flex; gap: 8px; }

.k-prep-big { display: flex; align-items: center; justify-content: center; gap: 18px; }
.k-prep-big button { width: 58px; height: 58px; border-radius: 16px; border: 0; background: #272e3a; color: #fff; font-size: 20px; font-weight: 900; }
.k-prep-big strong { font-size: 32px; color: #fbbf24; min-width: 115px; text-align: center; }

.k-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.k-presets button { padding: 12px 6px; border-radius: 12px; border: 1px solid #323945; background: #222731; color: #fff; font-weight: 800; font-size: 12.5px; }
.k-presets button:hover { background: #2e3645; }

.k-pause-section { background: #1e232c; border: 1px solid #2e3440; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.k-pause-section.danger { background: rgba(220,38,38,0.12); border-color: rgba(239,68,68,0.4); }
.k-pause-section p { margin: 0; font-size: 12px; color: #cbd5e1; }

.k-stock-body { overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.k-stock-group h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #fbbf24; }
.k-stock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 520px) { .k-stock-grid { grid-template-columns: 1fr; } }
.k-stock-tile {
  padding: 12px; border-radius: 12px; border: 1.5px solid #323945; background: #212630;
  display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; color: #fff;
}
.k-stock-tile.oos { background: rgba(220,38,38,0.22); border-color: #ef4444; }
.k-stock-tile strong { font-size: 13px; }
.k-stock-pill { font-size: 11px; font-weight: 900; padding: 3px 8px; border-radius: 7px; background: #059669; }
.k-stock-tile.oos .k-stock-pill { background: #dc2626; }

.k-paper {
  margin: 0; background: #ffffff; color: #0f241d; padding: 16px; border-radius: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px; line-height: 1.4; white-space: pre-wrap; border: 1px solid #d4e2da;
  max-height: 55vh; overflow-y: auto;
}

@media print {
  @page { size: 80mm auto; margin: 2mm; }
  body * { visibility: hidden !important; }
  #modal-print, #modal-print #mpr-paper {
    visibility: visible !important;
    position: static !important;
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 76mm !important;
    max-width: 76mm !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
    white-space: pre-wrap !important;
  }
  #modal-print .k-modal-head, #modal-print #mpr-send { display: none !important; }
}
