/* Guria Fish Farming — ტელეფონზე გათვლილი (mobile-first) */
:root {
  --bg: #f3f6f4;
  --surface: #ffffff;
  --surface-2: #eef3f0;
  --text: #17231d;
  --muted: #5d6b64;
  --line: #d7e0db;
  --brand: #1f5a40;
  --brand-2: #2f7d55;
  --accent: #b8860b;
  --s-green: #2f7d55;
  --s-yellow: #d9a520;
  --s-red: #c0392b;
  --s-critical: #7a1020;
  --s-empty: #c9d3ce;
  --on-status: #ffffff;
  --plan-bg: #fff6dc;
  --plan-line: #e5c66b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 14px rgba(0, 0, 0, .05);
  color-scheme: light;
}


* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* hidden ყოველთვის მალავს, display-ის წესების მიუხედავად */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 "Noto Sans Georgian", "Sylfaen", "BPG Arial", system-ui, -apple-system, "Segoe UI", sans-serif;
}
button { font: inherit; color: inherit; cursor: pointer; }

/* ---------------------------------------------------------------- ზედა ზოლი */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
/* ლოგო: კომპანიის სახელი ლამაზი შრიფტით (ინტერნეტის გარეშე — Georgia) */
.brand {
  flex: none; text-decoration: none; white-space: nowrap; line-height: 1;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif; color: var(--brand);
}
.brand-main { font-weight: 700; font-size: 22px; letter-spacing: .3px; }
.brand-sub { font-style: italic; font-weight: 500; font-size: 17px; color: var(--brand-2); }
@media (max-width: 640px) { .brand-main { font-size: 19px; } .brand-sub { font-size: 14px; } }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-item {
  padding: 7px 12px; border-radius: 999px; white-space: nowrap;
  color: var(--muted); text-decoration: none; font-size: 14px;
}
.nav-item.active { background: var(--surface-2); color: var(--brand); font-weight: 600; }
.nav-item.soon { opacity: .45; cursor: default; }

/* ---------------------------------------------------------------- განლაგება */
/* ტელეფონზე: თარიღი → აუზები → ჯამები */
.layout { display: flex; flex-direction: column; gap: 14px; padding: 12px 16px 32px; }
.side { display: contents; }
.date-card { order: 0; }
.alerts { order: 1; }
.farm { order: 2; min-width: 0; }
.totals { order: 3; }
.legend { order: 4; }

/* კომპიუტერზე: აუზები მარცხნივ, ეკრანის სიმაღლეზე (სქროლის გარეშე), ინფორმაცია მარჯვნივ — დანარჩენ სიგანეზე.
   აუზების ბლოკის სიმაღლე ≈ 1.22 × სიგანე (3 რიგი დიდი + პატარების რიგი მთელ სიგანეზე), ამიტომ სიგანე = სიმაღლე / 1.23 */
@media (min-width: 900px) {
  .layout {
    display: grid; gap: 20px; align-items: start;
    grid-template-columns: auto minmax(0, 1fr) 300px;      /* აუზები · თავისუფალი ადგილი (მომავალი ინფორმაცია) · ვიწრო პანელი */
    padding: 14px 24px 14px;
  }
  .farm { order: 0; width: min(calc((100dvh - var(--topbar, 58px) - 34px) / 1.23), calc(100vw - 400px)); }
  .side {
    order: 1;
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; min-width: 0;
    max-height: calc(100dvh - var(--topbar, 58px) - 28px); overflow-y: auto;
  }
}

/* ---------------------------------------------------------------- აუზები */
.big-pools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(6px, 2vw, 18px); }
.small-pools { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(4px, 1.5vw, 14px); margin-top: clamp(8px, 2vw, 18px); }

.pool {
  position: relative; aspect-ratio: 1; border-radius: 50%;
  border: 0; padding: 0;
  container-type: inline-size;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--s-green); color: var(--on-status);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .25), var(--shadow);
  transition: transform .12s ease;
  text-align: center; line-height: 1.15;
  min-width: 0; overflow: hidden;
}
.pool:hover { transform: scale(1.02); }
.pool:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.pool.yellow { background: var(--s-yellow); color: #2b2205; }
.pool.red { background: var(--s-red); }
.pool.critical { background: var(--s-critical); box-shadow: 0 0 0 4px var(--s-red), var(--shadow); }
.pool.empty { background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 3px var(--s-empty); }

.pool .p-no { font-weight: 700; font-size: clamp(12px, 13cqi, 30px); }
.pool .p-batch { font-size: clamp(8px, 6cqi, 12px); opacity: .8; }
.pool .p-t { font-weight: 700; font-size: clamp(12px, 12cqi, 26px); }
.pool .p-line { font-size: clamp(8px, 7.5cqi, 16px); opacity: .95; }
.pool .p-status { font-size: clamp(7px, 6cqi, 12px); font-weight: 600; margin-top: 2px; }
@container (max-width: 120px) {
  .pool .p-batch, .pool .p-avg, .pool .p-status { display: none; }
}
/* პატარა აუზები — ცოტა მსხვილი შრიფტი (ნაკლები სტრიქონი აქვთ) */
.small-pools .pool .p-no { font-size: clamp(13px, 16cqi, 30px); }
.small-pools .pool .p-t { font-size: clamp(13px, 16cqi, 26px); }
.small-pools .pool .p-line { font-size: clamp(9px, 10cqi, 16px); }
@container (max-width: 80px) {
  .pool .p-count, .pool .p-norm { display: none; }
}

.pool-cell { position: relative; min-width: 0; }
.pool-cell .pool { width: 100%; padding-bottom: 7%; }      /* ტექსტი ოდნავ ზემოთ */
/* ნიშნები — წრის კიდეზე, ოთხ კუთხეში (X; ადგილს app.js სვამს %-ით): ნახევარი აუზში შედის. ფერადი ფონი,
   თეთრი ნიშანი და ჩარჩო — ჩანს მწვანე/ყვითელ აუზზეც და თეთრ ფონზეც */
.badges { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.badge {
  position: absolute; transform: translate(-50%, -50%); pointer-events: auto;
  width: clamp(18px, 4.2vw, 28px); height: clamp(18px, 4.2vw, 28px); border-radius: 50%; border: 2px solid #fff; padding: 0;
  display: grid; place-items: center;
  font-size: clamp(11px, 2.4vw, 15px); font-weight: 800; line-height: 1;
  background: #555; color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
.badge.feed { background: #e08a00; }
.badge.sale { background: #b8920a; }
.badge.grading { background: #6a3fb5; }
.badge.pellet { background: #1565c0; font-size: clamp(9px, 1.9vw, 12px); letter-spacing: -.04em; }
.small-pools .badge { width: clamp(16px, 3.4vw, 22px); height: clamp(16px, 3.4vw, 22px); font-size: clamp(10px, 2vw, 13px); }
.small-pools .badge.pellet { font-size: clamp(8px, 1.6vw, 10px); }

/* ---------------------------------------------------------------- გვერდითა პანელი */
.date-card, .totals, .alerts:not(:empty), .legend {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow);
}
.date-card.other-day { background: var(--plan-bg); border-color: var(--plan-line); }
.date-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.date-row { display: flex; gap: 6px; }
.date-input {
  flex: 1; min-width: 0; text-align: center; font-size: 18px; font-weight: 600;
  padding: 8px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text);
}
.icon-btn {
  min-width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); font-size: 20px;
}
.cal-btn { position: relative; font-size: 18px; }
.date-field { display: flex; gap: 6px; }
.date-field input { flex: 1; min-width: 0; }
.date-field .cal-btn { min-width: 42px; height: auto; }
.cal-btn input[type="date"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.date-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.mode { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); }
.mode.plan { background: var(--plan-line); color: #2b2205; }
.btn-today {
  border: 0; border-radius: 10px; padding: 8px 14px;
  background: var(--brand); color: #fff; font-weight: 600;
}
.btn-today[hidden] { display: none; }

.totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
@media (min-width: 900px) { .totals { grid-template-columns: minmax(0, 1fr); } }
.total { min-width: 0; overflow-wrap: anywhere; }
.total .t-label { font-size: 12px; color: var(--muted); }
.total .t-value { font-size: 22px; font-weight: 700; }
.total .t-unit { font-size: 13px; color: var(--muted); font-weight: 400; }

.alerts { display: grid; gap: 6px; }
.alert { font-size: 13px; padding: 8px 10px; border-radius: 10px; background: #fdecea; color: #7a1020; }

/* ---------------------------------------------------------------- მთავარი გვერდის ბარათები (§9.6) */
/* აუზებსა და მარჯვენა პანელს შორის: პატარა ბარათები, ფართო ეკრანზე — რამდენიმე სვეტად */
.info-cards {
  order: 3; display: grid; gap: 12px; align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.info-cards:empty { display: none; }
/* ვიწრო კომპიუტერზე შუაში ადგილი არ რჩება — ბარათები აუზების ქვეშაა; ≥1200px — ერთ სვეტად, ერთმანეთის ქვეშ,
   მარჯვენა პანელთან ახლოს; აუზები ცოტა ვიწროვდება, რომ ბარათს მინიმუმ ~300px დარჩეს (ფართო ეკრანზე არ იცვლება) */
@media (min-width: 900px) { .info-cards { grid-column: 1 / 3; grid-row: 2; } }
@media (min-width: 1200px) {
  .farm { width: min(calc((100dvh - var(--topbar, 58px) - 34px) / 1.23), calc(100vw - 700px)); }
  .info-cards {
    grid-column: 2; grid-row: 1; grid-template-columns: minmax(280px, 360px); justify-content: end;
    max-height: calc(100dvh - var(--topbar, 58px) - 28px); overflow-y: auto;     /* როგორც მარჯვენა პანელი — გვერდი არ სქროლავს */
  }
}
.icard {
  min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow);
}
.icard-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.icard-title { font-size: 12px; color: var(--muted); }
.icard-more { font-size: 12px; font-weight: 600; color: var(--brand); text-decoration: none; white-space: nowrap; }
.icard-main { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.icard-big { font-size: 22px; font-weight: 700; }
.icard-sub { font-size: 12px; color: var(--muted); }
.icard-pill { margin-left: auto; font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 999px; background: var(--surface-2); color: var(--brand); }
.icard-bar { display: flex; height: 6px; margin: 7px 0 8px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.icard-bar i { display: block; height: 100%; }
.icard-note { font-size: 12px; color: var(--muted); margin-top: 6px; }
/* გაიყიდა — აუზის მწვანე; დაგეგმილი — გეგმის ყვითელი (როგორც თარიღის „გეგმა“) */
.icard .f { background: var(--s-green); }
.icard .p { background: var(--plan-bg); box-shadow: inset 0 0 0 1px var(--s-yellow); }
.icard .bar-late { background: var(--s-red); }
.size-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 2px 0; font-size: 13px; }
.size-track { display: flex; height: 8px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.size-track i { display: block; height: 100%; }
.size-val { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
.size-val b { font-weight: 400; color: #8a6a10; }
.icard-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; vertical-align: -1px; margin-right: 3px; }
.weeks, .week-labels { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.weeks { align-items: end; height: 82px; margin-top: 10px; }
.week { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.week-v { font-size: 12px; font-weight: 600; text-align: center; margin-bottom: 3px; }
.week-v.none { color: var(--muted); font-weight: 400; }
.week-bar { border-radius: 4px 4px 0 0; overflow: hidden; display: flex; flex-direction: column-reverse; }
.week-bar.none { height: 4px; border-radius: 2px; background: var(--surface-2); }
.week-labels { font-size: 11px; color: var(--muted); text-align: center; border-top: 1px solid var(--line); padding-top: 3px; }
.due-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid var(--surface-2); font-size: 13px; }
.due-pill { font-size: 11px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.due-pill.late { background: #fdecea; color: #7a1020; }
.due-pill.soon { background: var(--plan-bg); color: #6b520c; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.dot.green { background: var(--s-green); } .dot.yellow { background: var(--s-yellow); }
.dot.red { background: var(--s-red); } .dot.critical { background: var(--s-critical); }

/* ---------------------------------------------------------------- აუზის ფანჯარა */
.pool-dialog {
  width: 100%; max-width: 100%; height: 100%; max-height: 100%;
  margin: 0; padding: 0; border: 0;
  background: var(--surface); color: var(--text);
  display: none; flex-direction: column;
}
.pool-dialog[open] { display: flex; }
.pool-dialog::backdrop { background: rgba(0, 0, 0, .45); }
@media (min-width: 900px) {
  .pool-dialog {
    width: min(1600px, 97vw); height: 94vh;
    margin: auto; border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  }
}
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.dlg-title { flex: 1; min-width: 0; }
.dlg-title h2 { margin: 0; font-size: 20px; }
.dlg-sub { font-size: 13px; color: var(--muted); }
.btn-back { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 12px; }

.tabs { display: flex; gap: 6px; padding: 10px 14px 0; }
.tab {
  flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 600;
}
.tab[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (min-width: 900px) { .tab { flex: none; padding: 9px 18px; } }

.periods { display: flex; gap: 6px; padding: 10px 14px; overflow-x: auto; align-items: center; flex-wrap: wrap; }
.chip {
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); white-space: nowrap; font-size: 14px;
}
.chip[aria-pressed="true"] { background: var(--surface-2); border-color: var(--brand-2); color: var(--brand); font-weight: 600; }
.custom-range { display: flex; gap: 6px; align-items: center; }
.custom-range[hidden] { display: none; }
.custom-range input { width: 118px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }

.dlg-body { flex: 1; overflow: auto; padding: 12px 14px 20px; }
.info { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.warn { font-size: 13px; padding: 8px 10px; border-radius: 10px; background: var(--plan-bg); border: 1px solid var(--plan-line); margin-bottom: 10px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; }
.card {
  text-align: left; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2);
}
.card[aria-pressed="true"] { border-color: var(--brand-2); box-shadow: inset 0 0 0 1px var(--brand-2); }
.card .c-label { font-size: 12px; color: var(--muted); }
.card .c-value { font-size: 17px; font-weight: 700; }
.card .c-sub { font-size: 12px; color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table.data { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.data th { position: sticky; top: 0; background: var(--surface-2); font-weight: 600; font-size: 12px; color: var(--muted); z-index: 1; }
table.data th:first-child, table.data td:first-child { position: sticky; left: 0; background: var(--surface); text-align: left; z-index: 2; }
table.data th:first-child { background: var(--surface-2); z-index: 3; }
table.data td.left, table.data th.left { text-align: left; white-space: normal; min-width: 180px; }
table.data tr.fast td { background: var(--plan-bg); }
table.data tr.fast td:first-child { background: var(--plan-bg); }
.ev { display: inline-block; margin: 1px 4px 1px 0; padding: 2px 7px; border-radius: 999px; font-size: 12px; background: var(--surface-2); }
.ev.sale { background: #fbf0cc; color: #6b5100; }
.ev.out { background: #ece4fb; color: #4d2c91; }
.ev.stocking, .ev.in { background: #def3e7; color: #1f5a40; }
.ev.treatment { background: #e0ecfa; color: #1d4f86; }
.ev.dead { background: #f3e2e2; color: #7a1020; }
.ev.adjustment, .ev.correction { background: #e6eaf0; color: #3a4a5c; }
.neg { color: var(--s-red); font-weight: 600; }
.empty-note { padding: 30px 10px; text-align: center; color: var(--muted); }

/* ---------------------------------------------------------------- ფორმები და პანელები */
.tabs { flex-wrap: wrap; }
.tab { flex: 1 1 40%; }
.tab.action { background: var(--surface-2); font-weight: 500; }
.tab.action[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab-sep { display: none; }
@media (min-width: 900px) {
  .tab { flex: none; }
  .tab-sep { display: block; width: 1px; background: var(--line); margin: 4px 6px; }
}
.periods[hidden] { display: none; }

.page { max-width: 1100px; margin: 0 auto; padding: 12px 16px 40px; }
.page[hidden] { display: none; }
.page-head h1 { font-size: 22px; margin: 6px 0; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin: 12px 0; box-shadow: var(--shadow);
}
.dlg-body .panel { box-shadow: none; }
.panel h3 { margin: 0 0 10px; font-size: 16px; }
.form .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
/* რეალიზაციის გეგმა: სია მარცხნივ (ფართოდ), ფორმები მარჯვნივ — ვერტიკალურად, ერთ სვეტად */
#page-sales { max-width: 1400px; }
.sales-cols { display: grid; gap: 14px; align-items: start; }
.sales-main, .sales-side { min-width: 0; }
@media (min-width: 1000px) { .sales-cols { grid-template-columns: minmax(0, 1fr) 360px; } }
@media (min-width: 1200px) {                       /* კომპიუტერზე ფორმები ეკრანის ზედა მარჯვენა კუთხეშია */
  #page-sales { max-width: none; }
  .sales-main { width: 100%; max-width: 1100px; justify-self: center; }
}
.sales-side .form .grid { grid-template-columns: minmax(0, 1fr); }
.form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.form label.wide { margin-top: 10px; }
.form input, .form select, table.lines input, table.lines select {
  font: inherit; font-size: 16px; color: var(--text);
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  min-width: 0; width: 100%;
}
.form input:disabled { background: var(--surface-2); color: var(--muted); }
table.lines td { vertical-align: middle; }
table.lines input, table.lines select { min-width: 110px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px;
  padding: 10px 16px; font-weight: 600; min-height: 44px;
}
.btn.small { padding: 6px 10px; min-height: 34px; font-weight: 500; font-size: 13px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--s-red); border-color: var(--s-red); color: #fff; }
.btn.danger:disabled { opacity: .45; cursor: not-allowed; }
.btn.danger-ghost { color: var(--s-red); border-color: color-mix(in srgb, var(--s-red) 40%, var(--line)); }
td.actions { white-space: nowrap; }
td.actions .btn + .btn { margin-left: 6px; }
#tr-planned td { white-space: normal; }
#tr-planned td.actions { width: 1%; min-width: 120px; }
#tr-planned td.actions .btn { display: block; width: 100%; margin: 0 0 6px; }
#tr-planned td .ev.short, #tr-planned td .ev.over { display: inline-block; margin-top: 4px; font-weight: 600; }
.calc { font-size: 14px; margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.form-error { margin-bottom: 10px; padding: 8px 10px; border-radius: 10px; background: #fdecea; color: #7a1020; font-size: 14px; }
.form-error[hidden] { display: none; }
.confirm {
  margin: 10px 0; padding: 12px; border-radius: 12px;
  border: 1px solid var(--s-red); background: color-mix(in srgb, var(--s-red) 8%, var(--surface));
}
.confirm p { margin: 0 0 8px; font-weight: 600; }
.confirm .reason { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.confirm .reason input { padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.confirm .check { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.confirm .check input { width: 20px; height: 20px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
td.changed { color: #b26b00; font-weight: 700; }
.cap-mark { color: #b26b00; font-weight: 700; white-space: nowrap; }
.badge { cursor: pointer; }

/* ---------------------------------------------------------------- დღის აღრიცხვა */
.role { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); flex: none; }
.role select { font: inherit; font-size: 13px; padding: 5px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
@media (max-width: 600px) { .role span { display: none; } .topbar { gap: 8px; padding: 8px 10px; } }
.date-row.narrow { max-width: 360px; margin: 8px 0; }
.status { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; margin: 4px 0; }
.status.plan { background: var(--plan-bg); border: 1px solid var(--plan-line); }
.status.warn { background: #fdecea; color: #7a1020; }
.status.ok { background: #def3e7; color: #1f5a40; }

.pool-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 12px 0; }
.pool-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; display: grid; gap: 8px; box-shadow: var(--shadow);
}
.pool-card header { display: flex; justify-content: space-between; align-items: baseline; font-size: 17px; }
.pool-card .muted { font-size: 12px; color: var(--muted); }
.pool-card .norm { font-size: 14px; }
.pool-card.fasting { border-color: var(--plan-line); background: var(--plan-bg); }
.pool-card.alarm { border-color: var(--s-red); box-shadow: 0 0 0 2px color-mix(in srgb, var(--s-red) 35%, transparent); }
.fast-note { font-size: 13px; font-weight: 600; color: #8a6200; }
.pool-card .inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.pool-card label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.pool-card input {
  font: inherit; font-size: 18px; text-align: center; padding: 10px 4px; min-width: 0; width: 100%;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text);
}
.pool-card input:disabled { background: var(--surface-2); }
.diff { font-size: 13px; color: var(--muted); }
.pos { color: #8a6200; } b.neg { color: var(--s-red); }
textarea { font: inherit; font-size: 16px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); width: 100%; }
.actions-bar {
  position: sticky; bottom: 0; z-index: 4; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%);
}
.btn.big { min-height: 52px; font-size: 16px; padding: 12px 22px; flex: 1 1 200px; }
.op-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
/* ცხრილში გახსნილი დადასტურების ფორმა ცხრილს არ აფართოებს — ტექსტი ახალ ხაზზე გადადის */
table.data tr.confirm-row td { white-space: normal; text-align: left; position: static; }
select.pending-role { outline: 2px solid var(--plan-line); background: var(--plan-bg); }
/* მომხმარებლები და უფლებები */
table.users tr.edit-row td { background: var(--plan-bg); }
table.users tr.edit-row input, table.users tr.edit-row select { width: 100%; min-width: 120px; }
table.users tr.edit-tools td { background: var(--plan-bg); padding-top: 0; }
table.perms-table tr.grp td { background: var(--surface-2); font-weight: 700; color: var(--muted); font-size: .85em; }
.pm { display: inline-block; min-width: 2.4em; padding: 2px 8px; border-radius: 6px; border: 1px solid transparent; font-weight: 700; line-height: 1.4; }
button.pm { cursor: pointer; }
.pm-y { background: #e3f2e6; color: #1e6b35; }
.pm-w { background: #fff3d6; color: #8a5a00; }
.pm-n { background: var(--surface-2); color: var(--muted); }
.pm.changed { outline: 2px solid var(--plan-line); outline-offset: 1px; }
.perms-bar { justify-content: flex-end; gap: 10px; align-items: center; }
.confirm-form { padding: 10px; margin: 6px 0 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.confirm-form .check { display: flex; gap: 8px; align-items: center; margin: 10px 0; font-size: 14px; color: var(--text); }
.confirm-form .check input { width: 20px; height: 20px; }
.remaining[hidden] { display: none; }

/* ---------------------------------------------------------------- ოპერაციების ჟურნალი */
.journal-filters select { font: inherit; font-size: 14px; padding: 7px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.journal { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.j-row { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.j-row.cancelled { opacity: .6; }
.j-row.cancelled .j-sum { text-decoration: line-through; }
.j-head {
  width: 100%; border: 0; background: none; text-align: left; padding: 10px 12px;
  display: grid; grid-template-columns: 92px auto 1fr auto; gap: 10px; align-items: center;
}
.j-head:hover { background: var(--surface-2); }
.j-date { font-variant-numeric: tabular-nums; font-weight: 600; }
.j-kind { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.k-sale { background: #fbf0cc; color: #6b5100; }
.k-transfer, .k-grading { background: #ece4fb; color: #4d2c91; }
.k-stocking { background: #def3e7; color: #1f5a40; }
.k-daily { background: #e3eef8; color: #1d4b73; }
.k-correction, .k-adjustment { background: #e6eaf0; color: #3a4a5c; }
.j-sum { font-size: 14px; min-width: 0; }
.j-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
@media (max-width: 640px) {
  .j-head { grid-template-columns: auto 1fr; }
  .j-sum { grid-column: 1 / -1; }
  .j-meta { grid-column: 1 / -1; }
}
.j-detail { padding: 4px 12px 14px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.j-detail[hidden] { display: none; }
.j-who { font-size: 13px; color: var(--muted); margin-top: 8px; }
.j-history ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }

/* ---------------------------------------------------------------- საკვები */
.muted { color: var(--muted); font-size: 12px; }
form.policy { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
form.policy select, form.policy input, .order input, tr[data-route] input, #mv-product {
  font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text);
}
form.policy input { width: 64px; }
tr[data-route] input { width: 80px; }
.order { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.order.late { border-color: var(--s-red); }
.order-head { font-size: 14px; margin-bottom: 8px; }
.order .recv-date { width: 210px; }
details > summary.btn { display: inline-block; list-style: none; margin-top: 10px; cursor: pointer; }
details > summary.btn::-webkit-details-marker { display: none; }
details[open] > summary.btn { margin-bottom: 10px; }
tr.cancelled-row td { opacity: .5; text-decoration: line-through; }

/* ---------------------------------------------------------------- პარამეტრები */
label.inline { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
label.inline select, label.inline input, #t-form input {
  font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text);
}
label.inline input { width: 120px; }
#t-form input { width: 80px; }
table.norms td.ours, table.norms th.ours { background: color-mix(in srgb, var(--brand-2) 10%, var(--surface)); }
table.norms input { width: 84px; font: inherit; font-size: 15px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); text-align: right; }
table.norms input:disabled { background: transparent; border-color: transparent; }
.save-norms { margin-top: 10px; align-items: end; }
.save-norms label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.save-norms input { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
.versions { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }

/* ---------------------------------------------------------------- მკურნალობა */
.badge.treatment { background: #c62828; }
.treat-note { font-size: 13px; padding: 6px 8px; border-radius: 8px; background: #e3eef8; color: #1d4b73; }
.pool-checks { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.pool-checks .chip { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.pool-checks input { width: 18px; height: 18px; }

.sub { margin: 16px 0 8px; font-size: 15px; }
.filters .chip input { width: 16px; height: 16px; vertical-align: -2px; }
.filters label.chip { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }

/* ---------------------------------------------------------------- რეპორტები */
.page-tabs { padding: 0; margin-bottom: 10px; }
#v-form .grow { flex: 1 1 260px; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
#r-pool, .custom-range input { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); }
td.pos { color: #2f7d55; } td.neg { color: var(--s-red); }

/* დღის აღრიცხვა — საწყობის ბარათები */
.wh-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.wh-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 8px; }
.wh-grid { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); gap: 6px; align-items: center; }
.wh-grid .h { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.2; }
.wh-grid .t { font-size: 13px; font-weight: 600; padding-right: 2px; }
.wh-card output.need small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.wh-card output.need { font-size: 18px; font-weight: 700; text-align: center; padding: 9px 4px; border-radius: 10px;
  background: var(--plan-bg); border: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.wh-card input { font: inherit; font-size: 18px; text-align: center; padding: 9px 4px; width: 100%; min-width: 0;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
ul.plain { margin: 0; padding-left: 18px; }

#s-pool { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); }

/* მობილურზე მიმღები აუზების ხაზები — ბარათებად, ჰორიზონტალური სქროლის გარეშე */
@media (max-width: 640px) {
  table.lines.stack thead { display: none; }
  table.lines.stack, table.lines.stack tbody { display: block; }
  table.lines.stack tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 10px; border-bottom: 1px solid var(--line); }
  table.lines.stack td { display: block; position: static; padding: 0; border: 0; text-align: left; background: none; }
  table.lines.stack td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
  table.lines.stack td.l-kg { align-self: end; padding-bottom: 8px; font-weight: 600; }
  table.lines.stack td.l-act { grid-column: 1 / -1; text-align: right; }
  table.lines.stack input, table.lines.stack select { min-width: 0; width: 100%; }
}
.feed-label { display: inline-block; margin-top: 2px; font-weight: 600; color: var(--text); }
.wh-card .dual { display: grid; gap: 4px; }
.wh-card .dual label, .wh-card .kg-only { position: relative; display: block; }
.wh-card .kg-only { align-self: center; }
.wh-card .dual small, .wh-card .kg-only small { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 10px; color: var(--muted); pointer-events: none; }
.wh-card .dual input, .wh-card .kg-only input { padding-right: 26px; }
.wh-card .dual input.bag { font-weight: 700; }
table.data td.feed-col { white-space: nowrap; min-width: 0; }

/* აუზის ისტორია: ცხრილი თავის ფანჯარაში სქროლავს — სათაურები ზემოთ რჩება, თარიღი მარცხნივ */
.hist-wrap { max-height: 70vh; overflow: auto; }
.hist-wrap table.data th { top: 0; white-space: normal; vertical-align: bottom; }
/* ყველა სვეტი ეტევა: ვიწრო შუალედები, საკვების დასახელება ორ ხაზზე, ოპერაციები — სრულად (ტექსტი გადადის ახალ ხაზზე) */
.hist-wrap table.data th, .hist-wrap table.data td { padding: 7px 8px; }
.hist-wrap table.data td.feed-col { white-space: normal; min-width: 110px; }
table.data td.ops { min-width: 230px; }
table.data td.ops .ev { white-space: normal; }
/* გეგმის ახსნა: % და რომელი დღიდან, მეშოკები — პატარა ხაზით ქვემოთ; % შეცვლის დღე — გამოყოფილი */
.hist-wrap td .sub { display: block; font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 1px; }
.hist-wrap td.pct-cell { color: var(--text, inherit); }
.hist-wrap td.pct-cell.chg { font-weight: 700; color: #6b5100; background: #fbf0cc; }
.cards.mini { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; margin-bottom: 8px; }
.cards.mini .card { padding: 6px 9px; border-radius: 10px; }
.cards.mini .c-label { font-size: 11px; }
.cards.mini .c-value { font-size: 14px; }
.cards.mini .c-sub { font-size: 11px; }
@media (min-width: 900px) { .side { grid-column: 3; } .farm { grid-column: 1; } }
.grid-2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.card .card-btn { display: block; width: 100%; margin-top: 8px; text-align: center; text-decoration: none; }

/* შესვლა */
.login-page { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-card {
  width: min(380px, 100%); display: grid; gap: 14px; padding: 28px 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
}
.login-brand { font-family: "Playfair Display", Georgia, serif; color: var(--brand); text-align: center; margin-bottom: 6px; }
.login-brand .brand-main { font-size: 30px; } .login-brand .brand-sub { font-size: 22px; }
.login-card label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.login-card input { font: inherit; font-size: 17px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
.user-box { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.user-name { font-size: 14px; font-weight: 600; color: var(--brand); white-space: nowrap; }
@media (max-width: 640px) { .user-name { display: none; } }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 48px !important; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 38px;
  border: 0; background: none; font-size: 18px; border-radius: 8px; }
.pw-eye:hover { background: var(--surface-2); }

/* პარამეტრები: ბარათები ხატულებით */
.param-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.param-tile {
  display: grid; grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 12px; row-gap: 3px;
  padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
  color: var(--text); text-decoration: none; transition: transform .12s ease, border-color .12s ease;
}
.param-tile:hover { transform: translateY(-2px); border-color: var(--brand-2); }
.pt-icon { grid-row: 1 / 4; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  font-size: 26px; background: var(--surface-2); }
.pt-title { font-weight: 700; font-size: 16px; color: var(--brand); }
.pt-desc { font-size: 13px; color: var(--muted); }
.pt-value { font-size: 13px; font-weight: 600; color: var(--brand-2); min-height: 1em; }
.sec-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sec-head h1 { margin: 0; }
.sec-icon { font-size: .9em; }
.sec-head a.btn { text-decoration: none; color: var(--text); }
table.data tr.plus-row td { background: var(--surface-2); }
a.btn { text-decoration: none; color: inherit; display: inline-block; }
#d-list select { max-width: 190px; }

/* ყველა გრძელ ცხრილში ქუდი (სვეტების სათაურები) და პირველი სვეტი სქროლისას ჩანს.
   ცხრილი საკუთარ ფანჯარაში სქროლავს (ფორმის ცხრილები — გამონაკლისი) */
.table-wrap:not(:has(> table.lines)) { max-height: 72vh; overflow: auto; }

/* საკვები: ყოველდღიური ნაშთი (მარცხნივ) + შეტყობინებები და შეკვეთები (მარჯვნივ) */
.feed-layout { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .feed-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }
.feed-side { display: grid; gap: 12px; min-width: 0; }
.feed-side > * { min-width: 0; }                       /* მარჯვენა სვეტი 320 პქს-ს არ სცდება (გვერდის ჰორიზ. გადახვევა) */
.feed-side table.lines { width: 100%; table-layout: fixed; }
.feed-side table.lines select, .feed-side table.lines input { width: 100%; min-width: 0; }
@media (max-width: 1099px) { .feed-side { order: -1; } }
.feed-wrap { max-height: calc(100dvh - 230px) !important; }
.feed-sched th.grp { text-align: center; border-left: 2px solid var(--line); white-space: normal; min-width: 150px; color: var(--text); }
.feed-sched th.grp.dim { color: var(--muted); }
.feed-sched .g1 { border-left: 2px solid var(--line); }
.feed-sched thead tr.sub th:first-child { left: auto; z-index: 1; }
.feed-sched td.in { color: #2f7d55; font-weight: 600; }
.feed-sched td.low { background: #fff3cd; color: #7a5a00; font-weight: 600; }
.feed-sched td.out { background: #fdecea; color: #a11d2b; font-weight: 700; }
.alert-box { border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; font-size: 13px; line-height: 1.45; background: var(--surface-2); }
.alert-box.late { background: #fdecea; color: #7a1020; }
.alert-box.soon { background: #fff3cd; color: #6b4e00; }
.order-mini { border-top: 1px solid var(--line); padding: 8px 0; font-size: 13px; }
.order-mini summary { cursor: pointer; list-style: none; line-height: 1.45; }
.order-mini .order { margin-top: 8px; }
.feed-side .new-order { margin-top: 10px; }
.feed-side .new-order summary { display: block; text-align: center; }

/* საკვების მომწოდებლები */
.sup-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); margin-bottom: 12px; }
.sup-card { display: grid; gap: 4px; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow); }
.sup-card.on { border: 2px solid var(--brand-2); }
.sup-card .muted { font-size: 12px; }
.sup-badge { display: inline-block; font-size: 11px; padding: 1px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.sup-badge.st-active { background: #def3e7; color: #1f5a40; }
.sup-badge.st-review { background: #fff3cd; color: #6b4e00; }
#page-feed { max-width: 1700px; }
.sup-card .sup-badge { justify-self: start; }
.to-receive { background: #fff3cd; color: #6b4e00; border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; font-weight: 600; font-size: 13px; }
.count-badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: #c0392b; color: #fff; font-size: 12px; text-align: center; }
a.tab { text-decoration: none; color: inherit; }
.pc-norm { flex-wrap: wrap; gap: 8px; align-items: center; }
.pc-norm .chip { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }

/* დაუხურავი დღეები */
.od { border-radius: var(--radius); padding: 10px 12px; font-size: 13px; }
.od.ok { background: #def3e7; color: #1f5a40; }
.od.late { background: #fdecea; color: #7a1020; border: 1px solid #f0b4b4; }
.od h4 { margin: 0 0 6px; font-size: 14px; }
.od-row { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-top: 1px solid #f0c9c9; color: inherit; text-decoration: none; }
.od-row:first-of-type { border-top: 0; }
.od-row:hover { text-decoration: underline; }
.od-today { color: var(--muted); }
.od-st { font-size: 12px; text-align: right; }
.od-btn { display: block; margin-top: 8px; text-align: center; background: #a11d2b; color: #fff; border-radius: 10px; padding: 8px; text-decoration: none; font-weight: 600; }
.page-head .od { margin: 8px 0; }
.open-days:empty { display: none; }
.od a.od-btn { color: #fff; }
.confirm.action { border-color: var(--brand-2); background: #eef7f1; }
.confirm.action .check { font-weight: 600; }

/* საკვები: მარაგი დღეს (ქუდი), გადათვლა, ინვოისი */
.stock-head .cards { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 6px; }
.stock-head .card.low { background: #fff3cd; border-color: #f0d58a; }
.stock-head .card.out { background: #fdecea; border-color: #f2b8b5; }
span.in { color: #1f7a4d; font-weight: 600; }
#count-panel .filters { align-items: center; }
.count-box { margin-bottom: 10px; }
.count-box > summary { display: inline-block; list-style: none; cursor: pointer; }
.count-box > summary::-webkit-details-marker { display: none; }
.count-box > summary.overdue { background: #fdecea; color: #7a1020; border-color: #f2b8b5; }
.count-box[open] > summary { margin-bottom: 8px; }
#count-period { display: flex; gap: 8px; align-items: center; margin: 4px 0 8px; }
.inv-form { margin-top: 6px; min-width: 260px; }

/* დირექტორს — რა ელოდება დასტურს */
.pending { border: 1px solid #f0d58a; background: #fff8e1; border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.pending-title { font-weight: 700; margin-bottom: 6px; }
.pending-item { display: block; padding: 6px 0; border-top: 1px solid #f3e3b0; font-size: 13px; color: inherit; text-decoration: none; }
.pending-item:hover { text-decoration: underline; }

/* საკვები არ დაემთხვა (საწყობი ↔ აუზები) — წითლად */
.wh-card.mismatch { border-color: #c62828; background: #fdecea; }
.mismatch-box { border: 1px solid #f2b8b5; background: #fdecea; color: #7a1020; border-radius: 10px; padding: 8px 10px; margin: 8px 0; font-size: 13px; }
.mismatch-box ul { margin: 4px 0; }
.wh-add { margin-top: 8px; }
.pending-item.mm { color: #7a1020; }

/* ჟურნალი: საკვები არ დაემთხვა / შენიშვნა — სანამ არ გასწორდება */
.j-row.attention > .j-head { background: #fff1e6; border-left: 4px solid #d35400; }
.j-flag { color: #a04000; font-size: 12px; white-space: nowrap; }

/* დღის აღრიცხვა: შეუვსებელი უჯრა — ჩაწერეთ 0 */
input.need-zero { border-color: #c62828 !important; background: #fdecea !important; box-shadow: 0 0 0 2px rgba(198, 40, 40, .2); }
input.need-zero::placeholder { color: #c62828; }

/* დღის აღრიცხვა: „✕ არ ეძლევა“ (მკურნალობა / შიმშილობა) და ერთჯერადი კვება */
.x-cell { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.x-box {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 10px;
  border: 1px dashed #9aa5a0; color: #5b6762; font-weight: 700; font-size: 20px; line-height: 1.1;
  background: repeating-linear-gradient(135deg, #eef1ef 0 8px, #e2e7e4 8px 16px); cursor: not-allowed; user-select: none;
}
.x-box span { font-size: 12px; font-weight: 600; text-align: left; }
.x-box small { font-weight: 500; }
label.treat-feed { color: #c62828; font-weight: 700; }
label.treat-feed input { border-color: #c62828; box-shadow: 0 0 0 2px rgba(198, 40, 40, .15); }

/* მომხმარებლის ღილაკი და მენიუ (პაროლის შეცვლა, გასვლა) */
.user-box { position: relative; }
.user-btn { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--brand); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.user-btn:hover { background: var(--surface-2); }
.user-btn .caret { font-size: 11px; opacity: .7; }
.user-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 240px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.um-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 14px; }
.um-item { display: block; width: 100%; text-align: left; padding: 10px; border: 0; border-radius: 8px; background: none;
  font-size: 14px; cursor: pointer; color: inherit; }
.um-item:hover { background: var(--surface-2); }
.pw-dialog { border: 0; border-radius: 14px; padding: 18px; width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.pw-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.pw-dialog label { display: block; margin-bottom: 10px; }

/* რეალიზაციის სიმულაცია */
.sim-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.sim-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #ede7f6; color: #4527a0; font-size: 12px; font-weight: 600; }
.sim-lock { padding: 8px 10px; border-radius: 10px; background: #e8f5e9; color: #1b5e20; font-size: 13px; }
.card.warn { background: #fff3cd; } .card.bad { background: #fdecea; }
.sim-months td.sum { font-weight: 700; } .sim-months td.sum.ok { background: #c8e6c9; } .sim-months td.sum.low { background: #fff3cd; }
.sim-months td.sum.over { background: #f8c9c4; color: #7a1020; }      /* თვეში 50 ტ-ზე მეტი — პრობლემა */
tr.locked td { background: #f4f7f5; }
.ctr { display: inline-block; padding: 1px 6px; border-radius: 6px; font-size: 12px; margin: 1px; }
.ctr.ok { background: #e8f5e9; color: #1b5e20; } .ctr.miss { background: #fdecea; color: #7a1020; }
.sim-map td { text-align: center; font-size: 12px; white-space: nowrap; } .sim-map td small { display: block; font-size: 10px; opacity: .75; }
.sim-map td.s-yellow { background: #fff3cd; } .sim-map td.s-red { background: #f8c9c4; } .sim-map td.s-critical { background: #c62828; color: #fff; } .sim-map td.s-green { background: #e8f5e9; }
.sim-problems { border-color: #f2b8b5; }
.sim-filter { align-items: center; }
.sim-filter .date-field { width: 175px; }
/* „აუზები სცენარით“: მთავარი გვერდის აუზები მარცხნივ, თარიღი / ჯამები / კვირის მოვლენები მარჯვნივ */
.sim-pools { display: grid; gap: 16px; align-items: start; }
.sim-farm, .sim-side { min-width: 0; }
.sim-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.sim-side .date-input { min-width: 0; flex: 1; }
.sim-side .date-foot { flex-wrap: wrap; gap: 6px; }
.sim-side .date-foot .chip { padding: 4px 10px; font-size: 12px; }
.sim-side .panel { margin: 0; }
.sim-side .sim-week { order: 3; }                  /* ჯამების შემდეგ, ლეგენდამდე */
.sim-week ul { margin: 0; display: grid; gap: 6px; font-size: 13px; }
.alert.sim-watch { background: #fff3e0; color: #7a4100; }
@media (min-width: 900px) { .sim-pools { grid-template-columns: minmax(0, 620px) minmax(260px, 1fr); } }
.ev { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--surface-2); }
.ev-stocking { background: #e3f2fd; color: #0d47a1; } .ev-sale { background: #e8f5e9; color: #1b5e20; } .ev-freeze { background: #e0f7fa; color: #006064; }
.ev-transfer, .ev-grading { background: #ede7f6; color: #4527a0; } .ev-contract { background: #fff3e0; color: #e65100; }
tr.best td { background: #fffde7; }
.sim-req { padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
/* სცენარის შეცვლა გვერდიდან: დაცვა, წესები, ხელსაწყოები */
.sim-prot { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #fff3e0; color: #7a4100; font-size: 12px; font-weight: 600; }
.sim-rules h3 { margin-bottom: 6px; }
.sim-rule-list { margin: 0; padding-left: 20px; display: grid; gap: 3px; font-size: 13px; }
.sim-note { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.sim-tools { border-color: #b39ddb; }
.sim-flash { margin: 0 0 10px; padding: 8px 10px; border-radius: 10px; background: #e8f5e9; color: #1b5e20; font-size: 13px; }
.sim-tool-tabs { align-items: center; }
.sim-undo { margin-left: auto; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; min-width: 0; }
.sim-check span { display: flex; gap: 8px; align-items: center; color: var(--text); min-height: 40px; }
.sim-check input { width: 20px; height: 20px; }
.sim-lines { display: grid; gap: 6px; margin-top: 10px; font-size: 13px; justify-items: start; }
.sim-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sim-line select, .sim-line input { min-height: 38px; width: 130px; }
.form .sim-line-all { display: inline-flex; gap: 4px; align-items: center; color: var(--text); font-size: 13px; }
.sim-line .sim-line-all input { width: 18px; min-height: 0; height: 18px; }
.sim-pick { display: flex; flex-wrap: wrap; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 8px 0 10px; }
.sim-pick legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.form .sim-pool-pick { display: inline-flex; gap: 4px; align-items: center; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-size: 13px; }
.sim-pool-pick input { width: 16px; height: 16px; }
.sim-preview { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.sim-preview h4 { margin: 0 0 8px; }
tr.editing td { background: #ede7f6; }
td.nowrap { white-space: nowrap; }

/* გადაყვანა/დახარისხება: ზედმეტობა; შეტყობინება დირექტორს */
.surplus-box { border: 1px solid #90caf9; background: #e3f2fd; color: #0d47a1; border-radius: 10px; padding: 8px 10px; margin: 8px 0; font-size: 13px; }
.pending-item.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pending-item.notice a { color: inherit; flex: 1 1 200px; }
.pending-item.notice.short a { color: #7a1020; font-weight: 600; } .pending-item.notice.over a { color: #0d47a1; font-weight: 600; }

.src-rest { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-2); margin: 6px 0; }
b.blue, .blue { color: #0d47a1; }
.ev.short { background: #fdecea; color: #7a1020; } .ev.over { background: #e3f2fd; color: #0d47a1; }
.pm.locked { opacity: .55; cursor: not-allowed; }

/* რეალიზაცია თვეებით: თვის სათაური, ჯამი, პერიოდის ჯამი */
.sales-months tr.sm-month td { background: var(--surface-2); font-weight: 700; text-align: left; }
.sales-months tr.sm-sum td { font-weight: 700; border-top: 2px solid var(--line); }
.sales-months tr.sm-sum td:first-child, .sales-months tr.sm-total td:first-child { text-align: left; }
.sales-months tr.sm-total td { font-weight: 800; background: #e8f5e9; }
.sales-months tr.sm-plan td { color: var(--muted); }
.sales-months td small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.sales-months td.sm-kg { font-weight: 700; }
.sales-months th.sz, .sales-months td.sz { text-align: center; }    /* ზომის სვეტები: სათაური და წონა — ცენტრში */

