/* /PN ARTs — tulajdonosi felület */

body.admin { background: var(--paper); }
.admin code { font-size: .92em; background: var(--paper-2); padding: 1px 5px; }
.a-small { font-size: 13px; margin: 18px 0 0; text-align: center; }

/* Belépés */
.a-login { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.a-login[hidden] { display: none; }
.a-login-box { width: min(420px, 100%); background: var(--white); border: 1px solid var(--ink); box-shadow: 10px 10px 0 var(--ink); padding: 34px 30px; }
.a-login-brand { width: 210px; }
.a-login-box h1 { font-family: var(--display); font-weight: 600; font-size: 28px; letter-spacing: -.035em; margin: 26px 0 6px; }
.a-login-box > p { color: var(--muted); font-size: 14px; margin: 0 0 22px; }

/* Felső sáv */
.a-bar { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--ink); }
.a-bar-inner { max-width: 1200px; margin: 0 auto; padding: 12px var(--gutter); display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; }
.a-bar-title { font-size: 11px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.a-status { margin-left: auto; font-size: 12px; color: var(--muted); }
.a-status.dirty { color: var(--ink); font-weight: 700; }
.a-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.a-actions .btn { padding: .9em 1.2em; font-size: 11px; }

.a-main { max-width: 1200px; margin: 0 auto; padding: 28px var(--gutter) 96px; }
.a-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--ink); background: var(--white); margin-bottom: 22px; }
.a-flow div { padding: 16px 18px; border-right: 1px solid var(--ink); font-size: 13.5px; color: var(--muted); }
.a-flow div:last-child { border-right: 0; }
.a-flow b { display: block; color: var(--ink); font-family: var(--display); font-size: 13px; letter-spacing: .08em; margin-bottom: 4px; }
.a-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; background: var(--ink); color: var(--paper); padding: 12px 16px; font-size: 13.5px; margin-bottom: 20px; }
.a-notice[hidden] { display: none; }
.a-notice code { background: rgba(255, 255, 255, .14); }
.a-notice button { background: var(--paper); color: var(--ink); border: 0; padding: 8px 12px; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }

/* Fülek */
.a-tabs { display: flex; border-bottom: 1px solid var(--ink); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.a-tab { flex: none; background: none; border: 0; padding: 13px 18px; font-size: 11.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; transition: background .3s, color .3s; }
.a-tab:hover { background: var(--paper-2); }
.a-tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.a-panel[hidden] { display: none; }

/* Kártyák, mezők */
.a-card { background: var(--white); border: 1px solid var(--ink); padding: 22px; margin-bottom: 16px; }
.a-card h2 { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -.01em; margin: 0 0 4px; }
.a-card > p { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }
.a-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.a-grid .full { grid-column: 1 / -1; }
.field .hint { font-size: 12px; color: var(--muted); }
.field input[type="number"] { -moz-appearance: textfield; }
.a-check { display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 700; margin: 4px 0 14px; cursor: pointer; }
.a-check input { width: 18px; height: 18px; accent-color: var(--ink); }

/* Termék sorok */
.p-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.p-toolbar h2 { font-family: var(--display); font-size: 22px; margin: 0; }
.p-toolbar h2 span { font-size: 13px; color: var(--muted); font-family: var(--body); font-weight: 600; margin-left: 8px; }
.p-row { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 20px; background: var(--white); border: 1px solid var(--ink); padding: 18px; margin-bottom: 14px; animation: fadeUp .5s var(--ease) both; }
.p-row.off { background: var(--paper-2); }
.p-thumb { aspect-ratio: 4 / 5; overflow: hidden; background: var(--paper-2); border: 1px solid var(--line); }
.p-thumb img, .p-thumb .ph { width: 100%; height: 100%; object-fit: cover; }
.p-thumb-note { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.p-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.p-no { font-family: var(--display); font-weight: 800; font-size: 12px; background: var(--ink); color: var(--paper); padding: 3px 8px; }
.p-title { font-family: var(--display); font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-tools { margin-left: auto; display: flex; gap: 6px; flex: none; }
.icon-btn { width: 34px; height: 34px; border: 1px solid var(--ink); background: var(--white); font-size: 14px; line-height: 1; display: grid; place-items: center; transition: background .3s, color .3s; }
.icon-btn:hover { background: var(--ink); color: var(--paper); }
.icon-btn.danger:hover { background: var(--error); border-color: var(--error); color: #fff; }
.icon-btn[disabled] { opacity: .3; pointer-events: none; }
.p-fields { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 0 12px; }
.p-fields .s2 { grid-column: span 2; }
.p-fields .full { grid-column: 1 / -1; }
.img-pick { display: flex; gap: 8px; }
.img-pick input[type="text"] { flex: 1; min-width: 0; }
.img-pick .btn { padding: 0 14px; font-size: 10.5px; flex: none; cursor: pointer; }
.img-pick input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.img-pick input[type="file"]:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.p-warn { font-size: 12px; font-weight: 700; margin-top: 2px; }

/* Lista szerkesztő (szállítási módok) */
.opt-row { display: grid; grid-template-columns: 1.4fr 1.6fr .8fr 34px; gap: 10px; align-items: end; padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.opt-row .field { margin-bottom: 8px; }
.opt-row .icon-btn { margin-bottom: 8px; }

/* Állapotjelzés, figyelmeztetés */
.a-status.busy { color: var(--ink); }
.a-status.error { color: var(--error); font-weight: 700; }
.a-alert { background: var(--error); }
.a-alert button { color: var(--error); }

/* Fül-jelvény (új rendelések) */
.a-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 8px; background: var(--error); color: #fff; font-size: 11px; letter-spacing: 0; border-radius: 10px; vertical-align: 1px; }
.a-badge[hidden] { display: none; }

/* Kétállású kapcsoló (szűrők) */
.a-seg { display: inline-flex; border: 1px solid var(--ink); }
.a-seg-btn { background: var(--white); border: 0; border-left: 1px solid var(--ink); padding: 9px 14px; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; transition: background .3s, color .3s; }
.a-seg-btn:first-child { border-left: 0; }
.a-seg-btn:hover { background: var(--paper-2); }
.a-seg-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Címkék */
.a-pill { display: inline-block; border: 1px solid var(--line); padding: 2px 8px; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; background: var(--white); }
.a-pill.strong { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.a-pill.ok { border-color: var(--ink); }
.a-pill.bad { border-color: var(--error); color: var(--error); }

/* Listák (mentések) */
.a-list { border-top: 1px solid var(--line); }
.a-list-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.a-list-row .btn { padding: .8em 1.1em; font-size: 10.5px; }
.a-card .hint.full { margin: 0 0 6px; }

/* Ütközés párbeszéd */
.a-modal { position: fixed; inset: 0; z-index: 200; background: rgba(10, 10, 10, .55); display: grid; place-items: center; padding: 16px; }
.a-modal[hidden] { display: none; }
.a-modal-box { width: min(620px, 100%); max-height: calc(100svh - 32px); overflow: auto; background: var(--white); border: 1px solid var(--ink); box-shadow: 10px 10px 0 var(--ink); padding: 24px; }
.a-modal-box h2 { font-family: var(--display); font-weight: 600; font-size: 24px; letter-spacing: -.03em; margin: 0 0 8px; }
.a-modal-box > p { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.a-conflict { border: 1px solid var(--line); margin: 0 0 12px; padding: 10px 14px 12px; }
.a-conflict legend { font-weight: 800; font-size: 13px; padding: 0 6px; }
.a-conflict label { display: grid; grid-template-columns: 20px 1fr; gap: 8px; align-items: start; font-size: 14px; padding: 4px 0; cursor: pointer; overflow-wrap: anywhere; }
.a-conflict input { margin: 3px 0 0; accent-color: var(--ink); }

/* Rendelések */
.o-row { background: var(--white); border: 1px solid var(--ink); margin-bottom: 10px; }
.o-row.is-new { box-shadow: 6px 6px 0 var(--ink); }
.o-head { width: 100%; display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "no date name total" "badges badges badges badges"; gap: 6px 16px; align-items: center; text-align: left; background: none; border: 0; padding: 14px 16px; }
.o-head:hover { background: var(--paper); }
.o-no { grid-area: no; font-family: var(--display); font-weight: 700; font-size: 15px; }
.o-date { grid-area: date; font-size: 13px; color: var(--muted); white-space: nowrap; }
.o-name { grid-area: name; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-total { grid-area: total; font-family: var(--display); font-weight: 700; white-space: nowrap; }
.o-badges { grid-area: badges; display: flex; flex-wrap: wrap; gap: 6px; }
.o-body { border-top: 1px solid var(--ink); padding: 16px; }
.o-body[hidden] { display: none; }
.o-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; }
.o-grid h3 { font-size: 10.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; margin: 0 0 8px; }
.o-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.o-table th { text-align: left; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--ink); padding: 6px 6px 6px 0; }
.o-table td { border-bottom: 1px solid var(--line); padding: 8px 6px 8px 0; vertical-align: top; font-variant-numeric: tabular-nums; }
.o-table td small { display: block; color: var(--muted); font-size: 11.5px; }
.o-table th:not(:first-child), .o-table td:not(:first-child) { text-align: right; white-space: nowrap; }
.o-sum { margin: 10px 0 0; font-size: 14px; }
.o-sum div, .o-cust div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.o-sum dt, .o-cust dt { color: var(--muted); }
.o-sum dd, .o-cust dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.o-sum .grand { border-top: 1px solid var(--ink); margin-top: 6px; padding-top: 8px; font-family: var(--display); font-weight: 700; font-size: 18px; }
.o-sum .grand dt { color: var(--ink); }
.o-cust { margin: 0; font-size: 14px; }
.o-cust div { border-bottom: 1px solid var(--line); padding: 7px 0; }
.o-note { white-space: pre-wrap; text-align: left !important; }
.o-err { color: var(--error); font-weight: 700; }
.o-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.o-actions .btn { padding: .85em 1.2em; font-size: 10.5px; }
.o-status { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.o-status select { font: inherit; font-size: 13px; letter-spacing: 0; text-transform: none; padding: 8px 10px; border: 1px solid var(--ink); background: var(--white); border-radius: 0; }
.o-del { margin-left: auto; }
.o-del:hover { color: #fff; }
.o-del::before { background: var(--error); }

/* Statisztika */
#panel-stats.is-loading .s-chart, #panel-stats.is-loading .s-tiles { opacity: .55; transition: opacity .3s; }
.s-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--ink); background: var(--white); margin-bottom: 12px; }
.s-tile { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-right: 1px solid var(--ink); min-width: 0; }
.s-tile:last-child { border-right: 0; }
.s-label { font-size: 10.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.s-value { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 4vw, 44px); line-height: 1.05; letter-spacing: -.03em; }
.s-sub { font-size: 12.5px; color: var(--muted); }
.s-note { font-size: 12.5px; color: var(--muted); margin: 0 0 18px; max-width: 90ch; }
.s-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.s-chart { position: relative; width: 100%; min-height: 240px; outline-offset: 4px; }
.s-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.s-chart .s-grid { stroke: var(--paper-2); stroke-width: 1; shape-rendering: crispEdges; }
.s-chart .s-base { stroke: var(--ink); }
.s-chart .s-axis { font-family: var(--body); font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.s-chart .s-bar { fill: var(--ink); }
.s-chart .s-bar.on { fill: var(--muted); }
.s-chart .s-hit { fill: transparent; cursor: crosshair; }
.s-chart .s-hit.on { fill: rgba(10, 10, 10, .05); }
.s-tip { position: absolute; z-index: 2; pointer-events: none; background: var(--ink); color: var(--paper); padding: 8px 12px; font-size: 12px; line-height: 1.4; display: flex; flex-direction: column; white-space: nowrap; }
.s-tip[hidden] { display: none; }
.s-tip-main { font-family: var(--display); font-size: 16px; font-weight: 600; }
.s-tip-day, .s-tip-sub { color: var(--muted-inv); }
.s-table { margin-top: 10px; font-size: 13.5px; }
.s-table summary { cursor: pointer; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; padding: 6px 0; }
.s-table-wrap { max-height: 360px; overflow: auto; border-top: 1px solid var(--ink); }
.s-table table { width: 100%; border-collapse: collapse; }
.s-table th, .s-table td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.s-table th:first-child, .s-table td:first-child { text-align: left; }
.s-table th { position: sticky; top: 0; background: var(--white); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

@media (max-width: 860px) {
  .s-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s-tile:nth-child(2) { border-right: 0; }
  .s-tile:nth-child(-n+2) { border-bottom: 1px solid var(--ink); }
  .o-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .o-head { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "no total" "name name" "date date" "badges badges"; }
  .o-del { margin-left: 0; }
}
@media (max-width: 860px) {
  .a-flow { grid-template-columns: 1fr; }
  .a-flow div { border-right: 0; border-bottom: 1px solid var(--ink); }
  .a-flow div:last-child { border-bottom: 0; }
  .p-fields { grid-template-columns: 1fr 1fr; }
  .p-fields .name { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .a-bar { position: static; }
  .a-status { margin-left: 0; width: 100%; order: 3; }
  .a-actions { width: 100%; }
  .a-actions .btn { flex: 1 1 auto; }
  .a-grid { grid-template-columns: 1fr; }
  .p-row { grid-template-columns: 1fr; }
  .p-thumb-wrap { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: end; }
  .opt-row { grid-template-columns: 1fr 1fr; }
  .opt-row .field:nth-child(2) { grid-column: 1 / -1; order: 3; }
}
