:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e2e7ee;
  --line-strong: #cfd7e2;
  --ink: #1b2430;
  --ink-2: #4a5768;
  --ink-3: #7a8798;
  --primary: #1f4e8c;
  --primary-ink: #ffffff;
  --primary-soft: #e6eef8;
  --accent: #2f6fbf;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ok: #18794e;
  --ok-soft: #e7f5ee;
  --warn: #9a5b00;
  --warn-soft: #fff4dc;
  --mark: #ffe58a;
  --row-hover: #f1f5fb;
  --row-sel: #e3edfb;
  --tint-a: rgba(47, 111, 191, .13);
  --tint-b: rgba(24, 121, 78, .07);
  --circuit: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'><g fill='none' stroke='%232f6fbf' stroke-opacity='.10' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'><path d='M0 40h46l18 18h60l16 16h60'/><path d='M64 58v54l-18 18H0'/><path d='M124 74v70l20 20v36'/><path d='M46 0v22l18 18'/><path d='M200 118h-36l-18 18H90l-16 16v48'/><path d='M164 0v34l-20 20'/><path d='M0 170h30'/><rect x='86' y='86' width='26' height='18' rx='3'/></g><g fill='%232f6fbf' fill-opacity='.14'><circle cx='46' cy='40' r='3'/><circle cx='64' cy='58' r='3'/><circle cx='124' cy='74' r='3'/><circle cx='144' cy='164' r='3'/><circle cx='74' cy='152' r='3'/><circle cx='164' cy='118' r='3'/><circle cx='30' cy='170' r='3'/><circle cx='144' cy='54' r='3'/></g></svg>");
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --font: "Noto Sans Armenian", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141b;
    --surface: #161d27;
    --surface-2: #1b2430;
    --line: #273242;
    --line-strong: #344256;
    --ink: #e6ebf2;
    --ink-2: #b2bdcc;
    --ink-3: #8090a5;
    --primary: #5b95dc;
    --primary-ink: #0b1220;
    --primary-soft: #1d2d44;
    --tint-a: rgba(91, 149, 220, .16);
    --tint-b: rgba(56, 160, 110, .10);
    --circuit: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'><g fill='none' stroke='%238fb8ec' stroke-opacity='.11' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'><path d='M0 40h46l18 18h60l16 16h60'/><path d='M64 58v54l-18 18H0'/><path d='M124 74v70l20 20v36'/><path d='M46 0v22l18 18'/><path d='M200 118h-36l-18 18H90l-16 16v48'/><path d='M164 0v34l-20 20'/><path d='M0 170h30'/><rect x='86' y='86' width='26' height='18' rx='3'/></g><g fill='%238fb8ec' fill-opacity='.15'><circle cx='46' cy='40' r='3'/><circle cx='64' cy='58' r='3'/><circle cx='124' cy='74' r='3'/><circle cx='144' cy='164' r='3'/><circle cx='74' cy='152' r='3'/><circle cx='164' cy='118' r='3'/><circle cx='30' cy='170' r='3'/><circle cx='144' cy='54' r='3'/></g></svg>");
    --accent: #7aaef0;
    --danger: #f2877c;
    --danger-soft: #3a1d1b;
    --ok: #5cc596;
    --ok-soft: #15301f;
    --warn: #e8b45a;
    --warn-soft: #33270f;
    --mark: #6b5a12;
    --row-hover: #1c2634;
    --row-sel: #203352;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
/* էջի ֆոնը՝ թույլ տպագրատախտակի նախշ, որ երևա՝ ՏՏ բաժնի էջ է */
body {
  background-color: var(--bg); color: var(--ink); font: 14px/1.45 var(--font);
  background-image: var(--circuit),
    radial-gradient(1100px 420px at 8% -140px, var(--tint-a), transparent 72%),
    radial-gradient(900px 380px at 94% -100px, var(--tint-b), transparent 72%);
  background-repeat: repeat, no-repeat, no-repeat;
  background-size: 260px 260px, auto, auto;
  background-attachment: fixed;
}
@media (max-width: 760px) { body { background-size: 190px 190px, auto, auto; background-attachment: scroll; } }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
/* search, tabs and filters stay on screen while the page scrolls */
.stickytop { position: sticky; top: 0; z-index: 30; background: var(--surface); }
.topbar {
  position: relative; z-index: 30;
  display: flex; align-items: center; gap: 20px;
  padding: 14px 22px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 auto; cursor: pointer; border-radius: 8px; padding: 2px 6px 2px 2px; margin-left: -2px; }
.brand:hover { background: var(--surface-2); }
.logo {
  width: 42px; height: 42px; border-radius: 10px; flex: none;
  display: grid; place-items: center; background: var(--primary); color: var(--primary-ink);
  font-weight: 700; font-size: 16px; letter-spacing: .5px;
}
.brand-title { font-weight: 700; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-wrap { position: relative; flex: 1 1 520px; max-width: 760px; }
.search-wrap input {
  width: 100%; height: 46px; padding: 0 40px 0 44px; font-size: 15px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-2);
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.search-wrap input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-soft); }
.search-wrap input::-webkit-search-cancel-button { display: none; }
.search-ico { position: absolute; left: 16px; top: 14px; width: 18px; height: 18px; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; }
.search-clear {
  position: absolute; right: 10px; top: 10px; width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-3); font-size: 20px; line-height: 1; cursor: pointer;
}
.search-clear:hover { background: var(--line); color: var(--ink); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 13px; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.live.off::before { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.user-chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; font-size: 15px; font-weight: 550;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer;
}
.user-chip:hover { border-color: var(--line-strong); }
.user-chip .avatar { width: 34px; height: 34px; font-size: 13px; }
.user-chip .role { font-size: 12px; padding: 2px 9px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 12px; }
.role { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--line); color: var(--ink-2); }
.role.admin { background: var(--primary); color: var(--primary-ink); }

.warnbar {
  padding: 8px 18px; background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 600;
  border-bottom: 1px solid var(--line);
}

/* ---------- tabs ---------- */
.tabs {
  display: flex; gap: 6px; padding: 8px 22px 0; background: var(--surface); border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: thin;
}
.tab {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 11px 16px 12px; border: 0; border-bottom: 3px solid transparent; background: none; font-size: 15.5px;
  color: var(--ink-2); cursor: pointer; font-weight: 600; border-radius: 8px 8px 0 0;
}
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .count { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--line); color: var(--ink-2); min-width: 20px; text-align: center; }
.tab.active .count { background: var(--primary-soft); color: var(--primary); }
.tab .count.hit { background: var(--mark); color: var(--ink); }
.tab.dim { opacity: .5; }
.tab-sep { width: 1px; margin: 8px 6px 10px; background: var(--line); flex: none; }
.tab.add { color: var(--accent); }
.tabs-right { position: sticky; right: 0; margin-left: auto; display: flex; gap: 4px; padding-left: 10px; background: var(--surface); box-shadow: -12px 0 12px -10px rgba(0,0,0,.18); }

/* ---------- toolbar ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 18px; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.toolbar .spacer { flex: 1; }
.toolbar .info { color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.filter {
  height: 32px; max-width: 220px; padding: 0 28px 0 10px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); cursor: pointer;
}
.filter.on { border-color: var(--accent); background: var(--primary-soft); color: var(--primary); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); cursor: pointer; white-space: nowrap;
  font-weight: 550;
}
.btn:hover { border-color: var(--ink-3); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 13px; }
.btn.lg { height: 40px; padding: 0 18px; }

.bulkbar {
  z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 18px; background: var(--primary-soft); border-bottom: 1px solid var(--line); color: var(--primary); font-weight: 600;
}
.bulkbar select, .bulkbar input { height: 30px; border: 1px solid var(--line-strong); border-radius: 7px; padding: 0 8px; background: var(--surface); color: var(--ink); font-weight: 400; }

/* ---------- main / tables ---------- */
main { padding: 14px 18px 60px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
/* the table scrolls under the sticky header, which stays on screen */
.table-wrap { overflow: auto; max-height: calc(100vh - var(--stick, 160px) - 56px); border-radius: var(--radius); }
.group + .group { margin-top: 18px; }
.group-head { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.group-head h2 { margin: 0; font-size: 15px; }
.group-head .info { color: var(--ink-3); font-size: 13px; }
/* grouped sections scroll with the page, so their headings stick under the top bar */
.group .table-wrap { max-height: none; overflow: visible; }
.group .table-wrap .grid th { top: var(--stick, 0px); }

table.grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.grid th, .grid td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.grid th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--ink-2); font-weight: 650; font-size: 12px;
  user-select: none; border-bottom: 1px solid var(--line-strong);
  white-space: normal; overflow-wrap: break-word; /* long headings wrap instead of widening the column */
}
.grid th:hover { color: var(--ink); }
.grid th .sort { color: var(--accent); margin-left: 4px; }
.grid th.secret-col::after { content: " 🔒"; font-size: 11px; }
.grid td { white-space: nowrap; }
/* short columns (Printer N, Քարթրիջ, OpenBox, Հարկ…) shrink to their content,
   long text wraps — together this keeps the table inside the window */
.grid th.tight, .grid td.tight { width: 1%; }
/* short columns stay on one line; a rare long value is cut with "…" (full text on hover) */
.grid td.tight { white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
/* narrower screens: a slightly denser table instead of a sideways scrollbar */
@media (max-width: 1500px) { table.grid { font-size: 12.5px; } .grid th, .grid td { padding: 6px 6px; } }
.grid td.wrap { white-space: normal; min-width: 88px; max-width: 180px; overflow-wrap: break-word; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.p0 { background: var(--line); color: var(--ink-2); }
.pill.p1 { background: var(--ok-soft); color: var(--ok); }
.pill.p2 { background: var(--warn-soft); color: var(--warn); }
.pill.p3 { background: var(--primary-soft); color: var(--accent); }
.grid tfoot td {
  position: sticky; bottom: 0; background: var(--surface-2); border-top: 2px solid var(--line-strong);
  font-weight: 700; color: var(--ink); white-space: nowrap;
}
.grid tbody tr:hover td { background: var(--row-hover); }
.grid tbody tr.sel td { background: var(--row-sel); }
.grid tbody tr.flash td { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--mark); } to { background: transparent; } }
.grid td.num, .grid th.num { width: 1%; white-space: nowrap; color: var(--ink-3); text-align: right; }
.grid td.chk, .grid th.chk { width: 1%; padding-right: 4px; cursor: default; }
.grid td.empty { color: var(--ink-3); }
.grid td.editable { cursor: cell; }
.grid td.editing { padding: 3px 4px; background: var(--surface) !important; }
.grid td.editing input { width: 100%; min-width: 120px; height: 28px; padding: 0 6px; border: 2px solid var(--accent); border-radius: 6px; background: var(--surface); outline: none; }
.rowbtn {
  border: 1px solid transparent; background: none; border-radius: 6px; padding: 1px 6px; color: var(--ink-3);
  cursor: pointer; font-variant-numeric: tabular-nums;
}
.rowbtn:hover { border-color: var(--line-strong); color: var(--primary); background: var(--surface); }
mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 1px; color: var(--ink-3); }
.secret.shown { letter-spacing: 0; color: var(--warn); }
.empty-state { padding: 60px 20px; text-align: center; color: var(--ink-3); }
.empty-state .big { font-size: 34px; margin-bottom: 6px; }
.hint { color: var(--ink-3); font-size: 12px; }

/* ---------- landing (մուտք չգործած այցելու) ---------- */
.landing { max-width: 1040px; margin: 0 auto; padding: 28px 0 20px; }
.land-hero { text-align: center; margin: 4px auto 26px; max-width: 720px; }
.land-hero h1 { margin: 0 0 6px; font-size: clamp(22px, 3.4vw, 30px); letter-spacing: -.01em; }
.land-hero p { margin: 0; color: var(--ink-3); font-size: 14px; }
.land-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.land-card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 28px;
}
.help-card {
  overflow: hidden; color: #fff; border: 0;
  background: radial-gradient(120% 90% at 100% 0%, rgba(255,255,255,.16), transparent 55%),
              linear-gradient(140deg, #1f4e8c 0%, #2f6fbf 55%, #3b86d6 100%);
  box-shadow: 0 10px 30px rgba(31, 78, 140, .28);
}
.help-card::after {
  content: ""; position: absolute; right: -60px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%;
  border: 28px solid rgba(255,255,255,.07); pointer-events: none;
}
.hc-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.16);
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
}
.hc-ico {
  position: absolute; top: 22px; right: 24px; width: 58px; height: 58px; display: grid; place-items: center;
  font-size: 30px; border-radius: 16px; background: rgba(255,255,255,.14);
}
.help-card h2 { margin: 16px 0 8px; font-size: clamp(22px, 2.6vw, 28px); line-height: 1.2; padding-right: 70px; }
.hc-lead { margin: 0 0 20px; color: rgba(255,255,255,.88); line-height: 1.55; max-width: 480px; }
.hc-steps { list-style: none; counter-reset: st; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; }
.hc-steps li { counter-increment: st; display: flex; align-items: center; gap: 12px; }
.hc-steps li > div { display: flex; flex-wrap: wrap; column-gap: 10px; }
.hc-steps li::before {
  content: counter(st); flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: #1f4e8c; font-weight: 700; font-size: 13px;
}
.hc-steps b { font-weight: 650; }
.hc-steps span { color: rgba(255,255,255,.72); font-size: 13px; }
.hc-btns { display: flex; flex-wrap: wrap; gap: 10px; position: relative; z-index: 1; }
.help-card .btn.lg { height: 46px; padding: 0 20px; border-radius: 10px; font-size: 15px; }
.help-card .btn.primary { background: #fff; border-color: #fff; color: #1f4e8c; }
.help-card .btn.primary:hover { filter: none; background: #eef4fc; }
.help-card .btn:not(.primary) { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.35); color: #fff; }
.help-card .btn:not(.primary):hover { background: rgba(255,255,255,.2); }

.login-card { display: flex; flex-direction: column; }
.lc-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.lc-ico { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--primary-soft); }
.lc-head h2 { margin: 2px 0 4px; font-size: 19px; }
.lc-head p { margin: 0; color: var(--ink-3); font-size: 13px; line-height: 1.45; }
.login-card .field input { height: 44px; border-radius: 10px; }
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { flex: 1; padding-right: 44px !important; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; cursor: pointer; border-radius: 8px; opacity: .7; }
.pw-eye:hover { opacity: 1; background: var(--surface-2); }
.btn.block { width: 100%; margin-top: 6px; }
.login-card .btn.lg { height: 46px; border-radius: 10px; font-size: 15px; }
.lc-foot { margin: 14px 0 0; text-align: center; color: var(--ink-3); font-size: 12.5px; }
@media (max-width: 820px) {
  .landing { padding-top: 10px; }
  .land-grid { grid-template-columns: 1fr; }
  .land-card { padding: 22px 18px; }
  .hc-ico { width: 48px; height: 48px; font-size: 24px; top: 18px; right: 18px; }
  .hc-btns .btn { flex: 1 1 100%; }
  .hc-steps li > div { flex-direction: column; }
}

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea, .input {
  height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); outline: none; width: 100%;
}
.field textarea { height: auto; min-height: 70px; padding: 8px 10px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 14px; }
.error { color: var(--danger); background: var(--danger-soft); padding: 8px 10px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.check input { width: auto; height: auto; margin: 0; }

/* ---------- modal ---------- */
.modal-bg {
  position: fixed; inset: 0; z-index: 100; background: rgba(15, 20, 27, .45);
  display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow: auto;
  animation: fade .12s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 760px; background: var(--surface); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal.wide { max-width: 980px; }
.modal.narrow { max-width: 440px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; flex: 1; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.modal-foot .spacer { flex: 1; }
.x { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--ink-3); cursor: pointer; width: 32px; height: 32px; border-radius: 8px; }
.x:hover { background: var(--line); color: var(--ink); }
.kv { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.kv > div { padding: 8px 12px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv .k { background: var(--surface-2); color: var(--ink-2); font-weight: 600; font-size: 13px; }
.meta { color: var(--ink-3); font-size: 12px; margin-top: 10px; }
.subtabs { display: flex; gap: 4px; margin: -4px 0 14px; border-bottom: 1px solid var(--line); }
.subtabs button { border: 0; background: none; padding: 8px 12px; border-bottom: 2px solid transparent; cursor: pointer; color: var(--ink-2); font-weight: 600; }
.subtabs button.active { color: var(--primary); border-bottom-color: var(--primary); }

/* column editor */
.col-list { display: flex; flex-direction: column; gap: 6px; }
.col-item { display: grid; grid-template-columns: 1fr auto auto auto auto auto auto auto; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.col-item input[type=text] { height: 32px; }
.col-item .col-type { height: 32px; width: auto; }
.col-item .col-opts { grid-column: 1 / -1; }
.col-item .check { font-size: 12px; color: var(--ink-2); }

/* lists */
.list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .sub { color: var(--ink-3); font-size: 12px; }
.badge { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--line); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
.secret-box { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 16px; padding: 10px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); user-select: all; }

/* history */
.hist { display: flex; flex-direction: column; gap: 8px; }
.hist-item { padding: 10px 14px; }
.hist-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hist-top .who { font-weight: 650; }
.hist-top .when { color: var(--ink-3); font-size: 12px; margin-left: auto; }
.hist-sum { margin-top: 3px; }
.changes { margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; }
.changes li { padding: 2px 0; }
.changes .lbl { color: var(--ink-2); font-weight: 600; }
.changes .from { color: var(--danger); text-decoration: line-through; }
.changes .to { color: var(--ok); }
.hist-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.hist-filter .input { flex: 1 1 320px; width: auto; }

/* stats */
.stats { display: flex; flex-direction: column; gap: 18px; max-width: 1180px; margin: 0 auto; }
.stats-head h1 { margin: 4px 0 2px; font-size: 20px; }
.stats-head .hint { font-size: 13px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tile { position: relative; padding: 16px; overflow: hidden; border-top: 3px solid var(--primary); transition: transform .12s, border-color .12s, box-shadow .12s; }
.tile:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 6px 20px rgba(16,24,40,.12); }
.tile .ico { position: absolute; right: 12px; top: 12px; font-size: 20px; opacity: .35; }
.tile .lbl { color: var(--ink-2); font-size: 12px; font-weight: 600; padding-right: 26px; }
.tile .val { font-size: 30px; font-weight: 700; letter-spacing: -.5px; margin-top: 4px; font-variant-numeric: tabular-nums; color: var(--primary); }
.tile .sub { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.tile.warn { border-top-color: var(--danger, #c0392b); }
.tile.warn .val { color: var(--danger, #c0392b); }
.stat-card { padding: 16px 18px; }
.stat-card h3 { margin: 0 0 3px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.stat-card .desc { color: var(--ink-3); font-size: 12px; margin-bottom: 12px; }
table.st { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
.st th, .st td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.st th:first-child, .st td:first-child { text-align: left; }
.st th { color: var(--ink-2); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .03em; background: var(--surface-2); position: sticky; top: 0; }
.st tbody tr:hover td { background: var(--row-hover); }
.st tfoot td { font-weight: 700; border-top: 2px solid var(--line-strong); background: var(--surface-2); }
.st td.zero { color: var(--line-strong); }
.st td.link { cursor: pointer; color: var(--accent); font-weight: 600; }
.st td.link:hover { text-decoration: underline; }
.st td.bar-cell, .st th.bar-h { text-align: left; min-width: 170px; }
.bar { display: flex; align-items: center; gap: 8px; }
.bar i { display: block; height: 11px; border-radius: 3px; min-width: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent)); }
.bar-cell.link { cursor: pointer; }
.bar-cell.link:hover i { filter: brightness(1.15); }
.bar span { min-width: 30px; text-align: right; font-weight: 600; }
.stat-scroll { overflow-x: auto; max-height: 70vh; }

/* ---------- faculties home ---------- */
.home { max-width: 1180px; margin: 0 auto; }
.home-head { margin: 6px 0 16px; }
.home-head h1 { margin: 0 0 4px; font-size: 20px; }
.home-head .hint { font-size: 13px; max-width: 640px; }
.fac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; align-items: stretch; }
.fac-card {
  display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 14px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  border-top: 3px solid var(--primary); transition: border-color .12s, transform .12s, box-shadow .12s;
}
.fac-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(16, 24, 40, .12); }
.fac-card:active { background: var(--row-hover); }
.fac-name { font-weight: 700; font-size: 16px; line-height: 1.25; }
.fac-total { display: flex; align-items: baseline; gap: 6px; }
.fac-total .num { font-size: 26px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; color: var(--primary); }
.fac-total .lbl { color: var(--ink-3); font-size: 12px; }
.fac-counts { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.fac-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: baseline; gap: 10px; }
.fac-open { color: var(--accent); font-size: 13px; font-weight: 600; }
.fac-link { margin-left: auto; font-size: 11px; color: var(--ink-3); text-decoration: none; }
.fac-link:hover { color: var(--accent); text-decoration: underline; }
.home-head.mt { margin-top: 26px; }

/* sheet cards on the home page */
/* նույն ցանցը, ինչ ֆակուլտետների քարտերը՝ որ սյունակները համընկնեն */
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.sheet-card { display: flex; align-items: center; gap: 10px; padding: 14px 16px; min-height: 56px; cursor: pointer; transition: border-color .12s, transform .12s; }
.sheet-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.sh-ico { font-size: 19px; }
.sh-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.sh-eye { opacity: .6; font-size: 12px; }
.sh-n { margin-left: auto; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--ink-2); }

/* summary dialog */
.sum-picks { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.sum-out { max-height: 55vh; overflow: auto; }
.sum-table th { top: 0; }
.fac-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 2px 0 14px; }
.fac-head h1 { margin: 0; font-size: 20px; }

/* ---------- phone cards ---------- */
.cards { display: flex; flex-direction: column; gap: 8px; }
.row-card { padding: 10px 12px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.row-card:active { background: var(--row-hover); }
.row-card.flash { animation: flash 1.6s ease-out; }
.rc-title { font-weight: 650; margin-bottom: 4px; overflow-wrap: anywhere; }
.rc-sub { color: var(--ink-3); font-size: 12px; margin: -2px 0 4px; }
.rc-fields { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.rc-f { display: flex; gap: 10px; }
.rc-k { flex: 0 0 112px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-v { flex: 1; overflow-wrap: anywhere; min-width: 0; }
.rc-more { margin-top: 4px; color: var(--accent); font-size: 12px; }
.tb-panel { display: flex; flex-wrap: wrap; gap: 8px; flex-basis: 100%; min-width: 0; padding-top: 4px; }
.tb-panel .filter { flex: 1 1 100%; max-width: none; min-width: 0; }

/* popover */
.popover { position: absolute; z-index: 60; min-width: 220px; max-height: 60vh; overflow: auto; padding: 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); }
.popover .item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.popover .item:hover { background: var(--surface-2); }
.popover hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

/* toasts */
/* վերևի աջ անկյունում՝ մենյուի տակ, որ անմիջապես աչքի ընկնեն */
#toasts {
  position: fixed; right: 18px; top: calc(var(--stick, 120px) + 12px); z-index: 200;
  display: flex; flex-direction: column; gap: 10px; width: min(420px, calc(100vw - 24px)); pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 14px 12px 14px 16px;
  border-radius: 12px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong);
  border-left: 5px solid var(--accent); box-shadow: 0 12px 32px rgba(16, 24, 40, .22);
  font-size: 14.5px; line-height: 1.45; animation: toast-in .22s cubic-bezier(.2, .9, .3, 1.2);
}
.toast.out { animation: toast-out .2s forwards; }
.toast.clickable { cursor: pointer; }
.toast.clickable:hover { background: var(--surface-2); }
.toast.ok { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--danger); background: var(--danger-soft); }
.toast.notify { border-left-color: var(--primary); border-width: 2px 2px 2px 6px; border-color: var(--primary); }
.toast-ico { flex: none; font-size: 22px; line-height: 1; margin-top: 1px; }
.toast.notify .toast-ico { animation: ring .8s ease-in-out 2; }
.toast-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-title { font-weight: 700; margin-bottom: 2px; }
.toast-msg { color: var(--ink-2); }
.toast:not(:has(.toast-title)) .toast-msg { color: var(--ink); font-weight: 550; }
.toast-x { flex: none; width: 26px; height: 26px; border: 0; border-radius: 50%; background: none; color: var(--ink-3); font-size: 18px; line-height: 1; cursor: pointer; }
.toast-x:hover { background: var(--line); color: var(--ink); }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px); } }
@keyframes ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-18deg); } 40% { transform: rotate(14deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(4deg); } }
/* նոր նամակների / հայտերի քանակը ներդիրում՝ ուշադրություն գրավող */
.tab .count.hit { animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--mark) 90%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
  .search-wrap { order: 3; flex-basis: 100%; }
  .brand-title { font-size: 16px; }
  .logo { width: 36px; height: 36px; font-size: 14px; }
  .user-chip { font-size: 14px; }
  .tabs { padding: 6px 12px 0; }
  .tab { font-size: 14.5px; padding: 10px 12px 11px; }
  #toasts { right: 12px; left: 12px; width: auto; }
  .live span { display: none; }
  main, .toolbar, .tabs, .bulkbar { padding-left: 12px; padding-right: 12px; }
  main { padding-top: 10px; }
  .bulkbar { top: 108px; }
  .table-wrap { max-height: none; }
  .kv { grid-template-columns: 1fr; }
  .kv .k { border-bottom: 0; padding-bottom: 0; }
  .col-item { grid-template-columns: 1fr auto auto; }

  /* comfortable touch targets, and ≥16px inputs so iOS doesn't auto-zoom */
  input, select, textarea { font-size: 16px; }
  .btn { height: 38px; }
  .btn.sm { height: 34px; }
  .filter { height: 38px; }
  .grid th, .grid td { padding: 9px 10px; }
  .form-grid { grid-template-columns: 1fr; }

  /* dialogs: wide ones become full-screen, with a sticky footer */
  .modal-bg { padding: 0; align-items: stretch; }
  .modal { max-width: none; border-radius: 0; min-height: 100dvh; display: flex; flex-direction: column; }
  .modal-head { position: sticky; top: 0; background: var(--surface); z-index: 2; }
  .modal-body { flex: 1; }
  .modal-foot { position: sticky; bottom: 0; z-index: 2; border-radius: 0; }
  .modal.narrow { min-height: 0; margin: auto; border-radius: 14px; width: calc(100% - 24px); max-width: 440px; align-self: center; }
  .modal-bg:has(.modal.narrow) { padding: 16px 0; align-items: center; }
}

@media print {
  .topbar, .tabs, .toolbar, .bulkbar, #toasts, .grid .chk, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  main { padding: 0; }
  .card { box-shadow: none; border: 0; }
  .table-wrap { max-height: none; overflow: visible; }
  .grid th { position: static; }
  mark { background: none; }
}
.field.wide { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .toolbar .filter { flex: 1 1 calc(50% - 8px); max-width: none; min-width: 0; height: 30px; font-size: 13px; }
}
@media (max-width: 760px) {
  .tabs-right { position: static; box-shadow: none; margin-left: 0; padding-left: 0; }
}

/* ---------- հայտեր (help desk) ---------- */
.helpdesk { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 16px; border-left: 3px solid var(--accent); }
.hd-text { min-width: 240px; flex: 1; }
.hd-title { font-weight: 700; margin-bottom: 2px; }
.hd-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.sent { text-align: center; padding: 8px 0 4px; }
.big-num { font-size: 40px; font-weight: 700; color: var(--accent); letter-spacing: -1px; }
.row-inline { display: flex; gap: 8px; }
.row-inline input { flex: 1; }
.track-out { margin-top: 10px; }

.board-wrap { max-width: 1600px; margin: 0 auto; }
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: start; }
.board-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 160px; transition: background .12s, border-color .12s; }
.board-col.over { border-color: var(--accent); background: var(--primary-soft); }
.board-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 13px; margin-bottom: 10px; color: var(--ink-2); }
.tcard { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: 10px; padding: 10px; margin-bottom: 8px; cursor: pointer; transition: transform .1s, box-shadow .1s; }
.tcard:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(16,24,40,.12); }
.tcard:active { cursor: grabbing; }
.tcard.prio-high { border-left-color: var(--danger); }
.tcard.prio-normal { border-left-color: var(--accent); }
.tcard.prio-low { border-left-color: var(--line-strong); }
.tc-top { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 4px; }
.tc-num { font-weight: 700; color: var(--accent); }
.tc-kind { color: var(--ink-3); }
.tc-fire { margin-left: auto; }
.tc-text { font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.tc-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--ink-3); margin-top: 6px; }
.tc-place, .tc-who { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
/* հայտի արդյունքը՝ լուծվեց թե ոչ */
.tc-res { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; }
.tc-res.solved { background: var(--ok-soft); color: var(--ok); }
.tc-res.unsolved { background: var(--warn-soft); color: var(--warn); }
/* քարտի գործողությունների շարքը */
.tc-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.tc-acts .btn { height: 26px; padding: 0 8px; font-size: 12px; }
.pt-acts { display: flex; flex-wrap: wrap; gap: 4px; }
.tc-more { height: 22px; padding: 0 6px; font-size: 12px; opacity: .55; }
.tcard:hover .tc-more { opacity: 1; }
.btn.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.btn.ok:hover { background: var(--ok-soft); }
.btn.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.btn.warn:hover { background: var(--warn-soft); }
/* հայտի պատուհանի վերևի վիճակագոտին */
.tstate { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between;
  background: var(--row-hover); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.tstate.done { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 25%, var(--line)); }
.tstate.new { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 25%, var(--line)); }
.ts-now, .ts-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ts-now .tc-res { margin-top: 0; }
.tdesc { white-space: pre-wrap; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; margin: 12px 0; font-size: 14px; }
.tlog { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.tlog h4 { margin: 0 0 6px; font-size: 13px; color: var(--ink-2); }
.tlog-row { display: flex; gap: 8px; font-size: 12px; padding: 3px 0; color: var(--ink-2); }
.tlog-when { color: var(--ink-3); white-space: nowrap; min-width: 90px; }
.tlog-by { font-weight: 600; white-space: nowrap; }
@media (max-width: 1300px) { .board { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .board { grid-template-columns: 1fr; } }

/* հրապարակային հայտերի ցուցակ */
.toolbar-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.plist { display: flex; flex-direction: column; gap: 10px; }
.pticket { padding: 12px 14px; border-left: 3px solid var(--line-strong); }
.pticket.prio-high { border-left-color: var(--danger); }
.pticket.prio-normal { border-left-color: var(--accent); }
.pt-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 6px; }
.pt-text { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; }
.pt-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }

/* դիտողների մոտ տեքստը չի պատճենվում, տպելն էլ փակ է */
body.locked .grid, body.locked .cards, body.locked .plist, body.locked .fac-grid, body.locked .kv, body.locked .st {
  -webkit-user-select: none; user-select: none;
}
@media print {
  body.locked #app { display: none; }
  body.locked::after {
    content: "Տպելը հասանելի է միայն ադմիններին";
    display: block; padding: 40px; font: 600 16px system-ui, sans-serif; text-align: center;
  }
}

/* ամսաթվի խմբագրում՝ կայուն լայնություն և մաքրելու կոճակ */
.date-edit { display: flex; align-items: center; gap: 4px; }
.date-edit input[type=date] { flex: 1; min-width: 118px; }
.cell-clear {
  flex: 0 0 auto; width: 24px; height: 28px; line-height: 1; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-3); border-radius: 6px; cursor: pointer; font-size: 12px;
}
.cell-clear:hover { color: var(--danger); border-color: var(--danger); }
/* խմբագրվող բջիջը մնում է իր չափի մեջ */
.grid td.editing { overflow: visible; }
.grid td.editing input, .grid td.editing select { width: 100%; min-width: 0; box-sizing: border-box; }
.grid td.editing input[type=date] { padding-right: 2px; }

/* ձեռքով դասավորում՝ քաշելու բռնակ և տեղադրման գիծ */
.grid th.drag, .grid td.drag { width: 1%; padding: 7px 4px; }
.grid td.drag { cursor: grab; color: var(--ink-3); user-select: none; text-align: center; font-size: 14px; }
.grid td.drag:hover { color: var(--accent); }
.grid td.drag:active { cursor: grabbing; }
.grid tr.drop-before td { box-shadow: inset 0 2px 0 0 var(--accent); }
.grid tr.drop-after td { box-shadow: inset 0 -2px 0 0 var(--accent); }
.row-order { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.role.editor { background: var(--ok-soft); color: var(--ok); }
.role-sel { height: 30px; font-size: 12px; padding: 0 6px; }

/* ---------- հայտ բացողի փակումը, որ սպասում է հաստատման ---------- */
.board-col[data-status="confirm"] { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); }
.tc-uc { margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: var(--warn-soft); color: var(--ink-2); font-size: 12px; line-height: 1.4; }
.tc-uc b { color: var(--warn); font-weight: 700; }
.uc-box { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--ok-soft);
  border: 1px solid color-mix(in srgb, var(--ok) 25%, var(--line)); font-size: 13px; line-height: 1.5; }
.uc-box .uc-head { font-weight: 700; color: var(--ok); margin-bottom: 4px; }
.uc-box .hint { margin-top: 4px; }

/* ---------- ներքին նամակագրություն ---------- */
.chat {
  display: grid; grid-template-columns: 320px minmax(0, 1fr); overflow: hidden;
  height: calc(100vh - var(--stick, 120px) - 40px); min-height: 420px;
}
.chat-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--surface-2); }
.chat-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 8px; }
.chat-side-head h2 { margin: 0; font-size: 16px; }
.chat-search { margin: 0 12px 8px; width: auto; }
.chat-list { flex: 1; overflow-y: auto; padding: 0 6px 8px; }
.chat-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border: 0; border-radius: 9px;
  background: none; cursor: pointer; text-align: left;
}
.chat-item:hover { background: var(--row-hover); }
.chat-item.active { background: var(--row-sel); }
.ci-body { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.ci-top, .ci-bottom { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ci-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-time { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.ci-prev { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item.unread .ci-name, .chat-item.unread .ci-prev { color: var(--ink); font-weight: 700; }
.ci-badge { background: var(--primary); color: var(--primary-ink); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 7px; min-width: 20px; text-align: center; }
.avatar.lg { width: 38px; height: 38px; font-size: 13px; flex: none; }
.avatar.group { font-size: 17px; background: var(--ok-soft); }
.chat-sep { padding: 10px 8px 4px; font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; text-align: center; }
.chat-empty { padding: 30px 16px; text-align: center; color: var(--ink-3); font-size: 13px; line-height: 1.5; }
.chat-empty.big { margin: auto; }
.chat-empty .big { font-size: 40px; }

.chat-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); min-height: 58px; }
.chat-head:empty { display: none; }
.chat-head .spacer { flex: 1; }
.ch-title { min-width: 0; }
.ch-name { font-weight: 700; }
.ch-title .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.chat-back { display: none; font-size: 18px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; background: var(--bg); }
.chat-day { align-self: center; margin: 12px 0 6px; padding: 2px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); }
.chat-sys { align-self: center; margin: 6px 0; font-size: 12px; color: var(--ink-3); text-align: center; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: min(640px, 78%); margin-top: 8px; position: relative; }
.msg.cont { margin-top: 2px; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg-from { font-size: 12px; font-weight: 600; color: var(--accent); margin: 0 0 2px 10px; }
.bubble {
  padding: 7px 11px 5px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 1px 1px rgba(16, 24, 40, .04); user-select: text;
}
.msg.mine .bubble { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 22%, var(--line)); }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.msg-text a { color: var(--accent); }
.msg.deleted .msg-text { color: var(--ink-3); font-style: italic; }
.msg-meta { font-size: 10.5px; color: var(--ink-3); text-align: right; margin-top: 2px; }
.msg-seen { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.msg-acts { position: absolute; top: 2px; right: calc(100% + 4px); display: none; gap: 2px; }
.msg.mine:hover .msg-acts, .msg.mine:focus-within .msg-acts { display: flex; }
.chat-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-compose[hidden] { display: none; }
.chat-input {
  flex: 1; resize: none; min-height: 40px; max-height: 160px; padding: 9px 12px; line-height: 1.4;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); outline: none;
}
.chat-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--primary-soft); }
.chat-send { height: 40px; }
.pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow-y: auto; margin: 10px 0; }
.pick-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.pick-item:hover { background: var(--row-hover); }
.pick-item.on { background: var(--row-sel); }

@media (max-width: 760px) {
  main:has(.chat) { padding: 0; }
  .chat { grid-template-columns: 1fr; height: calc(100dvh - var(--stick, 110px)); border-radius: 0; border: 0; }
  .chat.has-cur .chat-side { display: none; }
  .chat:not(.has-cur) .chat-main { display: none; }
  .chat-side { border-right: 0; }
  .chat-back { display: inline-flex; }
  .msg { max-width: 88%; }
  .msg-acts { position: static; display: flex; opacity: .7; }
  .chat-send { padding: 0 12px; }
}
@media print { .chat { height: auto; } }

.mt-s { margin-top: 10px; }

/* հայտի ձև՝ ՏՏ աշխատակիցների ընտրություն բացվող ցանկից (մեկ կամ մի քանիսը) */
.ms { position: relative; }
.ms-btn {
  width: 100%; height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 10px; text-align: left;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); cursor: pointer;
}
.ms-btn:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--primary-soft); }
.ms-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-text.ph { color: var(--ink-3); }
.ms-caret { color: var(--ink-3); font-size: 12px; }
.ms-panel {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; min-width: 240px; max-height: 280px; overflow-y: auto;
  padding: 4px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow);
}
.ms-panel[hidden] { display: none; }
.ms-opt { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; cursor: pointer; }
.ms-opt:hover { background: var(--row-hover); }
.ms-opt:has(input:checked) { background: var(--row-sel); font-weight: 600; }
.ms + input { margin-top: 8px; }

/* հայտերի արխիվ */
.ar-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.ar-search { flex: 1 1 280px; height: 34px; }
.ar-stats { margin: 0 0 10px; font-size: 13px; }
.ar-item { cursor: pointer; }
.ar-item:hover { border-color: var(--accent); }
.ar-more { text-align: center; margin: 14px 0; }
.drop-done {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 22px 12px;
  border: 2px dashed var(--line-strong); border-radius: 12px; color: var(--ink-2); font-weight: 600;
}
.board-col.over .drop-done { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.dd-ico { font-size: 28px; color: var(--ink-3); }
.drop-done .hint { font-weight: 400; }
.archive-link { margin-top: 6px; }

/* ---- chat emoji picker ---- */
.emo { position: relative; flex: none; }
.emo-btn { height: 40px; width: 40px; padding: 0; font-size: 21px; line-height: 1; border-radius: 10px; }
.emo.open .emo-btn { background: var(--primary-soft); }
.emo-panel {
  display: none; position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 30;
  width: 360px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 12px 32px rgba(16, 24, 40, .18); overflow: hidden;
  animation: emoIn .14s ease-out;
}
.emo.open .emo-panel { display: flex; flex-direction: column; }
@keyframes emoIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.emo-tabs { display: flex; gap: 2px; padding: 6px 6px 0; border-bottom: 1px solid var(--line); background: var(--bg); }
.emo-tab { flex: 1; height: 36px; border: 0; background: none; font-size: 19px; cursor: pointer; border-bottom: 3px solid transparent; border-radius: 8px 8px 0 0; }
.emo-tab:hover { background: var(--row-hover); }
.emo-tab.on { border-bottom-color: var(--primary); background: var(--surface); }
.emo-title { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 8px 12px 2px; }
.emo-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; padding: 4px 8px 10px; max-height: 236px; overflow-y: auto; overflow-x: hidden; }
.emo-i { height: 38px; min-width: 0; padding: 0; border: 0; background: none; border-radius: 8px; font-size: 23px; line-height: 1; cursor: pointer; transition: transform .08s; }
.emo-i:hover { background: var(--row-hover); transform: scale(1.18); }
.emo-empty { grid-column: 1 / -1; padding: 24px 0; text-align: center; color: var(--ink-3); font-size: 13px; }
.msg-text.big-emo { font-size: 34px; line-height: 1.2; }
@media (max-width: 760px) {
  .emo-panel { position: fixed; left: 8px; right: 8px; bottom: 70px; width: auto; max-width: none; }
}

/* ---- կատարվելիք գործեր ---- */
.lchk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 500; }
.lchk input { width: 17px; height: 17px; }
.plan-chip { display: inline-flex; align-items: center; gap: 2px; margin-top: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--primary-soft); color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); }
.plan-chip .pc-rem { font-weight: 500; opacity: .8; }
.plan-chip.today { background: #fff4d6; color: #8a5a00; border-color: #f0c36b; }
.plan-chip.soon { background: #e8f3ff; }
.plan-chip.late { background: #fde8e8; color: #b42318; border-color: #f5b5b0; }
.plan .toolbar-inline { margin-top: 10px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.plan-day { margin-top: 22px; }
.plan-day h3 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; font-size: 18px; }
.plan-day h3 .count { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--line); color: var(--ink-2); }
.plan-day .pd-date { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.plan-day.today h3 { color: #8a5a00; }
.plan-day.late h3 { color: #b42318; }
.plan-item { display: grid; grid-template-columns: 130px 1fr auto; gap: 16px; align-items: start; }
.plan-item.mine { box-shadow: inset 4px 0 0 var(--primary); }
.pi-when { padding: 8px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); text-align: center; }
.pi-day { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.pi-time { font-size: 20px; font-weight: 700; margin: 2px 0; }
.pi-rem { font-size: 11.5px; color: var(--primary); }
.pi-rem.off { color: var(--ink-3); }
.plan-day.today .pi-when { background: #fff8e6; border-color: #f0c36b; }
.plan-day.late .pi-when { background: #fdeeee; border-color: #f5b5b0; }
.pi-main { min-width: 0; }
.pi-who { font-weight: 600; font-size: 13px; }
.pi-who.none { color: #b42318; font-weight: 500; }
.pi-acts { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.plan-box { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.plan-box[hidden] { display: none; }
.plan-box .field.wide { grid-column: 1 / -1; }
.quick-days { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.rem-ed { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rem-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong); }
.rem-chip input { border: 0; background: none; padding: 2px; width: auto; min-width: 0; font-weight: 600; }
.rem-x { border: 0; background: none; font-size: 17px; line-height: 1; cursor: pointer; color: var(--ink-3); padding: 0 6px; }
.rem-x:hover { color: #b42318; }
.toast.remind { border-left-width: 6px; }
.toast.remind .toast-msg { white-space: pre-line; }
.toast.remind.late { border-left-color: #d92d20; }
@media (max-width: 760px) {
  .plan-item { grid-template-columns: 1fr; gap: 10px; }
  .pi-when { display: flex; gap: 10px; align-items: baseline; text-align: left; }
  .pi-acts { flex-direction: row; flex-wrap: wrap; }
  .plan-box { grid-template-columns: 1fr; }
}
.pi-time.allday { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.quick-days .btn { border: 1px solid var(--line); }
