/* Axiora – изглед */
:root {
  --accent: #1a4aa8;
  --accent-soft: color-mix(in srgb, var(--accent) 9%, #fff);
  --accent-line: color-mix(in srgb, var(--accent) 28%, #fff);
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #111827;
  --text-2: #374151;
  --muted: #5f6b7a;
  --line: #e2e6ec;
  --line-2: #eef1f5;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ok: #157f3b;
  --warn: #9a5b00;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  font-family: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; line-height: 1.25; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 13px; margin: 0; font-weight: 650; color: var(--text); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }

/* ---------- контроли ---------- */
button, .btn {
  font: inherit; font-weight: 550; border: 1px solid var(--line); background: #fff; color: var(--text-2);
  padding: 0 14px; border-radius: 8px; cursor: pointer; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  text-decoration: none; box-shadow: var(--shadow); white-space: nowrap; transition: background .12s, border-color .12s;
}
button:hover, .btn:hover { background: #f8f9fb; border-color: #cfd5de; text-decoration: none; }
button:focus-visible, .btn:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover, .btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
button.ghost { background: transparent; border-color: transparent; box-shadow: none; }
button.ghost:hover { background: #eef1f5; }
button.danger { color: var(--danger); }
button.danger:hover { background: var(--danger-soft); border-color: #f3c3bd; }
button.small, .btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
button.icon { min-height: 32px; width: 32px; padding: 0; box-shadow: none; border-color: transparent; background: transparent; color: var(--muted); }
button.icon:hover { background: #eef1f5; color: var(--danger); }
button:disabled { opacity: .55; cursor: default; }

input, select, textarea {
  font: inherit; color: var(--text); background: #fff; border: 1px solid #d5dbe3; border-radius: 8px;
  padding: 0 11px; width: 100%; min-height: 38px; transition: border-color .12s, box-shadow .12s;
}
textarea { padding: 9px 11px; resize: vertical; min-height: 84px; line-height: 1.5; }
select { padding-right: 30px; appearance: none; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235f6b7a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center; }
input::placeholder, textarea::placeholder { color: #8a94a3; }
input:hover, select:hover, textarea:hover { border-color: #bfc7d2; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
input[readonly], textarea[readonly], select:disabled { background: #f6f7f9; color: var(--text-2); border-color: var(--line); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: var(--accent); flex: none; cursor: pointer; }
input[type=color] { padding: 3px; width: 64px; cursor: pointer; }
input[type=file] { padding: 5px 6px; color: var(--text-2); font-size: 13px; cursor: pointer; }
input[type=file]::file-selector-button { font: inherit; font-weight: 550; border: 1px solid var(--line); background: #f6f7f9; color: var(--text); border-radius: 6px; padding: 5px 12px; margin-right: 10px; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: #eef1f5; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 550; color: var(--text-2); }
/* ознака што изгледа како копче (на пр. избор на датотека) */
label.btn { flex-direction: row; font-size: inherit; color: var(--text-2); }
a.btn.danger { color: var(--danger); }
.path { overflow-wrap: anywhere; font-size: 12px; }
label.check { flex-direction: row; align-items: center; gap: 9px; font-size: 14px; font-weight: 450; color: var(--text); cursor: pointer; min-height: 30px; }
.hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }

/* ---------- заглавие ---------- */
.top { --head-fg: #fff; background: var(--accent); color: var(--head-fg); box-shadow: 0 2px 8px rgba(16, 24, 40, .18); position: sticky; top: 0; z-index: 20; }
.top a:focus-visible, .top button:focus-visible { outline-color: var(--head-fg); }
.top-in { max-width: 1360px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 28px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--head-fg); flex: none; min-width: 0; max-width: 240px; }
.brand .bname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand .mark { flex: none; }
.brand:hover { text-decoration: none; }
.brand img { height: 38px; width: auto; display: block; background: #fff; border-radius: 8px; padding: 5px 10px; }
.brand .mark { width: 30px; height: 30px; border-radius: 8px; background: #fff; color: var(--accent); display: grid; place-items: center; font-weight: 750; }
nav { display: flex; gap: 2px; flex: 1; align-self: stretch; overflow-x: auto; scrollbar-width: none; }
nav a { display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--head-fg); opacity: .86; font-weight: 550; border-bottom: 3px solid transparent; border-top: 3px solid transparent; white-space: nowrap; }
nav a:hover { opacity: 1; background: color-mix(in srgb, var(--head-fg) 10%, transparent); text-decoration: none; }
nav a.on { opacity: 1; font-weight: 650; background: color-mix(in srgb, var(--head-fg) 15%, transparent); border-bottom-color: var(--head-fg); }
.user { position: relative; flex: none; }
.user > button { box-shadow: none; border-color: transparent; padding: 0 6px 0 4px; gap: 9px; background: transparent; color: var(--head-fg); }
.user > button:hover { background: color-mix(in srgb, var(--head-fg) 14%, transparent); border-color: transparent; }
.user > button .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .75); }
.user .who { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.user .who b { font-size: 13px; color: var(--head-fg); font-weight: 600; }
.user .who span { font-size: 12px; color: var(--head-fg); opacity: .82; font-weight: 450; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
  min-width: 220px; padding: 6px; z-index: 40; display: flex; flex-direction: column; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px; color: var(--text-2); font-weight: 500;
  border: 0; background: none; box-shadow: none; min-height: 0; justify-content: flex-start; width: 100%; text-align: left; }
.menu a:hover, .menu button:hover { background: #f3f5f8; text-decoration: none; }
.menu .sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu .head { padding: 8px 10px 6px; font-size: 12px; color: var(--muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700; color: #fff; flex: none; letter-spacing: .02em; }
.avatars { display: flex; }
.avatars .avatar { width: 26px; height: 26px; font-size: 10.5px; border: 2px solid #fff; margin-left: -6px; }
.avatars .avatar:first-child { margin-left: 0; }

/* ---------- страница ---------- */
main { max-width: 1360px; margin: 0 auto; padding: 24px 20px 80px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .t { flex: 1; min-width: 220px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-h h2 { flex: 1; }
.card-h .i { color: var(--muted); }
.card-b { padding: 16px 18px 18px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.muted { color: var(--muted); }
.err { color: var(--danger); }

/* показатели */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { padding: 14px 16px; display: flex; align-items: center; gap: 14px; }
.kpi .ic { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.kpi .v { font-size: 22px; font-weight: 700; line-height: 1.1; }
.kpi .l { font-size: 12.5px; color: var(--muted); }
.kpi.blue .ic { background: #e8effc; color: #1a4aa8; }
.kpi.amber .ic { background: #fff3dc; color: #8a4b00; }
.kpi.red .ic { background: var(--danger-soft); color: var(--danger); }
.kpi.green .ic { background: #e3f4e8; color: var(--ok); }

/* јазичиња за статус */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; padding: 0 12px; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; box-shadow: none; color: var(--muted); padding: 0 10px; min-height: 46px; font-weight: 550; }
.tabs button:hover { background: none; color: var(--text); }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .n { font-size: 11.5px; font-weight: 650; background: #eef1f5; color: var(--muted); border-radius: 99px; padding: 1px 7px; }
.tabs button.on .n { background: var(--accent-soft); color: var(--accent); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.search { position: relative; flex: 1 1 260px; }
.search .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #8a94a3; width: 17px; height: 17px; }
.search input { padding-left: 36px; }
.toolbar select { width: auto; min-width: 150px; }

/* табели */
.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfc; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f8fafd; }
tr.sel td, tr.sel:hover td { background: var(--accent-soft); }
.dd { position: relative; }
.dd .menu { min-width: 230px; max-height: 70vh; overflow-y: auto; }
.menu button.danger { color: var(--danger); }
.menu button.danger:hover { background: var(--danger-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-main { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.ordno { font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.overdue { color: var(--danger); font-weight: 600; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .i { width: 34px; height: 34px; color: #aab3bf; stroke-width: 1.5; }
.empty b { color: var(--text); font-size: 15px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-draft { background: #eef0f3; color: #4a5160; }
.st-open { background: #e8effc; color: #1a4aa8; }
.st-in_progress { background: #fff3dc; color: #8a4b00; }
.st-done { background: #e3f4e8; color: #136c33; }
.st-invoiced { background: #ece6fb; color: #5b33b0; }
.st-cancelled { background: #fbe9e7; color: #a12a1c; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 500; }
.chip .i { width: 14px; height: 14px; }
.prio { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.pr-urgent { color: #9a5b00; }
.pr-emergency { color: var(--danger); }

/* ---------- потпис: прозорец во канцеларија и страница за клиентот ---------- */
.of-modal { position: fixed; inset: 0; z-index: 70; background: rgba(15, 23, 42, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.of-modal-in { background: #fff; border-radius: 14px; width: 100%; max-width: 620px; max-height: 100%; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-lg); }
.of-modal-in h2 { font-size: 18px; }
.sign-pad { display: block; width: 100%; height: 200px; border: 1px solid #c5ccd6; border-radius: 10px; background: #fff; touch-action: none; }
.sign-pad-h { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 550; color: var(--text-2); margin-bottom: 6px; }
.link-box { display: flex; gap: 8px; }
.link-box input { flex: 1; min-width: 0; font-size: 13px; }
.warn-box { background: #fff7e6; border: 1px solid #f5d89b; color: #7a4300; border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.sign-state { font-size: 13px; color: var(--text-2); margin: 0 0 12px; }
.sign-page { min-height: 100vh; display: flex; flex-direction: column; }
.sign-top { background: #fff; border-bottom: 1px solid var(--line); padding: 12px 16px; display: flex; justify-content: center; min-height: 62px; align-items: center; }
.sign-top img { max-height: 38px; max-width: 220px; display: block; }
.sign-main { width: 100%; max-width: 640px; margin: 0 auto; padding: 20px 14px 28px; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.sign-lead { margin: -8px 0 0; }
.sign-main .card-b { display: flex; flex-direction: column; gap: 14px; }
.sign-main h2 { font-size: 14px; }
.sign-kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 12px; margin: 0; font-size: 14px; }
.sign-kv dt { color: var(--muted); }
.sign-kv dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.sign-desc { margin: -6px 0 0; white-space: pre-wrap; }
.sign-lines { list-style: none; margin: -6px 0 0; padding: 0; }
.sign-lines li { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.sign-lines li:last-child { border-bottom: 0; }
.sign-lines b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sign-form input:not([type=checkbox]) { min-height: 46px; font-size: 16px; }
.sign-form button[type=submit] { min-height: 50px; font-size: 16px; }
.sign-form label.check { align-items: flex-start; }
.sign-form label.check input { margin-top: 2px; }
.sign-form textarea { font-size: 16px; }
.sign-form .actions button { flex: 1; min-height: 50px; font-size: 16px; }
button.linkish { background: none; border: 0; box-shadow: none; color: var(--muted); text-decoration: underline; font-weight: 500; align-self: center; min-height: 40px; }
button.linkish:hover { color: var(--danger); background: none; }
.sign-msg { padding: 40px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sign-msg .i { width: 44px; height: 44px; color: var(--accent); stroke-width: 1.5; }
.sign-msg h1 { font-size: 20px; }
.sign-msg p { margin: 0; color: var(--muted); }
.sign-foot { padding: 8px 0 22px; display: flex; justify-content: center; opacity: .75; }
.sign-foot img { height: 22px; }

/* ---------- цени на налогот ---------- */
.lines table#lines { min-width: 900px; }
.lines select { min-height: 34px; border-color: transparent; background-color: transparent; padding-left: 6px; padding-right: 22px; }
.lines td.amt { padding-right: 10px; white-space: nowrap; font-size: 13px; }
/* ред без цена: ДДВ е во втор план */
.lines tr.noprice [data-l=vat] { color: #9aa3af; }
.zero { color: #9aa3af; }
.mbox { margin: 16px 0 0 auto; max-width: 420px; display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.mrow { display: flex; justify-content: space-between; gap: 18px; }
.mrow span { color: var(--text-2); }
.mrow b { font-weight: 600; white-space: nowrap; }
.mrow.sub { border-top: 1px solid var(--line-2); padding-top: 7px; }
.mrow.tot { border-top: 2px solid var(--line); padding-top: 9px; font-size: 16px; }
.mrow.tot span, .mrow.tot b { color: var(--text); font-weight: 700; }
.mmiss { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin: 10px 0 0; color: #8a4b00; }
.mmiss .i { width: 15px; height: 15px; }
.sign-lines small { display: block; color: var(--muted); font-weight: 450; }
.sign-lines li > div { text-align: right; }
.sign-page .mbox { max-width: none; margin: -2px 0 0; }

/* ---------- резервни копии ---------- */
.sysbar { max-width: 1360px; margin: 16px auto -8px; padding: 0 20px; }
.sysbar .warn-box { display: flex; align-items: center; gap: 10px; }
.sysbar .warn-box span { flex: 1; }
.sysbar .i { width: 18px; height: 18px; flex: none; }
.of-modal .warn-box b { font-weight: 700; }

/* ---------- договори за одржување ---------- */
.usage { display: flex; flex-direction: column; gap: 5px; min-width: 110px; font-size: 13px; }
.ubar { display: block; height: 6px; border-radius: 99px; background: #e9edf2; overflow: hidden; }
.ubar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.usage.over { color: var(--danger); font-weight: 600; }
.usage.over .ubar i { background: var(--danger); }
tr.cur-per td { background: var(--accent-soft); }
.rep-tbl td input { min-height: 34px; }
.mcov { text-align: right; margin: 10px 0 0; }

/* ---------- извештаи ---------- */
.rep-tools { align-items: center; border-bottom: 0; }
.rep-tools label { flex-direction: row; align-items: center; gap: 8px; margin: 0; font-size: 13px; }
.rep-tools input[type=date] { width: auto; }
.rep-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.rep-grid .card, .rep-grid + .stack .card { min-width: 0; }
#rep .card-b { padding: 0; }
.rep-tbl td { padding: 9px 14px; }
.rep-tbl tfoot td { font-weight: 650; background: #fafbfc; border-top: 1px solid var(--line); border-bottom: 0; }
.rep-none { margin: 0; padding: 16px 18px; color: var(--muted); font-size: 13px; }
.rep-note { display: block; margin: 14px 2px 0; }
@media (max-width: 900px) { .rep-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- календар ---------- */
.seg-o { display: inline-flex; background: #e9edf2; border-radius: 9px; padding: 3px; gap: 2px; }
.seg-o button { border: 0; background: transparent; box-shadow: none; min-height: 34px; color: var(--muted); }
.seg-o button:hover { background: transparent; color: var(--text); }
.seg-o button.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.cal-tools { align-items: center; }
.cal-tools h2 { flex: 1; min-width: 180px; font-size: 16px; margin-left: 6px; }
.cal-tools .icon-nav { width: 38px; padding: 0; }
.cal-tools .flip .i { transform: rotate(180deg); }
.cal-head, .cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--muted); background: #fafbfc; border-bottom: 1px solid var(--line); }
.cal-week { grid-template-rows: 30px repeat(4, 27px); border-bottom: 1px solid var(--line-2); }
.cal-week:last-child { border-bottom: 0; }
.cal-cell { border-left: 1px solid var(--line-2); }
.cal-cell:first-child { border-left: 0; }
.cal-cell.out { background: #f8f9fb; }
.cal-cell.today { background: var(--accent-soft); }
.cal-cell.conf { box-shadow: inset 0 0 0 1px #f3c3bd; }
.cal-dn { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; font-size: 13px; font-weight: 600; color: var(--text-2); z-index: 1; }
.cal-cell.out + .cal-dn { color: #8a94a3; font-weight: 500; }
.cal-cell.today + .cal-dn .n { background: var(--accent); color: #fff; border-radius: 99px; min-width: 24px; height: 24px; display: inline-grid; place-items: center; }
.cal-alert { display: inline-flex; color: var(--danger); }
.cal-alert .i { width: 15px; height: 15px; }
.cal-bar { z-index: 1; margin: 2px 4px; padding: 0 7px; border-radius: 5px; display: flex; align-items: center; gap: 5px; font-size: 12px; min-width: 0; overflow: hidden; white-space: nowrap; }
.cal-bar:hover { text-decoration: none; filter: brightness(.95); }
.cal-bar .i { width: 13px; height: 13px; }
.cal-bar b { font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-bar span { overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.cal-bar.cl { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-bar.cr { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.unplanned { outline: 1px dashed currentColor; outline-offset: -1px; }
.cal-more { z-index: 1; border: 0; background: none; box-shadow: none; min-height: 0; height: 25px; padding: 0 8px; justify-content: flex-start; font-size: 12px; color: var(--accent); }
.cal-more:hover { background: none; text-decoration: underline; }
.cal-agenda { display: none; padding: 4px 14px 14px; }
.cal-aday h3 { font-size: 13px; margin: 14px 0 6px; display: flex; align-items: center; gap: 6px; }
.cal-aday.today h3 { color: var(--accent); }
.cal-chip { display: block; border-radius: 7px; padding: 6px 8px; margin-bottom: 5px; font-size: 12.5px; min-width: 0; }
.cal-chip:hover { text-decoration: none; filter: brightness(.96); }
.cal-chip .l1 { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.cal-chip .l1 .i { width: 13px; height: 13px; }
.cal-chip .l2 { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-table { table-layout: fixed; min-width: 1040px; }
.cal-table th:first-child { width: 170px; }
.cal-table thead th.today { color: var(--accent); background: var(--accent-soft); }
.cal-table thead b { color: var(--text); font-size: 14px; }
.cal-table td { vertical-align: top; padding: 6px; height: 84px; border-left: 1px solid var(--line-2); }
.cal-table td.today { background: var(--accent-soft); }
.cal-table td.conf { background: var(--danger-soft); }
.cal-who { background: #fff; white-space: normal; color: var(--text); font-size: 13px; vertical-align: top; }
.cal-who { display: flex; align-items: center; gap: 9px; border-bottom: 0; }
.cal-none { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #eef1f5; color: var(--muted); flex: none; }
.cal-conf { display: flex; align-items: center; gap: 4px; color: var(--danger); font-size: 11.5px; font-weight: 700; margin-bottom: 5px; }
.cal-conf .i { width: 13px; height: 13px; }
.cal-ics { display: inline-flex; align-items: center; gap: 4px; }
.cal-alert.amber, .cal-legend-c.amber { color: #9a5b00; }
.avail-card { margin-top: 16px; }
.avail-card .card-h .i { color: #9a5b00; }
.avail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 13px; }
.avail-n { margin-top: 2px; }
.avail-o { margin-top: 2px; color: var(--muted); }
.avail-warn { background: #fff7e6; border: 1px solid #f5d89b; border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.avail-t { display: flex; align-items: center; gap: 7px; font-weight: 700; color: #8a4b00; margin-bottom: 8px; }
.avail-ok { display: flex; align-items: center; gap: 7px; color: var(--ok); font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.avail-ok .i { width: 16px; height: 16px; }
.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; font-size: 12.5px; }
.cal-legend-c { display: inline-flex; align-items: center; gap: 5px; color: var(--danger); font-weight: 600; }
.cal-legend-c .i { width: 15px; height: 15px; }
@media (max-width: 760px) {
  .cal-month { display: none; }
  .cal-agenda { display: block; }
  .cal-tools h2 { order: 5; flex: 0 0 100%; margin: 4px 0 0; }
  .cal-tools select { margin-left: auto; min-width: 0; }
}

/* ---------- налог ---------- */
.ohead { padding: 18px 20px; display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.ohead .t { flex: 1; min-width: 240px; }
.ohead .no { font-size: 24px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ohead .meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); margin-top: 6px; font-size: 13px; }
.ohead .meta span { display: inline-flex; align-items: center; gap: 6px; }
.ohead .meta .i { width: 15px; height: 15px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 550; margin-bottom: 12px; }
.back:hover { color: var(--text); text-decoration: none; }

.steps { display: flex; border-top: 1px solid var(--line-2); overflow-x: auto; scrollbar-width: none; }
.steps button { flex: 1; min-width: 110px; border: 0; border-radius: 0; box-shadow: none; background: none; min-height: 48px; color: var(--muted); font-weight: 550; gap: 8px; position: relative; }
.steps button + button { border-left: 1px solid var(--line-2); }
.steps button .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #c5ccd6; display: grid; place-items: center; flex: none; }
.steps button .dot svg { width: 12px; height: 12px; stroke-width: 3; }
.steps button.past { color: var(--text-2); }
.steps button.past .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.steps button.cur { color: var(--accent); background: var(--accent-soft); }
.steps button.cur .dot { border-color: var(--accent); box-shadow: inset 0 0 0 3px #fff; background: var(--accent); }
.steps button:disabled { opacity: 1; cursor: default; }
.steps button:not(:disabled):hover { background: #f6f8fb; }
.cancelled-bar { padding: 12px 20px; border-top: 1px solid var(--line-2); background: var(--danger-soft); color: var(--danger); font-weight: 600; display: flex; gap: 10px; align-items: center; }

.olayout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; margin-top: 16px; align-items: start; }
.olayout > .side { position: sticky; top: 76px; }
.fields { display: grid; gap: 14px 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.fields .wide { grid-column: 1 / -1; }
.side .fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
.two-col { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); }

.lines { border: 1px solid var(--line); border-radius: 8px; }
.lines table { min-width: 720px; }
.lines table th { padding: 8px 8px; }
.lines table td { padding: 4px 4px; border-bottom: 1px solid var(--line-2); }
.lines table td:first-child { padding-left: 8px; }
.lines input { min-height: 34px; border-color: transparent; background: transparent; padding: 0 8px; border-radius: 6px; }
.lines input:hover { border-color: #d5dbe3; background: #fff; }
.lines input:focus { background: #fff; }
.lines td.pos { color: var(--muted); text-align: center; width: 40px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.lines tfoot td { background: #fafbfc; padding: 10px 12px; font-weight: 650; border-bottom: 0; }
.addrow { margin-top: 10px; }

.techs { display: flex; flex-direction: column; gap: 2px; }
.techs label.check { padding: 4px 6px; border-radius: 7px; }
.techs label.check:hover { background: #f5f7fa; }
.techs .role { font-size: 12px; color: var(--muted); margin-left: auto; }
/* во широк картон: техничарите во колони */
.techs.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 2px 18px; }
.radios { display: flex; flex-direction: column; gap: 2px; }
.log { list-style: none; padding: 0; margin: 0; }
.log li { position: relative; padding: 0 0 14px 20px; font-size: 13px; }
.log li::before { content: ''; position: absolute; left: 4px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-line); }
.log li::after { content: ''; position: absolute; left: 7px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.log li:last-child::after { display: none; }
.log .t { color: var(--muted); font-size: 12px; }
.log b { font-weight: 600; }

.sigview { border: 1px dashed #c5ccd6; border-radius: 8px; padding: 10px; background: #fafbfc; margin-bottom: 12px; }
.sigview img { max-width: 100%; max-height: 100px; display: block; margin-bottom: 6px; background: #fff; }
.thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #eef1f5; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button.icon { position: absolute; top: 4px; right: 4px; background: rgba(255,255,255,.9); }
.savebar { position: sticky; bottom: 0; z-index: 15; margin-top: 16px; }
.savebar-in { background: #1f2937; color: #fff; border-radius: 10px; padding: 10px 12px 10px 18px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-lg); }
.savebar-in .grow { flex: 1; font-weight: 550; }
.savebar-in button:not(.primary) { background: transparent; color: #e5e7eb; border-color: #4b5563; box-shadow: none; }
.savebar-in button:not(.primary):hover { background: #374151; }

/* шифрарници */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.split.closed { grid-template-columns: minmax(0, 1fr); }
.split > .side { position: sticky; top: 76px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1f2937; color: #fff; padding: 11px 18px; border-radius: 9px; z-index: 60;
  box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); display: flex; align-items: center; gap: 10px; font-weight: 500; }
.toast .i { color: #86efac; }
.toast.bad { background: var(--danger); }
.toast.bad .i { color: #fff; }

/* ---------- најава ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.login .brandside { background: #12223f; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login .brandside .logo { height: 46px; width: auto; align-self: flex-start; display: block; }
.login .formlogo { display: none; }
.login .brandside h2 { font-size: 30px; line-height: 1.2; font-weight: 650; color: #fff; max-width: 420px; letter-spacing: -.01em; }
.login .brandside p { color: #c3cddd; max-width: 420px; font-size: 15px; }
.login .brandside ul { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 12px; color: #dbe3ef; }
.login .brandside li { display: flex; gap: 10px; align-items: center; }
.login .brandside li .i { color: #8fb3ff; }
.login .brandside small { color: #93a1b8; }
.login .formside { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.login form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; }
.login form h1 { font-size: 24px; }
.login form .sub { color: var(--muted); margin: -6px 0 6px; }
.login form .sect { font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 8px; }
.login form button.primary { min-height: 42px; margin-top: 4px; }
.alert { background: var(--danger-soft); color: var(--danger); border-radius: 8px; padding: 10px 12px; font-weight: 500; }

/* понуди */
.qbanner { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line-2); font-weight: 550; flex-wrap: wrap; }
.qbanner > span { flex: 1; min-width: 200px; }
.qbanner .i { width: 18px; height: 18px; flex: none; }
.qbanner.ok { background: #e9f6ed; color: #136c33; }
.qbanner.bad { background: var(--danger-soft); color: var(--danger); }
.qbanner.warn { background: #fff7e6; color: #7a4300; }
.qbanner a { color: inherit; text-decoration: underline; }
.qbanner.adv { background: #ece6fb; color: #4a2a99; }
.q-comment { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid var(--line); color: var(--text-2); font-size: 13px; font-style: italic; }
.fields.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }

/* фактури */
.ipartner { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--text-2); padding: 10px 12px; background: #f6f7f9; border-radius: 8px; }
.ipartner b { font-size: 14px; color: var(--text); }
.iorders { list-style: none; margin: 0 0 4px; padding: 0; }
.iorders li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.iorders li:last-child { border-bottom: 0; }
.iorders li > span:nth-child(2) { flex: 1; min-width: 140px; }
.ibill-bar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.ibill-bar label { min-width: 150px; }
.ibill-bar label.grow { flex: 1; min-width: 220px; }
.per-inv { display: flex; gap: 6px; align-items: center; }
.per-inv input { min-width: 0; }
.per-inv button { flex: none; padding: 0 8px; }
.lines table.ilines { min-width: 940px; }
.neg { color: var(--danger); }

/* финансии */
.fin-tabs { margin-bottom: 16px; }
.fin-tabs .tabs a { display: inline-flex; align-items: center; padding: 12px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.fin-tabs .tabs a:hover { text-decoration: none; color: var(--text); }
.fin-tabs .tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.inline-date { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.inline-date input { width: auto; }
.aging tfoot td, .rep-tbl tfoot td { font-weight: 650; background: #f6f7f9; }
.card-bal { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); align-self: center; }
.card-bal b { color: var(--text); font-size: 15px; }
.seg-sm { display: inline-flex; background: #e9edf2; border-radius: 8px; padding: 3px; gap: 3px; }
.seg-sm a { padding: 6px 12px; border-radius: 6px; color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
.seg-sm a:hover { text-decoration: none; color: var(--text); }
.seg-sm a.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.comp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.comp-grid h3 { font-size: 13px; margin: 0 0 6px; color: var(--muted); }
.comp-grid input { width: 100%; }
@media (max-width: 700px) { .comp-grid { grid-template-columns: 1fr; } }
.chip.pk-in { background: #e3f4e8; color: #136c33; }
.chip.pk-out { background: #fbe9e7; color: #a12a1c; }
.chip.pk-comp { background: #ece6fb; color: #5b33b0; }
.cell-sub.paid { color: var(--ok); }
.paid { color: var(--ok); }
.bi-head { display: flex; gap: 12px 28px; flex-wrap: wrap; align-items: flex-start; font-size: 13px; }
.bi-head .lbl { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.bi-tbl td { vertical-align: top; }
.bi-tbl select { width: 100%; }
.bi-tbl tr.off td { opacity: .5; }
.bi-tbl tr.off td:first-child { opacity: 1; }
.bi-docs .chip { margin: 0 4px 4px 0; }
.lines table.sdlines { min-width: 640px; }
.lines table.sdlines select { width: 100%; }

/* ---------- тесни екрани ---------- */
/* заглавието: сите ставки од менито мора да се гледаат */
@media (max-width: 1400px) { .user .who { display: none; } }
@media (max-width: 1200px) { nav a span { display: none; } }
/* администраторот има 8 ставки */
.top-in:has(nav a:nth-child(8)) .user .who { display: none; }
@media (max-width: 1340px) { .top-in:has(nav a:nth-child(8)) nav a span { display: none; } }
/* со понудите: 9 ставки */
@media (max-width: 1500px) { .top-in:has(nav a:nth-child(9)) nav a span { display: none; } }
@media (max-width: 1720px) { .top-in:has(nav a:nth-child(10)) nav a span { display: none; } }
@media (max-width: 1900px) { .top-in:has(nav a:nth-child(11)) nav a span { display: none; } }
@media (max-width: 1100px) {
  .olayout { grid-template-columns: minmax(0, 1fr); }
  .olayout > .side { position: static; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split > .side { position: static; order: -1; }
}
@media (max-width: 900px) {
  .hide-md { display: none; }
  .user .who { display: none; }
  nav a span { display: none; }
  nav a { padding: 0 10px; }
  .top-in { gap: 12px; }
}
@media (max-width: 760px) {
  .login { grid-template-columns: minmax(0, 1fr); }
  .login .brandside { display: none; }
  .login .formside { flex-direction: column; gap: 28px; }
  .login .formlogo { display: block; height: 40px; width: auto; }
  main { padding: 16px 12px 80px; }
  .card-h .hint { display: none; }
  /* телефон: лого и корисник горе, навигацијата во свој ред */
  .top-in { padding: 8px 12px 0; flex-wrap: wrap; gap: 6px 12px; min-height: 0; }
  .brand { flex: 1; min-width: 0; max-width: none; }
  .brand img { max-width: 100%; height: 36px; object-fit: contain; }
  nav { order: 3; flex: 0 0 100%; min-height: 44px; }
  nav a { flex: 1; justify-content: center; }
  /* налозите како картички */
  table.cards thead { display: none; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards tr { padding: 12px 14px; border-bottom: 1px solid var(--line-2); display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
  table.cards td { padding: 0; border: 0; }
  table.cards td.c-st { grid-column: 2; grid-row: 1; text-align: right; }
  table.cards td.c-no { grid-column: 1; grid-row: 1; }
  table.cards td.c-cl, table.cards td.c-sub { grid-column: 1 / -1; }
  table.cards td.hide-sm { display: none; }
  table.cards td.c-due { grid-column: 1; font-size: 13px; color: var(--muted); }
  table.cards td.c-due:not(:empty)::before { content: 'Рок: '; }
  table.cards td.c-due.qv:not(:empty)::before { content: 'Важи до: '; }
  table.cards td.c-due.iv:not(:empty)::before { content: 'Датум: '; }
  table.cards td.c-amt { grid-column: 2; text-align: right; font-weight: 650; }
  table.cards td.c-who { grid-column: 2; display: flex; justify-content: flex-end; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 12px; gap: 10px; }
  .kpi .ic { width: 32px; height: 32px; }
  .ohead .no { font-size: 20px; }
  .steps { overflow: hidden; }
  .steps button { min-width: 0; font-size: 13px; padding: 0 6px; }
  .steps button.cur { flex: 2.2; }
  .steps button span.lbl { display: none; }
  .steps button.cur span.lbl { display: inline; }
}
@media print { .top, .savebar { display: none; } }
