/* ============================================================
   app.finkit.ge — თემები (hr-crm-spec §1, docs/design-hr.html)
   თემა = ტოკენების ნაკრები: <html data-theme="obsidian|hybrid">; აქცენტი კომპანიაზე — :root{--accent}
   ============================================================ */

:root,
[data-theme="obsidian"] {
  --bg: #0A0C10;
  --card: #111419;
  --card-2: #151920;
  --line: #1E232C;
  --line-2: #222833;
  --ink: #ECEEF2;
  --muted: #8E97A8;
  --muted-2: #AEB6C5;
  --accent: #4FD1A5;
  --on-accent: #0A0C10;
  --ok: #4FD1A5;
  --warn: #F2A93B;
  --info: #6AA8FF;
  --err: #F2766B;
  --input: #111419;

  --side-bg: #0D1015;
  --side-line: #1E232C;
  --side-ink: #ECEEF2;
  --side-muted: #9AA3B4;
  --side-on: #1A1F28;
  --side-card: #12161C;
  --avatar: #232A36;
  --avatar-ink: #ECEEF2;

  --r-card: 16px;
  --r-ctl: 12px;
  --r-nav: 10px;
  --font: "Noto Sans Georgian", system-ui, sans-serif;
  --font-head: "Noto Sans Georgian", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --h1: 28px;
  --h1-w: 600;
  --num-w: 500;
  color-scheme: dark;
}

[data-theme="hybrid"] {
  --bg: #F3F1EC;
  --card: #FBFAF7;
  --card-2: #ECE8E0;
  --line: #D9D5CC;
  --line-2: #E4E0D7;
  --ink: #16181D;
  --muted: #5B6068;
  --muted-2: #3F444B;
  --accent: #E8743A;
  --on-accent: #0B0F13;
  --ok: #2E7A57;
  --warn: #9E4A1C;
  --info: #2F5E9E;
  --err: #B3261E;
  --input: #FBFAF7;

  --side-bg: #0B0F13;
  --side-line: #232D38;
  --side-ink: #EDEAE3;
  --side-muted: #9AA3AC;
  --side-on: #1A222C;
  --side-card: #121820;
  --avatar: #EBD3B8;
  --avatar-ink: #0B0F13;

  --r-card: 20px;
  --r-ctl: 999px;
  --r-nav: 999px;
  --font: "Instrument Sans", "Noto Sans Georgian", system-ui, sans-serif;
  --font-head: "Unbounded", "Noto Sans Georgian", system-ui, sans-serif;
  --h1: 34px;
  --h1-w: 800;
  --num-w: 800;
  color-scheme: light;
}

/* ---------- საფუძველი ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 16px; font-weight: 600; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { flex: none; }
.note { color: var(--muted); font-size: 13px; margin: 0; }

/* ---------- ჩარჩო ---------- */
.app { display: grid; grid-template-columns: 233px minmax(0, 1fr); min-height: 100vh; }

.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 28px;
  padding: 24px 16px; background: var(--side-bg); color: var(--side-ink);
  border-right: 1px solid var(--side-line);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.logo {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
  font: 600 14px var(--mono);
}
[data-theme="hybrid"] .logo { font: 800 13px "Unbounded", var(--mono); }
.brand-t { display: flex; flex-direction: column; min-width: 0; }
.brand-t b { font-size: 15px; font-weight: 600; }
.brand-t small { font-size: 12px; color: var(--side-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px;
  border-radius: var(--r-nav); color: var(--side-muted); text-decoration: none;
}
[data-theme="hybrid"] .nav a { padding: 0 16px; }
.nav a:hover { color: var(--side-ink); background: color-mix(in srgb, var(--side-on) 60%, transparent); }
.nav a.on { background: var(--side-on); color: var(--side-ink); }
.nav a.on .ic { color: var(--accent); }
.nav-more { display: none; }
.nav-group {
  margin: 14px 12px 4px; font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--side-muted);
}

.me {
  display: flex; align-items: center; gap: 8px; padding: 10px 6px 10px 10px;
  background: var(--side-card); border: 1px solid var(--side-line); border-radius: calc(var(--r-card) - 4px);
}
[data-theme="hybrid"] .me { border-radius: 20px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--avatar); color: var(--avatar-ink); font-size: 13px; font-weight: 600;
}
.me-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.me-t b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-t small { font-size: 11.5px; color: var(--side-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .avatar { width: 34px; height: 34px; }
.icon-btn {
  width: 32px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px;
  background: transparent; color: var(--side-muted); cursor: pointer;
}
.icon-btn:hover { color: var(--side-ink); background: var(--side-on); }

.main { padding: 28px 32px 48px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }

/* ---------- ზედა ზოლი ---------- */
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ttl { display: flex; flex-direction: column-reverse; gap: 4px; min-width: 0; }
.ttl h1 { font: var(--h1-w) var(--h1)/1.15 var(--font-head); overflow-wrap: anywhere; }
.kicker { font-size: 14px; color: var(--muted); }
[data-theme="hybrid"] .ttl { flex-direction: column; }
[data-theme="hybrid"] .kicker { font: 12px var(--mono); }
.tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-actions { display: flex; align-items: center; gap: 10px; }

.ctl {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-ctl);
  color: var(--ink); text-decoration: none; cursor: pointer; white-space: nowrap;
}
[data-theme="hybrid"] .ctl { padding: 0 16px; }
.ctl:hover { border-color: var(--muted); }
.ctl.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.ctl.icon-only { width: 44px; padding: 0; justify-content: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  background: var(--accent); color: var(--on-accent); border: 0; border-radius: var(--r-ctl);
  font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.06); }
.linklike { background: none; border: 0; padding: 0; min-height: 44px; color: var(--accent); font-weight: 600; cursor: pointer; }

/* კომპანიის გადამრთველი */
.switch { position: relative; }
.switch summary { list-style: none; }
.switch summary::-webkit-details-marker { display: none; }
.switch[open] summary { border-color: var(--accent); }
.switch-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--accent); }
.dot-obsidian { background: #4FD1A5; }
.dot-hybrid { background: #E8743A; }
.switch-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 280px; max-height: 60vh; overflow-y: auto;
  display: flex; flex-direction: column; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
}
.switch-menu button {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; text-align: left;
  background: none; border: 0; border-radius: 10px; cursor: pointer;
}
.switch-menu button:hover, .switch-menu button.on { background: var(--card-2); }
.switch-menu button span:last-child { display: flex; flex-direction: column; }
.switch-menu small { font-size: 12px; color: var(--muted); }

/* ---------- ბარათები ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; max-width: 640px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 20px; }
.stat .lbl { font-size: 13px; color: var(--muted); }
.stat .num { font: var(--num-w) 34px/1.2 var(--mono); }
[data-theme="hybrid"] .stat .num { font-family: "Unbounded", var(--mono); }
.stat .num small { font-size: 16px; color: var(--muted); margin-left: 2px; }
[data-theme="hybrid"] .stat-accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
[data-theme="hybrid"] .stat-accent .lbl { color: var(--on-accent); }

.pill {
  display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px;
  background: var(--card-2); color: var(--muted-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pill-err { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); }
.pill-ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.pill-info { background: color-mix(in srgb, var(--info) 12%, transparent); color: var(--info); }
.pill-warn { background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); }
[data-theme="hybrid"] .stat-accent .pill { background: rgba(11, 15, 19, .12); color: var(--on-accent); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }

.mods { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mods li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.mods li:first-child { border-top: 0; }
.mod-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--card-2); color: var(--muted); flex: none; }
.mods li.on .mod-ic { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.mod-t { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.mod-t small { font-size: 12px; color: var(--muted); }

.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.checklist li.done { color: var(--ink); }
.tick { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--muted) 60%, transparent); display: grid; place-items: center; flex: none; }
.checklist li.done .tick { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- ფორმები და შეტყობინებები ---------- */
.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); }
.input {
  min-height: 46px; padding: 0 14px; font-size: 16px;  /* 16px — iOS შეყვანისას არ ადიდებს */
  background: var(--input); border: 1px solid var(--line); border-radius: 12px; color: var(--ink);
}
.input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 1px; border-color: var(--accent); }
.code-input { font: 600 24px var(--mono); letter-spacing: .3em; text-align: center; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.check small { display: block; }

.alert { padding: 12px 16px; border-radius: 12px; border: 1px solid; }
.alert-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.alert-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.alert-err { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); background: color-mix(in srgb, var(--err) 10%, transparent); }

/* ---------- ფორმის ბადე, ჩანართები ---------- */
.mono { font-family: var(--mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
select.input { padding-right: 34px; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.input[readonly] { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.stack > .form-actions { margin-top: 0; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-ctl);
  overflow-x: auto; scrollbar-width: none; align-self: flex-start; max-width: 100%; }
.tabs a { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: var(--r-ctl);
  color: var(--muted); text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }

.ctl.danger { color: var(--err); }
.ctl.danger:hover { border-color: var(--err); }

/* თემის არჩევა: მინიატურა */
.theme-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.theme-card { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1.5px solid var(--line); border-radius: var(--r-card); cursor: pointer; }
.theme-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.theme-card input { position: absolute; opacity: 0; }
.theme-t { display: flex; flex-direction: column; }
.theme-t small { color: var(--muted); font-size: 12px; }
.tp { display: flex; height: 120px; border-radius: 10px; overflow: hidden; border: 1px solid rgba(127, 127, 127, .25); }
.tp-side { width: 26%; display: flex; flex-direction: column; gap: 6px; padding: 10px 8px; }
.tp-side i { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .12); }
.tp-side i:first-child { background: var(--accent); width: 60%; }
.tp-main { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.tp-h { height: 12px; width: 50%; border-radius: 4px; }
.tp-row { flex: 1; display: flex; gap: 8px; }
.tp-c { flex: 1; border-radius: 8px; }
.tp-obsidian .tp-side { background: #0D1015; }
.tp-obsidian .tp-main { background: #0A0C10; }
.tp-obsidian .tp-h { background: #ECEEF2; opacity: .8; }
.tp-obsidian .tp-c { background: #111419; border: 1px solid #1E232C; }
.tp-hybrid .tp-side { background: #0B0F13; }
.tp-hybrid .tp-main { background: #F3F1EC; }
.tp-hybrid .tp-h { background: #16181D; }
.tp-hybrid .tp-c { background: #FBFAF7; border: 1px solid #D9D5CC; }
.tp .tp-acc { background: var(--accent); border-color: var(--accent); }
.tp-obsidian .tp-acc { background: color-mix(in srgb, var(--accent) 25%, #111419); }

/* აქცენტის ფერები */
.swatches { display: flex; flex-wrap: wrap; gap: 14px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; font-size: 12px; color: var(--muted); }
.swatch > input[type="radio"] { position: absolute; opacity: 0; }
.sw { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); display: block; }
.sw-default { background: conic-gradient(#4FD1A5 0 50%, #E8743A 50% 100%); }
.sw-color { padding: 0; cursor: pointer; background: none; overflow: hidden; }
.sw-color::-webkit-color-swatch-wrapper { padding: 0; }
.sw-color::-webkit-color-swatch { border: 0; border-radius: 50%; }
.swatch:has(input[type="radio"]:checked) .sw { outline: 2px solid var(--ink); outline-offset: 3px; }
.swatch:has(input[type="radio"]:checked) small { color: var(--ink); font-weight: 600; }

/* გადამრთველი (მოდული ჩართულია) */
.toggle { position: relative; display: inline-flex; cursor: pointer; flex: none; }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle-ui { width: 46px; height: 26px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); position: relative; transition: background .15s; }
.toggle-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.toggle input:checked + .toggle-ui { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-ui::after { transform: translateX(20px); background: var(--on-accent); }
.toggle input:disabled + .toggle-ui { opacity: .55; cursor: not-allowed; }
.toggle input:focus-visible + .toggle-ui { outline: 2px solid var(--accent); outline-offset: 2px; }

/* მომხმარებლები */
.people { list-style: none; margin: 0; padding: 0; }
.people > li { padding: 14px 0; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 10px; }
.people > li:first-child { border-top: 0; padding-top: 0; }
.person { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.person .avatar { background: var(--card-2); color: var(--ink); }
.person-t { display: flex; flex-direction: column; min-width: 0; flex: 1 1 200px; }
.person-t small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.person-edit > summary { list-style: none; align-self: flex-start; }
.person-edit > summary::-webkit-details-marker { display: none; }
.person-edit[open] > summary { border-color: var(--accent); }
.person-edit > form { margin-top: 12px; padding: 16px; background: var(--card-2); border-radius: 12px; }
.person-edit .form-actions { margin-top: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.row-actions > select.input { min-width: 0; max-width: 100%; }               /* გრძელი სახელების სია (გადახდა → კლიენტი) — მობილურზე არ გადადის */

/* ---------- სიები: ძებნა, ფილტრები, ცხრილი ---------- */
.lead { margin-top: -16px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.search { position: relative; flex: 1 1 280px; max-width: 420px; display: flex; align-items: center; }
.search .ic { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search .input { width: 100%; padding-left: 40px; border-radius: var(--r-ctl); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted); text-decoration: none; white-space: nowrap;
}
.chips a b { font: 500 12px var(--mono); color: var(--ink); }
.chips a.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chips a.on b { color: var(--on-accent); }

.table-card { padding: 0; overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 14px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 20px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--card-2) 60%, transparent); }
.table .num { text-align: right; white-space: nowrap; }
.person-link { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.person-link:hover b { color: var(--accent); }
.person-link .avatar, .profile .avatar { background: var(--card-2); color: var(--ink); }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager { display: flex; align-items: center; gap: 10px; }
.pill-muted { background: var(--card-2); color: var(--muted); }

/* ---------- ბარათი ---------- */
.profile { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.avatar.xl { width: 56px; height: 56px; font-size: 18px; }
.profile-t { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.profile-t b { font-size: 18px; font-weight: 600; }
.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kv { display: grid; grid-template-columns: minmax(120px, 40%) minmax(0, 1fr); gap: 10px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv a { color: var(--accent); text-decoration: none; }
.kv .big { font-size: 18px; font-weight: 600; }
.prewrap { white-space: pre-wrap; margin: 0; }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.history li { display: flex; flex-direction: column; padding-left: 14px; border-left: 2px solid var(--line); }
.textarea { width: 100%; min-height: 90px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.danger-zone > summary { list-style: none; display: inline-flex; }
.danger-zone > summary::-webkit-details-marker { display: none; }
.danger-zone > form { margin-top: 14px; }
.card .card-h form { margin: 0; }
[data-show-when][hidden] { display: none; }

/* ---------- ხელფასი: თვე, უწყისი, სქემები ---------- */
.period-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: -8px; }
.period-pick .input { min-height: 44px; width: 170px; }
.period-name { font-size: 16px; }
.stat .num.sm { font-size: 24px; }
.sheet-scroll { overflow-x: auto; }
.sheet th { vertical-align: bottom; }
.sheet th small { display: block; font-weight: 400; opacity: .8; }
.sheet td { padding: 10px 12px; }
.sheet th { padding: 12px; }
.sheet td small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; margin-top: 3px; }
.sheet td small b { color: var(--ink); font-weight: 500; }
.sheet .strong { font-weight: 600; }
.sheet tfoot td { border-top: 1px solid var(--line); background: var(--card-2); font-weight: 600; }
.sheet .who { min-width: 180px; }
.cell {
  width: 104px; min-height: 36px; padding: 0 8px; text-align: right; font: 14px var(--mono);
  background: var(--input); color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
}
.cell:focus { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); border-color: var(--accent); }
.row-x { width: 30px; height: 30px; color: var(--muted); font-size: 18px; background: none; border: 0; border-radius: 8px; cursor: pointer; }
.row-x:hover { color: var(--err); background: var(--card-2); }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--card-2); border-radius: var(--r-ctl); }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: var(--r-ctl); color: var(--muted); }
.seg input:checked + span { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }

.comp-list { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 10px; }
.comp-row {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.5fr) minmax(0, 1.3fr) minmax(0, 1.1fr) minmax(0, 1.4fr) minmax(0, .9fr) auto; gap: 10px; align-items: end;
  margin: 0; padding: 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--card-2);
}
.comp-row .field label { font-size: 12px; }
.comp-remove { min-height: 46px; align-items: center; }
.scheme-card { text-decoration: none; display: flex; flex-direction: column; gap: 10px; }
.scheme-card:hover { border-color: var(--accent); }
.scheme-card .card-h { margin-bottom: 0; }
.badges.start { justify-content: flex-start; }

.neg { color: var(--err); }
.accent-link { color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
.accent-link:hover { text-decoration: underline; }

/* ---------- მიმოხილვა: დიაგრამები (HTML/CSS; ყველა მნიშვნელობა ტექსტადაც) ---------- */
:root, [data-theme="obsidian"] { --viz-dim: #2A3242; }
[data-theme="hybrid"] { --viz-dim: #D6D0C4; }
.cols { display: flex; align-items: flex-end; gap: 12px; height: 210px; border-bottom: 1px solid var(--line); margin-top: 8px; }
.col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px;
       color: inherit; text-decoration: none; border-radius: 6px; }
.col-v { font: 500 12px var(--mono); color: var(--muted); white-space: nowrap; }
.col.on .col-v { color: var(--ink); font-weight: 600; }
.col-bar { display: block; width: 100%; max-width: 32px; min-height: 3px; border-radius: 4px 4px 0 0; background: var(--viz-dim); transition: filter .15s; }
.col.on .col-bar { background: var(--accent); }
.col:hover .col-bar, .col:focus-visible .col-bar { filter: brightness(1.18); }
.col:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cols-x { display: flex; gap: 12px; margin-top: 8px; }
.cols-x span { flex: 1 1 0; min-width: 0; text-align: center; font-size: 12px; color: var(--muted); }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.hbar-t { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; }
.hbar-t b { font-weight: 500; color: var(--muted-2); white-space: nowrap; }
.hbar-t b small { color: var(--muted); font-size: 11px; margin-left: 4px; }
.hbar-track { display: block; height: 8px; margin-top: 6px; border-radius: 999px; background: var(--card-2); overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.upcoming { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.upcoming li { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 12px; background: var(--card-2); }
.upcoming .person-t { flex: 1; min-width: 0; }
.upcoming .person-t small { display: block; font-size: 12px; color: var(--muted); }
.upcoming a { color: inherit; text-decoration: none; }
.upcoming a:hover { color: var(--accent); }
.date-tile { width: 46px; height: 46px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
             border-radius: 10px; background: var(--card); border: 1px solid var(--line); line-height: 1.1; }
.date-tile b { font: 600 16px var(--mono); }
.date-tile small { font-size: 10px; color: var(--muted); }

/* ---------- კალენდარი (app.js): ტექსტური ველი + ღილაკი, ფანჯარა დღეები / თვეები / წლები ---------- */
.dp { position: relative; display: block; }
.period-pick .dp { display: inline-block; }
.dp .dp-text { width: 100%; padding-right: 46px; font-variant-numeric: tabular-nums; }
.period-pick .dp .dp-text { width: 224px; cursor: pointer; }
.dp-btn { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center;
          border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.dp-btn:hover, .dp-btn:focus-visible { background: var(--card-2); color: var(--accent); }
.dp-btn:disabled { opacity: .4; cursor: default; background: transparent; }
.dp-pop { position: absolute; z-index: 60; width: 324px; max-width: calc(100vw - 16px); box-sizing: border-box; padding: 14px;
          background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 18px; font-family: var(--font);
          box-shadow: 0 22px 48px rgba(0, 0, 0, .38), 0 2px 8px rgba(0, 0, 0, .18); animation: dp-in .14s ease-out; }
[data-theme="hybrid"] .dp-pop { box-shadow: 0 22px 48px rgba(22, 24, 29, .16), 0 2px 6px rgba(22, 24, 29, .08); }
.dp-pop[hidden], .dp-scrim[hidden] { display: none; }
@keyframes dp-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.dp-head { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.dp-title { flex: 1; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
            border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: 600 14.5px var(--font); cursor: pointer; }
.dp-title svg { color: var(--muted); }
.dp-title:hover:not(:disabled) { background: var(--card-2); }
.dp-title:disabled { cursor: default; }
.dp-nav { width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; border: 0; border-radius: 10px;
          background: transparent; color: var(--muted); cursor: pointer; }
.dp-nav:hover { background: var(--card-2); color: var(--ink); }
.dp-body { display: grid; gap: 2px; }
.dp-body.days { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.dp-body.months, .dp-body.years { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.dp-wd { padding: 2px 0 6px; text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); }
.dp-wd.we { color: var(--accent); }
.dp-cell { height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: 500 13.5px var(--mono);
           font-variant-numeric: tabular-nums; cursor: pointer; transition: background .12s; }
.months .dp-cell, .years .dp-cell { height: 52px; font-family: var(--font); font-size: 14px; }
.dp-cell:hover { background: var(--card-2); }
.dp-cell.we { color: color-mix(in srgb, var(--accent) 75%, var(--ink)); }
.dp-cell.out { color: var(--muted); opacity: .55; }
.dp-cell.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.dp-cell.sel, .dp-cell.sel:hover { background: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: none; opacity: 1; }
.dp-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dp-cell:disabled { opacity: .25; cursor: default; background: transparent; }
.dp-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.dp-foot:empty { display: none; }
.dp-foot button { min-height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: transparent;
                  color: var(--ink); font: 500 12.5px var(--font); cursor: pointer; }
.dp-foot button:hover { border-color: var(--accent); color: var(--accent); }
.dp-scrim { position: fixed; inset: 0; z-index: 59; background: rgba(0, 0, 0, .45); }
@media (max-width: 760px) {
  .period-pick .dp, .period-pick .dp .dp-text { width: 100%; }
  .dp-pop { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; border-radius: 22px 22px 0 0;
            padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); animation-name: dp-up; }
  .dp-cell { height: 44px; font-size: 15px; }
  .months .dp-cell, .years .dp-cell { height: 56px; }
  @keyframes dp-up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) { .dp-pop, .more-sheet { animation: none; } }

/* ---------- HR დოკუმენტები ---------- */
.doc-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.doc-links a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: 12px; background: var(--card-2);
               color: inherit; text-decoration: none; }
.doc-links a span { flex: 1; min-width: 0; }
.doc-links a:hover, .doc-links li.on a { outline: 1px solid var(--accent); }
.doc-links .ic { color: var(--muted); }
.note code { font: 12px var(--mono); color: var(--ink); word-break: break-all; }

/* ---------- Excel-ის იმპორტი ---------- */
.rules { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--muted); line-height: 1.55; }
input.input[type="file"] { padding: 9px 12px; cursor: pointer; }
.sheet td.neg small { color: var(--err); }

/* ---------- რეპორტები ---------- */
.report-filter { margin-top: 0; }
.report-filter .period-pick input[type="number"] { width: 110px; }
.dept-pick { min-height: 44px; width: auto; min-width: 200px; margin-left: auto; }
.table-card > .card-h.pad { padding: 18px 20px 0; margin-bottom: 10px; }
.grid-2.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.payout .po-note { width: 220px; text-align: left; font-family: var(--font); }

/* ---------- ერთეულები, რეალიზაცია, ტაბელი ---------- */
.unit-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.unit-row .input { min-height: 40px; }
.unit-row .input:first-of-type { flex: 1 1 200px; }
.unit-row .input.mono { width: 90px; flex: 0 0 auto; }
.unit-row input[name="sort_order"] { width: 64px; }
.units-pick { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.units-pick legend { font-size: 13px; color: var(--muted); margin-bottom: 6px; padding: 0; }
.rev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 16px; }
.rev-grid .field { gap: 4px; }
.units-cell { min-width: 150px; }
.check.sm { font-size: 12px; gap: 6px; line-height: 1.6; }
.check.sm input { width: 16px; height: 16px; margin-top: 2px; }
.ts th.day, .ts td.day { padding: 6px 2px; text-align: center; min-width: 40px; }
.ts th.day small { display: block; font-size: 10px; opacity: .8; }
.ts .we { background: color-mix(in srgb, var(--card-2) 70%, transparent); }
.ts th.hol { color: var(--accent); }
.ts td.lv { font-size: 12px; font-weight: 600; color: var(--lv, var(--muted)); background: color-mix(in srgb, var(--lv, var(--muted)) 10%, transparent); cursor: default; }
.lv-annual { --lv: var(--ok); } .lv-unpaid { --lv: var(--warn); } .lv-sick { --lv: var(--err); } .lv-maternity { --lv: var(--info); } .lv-other { --lv: var(--muted); }
/* შვებულებები */
.nowrap { white-space: nowrap; }
small.block { display: block; margin-top: 2px; }
.row-tools { display: flex; gap: 2px; align-items: center; justify-content: flex-end; }
a.row-x { display: inline-flex; align-items: center; justify-content: center; }
a.row-x:hover { color: var(--accent); }
@media (max-width: 760px) { .table:not(.sheet) td.row-tools { display: flex; margin-left: auto; } }
.leave-table .person-t b { white-space: nowrap; }
.row-tools form { display: inline; margin: 0; }
.pill.lv-pill { background: color-mix(in srgb, var(--lv) 12%, transparent); color: var(--lv); }
.hol-list { margin-top: 14px; }
.hol-list summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.hol-list[open] summary { margin-bottom: 10px; color: var(--ink); }
.hol-list .rules { margin-bottom: 10px; }
a.card.stat { color: inherit; text-decoration: none; }
a.card.stat:hover { border-color: var(--accent); }
/* DocStamp: უწყისის ზოლი, ბარათის სია */
.ds-bar { align-items: center; margin-top: 0; padding: 12px 20px; }
.ds-sent { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.ds-sent li > span .pill { margin-right: 6px; }
/* RS.ge-ს რეესტრი */
.chips .chip-static { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted); white-space: nowrap; }
.chips .chip-static b { font: 500 12px var(--mono); color: var(--ink); }
.chips .chip-static.neg, .chips .chip-static.neg b { color: var(--err); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.rs-fields { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.rs-fields > span { white-space: nowrap; }
.rs-table td .neg { color: var(--err); }
.ts .cell.ts-cell { width: 38px; padding: 0 2px; text-align: center; }
.ts.monthly .cell { width: 110px; }
.ts .who .ts-fill { margin-top: 4px; min-height: 26px; padding: 0 8px; font-size: 11px; }

/* ---------- მშენებლობა: ხარჯთაღრიცხვა ---------- */
.est th { padding: 10px; }
.est td { padding: 8px 10px; }
.est .est-sec td { background: var(--card-2); font-weight: 600; }
.est .est-res td { color: var(--muted); font-size: 13px; padding-top: 4px; padding-bottom: 4px; border-bottom-color: transparent; }
.est .est-res td:nth-child(2) { padding-left: 28px; }
.est .est-name { min-width: 260px; max-width: 520px; }
.est td small { display: inline; margin: 0; white-space: normal; }
.est .cell { width: 84px; }
.est .est-chg { color: var(--accent); }
.est .est-extra td { background: color-mix(in srgb, var(--info) 6%, transparent); }
.est .est-a, .est td:nth-child(3) { white-space: nowrap; }
.est .cell.u { width: 70px; text-align: left; font-family: var(--font); }
.est .est-name .input { min-width: 240px; }
.est-pick .input { width: auto; min-width: 260px; max-width: 100%; }
.badges a.pill { text-decoration: none; }
.badges a.pill.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.ds-bar form.row-actions { margin-top: 0; align-items: center; }
@media (max-width: 760px) {
  .est-pick .input { min-width: 0; }
  .est-tools > .ctl, .est-tools > .period-pick, .est-tools > .badges { flex: 1 1 100%; }
  .est-tools > .ctl { justify-content: center; }
  .est-tools > .badges { justify-content: flex-start; }
}

/* ---------- შესვლა ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 480px); }
.login-side {
  background: var(--side-bg); border-right: 1px solid var(--side-line); color: var(--side-ink);
  padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
}
.login-side .brand { padding: 0; }
.login-side h2 { font-size: 30px; font-weight: 600; max-width: 20ch; margin-bottom: 14px; }
.login-side p { max-width: 40ch; font-size: 16px; line-height: 1.6; color: var(--side-muted); margin: 0; }
.login-mods { display: flex; flex-wrap: wrap; gap: 8px; }
.login-mods span { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--side-line); color: var(--side-muted); font-size: 13px; }
.login-mods span:first-child { border-color: var(--accent); color: var(--accent); }
.login-main { display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.login-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; }
.login-box h1 { font-size: 26px; font-weight: 600; }

.m-only, .m-brand { display: none; }
.m-brand { padding: 0; }
.m-brand small { color: var(--muted); }

/* ---------- მობილური (spec §7, ≤ 760px): მენიუ — ქვედა ზოლი ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .grid-2.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid-2.cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .app { display: block; }
  .side {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; top: auto; height: auto;
    flex-direction: row; gap: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--side-line); overflow: visible;
  }
  .side .brand, .me, .nav-group { display: none; }
  .m-brand { display: flex; margin-bottom: 8px; }
  .nav { flex-direction: row; gap: 2px; overflow-x: auto; scrollbar-width: none; }
  /* მინიშნება, რომ ზოლი გადაადგილდება (კლასებს app.js სვამს) */
  .nav.more-right { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); }
  .nav.more-left { -webkit-mask-image: linear-gradient(to left, #000 82%, transparent); mask-image: linear-gradient(to left, #000 82%, transparent); }
  .nav.more-left.more-right {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent);
  }
  .nav a {
    flex: 1 0 72px; flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; padding: 4px 6px;
    font-size: 11px; text-align: center; border-radius: 12px;
  }
  .nav a span { white-space: nowrap; }
  /* „მეტი“: ზოლზე — პირველი 4 + „მეტი“; დანარჩენი — ქვემოდან ამოსულ ფანჯარაში (ბადე) */
  .nav a.m-hide { display: none; }
  .nav:has(> .nav-more) { overflow-x: visible; min-width: 0; }
  .nav:has(> .nav-more) > a, .nav-more { flex: 1 1 0; min-width: 0; }
  .nav:has(> .nav-more) > a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .nav-more { display: block; }
  .nav-more > summary {
    list-style: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px;
    padding: 4px 6px; font-size: 11px; border-radius: 12px; color: var(--side-muted); cursor: pointer;
  }
  .nav-more > summary::-webkit-details-marker { display: none; }
  .nav-more > summary.on, .nav-more[open] > summary { background: var(--side-on); color: var(--side-ink); }
  .nav-more > summary.on .ic { color: var(--accent); }
  .more-sheet {
    position: absolute; left: 0; right: 0; bottom: 100%; max-height: 70vh; overflow-y: auto;   /* .side (fixed) — ზოლის ზედა კიდეზე */
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 14px 12px 16px;
    background: var(--side-bg); border-top: 1px solid var(--side-line); border-radius: 22px 22px 0 0;
    box-shadow: 0 -12px 32px rgba(0, 0, 0, .25); animation: dp-up .18s ease-out;
  }
  .more-sheet a { flex: none; min-height: 64px; white-space: normal; }
  .more-sheet a span { white-space: normal; line-height: 1.2; }
  .main { padding: 16px 16px 96px; gap: 16px; }
  .ttl h1 { font-size: 24px; }
  .tools { width: 100%; }
  .switch { flex: 1; min-width: 0; }
  .switch summary { width: 100%; }
  .switch-name { max-width: none; flex: 1; }
  .switch-menu { left: 0; right: 0; min-width: 0; }
  .m-only { display: block; }
  .stats { gap: 10px; }
  .stat { padding: 16px; }
  .stat .num { font-size: 28px; }
  .card { padding: 18px; }
  .form-grid, .theme-pick, .cards { grid-template-columns: minmax(0, 1fr); }
  .lead { margin-top: -8px; }
  .search { max-width: none; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; }
  /* ცხრილი → ბარათები (spec §7) */
  .table:not(.sheet) thead { display: none; }
  .table:not(.sheet), .table:not(.sheet) tbody, .table:not(.sheet) tr, .table:not(.sheet) td { display: block; }
  .table:not(.sheet) tr { padding: 14px 16px; border-bottom: 1px solid var(--line-2); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
  .table:not(.sheet) td { padding: 0; border: 0; flex: 0 1 auto; font-size: 13px; }
  .table:not(.sheet) td.who { flex: 1 1 100%; font-size: 14px; }
  .table td[data-label="დაწყება"]::before, .table td[data-label="გათავისუფლდა"]::before {
    content: attr(data-label) " "; color: var(--muted); font-size: 12px; font-family: var(--font);
  }
  .table:not(.sheet) .num { text-align: left; }
  /* უწყისი — ჰორიზონტალური სქროლი (spec §7: რიცხვითი ფორმები), სახელის სვეტი ფიქსირებული */
  .sheet .who { min-width: 140px; position: sticky; left: 0; background: var(--card); z-index: 1; }
  .sheet tfoot .who, .sheet tfoot td:first-child { background: var(--card-2); }
  .comp-row { grid-template-columns: minmax(0, 1fr); }
  .period-pick { flex: 1; min-width: 0; }
  .period-pick .input { width: 100%; }
  .period-name { flex: 1 1 100%; order: 5; }
  .report-filter .chips { order: 6; }
  .dept-pick { order: 7; flex: 1 1 100%; margin-left: 0; }
  .stat .num.sm { font-size: 18px; }
  /* ზედა ზოლი: გადამრთველი + გასვლა ერთ ხაზზე, გვერდის მთავარი მოქმედება — მთელ სიგანეზე ქვემოთ */
  .tools > .switch { order: 1; }
  .tools > .m-only { order: 2; }
  .tools > .page-actions { order: 3; flex: 1 1 100%; }
  .page-actions > * { flex: 1 1 0; justify-content: center; }
  .page-actions, .pager { flex-wrap: wrap; max-width: 100%; }        /* ბევრი ღილაკი (ფორმა №29: ბეჭდვა · Excel · „ბალანსისთვის“) — ორ ხაზად */
  .pager > select.input { flex: 1 1 0; min-width: 0; max-width: 100%; }   /* გრძელი ოფციები (მასალა ნაშთიდან) სიგანეს არ ზრდის */
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .form-actions .btn { flex: 1; }
  .tabs { align-self: stretch; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: 16px; }
  .tabs a { justify-content: center; border-radius: 12px; }
  .card-h { flex-direction: column; align-items: flex-start; gap: 2px; }
  .badges { justify-content: flex-start; }
  .login { grid-template-columns: 1fr; }
  .login-side { display: none; }
}

/* ---------- ობიექტზე (პრორაბი, ტელეფონი) — მოცულობები სტეპერით, ფასების გარეშე ---------- */
.alert-info { color: var(--info); border-color: color-mix(in srgb, var(--info) 40%, transparent); background: color-mix(in srgb, var(--info) 10%, transparent); }
.site-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.site-card { display: flex; align-items: center; gap: 12px; min-height: 64px; color: inherit; text-decoration: none; }
.site-card .person-t { flex: 1; min-width: 0; }
.site-card:hover { outline: 1px solid var(--accent); }
.site-form { gap: 12px; }
.site-sec { padding: 0; overflow: hidden; }
.site-sec > summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; font-weight: 600; list-style: none; }
.site-sec > summary::-webkit-details-marker { display: none; }
.site-sec > summary span { flex: 1; min-width: 0; }
.site-sec > summary::after { content: '▾'; color: var(--muted); }
.site-sec[open] > summary::after { content: '▴'; }
.site-sec[hidden], .site-pos[hidden] { display: none; }
.site-pos { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--line); }
.site-pos.filled { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.site-t { line-height: 1.45; overflow-wrap: anywhere; }
.site-t .mono { color: var(--muted); font-size: 12px; }
.site-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12.5px; }
.site-left.neg, .site-pos.warn-over .site-left { color: var(--err); }
.site-pos .hbar-track { margin-top: 0; height: 6px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper .ctl { width: 44px; height: 44px; padding: 0; justify-content: center; font-size: 20px; flex: none; }
.stepper .input { width: 120px; text-align: center; font: 500 16px var(--mono); }
.site-pos.warn-over .stepper .input { border-color: var(--err); }
.site-bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px;
            background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 -6px 20px rgba(0, 0, 0, .08); }
.site-bar .input { flex: 1 1 220px; min-width: 0; font-size: 16px; }
.site-day { margin: 14px 0 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.site-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.site-log li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.site-log .site-t { flex: 1; min-width: 0; }
.site-log .site-t small { display: block; }
.site-log b { white-space: nowrap; }
details.card > summary.card-h { cursor: pointer; list-style: none; }
details.card > summary.card-h::-webkit-details-marker { display: none; }
@media (max-width: 760px) {
  .site-search { font-size: 16px; }
  .site-bar { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .site-bar .btn { flex: 1 1 100%; justify-content: center; }
  .stepper .input { flex: 1; width: auto; min-width: 0; }
}

/* ---------- შესყიდვები ---------- */
fieldset.form-grid.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.form-grid.plain[disabled] .input { opacity: 1; color: var(--ink); background: var(--card-2); }
.sheet tfoot tr[hidden] { display: none; }
p.note.pad { padding: 0 20px 14px; margin: 0; }
form[data-pur-form] .est .est-name { width: 100%; max-width: none; }
form[data-pur-form] .est .est-name .input { width: 100%; }

/* ვიზუალური რედაქტორი (დოკუმენტის შაბლონები): ზოლი + „ქაღალდი“ (თეთრი ორივე თემაში — როგორც დოკუმენტი) */
.rt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; border: 1px solid var(--line); border-bottom: 0;
  border-radius: 10px 10px 0 0; background: var(--card); }
.rt-bar button, .rt-bar select, .rt-pop summary { min-height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px;
  background: transparent; color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.rt-bar button:hover, .rt-pop summary:hover { border-color: var(--accent); }
.rt-bar select { max-width: 100%; min-width: 0; }                 /* „+ ველი“ — გრძელი ტექსტი მობილურზე */
.rt-grp { display: inline-flex; gap: 2px; }
.rt-pop { position: relative; }
.rt-pop summary { display: inline-flex; align-items: center; gap: 4px; list-style: none; }
.rt-pop summary::-webkit-details-marker { display: none; }
.rt-a { font-weight: 800; text-decoration: underline; text-decoration-color: #C62828; text-decoration-thickness: 3px; }
.rt-sws { position: absolute; z-index: 20; top: 36px; left: 0; display: flex; flex-wrap: wrap; gap: 6px; width: 172px; padding: 8px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); box-shadow: 0 8px 24px #0004; }
.rt-bar .rt-sw { width: 26px; min-height: 26px; height: 26px; padding: 0; border-radius: 6px; border: 1px solid #0003; }
.rt-bar .rt-none { background: repeating-linear-gradient(45deg, #fff 0 4px, #ddd 4px 8px); }
.rt-area { min-height: 420px; max-height: 70vh; overflow: auto; padding: 18px 22px; border: 1px solid var(--line); border-radius: 0 0 10px 10px;
  background: #FFFFFF; color: #111111; font: 15px/1.55 "Noto Sans Georgian", sans-serif; text-align: left; }
.rt-area:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.rt-area p { margin: 0 0 6px; }
.rt-area h2 { font-size: 19px; margin: 12px 0 6px; }
.rt-area h3 { font-size: 16px; margin: 10px 0 4px; }
.rt-area ul, .rt-area ol { margin: 0 0 6px; padding-left: 24px; }
.rt-area blockquote { margin: 0 0 6px 32px; }
.rt-area table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.rt-area td, .rt-area th { border: 1px solid #999; padding: 4px 6px; min-width: 40px; vertical-align: top; }
@media (max-width: 760px) { .rt-area { min-height: 300px; padding: 12px; } .rt-sws { left: auto; right: 0; } }
