:root{
  --red:#A62A2E;
  --dark:#7E1F23;
  --red-soft:#faeceb;
  --bg:#f7f5f4;
  --panel:#ffffff;
  --ink:#26221f;
  --muted:#8d8681;
  --line:#ece7e3;
  --radius:14px;
  --shadow:0 1px 2px rgba(40,20,20,.04),0 8px 24px rgba(40,20,20,.05);
  --staff-nav-h:68px;
  --staff-header-h:96px;
  --safe-t:env(safe-area-inset-top,0px);
  --safe-b:env(safe-area-inset-bottom,0px);
}
*{box-sizing:border-box;margin:0;padding:0}
[hidden]{display:none!important}
body{font-family:'Segoe UI',system-ui,Arial,sans-serif;background:var(--bg);color:var(--ink);min-height:100vh}

/* ============ raspored: sidebar + sadržaj ============ */
.layout{display:flex;min-height:100vh}

.sidebar{
  width:232px;flex-shrink:0;background:var(--panel);border-right:1px solid var(--line);
  padding:22px 14px 16px;display:flex;flex-direction:column;gap:22px;
  position:sticky;top:0;height:100vh;
}
.brand{display:flex;align-items:center;gap:10px;padding:0 8px}
.brand b{color:var(--red);font-size:15px;display:block;line-height:1.2}
.brand > div > span{display:block;font-size:11px;color:var(--muted)}
.brand-ico svg{width:26px;height:26px;stroke:var(--red)}

#mainNav{display:flex;flex-direction:column;gap:2px}
#mainNav button{
  display:flex;align-items:center;gap:10px;width:100%;text-align:left;
  border:none;background:transparent;color:var(--ink);
  padding:11px 12px;border-radius:10px;cursor:pointer;font-size:14px;font-family:inherit;
  transition:background .12s,color .12s;
}
#mainNav button:hover{background:var(--bg)}
#mainNav button.active{background:var(--red-soft);color:var(--red);font-weight:600}
#mainNav button.active .ico svg{stroke:var(--red)}
#mainNav .ico svg{width:16px;height:16px;stroke:var(--muted)}

/* ============ sidebar foot + page head ============ */
.sidebar-foot{margin-top:auto;display:flex;flex-direction:column;gap:8px}
.help-link{display:block;text-align:center;font-size:13px;color:var(--muted);padding:8px 12px;border:1px solid var(--line);border-radius:10px;background:var(--bg);text-decoration:none;transition:color .12s,border-color .12s}
.help-link:hover{color:var(--red);border-color:#d8b7b6;text-decoration:none}
.user-box{display:flex;align-items:center;gap:8px;justify-content:space-between;border:1px solid var(--line);border-radius:12px;padding:9px 12px;background:var(--bg)}
.user-meta b{display:block;font-size:13px;line-height:1.3}
.role-tag{background:var(--red-soft);color:var(--dark);padding:2px 8px;border-radius:99px;font-size:10px;text-transform:uppercase;letter-spacing:.5px}
.icon-btn{border:none;background:transparent;cursor:pointer;width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center}
.icon-btn:hover{background:#f0e4e3}
.icon-btn .ico svg{width:15px;height:15px;stroke:var(--muted)}
.icon-btn:hover .ico svg{stroke:var(--red)}

main{flex:1;min-width:0;padding:26px 32px;width:100%}

.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:18px}
.page-head h2{font-size:24px;font-weight:800;letter-spacing:-.3px}
.page-head .sub{color:var(--muted);font-size:13px;margin-top:3px}

.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:20px}
@media(max-width:1000px){.stats{grid-template-columns:repeat(2,1fr)}}
.stat{background:#fff;border:1px solid var(--line);border-radius:14px;padding:14px 16px;display:flex;gap:12px;align-items:center;box-shadow:var(--shadow)}
.stat-ico{width:42px;height:42px;border-radius:12px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.stat-ico .ico svg{width:19px;height:19px}
.tone-red{background:#faecec;color:#b3362f}
.tone-blue{background:#e9f1fc;color:#2d6cc4}
.tone-orange{background:#fdf1e2;color:#c07c1f}
.tone-green{background:#e7f6ec;color:#2b8a4b}
.stat-t small{display:block;font-size:11.5px;color:var(--muted)}
.stat-t b{font-size:20px;line-height:1.25}
.stat-t > span{display:block;font-size:11px;color:var(--muted)}

.brand-tile{width:38px;height:38px;border-radius:11px;background:var(--red-soft);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.brand-tile .ico svg{width:20px;height:20px;stroke:var(--red)}

.nav-badge{margin-left:auto;background:var(--bg);border:1px solid var(--line);color:var(--muted);border-radius:99px;font-size:11px;padding:1px 8px;min-width:26px;text-align:center}
#mainNav button.active .nav-badge{background:#fff;color:var(--red);border-color:#efd4d3}
.nav-badge:empty{display:none}

.filter-bar{display:flex;gap:10px;margin-bottom:16px}
.search-box{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid var(--line);border-radius:10px;padding:0 12px;height:38px;width:min(320px,100%)}
.search-box .ico svg{width:15px;height:15px;stroke:var(--muted)}
.search-box input{border:none;outline:none;font-size:13.5px;flex:1;background:transparent;font-family:inherit;color:var(--ink)}

.cell-line{display:flex;align-items:center;gap:6px;font-size:11.5px;margin-top:7px;font-weight:600}
.cdot{width:8px;height:8px;border-radius:50%;display:inline-block;flex-shrink:0}
.cdot.ok{background:#2b8a4b}.cdot.part{background:#e09a2f}.cdot.none{background:#d3cdc9}
.cell-times{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px}
.tchip{background:var(--bg);border:1px solid var(--line);border-radius:6px;font-size:10px;padding:2px 6px;color:var(--muted)}
.legend{display:flex;gap:18px;align-items:center;margin-top:14px;font-size:12px;color:var(--muted);flex-wrap:wrap}
.legend span{display:flex;align-items:center;gap:6px}

.badge-ok{position:absolute;top:12px;right:12px;background:#e7f6ec;color:#2b8a4b;font-size:11px;padding:2px 9px;border-radius:99px}
.doc-card{position:relative}
.doc-card .meta{font-size:11.5px;color:var(--muted);margin-bottom:8px}

.token-chips{display:flex;flex-wrap:wrap;gap:5px;margin:6px 0}
.token-chips button{border:1px solid var(--line);background:var(--bg);border-radius:7px;font-size:11px;padding:3px 8px;cursor:pointer;color:var(--ink);font-family:inherit}
.token-chips button:hover{border-color:#d8b7b6;color:var(--red)}

.date-badge .tm{font-size:10px;opacity:.85;margin-top:2px}
.ph-sm{width:46px;height:46px;border-radius:50%;background:var(--bg);overflow:hidden;flex-shrink:0;display:flex;align-items:center;justify-content:center}
.ph-sm img{width:100%;height:100%;object-fit:cover;object-position:top}
.fmt-quick{display:flex;gap:5px}
.btn.sq{height:34px;padding:0 9px;font-size:11px;border-radius:8px}

/* ============ zajedničko ============ */
h2{font-size:19px}
h3{font-size:15px;margin-bottom:12px}
.hint{color:var(--muted);font-size:13px;margin-top:10px;line-height:1.5}
.view{display:none}
.view.active{display:block}
.view-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-bottom:18px}
.view-head.end{justify-content:flex-end}
.hint.no-top{margin-top:0}
.head-actions{display:flex;gap:8px;flex-wrap:wrap}
.chk{font-size:13px;color:var(--muted);display:flex;align-items:center;gap:7px;cursor:pointer}
.chk input{width:auto!important;margin:0!important;flex-shrink:0}
code{background:#f1ebe8;border-radius:4px;padding:1px 5px;font-size:12px}

.ico{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;line-height:0}
.ico svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.85;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}

/* ---------- dugmad (jednaka visina svuda) ---------- */
.btn{
  border:1px solid var(--line);background:#fff;color:var(--ink);
  height:38px;padding:0 16px;border-radius:10px;cursor:pointer;font-size:13.5px;font-family:inherit;
  display:inline-flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap;
  transition:border-color .12s,background .12s,color .12s;
}
.btn:hover{border-color:#d8b7b6;color:var(--red)}
.btn.primary{background:var(--red);border-color:var(--red);color:#fff;font-weight:600}
.btn.primary:hover{background:var(--dark);color:#fff}
.btn.danger{color:#b3261e;border-color:#eccfcd}
.btn.danger:hover{background:#b3261e;color:#fff;border-color:#b3261e}
.file-btn{position:relative;overflow:hidden}

/* ---------- paneli i forme ---------- */
.panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow)}
.panel.narrow{max-width:560px}
.panel .btn{margin-top:8px}
.panel > .btn,.panel > label.btn{width:100%;justify-content:center}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start}
@media(max-width:900px){.grid2{grid-template-columns:1fr}}

label{display:block;font-size:12.5px;color:var(--muted);margin-bottom:11px}
label input,label textarea,select,.add-row input{
  display:block;width:100%;margin-top:5px;padding:9px 11px;
  border:1px solid var(--line);border-radius:9px;font-size:14px;font-family:inherit;background:#fff;color:var(--ink);
}
label input:focus,label textarea:focus,select:focus{outline:2px solid #e5c2c1;border-color:#d8b7b6}
label input[type=color]{padding:3px;height:38px;cursor:pointer}
label input[type=file]{padding:6px}
label small{display:block;margin-top:4px;font-size:11px;line-height:1.4}
textarea{resize:vertical}
.row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.color-grid{display:grid;grid-template-columns:1fr 1fr;gap:4px 10px}
.color-grid input[type=color]{height:34px}
.sub-h{font-size:11px;text-transform:uppercase;letter-spacing:1px;color:var(--muted);margin:16px 0 8px;font-weight:600}
input[type=range]{width:100%;accent-color:var(--red);margin-top:6px}
.logo-preview{max-height:60px;max-width:220px;margin-bottom:10px;background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:6px}
.photo-preview{
  display:block;max-width:100%;max-height:140px;width:auto;height:auto;object-fit:contain;
  margin-bottom:10px;background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:6px;
}

/* ---------- pod-tabovi postavki ---------- */
.sub-tabs{display:flex;gap:6px;margin-bottom:18px;flex-wrap:wrap}
.sub-tabs button{
  border:1px solid var(--line);background:#fff;color:var(--ink);
  height:34px;padding:0 16px;border-radius:99px;cursor:pointer;font-size:13px;font-family:inherit;
  display:inline-flex;align-items:center;
}
.sub-tabs button.active{background:var(--red);border-color:var(--red);color:#fff;font-weight:600}
.sub-tabs button:hover:not(.active){border-color:#d8b7b6;color:var(--red)}
.set-view{display:none}
.set-view.active{display:block}

/* ---------- kalendar ---------- */
.cal-nav{
  display:grid;grid-template-columns:44px 1fr 44px;align-items:center;gap:8px;
  width:100%;max-width:100%;
}
.cal-nav h3{margin:0;grid-column:2;text-align:center;font-size:15px;font-weight:700;min-width:0}
.cal-nav .btn{
  width:44px;height:44px;padding:0;font-size:20px;line-height:1;
  flex:none;justify-self:center;
}
.cal-nav #calPrev{grid-column:1}
.cal-nav #calNext{grid-column:3}
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:7px}
.dow{text-align:center;font-size:11px;color:var(--muted);padding:4px 0;text-transform:uppercase;letter-spacing:1px}
.cal-cell{
  background:var(--panel);border:1px solid var(--line);border-radius:12px;
  min-height:94px;padding:8px;cursor:pointer;position:relative;
  transition:border-color .12s,box-shadow .12s;
}
.cal-cell:hover{border-color:#d8b7b6;box-shadow:var(--shadow)}
.cal-cell.empty{background:transparent;border:none;cursor:default;box-shadow:none}
.cal-cell.today{border:2px solid var(--red)}
.cal-cell .dnum{font-size:12px;font-weight:600;color:var(--muted)}
.cal-cell.today .dnum{color:var(--red)}
.chip{display:block;background:var(--red-soft);color:var(--dark);border-radius:6px;font-size:11px;padding:3px 7px;margin-top:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ---------- doktori ---------- */
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(205px,1fr));gap:14px}
.doc-card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:18px 16px;text-align:center;box-shadow:var(--shadow)}
.doc-card .ph{width:104px;height:104px;border-radius:50%;background:var(--bg);margin:0 auto 12px;overflow:hidden;display:flex;align-items:center;justify-content:center}
.doc-card .ph img{width:100%;height:100%;object-fit:cover;object-position:top}
.doc-card .ph .ico svg{width:46px;height:46px;stroke:#d3b4b3}
.doc-card .nm{font-weight:700;font-size:14.5px}
.doc-card .tt{font-size:11.5px;color:var(--muted)}
.doc-card .sp{color:var(--red);font-size:13px;margin:2px 0 10px}
.doc-card .actions{display:flex;gap:6px;justify-content:center;margin-top:4px}
.doc-pager{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;margin-top:18px;padding-top:14px;border-top:1px solid var(--line)}
.doc-pager-info{font-size:13px;font-weight:600;min-width:56px;text-align:center}
.doc-pager-total{font-size:12px;color:var(--muted);margin-left:4px}
.empty-msg{color:var(--muted);padding:36px 20px;text-align:center;background:var(--panel);border:1px dashed var(--line);border-radius:var(--radius);grid-column:1/-1}

/* ---------- objave ---------- */
.objave-toolbar{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  margin-bottom:14px;padding:10px 12px;background:var(--panel);border:1px solid var(--line);border-radius:12px;
}
.objave-filter{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--ink);font-weight:500;cursor:pointer}
.objave-filter input{width:16px;height:16px;accent-color:var(--red)}
.objave-count{font-size:12px;color:var(--muted);font-weight:600;white-space:nowrap}
.objave-head-desktop .chk{display:none}
.post-list{min-width:0}
.post-row{
  background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);
  padding:0;margin-bottom:10px;display:flex;flex-direction:column;box-shadow:var(--shadow);overflow:hidden;
}
.post-row-main{
  display:flex;align-items:center;gap:12px;padding:12px 14px;cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.post-row-actions{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  padding:0 14px 12px;border-top:1px solid var(--line);background:var(--bg,#faf9f8);
}
.post-row-chev{display:none}
.post-row .date-badge{background:linear-gradient(180deg,var(--red),var(--dark));color:#fff;border-radius:11px;padding:8px 10px;text-align:center;min-width:72px;flex-shrink:0}
.post-row .date-badge .dw{font-size:9.5px;letter-spacing:1px;opacity:.85}
.post-row .date-badge .dt{font-size:16px;font-weight:800;line-height:1.1}
.post-row .date-badge .tm{font-size:10px;opacity:.9;margin-top:2px}
.post-row .who{flex:1;min-width:0}
.post-row .who b{display:block;font-size:14px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.post-row .who span{display:block;font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.post-row .time{font-size:12.5px;color:var(--muted)}

/* ---------- korisnici ---------- */
.user-row{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:11px;padding:9px 13px;margin-bottom:8px;background:#fff}
.user-row b{flex:1;font-size:13.5px}
.user-row .btn{margin:0;height:32px;padding:0 10px}

/* ---------- modali ---------- */
.overlay{position:fixed;inset:0;background:rgba(35,18,16,.45);z-index:30;backdrop-filter:blur(2px)}
.overlay.tech-layer,.modal.tech-layer{z-index:110}
.modal.tech-layer{z-index:111}
.modal{
  position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:40;background:#fff;border-radius:18px;
  padding:22px;width:min(520px,94vw);max-height:92vh;overflow:auto;box-shadow:0 24px 70px rgba(40,10,10,.28);
}
.modal.wide{width:min(780px,96vw)}
#modal-editor{width:min(1040px,97vw)}
.modal h3{margin-bottom:14px}
.modal-form{
  display:flex;flex-direction:column;padding:0;overflow:hidden;
  max-height:min(92dvh,calc(100dvh - 24px));
}
.modal-form-head{padding:22px 22px 0;flex-shrink:0}
.modal-form-body{
  flex:1;min-height:0;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;
  padding:14px 22px 8px;
}
.modal-form .modal-form-head h3{margin-bottom:0}
.modal-form .modal-actions{
  flex-shrink:0;margin-top:0;padding:12px 22px 22px;
  background:#fff;border-top:1px solid var(--line);
}
.modal-actions{display:flex;gap:8px;margin-top:16px;align-items:center;flex-wrap:wrap}
.modal-actions-stack .spacer{flex:1;min-width:8px}
.spacer{flex:1}
.add-row{display:grid;grid-template-columns:1.2fr 1fr auto;gap:8px;margin-top:12px}
.day-entry{display:flex;align-items:center;gap:10px;padding:9px 12px;border:1px solid var(--line);border-radius:11px;margin-bottom:8px}
.day-entry b{flex:1;font-size:13.5px}
.day-entry .t{font-size:12px;color:var(--muted)}

/* ---------- pregled objave ---------- */
.fmt-tabs{display:flex;gap:6px;margin-bottom:12px;flex-wrap:wrap}
.fmt-tab,.ed-tab{border:1px solid var(--line);background:#fff;height:32px;padding:0 14px;border-radius:99px;cursor:pointer;font-size:13px;color:var(--ink);font-family:inherit;display:inline-flex;align-items:center}
.fmt-tab.active,.ed-tab.active{background:var(--red);border-color:var(--red);color:#fff}
.preview-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.preview-toolbar .fmt-tabs{margin-bottom:0}
.canvas-holder{display:flex;justify-content:center;align-items:flex-start;background:#efeae7;border-radius:12px;padding:14px;min-height:200px;max-height:62vh;overflow:auto}
.canvas-holder canvas{max-width:none;max-height:none;box-shadow:0 8px 30px rgba(0,0,0,.18);border-radius:4px;display:block;flex-shrink:0}
.caption-box{display:flex;gap:8px;margin-top:12px;align-items:stretch}
.caption-box textarea{flex:1;border:1px solid var(--line);border-radius:9px;padding:9px;font-size:13px;font-family:inherit}
.caption-box .btn{align-self:center}

/* ---------- editor šablona (pun ekran) ---------- */
.ed-shell{
  flex:1;min-width:0;display:flex;flex-direction:column;padding:18px 22px 14px;
  background:var(--bg);overflow:hidden;height:100vh;position:sticky;top:0;
}
.layout.editor-open main{display:none}
.layout.editor-open .ed-shell{display:flex!important}
.ed-top{display:flex;align-items:flex-start;gap:14px;flex-wrap:wrap;margin-bottom:12px}
.ed-back{font-size:13px}
.ed-title{flex:1;min-width:200px}
.ed-title h2{font-size:22px;font-weight:800;margin:0}
.ed-toolbar-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.ed-fmt-tabs{display:flex;gap:6px;flex-wrap:wrap}
.ed-zoom-tools{display:flex;align-items:center;gap:4px;background:#fff;border:1px solid var(--line);border-radius:10px;padding:4px 8px}
.ed-zoom-lbl{font-size:12px;color:var(--muted);min-width:42px;text-align:center}
.ed-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(240px,280px) minmax(280px,320px);gap:12px;flex:1;min-height:0}
@media(max-width:1280px){.ed-grid{grid-template-columns:minmax(0,1fr) minmax(220px,260px)}}
@media(max-width:960px){.ed-grid{grid-template-columns:1fr;overflow-y:auto}}
.ed-canvas-col{display:flex;flex-direction:column;min-height:0;gap:8px}
.ed-canvas-wrap{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}
.ed-canvas{background:#efeae7;border-radius:12px;padding:12px;display:flex;justify-content:center;align-items:flex-start;overflow:auto;flex:1;min-height:280px;max-height:calc(100vh - 280px)}
.ed-canvas canvas{max-width:none;max-height:none;box-shadow:0 8px 30px rgba(0,0,0,.18);border-radius:4px;cursor:move;touch-action:none;display:block;flex-shrink:0}
.ed-float-bar{
  position:absolute;display:flex;gap:2px;background:#fff;border:1px solid var(--line);
  border-radius:10px;padding:4px;box-shadow:0 6px 20px rgba(0,0,0,.12);z-index:5;
}
.ed-float-bar .icon-btn{width:32px;height:32px}
.ed-float-bar .danger-ico:hover{background:#fdecea}
.ed-float-bar .danger-ico:hover .ico svg{stroke:#b3261e}
.ed-add-panel{
  position:absolute;left:16px;bottom:16px;z-index:8;width:min(320px,90%);
  background:#fff;border:1px solid var(--line);border-radius:16px;padding:14px;
  box-shadow:0 16px 48px rgba(40,20,20,.18);
}
.ed-add-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.ed-add-head b{font-size:14px}
.ed-add-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.ed-add-grid button{
  border:1px solid var(--line);background:var(--bg);border-radius:12px;padding:14px 8px;
  cursor:pointer;font-family:inherit;font-size:12px;color:var(--ink);
  display:flex;flex-direction:column;align-items:center;gap:8px;transition:.15s;
}
.ed-add-grid button:hover{border-color:var(--red);background:var(--red-soft);transform:translateY(-1px)}
.ed-add-grid button .ico svg{width:22px;height:22px;stroke:var(--red)}
.ed-add-hint{margin:12px 0 0;font-size:11px;line-height:1.45}
.ed-canvas canvas{cursor:default}
.ed-canvas-foot{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:2px 0}
.ed-guides-chk{margin-left:auto}
.ed-layers,.ed-props{display:flex;flex-direction:column;min-height:0;max-height:100%;overflow:hidden;padding:14px}
.ed-sec-title{font-size:12px;text-transform:uppercase;letter-spacing:.8px;color:var(--muted);margin-bottom:8px;font-weight:700}
.ed-sec-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.ed-sec-head .ed-sec-title{margin-bottom:0}
.ed-sec-head .btn.sm{height:26px;padding:0 10px;font-size:11px}
.ed-sec-sub{font-size:11px;text-transform:uppercase;letter-spacing:.8px;color:var(--muted);margin:14px 0 8px;font-weight:600}
.ed-layer-list{display:flex;flex-direction:column;gap:6px;overflow-y:auto;flex:1;min-height:120px;padding-right:4px}
.ed-layer{
  display:grid;grid-template-columns:28px minmax(0,1fr);grid-template-areas:"ico name" "acts acts";
  gap:4px 8px;padding:8px 10px;border:1px solid var(--line);
  border-radius:10px;background:#fff;cursor:pointer;font-size:13px;transition:border-color .12s,background .12s;
  align-items:center;
}
.ed-layer:hover{border-color:#d8c4c2}
.ed-layer.active{border-color:var(--red);background:var(--red-soft)}
.ed-layer .ly-ico{grid-area:ico;width:28px;height:28px;border-radius:8px;background:var(--bg);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.ed-layer .ly-ico .ico svg{width:14px;height:14px;stroke:var(--muted)}
.ed-layer .ly-name{grid-area:name;min-width:0;display:flex;flex-direction:column;gap:2px;line-height:1.25}
.ed-layer .ly-hidden-tag{font-size:10px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.3px}
.ed-layer .ly-actions{
  grid-area:acts;display:flex;gap:4px;flex-shrink:0;align-items:center;justify-content:flex-end;
  padding-top:6px;margin-top:2px;border-top:1px solid var(--line);width:100%;
}
.ed-layer .ly-actions .icon-btn{width:28px;height:28px;flex-shrink:0}
.ed-layer .ly-actions .ly-del.danger-ico .ico svg{stroke:#b3261e}
.ed-layer .ly-actions .ly-order .ico svg{width:13px;height:13px}
.ed-layer .ly-actions .ly-order:disabled{opacity:.35;pointer-events:none}
.ed-layer[draggable="true"]{cursor:grab}
.ed-layer.dragging{opacity:.45;cursor:grabbing}
.ed-layer.drag-over{border-color:var(--red);background:var(--red-soft)}
.ed-layer.hidden-el{opacity:.72;background:#faf9f8}
.ed-layer.hidden-el .ly-hidden-tag{color:#b3261e}
.ed-add-btn{width:100%;justify-content:center;margin-top:8px}
.ed-quick-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:6px}
.ed-quick-grid button{
  border:1px solid var(--line);background:#fff;border-radius:10px;padding:10px 8px;cursor:pointer;
  font-size:12px;font-family:inherit;color:var(--ink);display:flex;flex-direction:column;align-items:center;gap:6px;
}
.ed-quick-grid button:hover{border-color:#d8c4c2;background:var(--red-soft)}
.ed-quick-grid button .ico svg{width:18px;height:18px;stroke:var(--red)}
.ed-props-head{margin-bottom:10px;padding-bottom:10px;border-bottom:1px solid var(--line)}
.ed-props-head h3{font-size:14px;text-transform:uppercase;letter-spacing:.5px;margin:0}
.ed-props-body{flex:1;overflow-y:auto;padding-right:4px;display:flex;flex-direction:column;gap:10px}
.ed-props-body label{font-size:12.5px}
.ed-props-body .row{gap:8px}
.ed-props-foot{display:flex;gap:8px;padding-top:12px;border-top:1px solid var(--line);margin-top:auto}
.ed-props-foot .btn{flex:1;justify-content:center}
.ed-props-foot .btn.primary{flex:1.2}
.ed-field-group{border:1px solid var(--line);border-radius:10px;padding:10px;background:var(--bg)}
.ed-field-group > b{display:block;font-size:11px;text-transform:uppercase;letter-spacing:.6px;color:var(--muted);margin-bottom:8px}
.ed-seg{display:flex;gap:4px}
.ed-seg button{
  flex:1;border:1px solid var(--line);background:#fff;height:34px;border-radius:8px;cursor:pointer;
  font-size:12px;font-family:inherit;color:var(--ink);
}
.ed-seg button.active{background:var(--red-soft);border-color:var(--red);color:var(--red);font-weight:600}
.ed-char{font-size:11px;color:var(--muted);text-align:right;margin-top:2px}
.color-hex-row{display:flex;align-items:center;gap:8px}
.color-preview{width:34px;height:34px;border-radius:8px;border:1px solid var(--line);flex-shrink:0}
.color-hex{flex:1;font-family:ui-monospace,Consolas,monospace;font-size:13px}
.ed-save-row{display:flex;justify-content:flex-end;padding-top:8px}
.ed-history-pop{
  position:fixed;z-index:70;background:#fff;border:1px solid var(--line);border-radius:12px;
  box-shadow:0 12px 40px rgba(0,0,0,.15);width:min(320px,92vw);max-height:360px;overflow-y:auto;padding:8px;
}
.ed-history-pop button{
  display:block;width:100%;text-align:left;border:none;background:transparent;padding:10px 12px;
  border-radius:8px;cursor:pointer;font-size:13px;font-family:inherit;color:var(--ink);
}
.ed-history-pop button:hover{background:var(--bg)}
.ed-history-pop button.active{background:var(--red-soft);color:var(--red)}

/* ---------- editor (legacy) ---------- */

/* ---------- prijava (staff PWA) ---------- */
#authScreen[hidden]{display:none!important}
.staff-auth-screen{
  position:fixed;inset:0;z-index:100;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(160deg,#faf6f5 0%,#f0dcdb 55%,#ebe2e0 100%);
  padding:max(16px,var(--safe-t)) 16px max(16px,var(--safe-b));overflow:hidden;
  font-family:'Poppins',system-ui,sans-serif;
}
.staff-auth-corner{
  position:absolute;top:-12vh;right:-14vw;width:min(52vw,240px);height:min(52vw,240px);
  border-radius:50%;border:5vw solid var(--red);opacity:.92;pointer-events:none;
}
.staff-auth-inner{width:100%;max-width:400px;animation:staffFadeUp .45s ease}
.staff-auth-card{
  background:#fff;padding:28px 24px 20px;border-radius:20px;
  box-shadow:0 24px 70px rgba(90,20,20,.16);border:1px solid rgba(236,231,227,.8);
}
.staff-auth-brand{text-align:center;margin-bottom:22px}
.staff-auth-logo{width:min(220px,78%);height:auto;margin:0 auto 10px;display:block;object-fit:contain}
.staff-auth-tagline{font-size:12px;color:var(--muted);line-height:1.4}
.staff-auth-card h2{font-size:20px;font-weight:800;text-align:center;margin-bottom:6px}
.staff-auth-lead{font-size:13px;color:var(--muted);text-align:center;line-height:1.5;margin-bottom:18px}
.staff-auth-form{display:flex;flex-direction:column;gap:2px}
.staff-field{display:block;margin-bottom:12px}
.staff-field-lbl{display:block;font-size:12px;font-weight:600;color:var(--muted);margin-bottom:6px}
.staff-field input{
  width:100%;padding:13px 14px;border:1px solid var(--line);border-radius:12px;
  font:inherit;font-size:15px;background:#fff;
}
.staff-field input:focus{outline:none;border-color:#d8b7b6;box-shadow:0 0 0 3px rgba(166,42,46,.1)}
.staff-pass-wrap{position:relative}
.staff-pass-wrap input{padding-right:48px}
.staff-pass-toggle{
  position:absolute;right:4px;top:50%;transform:translateY(-50%);
  width:40px;height:40px;border:none;background:transparent;cursor:pointer;font-size:16px;
}
.staff-auth-err{
  color:#b3261e;font-size:13px;line-height:1.4;margin:4px 0 8px;
  padding:10px 12px;background:#fdf0f0;border-radius:10px;border:1px solid #f0d0d0;
}
.staff-auth-err:empty{display:none;padding:0;border:none;background:transparent;margin:0}
.staff-auth-tech-ok{
  color:#1b6b38;font-size:13px;text-align:center;line-height:1.45;
  margin:0 0 12px;padding:10px 12px;background:#edf7f0;border-radius:10px;border:1px solid #c8e6d0;
}
.staff-auth-tech-ok[hidden]{display:none!important}
.staff-auth-foot{text-align:center;font-size:11px;color:var(--muted);margin-top:16px}
.staff-auth-screen .btn.full{height:48px;border-radius:12px;font-size:15px;width:100%;justify-content:center}
.staff-auth-screen .auth-tech{margin-top:10px;text-align:center}

body.auth-locked{overflow:hidden;position:fixed;inset:0;width:100%;height:100dvh;touch-action:none}
body.staff-app{-webkit-font-smoothing:antialiased;overscroll-behavior:none}

.staff-app-header,.staff-bottom-nav{display:none}
@keyframes staffFadeUp{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}

@media(max-width:820px){
  body.staff-app{font-family:'Poppins',system-ui,sans-serif}
  body.staff-app .staff-app-shell{
    max-width:480px;width:100%;margin:0 auto;
    border-left:1px solid var(--line);border-right:1px solid var(--line);
    box-shadow:0 0 48px rgba(0,0,0,.05);min-height:100dvh;
  }
  .layout{flex-direction:column}
  .sidebar{display:none}
  main{
    padding:calc(var(--staff-header-h) + var(--safe-t) + 8px) 16px calc(var(--staff-nav-h) + var(--safe-b) + 24px);
    min-height:100dvh;-webkit-overflow-scrolling:touch;
  }
  .page-head{display:flex;flex-direction:column;gap:10px;margin-bottom:14px}
  .page-head .head-actions{display:flex;flex-wrap:wrap}
  .page-head .head-actions .chk{width:100%;flex:none;font-size:13px;margin:0}
  .page-head .head-actions .file-btn{flex:1;min-width:calc(50% - 4px)}
  .page-head .head-actions .btn.sm{flex:1;min-width:calc(50% - 4px);height:40px}
  #view-dashboard .dash-date{display:none}
  #view-dashboard .page-head .head-actions .btn{flex:1}
  #view-doktori .cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  #view-doktori .doc-card{padding:14px 10px}
  #view-doktori .doc-card .ph{width:72px;height:72px;margin-bottom:10px}
  #view-doktori .doc-card .nm{font-size:13px}
  #view-doktori .doc-card .actions{flex-direction:column;gap:6px}
  #view-doktori .doc-card .actions .btn{width:100%;height:38px;font-size:12px}
  #view-doktori .filter-bar{align-items:stretch}
  #view-doktori .search-box{flex:1;min-width:100%}
  #view-doktori .view-toggle{margin-left:auto}
  #view-objave #statsObjave{display:none}
  #view-objave .objave-head-desktop{display:none}
  #view-objave .objave-toolbar{margin-bottom:12px;border-radius:14px}
  #view-objave .objave-grid{
    display:grid!important;grid-template-columns:minmax(0,1fr);gap:10px;
    width:100%;align-items:stretch;
  }
  #view-objave .objave-grid > #postList,
  #view-objave .objave-grid > .post-sidebox{
    grid-column:1;width:100%;max-width:100%;min-width:0;
  }
  #view-objave .post-list{
    display:flex;flex-direction:column;gap:8px;width:100%;
  }
  #view-objave .post-sidebox{
    order:-1;margin:0;border-radius:16px;padding:14px;
    border:1px solid var(--line);background:var(--panel);box-shadow:var(--shadow);
    box-sizing:border-box;
  }
  #view-objave .post-sidebox:not(.has-selection){opacity:.92}
  #view-objave .post-sidebox .sb-head{margin-bottom:10px}
  #view-objave .sb-head-txt h3{margin:0;font-size:15px}
  #view-objave .sb-meta{font-size:12px;color:var(--muted);margin:4px 0 0;line-height:1.4}
  #view-objave .sb-fmt{
    display:grid;grid-template-columns:repeat(3,1fr);gap:0;width:100%;
    margin-bottom:12px;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--bg);
  }
  #view-objave .sb-fmt .btn{
    height:40px;border:none;border-radius:0;background:transparent;font-size:13px;font-weight:600;
    box-shadow:none;
  }
  #view-objave .sb-fmt .btn:not(:last-child){border-right:1px solid var(--line)}
  #view-objave .sb-fmt .btn.active{background:var(--red);color:#fff}
  #view-objave .sb-canvas{min-height:0;border-radius:14px}
  #view-objave .sb-empty-hint{text-align:center;padding:24px 12px}
  #view-objave .sb-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}
  #view-objave .sb-actions .btn{width:100%;height:44px;justify-content:center}
  #view-objave .sb-actions .btn.admin-only{grid-column:1 / -1}
  #view-objave .post-row{
    border-radius:16px;margin-bottom:0;width:100%;box-sizing:border-box;
    border:1px solid var(--line);box-shadow:var(--shadow);
  }
  #view-objave .post-row-main{padding:12px}
  #view-objave .post-row-chev{
    display:block;color:var(--muted);font-size:22px;line-height:1;flex-shrink:0;margin-left:2px;
  }
  #view-objave .post-row.sel{border-color:var(--red);box-shadow:0 0 0 1px var(--red)}
  #view-objave .post-row.sel .post-row-main{background:var(--red-soft,#fbeaea)}
  #view-objave .post-row-actions{display:none}
  #view-objave .post-list .empty-msg{border-radius:16px;padding:28px 16px}
  #view-zakazivanje #statsZakazivanje{display:none}
  #view-zakazivanje .appt-filter-bar{margin-bottom:10px}
  #view-zakazivanje .appt-table-panel .panel-head{margin-bottom:8px}
  #view-pacijenti #statsPacijenti{display:none}
  #view-pacijenti .patient-table-panel .panel-head{margin-bottom:8px}
  .appt-accordion{display:flex;flex-direction:column;gap:8px}
  .appt-card{border:1px solid var(--line);border-radius:14px;background:var(--panel);overflow:hidden;box-shadow:var(--shadow)}
  .appt-card-head{
    display:flex;align-items:center;gap:10px;width:100%;padding:12px 14px;
    border:none;background:transparent;cursor:pointer;text-align:left;font:inherit;
    -webkit-tap-highlight-color:transparent;
  }
  .appt-card-main{flex:1;min-width:0}
  .appt-card-main b{display:block;font-size:14px;font-weight:700;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .appt-card-main span{display:block;font-size:12px;color:var(--muted);margin-top:2px}
  .appt-card .appt-status{flex-shrink:0;font-size:11px}
  .appt-card-chev{color:var(--muted);font-size:20px;line-height:1;flex-shrink:0;transition:transform .2s}
  .appt-card.open .appt-card-chev{transform:rotate(90deg)}
  .appt-card-body{padding:0 14px 12px;border-top:1px solid var(--line);background:var(--bg,#faf9f8)}
  .appt-card-rows{display:grid;gap:6px;padding:10px 0}
  .appt-card-row{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:13px}
  .appt-card-row span{color:var(--muted);font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.35px;flex-shrink:0}
  .appt-card-row b{text-align:right;word-break:break-word}
  .appt-card-actions{display:flex;gap:8px;padding-top:2px}
  .appt-card-actions .btn{flex:1;min-width:0;height:40px;justify-content:center;font-size:12px}
  .appt-empty{text-align:center;padding:22px 12px;color:var(--muted);font-size:13px;margin:0}

  #view-tvmodul #statsTvmodul{display:none}
  #view-tvmodul .page-head .head-actions .btn{flex:1 1 calc(50% - 4px);min-width:0;font-size:12px;padding:0 10px}
  #view-tvmodul .page-head .head-actions .btn.primary{flex:1 1 100%}
  #view-tvmodul .tv-dev{flex-wrap:wrap;align-items:flex-start;padding:12px}
  #view-tvmodul .tv-dev-info{width:calc(100% - 50px)}
  #view-tvmodul .tv-dev-actions{width:100%;margin-top:8px}
  #view-tvmodul .tv-dev-actions .btn{flex:1;justify-content:center;height:38px;font-size:12px}
  #view-tvmodul .tv-add-row{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;width:100%}
  #view-tvmodul .tv-add-row .btn{flex:none;width:100%;height:40px;font-size:11px;padding:0 6px}
  #view-tvmodul .tv-item{flex-wrap:wrap;padding:10px;gap:6px}
  #view-tvmodul .tv-item b{width:100%;white-space:normal;font-size:12px}
  #view-tvmodul .tv-item .tv-dur{width:56px}
  #view-tvmodul .pair-row{flex-direction:column;align-items:stretch}
  #view-tvmodul .pair-row .btn{width:100%}
  #view-tvmodul .pair-code{font-size:28px;letter-spacing:6px}
  #view-tvmodul .pair-code-input{width:100%;font-size:20px;letter-spacing:6px}
  #view-tvmodul .tv-frame{padding:8px 8px 14px;border-radius:14px}
  #view-postavke .sub-tabs{
    flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;
    margin:0 -4px 14px;padding:0 4px 6px;scrollbar-width:none;
  }
  #view-postavke .sub-tabs::-webkit-scrollbar{display:none}
  #view-postavke .sub-tabs button{flex-shrink:0}
  #view-postavke .tpl-actions{flex-direction:column}
  #view-postavke .tpl-actions .btn{width:100%}
  #view-postavke .panel.narrow{max-width:none}
  #view-tehnicki .page-head{flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:space-between}
  #view-tehnicki .page-head .btn{width:auto;flex:none;height:40px}
  #view-tehnicki .tech-banner{flex-direction:column;text-align:center;align-items:center}
  #view-tehnicki .tech-btns{flex-direction:column;width:100%}
  #view-tehnicki .tech-btns .btn{width:100%}
  #view-tehnicki .grid2 .panel .btn{width:100%;justify-content:center}
  #view-tehnicki .grid2 .panel .file-btn{width:100%}
  .grid2{grid-template-columns:1fr!important}
  .panel-head{flex-wrap:wrap;gap:8px}
  .panel-head .btn.sm{width:100%;justify-content:center}
  .doc-table-wrap,.appt-table-wrap,.patient-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:0 -4px;padding:0 4px}
  .day-entry{flex-wrap:wrap;gap:8px}
  .day-entry .btn{flex:1;min-width:calc(50% - 4px);justify-content:center}
  .modal{width:min(520px,calc(100% - 24px));max-width:calc(100% - 24px);max-height:calc(100dvh - 24px);padding:18px;border-radius:16px;box-sizing:border-box}
  .modal-form{padding:0;max-height:calc(100dvh - 16px)}
  .modal-form-head{padding:18px 18px 0}
  .modal-form-body{padding:12px 18px 6px}
  .modal-form .modal-actions{padding:10px 18px calc(18px + var(--safe-b))}
  #modal-doctor .modal-actions{
    display:grid;grid-template-columns:1fr 1fr;gap:8px;width:100%;
  }
  #modal-doctor .modal-actions .spacer{display:none}
  #modal-doctor .modal-actions .btn{
    width:100%;flex:none;min-width:0;max-width:100%;margin:0;height:44px;
  }
  #modal-doctor .modal-actions #btnSaveDoctor{grid-column:1 / -1;order:-2}
  #modal-doctor .modal-actions #btnPublishDoctor{order:-1}
  #modal-doctor .modal-actions #btnDeleteDoctor{grid-column:1 / -1}
  .modal label{min-width:0;overflow:hidden}
  .modal label input[type=file]{font-size:12px}
  .modal-actions .btn{flex:1;min-width:calc(50% - 4px);justify-content:center}
  .add-row{grid-template-columns:1fr}
  #doctorList .doc-table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .tech-banner .ico{align-self:center}
  .dash-actions{grid-template-columns:repeat(2,1fr)!important}
  .staff-auth-logo{width:min(190px,72%)}
  .staff-auth-brand{margin-bottom:14px}
  .page-head > div:first-child h2,
  .page-head > div:first-child .sub{display:none}
  .page-head .head-actions{width:100%;gap:8px}
  .page-head .head-actions .btn{flex:1;justify-content:center;height:44px;border-radius:12px}
  .stats{grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:16px}
  .stat{padding:14px;border-radius:16px}
  .stat-ico{width:38px;height:38px;border-radius:11px}
  .stat-t b{font-size:18px}
  .panel{border-radius:16px;padding:16px}
  .btn{height:44px;border-radius:12px;-webkit-tap-highlight-color:transparent}
  .btn:active:not(:disabled){transform:scale(.98)}
  .cal-cell{min-height:58px;padding:4px;border-radius:10px}
  #view-kalendar #statsKalendar{display:none}
  #view-kalendar .page-head{margin-bottom:8px}
  #view-kalendar .page-head .cal-nav{
    background:var(--panel);border:1px solid var(--line);border-radius:14px;
    padding:6px 8px;margin-bottom:10px;width:100%;
  }
  #view-kalendar .page-head .cal-nav .btn{
    flex:0 0 44px;width:44px;min-width:44px;height:44px;border-radius:12px;
  }
  #view-kalendar .page-head .cal-nav h3{
    flex:none;font-size:15px;font-weight:700;text-align:center;
  }
  #view-kalendar .cal-grid{gap:5px}
  #view-kalendar .dow{font-size:10px;padding:2px 0;letter-spacing:.4px}
  #view-kalendar .cal-cell{
    min-height:0;aspect-ratio:1;padding:6px 4px;
    display:flex;flex-direction:column;border-radius:10px;
  }
  #view-kalendar .cal-cell .dnum{font-size:13px;font-weight:700}
  #view-kalendar .cal-cell .cell-line{
    margin-top:auto;font-size:0;justify-content:center;gap:0;margin-bottom:2px;
  }
  #view-kalendar .cal-cell .cell-line .cdot{width:10px;height:10px}
  #view-kalendar .cal-cell .cell-times{display:none}
  #view-kalendar .legend{gap:10px;font-size:11px;margin-top:12px;justify-content:center}
  #view-kalendar .legend .hint{display:none}
  .row,.color-grid{grid-template-columns:1fr}
  .add-row{grid-template-columns:1fr}
  .doc-table,.appt-table-flat,.patient-table{font-size:13px;border-radius:14px;overflow:hidden}
  .doc-table th,.doc-table td,.appt-table-flat th,.appt-table-flat td{padding:10px}
  .filter-bar{flex-wrap:wrap;margin-bottom:10px}
  .appt-filters{width:100%}
  .appt-filters .btn{flex:1;justify-content:center;height:40px}
  .dash-grid,.dash-grid-b,.tv-grid,.tv-cols{grid-template-columns:1fr!important}
  #view-objave .objave-grid{grid-template-columns:minmax(0,1fr)!important}
  .post-sidebox{position:static;margin-top:0}
  .mod-info-fab,.pwa-install{display:none!important}
  body.staff-app .staff-toast{bottom:calc(var(--staff-nav-h) + var(--safe-b) + 20px)}
  body.staff-app .staff-app-header,
  body.staff-app .staff-bottom-nav{display:flex}
  .staff-header-logo{width:80px;max-height:24px}

  /* --- globalno: ništa ne izlazi iz ekrana --- */
  html{overflow-x:hidden}
  body.staff-app{overflow-x:hidden;width:100%;max-width:100vw}
  body.staff-app .layout,
  body.staff-app .staff-app-shell,
  body.staff-app main,
  body.staff-app .view,
  body.staff-app .panel,
  body.staff-app .objave-grid,
  body.staff-app .post-list,
  body.staff-app .post-sidebox{max-width:100%;min-width:0}
  body.staff-app img,
  body.staff-app canvas,
  body.staff-app video,
  body.staff-app iframe{max-width:100%}
  body.staff-app input,
  body.staff-app textarea,
  body.staff-app select{max-width:100%}

  .btn{min-width:0;max-width:100%;white-space:normal;line-height:1.25;padding:0 10px;font-size:12.5px;gap:5px}
  .btn .ico{flex-shrink:0}
  .page-head .head-actions .btn{flex:1 1 calc(50% - 4px);min-width:0;max-width:100%}
  .page-head .head-actions .btn:only-child,
  .page-head .head-actions .btn.primary{flex:1 1 100%}
  .stat{min-width:0}
  .stat-t{min-width:0;overflow:hidden}
  .stat-t small,.stat-t span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .panel{padding:14px;overflow:hidden}
  .panel-head h3,.panel-head .muted-sm{min-width:0;overflow:hidden;text-overflow:ellipsis}
  .filter-bar{width:100%}
  .search-box{width:100%;max-width:none}
  .cal-grid{max-width:100%}
  .legend{justify-content:center;gap:8px 12px}

  .modal{
    width:min(520px,calc(100% - 24px));max-width:calc(100% - 24px);
    left:50%;right:auto;transform:translate(-50%,-50%);box-sizing:border-box;
  }
  .modal.wide,#modal-preview{width:min(780px,calc(100% - 20px));max-width:calc(100% - 20px)}
  .modal-actions{width:100%}
  .pub-row{flex-wrap:wrap}
  .pub-badge{margin-left:auto}

  .post-row-actions{gap:6px;padding:10px 12px 12px}
  .post-row-actions .btn{flex:1 1 calc(50% - 4px);min-width:0;height:36px;font-size:11px;padding:0 8px}
  .post-row-actions .fmt-quick{width:100%;justify-content:center}

  #view-objave .sb-meta{word-break:break-word;overflow-wrap:anywhere;white-space:normal}
  #view-objave .sb-canvas{overflow:hidden;max-width:100%;padding:0}
  #view-objave .sb-canvas canvas{width:100%!important;max-width:100%!important;height:auto!important;display:block;margin:0;border-radius:14px}

  #view-tvmodul .pair-code{font-size:24px;letter-spacing:4px;word-break:break-all}
  #view-tvmodul .pair-code-input{letter-spacing:4px;max-width:100%;box-sizing:border-box}
  #view-tvmodul .tv-item{align-items:flex-start}
  #view-tvmodul .head-actions.tv-add-row{width:100%;box-sizing:border-box}

  .dash-docgrid{grid-template-columns:1fr!important}
  .dash-bar-t b{white-space:normal}
  .dash-act{padding:14px 8px 12px}
  .dash-act b{font-size:12px}

  .doc-table-wrap,.appt-table-wrap,.patient-table-wrap{
    overflow-x:visible;max-width:100%;margin:0;padding:0;
  }

  /* tabele → kartice na mobilnom (pacijenti, doktori) */
  .patient-table,
  #doctorList .doc-table{
    display:block;width:100%;border:none;background:transparent;box-shadow:none;overflow:visible;
  }
  .patient-table thead,
  #doctorList .doc-table thead{display:none}
  .patient-table tbody,
  #doctorList .doc-table tbody{display:flex;flex-direction:column;gap:10px}
  .patient-table tr,
  #doctorList .doc-table tr{
    display:block;background:var(--panel);border:1px solid var(--line);
    border-radius:14px;padding:12px 14px;box-shadow:var(--shadow);
  }
  .patient-table td,
  #doctorList .doc-table td{
    display:flex;align-items:center;justify-content:space-between;gap:12px;
    padding:5px 0;border:none;background:transparent!important;
    font-size:13px;text-align:right;
  }
  .patient-table td::before,
  #doctorList .doc-table td::before{
    font-size:10px;font-weight:700;color:var(--muted);
    text-transform:uppercase;letter-spacing:.35px;text-align:left;flex-shrink:0;
  }
  .patient-table tbody tr td:nth-child(1)::before{content:'Ime'}
  .patient-table tbody tr td:nth-child(2)::before{content:'Prijava'}
  .patient-table tbody tr td:nth-child(3)::before{content:'Telefon'}
  .patient-table tbody tr td:nth-child(4)::before{content:'E-mail'}
  .patient-table tbody tr td:nth-child(5)::before{content:'Status'}
  .patient-table tbody tr td:nth-child(6)::before{content:'Zadnja prijava'}
  #doctorList .doc-table tbody tr td:nth-child(1)::before{content:''}
  #doctorList .doc-table tbody tr td:nth-child(2)::before{content:'Doktor'}
  #doctorList .doc-table tbody tr td:nth-child(3)::before{content:'Specijalnost'}
  #doctorList .doc-table tbody tr td.admin-only:nth-child(4)::before{content:'Web'}
  .patient-table td:last-child,
  #doctorList .doc-table td:last-child{
    flex-direction:column;align-items:stretch;gap:8px;
    padding-top:10px;margin-top:6px;border-top:1px solid var(--line)!important;
  }
  .patient-table td:last-child::before,
  #doctorList .doc-table td:last-child::before{display:none}
  #doctorList .doc-table tbody tr td:first-child{justify-content:flex-start;padding-bottom:8px}
  #doctorList .doc-table tbody tr td:first-child::before{display:none}
  .patient-table .appt-actions,
  #doctorList .doc-table .ta-r{justify-content:stretch;width:100%}
  .patient-table .appt-actions .btn,
  #doctorList .doc-table .btn{flex:1;min-width:0;justify-content:center}
  .patient-table tr td[colspan]{
    display:block;text-align:center;padding:18px 8px;
  }
  .patient-table tr td[colspan]::before{display:none}
  .patient-table td b{text-align:right;word-break:break-word}

  #view-zakazivanje #apptCount{word-break:break-word}
  .token-chips{max-width:100%}
  .sub-tabs{max-width:100%}
  .tech-banner span{word-break:break-word}
  .canvas-holder{max-width:100%;overflow:auto}
  .canvas-holder canvas{max-width:100%;height:auto}
}

.staff-app-header{
  position:fixed;top:0;left:0;right:0;z-index:45;background:#fff;border-bottom:1px solid var(--line);
  padding:max(14px,var(--safe-t)) 18px 14px;box-shadow:0 1px 0 rgba(255,255,255,.9);
  flex-direction:column;
}
@media(min-width:481px) and (max-width:820px){
  .staff-app-header{left:50%;right:auto;transform:translateX(-50%);max-width:480px;width:100%}
  .staff-bottom-nav{left:50%;right:auto;transform:translateX(-50%);max-width:480px;width:100%}
}
.staff-header-row{display:flex;align-items:center;justify-content:space-between;gap:14px}
.staff-header-main{flex:1;min-width:0;padding-right:4px}
.staff-header-main h1{font-size:19px;font-weight:800;letter-spacing:-.35px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.staff-header-main p{font-size:13px;color:var(--red);font-weight:600;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.brand-logo{display:block;object-fit:contain;flex-shrink:0}
.staff-header-logo,.header-brand-logo{width:92px;max-height:28px;height:auto;margin-left:auto;object-position:right center}
.staff-header-view{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.7px;color:var(--muted);margin-top:10px;padding-top:10px;border-top:1px solid var(--line)}

.staff-bottom-nav{
  position:fixed;left:0;right:0;bottom:0;z-index:45;
  min-height:calc(var(--staff-nav-h) + var(--safe-b));padding:10px 4px var(--safe-b);
  background:rgba(255,255,255,.97);border-top:1px solid var(--line);
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  align-items:flex-end;justify-content:space-around;
}
.staff-nav-item{
  flex:1;border:none;background:transparent;color:var(--muted);cursor:pointer;
  display:flex;flex-direction:column;align-items:center;gap:3px;
  font:inherit;font-size:9px;font-weight:600;padding:8px 2px;min-width:0;position:relative;
  -webkit-tap-highlight-color:transparent;
}
.staff-nav-item .ico svg{width:22px;height:22px;stroke:currentColor}
.staff-nav-item.active{color:var(--red)}
.staff-nav-badge{
  position:absolute;top:2px;right:calc(50% - 22px);min-width:16px;height:16px;padding:0 4px;
  background:var(--red);color:#fff;font-size:9px;font-weight:800;border-radius:99px;
  display:flex;align-items:center;justify-content:center;
}

/* ---------- toast ---------- */
#toast,.staff-toast{
  position:fixed;left:50%;bottom:26px;transform:translateX(-50%) translateY(20px);
  background:#2b2523;color:#fff;padding:10px 22px;border-radius:99px;font-size:13.5px;
  opacity:0;pointer-events:none;transition:.25s;z-index:60;box-shadow:0 8px 24px rgba(0,0,0,.25);
}
#toast.show,.staff-toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

.mobile-drawer{position:fixed;inset:0;z-index:80;font-family:'Poppins',system-ui,sans-serif}
.mobile-drawer[hidden]{display:none!important}
.mobile-drawer-backdrop{position:absolute;inset:0;background:rgba(35,18,16,.42)}
.mobile-drawer-panel{
  position:absolute;left:0;top:0;bottom:0;width:min(300px,88vw);
  background:#fff;box-shadow:8px 0 32px rgba(0,0,0,.12);
  display:flex;flex-direction:column;padding:max(14px,var(--safe-t)) 0 var(--safe-b);
  animation:drawerIn .22s ease;
}
@keyframes drawerIn{from{transform:translateX(-100%)}to{transform:none}}
.mobile-drawer-head{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:8px 14px 14px;border-bottom:1px solid var(--line);
}
.mobile-drawer-head b{display:block;font-size:15px}
.mobile-drawer-nav{display:flex;flex-direction:column;gap:4px;padding:12px 10px;overflow:auto}
.mobile-drawer-nav button{
  display:flex;align-items:center;gap:10px;width:100%;text-align:left;
  border:none;background:transparent;color:var(--ink);padding:12px;border-radius:12px;
  font-size:14px;font-family:inherit;cursor:pointer;
}
.mobile-drawer-nav button.active{background:var(--red-soft);color:var(--red);font-weight:600}
.mobile-drawer-nav button .ico svg{width:18px;height:18px;stroke:currentColor}
.mobile-drawer-link{
  display:block;margin:8px 10px 0;padding:12px 14px;border-radius:12px;
  background:var(--bg);color:var(--muted);text-decoration:none;font-size:13px;text-align:center;
}
.mobile-drawer-logout{
  display:flex;align-items:center;justify-content:center;gap:8px;width:calc(100% - 20px);
  margin:12px 10px 0;padding:13px;border:none;border-radius:12px;cursor:pointer;
  background:#fdf0f0;color:#b3261e;font:inherit;font-size:14px;font-weight:600;
}
.mobile-drawer-logout .ico svg{width:16px;height:16px;stroke:currentColor}
body.drawer-open{overflow:hidden}

/* ---------- TV modul ---------- */
.tv-frame{background:#15110f;border-radius:16px;padding:12px 12px 20px;box-shadow:0 14px 40px rgba(0,0,0,.25)}
.tv-frame iframe{width:100%;aspect-ratio:16/9;border:none;border-radius:6px;background:#fff;display:block}
#tvLink{font-size:12px;color:var(--muted)}

/* ---------- TV playlista ---------- */
.tv-item{display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:10px;padding:7px 10px;margin-bottom:6px;background:#fff;font-size:13px}
.tv-item.off{opacity:.5}
.tv-item b{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px}
.tv-tip{background:var(--red-soft);color:var(--dark);font-size:9.5px;letter-spacing:.5px;padding:2px 7px;border-radius:99px;flex-shrink:0}
.tv-item .tv-dur{width:52px;padding:4px 6px;border:1px solid var(--line);border-radius:7px;font-size:12px;text-align:center}

/* ---------- male ikonice u listama (playlista i sl.) ---------- */
.el-ico{border:1px solid var(--line);background:#fff;cursor:pointer;width:28px;height:28px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;color:var(--muted);flex-shrink:0;font-size:11px;padding:0}
.el-ico:hover{color:var(--red);border-color:#d8b7b6}
.el-ico svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* ---------- kod za uparivanje TV-a ---------- */
.pair-code{font-size:34px;font-weight:800;letter-spacing:10px;color:var(--red);text-align:center;padding:12px;border:2px dashed #d8b7b6;border-radius:12px;margin-top:8px;background:var(--red-soft)}
.pair-code-input{font-size:22px;font-weight:700;letter-spacing:8px;text-align:center}
.pair-row{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end}
.pair-row label{flex:1;min-width:180px}

.appt-table .appt-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.appt-table .appt-actions .btn{margin:0}
.appt-table{width:100%;border-collapse:collapse;font-size:14px;margin-top:12px}
.appt-table th,.appt-table td{padding:10px 12px;text-align:left;border-bottom:1px solid var(--line)}
.appt-table th{font-size:12px;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.03em}
.appt-status{display:inline-block;padding:2px 8px;border-radius:6px;font-size:12px;font-weight:600;text-transform:capitalize}
.appt-status.pending{background:#fff3e0;color:#e65100}
.appt-status.confirmed,.appt-status.approved{background:#e8f5e9;color:#2e7d32}
.appt-status.cancelled{background:#fce8e8;color:#9b2c2c}
.patient-groups{display:flex;flex-direction:column;gap:14px;margin-top:12px}
.patient-group-card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow)}
.patient-group-head{display:flex;align-items:center;gap:14px;padding:14px 16px;background:var(--bg,#f7f5f4);border-bottom:1px solid var(--line);flex-wrap:wrap}
.patient-av{width:44px;height:44px;border-radius:12px;background:var(--red-soft);color:var(--red);font-weight:800;font-size:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.patient-group-info{flex:1;min-width:180px}
.patient-group-info b{display:block;font-size:15px;line-height:1.25}
.patient-group-info span{display:block;font-size:12px;color:var(--muted);margin-top:3px}
.patient-group-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-left:auto}
.patient-group-count{font-size:12px;color:var(--muted);font-weight:600}
.patient-group-empty{margin:0;padding:14px 16px;font-size:13px}
.appt-table-nested{margin:0}
.appt-table-nested th{background:#fafafa}
.appt-table-nested td,.appt-table-nested th{padding:9px 12px}
.hint-list{margin:8px 0 0 18px;line-height:1.7;color:var(--muted);font-size:13px}
.hint-list code{font-size:12px}

/* Uloge: sestri se sakrivaju admin-only kontrole */
body[data-role="sestra"] .admin-only{display:none !important}

/* Tehnički panel — samo Ordino podrška (PIN ili impersonate) */
#mainNav button.tech-only,
.mobile-drawer-nav button.tech-only{display:none!important}
body.tech-mode #mainNav button.tech-only,
body.tech-mode .mobile-drawer-nav button.tech-only{display:flex!important}
.tech-banner{display:flex;align-items:center;gap:14px;padding:14px 18px;margin-bottom:18px;border-radius:12px;background:linear-gradient(135deg,#1a1412,#2d2220);color:#fff;border:1px solid rgba(190,28,28,.35)}
.tech-banner b{display:block;font-size:14px;margin-bottom:2px}
.tech-banner span{font-size:12px;opacity:.85}
.tech-banner .ico{color:#e8a0a2}
.tech-btns{flex-wrap:wrap;gap:8px;margin:10px 0}
.tpl-actions{display:flex;flex-wrap:wrap;gap:10px;margin:12px 0}
.link-btn{background:none;border:none;padding:0;color:var(--muted);font-size:12px;cursor:pointer;text-decoration:underline}
.link-btn:hover{color:var(--red)}
.auth-tech{text-align:center;margin-top:8px}
.tech-readonly input{background:var(--bg,#f5f5f7);color:var(--muted)}

/* Ordino logo — isti kao pacijentska aplikacija */
.sidebar-brand-logo{width:min(158px,100%);height:auto;max-height:40px}
.auth-brand{display:flex;justify-content:center;margin-bottom:6px}
.auth-logo{width:100%;max-width:250px;height:auto;display:block}

/* Objave: lista + desni živi pregled */
.objave-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;align-items:start}
.objave-grid > #postList{grid-column:1 / 4;min-width:0}
.post-sidebox{grid-column:4 / 5;position:sticky;top:16px;background:var(--panel,#fff);border:1px solid var(--line);border-radius:var(--radius,14px);padding:16px}
.post-sidebox .sb-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;margin-bottom:12px}
.post-sidebox .sb-head h3,.post-sidebox .sb-head-txt h3{margin:0;font-size:15px}
.sb-meta{font-size:12px;color:var(--muted);margin:4px 0 0;line-height:1.4}
.post-sidebox .sb-fmt{margin-bottom:12px}
.post-sidebox .sb-fmt .btn.active{background:var(--red);border-color:var(--red);color:#fff}
.sb-canvas{background:var(--bg,#f5f5f7);border-radius:10px;padding:0;display:flex;align-items:center;justify-content:center;min-height:300px;overflow:hidden}
#view-objave .sb-canvas{min-height:200px;border-radius:14px}
.sb-canvas canvas{border-radius:8px;box-shadow:0 6px 22px rgba(0,0,0,.14);width:100%;max-width:100%;height:auto;display:block}
.sb-actions{display:flex;gap:8px;margin-top:12px}
.sb-actions .btn{flex:1;justify-content:center}
.post-row{cursor:pointer}
.post-row.sel{outline:2px solid var(--red,#BE1C1C);outline-offset:-1px;background:var(--red-soft,#fbeaea)}
@media(max-width:1100px){.objave-grid{grid-template-columns:1fr}.objave-grid > #postList,.post-sidebox{grid-column:auto}.post-sidebox{position:static}}

/* TV modul — ekrani + sadržaj */
.tv-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-bottom:18px}
.panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.panel-head h3{margin:0}
.muted-sm{font-size:12px;color:var(--muted)}
.tv-dev-list{display:flex;flex-direction:column;gap:8px;margin-bottom:12px;min-height:60px}
.tv-dev{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--bg,#f8f8fa)}
.tv-dev-ico{width:38px;height:38px;flex:none;display:flex;align-items:center;justify-content:center;background:var(--red-soft,#fbeaea);color:var(--red);border-radius:10px}
.tv-dev-ico svg{width:20px;height:20px}
.tv-dev-info{flex:1;display:flex;flex-direction:column;min-width:0}
.tv-dev-info b{font-size:14px}
.tv-dev-meta{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.tv-dev-actions{display:flex;flex-wrap:wrap;gap:6px;flex-shrink:0}
.tv-dev-actions .btn.sm{padding:5px 10px;font-size:11px}
.dash-tv-row{align-items:center}
.dash-tv-actions{margin-left:auto;flex-shrink:0}
.dash-tv-actions .btn.sm{padding:4px 8px;font-size:11px}
.dot{width:8px;height:8px;border-radius:50%;display:inline-block}
.dot.on{background:#22a559}.dot.off{background:#c2c2cc}
.btn.full{width:100%;justify-content:center}
.pair-panel{margin-top:12px;padding:14px;border:1px dashed var(--line);border-radius:12px;background:var(--bg,#f8f8fa)}
.tv-add-row{flex-wrap:wrap;gap:8px;margin:6px 0 4px}
.tv-cols{display:grid;grid-template-columns:1fr 1fr;gap:18px;align-items:start}
.tv-col{display:flex;flex-direction:column;gap:18px}
.pair-lbl{display:block;font-size:13px;color:var(--muted);margin-bottom:8px}
.pair-name-input{width:100%;margin-top:5px;padding:9px 12px;border:1px solid var(--line);border-radius:9px;font-size:14px}
@media(max-width:1000px){.tv-grid,.tv-cols{grid-template-columns:1fr}}

/* ---------- dashboard (Početna) ---------- */
.dash-grid{display:grid;grid-template-columns:3fr 2fr;gap:18px;align-items:start;margin-bottom:18px}
.dash-grid-b{grid-template-columns:1fr 1fr}
.dash-col{display:flex;flex-direction:column;gap:18px;min-width:0}
.dash-date{padding:8px 14px;border:1px solid var(--line);border-radius:12px;background:var(--panel,#fff);font-size:13px;font-weight:600;color:var(--text,#222);box-shadow:var(--shadow);white-space:nowrap}
.live-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;color:var(--red);margin-left:8px;vertical-align:2px}
.live-badge i{width:7px;height:7px;border-radius:50%;background:var(--red);animation:dashPulse 1.6s infinite}
@keyframes dashPulse{0%,100%{opacity:1}50%{opacity:.35}}
.dash-doc{display:flex;align-items:center;gap:12px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--bg,#f8f8fa)}
.dash-doc + .dash-doc{margin-top:8px}
.dash-doc-ico{width:36px;height:36px;flex:none;display:flex;align-items:center;justify-content:center;background:var(--red-soft,#fbeaea);color:var(--red);border-radius:10px}
.dash-doc-ico svg{width:18px;height:18px}
.dash-doc-ico.tvic{background:#e8f0fb;color:#2b6cb0}
.dash-doc-info{flex:1;display:flex;flex-direction:column;min-width:0}
.dash-doc-info b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dash-doc-info span{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:5px}
.dash-doc-time{font-size:13px;font-weight:600;color:var(--red);white-space:nowrap}
/* kartice doktora "danas na poslu" */
.dash-docgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.dash-doccard{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid var(--line);border-radius:14px;background:var(--bg,#f8f8fa)}
.dash-doccard-i{flex:1;display:flex;flex-direction:column;min-width:0}
.dash-doccard-i b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dash-doccard-i span{font-size:12px;color:var(--muted)}
.dash-av{width:42px;height:42px;flex:none;display:flex;align-items:center;justify-content:center;border-radius:50%;color:#fff;font-weight:700;font-size:15px;letter-spacing:.5px}
.dash-av.sm{width:32px;height:32px;font-size:12px}
.dash-tchips{display:flex;flex-direction:column;gap:4px}
.dash-tchips i{font-style:normal;font-size:11.5px;font-weight:600;color:var(--red);background:var(--red-soft,#fbeaea);padding:3px 8px;border-radius:7px;white-space:nowrap}
/* graf sedmice */
.dash-chart{overflow:hidden}
.dash-svg{width:100%;height:auto;display:block}
.dash-svg-lbl{font-size:11px;font-weight:600;fill:#9a9aa5}
.dash-svg-lbl.now{fill:var(--red)}
.dash-svg-val{font-size:11px;font-weight:700;fill:var(--red)}
/* brze akcije — kartice */
.dash-qa{margin-bottom:18px}
.dash-actions{display:grid;grid-template-columns:repeat(6,1fr);gap:12px}
.dash-act{display:flex;flex-direction:column;align-items:center;gap:3px;padding:16px 10px 13px;border:1px solid var(--line);border-radius:14px;background:var(--panel,#fff);cursor:pointer;font-family:inherit;transition:border-color .15s,box-shadow .15s,transform .15s;text-align:center}
.dash-act:hover{border-color:#d8b7b6;box-shadow:var(--shadow);transform:translateY(-2px)}
.dash-act-ico{width:44px;height:44px;display:flex;align-items:center;justify-content:center;background:var(--red-soft,#fbeaea);color:var(--red);border-radius:12px;margin-bottom:6px}
.dash-act-ico svg{width:22px;height:22px}
.dash-act b{font-size:13px;color:var(--text,#222)}
.dash-act > span:not(.dash-act-ico){font-size:11px;color:var(--muted)}
/* najaktivniji doktori — trake */
.dash-bar{display:flex;align-items:center;gap:12px}
.dash-bar + .dash-bar{margin-top:12px}
.dash-bar-i{flex:1;min-width:0}
.dash-bar-t{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:5px}
.dash-bar-t b{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dash-bar-t span{font-size:12px;font-weight:700;color:var(--red)}
.dash-bar-track{height:7px;border-radius:5px;background:var(--bg,#f0f0f3);overflow:hidden}
.dash-bar-track i{display:block;height:100%;border-radius:5px;background:linear-gradient(90deg,var(--red),#e0524f)}
.btn.sm{padding:5px 12px;font-size:12px;margin-top:0}
/* doktori — grid/tabela pogled */
.view-toggle{display:flex;gap:6px;margin-left:auto}
.view-toggle .btn.sq{padding:7px 12px;font-size:15px;line-height:1}
.view-toggle .btn.active{background:var(--red);border-color:var(--red);color:#fff}
.doc-table{width:100%;border-collapse:collapse;background:var(--panel,#fff);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow)}
.doc-table th{text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:1px;color:var(--muted);padding:12px 14px;border-bottom:2px solid var(--line);background:var(--bg,#fafafa)}
.doc-table td{padding:10px 14px;border-bottom:1px solid var(--line);font-size:14px;vertical-align:middle}
.doc-table tr:last-child td{border-bottom:none}
.doc-table tr:hover td{background:var(--bg,#fafafa)}
.doc-table .ta-r{text-align:right}
.patient-table-panel{margin-top:4px}
.patient-table-wrap{overflow-x:auto}
.patient-table{margin-top:0}
.patient-table .appt-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.patient-table .appt-actions .btn{margin:0}
.patient-table-empty{text-align:center;color:var(--muted);padding:28px 16px !important;font-size:13px}

/* Meta — društvene mreže */
.meta-page-picker{margin:12px 0;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--bg,#faf9f8)}
.meta-page-picker label{margin-bottom:0}
.meta-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.meta-actions .btn{flex:1;min-width:calc(50% - 4px);justify-content:center}
#modal-meta-publish label.chk{display:flex;align-items:center;gap:10px;margin-bottom:10px;color:var(--ink);font-size:14px;font-weight:500}
#modal-meta-publish label.chk input[type=checkbox]{width:18px;height:18px;margin:0;accent-color:var(--red);flex-shrink:0}
#view-objave #sbMetaPublish{grid-column:1 / -1}
.appt-table-panel{margin-top:4px}
.appt-table-wrap{overflow-x:auto}
.appt-table-flat{margin-top:0}
.appt-table-flat .appt-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.appt-table-flat .appt-actions .btn{margin:0}
.appt-filter-bar{margin-bottom:12px}
.appt-filters{display:flex;flex-wrap:wrap;gap:8px}
.appt-filters .btn.active{background:var(--red);border-color:var(--red);color:#fff}
.doc-mini{width:36px;height:36px;display:flex;align-items:center;justify-content:center;background:var(--red-soft,#fbeaea);color:var(--red);border-radius:50%;overflow:hidden}
.doc-mini img{width:100%;height:100%;object-fit:cover}
.doc-mini svg{width:18px;height:18px}
.badge-ok.inline{position:static;display:inline-block}
/* auto stavka u TV playlisti */
.tv-item.tv-auto{border-style:dashed;background:var(--red-soft,#fdf6f6)}
.tv-tip.auto{background:var(--red);color:#fff}
/* potvrda objavljivanja (U4) */
.pub-list{display:flex;flex-direction:column;gap:10px;margin:14px 0 4px}
.pub-row{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--bg,#f8f8fa)}
.pub-ico{width:38px;height:38px;flex:none;display:flex;align-items:center;justify-content:center;background:var(--red-soft,#fbeaea);color:var(--red);border-radius:10px}
.pub-ico svg{width:19px;height:19px}
.pub-i{flex:1;display:flex;flex-direction:column;min-width:0}
.pub-i b{font-size:14px}
.pub-i span{font-size:12px;color:var(--muted)}
.pub-badge{flex:none;font-size:11px;font-weight:700;padding:4px 10px;border-radius:8px;background:#e6f6ec;color:#177a43}
.pub-badge.manual{background:#fdf3e3;color:#a05f0a}
@media(max-width:1200px){.dash-actions{grid-template-columns:repeat(3,1fr)}}
@media(max-width:1000px){.dash-grid,.dash-grid-b{grid-template-columns:1fr}.dash-docgrid{grid-template-columns:1fr}}

/* ---------- objašnjenja modula ("kako radi ovaj modul") ---------- */
.mod-info-fab{
  position:fixed;right:22px;bottom:22px;z-index:55;display:flex;flex-direction:column;align-items:flex-end;gap:10px;
}
.mod-info-fab.hidden{display:none}
.mod-info-btn{
  width:48px;height:48px;border-radius:50%;border:none;cursor:pointer;
  background:var(--red,#9B2C2C);color:#fff;box-shadow:0 6px 22px rgba(126,31,35,.35);
  display:flex;align-items:center;justify-content:center;transition:transform .2s,box-shadow .2s;
}
.mod-info-btn:hover{transform:scale(1.05);box-shadow:0 8px 26px rgba(126,31,35,.42)}
.mod-info-btn .ico svg{width:22px;height:22px;stroke:#fff}
.mod-info-panel{
  width:min(360px,calc(100vw - 44px));background:#fff;border:1px solid #f0dddb;border-radius:16px;
  box-shadow:0 12px 40px rgba(35,18,16,.18);overflow:hidden;
}
.mod-info-panel-head{
  display:flex;align-items:center;gap:10px;padding:12px 14px;
  background:linear-gradient(135deg,#fdf6f5,#fbfafa);border-bottom:1px solid #f0dddb;
}
.mod-info-panel-head b{font-size:13.5px;color:var(--dark,#7E1F23);flex:1}
.mod-info-panel-ico{
  width:28px;height:28px;flex-shrink:0;display:flex;align-items:center;justify-content:center;
  background:var(--red-soft,#faeceb);color:var(--red);border-radius:8px;
}
.mod-info-panel-ico .ico svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:1.85}
.mod-info-close{
  width:28px;height:28px;border:none;background:transparent;color:var(--muted);font-size:22px;line-height:1;
  cursor:pointer;border-radius:8px;
}
.mod-info-close:hover{background:#f5f0ef;color:var(--ink)}
.mod-info-panel-body{padding:14px 16px 16px}
.mod-info-panel-body p{font-size:13px;color:var(--ink,#26221f);line-height:1.55;margin:0 0 10px}
.mod-info-panel-body ul{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:6px}
.mod-info-panel-body li{font-size:12.5px;color:var(--muted);line-height:1.5;padding-left:16px;position:relative}
.mod-info-panel-body li::before{
  content:"";position:absolute;left:2px;top:.55em;width:6px;height:6px;border-radius:50%;
  background:var(--red);opacity:.55;
}
@media(max-width:600px){
  .mod-info-btn{width:44px;height:44px}
}

.pwa-install{
  position:fixed;left:22px;right:22px;bottom:22px;z-index:54;
  display:flex;align-items:center;gap:12px;padding:12px 14px;
  background:#fff;border:1px solid #f0dddb;border-radius:14px;
  box-shadow:0 10px 32px rgba(35,18,16,.16);
}
.pwa-install[hidden]{display:none !important}
.pwa-install-txt{flex:1;min-width:0}
.pwa-install-txt b{display:block;font-size:13px;color:var(--ink,#26221f)}
.pwa-install-txt span{display:block;font-size:12px;color:var(--muted);margin-top:2px}
.pwa-install-x{
  width:32px;height:32px;border:none;background:transparent;color:var(--muted);
  font-size:22px;line-height:1;cursor:pointer;border-radius:8px;flex-shrink:0;
}
.pwa-install-x:hover{background:#f5f0ef;color:var(--ink)}
