
/* POSTA BEKI MANAGER — ORANGE / INK DESIGN SYSTEM */
:root {
  font-family: 'DM Sans', system-ui, sans-serif;
  color: #202126;
  background: #f7f7f5;
  --orange: #f46b24;
  --orange-dark: #d94d12;
  --ink: #191b20;
  --muted: #81838b;
  --line: #ebebea;
  --surface: #ffffff;
  --shadow: 0 6px 30px rgba(25,27,32,.035);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; }
button { cursor: pointer; transition: background .18s, transform .18s, box-shadow .18s; }
button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(244,107,36,.25); outline-offset: 2px; }
.hidden { display: none !important; }

header {
  min-height: 84px; display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 15px max(24px, calc((100vw - 1420px)/2));
  background: #fff; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; font: 800 19px Montserrat, sans-serif; letter-spacing: -.8px; }
.brand-mark { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 13px; background: var(--orange); color: #fff; font-size: 14px; letter-spacing: -.7px; }
.brand-text span { color: var(--orange); }
main { max-width: 1468px; padding: 34px 24px 80px; margin: 0 auto; }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0 0 22px; padding: 7px; background: #fff; border: 1px solid var(--line); border-radius: 17px; width: fit-content; max-width: 100%; box-shadow: var(--shadow); }
button { border: 0; border-radius: 10px; padding: 11px 18px; font-weight: 700; font-size: 13px; background: var(--orange); color: #fff; }
button:hover { background: var(--orange-dark); box-shadow: 0 5px 15px rgba(244,107,36,.16); }
button.secondary { background: #f3f3f2; color: #4c4d52; }
button.secondary:hover { background: #eaeae8; box-shadow: none; }
.tab { background: transparent; color: #6c6d72; padding: 12px 19px; }
.tab:hover { background: #fff3ec; color: var(--orange-dark); box-shadow: none; }
.tab.active { background: var(--ink); color: #fff; box-shadow: 0 4px 10px rgba(0,0,0,.09); }
.tab.active:hover { background: #34363c; }
#refresh { margin-left: 8px; }
h1, h2 { font-family: Montserrat, sans-serif; letter-spacing: -.8px; }
h1 { margin: 4px 0 10px; font-size: clamp(28px, 3vw, 38px); font-weight: 800; }
h2 { font-size: 18px; margin: 0 0 10px; font-weight: 800; }
.heading-dot { color: var(--orange); }
.eyebrow, .section-kicker { color: var(--orange-dark); font-size: 10px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }
.eyebrow { margin-top: 24px; }
.section-kicker { margin-bottom: 10px; }
p.muted, .muted { color: var(--muted); }
.panel > .muted { margin: 0 0 24px; font-size: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 25px; margin: 24px 0; box-shadow: var(--shadow); }
.card > p.muted { margin: 0 0 22px; font-size: 13px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; margin-top: 26px; }
.metric { position: relative; min-width: 0; min-height: 153px; background: #fff; border: 1px solid var(--line); border-radius: 19px; padding: 22px; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s, border-color .2s; }
.metric:hover { transform: translateY(-3px); border-color: #f8c4a7; box-shadow: 0 12px 30px rgba(25,27,32,.065); }
.metric-top { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.metric .label { color: #797b82; font-size: 12px; font-weight: 700; line-height: 1.5; }
.metric .value { font-family: Montserrat, sans-serif; font-size: clamp(19px,2vw,29px); font-weight: 800; margin-top: 22px; letter-spacing: -1px; overflow-wrap: anywhere; }
.metric-symbol { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #fff0e7; color: var(--orange); font-size: 17px; flex-shrink: 0; }
.metric-featured { background: var(--ink); border-color: var(--ink); color: #fff; }
.metric-featured .label { color: #b5b6bb; }
.metric-featured .metric-symbol { background: #393137; color: #ff975d; }
.metric-featured:hover { border-color: var(--ink); }
.filters { display: flex; gap: 12px; margin: 22px 0; }
.filters input { flex: 1; }
input, select { background: #fff; color: var(--ink); border: 1px solid #e2e2e1; border-radius: 11px; padding: 12px 14px; min-width: 0; font-size: 13px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(244,107,36,.11); }
input::placeholder { color: #a3a4a8; }
input[type=checkbox] { accent-color: var(--orange); width: 16px; height: 16px; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.table-wrap { max-width: 100%; width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 15px; background: #fff; -webkit-overflow-scrolling: touch; }
table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1080px; font-size: 12px; }
th, td { padding: 16px 15px; text-align: left; border-bottom: 1px solid #f0f0ef; white-space: nowrap; }
th { background: #fafaf9; color: #878990; font-size: 11px; font-weight: 800; letter-spacing: .25px; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #fff8f3; }
tbody tr:last-child td { border-bottom: 0; }
td { color: #34363b; font-weight: 600; }
td input[type=number] { width: 79px; padding: 9px; background: #fcfcfb; }
td button { min-width: 68px; padding: 9px 13px; font-size: 12px; white-space: nowrap; }
.financial-table { min-width: 680px; }
.financial-table th:not(:first-child), .financial-table td:not(:first-child) { text-align: right; }
.financial-table td:last-child { font-weight: 800; color: #202126; }
.financial-total td { background: #fff2e9; color: #b8460c !important; font-weight: 800; border-top: 1px solid #ffd9c2; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 100px; font-size: 11px; font-weight: 800; background: #f2f3f5; color: #60636b; }
.badge::before { content: ''; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.badge.status-krijuar { background: #e8f1ff; color: #2563eb; }
.badge.status-ne-dergim { background: #fff4d9; color: #a66a00; }
.badge.status-ne-depo { background: #fff0dc; color: #bf741a; }
.badge.status-ne-pritje { background: #fff4df; color: #9b6b14; }
.badge.status-dorezuar { background: #e4f8eb; color: #168044; }
.badge.status-likuiduar { background: #d9f7ef; color: #087c69; }
.badge.status-anuluar { background: #ffe6e5; color: #c23832; }
.badge.status-kthyer { background: #fbe5ed; color: #a62e59; }
.ad-form { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.ad-form label, .login label { display: flex; flex-direction: column; gap: 8px; color: #575960; font-size: 12px; font-weight: 800; }
.ad-form button { align-self: end; min-height: 43px; }
.login { max-width: 460px; margin: 75px auto; padding: 36px; }
.login p { color: var(--muted); }
.login form { display: grid; gap: 18px; margin-top: 26px; }
.login form button { min-height: 46px; }
.bar-row { display: grid; grid-template-columns: 140px minmax(0,1fr) 38px; align-items: center; gap: 15px; margin: 15px 0; }
.bar-row span { font-size: 12px; font-weight: 700; color: #62646b; }
.bar-row div { height: 11px; min-width: 2px; max-width: 100%; background: linear-gradient(90deg,#ffb17b,var(--orange)); border-radius: 20px; transition: width .4s; }
.bar-row b { color: #34363b; font-size: 12px; text-align: right; }
#message { min-height: 20px; font-size: 12px; font-weight: 700; color: #aa642d; margin: 0 0 12px; }
#message:empty { min-height: 0; margin: 0; }
@media(max-width:1000px) { .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); } .ad-form { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:650px) {
  header { min-height: 72px; padding: 12px 16px; }
  .brand { font-size: 15px; }
  .brand-mark { width: 37px; height: 37px; }
  main { padding: 22px 14px 55px; }
  nav { width: 100%; gap: 4px; padding: 6px; }
  .tab { flex: 1 1 auto; padding: 11px 9px; font-size: 11px; }
  #refresh { margin-left: 0; }
  .metrics { gap: 10px; }
  .metric { padding: 16px; min-height: 125px; border-radius: 15px; }
  .metric .value { font-size: 20px; margin-top: 17px; }
  .metric .label { font-size: 11px; }
  .card { padding: 18px; border-radius: 16px; }
  .filters { flex-direction: column; }
  .ad-form { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 90px minmax(0,1fr) 26px; gap: 9px; }
  .bar-row span { font-size: 10px; }
  .login { margin: 35px auto; padding: 24px; }
}
@media(prefers-reduced-motion:reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }

/* Payment status filter */
.filters select { min-width: 165px; }
@media (max-width: 650px) { .filters select { width: 100%; } }

/* Refinements — navigation, tables, status and supplier stacks */
nav .tab { min-width: 125px; font-size: 14px; padding: 14px 23px; }
#orders table th { font-size: 13px; padding-top: 19px; padding-bottom: 19px; }
#orders .filters { flex-wrap: wrap; }
#orders .filters select { min-width: 155px; }
.status-stacks { display: grid; grid-template-columns: repeat(auto-fit,minmax(165px,1fr)); gap: 13px; }
.status-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 11px; padding: 19px; border: 1px solid var(--line); border-radius: 15px; background: #fcfcfb; transition: transform .2s, border-color .2s; }
.status-stack:hover { transform: translateY(-3px); border-color: #ffc29f; }
.status-stack strong { font: 800 30px Montserrat,sans-serif; letter-spacing: -1px; }
.status-stack small { color: var(--muted); font-weight: 600; }
.supplier-stacks { display: grid; gap: 12px; margin-top: 24px; }
.supplier-stack { display: flex; align-items: center; gap: 16px; padding: 19px 22px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .2s, border-color .2s; }
.supplier-stack:hover { transform: translateY(-2px); border-color: #ffbb92; }
.supplier-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #fff0e7; color: var(--orange-dark); font-weight: 800; flex-shrink: 0; }
.supplier-name { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.supplier-stack strong { font: 800 17px Montserrat,sans-serif; white-space: nowrap; }
.profit-note { font-size: 11px; margin: 12px 0 0; }
@media(max-width:650px) { nav .tab { min-width: 0; font-size: 12px; padding: 12px 11px; } #orders .filters select { flex: 1; } .supplier-stack { padding: 15px; } }

/* Bulk save controls */
.orders-save-bar {
  position: sticky;
  bottom: 14px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 14px 18px;
  border: 1px solid #f3d3be;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(25, 27, 32, .10);
}
#unsaved-count { font-size: 13px; font-weight: 700; color: #6c6d72; }
#save-all-orders { min-width: 175px; }
#save-all-orders:disabled { background: #e8e8e6; color: #999; cursor: not-allowed; box-shadow: none; }
#orders tbody tr.order-edited { background: #fff8f1; }
@media (max-width: 550px) {
  .orders-save-bar { padding: 12px; }
  #save-all-orders { min-width: 0; }
}

/* SUPPLIERS: THREE CARDS PER ROW */
#suppliers-body.supplier-cards-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; margin-top:24px; }
.supplier-card { display:flex; flex-direction:column; gap:16px; min-width:0; padding:24px; background:#fff; border:1px solid #e8e8e8; border-radius:18px; box-shadow:0 5px 20px rgba(0,0,0,.04); }
.supplier-card-header { display:flex; align-items:center; gap:12px; margin-bottom:8px; min-width:0; }
.supplier-caption { font-size:10px; font-weight:800; letter-spacing:1.2px; color:#81838b; }
.supplier-card-name { font:800 16px Montserrat,sans-serif; color:#191b20; overflow-wrap:anywhere; margin-top:5px; }
.supplier-card-amount { font:800 28px Montserrat,sans-serif; color:#191b20; }
.supplier-cost-note { font-size:11px; color:#a65b1d; margin:-8px 0 0; }
.supplier-pay-btn { width:100%; margin-top:auto; padding:13px 16px; background:#f46b24; color:#fff; border:0; border-radius:11px; font-size:13px; font-weight:800; cursor:pointer; }
.supplier-pay-btn:hover:not(:disabled) { background:#d94d12; }
.supplier-pay-btn:disabled { opacity:.6; cursor:wait; }
@media(max-width:900px) { #suppliers-body.supplier-cards-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) { #suppliers-body.supplier-cards-grid { grid-template-columns:1fr; } }

/* Supplier cards: four per row on wide screens. */
#suppliers-body.supplier-cards-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  #suppliers-body.supplier-cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  #suppliers-body.supplier-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  #suppliers-body.supplier-cards-grid { grid-template-columns: 1fr; }
}
