/* =========================================================================
   Aplikacioni raspored — B2B portal i admin panel
   ========================================================================= */
body { background: var(--bg); }

/* ---------------------------- Demo traka ---------------------------- */
.demo-bar {
  position: sticky; top: 0; z-index: 90;
  display: flex; align-items: center; gap: 10px; justify-content: center;
  min-height: var(--demobar-h); padding: 6px 16px;
  background: var(--brown-900); color: #EADBC4; font-size: 12.5px; text-align: center;
}
.demo-bar b { color: #fff; }
.demo-bar__dot { width: 7px; height: 7px; border-radius: 50%; background: #F0B44C; box-shadow: 0 0 0 4px rgba(240,180,76,.2); flex-shrink: 0; }
.demo-bar__btn { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,.1); color: #fff; font-weight: 600; font-size: 12px; white-space: nowrap; }
.demo-bar__btn:hover { background: rgba(255,255,255,.18); }

/* ------------------------------ Layout ------------------------------ */
.app { display: flex; min-height: calc(100vh - var(--demobar-h)); }
.sidebar {
  position: sticky; top: var(--demobar-h); height: calc(100vh - var(--demobar-h));
  width: var(--sidebar-w); flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 18px 14px 14px; overflow-y: auto;
}
.sidebar__brand { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 18px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text b { font-family: var(--font-display); font-size: 19px; font-weight: 650; letter-spacing: -.01em; }
.brand__text small { font-size: 12px; color: var(--muted); font-weight: 500; }
.sidebar__close { display: none; }
.sidebar__company { display: flex; align-items: center; gap: 11px; padding: 12px; margin: 0 0 14px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--border); }
.sidebar__company div { display: flex; flex-direction: column; min-width: 0; }
.sidebar__company b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__company small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-group { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--brown-400); padding: 16px 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; width: 100%;
  height: 42px; padding: 0 12px; border-radius: 11px;
  color: var(--text-2); font-weight: 550; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.nav-link .ic { color: var(--brown-400); transition: color .15s; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--primary-soft); color: var(--crust-700); }
.nav-link.active .ic { color: var(--primary); }
.nav-link--muted { font-size: 14px; height: 38px; }
.nav-badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--primary); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.sidebar__foot { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-overlay { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: var(--demobar-h); z-index: 60;
  height: var(--topbar-h); display: flex; align-items: center; gap: 12px;
  padding: 0 28px; background: rgba(250, 244, 234, .86); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
}
.topbar__menu { display: none; }
.topbar__title { font-weight: 650; font-size: 15px; color: var(--text-2); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__actions { display: flex; align-items: center; gap: 6px; }
.dot-count { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.dot-count[hidden] { display: none; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); transition: border-color .15s; }
.user-chip:hover { border-color: var(--crust-300); }
.user-chip .avatar { width: 32px; height: 32px; font-size: 12px; }
.user-chip__text { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.user-chip__text b { font-size: 13.5px; font-weight: 600; }
.user-chip__text small { font-size: 11.5px; color: var(--muted); }
.view { padding: 26px 28px 60px; width: 100%; max-width: 1380px; margin: 0 auto; outline: none; }
.view--in { animation: viewIn .35s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }

.cart-btn { position: relative; }

/* ---------------------------- Obaveštenja ---------------------------- */
.notif-menu { width: 360px; padding: 0; max-width: calc(100vw - 24px); }
.notif-menu__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.notif-menu__list { max-height: 420px; overflow-y: auto; padding: 6px; }
.notif { display: flex; gap: 12px; padding: 10px; border-radius: 10px; }
.notif:hover { background: var(--surface-2); }
.notif__ic { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-3); display: grid; place-items: center; color: var(--crust-600); flex-shrink: 0; }
.notif__body { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 13.5px; }
.notif__body small { color: var(--text-2); font-size: 12.5px; }
.notif__body em { font-style: normal; color: var(--muted); font-size: 11.5px; }
.notif.unread .notif__ic { background: var(--primary-soft); color: var(--primary); }
.notif.unread b::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); margin-left: 6px; vertical-align: middle; }
.notif-menu__empty { padding: 30px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.notif-menu__empty p { color: var(--text); font-weight: 600; }

/* ------------------------------ Page head ------------------------------ */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 27px; font-weight: 700; letter-spacing: -.02em; }
.page-head p { color: var(--muted); margin-top: 4px; font-size: 14.5px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13.5px; font-weight: 600; margin-bottom: 10px; }
.back-link:hover { color: var(--primary); }

/* ------------------------------ Kartice ------------------------------ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; flex-wrap: wrap; }
.card__head h3 { font-size: 16px; font-weight: 650; }
.card__head p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card__body { padding: 18px 20px 20px; }
.card__body--flush { padding: 8px 0 0; }
.card + .card { margin-top: 18px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.grid-side { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 18px 16px; box-shadow: var(--shadow-xs); transition: transform .18s var(--ease), box-shadow .18s, border-color .18s; }
.kpi--link { cursor: pointer; }
.kpi--link:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--crust-300); }
.kpi__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpi__label { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi__ic { width: 30px; height: 30px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.kpi__value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 10px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi__value small { font-size: 15px; font-weight: 600; color: var(--muted); }
.kpi__sub { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.kpi__delta { font-weight: 700; }
.kpi__delta.up { color: var(--success); }
.kpi__delta.down { color: var(--danger); }

/* ------------------------------ Filteri ------------------------------ */
.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.filters .field { flex: 0 1 180px; }
.filters .field--search { flex: 1 1 240px; }
.filters .field__label { font-size: 12px; }
.filters__actions { display: flex; gap: 8px; margin-left: auto; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { border-color: var(--crust-300); color: var(--text); }
.chip.active { background: var(--brown-900); border-color: var(--brown-900); color: #fff; }
.chip .count { font-size: 11.5px; opacity: .7; }

/* ------------------------------ Tabele ------------------------------ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 0; }
.cell-title { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12.5px; color: var(--muted); }
.order-no { font-weight: 650; font-variant-numeric: tabular-nums; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; gap: 12px; flex-wrap: wrap; font-size: 13.5px; border-top: 1px solid var(--border); }
.pager__btns { display: flex; align-items: center; gap: 8px; }
.pager__num { font-weight: 600; color: var(--text-2); min-width: 50px; text-align: center; }

/* Responsivne tabele -> kartice na telefonu */
@media (max-width: 760px) {
  .table--cards thead { display: none; }
  .table--cards, .table--cards tbody, .table--cards tr, .table--cards td { display: block; width: 100%; }
  .table--cards tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .table--cards td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table--cards td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: left; flex-shrink: 0; }
  .table--cards td[data-label=""]::before { content: none; }
  .table--cards td.td-main { display: block; text-align: left; padding-bottom: 6px; }
  .table--cards td.td-main::before { content: none; }
  .table--cards .actions { justify-content: flex-end; }
  .table--cards tfoot { display: block; }
  .table--cards tfoot tr { background: var(--surface-2); }
}

/* ------------------------------ Grafikoni ------------------------------ */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: #ECE3D5; stroke-width: 1; }
.chart .grid.base { stroke: #D6C8B2; }
.chart .axis { fill: var(--muted); font-size: 11.5px; font-family: var(--font-ui); }
.chart .mark { transition: opacity .15s; }
.chart .mark.dim { opacity: .35; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: .1; }
.chart .crosshair { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart-tip { position: absolute; top: 0; display: none; pointer-events: none; z-index: 5; min-width: 140px; padding: 9px 11px; background: var(--brown-900); color: #fff; border-radius: 10px; box-shadow: var(--shadow); font-size: 12.5px; }
.chart-tip__title { font-weight: 700; margin-bottom: 4px; color: #F3E6D3; }
.chart-tip__row { display: flex; align-items: center; gap: 7px; }
.chart-tip__row span { flex: 1; opacity: .85; }
.chart-tip__row b { font-variant-numeric: tabular-nums; }
.chart-tip__row i, .legend__item i, .hbar__label i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; font-size: 12.5px; color: var(--text-2); }
.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.hbars { display: flex; flex-direction: column; gap: 14px; }
.hbar__top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 6px; }
.hbar__label { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 550; min-width: 0; }
.hbar__val { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar__val small { color: var(--muted); font-weight: 500; }
.hbar__track { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.hbar__fill { height: 100%; border-radius: 99px; transition: width .6s var(--ease); }

/* ------------------------------ Liste ------------------------------ */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 13px 20px; border-top: 1px solid var(--border); }
.list-item:first-child { border-top: 0; }
a.list-item:hover, button.list-item:hover { background: var(--surface-2); }
button.list-item { width: 100%; text-align: left; }
.list-item__ic { width: 40px; height: 40px; border-radius: 11px; background: var(--surface-3); display: grid; place-items: center; color: var(--crust-600); flex-shrink: 0; }
.list-item__date { width: 46px; height: 48px; border-radius: 11px; background: var(--primary-soft); color: var(--crust-700); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; line-height: 1.05; }
.list-item__date b { font-size: 17px; }
.list-item__date small { font-size: 10.5px; text-transform: uppercase; font-weight: 700; letter-spacing: .05em; }
.list-item__main { flex: 1; min-width: 0; }
.list-item__main b { display: block; font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item__main small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item__end { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 13.5px; }

.dl { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 550; word-break: break-word; }

/* Vremenska linija statusa */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 18px 28px; font-size: 13.5px; }
.timeline li::before { content: ''; position: absolute; left: 6px; top: 16px; bottom: -2px; width: 2px; background: var(--border); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::before { display: none; }
.timeline__dot { position: absolute; left: 0; top: 3px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); background: var(--brown-400); }
.timeline__dot--nova { background: var(--st-nova); }
.timeline__dot--potvrdjena { background: #D28A00; }
.timeline__dot--zavrsena { background: var(--st-zavrsena); }
.timeline__dot--otkazana { background: var(--st-otkazana); }
.timeline small { color: var(--muted); display: block; }

/* ------------------------- Narudžbina — proizvodi ------------------------- */
.products-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.product-tile { display: flex; gap: 14px; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.product-tile.has-qty { border-color: var(--crust-400); box-shadow: 0 0 0 3px var(--primary-soft); }
.product-tile__img { width: 84px; height: 84px; border-radius: 13px; flex-shrink: 0; background-size: cover; background-position: center; background-color: var(--surface-3); }
.product-tile__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.product-tile__body h4 { font-size: 15.5px; }
.product-tile__body p { font-size: 12.5px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-tile__price { font-weight: 650; font-size: 14px; }
.product-tile__price small { color: var(--muted); font-weight: 500; }
.product-tile__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.quick-add { display: flex; gap: 4px; }
.quick-add button { height: 28px; padding: 0 8px; border-radius: 7px; background: var(--surface-3); font-size: 12px; font-weight: 650; color: var(--text-2); }
.quick-add button:hover { background: var(--primary-soft); color: var(--crust-700); }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 11px; background: var(--surface); overflow: hidden; height: 38px; }
.stepper button { width: 36px; height: 100%; display: grid; place-items: center; color: var(--text-2); }
.stepper button:hover { background: var(--surface-2); color: var(--text); }
.stepper input { width: 58px; height: 100%; border: 0; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; background: transparent; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; background: var(--surface-2); }

.summary { position: sticky; top: calc(var(--demobar-h) + var(--topbar-h) + 16px); }
.summary__row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 6px 0; }
.summary__row span:first-child { color: var(--text-2); }
.summary__total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 14px; margin-top: 10px; border-top: 1px dashed var(--border-strong); }
.summary__total b { font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.summary__items { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.summary__item { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.summary__item span { color: var(--text-2); }

.time-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; max-height: 196px; overflow-y: auto; padding: 2px; }
.time-slot { height: 36px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.time-slot:hover:not(:disabled) { border-color: var(--crust-400); }
.time-slot.active { background: var(--brown-900); border-color: var(--brown-900); color: #fff; }
.time-slot:disabled { opacity: .35; cursor: not-allowed; text-decoration: line-through; }
.date-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.date-pill { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 64px; height: 58px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); line-height: 1.1; }
.date-pill small { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 700; letter-spacing: .04em; }
.date-pill b { font-size: 16px; }
.date-pill:hover { border-color: var(--crust-400); }
.date-pill.active { background: var(--brown-900); border-color: var(--brown-900); color: #fff; }
.date-pill.active small { color: #D9C6AA; }

.steps { display: flex; gap: 8px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.step__n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-size: 12.5px; }
.step.active { color: var(--text); }
.step.active .step__n { background: var(--brown-900); color: #fff; }
.step.done .step__n { background: var(--primary); color: #fff; }
.step-sep { width: 28px; height: 2px; background: var(--border-strong); border-radius: 2px; }

.success-hero { text-align: center; padding: 34px 20px 10px; }
.success-hero__ic { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--st-zavrsena-bg); color: var(--success); animation: pop .5s var(--ease); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.success-hero h2 { font-size: 26px; letter-spacing: -.02em; }
.success-hero p { color: var(--muted); margin-top: 6px; }

.fav-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.fav-card__items { display: flex; flex-wrap: wrap; gap: 6px; }
.fav-card__foot { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }

.location-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.location-card__head { display: flex; gap: 12px; align-items: flex-start; }
.location-card__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-stat { background: var(--surface-2); border-radius: 11px; padding: 10px; }
.mini-stat small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.mini-stat b { font-size: 16px; font-variant-numeric: tabular-nums; }

.quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.quick-action { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); text-align: left; transition: transform .18s var(--ease), border-color .18s, box-shadow .18s; }
.quick-action:hover { transform: translateY(-2px); border-color: var(--crust-300); box-shadow: var(--shadow-sm); }
.quick-action__ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.quick-action--primary { background: var(--brown-900); border-color: var(--brown-900); color: #fff; }
.quick-action--primary .quick-action__ic { background: rgba(255,255,255,.1); color: var(--crust-300); }
.quick-action--primary small { color: #CDB99C !important; }
.quick-action b { display: block; font-size: 15px; }
.quick-action small { display: block; font-size: 12.5px; color: var(--muted); }

.welcome { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 26px; margin-bottom: 18px; border-radius: var(--r-xl); background: radial-gradient(120% 140% at 100% 0%, #E9C48D 0%, #C98E4E 38%, #8C5222 100%); color: #fff; position: relative; overflow: hidden; }
.welcome::after { content: ''; position: absolute; right: -40px; top: -40px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.22), transparent 65%); }
.welcome h2 { font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -.01em; }
.welcome p { opacity: .9; margin-top: 4px; }
.welcome .btn { position: relative; z-index: 1; }

.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 12px; }
.divider { height: 1px; background: var(--border); margin: 18px 0; border: 0; }

.account-list { display: flex; flex-direction: column; gap: 8px; }
.account { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 13px; text-align: left; width: 100%; transition: border-color .15s, background .15s; }
.account:hover { border-color: var(--crust-400); background: var(--surface-2); }
.account.current { border-color: var(--crust-400); background: var(--primary-soft); }
.account__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.account__text b { font-size: 14.5px; }
.account__text small { font-size: 12.5px; color: var(--muted); }

.prod-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.prod-admin__card { overflow: hidden; display: flex; flex-direction: column; }
.prod-admin__img { height: 150px; background-size: cover; background-position: center; background-color: var(--surface-3); position: relative; }
.prod-admin__img .badge { position: absolute; top: 12px; left: 12px; }
.prod-admin__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.prod-admin__price { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.prod-admin__price small { font-size: 13px; color: var(--muted); font-weight: 500; }

.bottom-nav { display: none; }

/* ------------------------------ Responzivnost ------------------------------ */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-side { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 980px) {
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; z-index: 200; transform: translateX(-102%); transition: transform .28s var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar__close { display: inline-grid; }
  body.sidebar-open .sidebar { transform: none; }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 190; background: rgba(30,22,17,.4); opacity: 0; pointer-events: none; transition: opacity .25s; display: block; }
  body.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
  .topbar__menu { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .view { padding: 20px 16px 48px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-side { grid-template-columns: 1fr; }
  .summary { position: static; }
  .user-chip__text { display: none; }
  .user-chip { padding: 3px; }
  .user-chip > .ic { display: none; }
}
@media (max-width: 760px) {
  .demo-bar { font-size: 11.5px; justify-content: space-between; text-align: left; }
  .demo-bar > span:not(.demo-bar__dot) { flex: 1; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 23px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .welcome { flex-direction: column; align-items: flex-start; padding: 22px; }
  .welcome h2 { font-size: 24px; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 10px; }
  .filters .field { flex: 1 1 140px; }
  .filters__actions { width: 100%; margin-left: 0; }
  .filters__actions .btn { flex: 1; }
  .card__head, .card__body { padding-left: 16px; padding-right: 16px; }
  .list-item { padding: 12px 16px; }
  .app--portal .view { padding-bottom: 96px; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav__item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 11px; font-weight: 600; color: var(--muted); border-radius: 10px; }
  .bottom-nav__item.active { color: var(--primary); }
  .bn-ic { position: relative; }
  .bn-ic .dot-count { top: -6px; right: -10px; }
}
@media (max-width: 420px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi__value { font-size: 22px; }
  .location-card__stats { grid-template-columns: 1fr 1fr 1fr; }
}

/* ------------------------------ Štampa ------------------------------ */
@media print {
  .demo-bar, .sidebar, .topbar, .bottom-nav, .page-actions, .back-link, .toasts, .sidebar-overlay { display: none !important; }
  body, .view { background: #fff; padding: 0; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .grid-side { grid-template-columns: 1fr 1fr; }
}

/* ------------------------------ Portal — dopune ------------------------------ */
.kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.welcome__loc { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 6px 6px 6px 12px; border-radius: 99px; background: rgba(255,255,255,.16); backdrop-filter: blur(6px); font-size: 14px; position: relative; z-index: 1; max-width: 100%; }
.welcome__loc span { padding-right: 8px; }
.welcome__select { appearance: none; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center; border: 0; color: #fff; font: inherit; font-weight: 600; padding: 4px 28px 4px 0; cursor: pointer; max-width: 100%; text-overflow: ellipsis; }
.welcome__select option { color: var(--text); }
.welcome__select:focus-visible { outline: 2px solid #fff; border-radius: 6px; }
.welcome__cta { height: 60px; padding: 0 30px; font-size: 17px; border-radius: 16px; }
.usual { border-color: var(--crust-300); background: linear-gradient(180deg, #FFFBF4, var(--surface)); }
#usualHost > .card, .repeat-card { height: 100%; }
@media (max-width: 760px) {
  .kpis--3 { grid-template-columns: 1fr; }
  .welcome__cta { width: 100%; height: 56px; }
}

/* ------------------------------ Admin — dopune ------------------------------ */
.kpis--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1420px) { .kpis--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } .kpis--6 .kpi__value { font-size: 24px; } }
.gsearch { position: relative; width: min(380px, 34vw); margin-right: 6px; }
.gsearch .input { padding-right: 34px; background: var(--surface); }
.gsearch__kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 600 11px var(--font-ui); color: var(--muted); border: 1px solid var(--border-strong); border-radius: 5px; padding: 1px 6px; background: var(--surface-2); pointer-events: none; }
.gsearch__panel { position: absolute; top: calc(100% + 8px); left: 0; right: 0; min-width: 320px; max-height: 460px; overflow-y: auto; z-index: 130; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; display: none; }
.gsearch.open .gsearch__panel { display: block; }
.gsearch__group { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; }
.gsearch__item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; font-size: 13.5px; }
.gsearch__item .ic { color: var(--crust-500); }
.gsearch__item b { display: block; font-weight: 600; }
.gsearch__item small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gsearch__item:hover, .gsearch__item.active { background: var(--surface-2); }
.gsearch__hint { padding: 14px 12px; color: var(--muted); font-size: 13px; }
.drawer-sec { padding: 14px 0; border-bottom: 1px solid var(--border); }
.drawer-sec:first-child { padding-top: 4px; }
.drawer-sec:last-child { border-bottom: 0; }
.modal__title .badge { vertical-align: middle; margin-left: 6px; }
.status-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.status-pick__btn { padding: 6px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); transition: border-color .15s, transform .12s; }
.status-pick__btn:hover:not(:disabled) { border-color: var(--crust-400); transform: translateY(-1px); }
.status-pick__btn.active { border-color: var(--brown-900); box-shadow: 0 0 0 2px var(--brown-900); cursor: default; }
.list-item__ic--danger { background: var(--st-otkazana-bg); color: var(--danger); }
.list-item__ic--warning { background: var(--st-potvrdjena-bg); color: var(--warning); }
.list-item__ic--success { background: var(--st-zavrsena-bg); color: var(--success); }
.list-item__ic--nova { background: var(--st-nova-bg); color: var(--st-nova); }
.delta { font-weight: 700; font-size: 13px; white-space: nowrap; }
.delta--up { color: var(--success); }
.delta--down { color: var(--danger); }
.card--signal { border-color: #EBCFB0; }
tr[data-drawer] { cursor: pointer; }
@media (max-width: 1180px) { .gsearch { width: 260px; } }
@media (max-width: 760px) {
  .kpis--6 { grid-template-columns: 1fr 1fr; }
  .app--admin .topbar__title { display: none; }
  .gsearch { width: auto; flex: 1; margin-right: 0; }
  .gsearch__kbd { display: none; }
  .gsearch__panel { position: fixed; left: 12px; right: 12px; top: calc(var(--demobar-h) + var(--topbar-h)); min-width: 0; }
  .topbar__actions { flex: 1; justify-content: flex-end; }
}
#draftBadge { min-width: 8px; width: 8px; height: 8px; padding: 0; font-size: 0; background: var(--primary); }

/* =========================================================================
   MOBILNA OPTIMIZACIJA (portal + admin)
   ========================================================================= */
.mobile-bar, .filters__toggle, .demo-bar__short { display: none; }
.filters__count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; }
html, body { overflow-x: clip; }
@media (max-width: 760px) {
  /* kraća demo traka */
  .demo-bar__long { display: none; }
  .demo-bar__short { display: inline; }
  :root { --topbar-h: 56px; }

  /* polja od 16px — iOS ne zumira pri fokusu */
  .input, .input--sm, .stepper input, select.input { font-size: 16px; }
  .input--sm { height: 42px; }

  /* veće površine za dodir */
  .icon-btn--sm { width: 40px; height: 40px; }
  .btn--sm { height: 40px; }
  .chip { height: 36px; }
  .stepper { height: 46px; }
  .stepper button { width: 46px; }
  .stepper input { width: 64px; }
  .quick-add button { height: 36px; padding: 0 12px; font-size: 13px; }
  .time-slots { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); max-height: none; }
  .time-slot { height: 44px; }

  /* filteri: pretraga + dugme „Filteri“ */
  .filters__toggle { display: inline-flex; align-self: flex-end; height: 42px; }
  .filters:not(.filters--open) > .field:not(.field--search),
  .filters:not(.filters--open) > .filters__actions { display: none; }
  .filters .field--search { flex: 1 1 0; min-width: 0; }
  .filters--open > .field:not(.field--search) { flex: 1 1 calc(50% - 5px); }

  /* horizontalni skrol umesto prelamanja */
  .chips, .date-pills, .segmented { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; max-width: 100%; }
  .chips::-webkit-scrollbar, .date-pills::-webkit-scrollbar, .segmented::-webkit-scrollbar { display: none; }
  .chip, .date-pill, .segmented button { flex-shrink: 0; }
  .card__head > .row, .card__head > .segmented { width: 100%; }

  /* proizvodi u novoj narudžbini */
  .product-tile { padding: 12px; gap: 12px; }
  .product-tile__img { width: 72px; height: 72px; }
  .product-tile__foot { gap: 10px; }

  /* stavke u koraku isporuke */
  #cartItems .list-item { flex-wrap: wrap; }
  #cartItems .list-item__main { flex: 1 1 calc(100% - 110px); }
  #cartItems .list-item__end { min-width: 0 !important; margin-left: auto; }

  /* fiksna akciona traka iznad donje navigacije */
  .mobile-bar { display: flex; align-items: center; gap: 12px; position: fixed; left: 0; right: 0; z-index: 79;
    bottom: calc(62px + env(safe-area-inset-bottom)); padding: 10px 16px; background: var(--surface);
    border-top: 1px solid var(--border); box-shadow: 0 -8px 24px rgba(43, 32, 25, .08); }
  .mobile-bar__info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
  .mobile-bar__info b { font-size: 16px; font-variant-numeric: tabular-nums; }
  .mobile-bar__info small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mobile-bar .btn { height: 48px; padding: 0 18px; flex-shrink: 0; }
  .app--portal .view.has-mobile-bar { padding-bottom: 170px; }
  .summary #submitOrder, .summary a.btn--primary { display: none; }
  body:has(.mobile-bar) .toasts { bottom: 150px; }

  /* drawer i modali */
  .drawer-sec .table th, .drawer-sec .table td { padding: 10px 8px; }
  .dl dd { margin-bottom: 8px; }

  /* tabele kao kartice: malo vazduha */
  .table--cards tr { padding: 14px 16px; }
  .table--cards td { font-size: 14px; }
  .page-head { margin-bottom: 16px; }
  .kpi__label { font-size: 12.5px; }
}
@media (max-width: 380px) {
  .kpis, .kpis--6 { grid-template-columns: 1fr; }
  .bottom-nav__item { font-size: 10px; }
  .mobile-bar .btn { padding: 0 14px; }
}

/* ------------------------------ Stalne narudžbine ------------------------------ */
.plan__head { display: flex; align-items: center; gap: 14px; }
.plan__name { font-size: 17px; }
.plan--paused { opacity: .75; }
.plan__week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 16px 0 12px; }
.plan__day { border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); text-align: center; padding: 8px 2px; line-height: 1.2; }
.plan__day small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.plan__day b { font-size: 15px; font-variant-numeric: tabular-nums; color: var(--brown-400); }
.plan__day.on { background: var(--primary-soft); border-color: var(--crust-300); }
.plan__day.on b { color: var(--crust-700); }
.plan__sched { margin: 14px -20px -20px; border-top: 1px solid var(--border); }
.tag--plan { gap: 3px; height: 19px; font-size: 11px; padding: 0 6px; vertical-align: middle; background: var(--st-nova-bg); color: var(--st-nova); }
.week-grid th, .week-grid td { padding: 8px 6px; }
.week-grid__prod { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 120px; padding-left: 16px !important; }
.week-grid thead .week-grid__prod, .week-grid tfoot .week-grid__prod { background: var(--surface-2); }
.week-grid__in { width: 72px; min-width: 64px; text-align: center; padding: 0 6px; font-variant-numeric: tabular-nums; }
.week-grid__in:not(:placeholder-shown):valid { border-color: var(--crust-300); background: #FFFBF4; }
@media (max-width: 760px) {
  .plan__sched { margin: 14px -16px -16px; }
  .plan__week { gap: 4px; }
  .plan__day b { font-size: 13px; }
  .summary [type=submit] { display: none; }
}

/* ------------------------------ Cene po klijentu ------------------------------ */
.tag--price { height: 19px; font-size: 11px; padding: 0 6px; vertical-align: middle; background: var(--st-zavrsena-bg); color: var(--success); }
.discount-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.discount-row .field { flex: 0 1 320px; }
.discount-row__kpi { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.discount-row__kpi small { font-size: 12px; font-weight: 600; color: var(--muted); }
.discount-row__kpi b { font-size: 22px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.input-suffix { position: relative; display: block; }
.input-suffix .input { padding-right: 36px; }
.input-suffix > span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.rules-list .list-item { padding-left: 0; padding-right: 0; }
@media (max-width: 760px) {
  .discount-row .field, .discount-row .btn { flex: 1 1 100%; }
  .discount-row__kpi { margin-left: 0; align-items: flex-start; text-align: left; }
}

.tag--guest { height: 19px; font-size: 11px; padding: 0 6px; vertical-align: middle; background: #FFF1C9; color: #7A5600; }
