/* Interaktivni demo — isti vizuelni jezik kao osnovni prototip. */
[data-demo-click] { cursor:pointer; }
[data-demo-click]:hover { outline:1px solid var(--accent); outline-offset:2px; }
[data-demo-click]:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.demo-tools { display:flex; justify-content:space-between; gap:8px; align-items:center; padding:10px 0; font-size:11px; color:#acb8c9; }
.demo-tools button { background:none; color:#ffc18e; border:1px solid #586274; border-radius:8px; padding:8px; cursor:pointer; }
.demo-dialog { margin:auto; width:min(620px,calc(100vw - 24px)); max-height:88dvh; padding:0; border:1px solid #586274; border-radius:18px; background:var(--bg-panel); color:var(--text-primary); box-shadow:0 20px 80px #0009; }
.demo-dialog::backdrop { background:#050b15cc; }
.demo-dialog-head { position:sticky; top:0; z-index:2; display:flex; align-items:center; gap:10px; padding:16px; background:var(--bg-panel); border-bottom:1px solid #586274; }
.demo-dialog-head h2 { flex:1; font-size:18px; }
.demo-dialog-head button { color:white; border:1px solid #586274; background:var(--bg-card); padding:8px 12px; border-radius:8px; cursor:pointer; }
.demo-dialog-body { padding:18px; font-size:14px; line-height:1.6; overflow-wrap:anywhere; }
.demo-dialog-body p { margin:0 0 12px; }
.demo-dialog-body label { display:block; margin:12px 0; }
.demo-dialog-body input:not([type=checkbox]), .demo-dialog-body select, .demo-dialog-body textarea { display:block; width:100%; padding:12px; margin:5px 0; color:white; background:#141b26; border:1px solid #718097; border-radius:8px; font:inherit; }
.demo-dialog-body textarea { min-height:110px; resize:vertical; }
.demo-row { display:block; text-align:left; width:100%; padding:13px; margin:8px 0; background:var(--bg-card); border:1px solid #586274; border-radius:10px; color:var(--text-primary); font:inherit; cursor:pointer; }
.demo-row small { display:block; color:#bbc5d3; }
.demo-row:hover { border-color:var(--accent); }
.demo-kv { display:flex; justify-content:space-between; gap:20px; padding:9px 0; border-bottom:1px solid #586274; }
.demo-caption { color:#b9c4d3; font-size:12px; }
.demo-dialog-body .btn-primary { margin-top:14px; }
.dp-nav-item.disabled { opacity:1; cursor:pointer; pointer-events:auto; }
.dp-nav-soon { display:none; }
.dp-table { min-width:630px; }
.demo-table-scroll { overflow-x:auto; width:100%; }
.dp-main { min-width:0; }
.installed-table { min-width:330px; }
@media(max-width:600px) { .dp-sidebar { display:flex; flex-wrap:wrap; width:100%; } .desktop-panel-inner { flex-direction:column; } .dp-nav-item { font-size:12px; } .dp-kpi-row { flex-wrap:wrap; } .demo-dialog-head h2 { font-size:16px; } }

/* Distributer na telefonu: kartice umjesto pomjeranja desktop tabele. */
@media(max-width:800px) {
  body.desktop-mode { padding:0 0 24px; }
  body.desktop-mode .global-wrapper { width:100%; max-width:100%; min-width:0; }
  body.desktop-mode .desktop-panel-frame { overflow:visible; width:100%; border-radius:0; }
  body.desktop-mode .desktop-panel-inner { min-width:0; min-height:0; width:100%; flex-direction:column; }
  body.desktop-mode .demo-tools { padding:10px 12px; gap:12px; }
  body.desktop-mode .demo-tools span { line-height:1.5; }
  body.desktop-mode .demo-tools button { min-height:44px; flex-shrink:0; }
  .dp-topbar { padding:16px; align-items:flex-start; flex-direction:column; gap:10px; }
  .dp-topbar-title { font-size:16px; }
  .dp-topbar-right { width:100%; flex-wrap:wrap; gap:8px 16px; font-size:12px; }
  .dp-topbar-date { width:100%; color:#aab7ca; }
  .dp-sidebar { width:100%; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; padding:10px 12px; border-right:0; border-bottom:1px solid #344055; }
  .dp-nav-item { min-width:0; min-height:52px; padding:9px 8px; border:1px solid #344055; border-radius:9px; font-size:12px; line-height:1.4; color:#c4cedc; gap:4px; }
  .dp-nav-item.active { border-color:var(--accent); background:var(--accent-muted); }
  .dp-main { width:100%; padding:18px 12px; overflow:visible; }
  .dp-kpi-row { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-bottom:24px; }
  .dp-kpi-card { min-width:0; padding:14px 9px; }
  .dp-kpi-value { font-size:clamp(18px,5vw,26px); overflow-wrap:anywhere; }
  .dp-kpi-label { font-size:10px; letter-spacing:0; line-height:1.5; color:#b1bfd1; margin-top:8px; }
  .dp-section-title { font-size:13px; color:#b8c5d7; line-height:1.5; margin:0 0 12px; }
  .dp-main > .demo-table-scroll { overflow:visible; }
  .dp-table { min-width:0; display:block; width:100%; margin-bottom:24px; }
  .dp-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .dp-table tbody { display:grid; gap:12px; width:100%; }
  .dp-table tbody tr { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px 16px; width:100%; padding:16px; border:1px solid #344055; border-radius:14px; background:#1e293b; }
  .dp-table tbody tr.row-new { border-color:#98602e; }
  .dp-table tbody td, .dp-table tr.row-new td { display:block; min-width:0; border:0; padding:0; background:transparent; font-size:14px; color:#e3eaf4; line-height:1.5; overflow-wrap:anywhere; }
  .dp-table tr.row-new td:first-child { border-left:0; }
  .dp-table td::before { content:attr(data-label); display:block; font-size:10px; line-height:1.5; text-transform:uppercase; letter-spacing:.05em; color:#aebdd0; margin-bottom:3px; }
  .demo-orders-table td:nth-child(3), .demo-orders-table td:nth-child(4), .demo-orders-table td:nth-child(5), .demo-orders-table td:nth-child(9) { grid-column:1 / -1; }
  .demo-orders-table td:nth-child(5) { font-size:12px; }
  .demo-orders-table td:nth-child(9)::before { display:none; }
  .dp-table .td-id { font-size:15px; }
  .dp-table .td-total { font-size:18px; color:#ffb078; }
  .dp-btn-open { width:100%; min-height:46px; border-radius:9px; font-size:14px; }
  .dp-badge { font-size:11px; padding:5px 8px; }
  /* Svaka kartica otvara svoj puni detalj i akcije u mobilnom dijalogu. */
  #dpDetailPanel { display:none; }
  .demo-claims-table td:nth-child(2), .demo-claims-table td:nth-child(5) { grid-column:1 / -1; }
  .demo-claims-table td:last-child { color:#ffb078; }
  .dp-demand-grid { grid-template-columns:1fr; gap:10px; }
  .dp-demand-item { padding:16px; }
  .dp-demand-desc { font-size:13px; color:#c3cfde; }
  .dp-demand-source { font-size:11px; color:#a5b4c9; }
  .dp-announcement { font-size:12px; color:#a5b4c9; }
  body.desktop-mode .demo-dialog { width:calc(100vw - 16px); max-height:calc(100dvh - 24px); }
  .demo-dialog-head button { min-width:44px; min-height:44px; }
  .demo-dialog-body .demo-kv { gap:12px; }
  .demo-dialog-body .demo-kv > span { min-width:0; }
  .demo-dialog-body .demo-kv > strong { flex-shrink:0; }
}
