:root {
  --bg: #f6f1e8;
  --panel: #fffdfa;
  --line: rgba(52, 42, 31, .12);
  --text: #1f1812;
  --muted: #756b5f;
  --accent: #1b5a50;
  --accent-2: #d9784f;
  --danger: #b54c47;
  --shadow: 0 18px 50px rgba(72, 50, 30, .09);
}

* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 80% -10%, #e2efe9 0, transparent 36%), var(--bg); color: var(--text); font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
button, input { font: inherit; }
.app-shell { width: min(1320px, 100%); margin: auto; padding: 20px clamp(14px, 3vw, 42px) 42px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 8px 0 26px; }
.topbar h1 { margin: 2px 0 5px; font-size: clamp(25px, 4vw, 40px); letter-spacing: -.04em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.eyebrow { margin: 0; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.muted { color: var(--muted); margin: 0; }
.panel { background: rgba(255, 253, 250, .92); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.login-card { max-width: 440px; margin: 9vh auto; padding: clamp(22px, 4vw, 38px); }
.panel-heading h2 { margin: 4px 0 8px; font-size: 22px; }
.login-form { display: grid; gap: 14px; margin-top: 22px; }
.login-form label { display: grid; gap: 6px; font-weight: 700; }
.login-form input, .search { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); outline: none; }
.login-form input:focus, .search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(27, 90, 80, .13); }
.button { border: 0; border-radius: 11px; padding: 11px 15px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.button.primary { background: var(--accent); color: #fff; }
.button.secondary { background: #f1ebe2; color: var(--text); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.badge { border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 800; }
.muted-badge { background: #f0ebe3; color: var(--muted); }
.ok-badge { background: #dceee6; color: #236553; }
.warn-badge { background: #fff0dd; color: #9a5b1a; }
.hidden { display: none !important; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 15px; }
.summary-card { padding: 18px 19px; background: var(--panel); border: 1px solid var(--line); border-radius: 17px; }
.summary-label { color: var(--muted); font-size: 13px; }
.summary-value { margin-top: 4px; font-size: 25px; font-weight: 850; }
.controls { padding: 14px 18px; margin-bottom: 15px; }
.tabs { display: flex; gap: 7px; margin-bottom: 13px; }
.tab { border: 0; background: transparent; border-bottom: 2px solid transparent; padding: 8px 12px; color: var(--muted); font-weight: 800; cursor: pointer; }
.tab.active { color: var(--accent); border-color: var(--accent); }
.control-row { display: flex; gap: 9px; }
.search { flex: 1; }
.message { min-height: 21px; margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.message.error { color: var(--danger); }
.message.success { color: var(--accent); }
.order-panel { padding: 18px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 13px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 850px; }
th, td { padding: 12px 9px; text-align: left; border-top: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 12px; letter-spacing: .03em; }
td { font-size: 14px; }
.order-id { font-weight: 850; }
.subline { color: var(--muted); font-size: 12px; }
.status { display: inline-flex; border-radius: 999px; padding: 4px 8px; background: #f1ebe2; color: #695d50; font-size: 12px; }
.status.printed { background: #dceee6; color: #236553; }
.status.waiting { background: #fff0dd; color: #9a5b1a; }
.row-actions { white-space: nowrap; }
.row-reprint { padding: 7px 10px; font-size: 12px; }
.confirm-dialog { width: min(520px, calc(100% - 24px)); padding: 0; border: 0; background: transparent; color: var(--text); }
.confirm-dialog::backdrop { background: rgba(31, 24, 18, .42); backdrop-filter: blur(3px); }
.dialog-card { padding: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 70px rgba(72, 50, 30, .2); }
.dialog-card .panel-heading { margin-bottom: 17px; }
.icon-button { border: 0; background: transparent; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; }
.dialog-details { display: grid; gap: 8px; margin-bottom: 15px; padding: 13px 14px; background: #f5efe7; border-radius: 13px; }
.dialog-detail { display: flex; justify-content: space-between; gap: 16px; }
.dialog-detail strong { text-align: right; overflow-wrap: anywhere; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 17px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 13px; padding-top: 16px; }
.footer-note { color: var(--muted); font-size: 12px; text-align: center; }
.no-data { text-align: center; color: var(--muted); padding: 38px; }

@media (max-width: 760px) {
  .app-shell { padding: 13px 11px 30px; }
  .topbar { padding-bottom: 16px; }
  .topbar h1 { font-size: 27px; }
  .topbar .muted { font-size: 13px; }
  .topbar-actions { align-items: flex-start; }
  .topbar-actions .badge { display: none; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .summary-card { padding: 13px; }
  .summary-value { font-size: 20px; }
  .controls { padding: 11px; }
  .tabs { overflow: auto; margin-bottom: 7px; }
  .tab { padding: 8px 10px; }
  .control-row { display: grid; grid-template-columns: 1fr 1fr; }
  .search { grid-column: 1 / -1; }
  .control-row .primary { grid-column: 1 / -1; }
  .order-panel { padding: 12px 10px; }
  .table-wrap { overflow: visible; }
  table { min-width: 0; }
  thead { display: none; }
  tbody, tr, td { display: block; }
  tr { position: relative; padding: 11px 0 13px 31px; border-top: 1px solid var(--line); }
  td { border: 0; padding: 2px 0; }
  td:first-child { position: absolute; left: 3px; top: 15px; }
  td:nth-child(4) { font-weight: 800; }
  .row-actions { margin-top: 7px; }
  .pager { padding-top: 12px; }
  .login-card { margin-top: 4vh; }
  .login-card .button { width: 100%; }
  .dialog-card { padding: 18px; }
  .dialog-detail { display: grid; gap: 2px; }
  .dialog-detail strong { text-align: left; }
}
