/* LİBERTE OS · Ekranlar arası ortak tasarım dili (POS, Mutfak, Yönetim). Marka: #173D36 · #F8F7F2 · #C9E4D4 · #FFFFFF */
:root {
  --forest: #173D36; --forest-2: #24564c; --paper: #F8F7F2; --mint: #C9E4D4; --white: #FFFFFF;
  --mint-soft: #e7f2ec; --line: #dfe3dc; --muted: #5d6d66; --warn: #9a6a12; --warn-bg: #fbf1dc; --danger: #a3341f; --danger-bg: #fbe7e1;
  --info: #2f5175; --info-bg: #e5eef8;
  --radius: 12px; --header: 60px;
  font-family: "Segoe UI", system-ui, -apple-system, Tahoma, sans-serif; color: var(--forest); background: var(--paper); font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea, a { font: inherit; color: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; border: 1px solid var(--line); border-radius: 10px; background: var(--white); padding: 10px 14px; min-height: 44px; font-weight: 600; }
button:hover:not(:disabled) { border-color: var(--forest-2); background: var(--mint-soft); }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 3px solid #d39b2a; outline-offset: 2px; }
a { text-decoration: none; }
h1, h2, h3, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; top: -100px; left: 12px; background: var(--white); padding: 12px; z-index: 20; }
.skip:focus { top: 8px; }
.eyebrow { font-size: 10px; letter-spacing: 2px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.primary { background: var(--forest); color: var(--white); border-color: var(--forest); }
.primary:hover:not(:disabled) { background: var(--forest-2) !important; color: var(--white); }
.ghost { background: transparent; border-color: transparent; }
.danger { color: var(--danger); }
.boot { padding: 15vh 24px; text-align: center; line-height: 2; }
.boot a { text-decoration: underline; }
kbd { font-family: inherit; font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; }

/* ===== Kabuk ve üst bar ===== */
.screen { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.topbar { display: flex; align-items: center; gap: 16px; height: var(--header); padding: 0 16px; background: var(--forest); color: var(--white); flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; letter-spacing: 2px; color: var(--white); white-space: nowrap; }
.brand b { font-weight: 400; color: var(--mint); }
.monogram { display: grid; place-items: center; width: 34px; height: 38px; border: 1px solid var(--mint); border-radius: 16px 16px 4px 4px; font-family: Georgia, serif; font-size: 24px; }
.demo-badge { font-size: 10px; font-weight: 700; letter-spacing: 1px; background: var(--mint); color: var(--forest); padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
.topbar select { background: var(--forest-2); color: var(--white); border: 1px solid #3c6e63; border-radius: 8px; min-height: 40px; padding: 0 10px; max-width: 260px; }
.header-spacer { flex: 1; }
.conn { font-size: 12px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.conn::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #7fd39d; }
.conn.reconnecting::before { background: #f0c35b; }
.conn.offline::before { background: #ef7a62; }
.outbox-pill { font-size: 11px; background: var(--warn-bg); color: var(--warn); padding: 5px 9px; border-radius: 6px; font-weight: 700; }
.header-actions { display: flex; gap: 6px; }
.header-actions a, .header-actions button { color: var(--white); background: transparent; border: 1px solid transparent; font-size: 13px; min-height: 40px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 8px; }
.header-actions a:hover, .header-actions button:hover:not(:disabled) { background: var(--forest-2); border-color: #3c6e63; }

.messages:empty { display: none; }
.message { padding: 9px 16px; font-size: 13px; display: flex; justify-content: space-between; gap: 12px; }
.message.error { background: var(--danger-bg); color: var(--danger); }
.message.success { background: var(--mint-soft); color: var(--forest); }
.message.warn { background: var(--warn-bg); color: var(--warn); }
.message button { min-height: 30px; padding: 2px 10px; font-size: 12px; }

/* ===== Ortak parçalar ===== */
.pane-head { padding: 14px 16px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; }
.pane-head h2 { font-size: 18px; }
.count-chip { font-size: 12px; background: var(--mint); padding: 3px 8px; border-radius: 6px; font-weight: 700; }
.chips { display: flex; gap: 6px; overflow-x: auto; flex-shrink: 0; scrollbar-width: thin; }
.chips button { white-space: nowrap; font-size: 13px; font-weight: 600; border-radius: 22px; min-height: 40px; padding: 6px 16px; background: var(--white); }
.chips button[aria-pressed=true] { background: var(--forest); color: var(--white); border-color: var(--forest); }
.tag { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: var(--mint-soft); color: var(--forest); }
.tag.low { background: var(--warn-bg); color: var(--warn); }
.tag.out { background: var(--danger-bg); color: var(--danger); }
.status { font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 5px; background: var(--paper); }
.status-draft { background: var(--warn-bg); color: var(--warn); }
.status-pending, .status-preparing { background: var(--info-bg); color: var(--info); }
.status-ready { background: var(--mint); color: var(--forest); }
.status-void { background: var(--danger-bg); color: var(--danger); text-decoration: line-through; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); padding: 28px 16px; gap: 10px; grid-column: 1 / -1; flex: 1; }
.empty h3 { color: var(--forest); font-size: 17px; }

/* ===== Kaydırmasız, sayfasız sığdırma ===== */
/* Liste sabit boyutta durur, kaydırma çubuğu yoktur; yoğunluk kademesi (data-density) ile sığdırılır.
   Sığmayan öğe olursa ekran bunu .fit-note ile açıkça bildirir (sessizce gizlemez). */
.fit { position: relative; overflow: hidden; min-height: 0; grid-auto-rows: max-content; scrollbar-width: none; }
.fit-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; font-weight: 700; color: var(--warn); background: var(--warn-bg); border-radius: 8px; padding: 4px 8px; flex-shrink: 0; }
.fit-note:empty { display: none; }
.fit-note button { min-height: 36px; padding: 4px 10px; font-size: 12px; }

/* ===== Diyaloglar ===== */
dialog { width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px); border: 1px solid var(--line); border-radius: 16px; padding: 0; background: var(--white); color: var(--forest); box-shadow: 0 20px 70px #0b2a2440; }
dialog.wide { width: min(880px, calc(100% - 24px)); }
dialog::backdrop { background: #0f271e99; }
dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 26px); }
.dlg-head { padding: 18px 20px 8px; }
.dlg-head h2 { font-size: 20px; }
.dlg-body { padding: 8px 20px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; border-top: 1px solid var(--line); }
.dlg-body label, .form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; }
.dlg-body input, .dlg-body select, .dlg-body textarea, .form-grid input, .form-grid select, .form-grid textarea { border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-height: 44px; font-weight: 400; background: var(--white); }
.form-grid label small { font-weight: 400; color: var(--muted); font-size: 11px; }
label.check { flex-direction: row !important; align-items: center; gap: 8px !important; }
label.check input { width: 18px; height: 18px; min-height: auto !important; accent-color: var(--forest); }
.link { text-decoration: underline; font-weight: 600; color: var(--forest); }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0; }
legend { font-size: 13px; font-weight: 700; padding: 0 6px; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.choice { flex-direction: row !important; align-items: center; gap: 8px !important; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-height: 44px; font-weight: 500 !important; cursor: pointer; }
.choice:has(input:checked) { background: var(--mint); border-color: #a9cdb8; }
.choice input { min-height: auto !important; width: 18px; height: 18px; accent-color: var(--forest); }
.choice span { flex: 1; }
.choice small { color: var(--muted); }
.dlg-total { display: flex; justify-content: space-between; align-items: center; font-size: 15px; font-weight: 700; }
.dlg-error { color: var(--danger); font-size: 13px; min-height: 18px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.pick-grid.dense { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 4px; }
.pick-grid.dense .choice { min-height: 40px; padding: 4px 8px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.legal { font-size: 11px; color: var(--muted); }
/* Fiş önizlemesi: uzun fiş kaydırma yerine yan yana sütunlara akar */
pre.bill { font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; line-height: 1.3; background: var(--paper); padding: 12px; border-radius: 8px; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0;
  max-height: calc(100dvh - 230px); columns: 330px auto; column-fill: auto; column-gap: 20px; column-rule: 1px dashed var(--line); }
pre.bill.dense { font-size: 10px; columns: 270px auto; }

@media (max-width: 1199px) { .brand span:last-child, .header-actions .label { display: none; } }
/* Dokunmatik ekran: ortak üst çubuk ve çip dokunma hedefleri en az 44 px */
@media (pointer: coarse) {
  .header-actions a, .header-actions button { min-height: 44px; min-width: 44px; justify-content: center; }
  .chips button, .topbar select, .brand { min-height: 44px; }
  .brand { min-width: 44px; justify-content: center; }
}
@media (max-width: 899px) { .conn span, .demo-badge { font-size: 9px; } }
@media (max-width: 639px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .topbar select { max-width: 140px; }
  .demo-badge, .conn span { display: none; }
}

/* ===== Yazdırma ===== */
#print-area { display: none; }
@media print {
  dialog, body:has(#print-area:not(:empty)) .screen { display: none !important; }
  #print-area:not(:empty) { display: block; margin: 0; font: 12px/1.35 "Cascadia Mono", Consolas, monospace; white-space: pre; }
}
