/* Czcionki jak w sklepie Baru Leśnego (DM Sans + Playfair Display, licencja OFL, z naszego serwera) */
@font-face{font-family:'DM Sans';font-style:normal;font-weight:400 700;font-display:swap;src:url(/fonts/dm-sans-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}@font-face{font-family:'DM Sans';font-style:normal;font-weight:400 700;font-display:swap;src:url(/fonts/dm-sans-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}@font-face{font-family:'Playfair Display';font-style:italic;font-weight:400 600;font-display:swap;src:url(/fonts/playfair-display-italic-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}@font-face{font-family:'Playfair Display';font-style:italic;font-weight:400 600;font-display:swap;src:url(/fonts/playfair-display-italic-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}@font-face{font-family:'Playfair Display';font-style:normal;font-weight:400 600;font-display:swap;src:url(/fonts/playfair-display-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}@font-face{font-family:'Playfair Display';font-style:normal;font-weight:400 600;font-display:swap;src:url(/fonts/playfair-display-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}

/* Kolory Baru Leśnego (jak catering.barlesnyleba.pl) */
:root {
  --green: #183c38; --green-2: #24534d; --teal: #006873; --lime: #b4c640;
  --red: #b5372c; --gold: #b29656; --cream: #f8f6f0; --paper: #fffefb;
  --ink: #183c38; --muted: #737c72; --line: #dedfd4; --ok: #3f7d4f; --warn: #a74b32;
  --r: 10px;
  font-family: 'DM Sans', Arial, sans-serif;
  color: var(--ink); background: var(--cream);
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }
h1, h2 { margin: .2em 0; }
h1, .serif { font-family: 'Playfair Display', Georgia, serif; font-weight: 400; letter-spacing: -.5px; }
h1 em { color: var(--red); }
h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.2rem 0 .5rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.error { color: var(--red); min-height: 1.3em; font-weight: 600; }

/* przyciski */
.primary, .secondary { border: 0; border-radius: var(--r); padding: .8rem 1.2rem; font-weight: 700; }
.primary { background: var(--green); color: var(--paper); box-shadow: 0 3px 0 #b2965633; }
.primary:active { background: var(--green-2); }
.primary:disabled { opacity: .5; }
.secondary { background: #fff; border: 2px solid var(--green); color: var(--green); }
.big { width: 100%; font-size: 1.2rem; padding: 1.1rem; }
.link { background: none; border: 0; color: var(--green); text-decoration: underline; padding: .5rem; }
.danger { color: var(--red) !important; }
.icon-btn { background: rgba(255,255,255,.12); border: 0; border-radius: 10px; min-width: 44px; height: 44px; display: inline-grid; place-items: center; color: inherit; text-decoration: none; font-size: 1.2rem; }
.icon-btn:disabled { opacity: .3; }
.input { width: 100%; border: 2px solid var(--line); border-radius: 10px; padding: .7rem .8rem; background: #fff; font-size: 1rem; }
.input:focus { outline: none; border-color: var(--green); }
.money { font-variant-numeric: tabular-nums; }

/* pasek górny */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; padding-top: max(.5rem, env(safe-area-inset-top)); background: var(--green); color: #fff; }
.bar .title { font-size: 1.2rem; }
.bar-logo { width: 36px; height: 36px; flex: none; border-radius: 50%; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--lime); flex: none; box-shadow: 0 0 0 3px rgba(255,255,255,.15); }
.dot.off { background: #f87171; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.tabs { display: flex; gap: .3rem; flex: 1; }
.tab { flex: 1; background: transparent; border: 0; color: #c9d6cf; padding: .6rem .4rem; border-radius: 10px; font-weight: 600; }
.tab.active { background: rgba(255,255,255,.16); color: #fff; }
.badge { background: var(--lime); color: var(--ink); border-radius: 99px; padding: 0 .45rem; margin-left: .2rem; }

/* komunikaty */
#toast { position: fixed; left: 50%; bottom: 6rem; transform: translate(-50%, 2rem); opacity: 0; transition: .2s; background: var(--ink); color: #fff; padding: .8rem 1.1rem; border-radius: 12px; z-index: 50; max-width: 90vw; text-align: center; pointer-events: none; font-weight: 600; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--red); }
#toast.ok { background: var(--ok); }

/* ostrzeżenie: ekran może się wygasić */
#awake-warning { position: fixed; left: 0; right: 0; top: 0; z-index: 40; border: 0; padding: .7rem 1rem; padding-top: max(.7rem, env(safe-area-inset-top)); background: var(--warn); color: #fff; font-weight: 700; font-size: 1rem; text-align: center; }

/* logowanie */
body.login { display: grid; place-items: center; padding: 1rem; padding-top: 3rem; }
.login-box { width: min(360px, 100%); text-align: center; }
.login .logo { width: 128px; height: 128px; border-radius: 50%; }
.login h1 { font-size: 2.6rem; line-height: 1.1; margin-top: .4rem; }
.pin-dots { display: flex; justify-content: center; gap: .7rem; margin: 1.5rem 0 .5rem; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--green); }
.pin-dots span.on { background: var(--green); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.keypad button { height: 68px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: 1.6rem; font-weight: 500; box-shadow: 0 2px 0 #183c3810; }
.keypad button:active { background: #eceee4; }
.keypad .ok { background: var(--green); border-color: var(--green); color: var(--paper); font-weight: 700; }
.big-choice { display: flex; flex-direction: column; align-items: center; background: var(--paper); border: 1px solid var(--line); color: var(--ink); text-decoration: none; border-radius: 12px; padding: 1rem; margin: .7rem 0; font-family: 'Playfair Display', Georgia, serif; font-size: 1.6rem; box-shadow: 0 3px 0 #b2965622; }
.big-choice span { font-size: 2rem; }
.login .lead { font-size: 1.15rem; margin: 1.4rem 0 .4rem; }
.login .owner { display: block; margin: 1rem auto 0; color: var(--muted); }
#pin-view .link { margin-top: 1rem; }
.big-choice small { font-family: 'DM Sans', Arial, sans-serif; font-size: .85rem; color: var(--muted); }

/* świąteczne lampki jak w sklepie */
.lights { position: fixed; top: 0; left: 0; right: 0; z-index: 1; height: 30px; overflow: hidden; display: flex; gap: 30px; padding: 0 0 0 15px; background: radial-gradient(ellipse 22px 9px at 20px 0, transparent 7px, #2e4a3f 7.5px, #2e4a3f 8.6px, transparent 9.2px) repeat-x 0 0 / 40px 14px; pointer-events: none; }
.lights i { flex: 0 0 10px; height: 15px; margin-top: 9px; border-radius: 50% 50% 46% 46%; background: var(--red); box-shadow: 0 0 10px 2px #b5372c88; position: relative; animation: twinkle 2.4s ease-in-out infinite; }
.lights i::before { content: ""; position: absolute; top: -3px; left: 2.5px; width: 5px; height: 4px; border-radius: 1px; background: #3b4a42; }
.lights i:nth-child(4n+2) { background: var(--gold); box-shadow: 0 0 10px 2px #e0b84f99; animation-delay: .6s; }
.lights i:nth-child(4n+3) { background: #4f9a6b; box-shadow: 0 0 10px 2px #4f9a6b88; animation-delay: 1.2s; }
.lights i:nth-child(4n+4) { background: #f6f1e1; box-shadow: 0 0 10px 2px #ffffffaa; animation-delay: 1.8s; }
@keyframes twinkle { 50% { opacity: .45; } }
.sheet .lights { position: absolute; }
.sheet.done .lights, .sheet.start .lights { background-image: radial-gradient(ellipse 22px 9px at 20px 0, transparent 7px, #8fa79b 7.5px, #8fa79b 8.6px, transparent 9.2px); }
@media (prefers-reduced-motion: reduce) { .lights i { animation: none; } }

/* kasa */
.kasa .view { padding: .7rem; padding-bottom: 6rem; }
.chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .5rem; scrollbar-width: none; }
.chip { flex: none; border: 2px solid var(--line); background: #fff; border-radius: 99px; padding: .45rem .9rem; font-weight: 600; white-space: nowrap; }
.chip.active { background: var(--green); border-color: var(--green); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .55rem; }
.product { position: relative; min-height: 84px; border: 2px solid var(--line); background: var(--paper); box-shadow: 0 2px 0 #183c380d; border-radius: var(--r); padding: .55rem .7rem; display: flex; flex-direction: row; align-items: center; gap: .8rem; text-align: left; transition: transform .05s; }
.product:active { transform: scale(.97); background: #f1efe8; }
.product.in { border-color: var(--teal); background: #eef5f2; }
.p-img { width: 64px; height: 64px; border-radius: 14px; flex: none; }
.p-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; flex: 1; }
.p-name { font-weight: 700; font-size: 1.08rem; line-height: 1.2; padding-right: 2rem; }
.l-img { width: 40px; height: 40px; border-radius: 9px; flex: none; }
.p-price { color: var(--teal); font-weight: 700; font-variant-numeric: tabular-nums; }
.qty-badge { position: absolute; top: 50%; right: .6rem; transform: translateY(-50%); background: var(--red); color: #fff; min-width: 28px; height: 28px; border-radius: 99px; display: grid; place-items: center; font-weight: 800; }
.cart-bar { position: fixed; left: .7rem; right: .7rem; bottom: max(.7rem, env(safe-area-inset-bottom)); z-index: 6; display: flex; justify-content: space-between; align-items: center; border: 0; border-radius: 18px; padding: 1.05rem 1.2rem; background: var(--green); color: var(--paper); font-size: 1.15rem; font-weight: 700; box-shadow: 0 4px 0 var(--gold), 0 8px 24px rgba(0,0,0,.18); }
.cart-bar:disabled { background: #9a958b; box-shadow: none; }
.cart-bar strong { color: var(--lime); font-size: 1.35rem; font-variant-numeric: tabular-nums; }

.sheet { position: fixed; inset: 0; z-index: 20; background: var(--cream); overflow-y: auto; padding: 1rem; padding-top: max(1rem, env(safe-area-inset-top)); padding-bottom: max(1rem, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: .8rem; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.lines { display: flex; flex-direction: column; gap: .4rem; }
.line { display: flex; align-items: center; gap: .6rem; background: #fff; border-radius: 12px; padding: .6rem .7rem; }
.l-name { flex: 1; font-weight: 600; display: flex; flex-direction: column; }
.l-name small { color: var(--muted); font-weight: 400; }
.l-sum { min-width: 5.5rem; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.stepper { display: flex; align-items: center; gap: .4rem; }
.stepper button { width: 42px; height: 42px; border-radius: 12px; border: 2px solid var(--line); background: var(--cream); font-size: 1.4rem; font-weight: 700; }
.stepper b { min-width: 1.6rem; text-align: center; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.2rem; padding: .2rem .2rem; }
.total-row strong { font-family: 'Playfair Display', Georgia, serif; font-weight: 600; font-size: 2.2rem; font-variant-numeric: tabular-nums; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.seg button { border: 2px solid var(--line); background: #fff; border-radius: var(--r); padding: .9rem; font-weight: 700; font-size: 1.05rem; }
.seg button.active { border-color: var(--green); background: var(--green); color: #fff; }
.quick { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.quick button { border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: .55rem .8rem; font-weight: 600; }
.change { font-size: 1.4rem; font-weight: 800; min-height: 1.6em; margin-top: .4rem; }
.change.ok { color: var(--ok); }
.change.warn { color: var(--warn); font-size: 1.05rem; }
.sheet.done { text-align: center; justify-content: center; background: var(--green); color: #fff; }
.sheet.done .muted { color: #cfe3d6; }
.sheet.done .line { background: rgba(255,255,255,.12); }
.order-no { font-family: 'Playfair Display', Georgia, serif; font-size: 8rem; line-height: 1; }
.done-total { font-size: 1.3rem; }
.big-change { color: var(--lime) !important; font-size: 1.8rem; }
.sheet.done .primary { background: var(--paper); color: var(--green); box-shadow: 0 3px 0 var(--gold); }
.sheet.done .muted { color: #c9d6cf; }

.list { display: flex; flex-direction: column; gap: .5rem; }
.ocard { background: #fff; border-radius: var(--r); padding: .7rem .8rem; border-left: 6px solid var(--line); }
.ocard.s-ready { border-left-color: var(--ok); background: #eef8f1; }
.ocard.s-new { border-left-color: var(--gold); }
.ocard, .line, .stat, .table, .mrow { box-shadow: 0 2px 0 #183c380d; }
.ocard.s-cancelled { opacity: .55; text-decoration: line-through; }
.o-head { display: flex; justify-content: space-between; align-items: baseline; }
.o-no { font-family: 'Playfair Display', Georgia, serif; font-size: 2rem; font-weight: 600; }
.o-items { display: flex; flex-wrap: wrap; gap: .2rem .8rem; }
.o-note { background: #fff4d6; border-radius: 8px; padding: .4rem .6rem; margin-top: .4rem; font-weight: 600; }
.o-actions { display: flex; justify-content: flex-end; align-items: center; gap: .5rem; margin-top: .5rem; }
.tag { background: var(--line); border-radius: 6px; padding: .1rem .5rem; font-size: .85rem; }

/* kuchnia */
body.kuchnia { background: #10302c; color: #fff; display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
.kuchnia .bar { background: #0b2421; }
.kuchnia .bar .title { font-family: 'Playfair Display', Georgia, serif; font-size: 1.5rem; font-weight: 400; }
.kuchnia .bar-logo { width: 40px; height: 40px; }
.counter { flex: 1; color: var(--lime); font-weight: 700; font-size: 1.1rem; }
.clock { font-variant-numeric: tabular-nums; font-size: 1.2rem; font-weight: 700; }
.todo { display: flex; gap: .4rem; overflow-x: auto; padding: .5rem .7rem; background: #163a35; }
.todo .chip { background: #24534d; border-color: #24534d; color: #fff; }
.kgrid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-content: start; gap: .8rem; padding: .8rem; }
.kcard { background: var(--paper); color: var(--ink); border-radius: 18px; padding: .8rem; display: flex; flex-direction: column; gap: .5rem; border-top: 10px solid var(--gold); }
.kcard.fresh { animation: pop .3s; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.kcard.slow { border-top-color: #f59e0b; }
.kcard.late { border-top-color: var(--red); }
.kcard.late .k-time { color: var(--red); font-weight: 800; }
.k-head { display: flex; justify-content: space-between; align-items: baseline; }
.k-head .o-no { font-size: 3rem; }
.k-time { color: var(--muted); flex: 1; text-align: right; margin-right: .6rem; }
.k-del { border: 1px solid #e3c4c0; background: #fbf0ee; color: var(--red); border-radius: 8px; padding: .45rem .7rem; font-weight: 700; }
.k-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.k-items li img { width: 40px; height: 40px; border-radius: 9px; flex: none; }
.k-items li { display: flex; align-items: center; gap: .6rem; font-size: 1.35rem; padding: .45rem .5rem; border-radius: 10px; background: #f5f2ea; cursor: pointer; user-select: none; }
.k-items li b { color: var(--red); }
.k-items li.done { text-decoration: line-through; opacity: .45; }
.k-other { color: var(--muted); font-size: .9rem; }
.ready-btn { margin-top: auto; border: 0; border-radius: 14px; background: var(--ok); color: #fff; font-size: 1.5rem; font-weight: 900; padding: 1rem; }
.ready-btn:active { filter: brightness(.9); }
.empty { grid-column: 1 / -1; text-align: center; font-family: 'Playfair Display', Georgia, serif; color: #9fbfae; font-size: 1.5rem; margin-top: 20vh; }
.ready-strip { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; padding-bottom: max(.5rem, env(safe-area-inset-bottom)); background: #0b2421; overflow-x: auto; }
.ready-strip .muted { color: #9fbfae; flex: none; font-size: .9rem; }
.ready-strip #ready { display: flex; gap: .4rem; }
.ready-strip .chip { background: #24534d; border-color: #24534d; color: #fff; font-size: 1.1rem; }
.sheet.start { background: #10302c; color: #fff; align-items: center; justify-content: center; text-align: center; }
.sheet.start .primary { max-width: 360px; background: var(--paper); color: var(--green); box-shadow: 0 3px 0 var(--gold); }
.sheet.start .logo { border-radius: 50%; }
.sheet.start h1 { font-size: 2.4rem; }

/* administracja */
.admin .pad { padding: 1rem; max-width: 1280px; margin: 0 auto; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin: .6rem 0; }
.row label { min-width: 10rem; }
.row .input { flex: 1; min-width: 8rem; width: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; margin: 1rem 0; }
.stat { background: #fff; border-radius: var(--r); padding: .8rem; display: flex; flex-direction: column; }
.stat small { color: var(--muted); }
.stat strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--r); overflow: hidden; }
.table th, .table td { padding: .6rem .8rem; border-bottom: 1px solid var(--line); text-align: left; }
.table td:nth-child(n+2), .table th:nth-child(n+2) { text-align: right; font-variant-numeric: tabular-nums; }
.m-img { width: 44px; height: 44px; border-radius: 10px; }
.m-img.empty { background: var(--line); }
.mrow { display: grid; grid-template-columns: 44px minmax(14rem, 3fr) 6rem 1fr 1.2fr auto auto auto; gap: .4rem; align-items: center; background: #fff; border-radius: 12px; padding: .5rem; margin-bottom: .4rem; }
.mrow.off { opacity: .55; }
.check { display: flex; align-items: center; gap: .3rem; white-space: nowrap; font-size: .9rem; }
.check input { width: 20px; height: 20px; }
.m-btns { display: flex; gap: .2rem; }
.admin .m-btns .icon-btn { background: var(--cream); color: var(--ink); min-width: 38px; height: 38px; }
@media (max-width: 700px) {
  .mrow { grid-template-columns: 44px 1fr 6.5rem; }
  .mrow > :nth-child(4), .mrow > :nth-child(5) { grid-column: 2 / -1; }
}
@media print {
  .bar, .row button, #print { display: none !important; }
  .admin .view:not(#report) { display: none !important; }
}
