:root {
  --brand: #0f6e56;
  --brand-600: #0b5744;
  --brand-050: #e8f4ef;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --ink: #16231f;
  --muted: #697570;
  --line: #e6ebe8;
  --danger: #c0392b;
  --danger-050: #fdecea;
  --warn: #9a6a00;
  --warn-050: #fcf2dd;
  --ok: #2f7d32;
  --ok-050: #e9f5ea;
  --blue: #1f6feb;
  --blue-050: #e9f1fd;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .05), 0 6px 18px rgba(16, 24, 20, .06);
  --shadow-lg: 0 14px 40px rgba(16, 24, 20, .14);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Header / nav ---------- */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 110, 86, .96);
  backdrop-filter: saturate(140%) blur(6px);
  padding: 12px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06), 0 6px 18px rgba(12, 60, 46, .18);
}
header .logo { color: #fff; text-decoration: none; font-size: 17px; font-weight: 700; letter-spacing: .2px; display: flex; align-items: center; gap: 9px; }
header nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
header nav a {
  color: #d9efe7; text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 7px 11px; border-radius: 9px; transition: background .15s, color .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
header nav a:hover { background: rgba(255, 255, 255, .14); color: #fff; }
header nav .user { color: #a8d6c7; font-size: 13px; padding: 0 4px; }
header nav .chiqish { color: #ffdede; }
.nav-badge { background: #ff5a4d; color: #fff; border-radius: 20px; padding: 1px 7px; font-size: 11px; font-weight: 700; margin-left: 2px; }

/* ---------- Layout ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 26px 20px 60px; }
h1 { font-size: 24px; font-weight: 700; margin: 6px 0 18px; letter-spacing: -.3px; }
h2 { font-size: 16px; font-weight: 600; margin: 20px 0 12px; color: var(--ink); }
a { color: var(--brand); }
.hint { color: var(--muted); font-size: 13px; }
code { background: #eef1ef; padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; }
.back:hover { color: var(--brand); }

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, .0); } 50% { box-shadow: 0 0 0 4px rgba(192, 57, 43, .14); } }
main > * { animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; }
.menu li, table tbody tr { animation: rise .4s cubic-bezier(.2, .7, .2, 1) both; }
.menu li:nth-child(2) { animation-delay: .04s; } .menu li:nth-child(3) { animation-delay: .08s; }
.menu li:nth-child(4) { animation-delay: .12s; } .menu li:nth-child(5) { animation-delay: .16s; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Flash ---------- */
.flash {
  background: var(--ok-050); border: 1px solid #bfe3c2; color: #1f5c22;
  padding: 13px 16px; border-radius: var(--radius); margin-bottom: 18px;
  white-space: pre-wrap; font-size: 14px; box-shadow: var(--shadow); animation: pop .3s ease both;
}

/* ---------- Menu ---------- */
.menu { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.menu a {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.menu a:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #cfe0d9; }
.menu .tile {
  width: 46px; height: 46px; flex: none; border-radius: 12px;
  background: var(--brand-050); color: var(--brand);
  display: grid; place-items: center;
}
.menu .tile svg { width: 24px; height: 24px; }
.menu .raqam { font-size: 13px; font-weight: 700; color: var(--muted); width: 16px; }
.menu .nom { flex: 1; font-size: 17px; font-weight: 600; }
.menu .count { min-width: 40px; text-align: center; padding: 6px 13px; border-radius: 22px; font-weight: 700; font-size: 15px; }
.count.bad { background: var(--danger-050); color: var(--danger); }
.count.ok { background: var(--ok-050); color: var(--ok); }
.menu .count small { display: block; font-size: 10px; font-weight: 600; opacity: .7; }

/* ---------- Stat / zarar ---------- */
.zarar {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(180deg, #fff 0%, #fff6f5 100%);
  border: 1px solid #f3cdc7; color: var(--danger);
  padding: 16px 20px; border-radius: var(--radius); margin-bottom: 18px; box-shadow: var(--shadow);
}
.zarar .z-ic { width: 42px; height: 42px; border-radius: 11px; background: var(--danger-050); display: grid; place-items: center; flex: none; }
.zarar .z-ic svg { width: 22px; height: 22px; }
.zarar .z-lab { font-size: 13px; color: var(--muted); font-weight: 500; }
.zarar .z-val { font-size: 22px; font-weight: 800; color: var(--danger); letter-spacing: -.4px; }

/* ---------- Filtr panel (ro'yxatda) ---------- */
.filtr-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.filtr-panel > summary { cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
.filtr-panel > summary::-webkit-details-marker { display: none; }
.filtr-panel > summary::before { content: "⚙"; }
.filtr-panel[open] > summary { border-bottom: 1px solid var(--line); }
.filtr-panel .grid { padding: 18px; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 200px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search input { width: 100%; padding: 11px 12px 11px 38px; border: 1px solid var(--line); border-radius: 11px; font: inherit; background: var(--surface); box-shadow: var(--shadow); }
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-050); }
.toolbar select { padding: 11px 14px; border: 1px solid var(--line); border-radius: 11px; font: inherit; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; }

/* ---------- Table ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 15px; text-align: left; font-size: 14px; vertical-align: middle; }
thead th { background: #fafbfa; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid var(--line); }
tbody tr { border-bottom: 1px solid #f0f3f1; transition: background .14s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #fafcfb; }
tbody tr.crit { box-shadow: inset 3px 0 0 var(--danger); }
tbody tr.warn { box-shadow: inset 3px 0 0 var(--warn); }
.tovar-nom { font-weight: 600; max-width: 320px; }
.kun { white-space: nowrap; }
.kun .n { font-weight: 700; font-variant-numeric: tabular-nums; }
.tugagan { display: inline-flex; align-items: center; gap: 5px; background: var(--danger); color: #fff; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; animation: pulse 2.4s ease-in-out infinite; }
.chip-kun { display: inline-block; background: var(--warn-050); color: var(--warn); padding: 3px 10px; border-radius: 20px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tezlik-link { font-weight: 700; text-decoration: none; color: var(--brand); border-bottom: 1.5px dashed rgba(15, 110, 86, .4); font-variant-numeric: tabular-nums; }
.tezlik-link:hover { border-bottom-style: solid; }
.period-metrics { min-width: 0; }
.period-line { display: flex; gap: 7px; align-items: baseline; flex-wrap: wrap; font-size: 12px; line-height: 1.8; }
.period-line .hint { font-size: inherit; }
.period-top { color: var(--brand); font-weight: 600; }
.period-primary { color: var(--muted); font-size: 12px; white-space: normal; margin: 3px 0; }
.top-table-wrap { overflow-x: auto; }
.top-table-wrap table { min-width: 0; table-layout: fixed; }
@media (max-width: 760px) {
  .top-table-wrap table { min-width: 0; }
  .period-metrics { min-width: 0; }
  .period-line { gap: 4px; font-size: 11px; }
}
.belgi { display: inline-flex; align-items: center; gap: 4px; background: var(--warn-050); color: var(--warn); padding: 2px 8px; border-radius: 7px; font-size: 11px; font-weight: 600; margin-left: 6px; }
.tavsiya-row { background: #fffaf0; }
.foyda { font-variant-numeric: tabular-nums; font-weight: 600; }
.bosh { text-align: center; color: var(--muted); padding: 30px; }
.boshqa-tag { display: inline-block; background: var(--blue-050); color: var(--blue); padding: 2px 8px; border-radius: 7px; font-size: 12px; font-weight: 600; margin: 1px; }

/* ---------- Buttons ---------- */
.amal { white-space: nowrap; }
.amal form { display: inline; margin: 0; }
button, .btn-zam { font: inherit; cursor: pointer; border-radius: 9px; padding: 8px 13px; border: 1px solid transparent; font-weight: 600; font-size: 13px; transition: transform .12s, filter .12s, background .12s; display: inline-flex; align-items: center; gap: 6px; }
button:hover, .btn-zam:hover { transform: translateY(-1px); filter: brightness(.98); }
button:active { transform: translateY(0); }
.btn-primary { background: var(--brand); color: #fff; padding: 10px 18px; }
.btn-primary:hover { background: var(--brand-600); }
.btn-ok { background: var(--ok-050); color: var(--ok); border-color: #bfe3c2; }
.btn-del { background: var(--danger-050); color: var(--danger); border-color: #f3cdc7; }
.btn-req { background: var(--blue-050); color: var(--blue); border-color: #c5dcfa; }
.btn-zam { background: var(--warn-050); color: var(--warn); border: 1px solid #f0d79a; text-decoration: none; }

/* ---------- Forms / cards ---------- */
.kirish-box { max-width: 380px; margin: 48px auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: var(--shadow-lg); }
.kirish-box h1 { text-align: center; }
form label { display: block; margin-bottom: 14px; font-size: 14px; color: #3c4844; font-weight: 500; }
form input, form select, .select { width: 100%; padding: 11px 13px; margin-top: 6px; border: 1px solid #d9dedb; border-radius: 10px; font: inherit; background: var(--surface); }
form input:focus, form select:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-050); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 20px; align-items: end; }
.grid button { grid-column: 1 / -1; justify-self: start; }
.row { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.row form { margin: 0; }
.yet-edit { font-size: 12px; margin-left: 6px; color: var(--blue); text-decoration: none; border: 1px solid #c5dcfa; border-radius: 7px; padding: 2px 8px; white-space: nowrap; font-weight: 600; }
.yet-edit:hover { background: var(--blue-050); }
.log { background: #0f1b17; color: #d7f0e7; padding: 14px 16px; border-radius: 11px; font-size: 13px; white-space: pre-wrap; line-height: 1.6; overflow-x: auto; }
.tezlik-holat { font-size: 16px; }
.ok-txt { color: var(--ok); font-weight: 700; }
.bad-txt { color: var(--danger); font-weight: 700; }

/* ---------- Mobile: jadval -> karta ---------- */
@media (max-width: 760px) {
  main { padding: 18px 14px 50px; }
  h1 { font-size: 21px; }
  .table-wrap { background: transparent; border: none; box-shadow: none; overflow: visible; }
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tbody tr {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    margin-bottom: 12px; padding: 6px 14px; box-shadow: var(--shadow);
  }
  tbody tr:hover { background: var(--surface); }
  td { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 9px 0; border-bottom: 1px solid #f2f4f3; text-align: right; }
  td:last-child { border-bottom: none; }
  td::before { content: attr(data-label); color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; text-align: left; }
  td.amal { justify-content: flex-start; flex-wrap: wrap; }
  td.tovar-nom { max-width: none; font-size: 15px; }
  .zarar .z-val { font-size: 19px; }
}

/* Buyurtma / natsenka hisob izohi (#7) */
.buy-det { margin: 2px 0; }
.buy-det > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: baseline; gap: 6px; }
.buy-det > summary::-webkit-details-marker { display: none; }
.buy-q { font-size: 11px; color: var(--muted); border-bottom: 1px dashed var(--muted); }
.buy-calc { margin-top: 6px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; line-height: 1.7; color: var(--muted); text-align: left; }
.buy-calc b { color: var(--ink, #1a2a26); }
.buy-res { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); color: #0f6e56; }

/* Hisob havolasi -> alohida oyna (modal) */
.hisob-wrap { margin: 2px 0; }
.hisob-link { cursor: pointer; }
.hisob-link:hover { color: var(--brand); }
.hisob-num { font-weight: 700; color: var(--ink); border-bottom: none; margin-left: 0; display: inline-block; }
.hisob-num:hover { color: var(--brand); border-bottom: none; }
.hisob-izoh { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.6; }
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(16, 24, 20, .5); display: flex; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(2px); }
.modal[hidden] { display: none; }
.modal-box { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); max-width: 440px; width: 100%; padding: 22px; position: relative; animation: rise .25s cubic-bezier(.2, .7, .2, 1) both; }
.modal-box h3 { margin: 0 32px 12px 0; font-size: 17px; }
.modal-x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border: none; background: var(--bg); border-radius: 9px; font-size: 16px; cursor: pointer; color: var(--muted); }
.modal-x:hover { background: var(--danger-050); color: var(--danger); }
.modal-box .buy-calc { border: none; padding: 0; background: transparent; }
#g-modal .modal-box { max-width: 580px; max-height: 88vh; overflow: auto; }
.gr-modal-chart { margin: 0 0 14px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 8px 4px; background: var(--bg); }

/* Umumiy jadvalda mavsum biriktirish (#5) */
.mavsum-cell .mv-select { font-size: 12px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); max-width: 170px; }
.mavsum-cell .mv-select.mv-yoq { border-color: #c0392b; color: #c0392b; font-weight: 600; }

/* Boshqa filialda bor, bu yerda yo'q (#1) — ajralib turuvchi rang */
.imkon { margin-top: 26px; background: #fff7ed; border: 1px solid #f3d9b0; border-left: 4px solid #d98324; border-radius: 0 12px 12px 0; padding: 16px 18px; }
.imkon h2 { font-size: 15px; margin: 0 0 4px; color: #9a5b00; }
.imkon table { background: transparent; }

/* Telegramga yuborish ikonkasi (#2) */
.tg-send { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; color: #229ED9; background: #e7f5fc; margin-left: 4px; vertical-align: middle; text-decoration: none; border: none; padding: 0; cursor: pointer; }
.tg-send:hover { background: #229ED9; color: #fff; }
.tg-send:disabled { opacity: .6; cursor: default; }
.tg-send.tg-ok { background: var(--ok-050); color: var(--ok); }

/* Savdo grafigi sahifasi */
.gr-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 14px; margin-bottom: 16px; }
/* yopiq <details> — summary'dan boshqasi ko'rinmaydi (filtr ham, grafik ham) */
.filtr-panel:not([open]) > :not(summary) { display: none; }
.gr-controls label { font-size: 12px; font-weight: 600; color: var(--muted); display: block; }
.gr-controls .select { margin-top: 5px; }
.gr-controls label.g-range { grid-column: span 2; }
.gr-drange { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.gr-drange .select { margin-top: 0; flex: 1 1 0; min-width: 0; }
.gr-drange span { color: var(--muted); font-weight: 700; flex: 0 0 auto; }
/* grafik paneli (yopiladigan qadam) */
.gr-panel-body { padding: 16px; }
.gr-chart-panel > summary::before { content: "📈"; }
@media (max-width: 560px) { .gr-controls label.g-range { grid-column: auto; } }
.gr-stat { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.gr-stat-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.gr-stat-box:hover { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-050); }
.gr-stat-lab { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.gr-stat-val { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.3px; margin-top: 2px; }
.gr-chart-card { padding: 18px; }
.gr-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.gr-chart-head b { font-size: 16px; }
.g-rank-row:hover { background: var(--brand-050); }
.gr-tabs { display: inline-flex; gap: 4px; background: #eef2f0; border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.gr-tab { border: none; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 14px; padding: 8px 16px; border-radius: 9px; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.gr-tab:hover { color: var(--ink); }
.gr-tab.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
/* Bosh sahifa — tushgan kategoriyalar (faqat nom + foiz) */
.kat-tush-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.kat-tush-row:last-child { border-bottom: none; }
.kat-tush-nom { font-weight: 600; }
.kat-tush-foiz { font-weight: 800; color: var(--danger); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Bosh sahifa — Kategoriya qadami (bosiladigan, bo'limga o'tadi) */
.kat-qadam { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding: 18px 20px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.kat-qadam:hover { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-050); }
.kat-qadam-ikon { font-size: 22px; line-height: 1; }
.kat-qadam-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kat-qadam-nom { font-size: 17px; font-weight: 700; color: var(--ink); }
.kat-qadam-badge { background: var(--danger-050); color: var(--danger); font-weight: 700; font-size: 13px; padding: 5px 12px; border-radius: 20px; white-space: nowrap; }
.kat-qadam-strelka { font-size: 20px; color: var(--muted); }

/* Keep all report actions inside the desktop table. */
.top-table-wrap th, .top-table-wrap td { padding: 10px 7px; overflow-wrap: anywhere; }
.top-table-wrap th:nth-child(1) { width: 8%; }
.top-table-wrap th:nth-child(2) { width: 19%; }
.top-table-wrap th:nth-child(3) { width: 12%; }
.top-table-wrap th:nth-child(4) { width: 10%; }
.top-table-wrap th:nth-child(5) { width: 16%; }
.top-table-wrap th:nth-child(6) { width: 8%; }
.top-table-wrap th:nth-child(7) { width: 8%; }
.top-table-wrap th:nth-child(8) { width: 8%; }
.top-table-wrap th:nth-child(9) { width: 11%; }
.top-table-wrap .kun, .top-table-wrap .amal { white-space: normal; }
.top-table-wrap button, .top-table-wrap select { max-width: 100%; padding: 7px 5px; }
.top-table-wrap .boshqa-tag { max-width: 100%; white-space: normal; box-sizing: border-box; }
.transfer-tip { font-size: 11px; line-height: 1.5; color: #16624b; margin: 5px 0; }
.rules-panel { background: #f5faf8; border: 1px solid #dce8e1; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.rules-panel summary { cursor: pointer; font-weight: 600; }
.rules-panel p { font-size: 13px; line-height: 1.6; }
.panel-heading { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.panel-heading .rules-panel { flex: 1; min-width: 220px; }
.op-filter { grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); align-items: end; }
.date-control { position: relative; display: flex; align-items: center; gap: 4px; }
.date-control .date-display { min-width: 0; width: 100%; }
.date-control .date-native { position: absolute; width: 1px; height: 1px; opacity: 0; padding: 0; pointer-events: none; }
.date-control .date-open { padding: 8px; flex: none; }
@media (max-width: 760px) {
  .top-table-wrap th, .top-table-wrap td { width: auto; }
}

.top-table-wrap .tugagan { white-space: nowrap; overflow-wrap: normal; font-size: 11px; padding: 3px 5px; gap: 3px; }
.top-table-wrap .tugagan svg { flex-shrink: 0; width: 11px; }
.date-dialog { border: 1px solid #dce8e1; border-radius: 14px; padding: 18px; width: 310px; max-width: 90vw; color: #243830; }
.date-dialog::backdrop { background: #10251c66; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; text-align: center; margin-bottom: 12px; }
.calendar-grid button { padding: 8px 2px; }
.calendar-grid button[aria-pressed=true] { background: #176e58; color: white; }
.calendar-grid button:disabled { opacity: .3; cursor: default; }

/* Current branch inventory remains distinct from other branches and warehouse. */
.current-stock { display: block; padding: 5px 8px; margin: 0 1px 6px; border: 1px solid #c4b5fd; border-radius: 7px; background: #ede9fe; color: #4c1d95; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.current-stock.stock-empty { border-color: #fecaca; background: #fff1f2; color: #9f1239; }
.transfer-tip { color: #14532d; font-size: 12px; font-weight: 800; }
.transfer-amount { color: #14532d; font-size: 15px; font-weight: 800; }
.history-warning { color: #854d0e; font-size: 11px; line-height: 1.4; }
.availability-period { margin: 8px 0; }

.transfer-filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0; padding: 12px 14px; background: #ecfdf5; border: 1px solid #bbf7d0; border-radius: 11px; }
.transfer-filter-bar label { font-weight: 700; color: #14532d; }
.transfer-filter-bar select { width: auto; min-width: 180px; max-width: 100%; }
