:root {
  --bg: #f3f5f9;
  --panel: #ffffff;
  --border: #e2e6ee;
  --text: #1c2333;
  --muted: #68718a;
  --primary: #3b63f3;
  --primary-dark: #2c4ed1;
  --danger: #d64545;
  --ok: #2e9e5b;
  --warn: #d9822b;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20, 30, 60, .08), 0 4px 14px rgba(20, 30, 60, .05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}

button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

/* ---------- prijava ---------- */
#login-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #24304f 0%, #3b63f3 100%);
}
.login-box {
  background: var(--panel); border-radius: 14px; box-shadow: var(--shadow);
  padding: 36px 34px; width: 360px; max-width: calc(100vw - 32px);
}
.login-box h1 { font-size: 22px; margin-bottom: 4px; }
.login-box .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.login-alt { margin-top: 16px; text-align: center; font-size: 13.5px; }
.login-alt a { color: var(--primary); text-decoration: none; font-weight: 600; }
.login-alt a:hover { text-decoration: underline; }
.pw-hint { color: var(--muted); font-size: 12.5px; margin: -4px 0 14px; }
label.chk {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  font-size: 14px !important; font-weight: 600 !important; color: var(--text) !important;
}
label.chk input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--primary); }
.vrsta-red {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.vrsta-red:last-child { border-bottom: 0; }
.klijent-info p { margin-bottom: 6px; font-size: 14.5px; }
.kod-prikaz {
  font-family: ui-monospace, Menlo, monospace; font-size: 34px; font-weight: 700;
  letter-spacing: 8px; text-align: center; background: #f0f4ff; color: var(--primary);
  border-radius: 10px; padding: 16px 0; margin: 14px 0;
}

/* ---------- raspored ---------- */
#app { display: none; min-height: 100vh; }
#app.visible { display: flex; }

.sidebar {
  width: 220px; flex-shrink: 0; background: #1d2438; color: #cfd6e6;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
  padding: 20px 18px 16px; font-weight: 700; font-size: 17px; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .brand span { color: #7f9bff; }
.sidebar nav { padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav button {
  background: none; border: 0; color: inherit; text-align: left;
  padding: 10px 12px; border-radius: 8px; font-size: 14.5px; display: flex; gap: 10px; align-items: center;
}
.sidebar nav button:hover { background: rgba(255,255,255,.07); }
.sidebar nav button.active { background: var(--primary); color: #fff; }
.nav-badge {
  margin-left: auto; background: var(--danger); color: #fff; border-radius: 99px;
  font-size: 11.5px; font-weight: 700; padding: 1px 8px; min-width: 14px; text-align: center;
}
.nav-badge:empty { display: none; }
.sidebar .who {
  padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px;
}
.sidebar .who b { display: block; color: #fff; font-size: 14px; }
.sidebar .who button {
  margin-top: 10px; width: 100%; background: rgba(255,255,255,.1); color: #fff;
  border: 0; padding: 8px; border-radius: 7px; font-size: 13px;
}
.sidebar .who button:hover { background: rgba(255,255,255,.18); }

.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
main { flex: 1; padding: 26px 30px; min-width: 0; }

#push-banner {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 30px 0; padding: 11px 14px;
  background: #eef2ff; border: 1px solid #c9d4fb; border-radius: var(--radius);
  font-size: 14px; color: var(--text);
}
#push-banner span { flex: 1; }
#push-banner #pb-zatvori {
  background: none; border: none; color: var(--muted); font-size: 15px; line-height: 1;
}

.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 21px; margin-right: auto; }

/* ---------- dugmad / forme ---------- */
.btn {
  border: 0; border-radius: 8px; padding: 9px 16px; font-size: 14px; font-weight: 600;
  background: var(--primary); color: #fff;
}
.btn:hover { background: var(--primary-dark); }
.btn.secondary { background: #e8ecf5; color: var(--text); }
.btn.secondary:hover { background: #dde3f0; }
.btn.danger { background: #fbeaea; color: var(--danger); }
.btn.danger:hover { background: #f5d8d8; }
.btn.small { padding: 6px 11px; font-size: 13px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 11px; background: #fff; font-size: 14.5px;
}
.field textarea { resize: vertical; min-height: 74px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,99,243,.13);
}
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

select.inline-filter {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  background: #fff; font-size: 13.5px; max-width: 190px;
}
input.inline-filter {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  background: #fff; font-size: 13.5px;
}

.error-msg { color: var(--danger); font-size: 13.5px; margin-top: 10px; min-height: 18px; }

/* ---------- kanban ---------- */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.col {
  background: #eaedf4; border-radius: var(--radius); padding: 12px;
  min-height: 300px; display: flex; flex-direction: column; gap: 10px;
}
.col.dragover { outline: 2px dashed var(--primary); outline-offset: -2px; background: #e2e8f8; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 6px; }
.col-head h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.col-head .count {
  background: #fff; border-radius: 99px; font-size: 12.5px; font-weight: 700;
  padding: 2px 9px; color: var(--muted);
}
.card {
  background: var(--panel); border-radius: 9px; box-shadow: var(--shadow);
  padding: 12px 13px; cursor: grab; border-left: 4px solid transparent;
}
.card:active { cursor: grabbing; }
.card.dragging { opacity: .45; }
.card .title { font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.chip {
  border-radius: 99px; padding: 2px 9px; font-size: 11.5px; font-weight: 600; color: #fff;
}
.chip.outline { background: #eef1f7; color: var(--muted); font-weight: 500; }
.chip.pending { background: #fdf3e4; color: var(--warn); }
.chip.zakazano { background: #ece8fb; color: #6a4fd0; font-weight: 700; }
.chip.zakazano.danas { background: #6a4fd0; color: #fff; }
.badge-prio { border-radius: 5px; padding: 2px 7px; font-size: 11px; font-weight: 700; }
.prio-visok  { background: #fbeaea; color: var(--danger); }
.prio-srednji{ background: #fdf3e4; color: var(--warn); }
.prio-nizak  { background: #e8f5ec; color: var(--ok); }
.rok { font-weight: 600; }
.rok.kasni { color: var(--danger); }
.card .done-info { font-size: 12px; color: var(--ok); margin-top: 6px; font-weight: 600; }
.steps-info { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.steps-bar { flex: 1; height: 6px; background: #eef1f7; border-radius: 99px; overflow: hidden; }
.steps-bar > div { height: 100%; background: var(--ok); border-radius: 99px; transition: width .2s; }
.steps-num { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }

/* prilozi u prozoru zadatka */
.prilozi { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 14px; }
.prilozi h4 { font-size: 14.5px; margin-bottom: 10px; }
.pf-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 0;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
.pf-item:last-child { border-bottom: 0; }
.pf-item a { color: var(--primary); text-decoration: none; font-weight: 600; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-item a:hover { text-decoration: underline; }
.pf-item .muted { font-size: 12px; white-space: nowrap; }

/* koraci u prozoru zadatka */
.koraci { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 14px; }
.koraci h4 { font-size: 14.5px; margin-bottom: 10px; }
.s-lista { margin-bottom: 10px; max-height: 240px; overflow-y: auto; }
.s-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 4px;
  border-bottom: 1px solid var(--border); cursor: pointer; font-size: 14px;
}
.s-item:last-child { border-bottom: 0; }
.s-item input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--ok); flex-shrink: 0; }
.s-item.done .s-naslov { text-decoration: line-through; color: var(--muted); }
.s-naslov { flex: 1; }
.s-ko { font-size: 11.5px; white-space: nowrap; }
.s-obrisi {
  border: 0; background: none; color: var(--muted); font-size: 14px;
  padding: 2px 6px; border-radius: 5px; flex-shrink: 0;
}
.s-obrisi:hover { background: #fbeaea; color: var(--danger); }

.card-koment {
  margin-top: 8px; font-size: 12.5px; color: var(--muted);
  background: #f4f6fb; border-radius: 7px; padding: 6px 10px; line-height: 1.45;
}
.card-koment b { color: var(--text); }
.card-koment .k-vise { font-weight: 600; color: var(--primary); white-space: nowrap; }

/* komentari u prozoru zadatka */
.komentari { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 14px; }
.komentari h4 { font-size: 14.5px; margin-bottom: 10px; }
.k-lista { max-height: 220px; overflow-y: auto; margin-bottom: 10px; }
.k-item { padding: 8px 0; border-bottom: 1px solid var(--border); }
.k-item:last-child { border-bottom: 0; }
.k-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin-bottom: 3px; }
.k-tekst { font-size: 14px; white-space: pre-wrap; }
.k-input { display: flex; gap: 8px; }
.k-input input {
  flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font-size: 14px;
}
.k-input input:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,99,243,.13);
}
.empty-col { color: var(--muted); font-size: 13px; text-align: center; padding: 18px 0; }

/* ---------- tabele ---------- */
.panel { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 16px; font-size: 14px; }
th { background: #f7f9fc; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; }
tr + tr td { border-top: 1px solid var(--border); }
tr[data-open] { cursor: pointer; }
tr[data-open]:hover td { background: #f7f9fc; }
td .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.tag { border-radius: 5px; padding: 2px 8px; font-size: 12px; font-weight: 600; }
.tag.admin { background: #ece8fb; color: #6a4fd0; }
.tag.radnik { background: #e8f0fb; color: #2c62c9; }
.tag.menadzer { background: #e4f4f0; color: #1d8a6b; }
.tag.warn-tag { background: #fdf3e4; color: var(--warn); }
.tag.neaktivan { background: #f0f1f5; color: var(--muted); }

/* ---------- izveštaji ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }

/* ---------- prodaja (CRM) ---------- */
.table-scroll { overflow-x: auto; }
.crm-sekcija { margin: 22px 0 10px; font-size: 17px; }
tr[data-ponuda], tr[data-prodaja] { cursor: pointer; }
tr[data-ponuda]:hover, tr[data-prodaja]:hover { background: #f7f9fc; }
.sub-tabs { display: inline-flex; background: #e8ecf4; border-radius: 9px; padding: 3px; gap: 2px; }
.sub-tabs button { border: 0; background: none; padding: 6px 14px; border-radius: 7px; font-size: 13.5px; color: var(--muted); }
.sub-tabs button.active { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.hbar-red { display: flex; align-items: center; gap: 10px; }
.hbar-red > span { min-width: 96px; text-align: right; }
.hbar-red .hbar-track { flex: 1; }
.klijent-crm {
  background: #eef2ff; border: 1px solid #c9d4fb; border-radius: 8px;
  padding: 9px 13px; margin: -4px 0 14px; font-size: 13.5px;
}
.st-chip { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12.5px; font-weight: 600; }

/* ---------- globalna pretraga ---------- */
#q-input {
  width: 100%; padding: 11px 14px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px;
}
.q-rez { max-height: 56vh; overflow-y: auto; }
.q-grupa {
  font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); font-weight: 600; margin: 12px 0 4px;
}
.q-red { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.q-red:hover { background: #f2f5fb; }
.q-red b { font-weight: 600; font-size: 14.5px; }
.q-red .muted { font-size: 12.5px; }
.st-poslata { background: #e8edfd; color: var(--primary-dark); }
.st-prihvacena { background: #e2f4e9; color: var(--ok); }
.st-odbijena { background: #fbe5e5; color: var(--danger); }
.tile { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.tile .num { font-size: 30px; font-weight: 700; }
.tile .lbl { color: var(--muted); font-size: 13px; margin-top: 2px; }
.tile.ok .num { color: var(--ok); }
.tile.bad .num { color: var(--danger); }
.tile.warn .num { color: var(--warn); }

.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.report-box { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.report-box h3 { font-size: 15px; margin-bottom: 14px; }
.report-box.wide { grid-column: 1 / -1; }

.hbar-row { display: grid; grid-template-columns: 130px 1fr 90px; gap: 10px; align-items: center; margin-bottom: 9px; font-size: 13.5px; }
.hbar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { background: #eef1f7; border-radius: 99px; height: 14px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 99px; background: var(--primary); min-width: 2px; }
.hbar-fill.late { background: var(--danger); }
.hbar-num { color: var(--muted); font-size: 12.5px; text-align: right; }

.chart-svg { width: 100%; height: auto; display: block; }
.muted { color: var(--muted); font-size: 13.5px; }

/* ---------- čet (plutajući oblačić) ---------- */
#chat-widget { position: fixed; right: 20px; bottom: 20px; z-index: 60; }
#chat-bubble {
  width: 58px; height: 58px; border-radius: 50%; border: 0;
  background: var(--primary); color: #fff; font-size: 26px;
  box-shadow: 0 4px 16px rgba(20, 30, 60, .3); position: relative;
  transition: transform .15s;
}
#chat-bubble:hover { transform: scale(1.07); background: var(--primary-dark); }
#chat-bubble .nav-badge { position: absolute; top: -3px; right: -3px; margin: 0; border: 2px solid #fff; }
#chat-bubble.hidden { display: none; }
#chat-panel {
  position: fixed; right: 20px; bottom: 20px;
  width: 370px; height: 500px; max-height: calc(100vh - 40px); max-width: calc(100vw - 40px);
  background: var(--panel); border-radius: 14px; overflow: hidden;
  box-shadow: 0 10px 40px rgba(15, 20, 40, .3);
  display: flex; flex-direction: column;
}
#chat-panel.hidden { display: none; }
.chat-panel-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; background: #1d2438;
}
.chat-panel-head select {
  flex: 1; border: 0; border-radius: 7px; padding: 7px 9px;
  background: rgba(255,255,255,.12); color: #fff; font-size: 13.5px;
}
.chat-panel-head select option { color: var(--text); background: #fff; }
#chat-min {
  width: 30px; height: 30px; border: 0; border-radius: 7px; flex-shrink: 0;
  background: rgba(255,255,255,.12); color: #fff; font-size: 15px; font-weight: 700;
}
#chat-min:hover { background: rgba(255,255,255,.25); }
.chat-msgs {
  flex: 1; overflow-y: auto; padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.msg {
  max-width: 72%; background: #eef1f7; border-radius: 12px 12px 12px 4px;
  padding: 8px 13px; align-self: flex-start; word-wrap: break-word;
}
.msg.moja {
  background: var(--primary); color: #fff;
  border-radius: 12px 12px 4px 12px; align-self: flex-end;
}
.msg .m-head { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; font-weight: 600; }
.msg.moja .m-head { color: rgba(255,255,255,.78); }
.msg .m-text { font-size: 14.5px; white-space: pre-wrap; }
.msg .m-seen {
  font-size: 11px; text-align: right; margin-top: 3px;
  color: rgba(255,255,255,.62); cursor: pointer; letter-spacing: 1px;
}
.msg .m-seen.sve { color: #fff; font-weight: 700; }
.msg .m-seen-detail {
  font-size: 11.5px; color: rgba(255,255,255,.85); text-align: right; margin-top: 2px;
}
.msg .m-seen-detail.hidden { display: none; }
.k-item .k-seen { font-size: 11.5px; color: var(--muted); margin-top: 3px; letter-spacing: .3px; }
.k-item .k-seen.sve { color: var(--ok); }
.chat-input {
  display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--border);
}
.chat-input input {
  flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  font-size: 14.5px;
}
.chat-input input:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,99,243,.13);
}

/* ---------- obaveštenja ---------- */
.notif-list { padding: 4px 0; }
.notif-item {
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 14px; align-items: baseline;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item[data-goto] { cursor: pointer; }
.notif-item[data-goto]:hover { background: #f7f9fc; }
.notif-item.novo { background: #f0f4ff; }
.notif-item.novo .n-tekst { font-weight: 600; }
.notif-item.novo .n-tekst::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); margin-right: 9px; vertical-align: middle;
}
.n-vreme { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

/* ---------- modal ---------- */
#modal-back {
  position: fixed; inset: 0; background: rgba(15, 20, 40, .45);
  display: none; align-items: flex-start; justify-content: center; padding: 60px 16px; z-index: 80;
  overflow-y: auto;
}
#modal-back.visible { display: flex; }
.modal {
  background: var(--panel); border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.2);
  width: 520px; max-width: 100%; padding: 24px 26px;
}
.modal h3 { font-size: 18px; margin-bottom: 18px; }
.modal.wide { width: 960px; }

/* prozor zadatka: dve kolone + kartice */
.tm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; }
.tm-side {
  display: flex; flex-direction: column; min-height: 460px;
  border-left: 1px solid var(--border); padding-left: 26px;
}
.tm-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tm-tab {
  border: 0; background: #eef1f7; color: var(--muted); border-radius: 8px;
  padding: 8px 13px; font-size: 13.5px; font-weight: 700;
}
.tm-tab:hover { background: #e2e8f5; }
.tm-tab.active { background: var(--primary); color: #fff; }
.tm-tab.active .muted, .tm-tab.active span { color: rgba(255,255,255,.85); }
.tm-pane { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tm-pane.hidden { display: none; }
.tm-pane .s-lista, .tm-pane .k-lista, .tm-pane .pf-lista {
  flex: 1; overflow-y: auto; max-height: 52vh; margin-bottom: 10px;
}

/* izbor više zaduženih */
.asg-box {
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
  padding: 7px 11px; max-height: 132px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 1px;
}
.asg-box label.chk { font-weight: 500 !important; font-size: 13.5px !important; padding: 3px 0; }
.asg-box.locked { background: #f4f6fb; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal .actions .left { margin-right: auto; }

/* ---------- toast ---------- */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1d2438; color: #fff; padding: 11px 20px; border-radius: 9px;
  font-size: 14px; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .25s; z-index: 99;
}
#toast.visible { opacity: 1; }

/* ---------- telefon / tablet ---------- */
@media (max-width: 900px) {
  body { font-size: 14.5px; }
  #app.visible { flex-direction: column; }

  .sidebar {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 40;
    flex-direction: column;
  }
  .sidebar .brand { padding: 10px 14px 6px; font-size: 16px; border-bottom: 0; }
  .sidebar nav {
    flex-direction: row; flex-wrap: nowrap; overflow-x: auto;
    padding: 4px 8px 8px; gap: 4px; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .sidebar nav button {
    white-space: nowrap; padding: 8px 11px; font-size: 13.5px; flex-shrink: 0;
  }
  .nav-badge { margin-left: 6px; }
  .sidebar .who {
    display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  }
  .sidebar .who b { display: inline; font-size: 13.5px; }
  .sidebar .who > span { display: none; }
  .sidebar .who button { margin-top: 0; width: auto; margin-left: auto; padding: 6px 14px; }

  main { padding: 16px 12px; }
  #push-banner { margin: 10px 12px 0; flex-wrap: wrap; }
  .page-head { gap: 8px; }
  .page-head h2 { width: 100%; font-size: 19px; }
  select.inline-filter { max-width: 46vw; }

  .board { grid-template-columns: 1fr; }
  .col { min-height: 90px; }
  .report-grid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile .num { font-size: 24px; }

  .panel { overflow-x: auto; }
  .panel table { min-width: 560px; }

  .field-row { flex-direction: column; gap: 0; }
  #modal-back { padding: 16px 10px; }
  .modal { padding: 20px 16px; }
  .modal.wide { width: auto; }
  .tm-grid { grid-template-columns: 1fr; gap: 0; }
  .tm-side {
    border-left: 0; padding-left: 0; min-height: 0;
    border-top: 1px solid var(--border); padding-top: 14px; margin-top: 8px;
  }
  .tm-pane .s-lista, .tm-pane .k-lista, .tm-pane .pf-lista { max-height: 38vh; }

  #chat-widget { right: 14px; bottom: 14px; }
  #chat-panel {
    right: 10px; left: 10px; bottom: 10px; width: auto;
    height: min(74vh, 560px);
  }
  .msg { max-width: 88%; }
  .hbar-row { grid-template-columns: 92px 1fr 84px; font-size: 12.5px; }
}
