:root{--bg:#f5f7fb;--panel:#fff;--line:#e7ebf2;--text:#0f172a;--muted:#6b7280;--blue:#2f63f6;--nav:#071426;--green:#16a34a;--red:#ef4444;--orange:#f59e0b;--shadow:0 18px 45px rgba(15,23,42,.08)}*{box-sizing:border-box}body{margin:0;font-family:Inter,ui-sans-serif,system-ui,Segoe UI,Arial;color:var(--text);background:var(--bg)}a{color:var(--blue);text-decoration:none}.app-shell{display:flex;min-height:100vh}.sidebar{width:245px;background:linear-gradient(180deg,#071426,#091a31);color:white;padding:18px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}.brand img{width:164px;margin:5px 0 20px}.nav-item{display:flex;gap:12px;align-items:center;color:#dbe7ff;padding:11px 12px;border-radius:12px;margin:3px 0;font-size:14px}.nav-item.active,.nav-item:hover{background:#2f63f6;color:white}.ico{width:18px;height:18px;border:1.8px solid currentColor;border-radius:5px}.sidebar-user{margin-top:auto;border-top:1px solid rgba(255,255,255,.1);padding-top:16px;display:flex;gap:10px;align-items:center}.avatar{background:linear-gradient(135deg,#2f63f6,#7c3aed);color:white;border-radius:50%;width:38px;height:38px;display:grid;place-items:center;font-weight:800}.avatar.mini{width:30px;height:30px;display:inline-grid;margin-right:8px;font-size:12px}.main{flex:1}.topbar{height:92px;background:rgba(255,255,255,.86);backdrop-filter:blur(18px);display:flex;align-items:center;justify-content:space-between;padding:0 28px;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:5}.topbar h1{font-size:24px;margin:0}.topbar p{margin:4px 0 0;color:var(--muted);font-size:13px}.top-actions{display:flex;gap:10px;align-items:center}.global-search{width:330px;border:1px solid var(--line);border-radius:12px;padding:12px 14px}.content{padding:24px}.card,.stat{background:var(--panel);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow)}.card{padding:20px;margin-bottom:18px}.card-head,.toolbar,.detail-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.btn{border:1px solid var(--line);background:#fff;border-radius:12px;padding:10px 14px;font-weight:700;cursor:pointer;transition:.18s}.btn:hover{transform:translateY(-1px);box-shadow:0 8px 20px rgba(15,23,42,.08)}.btn.primary{background:var(--blue);border-color:var(--blue);color:white}.btn.ghost{background:#f8fafc}.btn.wide{width:100%}.grid{display:grid;gap:18px}.stats{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:18px}.stat{padding:18px}.stat span{display:block;color:var(--muted);font-size:13px}.stat b{display:block;font-size:34px;margin:8px 0}.stat small.ok,.pill.green{color:var(--green);background:#dcfce7}.stat small.warn{color:var(--orange)}.split{display:grid;grid-template-columns:2fr 1fr;gap:18px}.org-grid{display:grid;grid-template-columns:1fr 1.2fr;gap:18px}.table{width:100%;border-collapse:collapse;font-size:14px}.table th{text-align:left;color:#64748b;font-size:12px;border-bottom:1px solid var(--line);padding:12px}.table td{border-bottom:1px solid var(--line);padding:14px 12px;vertical-align:middle}.table tr:hover{background:#f8fbff}.table small{display:block;color:var(--muted);margin-top:3px}.clickable tr{cursor:pointer}.pill{display:inline-flex;border-radius:999px;padding:5px 9px;font-size:12px;font-weight:800}.pill.blue{color:#2452d9;background:#e9efff}.pill.red{color:#dc2626;background:#fee2e2}.pill.orange{color:#d97706;background:#fef3c7}.icon-btn{border:0;background:#f8fafc;border-radius:9px;padding:7px 10px;cursor:pointer}.tabs{display:flex;gap:8px;margin-bottom:16px}.tabs button{border:0;background:#f3f6fb;border-radius:999px;padding:8px 13px}.tabs .active{background:#e9efff;color:var(--blue);font-weight:800}.org-logo{display:inline-grid;place-items:center;width:34px;height:34px;border-radius:12px;background:#e9efff;color:var(--blue);font-weight:900;margin-right:10px}.kv{display:grid;grid-template-columns:140px 1fr;gap:10px}.kv dt{color:var(--muted)}.contact{padding:12px;border:1px solid var(--line);border-radius:14px;margin-bottom:10px}.contact span{display:block;color:var(--muted);font-size:13px}.timeline div{position:relative;padding:0 0 18px 26px}.timeline i{position:absolute;left:0;top:3px;width:11px;height:11px;background:var(--blue);border-radius:50%;box-shadow:0 0 0 5px #e9efff}.timeline span{display:block;color:var(--muted);font-size:13px}.modal-backdrop{position:fixed;inset:0;background:rgba(2,6,23,.55);display:grid;place-items:center;z-index:20;animation:fade .18s}.modal{background:white;border-radius:22px;box-shadow:0 35px 80px rgba(0,0,0,.25);width:min(760px,calc(100vw - 24px));max-height:92vh;overflow:auto;animation:pop .18s}.modal-close{float:right;margin:12px;border:0;background:#f1f5f9;border-radius:10px;padding:8px 11px;cursor:pointer}.modal-form{padding:26px}.modal-form h2{margin-top:0}.modal-form label{display:block;font-weight:700;font-size:13px;margin:12px 0}.modal-form input,.modal-form select,.modal-form textarea{width:100%;border:1px solid var(--line);border-radius:12px;padding:12px;margin-top:6px}.form-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;align-items:end}.check{display:flex!important;gap:8px;align-items:center}.check input{width:auto}.toast{position:fixed;right:22px;bottom:22px;background:#071426;color:white;border-radius:16px;padding:14px 16px;box-shadow:0 18px 45px rgba(0,0,0,.25);z-index:50;animation:slide .25s}.toast.ok{border-left:5px solid var(--green)}.toast.err{border-left:5px solid var(--red)}.banner{padding:12px 14px;border-radius:14px;margin-bottom:15px;background:#fef3c7}.banner.danger{background:#fee2e2}.codebox{background:#0f172a;color:#c7d2fe;border-radius:14px;padding:14px;max-height:300px;overflow:auto}.login-body{min-height:100vh;background:radial-gradient(circle at top left,#2f63f6,#071426 45%,#020617);display:grid;place-items:center}.login-card{width:min(440px,calc(100vw - 24px));background:white;border-radius:26px;padding:34px;box-shadow:0 35px 80px rgba(0,0,0,.3)}.login-logo{width:190px;background:#071426;border-radius:14px;padding:10px}.login-card label{display:block;margin:13px 0;font-weight:700}.login-card input{width:100%;border:1px solid var(--line);border-radius:12px;padding:13px;margin-top:6px}.login-security{margin-top:16px;color:var(--muted);font-size:13px}.role-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:16px}.role-card{border:1px solid var(--line);border-radius:18px;padding:16px}.perm-list label{display:block;padding:6px 0}.security-list div{padding:10px;border-bottom:1px solid var(--line)}.logo-samples{display:flex;gap:16px;align-items:center}.logo-samples img{width:180px;border:1px solid var(--line);border-radius:14px;padding:10px;background:#071426}.logo-samples .sample-light{background:white}.bar{height:9px;background:#e9efff;border-radius:999px;overflow:hidden}.bar i{display:block;background:var(--blue);height:100%}.calendar{overflow:auto}.cal-head,.cal-row{display:grid;grid-template-columns:150px 1fr;align-items:center}.cal-head span{display:inline-block;width:90px;color:var(--muted);font-size:12px}.cal-track{position:relative;height:54px;border-bottom:1px solid var(--line);background:repeating-linear-gradient(90deg,#fff,#fff 89px,#eef2f7 90px)}.event{position:absolute;top:12px;height:30px;background:#e9efff;color:var(--blue);border:1px solid #bfd0ff;border-radius:9px;padding:6px;font-size:12px;white-space:nowrap}.event.green{background:#dcfce7;color:var(--green);border-color:#bbf7d0}.sign-body{background:#f5f7fb;display:grid;place-items:center;min-height:100vh}.sign-flow{width:min(520px,100%);background:white;border:1px solid var(--line);border-radius:26px;padding:24px;box-shadow:var(--shadow)}.sign-flow img{width:150px;background:#071426;border-radius:12px;padding:8px}.steps{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0}.steps span{padding:8px 10px;border-radius:999px;background:#f1f5f9;font-size:13px}.steps .done{background:#dcfce7;color:var(--green)}.pdf-preview,.pdf-doc{background:white;border:1px solid var(--line);border-radius:18px;padding:20px}.signature-box{border:1px solid var(--line);border-radius:12px;min-height:82px;display:grid;place-items:center;font-family:cursive;font-size:28px;background:#fbfdff}.pdf-body{background:#e5e7eb;padding:30px}.pdf-doc{width:850px;margin:auto}.pdf-doc header{display:flex;justify-content:space-between;border-bottom:2px solid #071426;padding-bottom:18px}.pdf-doc header img{width:170px}.qr{width:70px;height:70px;border:2px dashed #0f172a;display:grid;place-items:center}.pdf-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.photo-row{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.photo-row div{height:90px;border-radius:12px;background:linear-gradient(135deg,#cbd5e1,#f8fafc)}.pdf-doc footer{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:30px}@keyframes fade{from{opacity:0}}@keyframes pop{from{transform:translateY(10px) scale(.98);opacity:0}}@keyframes slide{from{transform:translateY(15px);opacity:0}}@media(max-width:1050px){.sidebar{width:80px}.sidebar span:not(.ico),.sidebar-user div,.brand img{display:none}.stats,.split,.org-grid{grid-template-columns:1fr}.topbar{height:auto;align-items:flex-start;flex-direction:column;padding:18px}.global-search{width:100%}.content{padding:14px}}
/* ServisPoint logo + icon refresh */
.brand img{width:176px;margin:4px 0 22px;display:block}.nav-svg{width:20px;height:20px;display:grid;place-items:center;flex:0 0 20px}.nav-svg svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}.nav-item{gap:13px}.ico{display:none!important}
.minimal-login{background:radial-gradient(circle at 25% 20%,rgba(47,99,246,.35),transparent 34%),linear-gradient(135deg,#061224,#0a1c34 45%,#020617)}.login-panel{width:min(420px,calc(100vw - 28px));display:grid;gap:22px;justify-items:center}.login-brand-wrap{background:rgba(2,6,23,.52);border:1px solid rgba(255,255,255,.1);border-radius:24px;padding:14px 18px;box-shadow:0 22px 60px rgba(0,0,0,.35)}.login-logo-clean{width:230px;display:block}.login-box{width:100%;background:#fff;border-radius:26px;padding:28px;box-shadow:0 35px 80px rgba(0,0,0,.32);border:1px solid rgba(255,255,255,.6)}.login-box h1{margin:0 0 18px;font-size:25px}.login-box label{display:block;margin:13px 0;font-weight:750;font-size:13px;color:#172033}.login-box input{width:100%;border:1px solid var(--line);border-radius:14px;padding:13px;margin-top:7px;background:#fbfdff}.login-links{display:flex;gap:9px;align-items:center;justify-content:center;margin-top:16px;color:#64748b}.login-links a{font-weight:800}.about-body{margin:0;background:#f5f7fb;color:#0f172a;font-family:Inter,ui-sans-serif,system-ui,Segoe UI,Arial}.about-nav{height:84px;display:flex;align-items:center;justify-content:space-between;padding:0 7vw;background:#071426}.about-nav img{width:184px}.about-nav nav{display:flex;align-items:center;gap:16px}.about-nav a:not(.btn){color:#dbe7ff;font-weight:800}.about-hero{display:grid;grid-template-columns:1.1fr .9fr;gap:42px;align-items:center;padding:72px 7vw}.eyebrow{color:#2f63f6;font-weight:900;text-transform:uppercase;letter-spacing:.08em;font-size:12px}.about-hero h1{font-size:54px;line-height:1.02;margin:12px 0 18px}.about-hero p{font-size:18px;line-height:1.65;color:#64748b;max-width:720px}.hero-actions{display:flex;gap:12px;margin-top:24px}.hero-card{background:#fff;border:1px solid var(--line);border-radius:28px;padding:22px;box-shadow:var(--shadow);display:grid;gap:14px}.mini-window{border:1px solid var(--line);border-radius:18px;padding:18px;background:#fbfdff}.mini-window b{display:block}.mini-window span{font-size:42px;font-weight:900}.mini-window.blue{background:#e9efff;color:#173eb7}.mini-window.blue p{font-size:14px;margin:8px 0 0;color:#3152ad}.about-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;padding:0 7vw 48px}.about-grid article,.about-contact{background:#fff;border:1px solid var(--line);border-radius:24px;padding:24px;box-shadow:var(--shadow)}.about-grid p,.about-contact p{color:#64748b;line-height:1.6}.about-contact{margin:0 7vw 70px}.logo-samples img[src*="white-on-black"]{background:#071426}.logo-samples img[src*="black-on-white"]{background:#fff}@media(max-width:900px){.about-hero,.about-grid{grid-template-columns:1fr}.about-hero h1{font-size:38px}.about-nav{padding:0 18px}.about-nav img{width:160px}}

.users-screen{grid-template-columns:minmax(0,1.7fr) minmax(320px,.8fr)}
.btn.ghost{background:#fff;border:1px solid #d8e1f2;color:#1f3b75}.btn.danger{background:#fff0f0;color:#b42318;border:1px solid #ffd2d2}.btn.small{padding:7px 10px;font-size:12px;border-radius:10px}
.login-box .muted{line-height:1.55}.login-box input[inputmode="numeric"],.login-box input[name="code"]{font-size:28px;letter-spacing:8px;text-align:center;font-weight:800}
.check{display:flex!important;gap:10px;align-items:flex-start;font-weight:600}.check input{width:auto!important;margin-top:3px}
.security-list{display:grid;gap:12px;color:#405174}.settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.settings-list{display:grid;gap:12px}.settings-list>div{display:flex;justify-content:space-between;gap:20px;border-bottom:1px solid #eef2f7;padding:10px 0}.settings-list span{color:#667085;text-align:right}
.detailed-roles{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}.role-title{display:flex;align-items:center;justify-content:space-between;gap:12px}.perm-list.described{display:grid;gap:8px;max-height:520px;overflow:auto;padding-right:6px}.perm-row{display:flex;gap:11px;align-items:flex-start;padding:10px;border:1px solid #eef2f7;border-radius:14px;background:#fbfdff}.perm-row input{margin-top:3px}.perm-row span{display:grid;gap:3px}.perm-row small{color:#667085;line-height:1.35}
@media(max-width:1000px){.settings-grid,.detailed-roles,.users-screen{grid-template-columns:1fr}}



/* ServisPoint V2 - Users & Roles premium UI patch */
.sp-page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin:6px 0 22px}
.sp-page-head h1{font-size:34px;line-height:1.1;margin:4px 0 8px;letter-spacing:-.04em}
.sp-page-head p{margin:0;color:#667085;max-width:720px}
.eyebrow{font-size:12px;text-transform:uppercase;letter-spacing:.12em;color:#2458ff;font-weight:800}
.hero-actions{display:flex;gap:10px;flex-wrap:wrap}
.security-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px}
.metric-card{background:linear-gradient(180deg,#fff,#f8fbff);border:1px solid #e2e8f0;border-radius:20px;padding:18px;box-shadow:0 14px 35px rgba(10,30,70,.06)}
.metric-card span{display:block;color:#667085;font-size:13px}.metric-card b{display:block;font-size:30px;margin:6px 0;color:#071225}.metric-card small{color:#667085}
.users-admin-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(360px,.65fr);gap:18px;align-items:start}
.card-head.rich{align-items:flex-start}.toolbar.compact{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.smart-input{height:40px;border:1px solid #d7deea;border-radius:12px;padding:0 12px;background:#fff;color:#0b1220}
.user-list{display:flex;flex-direction:column;gap:10px;max-height:720px;overflow:auto;padding-right:4px}
.user-row-card{display:grid;grid-template-columns:54px minmax(0,1fr) auto;gap:14px;align-items:center;padding:14px;border:1px solid #e5eaf3;border-radius:18px;background:#fff;cursor:pointer;transition:.18s ease}
.user-row-card:hover,.user-row-card.selected{border-color:#9db7ff;box-shadow:0 12px 30px rgba(36,88,255,.10);transform:translateY(-1px)}
.user-avatar{position:relative;width:48px;height:48px;border-radius:16px;background:linear-gradient(135deg,#2458ff,#73a7ff);display:grid;place-items:center;color:#fff;font-weight:900;overflow:hidden}
.user-avatar img{width:100%;height:100%;object-fit:cover}.user-avatar i{position:absolute;right:2px;bottom:2px;width:13px;height:13px;border-radius:50%;border:2px solid #fff}.user-avatar i.on{background:#22c55e}.user-avatar i.off{background:#ef4444}
.user-title{display:flex;gap:10px;align-items:center;margin-bottom:4px}.user-sub{display:flex;gap:12px;color:#667085;font-size:13px;flex-wrap:wrap}.user-side{text-align:right;display:flex;flex-direction:column;gap:6px;align-items:flex-end}.user-side small{color:#667085;max-width:220px}
.user-detail-panel{position:sticky;top:18px;min-height:420px}
.empty-detail{text-align:center;padding:44px 20px}.large-avatar{width:86px;height:86px;border-radius:28px;margin:0 auto 18px;background:#eef4ff;color:#2458ff;display:grid;place-items:center;font-size:28px;font-weight:900}
.detail-profile{display:flex;align-items:center;gap:16px;margin-bottom:18px}.detail-profile .user-avatar{width:68px;height:68px;border-radius:22px}.detail-profile h2{margin:0}.detail-profile p{margin:4px 0 0;color:#667085}
.detail-fields{display:grid;gap:10px;margin:18px 0}.detail-field{padding:12px;border:1px solid #e5eaf3;border-radius:14px;background:#f8fafc}.detail-field span{display:block;color:#667085;font-size:12px;margin-bottom:3px}.detail-field b{font-size:14px}
.detail-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:18px}
.device-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.device-card{display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:14px;align-items:center;border:1px solid #e5eaf3;border-radius:18px;padding:14px;background:#fff}.device-icon{width:44px;height:44px;border-radius:14px;background:#eef4ff;display:grid;place-items:center}.device-card p{margin:3px 0;color:#667085}.device-card small{color:#667085}.device-actions{display:flex;gap:8px;align-items:center}
.security-list.premium{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.security-list.premium div{border:1px solid #e5eaf3;border-radius:16px;padding:14px;background:#fff}.security-list.premium b{display:block;margin-bottom:5px}.security-list.premium span{color:#667085;font-size:13px}
.modal-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}.avatar-upload-preview{width:72px;height:72px;border-radius:24px;background:linear-gradient(135deg,#2458ff,#72a7ff);display:grid;place-items:center;color:#fff;font-weight:900;font-size:24px;overflow:hidden}.avatar-upload-preview img{width:100%;height:100%;object-fit:cover}
.password-rules{display:flex;gap:7px;flex-wrap:wrap;margin:10px 0 16px}.password-rules span{padding:6px 9px;border-radius:999px;background:#eef4ff;color:#2458ff;font-size:12px;font-weight:700}

/* Roles */
.role-overview-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-bottom:18px}
.role-summary-card{display:grid;grid-template-columns:56px minmax(0,1fr) auto;gap:16px;align-items:center;border:1px solid #e2e8f0;border-radius:22px;padding:18px;background:#fff;box-shadow:0 14px 35px rgba(10,30,70,.055);transition:.18s ease}
.role-summary-card:hover{transform:translateY(-1px);border-color:#9db7ff;box-shadow:0 16px 40px rgba(36,88,255,.10)}
.role-icon{width:56px;height:56px;border-radius:18px;background:#081225;color:#fff;display:grid;place-items:center;font-weight:900;font-size:22px}.role-title-line{display:flex;align-items:center;gap:10px}.role-title-line h2{margin:0}.role-summary-main p{margin:6px 0;color:#667085}.role-progress{height:8px;background:#eef2f7;border-radius:999px;overflow:hidden;margin:10px 0 6px}.role-progress i{display:block;height:100%;background:linear-gradient(90deg,#2458ff,#22c55e);border-radius:999px}
.permission-matrix{overflow:auto}.matrix-dot{display:inline-grid;place-items:center;width:26px;height:26px;border-radius:999px;font-weight:900}.matrix-dot.yes{background:#dcfce7;color:#16a34a}.matrix-dot.no{background:#f1f5f9;color:#94a3b8}
.role-modal-form{min-width:min(920px,92vw)}.role-perm-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;max-height:62vh;overflow:auto;padding-right:4px}.perm-group-card{border:1px solid #e5eaf3;border-radius:18px;padding:14px;background:#f8fafc}.perm-group-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.perm-group-head h3{margin:0;font-size:16px}.link-btn{border:0;background:transparent;color:#2458ff;font-weight:800;cursor:pointer}.perm-switch{display:grid;grid-template-columns:42px minmax(0,1fr);gap:10px;align-items:start;padding:11px;border-radius:14px;cursor:pointer}.perm-switch:hover{background:#fff}.perm-switch input{display:none}.switch-ui{width:38px;height:22px;border-radius:999px;background:#cbd5e1;position:relative;transition:.18s}.switch-ui:after{content:"";position:absolute;width:18px;height:18px;border-radius:50%;background:#fff;left:2px;top:2px;transition:.18s;box-shadow:0 2px 5px rgba(0,0,0,.18)}.perm-switch input:checked + .switch-ui{background:#2458ff}.perm-switch input:checked + .switch-ui:after{left:18px}.perm-switch b{display:block;font-size:13px}.perm-switch small{display:block;color:#667085;margin-top:3px;line-height:1.35}.modal-actions.sticky{position:sticky;bottom:-18px;background:linear-gradient(180deg,rgba(255,255,255,.75),#fff 35%);padding-top:14px}

@media(max-width:1100px){.users-admin-grid{grid-template-columns:1fr}.user-detail-panel{position:static}.security-metrics,.security-list.premium{grid-template-columns:repeat(2,minmax(0,1fr))}.device-grid,.role-overview-grid{grid-template-columns:1fr}}
@media(max-width:700px){.sp-page-head{align-items:flex-start;flex-direction:column}.security-metrics,.security-list.premium{grid-template-columns:1fr}.user-row-card{grid-template-columns:48px minmax(0,1fr)}.user-side{grid-column:2;text-align:left;align-items:flex-start}.role-perm-groups{grid-template-columns:1fr}.device-card{grid-template-columns:44px minmax(0,1fr)}.device-actions{grid-column:2}}



/* ------------------------------------------------------------------
   ServisPoint V2 - Users/Roles layout FIX
   Oprava rozházeného rozložení v modálu rolí a kartách uživatelů.
------------------------------------------------------------------- */

/* Modal: nesmí dělat horizontální posuvník celé stránky */
.modal-backdrop,
.modal-backdrop * {
  box-sizing: border-box;
}

.modal-backdrop {
  overflow: hidden !important;
}

.modal-backdrop .modal {
  width: min(1040px, calc(100vw - 36px)) !important;
  max-width: calc(100vw - 36px) !important;
  max-height: calc(100vh - 36px) !important;
  overflow: auto !important;
  padding: 26px !important;
  border-radius: 24px !important;
}

/* Role modal uvnitř */
.role-modal-form {
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

.role-modal-form .form-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 14px !important;
}

.role-modal-form input[type="text"],
.role-modal-form input:not([type]),
.role-modal-form textarea,
.role-modal-form select {
  width: 100% !important;
  min-width: 0 !important;
}

.role-perm-groups {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
  max-height: min(58vh, 620px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: 4px !important;
}

.perm-group-card {
  min-width: 0 !important;
  overflow: hidden !important;
  padding: 14px !important;
  border-radius: 18px !important;
}

.perm-group-head {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 12px !important;
  margin-bottom: 8px !important;
}

.perm-group-head h3 {
  min-width: 0 !important;
  font-size: 16px !important;
  line-height: 1.25 !important;
}

/* Důležitá oprava: původní checkbox nesmí zůstat viditelný */
.perm-switch {
  display: grid !important;
  grid-template-columns: 46px minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: start !important;
  width: 100% !important;
  min-width: 0 !important;
  padding: 10px !important;
  border-radius: 14px !important;
  position: relative !important;
}

.perm-switch input[type="checkbox"] {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
}

.perm-switch .switch-ui {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 40px !important;
  height: 24px !important;
  flex: 0 0 40px !important;
  margin-top: 2px !important;
  display: block !important;
}

.perm-switch > span:last-child {
  grid-column: 2 !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.perm-switch b {
  display: block !important;
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  line-height: 1.25 !important;
  font-size: 13px !important;
}

.perm-switch small {
  display: block !important;
  max-width: 100% !important;
  overflow-wrap: normal !important;
  line-height: 1.35 !important;
  margin-top: 3px !important;
}

/* Sticky tlačítko dole bez horizontálního přesahu */
.modal-actions.sticky {
  left: 0 !important;
  right: 0 !important;
  margin-left: -2px !important;
  margin-right: -2px !important;
  padding: 14px 0 0 !important;
}

.modal-actions.sticky .btn,
.role-modal-form .modal-actions .btn {
  width: 100% !important;
  max-width: 100% !important;
}

/* Karty uživatelů: pevnější rozložení, méně rozpadání */
.users-master .card-head.rich {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  gap: 18px !important;
}

.users-master .toolbar.compact {
  flex: 0 0 auto !important;
  display: flex !important;
  gap: 10px !important;
  align-items: center !important;
}

.users-master .toolbar.compact .smart-input {
  width: 230px !important;
  max-width: 100% !important;
}

.user-row-card {
  grid-template-columns: 56px minmax(260px, 1fr) minmax(170px, auto) !important;
  min-height: 88px !important;
  align-items: center !important;
}

.user-main {
  min-width: 0 !important;
}

.user-title {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  align-items: center !important;
}

.user-title b {
  font-size: 16px !important;
  line-height: 1.2 !important;
  min-width: 0 !important;
}

.user-sub {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 7px 12px !important;
  line-height: 1.3 !important;
}

.user-side {
  min-width: 150px !important;
  align-items: flex-end !important;
  justify-content: center !important;
}

.user-side small {
  max-width: 210px !important;
  text-align: right !important;
  line-height: 1.35 !important;
}

.user-detail-panel .detail-profile {
  display: grid !important;
  grid-template-columns: 72px minmax(0, 1fr) !important;
}

.user-detail-panel .detail-profile h2 {
  font-size: 24px !important;
  line-height: 1.15 !important;
  word-break: normal !important;
}

/* Detail uživatele - lepší zarovnání */
.detail-fields {
  grid-template-columns: 1fr !important;
}

.detail-field {
  min-width: 0 !important;
}

.detail-field b {
  overflow-wrap: anywhere !important;
}

/* Obecná oprava tlačítek a pills */
.pill {
  white-space: nowrap !important;
}

.btn.small {
  min-height: 34px !important;
  padding: 0 12px !important;
}

/* Role cards */
.role-summary-card {
  grid-template-columns: 56px minmax(0, 1fr) auto !important;
  min-width: 0 !important;
}

.role-summary-main {
  min-width: 0 !important;
}

.role-summary-main p {
  overflow-wrap: normal !important;
}

/* Mobil/tablet */
@media (max-width: 1180px) {
  .role-perm-groups {
    grid-template-columns: 1fr !important;
    max-height: none !important;
  }

  .role-modal-form .form-row {
    grid-template-columns: 1fr !important;
  }

  .users-master .card-head.rich {
    flex-direction: column !important;
  }

  .users-master .toolbar.compact {
    width: 100% !important;
  }

  .users-master .toolbar.compact .smart-input {
    flex: 1 1 220px !important;
    width: auto !important;
  }
}

@media (max-width: 760px) {
  .modal-backdrop .modal {
    width: calc(100vw - 18px) !important;
    max-width: calc(100vw - 18px) !important;
    max-height: calc(100vh - 18px) !important;
    padding: 18px !important;
    border-radius: 20px !important;
  }

  .user-row-card {
    grid-template-columns: 52px minmax(0, 1fr) !important;
  }

  .user-side {
    grid-column: 1 / -1 !important;
    min-width: 0 !important;
    align-items: flex-start !important;
    text-align: left !important;
    padding-left: 64px !important;
  }

  .user-side small {
    text-align: left !important;
    max-width: 100% !important;
  }

  .security-metrics {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 520px) {
  .security-metrics {
    grid-template-columns: 1fr !important;
  }

  .users-master .toolbar.compact {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .users-master .toolbar.compact .smart-input {
    width: 100% !important;
  }
}



/* ------------------------------------------------------------------
   ServisPoint V2 - USER CARD ALIGNMENT FIX
   Oprava rozložení karet uživatelů: role/aktivita už nelítá úplně vpravo.
------------------------------------------------------------------- */

.users-admin-grid {
  grid-template-columns: minmax(0, 1fr) !important;
}

.user-detail-panel {
  display: none !important;
}

/* Karta uživatele má pevný logický layout */
.user-row-card {
  display: grid !important;
  grid-template-columns: 56px minmax(260px, 1fr) 260px !important;
  gap: 14px !important;
  align-items: center !important;
  min-height: 90px !important;
  padding: 14px 16px !important;
  width: 100% !important;
}

/* Střední část */
.user-main {
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

.user-title {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
  margin-bottom: 6px !important;
}

.user-title b {
  font-size: 16px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}

.user-sub {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
  color: #667085 !important;
  font-size: 13px !important;
  line-height: 1.3 !important;
}

.user-sub span {
  display: inline-flex !important;
  align-items: center !important;
}

/* Pravá část jako kompaktní box, ne roztažený text */
.user-side {
  min-width: 0 !important;
  width: 260px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  justify-content: center !important;
  gap: 8px !important;
  text-align: right !important;
}

.user-side .pill {
  align-self: flex-end !important;
  max-width: 140px !important;
}

.user-side small {
  display: block !important;
  width: 100% !important;
  max-width: 260px !important;
  text-align: right !important;
  color: #667085 !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  overflow-wrap: normal !important;
}

/* Když je text aktivity dlouhý, nerozbije kartu */
.user-side small br {
  display: none !important;
}

/* Nadpis karty a filtry */
.users-master .card-head.rich {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  gap: 18px !important;
}

.users-master .card-head.rich h2 {
  margin-bottom: 8px !important;
}

.users-master .card-head.rich p {
  max-width: 620px !important;
  line-height: 1.45 !important;
}

.users-master .toolbar.compact {
  display: grid !important;
  grid-template-columns: 230px 230px !important;
  gap: 10px !important;
  align-items: center !important;
}

.users-master .toolbar.compact .smart-input {
  width: 100% !important;
}

/* Lepší mezery v seznamu */
.user-list {
  gap: 12px !important;
  padding-top: 6px !important;
}

/* Avatar */
.user-avatar {
  width: 48px !important;
  height: 48px !important;
  border-radius: 16px !important;
}

/* Tablet */
@media (max-width: 980px) {
  .users-master .card-head.rich {
    grid-template-columns: 1fr !important;
  }

  .users-master .toolbar.compact {
    grid-template-columns: 1fr 1fr !important;
    width: 100% !important;
  }

  .user-row-card {
    grid-template-columns: 56px minmax(0, 1fr) !important;
    align-items: start !important;
  }

  .user-side {
    grid-column: 2 !important;
    width: 100% !important;
    align-items: flex-start !important;
    text-align: left !important;
    margin-top: 6px !important;
  }

  .user-side .pill {
    align-self: flex-start !important;
  }

  .user-side small {
    text-align: left !important;
    max-width: 100% !important;
  }
}

/* Mobil */
@media (max-width: 620px) {
  .users-master .toolbar.compact {
    grid-template-columns: 1fr !important;
  }

  .user-row-card {
    grid-template-columns: 48px minmax(0, 1fr) !important;
    gap: 12px !important;
    padding: 13px !important;
  }

  .user-avatar {
    width: 44px !important;
    height: 44px !important;
  }

  .user-title b {
    white-space: normal !important;
  }

  .user-sub {
    display: grid !important;
    gap: 4px !important;
  }
}



/* ------------------------------------------------------------------
   ServisPoint V2 - RESTORE USER DETAIL PANEL
   Vrací detail uživatele a současně drží pěkné zarovnání karet.
------------------------------------------------------------------- */

.users-admin-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr) !important;
  gap: 18px !important;
  align-items: start !important;
}

.user-detail-panel {
  display: block !important;
  position: sticky !important;
  top: 18px !important;
  min-height: 420px !important;
}

/* Karty v levém seznamu nesmí tlačit detail pryč */
.user-row-card {
  grid-template-columns: 56px minmax(0, 1fr) 170px !important;
  gap: 14px !important;
}

.user-side {
  width: 170px !important;
  max-width: 170px !important;
}

.user-side small {
  max-width: 170px !important;
  font-size: 12px !important;
}

/* Detail panel */
.user-detail-panel .empty-detail,
.user-detail-panel .detail-profile,
.user-detail-panel .detail-fields,
.user-detail-panel .detail-actions {
  width: 100% !important;
}

.user-detail-panel .detail-profile {
  display: grid !important;
  grid-template-columns: 72px minmax(0, 1fr) !important;
  gap: 14px !important;
  align-items: center !important;
}

.user-detail-panel .detail-profile h2 {
  font-size: 23px !important;
  line-height: 1.15 !important;
  margin: 0 !important;
}

.user-detail-panel .detail-profile p {
  margin: 5px 0 0 !important;
  color: #667085 !important;
  overflow-wrap: anywhere !important;
}

.user-detail-panel .detail-fields {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
  margin-top: 18px !important;
}

.user-detail-panel .detail-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
}

.user-detail-panel .security-list {
  display: grid !important;
  gap: 8px !important;
}

.user-detail-panel .security-list div {
  border: 1px solid #e5eaf3 !important;
  background: #f8fafc !important;
  border-radius: 14px !important;
  padding: 10px 12px !important;
  font-size: 13px !important;
}

/* Na užších displejích detail přejde pod seznam */
@media (max-width: 1180px) {
  .users-admin-grid {
    grid-template-columns: 1fr !important;
  }

  .user-detail-panel {
    position: static !important;
  }

  .user-row-card {
    grid-template-columns: 56px minmax(0, 1fr) 220px !important;
  }

  .user-side {
    width: 220px !important;
    max-width: 220px !important;
  }

  .user-side small {
    max-width: 220px !important;
  }
}

@media (max-width: 760px) {
  .user-row-card {
    grid-template-columns: 52px minmax(0, 1fr) !important;
  }

  .user-side {
    grid-column: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    align-items: flex-start !important;
    text-align: left !important;
  }

  .user-side small {
    text-align: left !important;
    max-width: 100% !important;
  }

  .user-detail-panel .detail-actions {
    grid-template-columns: 1fr !important;
  }
}



/* ServisPoint V2 - save spinner + avatar upload visibility */
.btn.is-loading,
button.is-loading {
  position: relative !important;
  pointer-events: none !important;
  opacity: .82 !important;
  color: transparent !important;
}

.btn.is-loading::after,
button.is-loading::after {
  content: "" !important;
  width: 18px !important;
  height: 18px !important;
  border-radius: 50% !important;
  border: 2px solid rgba(255,255,255,.45) !important;
  border-top-color: #fff !important;
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  margin-left: -9px !important;
  margin-top: -9px !important;
  animation: spSpin .75s linear infinite !important;
}

@keyframes spSpin { to { transform: rotate(360deg); } }

.form-saving-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.62);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  z-index: 20;
  border-radius: inherit;
}

.form-saving-overlay > div {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #081225;
  color: #fff;
  padding: 12px 16px;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(8,18,37,.22);
  font-weight: 800;
}

.form-saving-overlay i {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spSpin .75s linear infinite;
}

.user-avatar img,
.avatar-upload-preview img,
.sidebar-user img,
.profile-avatar img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

.avatar-upload-preview.has-image {
  background: #fff !important;
  border: 1px solid #dbe4f0 !important;
}



/* ServisPoint V2 - avatar display fix */
.user-avatar img,
.avatar-upload-preview img,
.large-avatar img {
  display:block !important;
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
}

.user-avatar img[src=""],
.user-avatar img:not([src]) {
  display:none !important;
}

.user-avatar:has(img) span {
  display:none !important;
}



/* ------------------------------------------------------------------
   ServisPoint V2 - duplicate page header fix
   Horní globální hlavička už u moderních stránek neduplikuje název.
------------------------------------------------------------------- */

/* Schováme textový blok v horní liště jen na stránkách, které mají vlastní hero hlavičku */
body:has(.users-hero) .topbar > div:first-child,
body:has(.roles-hero) .topbar > div:first-child {
  display: none !important;
}

/* Horní lišta potom funguje jen jako akční/search lišta */
body:has(.users-hero) .topbar,
body:has(.roles-hero) .topbar {
  justify-content: flex-end !important;
  min-height: 72px !important;
}

/* Vlastní hero hlavička dostane lepší odsazení, aby nepůsobila jako druhý titulek nalepený pod topbarem */
body:has(.users-hero) .sp-page-head,
body:has(.roles-hero) .sp-page-head {
  margin-top: 0 !important;
  padding-top: 4px !important;
}

/* Kdyby prohlížeč nepodporoval :has(), použije JS třídu níže */
body.sp-modern-page .topbar > div:first-child {
  display: none !important;
}

body.sp-modern-page .topbar {
  justify-content: flex-end !important;
  min-height: 72px !important;
}

body.sp-modern-page .sp-page-head {
  margin-top: 0 !important;
  padding-top: 4px !important;
}



/* ------------------------------------------------------------------
   ServisPoint V2 - compact layout patch
   Cíl: více obsahu na stránce, menší hlavičky, menší metriky,
   akce a hledání kontextově pro aktuální stránku.
------------------------------------------------------------------- */

:root {
  --sp-compact-card-radius: 18px;
}

/* Celkové zahuštění obsahu */
.main,
.content,
.page,
.app-main {
  --compact-gap: 12px;
}

main,
.main-content,
.content {
  padding-top: 14px !important;
}

/* Horní lišta zůstává, ale je nižší a bez obřího titulku */
.topbar {
  min-height: 58px !important;
  padding: 10px 18px !important;
  gap: 10px !important;
  border-bottom: 1px solid #e5eaf3 !important;
}

.topbar > div:first-child {
  display: none !important;
}

.topbar .search,
.topbar input[type="search"],
.topbar input[placeholder*="Hledat zakázku"] {
  height: 38px !important;
  min-width: 280px !important;
  max-width: 420px !important;
}

.topbar .btn,
.topbar button {
  min-height: 38px !important;
  padding: 0 14px !important;
}

/* Na těchto stránkách nechceme generické tlačítko Nová organizace v topbaru */
body.sp-page-users .topbar .btn.primary,
body.sp-page-roles .topbar .btn.primary {
  display: none !important;
}

/* Hero hlavička výrazně menší */
.sp-page-head,
.users-hero,
.roles-hero {
  margin: 0 0 10px !important;
  padding: 0 !important;
  align-items: flex-start !important;
}

.sp-page-head h1,
.users-hero h1,
.roles-hero h1 {
  font-size: 26px !important;
  line-height: 1.08 !important;
  margin: 2px 0 4px !important;
  letter-spacing: -0.035em !important;
}

.sp-page-head p,
.users-hero p,
.roles-hero p {
  font-size: 13px !important;
  line-height: 1.35 !important;
  max-width: 760px !important;
}

.eyebrow {
  font-size: 11px !important;
  letter-spacing: .10em !important;
  margin-bottom: 2px !important;
}

/* Kontextová lišta akcí pod titulkem */
.page-local-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  margin: -4px 0 12px !important;
  flex-wrap: wrap !important;
}

.page-local-toolbar .smart-input {
  height: 38px !important;
  border-radius: 12px !important;
  min-width: 220px !important;
  padding: 0 12px !important;
  font-size: 13px !important;
}

.page-local-toolbar .btn {
  min-height: 38px !important;
  padding: 0 14px !important;
  border-radius: 12px !important;
  font-size: 13px !important;
}

/* Metriky menší a méně dominantní */
.security-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin-bottom: 12px !important;
}

.metric-card {
  border-radius: var(--sp-compact-card-radius) !important;
  padding: 12px 14px !important;
  min-height: 86px !important;
}

.metric-card span {
  font-size: 12px !important;
}

.metric-card b {
  font-size: 24px !important;
  line-height: 1.05 !important;
  margin: 4px 0 !important;
}

.metric-card small {
  font-size: 12px !important;
}

/* Karty a tabulky hustší */
.card {
  border-radius: var(--sp-compact-card-radius) !important;
  padding: 16px !important;
}

.card-head.rich {
  margin-bottom: 10px !important;
}

.card-head.rich h2,
.users-master h2 {
  font-size: 22px !important;
  margin-bottom: 5px !important;
}

.card-head.rich p,
.users-master p {
  font-size: 13px !important;
  line-height: 1.35 !important;
}

/* Seznam uživatelů kompaktnější */
.users-admin-grid {
  gap: 14px !important;
}

.user-list {
  gap: 8px !important;
  max-height: calc(100vh - 330px) !important;
}

.user-row-card {
  min-height: 72px !important;
  padding: 10px 12px !important;
  border-radius: 16px !important;
  grid-template-columns: 48px minmax(0, 1fr) 150px !important;
}

.user-avatar {
  width: 42px !important;
  height: 42px !important;
  border-radius: 14px !important;
}

.user-title {
  margin-bottom: 3px !important;
  gap: 7px !important;
}

.user-title b {
  font-size: 15px !important;
}

.user-sub {
  font-size: 12px !important;
  gap: 8px !important;
}

.user-side {
  width: 150px !important;
  max-width: 150px !important;
  gap: 5px !important;
}

.user-side small {
  max-width: 150px !important;
  font-size: 11.5px !important;
  line-height: 1.25 !important;
}

/* Pravý detail menší, ale čitelný */
.user-detail-panel {
  top: 12px !important;
}

.user-detail-panel .detail-profile {
  grid-template-columns: 56px minmax(0, 1fr) !important;
  gap: 12px !important;
  margin-bottom: 12px !important;
}

.user-detail-panel .detail-profile .user-avatar {
  width: 52px !important;
  height: 52px !important;
  border-radius: 16px !important;
}

.user-detail-panel .detail-profile h2 {
  font-size: 21px !important;
}

.detail-fields {
  gap: 8px !important;
  margin: 12px 0 !important;
}

.detail-field {
  padding: 10px 12px !important;
  border-radius: 13px !important;
}

.detail-field span {
  font-size: 11.5px !important;
}

.detail-field b {
  font-size: 13px !important;
}

.detail-actions {
  gap: 8px !important;
}

.detail-actions .btn {
  min-height: 38px !important;
  font-size: 13px !important;
}

/* Role stránka kompaktnější */
.role-overview-grid {
  gap: 10px !important;
  margin-bottom: 12px !important;
}

.role-summary-card {
  padding: 13px 14px !important;
  border-radius: 18px !important;
  grid-template-columns: 46px minmax(0, 1fr) auto !important;
}

.role-icon {
  width: 44px !important;
  height: 44px !important;
  border-radius: 15px !important;
  font-size: 18px !important;
}

.role-title-line h2 {
  font-size: 18px !important;
}

.role-summary-main p {
  font-size: 12.5px !important;
  line-height: 1.35 !important;
  margin: 4px 0 !important;
}

.role-progress {
  height: 6px !important;
  margin: 7px 0 4px !important;
}

.permission-matrix table,
.table {
  font-size: 12.5px !important;
}

.table th,
.table td {
  padding: 8px 10px !important;
}

/* Modály o něco menší */
.modal-backdrop .modal {
  padding: 22px !important;
}

.modal-title-row h2 {
  font-size: 22px !important;
}

.modal-title-row p {
  font-size: 13px !important;
}

.role-perm-groups {
  max-height: min(56vh, 560px) !important;
}

.perm-group-card {
  padding: 12px !important;
}

.perm-switch {
  padding: 8px !important;
}

.perm-switch b {
  font-size: 12.5px !important;
}

.perm-switch small {
  font-size: 11.5px !important;
}

/* Sidebar trochu kompaktnější */
.sidebar nav a,
.sidebar .nav a,
.side-nav a {
  min-height: 40px !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

.sidebar {
  width: 230px;
}

/* Responsivita */
@media (max-width: 1180px) {
  .security-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .page-local-toolbar {
    justify-content: flex-start !important;
  }

  .user-list {
    max-height: none !important;
  }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 54px !important;
    padding: 8px 12px !important;
  }

  .topbar .search,
  .topbar input[type="search"],
  .topbar input[placeholder*="Hledat zakázku"] {
    display: none !important;
  }

  .sp-page-head h1,
  .users-hero h1,
  .roles-hero h1 {
    font-size: 23px !important;
  }

  .security-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .metric-card {
    padding: 10px 12px !important;
    min-height: 76px !important;
  }

  .metric-card b {
    font-size: 22px !important;
  }

  .page-local-toolbar {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
  }

  .page-local-toolbar .smart-input,
  .page-local-toolbar .btn {
    width: 100% !important;
  }

  .user-row-card {
    grid-template-columns: 44px minmax(0, 1fr) !important;
    min-height: 70px !important;
  }

  .user-side {
    grid-column: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}



/* ------------------------------------------------------------------
   ServisPoint V2 - single header compact patch
   Uživatelé / Role: žádná dvojitá hlavička. Topbar se skryje,
   ovládání je přímo v jedné kompaktní hlavičce stránky.
------------------------------------------------------------------- */

body.sp-page-users .topbar,
body.sp-page-roles .topbar,
body:has(.single-page-head.users-hero) .topbar,
body:has(.single-page-head.roles-hero) .topbar {
  display: none !important;
}

/* Odstranění horní prázdné mezery po topbaru */
body.sp-page-users .content,
body.sp-page-users main,
body.sp-page-users .main-content,
body.sp-page-roles .content,
body.sp-page-roles main,
body.sp-page-roles .main-content,
body:has(.single-page-head.users-hero) .content,
body:has(.single-page-head.users-hero) main,
body:has(.single-page-head.users-hero) .main-content,
body:has(.single-page-head.roles-hero) .content,
body:has(.single-page-head.roles-hero) main,
body:has(.single-page-head.roles-hero) .main-content {
  padding-top: 12px !important;
}

/* Jediná hlavička stránky */
.single-page-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: end !important;
  gap: 16px !important;
  margin: 0 0 12px !important;
  padding: 0 !important;
}

.single-title {
  min-width: 0 !important;
}

.single-title h1 {
  font-size: 25px !important;
  line-height: 1.08 !important;
  letter-spacing: -0.035em !important;
  margin: 2px 0 4px !important;
}

.single-title p {
  margin: 0 !important;
  color: #667085 !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
  max-width: 760px !important;
}

.single-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
}

.single-actions .smart-input {
  height: 36px !important;
  min-width: 210px !important;
  border-radius: 11px !important;
  padding: 0 11px !important;
  font-size: 13px !important;
}

.single-actions select.smart-input {
  min-width: 170px !important;
}

.single-actions .btn {
  min-height: 36px !important;
  height: 36px !important;
  padding: 0 13px !important;
  border-radius: 11px !important;
  font-size: 13px !important;
  white-space: nowrap !important;
}

/* Ještě kompaktnější metriky */
.security-metrics {
  gap: 9px !important;
  margin-bottom: 11px !important;
}

.metric-card {
  padding: 10px 13px !important;
  min-height: 74px !important;
  border-radius: 16px !important;
}

.metric-card span {
  font-size: 11.5px !important;
}

.metric-card b {
  font-size: 22px !important;
  margin: 3px 0 !important;
}

.metric-card small {
  font-size: 11.5px !important;
}

/* Karta uživatelů blíž k metrikám */
.users-admin-grid {
  gap: 12px !important;
}

.users-master.card,
.user-detail-panel.card {
  padding: 14px !important;
}

.users-master .card-head.rich {
  margin-bottom: 8px !important;
}

.users-master h2 {
  font-size: 21px !important;
}

/* Uvnitř seznamu uživatelů už není potřeba další hledání, kdyby někde zůstalo */
.users-master .toolbar.compact {
  display: none !important;
}

/* Role stránka */
.role-overview-grid {
  margin-top: 0 !important;
}

/* Responsivita */
@media (max-width: 1280px) {
  .single-page-head {
    grid-template-columns: 1fr !important;
    align-items: start !important;
  }

  .single-actions {
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }
}

@media (max-width: 760px) {
  .single-title h1 {
    font-size: 22px !important;
  }

  .single-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    width: 100% !important;
  }

  .single-actions .smart-input,
  .single-actions .btn {
    width: 100% !important;
    min-width: 0 !important;
  }

  .security-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}



/* ServisPoint V2 - permissions polish */
.user-detail-panel .detail-actions:empty {
  display: none !important;
}



/* ServisPoint V2 - modal unlock visual fix */
.form-saving-overlay {
  transition: opacity .15s ease;
}

form.ajax-form:not([data-submitting="1"]) .is-loading {
  pointer-events: auto !important;
  opacity: 1 !important;
  color: inherit !important;
}



/* ServisPoint V2 - Settings page */
.settings-hero.single-page-head {
  margin-bottom: 12px !important;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, .72fr);
  gap: 14px;
  align-items: start;
}

.settings-card {
  min-width: 0;
}

.settings-card:nth-child(1),
.settings-card:nth-child(2) {
  grid-column: auto;
}

.settings-card textarea {
  width: 100%;
  resize: vertical;
}

.asset-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.asset-card {
  display: grid;
  grid-template-columns: 92px minmax(0,1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #e5eaf3;
  background: #f8fafc;
  border-radius: 16px;
  padding: 10px;
}

.asset-preview {
  width: 92px;
  height: 64px;
  border-radius: 14px;
  background: linear-gradient(135deg,#eef4ff,#ffffff);
  border: 1px dashed #b9c7e5;
  display: grid;
  place-items: center;
  color: #2458ff;
  font-weight: 900;
  overflow: hidden;
}

.asset-preview.has-image {
  border-style: solid;
  background: #fff;
}

.asset-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.asset-info {
  min-width: 0;
}

.asset-info b {
  display: block;
  margin-bottom: 3px;
}

.asset-info small,
.asset-info em {
  display: block;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.asset-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 10px;
  margin: 10px 0 14px;
}

.option-grid.compact {
  grid-template-columns: repeat(2,minmax(0,1fr));
}

.option-card {
  display: grid;
  grid-template-columns: 22px minmax(0,1fr);
  gap: 9px;
  align-items: start;
  border: 1px solid #e5eaf3;
  border-radius: 16px;
  background: #f8fafc;
  padding: 11px;
  cursor: pointer;
}

.option-card:has(input:checked) {
  border-color: #9db7ff;
  background: #f4f7ff;
  box-shadow: 0 8px 22px rgba(36,88,255,.08);
}

.option-card input {
  margin-top: 3px;
}

.option-card b {
  display: block;
  font-size: 13px;
}

.option-card small {
  display: block;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 2px;
}

.preview-card {
  position: sticky;
  top: 12px;
}

.protocol-preview {
  border: 1px solid #e5eaf3;
  border-radius: 18px;
  background: #fff;
  padding: 16px;
  box-shadow: inset 0 0 0 1px #fff;
}

.protocol-preview-head {
  display: grid;
  grid-template-columns: 150px minmax(0,1fr);
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid #e5eaf3;
  padding-bottom: 12px;
}

.protocol-preview-head img {
  max-width: 140px;
  max-height: 58px;
  object-fit: contain;
}

.protocol-preview-head b,
.protocol-preview-head span {
  display: block;
}

.protocol-preview-head span {
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.protocol-preview h3 {
  margin: 16px 0 10px;
  font-size: 20px;
}

.protocol-preview-box {
  display: grid;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e5eaf3;
  border-radius: 14px;
  padding: 12px;
  font-size: 13px;
}

.protocol-preview-sign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.protocol-preview-sign div {
  min-height: 110px;
  border: 1px dashed #c9d5ea;
  border-radius: 14px;
  display: grid;
  place-items: center;
  padding: 10px;
}

.protocol-preview-sign img {
  max-width: 100%;
  max-height: 72px;
  object-fit: contain;
}

.protocol-preview-sign span {
  color: #667085;
  font-size: 12px;
}

@media(max-width:1200px){
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .preview-card {
    position: static;
  }
}

@media(max-width:760px){
  .asset-card {
    grid-template-columns: 74px minmax(0,1fr);
  }
  .asset-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .asset-preview {
    width: 74px;
    height: 58px;
  }
  .option-grid,
  .option-grid.compact {
    grid-template-columns: 1fr;
  }
}

body.sp-page-settings .topbar,
body:has(.settings-hero) .topbar {
  display: none !important;
}



/* ------------------------------------------------------------------
   ServisPoint V2 - Settings polish v2
------------------------------------------------------------------- */

.settings-polished {
  align-items: start !important;
}

.settings-polished .settings-card {
  padding: 18px !important;
  border-radius: 20px !important;
}

.settings-polished .card-head.rich {
  margin-bottom: 14px !important;
}

.settings-polished .card-head.rich h2 {
  font-size: 21px !important;
  margin: 0 0 5px !important;
}

.settings-polished .card-head.rich p {
  font-size: 13px !important;
  line-height: 1.4 !important;
}

.settings-form-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
}

.settings-form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.settings-form-grid .wide {
  grid-column: 1 / -1 !important;
}

.settings-polished label {
  display: grid !important;
  gap: 6px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  color: #142033 !important;
}

.settings-polished input[type="text"],
.settings-polished input[type="email"],
.settings-polished input:not([type]),
.settings-polished textarea,
.settings-polished select {
  width: 100% !important;
  min-height: 42px !important;
  border: 1px solid #d9e2ef !important;
  border-radius: 13px !important;
  background: #fff !important;
  padding: 10px 12px !important;
  font: inherit !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #0b1220 !important;
  outline: none !important;
  box-shadow: 0 1px 0 rgba(10,30,70,.02) !important;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease !important;
}

.settings-polished textarea {
  min-height: 92px !important;
  resize: vertical !important;
  line-height: 1.45 !important;
}

.settings-polished input:focus,
.settings-polished textarea:focus,
.settings-polished select:focus {
  border-color: #8aacff !important;
  box-shadow: 0 0 0 4px rgba(36,88,255,.10) !important;
}

.settings-block-title {
  margin: 16px 0 8px !important;
}

.settings-block-title b {
  display: block !important;
  font-size: 14px !important;
  color: #0b1220 !important;
  margin-bottom: 3px !important;
}

.settings-block-title span {
  display: block !important;
  font-size: 12px !important;
  color: #667085 !important;
  line-height: 1.4 !important;
}

.settings-polished .option-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin: 8px 0 12px !important;
}

.settings-polished .option-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.settings-polished .option-card {
  display: grid !important;
  grid-template-columns: 22px minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: start !important;
  border: 1px solid #e1e8f3 !important;
  border-radius: 16px !important;
  background: #f8fafc !important;
  padding: 12px !important;
  cursor: pointer !important;
  min-height: 78px !important;
}

.settings-polished .option-card input {
  width: 16px !important;
  height: 16px !important;
  margin: 2px 0 0 !important;
  accent-color: #2458ff !important;
}

.settings-polished .option-card:has(input:checked) {
  border-color: #8aacff !important;
  background: #f4f7ff !important;
  box-shadow: 0 10px 24px rgba(36,88,255,.08) !important;
}

.settings-polished .option-card b {
  display: block !important;
  font-size: 13px !important;
  color: #0b1220 !important;
  margin-bottom: 3px !important;
}

.settings-polished .option-card small {
  display: block !important;
  color: #667085 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}

.settings-polished .asset-card {
  grid-template-columns: 94px minmax(0, 1fr) auto !important;
  padding: 12px !important;
  border-radius: 17px !important;
  background: #f8fafc !important;
  border: 1px solid #e1e8f3 !important;
}

.settings-polished .asset-preview {
  width: 94px !important;
  height: 64px !important;
  border-radius: 15px !important;
  background: linear-gradient(135deg,#eef4ff,#fff) !important;
}

.settings-polished .asset-info b {
  font-size: 14px !important;
}

.settings-polished .asset-info small,
.settings-polished .asset-info em {
  font-size: 12px !important;
  line-height: 1.35 !important;
}

.settings-polished .file-btn {
  cursor: pointer !important;
}

.settings-polished .preview-card,
.settings-polished .protocol-preview {
  display: none !important;
}

@media(max-width:1100px){
  .settings-form-grid.two,
  .settings-polished .option-grid,
  .settings-polished .option-grid.compact {
    grid-template-columns: 1fr !important;
  }
}

@media(max-width:760px){
  .settings-polished .asset-card {
    grid-template-columns: 74px minmax(0, 1fr) !important;
  }

  .settings-polished .asset-preview {
    width: 74px !important;
    height: 58px !important;
  }

  .settings-polished .asset-actions {
    grid-column: 1 / -1 !important;
    justify-content: flex-start !important;
  }
}



/* ServisPoint V2 - settings saving overlay */
.settings-saving-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: rgba(8, 18, 37, .28);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}

.settings-saving-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.settings-saving-box {
  min-width: 280px;
  max-width: 420px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 28px 80px rgba(8,18,37,.28);
  padding: 24px;
  text-align: center;
  color: #0b1220;
}

.settings-saving-box i {
  width: 42px;
  height: 42px;
  display: block;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 4px solid #e7edff;
  border-top-color: #2458ff;
  animation: spSpin .75s linear infinite;
}

.settings-saving-box b {
  display: block;
  font-size: 18px;
  margin-bottom: 7px;
}

.settings-saving-box span {
  display: block;
  color: #667085;
  font-size: 13px;
  line-height: 1.45;
}

button.settings-saving-button {
  min-width: 150px;
}


/* ServisPoint V2 - SVG asset support */
.asset-preview img[src^="data:image/svg+xml"]{width:100%;height:100%;object-fit:contain;}



/* ServisPoint V2 - Organizations page */
body.sp-page-organizations .topbar,
body:has(.orgs-hero) .topbar { display:none!important; }

.org-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(380px,.58fr);gap:14px;align-items:start}
.org-table-card{min-width:0}
.org-table-wrap{overflow:auto;max-height:calc(100vh - 310px)}
.org-table{width:100%;border-collapse:separate;border-spacing:0 8px;font-size:13px}
.org-table th{text-align:left;color:#667085;font-size:12px;font-weight:800;padding:0 10px 4px}
.org-table td{background:#fff;border-top:1px solid #e5eaf3;border-bottom:1px solid #e5eaf3;padding:10px;vertical-align:middle}
.org-table tr td:first-child{border-left:1px solid #e5eaf3;border-radius:16px 0 0 16px}
.org-table tr td:last-child{border-right:1px solid #e5eaf3;border-radius:0 16px 16px 0}
.org-table tr{cursor:pointer}
.org-table tr:hover td,.org-table tr.selected td{border-color:#9db7ff;box-shadow:0 10px 26px rgba(36,88,255,.08)}
.org-name-cell{display:grid;grid-template-columns:42px minmax(0,1fr);gap:10px;align-items:center}
.org-name-cell b,.org-table td b{display:block;font-size:14px;color:#0b1220}
.org-name-cell small,.org-table td small{display:block;color:#667085;font-size:12px;line-height:1.3;max-width:360px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.org-avatar{width:40px;height:40px;border-radius:14px;background:linear-gradient(135deg,#2458ff,#73a7ff);display:grid;place-items:center;color:#fff;font-weight:900}
.org-avatar.big{width:56px;height:56px;border-radius:18px;font-size:22px}
.org-links-mini{display:flex;gap:6px;flex-wrap:wrap}
.org-links-mini span{background:#f1f5f9;border:1px solid #e2e8f0;border-radius:999px;padding:4px 8px;font-size:11px;color:#475467}
.org-detail-panel{position:sticky;top:12px}
.org-detail-head{display:grid;grid-template-columns:56px minmax(0,1fr);gap:12px;align-items:center;margin-bottom:12px}
.org-detail-head h2{margin:0;font-size:22px;line-height:1.12}
.org-detail-head p{margin:4px 0 0;color:#667085}
.org-fast-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0}
.org-fast-actions .btn{text-align:center;justify-content:center}
.org-detail-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0}
.contacts-section{margin-top:14px}
.contacts-section h3{font-size:16px;margin:0 0 8px}
.contact-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;border:1px solid #e5eaf3;background:#f8fafc;border-radius:14px;padding:10px;margin-bottom:8px}
.contact-card b{display:block}.contact-card small{display:block;color:#667085;font-size:12px}
.empty-line{border:1px dashed #cbd5e1;border-radius:14px;padding:14px;text-align:center}
.ares-panel{background:#f8fafc;border:1px solid #e5eaf3;border-radius:18px;padding:12px;margin:12px 0}
.inline-action{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}
.ares-results{display:grid;gap:8px;margin-top:10px}
.ares-results button{text-align:left;border:1px solid #dce6f5;background:#fff;border-radius:14px;padding:10px;cursor:pointer}
.ares-results button:hover{border-color:#8aacff;box-shadow:0 8px 22px rgba(36,88,255,.08)}
.ares-results b,.ares-results small{display:block}.ares-results small{color:#667085;margin-top:3px}
.org-modal-form{min-width:min(960px,92vw)}
.contact-modal-form{min-width:min(720px,92vw)}
.card-head.compact h2{font-size:20px!important}
@media(max-width:1180px){.org-layout{grid-template-columns:1fr}.org-detail-panel{position:static}.org-table-wrap{max-height:none}}
@media(max-width:760px){.org-table{min-width:820px}.single-actions.orgs-toolbar{display:grid!important;grid-template-columns:1fr!important}.inline-action{grid-template-columns:1fr}.org-fast-actions,.org-detail-actions{grid-template-columns:1fr}}



/* ServisPoint V2 - organizations full page cleanup */
.org-metrics{display:none!important}
.org-layout{display:block!important}
.org-table-full{width:100%!important}
.org-table-wrap{max-height:calc(100vh - 210px)!important;overflow:auto!important}
.org-table{width:100%;border-collapse:separate;border-spacing:0 7px;font-size:13px}
.org-detail-panel{display:none!important}
.org-drawer-backdrop{position:fixed;inset:0;background:rgba(8,18,37,.32);backdrop-filter:blur(2px);z-index:1050;opacity:0;transition:.18s ease}
.org-drawer-backdrop.open{opacity:1}
.org-drawer{position:fixed;top:0;right:0;width:min(560px,96vw);height:100vh;background:#fff;z-index:1060;box-shadow:-28px 0 80px rgba(8,18,37,.24);transform:translateX(104%);transition:transform .18s ease;overflow:auto}
.org-drawer.open{transform:translateX(0)}
.org-drawer-inner{padding:20px}
.drawer-head{display:flex;justify-content:flex-end;margin-bottom:4px}
.drawer-head .btn{font-size:22px;line-height:1;width:38px;height:38px;display:grid;place-items:center;padding:0!important}
.contact-actions{display:flex;gap:6px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
.contact-card{align-items:center}
.org-table td:last-child{text-align:right}
.org-table .btn.small{min-height:32px}
@media(max-width:900px){.org-table{min-width:1050px}.org-table-wrap{max-height:none}.org-drawer{width:100vw}}



/* ServisPoint V2 - organization delete + drawer/modal fix */
.modal-backdrop{
  z-index: 3000 !important;
}
.modal-backdrop .modal{
  z-index: 3001 !important;
}
.org-drawer-backdrop{
  z-index: 1050 !important;
}
.org-drawer{
  z-index: 1060 !important;
}
.org-detail-actions{
  grid-template-columns: 1fr 1fr 1fr !important;
}
.danger-box{
  border:1px solid #fecaca;
  background:#fff1f2;
  color:#7f1d1d;
  border-radius:16px;
  padding:14px;
  margin:12px 0 16px;
}
.danger-box b{display:block;margin-bottom:6px}
.danger-box p{margin:6px 0;font-size:13px;line-height:1.45}
.btn.danger{
  background:#ef4444!important;
  color:#fff!important;
  border-color:#ef4444!important;
}
@media(max-width:760px){
  .org-detail-actions{grid-template-columns:1fr!important}
}



/* ServisPoint V2 - compact organization/contact modals */
.org-modal-form,
.contact-modal-form {
  min-width: min(900px, 94vw) !important;
}

.org-modal-form .modal-title-row,
.contact-modal-form .modal-title-row {
  margin-bottom: 8px !important;
}

.compact-org-form h2,
.compact-contact-form h2,
.org-modal-form h2,
.contact-modal-form h2 {
  font-size: 21px !important;
  margin-bottom: 4px !important;
}

.org-modal-form p.muted,
.contact-modal-form p.muted {
  font-size: 12.5px !important;
  line-height: 1.32 !important;
  margin: 0 !important;
}

.org-modal-form .ares-panel {
  margin: 8px 0 10px !important;
  padding: 10px !important;
  border-radius: 15px !important;
}

.org-modal-form .inline-action {
  gap: 6px !important;
}

.org-modal-form .settings-form-grid.two,
.contact-modal-form .settings-form-grid.two,
.compact-modal-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px 10px !important;
}

.org-modal-form .settings-form-grid .wide,
.contact-modal-form .settings-form-grid .wide,
.compact-modal-grid .wide {
  grid-column: 1 / -1 !important;
}

.org-modal-form label,
.contact-modal-form label {
  gap: 4px !important;
  font-size: 11.5px !important;
}

.org-modal-form input,
.org-modal-form textarea,
.org-modal-form select,
.contact-modal-form input,
.contact-modal-form textarea,
.contact-modal-form select {
  min-height: 36px !important;
  border-radius: 11px !important;
  padding: 7px 10px !important;
  font-size: 13px !important;
}

.org-modal-form textarea,
.contact-modal-form textarea {
  min-height: 62px !important;
  line-height: 1.35 !important;
}

.org-modal-form textarea[name="note"],
.contact-modal-form textarea[name="note"] {
  min-height: 58px !important;
}

.org-modal-form textarea[name="address"] {
  min-height: 52px !important;
}

.org-modal-form .check,
.contact-modal-form .check {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 36px !important;
  padding: 7px 10px !important;
  border: 1px solid #e1e8f3 !important;
  border-radius: 12px !important;
  background: #f8fafc !important;
}

.org-modal-form .check input,
.contact-modal-form .check input {
  min-height: auto !important;
  width: 16px !important;
  height: 16px !important;
  padding: 0 !important;
}

.org-modal-form .modal-actions.sticky,
.contact-modal-form .modal-actions.sticky {
  padding-top: 10px !important;
}

.org-modal-form .modal-actions .btn,
.contact-modal-form .modal-actions .btn {
  min-height: 38px !important;
}

/* Menší výška modálu a méně scrollování */
.modal-backdrop .modal:has(.org-modal-form),
.modal-backdrop .modal:has(.contact-modal-form) {
  padding: 18px !important;
  max-height: calc(100vh - 24px) !important;
}

/* Fallback pokud :has není podporované */
.modal .org-modal-form,
.modal .contact-modal-form {
  max-height: calc(100vh - 72px) !important;
  overflow: auto !important;
  padding-right: 2px !important;
}

@media(max-width: 980px){
  .org-modal-form .settings-form-grid.two,
  .contact-modal-form .settings-form-grid.two,
  .compact-modal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media(max-width: 620px){
  .org-modal-form .settings-form-grid.two,
  .contact-modal-form .settings-form-grid.two,
  .compact-modal-grid {
    grid-template-columns: 1fr !important;
  }
}



/* ServisPoint V2 - jobs/protocols/photos */
body.sp-page-jobs .topbar,body.sp-page-protocols .topbar,body.sp-page-photos .topbar,
body:has(.jobs-hero) .topbar,body:has(.protocols-hero) .topbar,body:has(.photos-hero) .topbar{display:none!important}
.service-board{display:grid;grid-template-columns:repeat(5,minmax(220px,1fr));gap:12px;overflow:auto}
.service-column{background:#f8fafc;border:1px solid #e5eaf3;border-radius:18px;padding:10px;min-height:480px}
.service-column h3{font-size:14px;margin:2px 4px 10px}
.service-card{background:#fff;border:1px solid #e5eaf3;border-radius:16px;padding:12px;margin-bottom:10px;box-shadow:0 8px 22px rgba(10,30,70,.04)}
.service-card-head{display:flex;justify-content:space-between;align-items:center}.service-card h4{font-size:15px;margin:8px 0 4px}.service-card p{margin:0;color:#475467}.service-card small{display:block;color:#667085;margin-top:5px}.service-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}
.protocol-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(380px,.55fr);gap:14px;align-items:start}.protocol-list-card{min-width:0}.protocol-editor-panel{position:sticky;top:12px}.protocol-table tr{cursor:pointer}.protocol-table tr.selected td{border-color:#9db7ff!important;box-shadow:0 10px 26px rgba(36,88,255,.08)}
.protocol-detail-head h2{font-size:21px;margin:0 0 4px}.protocol-detail-head p{margin:0;color:#667085}.protocol-next-actions{display:grid;grid-template-columns:1fr;gap:8px;margin:14px 0}.protocol-items{display:grid;gap:8px}.protocol-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;border:1px solid #e5eaf3;background:#f8fafc;border-radius:14px;padding:10px}.protocol-item b,.protocol-item small{display:block}.protocol-item small{color:#667085}

.service-modal{min-width:min(920px,94vw)!important}
@media(max-width:1200px){.service-board{grid-template-columns:repeat(5,260px)}.protocol-layout{grid-template-columns:1fr}.protocol-editor-panel{position:static}}



/* ServisPoint V2 - mobile friendly workspaces */
.workspace-head{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:14px;align-items:center;margin-bottom:14px}
.workspace-head h1{font-size:25px;margin:2px 0 4px;line-height:1.1}.workspace-head p{margin:0;color:#667085}
.workspace-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.workspace-grid,.protocol-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,.42fr);gap:14px;align-items:start}
.workspace-list,.operation-list{display:grid;gap:9px}.workspace-row,.operation-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;border:1px solid #e5eaf3;background:#f8fafc;border-radius:15px;padding:12px;text-decoration:none;color:inherit}
.workspace-row b,.workspace-row span,.operation-row b,.operation-row small{display:block}.workspace-row span,.operation-row small{color:#667085;font-size:12px}
.operation-meta{display:flex;gap:6px;align-items:center;flex-wrap:wrap;justify-content:flex-end}

body:has(.workspace-head) .topbar{display:none!important}
@media(max-width:900px){.workspace-head{grid-template-columns:1fr}.workspace-actions{justify-content:flex-start}.workspace-grid,.protocol-workspace{grid-template-columns:1fr}.workspace-row,.operation-row{grid-template-columns:1fr}.operation-meta{justify-content:flex-start}}
@media(max-width:540px){.workspace-actions .btn{width:100%;justify-content:center}}



/* ServisPoint V2 - organization AJAX picker */
.org-picker{position:relative}
.org-picker input[data-org-picker-input]{width:100%!important}
.org-picker-results{
  position:absolute;
  left:0; right:0; top:calc(100% + 6px);
  background:#fff;
  border:1px solid #dbe4f0;
  border-radius:14px;
  box-shadow:0 18px 50px rgba(8,18,37,.18);
  z-index:5000;
  max-height:260px;
  overflow:auto;
  padding:6px;
}
.org-picker-results button{
  width:100%;
  border:0;
  background:#fff;
  text-align:left;
  border-radius:11px;
  padding:9px 10px;
  cursor:pointer;
}
.org-picker-results button:hover{background:#f4f7ff}
.org-picker-results b,.org-picker-results small{display:block}
.org-picker-results small{color:#667085;font-size:12px;margin-top:2px}
.org-picker-loading,.org-picker-empty{padding:12px;color:#667085;font-size:13px;text-align:center}

/* modal compact hard override */
.service-modal .settings-form-grid.two,
.org-modal-form .settings-form-grid.two,
.contact-modal-form .settings-form-grid.two{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:8px 10px!important;
}
.service-modal label,
.org-modal-form label,
.contact-modal-form label{font-size:11.5px!important;gap:4px!important}
.service-modal input,.service-modal select,.service-modal textarea,
.org-modal-form input,.org-modal-form select,.org-modal-form textarea,
.contact-modal-form input,.contact-modal-form select,.contact-modal-form textarea{
  min-height:36px!important;border-radius:11px!important;padding:7px 10px!important;font-size:13px!important;
}
.service-modal textarea,.org-modal-form textarea,.contact-modal-form textarea{min-height:58px!important}
.service-modal .wide,.org-modal-form .wide,.contact-modal-form .wide{grid-column:1/-1!important}
.modal-backdrop .modal:has(.service-modal),
.modal-backdrop .modal:has(.org-modal-form),
.modal-backdrop .modal:has(.contact-modal-form){
  padding:18px!important;
  max-height:calc(100vh - 24px)!important;
}
@media(max-width:980px){
  .service-modal .settings-form-grid.two,
  .org-modal-form .settings-form-grid.two,
  .contact-modal-form .settings-form-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:620px){
  .service-modal .settings-form-grid.two,
  .org-modal-form .settings-form-grid.two,
  .contact-modal-form .settings-form-grid.two{grid-template-columns:1fr!important}
}



.org-picker-error{
  color:#b42318!important;
  background:#fff1f2!important;
  border:1px solid #fecaca!important;
  border-radius:12px;
  text-align:left!important;
  line-height:1.35;
}



/* ServisPoint V2 - compact jobs table */
.jobs-table-card{padding:14px!important}
.job-table-wrap{overflow:auto;max-height:calc(100vh - 190px)}
.job-table{min-width:1040px;border-spacing:0 6px!important}
.job-table th{font-size:11.5px!important;padding:0 9px 3px!important}
.job-table td{padding:8px 9px!important}
.job-table td b{font-size:13px!important}
.job-table td small{font-size:11.5px!important;line-height:1.25;display:block;max-width:360px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#667085}
.job-mini-actions{display:flex;gap:5px;flex-wrap:nowrap;justify-content:flex-end}
.job-mini-actions .btn.small{min-height:30px!important;padding:0 8px!important;font-size:12px!important}
.toggle-compact{display:flex!important;align-items:center!important;gap:7px!important;height:36px!important;padding:0 10px!important;border:1px solid #d9e2ef!important;border-radius:12px!important;background:#fff!important;font-size:12px!important;font-weight:800!important;color:#142033!important;white-space:nowrap}
.toggle-compact input{width:15px;height:15px;accent-color:#2458ff}
@media(max-width:760px){.jobs-toolbar{display:grid!important;grid-template-columns:1fr!important}.toggle-compact{justify-content:flex-start}.job-table-wrap{max-height:none}}



/* ServisPoint V2 - Service V3 workspace */
body:has(.jobs-hero) .topbar,
body:has(.protocols-hero) .topbar,
body:has(.photos-hero) .topbar,
body:has(.workspace-head) .topbar { display:none!important; }

.jobs-table-card{padding:14px!important}
.job-table-wrap{overflow:auto;max-height:calc(100vh - 190px)}
.job-table{min-width:1120px;border-spacing:0 6px!important}
.job-table th{font-size:11.5px!important;padding:0 9px 3px!important}
.job-table td{padding:8px 9px!important}
.job-table td b{font-size:13px!important}
.job-table td small{font-size:11.5px!important;line-height:1.25;display:block;max-width:380px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#667085}
.job-mini-actions{display:flex;gap:5px;flex-wrap:nowrap;justify-content:flex-end}
.job-mini-actions .btn.small{min-height:30px!important;padding:0 8px!important;font-size:12px!important}
.toggle-compact{display:flex!important;align-items:center!important;gap:7px!important;height:36px!important;padding:0 10px!important;border:1px solid #d9e2ef!important;border-radius:12px!important;background:#fff!important;font-size:12px!important;font-weight:800!important;color:#142033!important;white-space:nowrap}
.toggle-compact input{width:15px;height:15px;accent-color:#2458ff}

.workflow-bar{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 14px}
.workflow-bar .inline-form{display:inline-flex;margin:0}
.workflow-bar .btn{min-height:36px}
.sticky-workflow{position:sticky;top:0;z-index:30;background:#f3f6fbcc;backdrop-filter:blur(8px);padding:8px;border-radius:16px}

.workspace-head{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:14px;align-items:center;margin-bottom:14px}
.workspace-head h1{font-size:25px;margin:2px 0 4px;line-height:1.1}.workspace-head p{margin:0;color:#667085}
.workspace-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.workspace-grid,.protocol-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,.42fr);gap:14px;align-items:start}
.protocol-workspace.full{grid-template-columns:minmax(0,1fr) minmax(320px,.34fr)}
.workspace-list,.operation-list{display:grid;gap:9px}
.workspace-row,.operation-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;border:1px solid #e5eaf3;background:#f8fafc;border-radius:15px;padding:12px;text-decoration:none;color:inherit}
.workspace-row b,.workspace-row span,.operation-row b,.operation-row small{display:block}.workspace-row span,.operation-row small{color:#667085;font-size:12px}
.operation-row{grid-template-columns:34px minmax(0,1fr) auto;align-items:center}
.operation-row.dragging{opacity:.45}
.drag-handle{width:28px;height:28px;border-radius:10px;display:grid;place-items:center;background:#eef4ff;color:#2458ff;cursor:grab}
.operation-meta{display:flex;gap:6px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.section-line{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:10px}
.protocol-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:16px}
.protocol-summary-grid>div{background:#f8fafc;border:1px solid #e5eaf3;border-radius:14px;padding:10px}
.protocol-summary-grid span{display:block;color:#667085;font-size:12px}.protocol-summary-grid b{display:block;font-size:13px}.protocol-summary-grid small{display:block;color:#667085;font-size:12px}
.detail-fields.compact{grid-template-columns:repeat(3,minmax(0,1fr))}


.photo-toolbar select{min-height:36px;border:1px solid #d9e2ef;border-radius:12px;padding:0 10px;background:#fff}


.service-modal{min-width:min(920px,94vw)!important}
.item-modal-form{min-width:min(760px,94vw)!important}
.pill.orange{background:#fff7ed!important;color:#c2410c!important;border-color:#fed7aa!important}

@media(max-width:1050px){
  .workspace-head{grid-template-columns:1fr}.workspace-actions{justify-content:flex-start}
  .workspace-grid,.protocol-workspace,.protocol-workspace.full{grid-template-columns:1fr}
  .protocol-summary-grid,.detail-fields.compact{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
  .jobs-toolbar,.photo-toolbar{display:grid!important;grid-template-columns:1fr!important}
  .toggle-compact{justify-content:flex-start}
  .job-table-wrap{max-height:none}
  .workspace-row,.operation-row{grid-template-columns:1fr}
  .operation-meta{justify-content:flex-start}
  
  .workflow-bar .inline-form,.workflow-bar .btn,.workspace-actions .btn{width:100%;justify-content:center}
  .protocol-summary-grid,.detail-fields.compact{grid-template-columns:1fr}
}
@media(max-width:540px){}



/* ServisPoint V2 - clickable rows */
[data-job-row],
[data-protocol-row] {
  cursor: pointer;
}

[data-job-row]:hover td,
[data-protocol-row]:hover td {
  border-color: #9db7ff !important;
  box-shadow: 0 10px 26px rgba(36,88,255,.08);
}

[data-job-row] a,
[data-protocol-row] a {
  color: inherit;
  text-decoration: none;
}

[data-job-row] a:hover,
[data-protocol-row] a:hover {
  color: #2458ff;
}

/* ServisPoint V2 - job workspace cleanup */
.job-extra-grid {
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:14px;
  margin-top:14px;
}
.soft-textarea {
  width:100%;
  min-height:110px;
  border:1px solid #dbe4f0;
  border-radius:14px;
  padding:12px;
  resize:vertical;
  background:#f8fafc;
}
.photo-upload-info { grid-column:1/-1; }
.photo-upload-info .btn { margin-left:8px; }
@media(max-width:900px){ .job-extra-grid { grid-template-columns:1fr; } }

/* ServisPoint V2 - compact job summary + drag/drop photos */
.job-compact-summary{
  display:grid;
  grid-template-columns:minmax(0,1.2fr) minmax(220px,.7fr) minmax(240px,.9fr);
  gap:10px;
  margin-bottom:12px;
}
.summary-main,.summary-card{
  border:1px solid #e5eaf3;
  background:#f8fafc;
  border-radius:16px;
  padding:12px;
}
.summary-main h2{margin:0 0 4px;font-size:20px}
.summary-main p{margin:0 0 8px;color:#475467}
.summary-tags{display:flex;gap:6px;flex-wrap:wrap}
.summary-card span{display:block;color:#667085;font-size:12px;margin-bottom:4px}
.summary-card b{display:block;font-size:14px}
.summary-card small,.summary-card a{display:block;font-size:12px;margin-top:3px}
.compact-description{
  border:1px solid #e5eaf3;
  background:#fff;
  border-radius:14px;
  padding:10px 12px;
  margin-bottom:12px;
  color:#344054;
}
.photo-dropzone{
  min-height:170px;
  border:1px dashed transparent;
  transition:.15s ease;
  cursor:pointer;
  position:relative;
}
.photo-dropzone:after{
  content:'Přetáhni sem fotky nebo klikni pro výběr';
  display:none;
  grid-column:1/-1;
  border:1px dashed #9db7ff;
  background:#eef4ff;
  color:#2458ff;
  border-radius:14px;
  padding:12px;
  text-align:center;
  font-weight:800;
}
.photo-dropzone:hover:after,
.photo-dropzone.drag-over:after,
.photo-dropzone.uploading:after{display:block}
.photo-dropzone.drag-over{background:#f4f7ff;border-color:#9db7ff;border-radius:16px}
.photo-dropzone.uploading{opacity:.65}
@media(max-width:1000px){.job-compact-summary{grid-template-columns:1fr}}



/* ServisPoint V2 - denser photo thumbs + lightbox */







.sp-lightbox{
  position:fixed;
  inset:0;
  background:rgba(4,10,22,.88);
  z-index:9999;
  display:none;
  align-items:center;
  justify-content:center;
  padding:54px 70px;
}
.sp-lightbox.open{display:flex}
body.sp-lightbox-open{overflow:hidden}
.sp-lb-stage{
  max-width:100%;
  max-height:100%;
  overflow:auto;
  display:flex;
  align-items:center;
  justify-content:center;
}
.sp-lb-stage img{
  max-width:calc(100vw - 160px);
  max-height:calc(100vh - 140px);
  object-fit:contain;
  transition:transform .15s ease;
  transform-origin:center center;
  border-radius:14px;
  box-shadow:0 24px 80px rgba(0,0,0,.45);
}
.sp-lb-close,.sp-lb-prev,.sp-lb-next{
  position:absolute;
  border:0;
  background:rgba(255,255,255,.12);
  color:#fff;
  cursor:pointer;
  border-radius:999px;
  display:grid;
  place-items:center;
  backdrop-filter:blur(8px);
}
.sp-lb-close{top:18px;right:18px;width:44px;height:44px;font-size:30px}
.sp-lb-prev,.sp-lb-next{top:50%;transform:translateY(-50%);width:50px;height:70px;font-size:50px}
.sp-lb-prev{left:14px}.sp-lb-next{right:14px}
.sp-lb-toolbar{
  position:absolute;
  bottom:18px;
  left:50%;
  transform:translateX(-50%);
  display:flex;
  gap:8px;
  background:rgba(255,255,255,.12);
  padding:8px;
  border-radius:999px;
  backdrop-filter:blur(8px);
}
.sp-lb-toolbar button,.sp-lb-toolbar a{
  border:0;
  background:#fff;
  color:#111827;
  border-radius:999px;
  padding:8px 12px;
  font-weight:800;
  text-decoration:none;
  cursor:pointer;
}
@media(max-width:700px){
  .sp-lightbox{padding:52px 12px}
  .sp-lb-stage img{max-width:calc(100vw - 24px);max-height:calc(100vh - 140px)}
  .sp-lb-prev,.sp-lb-next{width:42px;height:56px;font-size:38px}
  .sp-lb-toolbar{bottom:10px}
}



/* ServisPoint V2 - Jobs UX patch */
.job-table th:last-child,
.job-table td:last-child{min-width:320px}
.job-row-actions{
  display:flex;
  gap:5px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
}
.job-row-actions .inline-form{margin:0;display:inline-flex}
.job-row-actions .btn.small{min-height:28px!important;padding:0 8px!important;font-size:11.5px!important}
.workorder-modal-layout{
  display:grid;
  grid-template-columns:minmax(0,1.15fr) minmax(280px,.85fr);
  gap:14px;
}
.modal-section{
  border:1px solid #e5eaf3;
  background:#f8fafc;
  border-radius:18px;
  padding:14px;
  display:grid;
  gap:10px;
}
.modal-section h3{
  margin:0 0 2px;
  font-size:14px;
}
.modal-section label{
  display:grid;
  gap:5px;
  font-size:12px;
  font-weight:800;
}
.modal-section input,
.modal-section select,
.modal-section textarea{
  width:100%;
  border:1px solid #d9e2ef;
  border-radius:12px;
  padding:9px 11px;
  background:#fff;
  min-height:38px;
}
.modal-section textarea{resize:vertical}
.multi-tech-select{min-height:150px!important}
.hint{color:#667085;font-size:12px;line-height:1.35}
.custom-contact-fields{
  display:grid;
  gap:8px;
  border:1px dashed #b8c7e6;
  background:#fff;
  border-radius:14px;
  padding:10px;
}
.status-modal-form{min-width:min(720px,94vw)!important}
.status-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}
.status-choice{
  border:1px solid #d9e2ef;
  background:#fff;
  border-radius:16px;
  padding:13px;
  text-align:left;
  cursor:pointer;
}
.status-choice b{display:block;font-size:14px;margin-bottom:4px}
.status-choice span{display:block;color:#667085;font-size:12px;line-height:1.35}
.status-choice:hover{border-color:#9db7ff;box-shadow:0 12px 30px rgba(36,88,255,.08)}
.status-choice.primary{background:#eef4ff;border-color:#9db7ff}
.status-choice.danger{background:#fff1f2;border-color:#fecaca}
@media(max-width:850px){
  .workorder-modal-layout{grid-template-columns:1fr}
  .status-grid{grid-template-columns:1fr}
  .job-table th:last-child,.job-table td:last-child{min-width:260px}
}



/* ServisPoint V2 - cleaner jobs table + fixed status modal visual */
.jobs-table-card{
  padding:10px!important;
  border-radius:18px!important;
}
.job-table-wrap{
  overflow:auto;
  max-height:calc(100vh - 185px);
}
.job-pro-table{
  width:100%;
  min-width:1180px;
  border-collapse:separate;
  border-spacing:0 7px;
}
.job-pro-table thead th{
  position:sticky;
  top:0;
  z-index:2;
  background:#f3f6fb;
  color:#667085;
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.025em;
  text-align:left;
  padding:8px 10px;
  border-bottom:1px solid #e5eaf3;
}
.job-pro-table tbody tr{
  transition:.12s ease;
}
.job-pro-table tbody td{
  background:#fff;
  border-top:1px solid #e5eaf3;
  border-bottom:1px solid #e5eaf3;
  padding:9px 10px;
  vertical-align:middle;
}
.job-pro-table tbody td:first-child{
  border-left:1px solid #e5eaf3;
  border-radius:14px 0 0 14px;
}
.job-pro-table tbody td:last-child{
  border-right:1px solid #e5eaf3;
  border-radius:0 14px 14px 0;
}
.job-pro-table tbody tr:hover td{
  border-color:#9db7ff;
  box-shadow:0 8px 22px rgba(36,88,255,.055);
}
.job-code{
  width:82px;
  color:#2458ff;
  font-weight:900;
}
.job-title{min-width:270px;max-width:360px}
.job-title b,
.job-org b,
.job-contact b{
  display:block;
  color:#111827;
  font-size:13px;
  line-height:1.2;
}
.job-title small,
.job-org small,
.job-contact small{
  display:block;
  color:#667085;
  font-size:11.5px;
  line-height:1.25;
  margin-top:3px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:340px;
}
.job-org{min-width:210px}
.job-contact{min-width:185px}
.job-techs{
  min-width:160px;
  max-width:220px;
  color:#344054;
  font-size:12.5px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.job-status{width:145px}
.status-badge{
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:0 10px;
  border-radius:999px;
  font-size:11.5px;
  font-weight:900;
  border:1px solid transparent;
  white-space:nowrap;
}
.status-new{background:#f2f4f7;color:#344054;border-color:#e4e7ec}
.status-planned{background:#eef4ff;color:#2458ff;border-color:#c7d7fe}
.status-in_progress{background:#e0f2fe;color:#0369a1;border-color:#bae6fd}
.status-waiting_signature{background:#fff7ed;color:#c2410c;border-color:#fed7aa}
.status-done{background:#dcfce7;color:#15803d;border-color:#bbf7d0}
.status-cancelled{background:#fee2e2;color:#b42318;border-color:#fecaca}

.job-actions-cell{
  min-width:315px;
}
.job-row-actions{
  display:flex;
  gap:6px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:nowrap;
}
.job-row-actions .inline-form{
  margin:0;
  display:inline-flex;
}
.job-action{
  border:1px solid #d9e2ef;
  background:#fff;
  color:#111827;
  min-height:30px;
  padding:0 10px;
  border-radius:10px;
  font-size:11.5px;
  font-weight:900;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
}
.job-action:hover{
  border-color:#9db7ff;
  color:#2458ff;
  background:#f8fbff;
}
.job-action.primary{
  background:#315cff;
  color:#fff;
  border-color:#315cff;
}
.job-action.open{
  background:#f8fafc;
}
.status-modal-form .status-grid{
  align-items:stretch;
}
.status-modal-form .status-choice{
  display:block!important;
  width:100%;
  min-height:84px;
  text-align:left!important;
  line-height:1.25;
}
.status-modal-form .status-choice b{
  display:block!important;
  margin-bottom:5px;
  font-size:14px;
}
.status-modal-form .status-choice span{
  display:block!important;
  font-size:12px;
  color:#667085;
}
.status-modal-form .status-choice.is-saving{
  opacity:.65;
  pointer-events:none;
}
.status-title{
  margin-bottom:14px!important;
}
@media(max-width:900px){
  .job-pro-table{min-width:1060px}
  .job-actions-cell{min-width:270px}
  .job-row-actions{flex-wrap:wrap;justify-content:flex-start}
}



/* ServisPoint V2 - job contact/technician polish */
.job-code{
  width:118px!important;
  min-width:118px!important;
  white-space:normal!important;
}
.job-code b{
  display:block;
  line-height:1.45;
  font-size:13px!important;
  word-break:keep-all;
}
.job-pro-table thead th:first-child{
  min-width:118px!important;
}
.multi-tech-select{
  min-height:145px!important;
}
.multi-tech-select option{
  padding:7px 8px;
  border-radius:8px;
}
.custom-contact-fields[hidden]{
  display:none!important;
}

/* ServisPoint V2 - contacts locked until organization selected */
select[name="contact_id"]:disabled{
  background:#f2f4f7!important;
  color:#98a2b3!important;
  cursor:not-allowed;
}
.job-techs{
  min-width:190px!important;
}
.summary-tags .pill:nth-child(2){
  max-width:360px;
  white-space:normal;
  line-height:1.25;
}

/* ServisPoint V2 - technician chips */
.tech-picker{display:grid;gap:8px}
.tech-picker-title{font-size:12px;font-weight:900;color:#111827}
.tech-chip-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(145px,1fr));
  gap:7px;
  max-height:190px;
  overflow:auto;
  padding:4px;
  border:1px solid #d9e2ef;
  border-radius:14px;
  background:#fff;
}
.tech-chip{
  display:flex!important;
  align-items:center;
  gap:8px!important;
  border:1px solid #e5eaf3;
  border-radius:12px;
  padding:8px 9px;
  background:#f8fafc;
  cursor:pointer;
  font-size:12px!important;
  font-weight:900!important;
}
.tech-chip input{
  width:16px!important;
  height:16px!important;
  min-height:16px!important;
  accent-color:#315cff;
}
.tech-chip:has(input:checked){
  background:#eef4ff;
  border-color:#9db7ff;
  color:#2458ff;
}

/* ServisPoint V2 - protocol actions in workorder + job action bar */
.job-action-bar{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  margin-bottom:14px;
}
.icon-action{
  border:1px solid #d9e2ef;
  background:#fff;
  color:#111827;
  border-radius:12px;
  min-height:36px;
  padding:0 12px;
  display:inline-flex;
  align-items:center;
  gap:7px;
  font-weight:900;
  cursor:pointer;
  text-decoration:none;
}
.icon-action:hover{border-color:#9db7ff;background:#f8fbff;color:#2458ff}
.icon-action.primary{background:#315cff;border-color:#315cff;color:#fff}
.icon-action.danger{background:#fff1f2;border-color:#fecaca;color:#b42318}
.protocol-job-list{
  gap:8px!important;
}
.protocol-row-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  border:1px solid #e5eaf3;
  background:#f8fafc;
  border-radius:15px;
  padding:8px 10px;
}
.protocol-row-card:hover{
  border-color:#9db7ff;
  box-shadow:0 10px 26px rgba(36,88,255,.06);
}
.protocol-row-main{
  display:block;
  min-width:0;
  color:inherit;
  text-decoration:none;
}
.protocol-row-main b{
  display:block;
  font-size:13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.protocol-row-main span{
  display:flex;
  gap:6px;
  align-items:center;
  flex-wrap:wrap;
  color:#667085;
  font-size:12px;
  margin-top:3px;
}
.protocol-row-actions{
  display:flex;
  gap:5px;
  align-items:center;
}
.protocol-row-actions .inline-form{margin:0;display:inline-flex}
.icon-mini{
  width:32px;
  height:32px;
  border:1px solid #d9e2ef;
  background:#fff;
  border-radius:10px;
  display:grid;
  place-items:center;
  cursor:pointer;
  text-decoration:none;
  font-size:15px;
}
.icon-mini:hover{border-color:#9db7ff;background:#eef4ff}
.icon-mini.ok{background:#ecfdf3;border-color:#bbf7d0}
.status-protocol-draft{background:#f2f4f7;color:#344054;border-color:#e4e7ec}
.status-protocol-in_progress{background:#e0f2fe;color:#0369a1;border-color:#bae6fd}
.status-protocol-sent_for_signature{background:#fff7ed;color:#c2410c;border-color:#fed7aa}
.status-protocol-signed{background:#ecfdf3;color:#15803d;border-color:#bbf7d0}
.status-protocol-sent_email{background:#eef4ff;color:#2458ff;border-color:#c7d7fe}
.status-protocol-closed{background:#dcfce7;color:#15803d;border-color:#bbf7d0}
.status-protocol-cancelled{background:#fee2e2;color:#b42318;border-color:#fecaca}
@media(max-width:760px){
  .protocol-row-card{grid-template-columns:1fr}
  .protocol-row-actions{justify-content:flex-start;flex-wrap:wrap}
  .icon-action span{display:none}
}

/* ServisPoint V2 - inline protocol editor */
.protocol-inline-form{display:grid;gap:14px}
.protocol-items-table-wrap{overflow:auto;border:1px solid #e5eaf3;border-radius:16px;background:#fff}
.protocol-items-table{width:100%;border-collapse:collapse;min-width:760px}
.protocol-items-table th{
  background:#f8fafc;
  color:#667085;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.03em;
  text-align:left;
  padding:9px;
  border-bottom:1px solid #e5eaf3;
}
.protocol-items-table td{padding:7px;border-bottom:1px solid #eef2f7}
.protocol-items-table tr:last-child td{border-bottom:0}
.protocol-items-table select,
.protocol-items-table input{
  width:100%;
  min-height:34px;
  border:1px solid #d9e2ef;
  border-radius:10px;
  padding:6px 8px;
  background:#fff;
}
.protocol-items-table th:nth-child(1){width:170px}
.protocol-items-table th:nth-child(3){width:110px}
.protocol-items-table th:nth-child(4){width:80px}
.protocol-items-table th:nth-child(5){width:48px}
.protocol-notes-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.protocol-notes-grid label{display:grid;gap:6px;font-size:12px;font-weight:900}
.protocol-notes-grid textarea{
  width:100%;
  border:1px solid #d9e2ef;
  border-radius:14px;
  padding:10px;
  resize:vertical;
}
.sticky-savebar{
  position:sticky;
  bottom:0;
  background:linear-gradient(180deg,rgba(255,255,255,0),#fff 35%);
  padding-top:18px;
  display:flex;
  justify-content:flex-end;
}
.workorder-note-form{display:grid;gap:8px}
.note-list{display:grid;gap:8px;margin-top:10px}
.note-item{background:#f8fafc;border:1px solid #e5eaf3;border-radius:14px;padding:10px}
.note-item b{font-size:12px}.note-item span{font-size:11px;color:#667085;margin-left:6px}.note-item p{margin:6px 0 0;font-size:13px}
@media(max-width:800px){
  .protocol-notes-grid{grid-template-columns:1fr}
}

/* ServisPoint V2 - documents + duplicate action cleanup */
.workspace-head .workspace-actions:empty{display:none}
.soft-separator{border:0;border-top:1px solid #e5eaf3;margin:14px 0}
.document-list{display:grid;gap:7px}
.document-list.compact{margin-top:6px}
.document-item{
  display:grid;
  grid-template-columns:24px minmax(0,1fr) auto;
  gap:8px;
  align-items:center;
  border:1px solid #e5eaf3;
  background:#f8fafc;
  color:inherit;
  text-decoration:none;
  border-radius:12px;
  padding:8px 9px;
}
.document-item:hover{border-color:#9db7ff;background:#eef4ff}
.document-item b{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.document-item small{font-size:11px;color:#667085}

/* ServisPoint V2 - document drag/drop */
.document-dropzone{
  min-height:78px;
  border:1px dashed transparent;
  border-radius:14px;
  padding:4px;
  transition:.15s ease;
  cursor:pointer;
}
.document-dropzone:hover,
.document-dropzone.drag-over{
  border-color:#9db7ff;
  background:#f4f7ff;
}
.document-dropzone.uploading{
  opacity:.65;
  pointer-events:none;
}
.document-dropzone .empty-line{
  border:1px dashed #c7d7fe;
  background:#eef4ff;
  color:#2458ff;
  border-radius:12px;
  padding:12px;
  font-weight:800;
}























/* ServisPoint V2 - fotodokumentace dočasně vypnutá */
.photos-disabled-card,
.photos-disabled-box{
  border:1px dashed rgba(100,116,139,.35);
  border-radius:18px;
  background:rgba(248,250,252,.86);
  padding:18px;
  color:#64748b;
}
.photos-disabled-card h2,
.photos-disabled-box h2{margin:0 0 6px;color:#0f172a;font-size:18px}
.photos-disabled-card p,
.photos-disabled-box p{margin:0;line-height:1.45}
body.sp-lightbox-open,
body.sp-photo-viewer-open,
body.spg-viewer-open{overflow:auto!important}
#spGalleryLightbox,#spPhotoViewer,#spPhotoViewerFinal,#spHardPhotoViewer,#spgViewer,#pswpLite,
.sp-lightbox,.sp-photo-viewer,.spg-viewer,.sp-simple-viewer,.sphv,.pswp-lite{display:none!important;visibility:hidden!important;pointer-events:none!important}

/* ServisPoint V2 - nová fotodokumentace */
.sp-photo-panel{display:grid;gap:14px}.sp-photo-head{align-items:flex-start}.sp-photo-head .muted{margin:4px 0 0}.sp-photo-dropzone{display:grid;place-items:center;text-align:center;gap:5px;min-height:138px;border:1.5px dashed #b8c7dc;border-radius:18px;background:linear-gradient(180deg,#fbfdff,#f5f8fd);cursor:pointer;transition:.18s;padding:16px}.sp-photo-dropzone:hover,.sp-photo-dropzone.drag-over{border-color:#2f63f6;background:#eef4ff;transform:translateY(-1px)}.sp-photo-dropzone.uploading{opacity:.7;pointer-events:none}.sp-photo-drop-icon{font-size:28px}.sp-photo-dropzone b{font-size:15px}.sp-photo-dropzone small{color:#64748b}.sp-photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(92px,1fr));gap:10px}.sp-photo-grid-wide{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}.sp-photo-card{border:0;background:#f8fafc;border-radius:15px;padding:0;overflow:hidden;box-shadow:inset 0 0 0 1px #e5edf7;cursor:pointer;text-align:left;transition:.16s}.sp-photo-card:hover{transform:translateY(-2px);box-shadow:0 14px 35px rgba(15,23,42,.12)}.sp-photo-card img{width:100%;aspect-ratio:1/1;object-fit:cover;display:block;background:#e2e8f0}.sp-photo-card span{display:block;font-size:11px;color:#64748b;padding:7px 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sp-photo-empty{margin-top:0}
body.sp-photo-inspector-open{overflow:hidden}#spPhotoInspector{position:fixed;inset:0;background:rgba(2,6,23,.88);z-index:1000;display:none;grid-template-columns:minmax(0,1fr) 390px;color:#fff}#spPhotoInspector.open{display:grid}.spi-stage{position:relative;min-width:0;display:grid;place-items:center}.spi-canvas{position:absolute;inset:0;display:grid;place-items:center;overflow:hidden;touch-action:none;cursor:grab}.spi-canvas img{max-width:92%;max-height:90%;object-fit:contain;transition:transform .08s linear;will-change:transform;box-shadow:0 20px 90px rgba(0,0,0,.45);border-radius:6px}.spi-close{position:absolute;top:16px;right:16px;z-index:3;width:42px;height:42px;border:0;border-radius:14px;background:rgba(255,255,255,.12);color:#fff;font-size:28px;cursor:pointer}.spi-nav{position:absolute;z-index:3;top:50%;transform:translateY(-50%);width:46px;height:64px;border:0;border-radius:16px;background:rgba(255,255,255,.12);color:#fff;font-size:42px;cursor:pointer}.spi-prev{left:18px}.spi-next{right:18px}.spi-toolbar{position:absolute;z-index:3;bottom:20px;left:50%;transform:translateX(-50%);display:flex;gap:8px;background:rgba(15,23,42,.74);backdrop-filter:blur(12px);border:1px solid rgba(255,255,255,.14);border-radius:18px;padding:8px}.spi-toolbar button{border:0;border-radius:12px;background:rgba(255,255,255,.12);color:#fff;padding:10px 13px;font-weight:800;cursor:pointer}.spi-panel{background:#fff;color:#0f172a;overflow:auto;box-shadow:-20px 0 60px rgba(0,0,0,.25)}.spi-panel-head{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border-bottom:1px solid #e5edf7;background:#fff}.spi-panel-head span{font-weight:900}.spi-panel-head button{border:0;background:#f1f5f9;border-radius:10px;padding:8px 11px;cursor:pointer}.spi-panel [data-spi-info]{padding:18px}.spi-panel h2{font-size:21px;margin:0 0 14px}.spi-meta{display:grid;gap:10px}.spi-meta div{border:1px solid #e5edf7;border-radius:14px;padding:10px 12px;background:#fbfdff}.spi-meta span{display:block;color:#64748b;font-size:12px;margin-bottom:3px}.spi-meta b{font-size:13px;word-break:break-word}.spi-note{background:#fff7ed;border:1px solid #fed7aa;border-radius:14px;padding:12px;line-height:1.45}.spi-map{width:100%;height:230px;border:0;border-radius:16px;margin-top:14px;background:#e2e8f0}.spi-map-empty{display:grid;place-items:center;min-height:120px;border:1px dashed #cbd5e1;border-radius:16px;color:#64748b;margin-top:14px;background:#f8fafc}.spi-map-link{display:inline-block;margin-top:8px;font-size:13px}.spi-actions{display:flex;gap:8px;margin-top:16px;flex-wrap:wrap}.btn.danger,.spi-actions .danger{background:#fee2e2;color:#b91c1c}@media(max-width:900px){#spPhotoInspector{grid-template-columns:1fr;grid-template-rows:minmax(45vh,1fr) 45vh}.spi-panel{box-shadow:0 -20px 60px rgba(0,0,0,.25)}.spi-close{display:none}.spi-nav{width:38px;height:54px}.spi-toolbar{bottom:10px}.sp-photo-grid{grid-template-columns:repeat(auto-fill,minmax(86px,1fr))}}

/* ServisPoint V2 - HEIC + video media cards */
.sp-photo-video-thumb,
.sp-photo-heic-thumb{width:100%;aspect-ratio:1/1;background:#e2e8f0;display:grid;place-items:center;position:relative;overflow:hidden}
.sp-photo-video-thumb video{width:100%;height:100%;object-fit:cover;display:block;background:#111827}
.sp-photo-video-thumb span{position:absolute;inset:auto auto 10px 10px;width:34px;height:34px;border-radius:999px;background:rgba(15,23,42,.78);color:#fff;display:grid;place-items:center;font-size:15px;padding:0}
.sp-photo-heic-thumb{background:linear-gradient(135deg,#eff6ff,#f8fafc);color:#0f172a;text-align:center;padding:10px;box-sizing:border-box}
.sp-photo-heic-thumb b{font-size:20px;letter-spacing:.08em}.sp-photo-heic-thumb small{display:block;color:#64748b;line-height:1.3;margin-top:5px}
.spi-media-slot{position:absolute;inset:0;display:grid;place-items:center;overflow:hidden;touch-action:none;cursor:grab}
.spi-media-slot img,.spi-media-slot video{max-width:92%;max-height:90%;object-fit:contain;transition:transform .08s linear;will-change:transform;box-shadow:0 20px 90px rgba(0,0,0,.45);border-radius:8px;background:#020617}
.spi-media-slot video{width:auto;height:auto}.spi-heic-preview{max-width:520px;background:#fff;color:#0f172a;border-radius:22px;padding:28px;text-align:center;box-shadow:0 20px 90px rgba(0,0,0,.45);display:grid;gap:12px}.spi-heic-preview b{font-size:34px}.spi-heic-preview span{color:#64748b;line-height:1.45}


/* ServisPoint v20 - viditelný stav protokolu */
.protocol-status-visible{display:inline-flex;align-items:center;gap:8px;margin-top:8px;padding:7px 10px;border-radius:999px;background:#eef2ff;border:1px solid #c7d2fe;color:#1e3a8a;font-size:13px;font-weight:700}.protocol-status-visible span{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#64748b}.protocol-process-summary span:last-child{color:#2563eb;font-weight:700}

/* ServisPoint V35 - výběr fotek do PDF protokolu */
.sp-photo-card{position:relative;display:block}
.sp-photo-card .sp-photo-open{display:block;width:100%;border:0;background:transparent;padding:0;margin:0;text-align:left;cursor:pointer;color:inherit;font:inherit}
.sp-photo-card.is-pdf-excluded{opacity:.64}
.sp-photo-card.is-pdf-excluded img,.sp-photo-card.is-pdf-excluded .sp-photo-video-thumb,.sp-photo-card.is-pdf-excluded .sp-photo-heic-thumb{filter:grayscale(.35)}
.sp-photo-pdf-toggle{position:absolute;right:6px;bottom:29px;display:flex;align-items:center;gap:4px;max-width:calc(100% - 12px);border:1px solid rgba(37,99,235,.22);border-radius:999px;background:rgba(255,255,255,.93);box-shadow:0 8px 20px rgba(15,23,42,.12);padding:4px 7px;font-size:10px;font-weight:900;color:#0f172a;cursor:pointer;z-index:2;backdrop-filter:blur(8px)}
.sp-photo-pdf-toggle input{width:13px;height:13px;accent-color:#2563eb;margin:0;cursor:pointer}
.sp-photo-pdf-toggle span{display:inline!important;padding:0!important;color:inherit!important;font-size:10px!important;white-space:nowrap!important;overflow:visible!important;text-overflow:clip!important}
@media(max-width:900px){.sp-photo-pdf-toggle{bottom:27px;font-size:9px;padding:4px 6px}.sp-photo-pdf-toggle span{font-size:9px!important}}


/* v36: Volba zahrnutí fotky do PDF je přesunutá z náhledu do detailu fotky */
.spi-pdf-box{margin-top:14px;border:1px solid #dbeafe;background:#f8fbff;border-radius:16px;padding:12px 13px;color:#0f172a}
.spi-pdf-toggle{display:flex;align-items:center;gap:10px;font-weight:900;color:#0f172a;cursor:pointer;user-select:none}
.spi-pdf-toggle input{width:18px;height:18px;accent-color:#2563eb;margin:0;cursor:pointer}
.spi-pdf-toggle span{font-size:14px}
.spi-pdf-box small{display:block;margin-top:7px;color:#64748b;line-height:1.35;font-size:12px}

/* ------------------------------------------------------------------
   Dashboard V38 - rychlý přehled zakázek, protokolů a fotek
------------------------------------------------------------------- */
.dashboard-v2{display:grid;gap:18px}.dash-hero{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:24px 26px;background:linear-gradient(135deg,#fff 0%,#f8fbff 54%,#eef4ff 100%);overflow:hidden;position:relative}.dash-hero:after{content:"";position:absolute;right:-80px;top:-100px;width:260px;height:260px;border-radius:70px;background:linear-gradient(135deg,rgba(47,99,246,.18),rgba(7,20,38,.08));transform:rotate(18deg)}.dash-hero>*{position:relative;z-index:1}.dash-hero h1{margin:2px 0 6px;font-size:30px;letter-spacing:-.03em}.dash-hero p{margin:0;color:#667085}.dash-quick-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}.dash-action{display:inline-flex;align-items:center;justify-content:center;border:1px solid #dbe4f0;background:#fff;border-radius:14px;padding:11px 14px;font-weight:900;color:#0f172a;box-shadow:0 8px 20px rgba(15,23,42,.05)}.dash-action.primary{background:#2f63f6;border-color:#2f63f6;color:#fff}.dash-stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.dash-stat-card{display:block;background:#fff;border:1px solid #e7ebf2;border-radius:20px;padding:17px 18px;box-shadow:0 16px 34px rgba(15,23,42,.055);color:#0f172a;min-height:146px;transition:.18s}.dash-stat-card:hover{transform:translateY(-2px);box-shadow:0 20px 45px rgba(15,23,42,.09);border-color:#cbd8ff}.dash-stat-icon{width:42px;height:42px;border-radius:15px;display:grid;place-items:center;font-weight:900;margin-bottom:12px}.dash-stat-icon.blue{background:#eef4ff;color:#2f63f6}.dash-stat-icon.purple{background:#f3e8ff;color:#7c3aed}.dash-stat-icon.orange{background:#fff7ed;color:#ea580c}.dash-stat-icon.green{background:#ecfdf5;color:#16a34a}.dash-stat-card small{display:block;color:#667085;font-weight:800}.dash-stat-card b{display:block;font-size:34px;line-height:1;margin:7px 0 8px;letter-spacing:-.04em}.dash-stat-card em{font-style:normal;color:#667085;font-size:12px}.dash-grid-main{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(330px,.75fr);gap:18px;align-items:start}.dash-column{display:grid;gap:18px}.dash-panel{padding:18px}.dash-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}.dash-panel-head h2{margin:0;font-size:18px;letter-spacing:-.02em}.dash-panel-head p{margin:4px 0 0;color:#667085;font-size:13px}.dash-panel-head>a{font-weight:900;font-size:13px}.dash-list{display:grid;gap:10px}.dash-list.compact{gap:9px}.dash-job-item,.dash-protocol-item{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;background:#fff;border:1px solid #e7ebf2;border-radius:16px;padding:14px 14px 14px 18px;color:#0f172a;overflow:hidden;transition:.16s}.dash-job-item:hover,.dash-protocol-item:hover{border-color:#b7c6ff;box-shadow:0 10px 24px rgba(47,99,246,.09);transform:translateY(-1px)}.dash-state-bar{position:absolute;left:0;top:0;bottom:0;width:5px;background:#94a3b8}.dash-state-bar.blue{background:#2f63f6}.dash-state-bar.purple{background:#7c3aed}.dash-state-bar.orange{background:#f59e0b}.dash-state-bar.green{background:#16a34a}.dash-state-bar.red{background:#ef4444}.dash-item-main{min-width:0}.dash-item-main b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}.dash-item-main small{display:block;color:#667085;margin-top:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dash-item-side{text-align:right;min-width:132px}.dash-item-side em{display:inline-flex;background:#f1f5f9;color:#334155;border-radius:999px;padding:4px 8px;font-style:normal;font-size:11px;font-weight:900}.dash-item-side small{display:block;color:#667085;margin-top:5px;font-size:11px}.dash-protocol-item{grid-template-columns:auto minmax(0,1fr) auto;padding-left:14px}.dash-protocol-code{display:inline-flex;align-items:center;justify-content:center;min-width:92px;background:#eef4ff;color:#2f63f6;border-radius:12px;padding:8px 10px;font-weight:900;font-size:12px}.dash-status-pill{display:inline-flex;border-radius:999px;padding:6px 9px;font-size:11px;font-weight:900;white-space:nowrap}.dash-status-pill.blue{background:#eef4ff;color:#2f63f6}.dash-status-pill.orange{background:#fff7ed;color:#ea580c}.dash-status-pill.green{background:#ecfdf5;color:#16a34a}.dash-status-pill.red{background:#fef2f2;color:#ef4444}.dash-nav-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.dash-nav-tile{display:block;border:1px solid #e7ebf2;background:linear-gradient(180deg,#fff,#f8fafc);border-radius:16px;padding:14px;color:#0f172a}.dash-nav-tile:hover{border-color:#b7c6ff;background:#fff;box-shadow:0 10px 24px rgba(15,23,42,.07)}.dash-nav-tile b{display:block;font-size:14px}.dash-nav-tile span{display:block;color:#667085;font-size:12px;margin-top:4px}.dash-photo-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.dash-photo{display:block;border-radius:16px;overflow:hidden;background:#eef2f7;border:1px solid #e7ebf2;color:#0f172a;min-height:126px;position:relative}.dash-photo img{display:block;width:100%;height:118px;object-fit:cover}.dash-photo span{display:block;padding:7px 9px;font-size:11px;color:#64748b;background:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dash-empty{border:1px dashed #d8e0ec;border-radius:16px;background:#f8fafc;color:#64748b;padding:18px;text-align:center;font-weight:700}.dash-empty.photos{grid-column:1/-1}.dash-activity{display:grid;gap:12px}.dash-activity div{display:grid;grid-template-columns:14px minmax(0,1fr);gap:8px}.dash-activity i{width:9px;height:9px;border-radius:50%;background:#2f63f6;margin-top:4px}.dash-activity b{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dash-activity span{grid-column:2;color:#667085;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:-7px}
@media(max-width:1180px){.dash-stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dash-grid-main{grid-template-columns:1fr}.dash-column.side{grid-template-columns:repeat(2,minmax(0,1fr))}.activity-panel{grid-column:1/-1}}
@media(max-width:700px){.dashboard-v2{gap:12px}.dash-hero{display:block;padding:18px}.dash-hero h1{font-size:24px}.dash-quick-actions{justify-content:flex-start;margin-top:14px}.dash-action{padding:9px 11px;border-radius:12px;font-size:13px}.dash-stats-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.dash-stat-card{min-height:118px;padding:13px}.dash-stat-card b{font-size:28px}.dash-stat-icon{width:34px;height:34px;border-radius:12px;margin-bottom:8px}.dash-grid-main,.dash-column.side{grid-template-columns:1fr;gap:12px}.dash-panel{padding:14px;border-radius:18px}.dash-panel-head h2{font-size:16px}.dash-panel-head p{font-size:12px}.dash-job-item{grid-template-columns:1fr;padding:13px 13px 13px 16px}.dash-item-side{text-align:left;min-width:0}.dash-item-side small{display:inline;margin-left:6px}.dash-protocol-item{grid-template-columns:1fr;gap:8px}.dash-protocol-code{width:max-content;min-width:0}.dash-status-pill{width:max-content}.dash-nav-grid{grid-template-columns:1fr 1fr}.dash-photo-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}.dash-photo{min-height:78px;border-radius:12px}.dash-photo img{height:70px}.dash-photo span{display:none}.dash-activity div{grid-template-columns:12px minmax(0,1fr)}}

/* Globální vyhledávání v horní liště */
.global-search-wrap{position:relative;width:min(520px,38vw)}
.global-search-wrap .global-search{width:100%;padding-left:42px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%236b7280' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center;box-shadow:0 10px 30px rgba(15,23,42,.05)}
.global-search-panel{position:absolute;right:0;top:calc(100% + 10px);width:min(720px,calc(100vw - 28px));max-height:min(620px,calc(100vh - 130px));overflow:auto;background:#fff;border:1px solid var(--line);border-radius:22px;box-shadow:0 28px 80px rgba(15,23,42,.22);z-index:80;padding:10px}
.global-search-panel[hidden]{display:none!important}.global-search-summary{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:10px 12px 12px;border-bottom:1px solid var(--line);margin-bottom:6px}.global-search-summary>b{font-size:14px}.global-search-summary div{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.global-search-summary span{font-size:11px;color:#475569;background:#f1f5f9;border:1px solid #e2e8f0;border-radius:999px;padding:4px 8px}.global-search-result{display:grid;grid-template-columns:42px 1fr;gap:11px;align-items:center;padding:10px;border-radius:16px;color:var(--text)}.global-search-result:hover{background:#f8fbff}.global-search-result i{width:42px;height:42px;border-radius:14px;background:#e9efff;display:grid;place-items:center;font-style:normal}.global-search-result img{width:42px;height:42px;border-radius:14px;object-fit:cover;background:#f1f5f9}.global-search-result b{display:block;font-size:14px;line-height:1.25;color:#0f172a}.global-search-result small{display:block;color:#64748b;margin-top:3px;font-size:12px;line-height:1.35}.global-search-hint,.global-search-empty,.global-search-loading{padding:18px;border-radius:16px;background:#f8fafc;color:#64748b}.global-search-hint b,.global-search-empty b{display:block;color:#0f172a;margin-bottom:5px}.global-search-loading{font-weight:800;color:#2452d9;background:#e9efff}
@media(max-width:860px){.global-search-wrap{width:100%}.global-search-panel{position:fixed;left:10px;right:10px;top:74px;width:auto;max-height:calc(100vh - 95px);border-radius:20px}.topbar .top-actions{width:100%;display:grid;grid-template-columns:1fr auto auto;gap:8px}.topbar .top-actions .global-search-wrap{grid-column:1 / -1}.global-search-summary{display:block}.global-search-summary div{justify-content:flex-start;margin-top:8px}.global-search-result{grid-template-columns:38px 1fr;padding:9px}.global-search-result i,.global-search-result img{width:38px;height:38px;border-radius:13px}}

/* ServisPoint V2 - moderní kalendář plánování */
.calendar-page{display:grid;gap:18px}.calendar-hero{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:22px 24px;background:linear-gradient(135deg,#fff,#f7faff)}.calendar-hero h2{margin:4px 0 4px;font-size:26px}.eyebrow{margin:0;color:var(--blue);font-weight:900;text-transform:uppercase;font-size:12px;letter-spacing:.08em}.muted{color:var(--muted)}.calendar-hero-actions{display:flex;gap:10px;flex-wrap:wrap}.calendar-layout{display:grid;grid-template-columns:290px minmax(0,1fr);gap:18px}.calendar-side{padding:16px;max-height:calc(100vh - 150px);overflow:auto;position:sticky;top:112px}.calendar-main{padding:14px;overflow:hidden}.calendar-side-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}.calendar-side-head small{background:#eef4ff;color:var(--blue);border-radius:999px;padding:4px 9px;font-weight:900}.soft-sep{border:0;border-top:1px solid var(--line);margin:16px 0}.calendar-tech-list,.calendar-job-list{display:grid;gap:8px}.cal-tech,.cal-job{width:100%;border:1px solid var(--line);background:#fff;border-radius:15px;padding:10px;text-align:left;cursor:pointer;transition:.16s}.cal-tech{display:flex;align-items:center;gap:10px}.cal-tech:hover,.cal-job:hover{transform:translateY(-1px);box-shadow:0 10px 24px rgba(15,23,42,.08)}.cal-tech.active{border-color:#bfd0ff;background:#f5f8ff}.cal-tech small,.cal-job small{display:block;color:var(--muted);font-size:12px;margin-top:2px}.cal-avatar{width:34px;height:34px;border-radius:50%;display:inline-grid;place-items:center;background:linear-gradient(135deg,#2f63f6,#7c3aed);color:white;font-weight:900;overflow:hidden;flex:0 0 auto}.cal-avatar img{width:100%;height:100%;object-fit:cover}.cal-avatar.tiny{width:25px;height:25px;font-size:11px;margin-right:5px}.cal-mini-search{width:100%;border:1px solid var(--line);border-radius:12px;padding:10px;margin:0 0 10px}.calendar-job-list{max-height:320px;overflow:auto;padding-right:3px}.cal-job b{display:block;line-height:1.22}.service-calendar{--fc-border-color:#e8edf6;--fc-button-bg-color:#fff;--fc-button-border-color:#e3e9f3;--fc-button-text-color:#0f172a;--fc-button-active-bg-color:#2f63f6;--fc-button-active-border-color:#2f63f6;--fc-today-bg-color:#f4f7ff;--fc-event-bg-color:#2f63f6;--fc-event-border-color:#2f63f6}.service-calendar .fc-toolbar-title{font-size:22px;font-weight:900}.service-calendar .fc-button{border-radius:11px!important;font-weight:800!important;box-shadow:none!important;padding:8px 11px!important}.service-calendar .fc-col-header-cell{background:#f8fbff}.service-calendar .fc-col-header-cell-cushion{padding:10px 4px;color:#334155}.service-calendar .fc-timegrid-slot{height:38px}.service-calendar .fc-event{border-radius:12px;border:0;box-shadow:0 8px 20px rgba(47,99,246,.18);overflow:hidden}.service-calendar .fc-event-main{padding:4px 6px}.fc-sp-event{display:grid;gap:2px;min-width:0}.fc-sp-event b{font-size:12px;line-height:1.18;white-space:normal}.fc-sp-event small{font-size:10px;opacity:.85}.fc-tech-stack{display:flex;margin-top:3px}.fc-tech-stack img,.fc-tech-stack i{width:18px;height:18px;border-radius:50%;border:2px solid rgba(255,255,255,.8);background:#e9efff;color:#2f63f6;display:grid;place-items:center;font-size:9px;font-weight:900;margin-left:-5px;object-fit:cover}.fc-tech-stack img:first-child,.fc-tech-stack i:first-child{margin-left:0}.calendar-cdn-warning{padding:16px;border-radius:14px;background:#fee2e2;color:#991b1b;font-weight:800}.cal-tech-picker{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}.cal-tech-chip{display:inline-flex!important;align-items:center;gap:4px;border:1px solid var(--line);border-radius:999px;padding:7px 10px;margin:0!important;background:#fff;font-size:13px}.cal-tech-chip input{width:auto!important;margin:0!important}.cal-modal-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:14px}.btn.danger{background:#fee2e2;border-color:#fecaca;color:#b91c1c}.cal-all-day{align-self:center;margin-top:26px!important}
@media(max-width:980px){.calendar-layout{grid-template-columns:1fr}.calendar-side{position:relative;top:auto;max-height:none}.calendar-tech-list{display:flex;overflow:auto;padding-bottom:4px}.cal-tech{min-width:185px}.calendar-job-list{max-height:180px}.calendar-hero{align-items:flex-start;flex-direction:column}.calendar-hero-actions{width:100%}.calendar-hero-actions .btn{flex:1}.calendar-main{padding:8px}.service-calendar .fc-toolbar{gap:8px;align-items:flex-start;flex-direction:column}.service-calendar .fc-toolbar-chunk{display:flex;flex-wrap:wrap;gap:6px}.service-calendar .fc-toolbar-title{font-size:18px}.service-calendar .fc-button{padding:7px 9px!important;font-size:12px!important}.service-calendar .fc-timegrid-slot{height:34px}.cal-modal-actions .btn{flex:1 1 45%}}

/* Calendar v41 refinements */
body[data-page="calendar"] .topbar .global-search-wrap{display:none!important}
body[data-page="calendar"] .topbar{min-height:76px;height:auto}
.calendar-hero-actions-search{align-items:center}
.calendar-event-search-wrap{position:relative;min-width:280px;flex:1 1 320px;max-width:460px}
.cal-event-search{width:100%;border:1px solid var(--line);border-radius:14px;padding:11px 42px 11px 14px;background:#fff;box-shadow:0 8px 18px rgba(15,23,42,.04);font-weight:700}
.cal-event-search:focus{outline:2px solid rgba(47,99,246,.18);border-color:#bfd0ff}
.cal-event-search-clear{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:30px;height:30px;display:grid;place-items:center;padding:0;font-size:18px;line-height:1}
.fc-tech-stack i{font-style:normal}
@media(max-width:980px){
  body[data-page="calendar"] .topbar{display:none}
  .calendar-event-search-wrap{max-width:none;width:100%;flex-basis:100%}
  .calendar-hero-actions-search{display:grid;grid-template-columns:1fr 1fr;width:100%}
  .calendar-event-search-wrap{grid-column:1/-1}
}

/* Calendar v42 - rychlý detail události, mapa, poznámka k zakázce */
.cal-info-sheet{display:grid;gap:14px;min-width:min(720px,calc(100vw - 42px));max-width:820px}
.cal-info-head{padding:6px 2px 2px}.cal-info-head span{display:inline-flex;border-radius:999px;background:#eef4ff;color:#2452d9;font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.07em;padding:5px 9px}.cal-info-head h2{margin:9px 0 4px;font-size:24px;letter-spacing:-.025em}.cal-info-head p{margin:0;color:#64748b;font-weight:800}.cal-info-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.cal-info-grid>div{border:1px solid #e7edf7;background:#f8fbff;border-radius:16px;padding:12px}.cal-info-grid small,.cal-info-note small{display:block;color:#64748b;font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.06em;margin-bottom:5px}.cal-info-grid b{display:block;color:#0f172a;font-size:13px;line-height:1.35}.cal-info-techs{display:flex!important;align-items:center;gap:7px;flex-wrap:wrap}.cal-info-map{border:1px solid #e7edf7;border-radius:18px;overflow:hidden;background:#eef2f7;height:210px}.cal-info-map iframe{border:0;width:100%;height:100%;display:block}.cal-info-note{border:1px solid #e7edf7;border-radius:16px;padding:13px;background:#fff}.cal-info-note p{margin:0;color:#334155;line-height:1.45;max-height:180px;overflow:auto}.cal-info-add-note{border:1px solid #dbeafe;background:#f8fbff;border-radius:17px;padding:13px;display:grid;gap:10px}.cal-info-add-note label{margin:0!important;font-weight:900;color:#0f172a}.cal-info-add-note textarea{margin-top:7px;width:100%;border:1px solid #d6e0ef;border-radius:13px;padding:10px;resize:vertical;min-height:78px}.cal-info-actions{display:flex;gap:9px;flex-wrap:wrap;justify-content:flex-end}.cal-info-actions .btn{min-width:120px}.calendar-event-form[data-saving="1"]{opacity:.72;pointer-events:none}
@media(max-width:760px){.cal-info-sheet{min-width:0;max-width:none}.cal-info-head h2{font-size:20px}.cal-info-grid{grid-template-columns:1fr}.cal-info-map{height:180px}.cal-info-actions{display:grid;grid-template-columns:1fr 1fr}.cal-info-actions .btn{min-width:0;width:100%}}

/* v43: calendar events embedded in job detail */
.job-calendar-card .section-line{align-items:flex-start}.job-calendar-card .section-line h2{margin-bottom:2px}.job-calendar-list{display:grid;gap:10px}.job-calendar-event{display:grid;grid-template-columns:92px minmax(0,1fr);gap:12px;border:1px solid #e6edf7;background:linear-gradient(180deg,#ffffff,#fbfdff);border-radius:18px;padding:12px;box-shadow:0 10px 26px rgba(15,23,42,.045)}.job-calendar-date{border-radius:15px;background:#eef4ff;color:#1d4ed8;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;min-height:74px;padding:8px}.job-calendar-date b{font-size:14px;line-height:1.1}.job-calendar-date span{font-size:12px;font-weight:900;margin-top:5px;color:#334155}.job-calendar-body{min-width:0}.job-calendar-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}.job-calendar-title-row small{display:inline-flex;margin-bottom:3px;color:#64748b;font-weight:900;text-transform:uppercase;letter-spacing:.06em;font-size:10px}.job-calendar-title-row h3{margin:0;font-size:16px;line-height:1.24;color:#0f172a}.job-calendar-techs{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:8px;color:#334155;font-size:13px}.job-calendar-techs b{font-weight:800}.job-cal-avatar{width:26px;height:26px;border-radius:50%;display:inline-grid;place-items:center;overflow:hidden;background:linear-gradient(135deg,#2f63f6,#7c3aed);color:white;font-size:11px;font-weight:900;border:2px solid #fff;box-shadow:0 2px 8px rgba(15,23,42,.12);margin-right:-3px}.job-cal-avatar img{width:100%;height:100%;object-fit:cover}.job-calendar-meta{margin-top:8px;font-size:13px;color:#475569;line-height:1.35}.job-calendar-meta a{font-weight:900;color:#2452d9;margin-left:5px}.job-calendar-note{margin:9px 0 0;color:#475569;background:#f8fafc;border-radius:12px;padding:9px 10px;font-size:13px;line-height:1.42}.job-calendar-event.is-past{opacity:.74}@media(max-width:720px){.job-calendar-event{grid-template-columns:1fr;padding:11px}.job-calendar-date{align-items:flex-start;text-align:left;min-height:auto}.job-calendar-date b{font-size:13px}.job-calendar-title-row h3{font-size:15px}.job-calendar-card .section-line{gap:8px}.job-calendar-card .section-line .btn{width:100%;justify-content:center}}

/* ServisPoint v44 - menu / documents */
.nav-item.nav-disabled{opacity:.38;cursor:not-allowed;filter:grayscale(.4);position:relative;user-select:none}
.nav-item.nav-disabled:hover{background:transparent;color:#dbe7ff;transform:none;box-shadow:none}
.nav-item.nav-disabled em{margin-left:auto;font-size:9px;font-style:normal;background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.12);padding:2px 6px;border-radius:999px;color:#cbd5e1}
.docs-head{align-items:flex-start}.docs-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:18px}.docs-toolbar-card{padding:16px}.docs-toolbar{display:grid;grid-template-columns:minmax(260px,1.6fr) minmax(180px,.7fr) minmax(160px,.55fr);gap:12px;align-items:end}.docs-toolbar label{font-size:12px;font-weight:800;color:#64748b}.docs-toolbar label span{display:block;margin:0 0 6px}.docs-toolbar .smart-input{width:100%}.tag-cloud{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.tag-cloud button{border:1px solid #dbe5f2;background:#f8fafc;color:#3151b5;border-radius:999px;padding:6px 10px;font-weight:800;cursor:pointer}.tag-cloud button:hover,.tag-cloud button.active{background:#e9efff;border-color:#bfd0ff}.docs-grid{display:grid;gap:12px}.doc-card{display:grid;grid-template-columns:58px minmax(0,1fr) auto;gap:14px;align-items:center;background:#fff;border:1px solid #e5eaf3;border-radius:20px;padding:14px 16px;box-shadow:0 12px 30px rgba(15,23,42,.045)}.doc-card:hover{border-color:#b8c8ff;box-shadow:0 16px 36px rgba(47,99,246,.08)}.doc-file-icon{width:58px;height:58px;border-radius:18px;background:linear-gradient(135deg,#edf4ff,#f8fbff);border:1px solid #dce7fb;color:#2452d9;display:grid;place-items:center}.doc-file-icon b{font-size:13px;letter-spacing:.04em}.doc-main{min-width:0}.doc-topline{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:5px}.doc-category{background:#eef4ff;color:#2452d9;border-radius:999px;padding:4px 8px;font-size:11px;font-weight:900}.doc-source{background:#f1f5f9;color:#64748b;border-radius:999px;padding:4px 8px;font-size:11px;font-weight:800}.doc-source.linked{background:#ecfdf5;color:#15803d}.doc-card h2{margin:0 0 4px;font-size:17px;letter-spacing:-.02em}.doc-card p{margin:0 0 4px;color:#64748b}.doc-note{color:#334155!important}.doc-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.doc-tags span{font-size:11px;font-weight:800;color:#5b6b85;background:#f8fafc;border:1px solid #e5eaf3;border-radius:999px;padding:3px 7px}.doc-meta{display:flex;gap:12px;flex-wrap:wrap;color:#94a3b8;font-size:12px;margin-top:8px}.doc-actions{display:flex;gap:8px;align-items:center;justify-content:flex-end}.docs-empty{grid-column:1/-1}.muted{color:#64748b}@media(max-width:860px){.docs-stats{grid-template-columns:1fr}.docs-toolbar{grid-template-columns:1fr}.doc-card{grid-template-columns:48px minmax(0,1fr);align-items:start}.doc-file-icon{width:48px;height:48px;border-radius:15px}.doc-actions{grid-column:1/-1;justify-content:stretch}.doc-actions .btn{flex:1;text-align:center}.nav-item.nav-disabled em{display:none}}

/* ServisPoint performance pass v45: levnější vykreslení velkých galerií/seznamů */
.sp-photo-card{content-visibility:auto;contain-intrinsic-size:180px 150px;}
.sp-photo-card img{object-fit:cover;background:#f1f5f9;}
@media (max-width:860px){
  .job-mobile-card,.protocol-mobile-card,.org-mobile-card{content-visibility:auto;contain-intrinsic-size:120px 88px;}
}

/* v49 - nastavení typů položek protokolů */
.settings-types-list{display:flex;flex-direction:column;gap:10px;margin-top:12px}
.settings-type-row,.settings-type-add{display:grid;grid-template-columns:minmax(110px,.8fr) minmax(180px,1.4fr) 90px 90px auto;gap:10px;align-items:end;background:#f8fafc;border:1px solid #e5edf7;border-radius:16px;padding:12px}
.settings-type-row label,.settings-type-add label{font-size:12px;font-weight:800;color:#334155;display:flex;flex-direction:column;gap:5px;margin:0}
.settings-type-row input,.settings-type-add input{height:38px;border-radius:10px;border:1px solid #d7e2f0;padding:0 10px;background:#fff;font-weight:700;color:#0f172a}
.settings-type-row .type-active{align-items:center;justify-content:center;flex-direction:row;height:38px;background:#fff;border:1px solid #d7e2f0;border-radius:10px;padding:0 8px;gap:6px}
.settings-type-row .type-active input{height:auto;width:auto;padding:0}
@media(max-width:860px){.settings-type-row,.settings-type-add{grid-template-columns:1fr}.settings-type-row .btn,.settings-type-add .btn{width:100%}}
.settings-type-actions{display:flex;gap:8px;align-items:center}
.settings-type-actions .btn{white-space:nowrap}
@media(max-width:860px){.settings-type-actions{display:grid;grid-template-columns:1fr 1fr}.settings-type-actions .btn{width:100%}}

/* v50 – kompaktní správa typů položek protokolu */
.settings-types-compact{margin-top:12px;border:1px solid #e6edf7;border-radius:16px;overflow:hidden;background:#fff}
.settings-type-head{display:grid;grid-template-columns:120px minmax(220px,1fr) 86px 88px 142px;gap:8px;align-items:center;padding:9px 12px;background:#f8fbff;border-bottom:1px solid #e6edf7;color:#64748b;font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.04em}
.settings-type-row.compact,.settings-type-add.compact{display:grid;grid-template-columns:120px minmax(220px,1fr) 86px 88px 142px;gap:8px;align-items:center;margin:0;padding:8px 12px;background:#fff;border:0;border-bottom:1px solid #eef3f9;border-radius:0}
.settings-type-row.compact:nth-child(odd){background:#fbfdff}
.settings-type-row.compact:last-child{border-bottom:0}
.settings-type-row.compact .field,.settings-type-add.compact .field{display:block;margin:0}
.settings-type-row.compact input,.settings-type-add.compact input{width:100%;height:34px;border:1px solid #dbe5f2;border-radius:10px;background:#fff;padding:0 10px;font-size:13px;font-weight:700;color:#0f172a}
.settings-type-row.compact .field.code input,.settings-type-add.compact .field.code input{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px}
.settings-type-row.compact .field.order input,.settings-type-add.compact .field.order input{text-align:right}
.settings-type-row.compact .type-active.compact{display:flex!important;align-items:center;justify-content:center;gap:7px;height:34px;margin:0;padding:0 8px;border:1px solid #dbe5f2;border-radius:10px;background:#fff;color:#334155;font-size:12px;font-weight:800;line-height:1;white-space:nowrap}
.settings-type-row.compact .type-active.compact input{width:16px;height:16px;margin:0;padding:0;flex:0 0 auto;accent-color:var(--blue)}
.settings-type-actions.compact{display:flex;gap:6px;align-items:center;justify-content:flex-end;min-width:0}
.settings-type-actions.compact .btn,.settings-type-add.compact .btn{height:34px;padding:0 10px;border-radius:10px;font-size:12px;line-height:1;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap}
.settings-type-add.compact{margin-top:10px;border:1px dashed #cfe0ff;border-radius:14px;background:#f8fbff}
.settings-type-add.compact .type-add-placeholder{height:1px}.mobile-label{display:none}
@media(max-width:860px){
  .settings-type-head{display:none}
  .settings-types-compact{border:0;background:transparent;display:grid;gap:8px;overflow:visible}
  .settings-type-row.compact,.settings-type-add.compact{grid-template-columns:92px 1fr 74px;grid-template-areas:"code name order" "active active actions";gap:8px;padding:10px;border:1px solid #e6edf7;border-radius:14px;background:#fff}
  .settings-type-row.compact .field.code,.settings-type-add.compact .field.code{grid-area:code}.settings-type-row.compact .field.name,.settings-type-add.compact .field.name{grid-area:name}.settings-type-row.compact .field.order,.settings-type-add.compact .field.order{grid-area:order}
  .settings-type-row.compact .type-active.compact{grid-area:active;justify-content:flex-start;border:0;background:transparent;height:30px;padding:0}.settings-type-actions.compact{grid-area:actions;justify-content:flex-end}.settings-type-add.compact .type-add-placeholder{display:none}.settings-type-add.compact .btn{grid-area:actions;width:100%}
  .settings-type-actions.compact .btn{min-width:70px}.mobile-label{display:block;color:#64748b;font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.04em;margin-bottom:3px}
}

/* v51 – správa typů položek protokolu: finální kompaktní desktop + čistý mobil */
.protocol-types-settings{overflow:visible}
.protocol-types-settings .compact-head{margin-bottom:10px}
.protocol-type-editor{width:100%;border:1px solid #e6edf7;border-radius:16px;background:#fff;overflow:hidden;box-shadow:0 10px 26px rgba(15,23,42,.035)}
.protocol-type-header,
.protocol-type-row{display:grid;grid-template-columns:minmax(92px,120px) minmax(180px,1fr) 88px 92px 142px;gap:8px;align-items:center}
.protocol-type-header{padding:8px 12px;background:#f8fbff;border-bottom:1px solid #e6edf7;color:#64748b;font-size:10.5px;font-weight:900;text-transform:uppercase;letter-spacing:.05em}
.protocol-type-row{margin:0!important;padding:7px 12px!important;background:#fff!important;border:0!important;border-bottom:1px solid #eef3f9!important;border-radius:0!important;min-height:48px}
.protocol-type-row:nth-of-type(even){background:#fbfdff!important}
.protocol-type-row:last-child{border-bottom:0!important}
.protocol-type-row.protocol-type-new{background:#f8fbff!important;border-top:1px dashed #cbdaf4!important}
.protocol-type-row .ptr-field{display:block!important;margin:0!important;padding:0!important;min-width:0;color:#64748b;font-size:0;font-weight:900;line-height:1}
.protocol-type-row .ptr-field span{display:none}
.protocol-type-row .ptr-field input{width:100%!important;height:32px!important;min-height:32px!important;margin:0!important;padding:0 9px!important;border:1px solid #dbe5f2!important;border-radius:9px!important;background:#fff!important;color:#0f172a!important;font-size:12.5px!important;font-weight:750!important;box-shadow:none!important;line-height:32px!important}
.protocol-type-row .ptr-code input{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace!important;font-size:12px!important;color:#334155!important}
.protocol-type-row .ptr-order input{text-align:right!important}
.protocol-type-row .ptr-active{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:7px!important;height:32px!important;margin:0!important;padding:0 8px!important;border:1px solid #dbe5f2!important;border-radius:9px!important;background:#fff!important;color:#334155!important;font-size:12px!important;font-weight:850!important;line-height:1!important;white-space:nowrap!important;box-sizing:border-box!important;min-width:0!important;flex-direction:row!important}
.protocol-type-row .ptr-active input{appearance:auto!important;display:inline-block!important;width:15px!important;height:15px!important;min-width:15px!important;margin:0!important;padding:0!important;flex:0 0 15px!important;accent-color:var(--blue)!important;position:static!important}
.protocol-type-row .ptr-active span{display:inline-block!important;line-height:1!important;margin:0!important;white-space:nowrap!important}
.protocol-type-row .ptr-active-placeholder{border-style:dashed!important;color:#64748b!important;background:#f8fafc!important}
.protocol-type-row .ptr-actions{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:6px!important;margin:0!important;min-width:0!important}
.protocol-type-row .ptr-actions .btn{height:32px!important;min-height:32px!important;padding:0 10px!important;border-radius:9px!important;font-size:12px!important;font-weight:850!important;line-height:1!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;white-space:nowrap!important;margin:0!important}
.protocol-type-row .ptr-actions .btn.ghost.danger{background:#fff!important;border-color:#fecaca!important;color:#dc2626!important}
.protocol-type-row .ptr-actions .btn.ghost.danger:hover{background:#fff1f2!important}

@media(max-width:860px){
  .protocol-types-settings .card-head.rich{padding-bottom:4px}
  .protocol-types-settings .card-head.rich h2{font-size:18px}
  .protocol-types-settings .card-head.rich p{font-size:12px;line-height:1.35}
  .protocol-type-editor{border:0;background:transparent;box-shadow:none;overflow:visible;display:grid;gap:10px}
  .protocol-type-header{display:none!important}
  .protocol-type-row{display:grid!important;grid-template-columns:86px 1fr 66px!important;grid-template-areas:
    "code name order"
    "active active active"
    "actions actions actions"!important;gap:8px!important;align-items:end!important;min-height:0!important;padding:11px!important;border:1px solid #e4ebf6!important;border-radius:16px!important;background:#fff!important;box-shadow:0 10px 24px rgba(15,23,42,.045)!important}
  .protocol-type-row.protocol-type-new{border:1px dashed #bed0f8!important;background:#f8fbff!important}
  .protocol-type-row .ptr-field span{display:block!important;margin:0 0 5px!important;color:#64748b!important;font-size:10px!important;font-weight:900!important;text-transform:uppercase!important;letter-spacing:.05em!important;line-height:1!important}
  .protocol-type-row .ptr-field input{height:36px!important;min-height:36px!important;border-radius:11px!important;font-size:13px!important;line-height:36px!important}
  .protocol-type-row .ptr-code{grid-area:code!important}.protocol-type-row .ptr-name{grid-area:name!important}.protocol-type-row .ptr-order{grid-area:order!important}
  .protocol-type-row .ptr-active{grid-area:active!important;justify-content:flex-start!important;height:34px!important;border:0!important;background:#f8fafc!important;border-radius:12px!important;padding:0 10px!important;width:100%!important}
  .protocol-type-row .ptr-actions{grid-area:actions!important;display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;width:100%!important}
  .protocol-type-row .ptr-actions .btn{width:100%!important;height:38px!important;min-height:38px!important;border-radius:12px!important;font-size:13px!important}
  .protocol-type-row.protocol-type-new .ptr-actions{grid-template-columns:1fr!important}
  .protocol-type-row .ptr-active-placeholder{justify-content:flex-start!important;color:#64748b!important}
}

@media(max-width:420px){
  .protocol-type-row{grid-template-columns:1fr 1fr!important;grid-template-areas:
    "code order"
    "name name"
    "active active"
    "actions actions"!important}
  .protocol-type-row .ptr-actions{grid-template-columns:1fr!important}
}

/* v52 – oprava správy typů položek: mimo hlavní formulář, pevná řádková tabulka + mobilní karty */
.protocol-types-settings{
  margin-top:18px!important;
  overflow:visible!important;
}
.protocol-types-settings .card-head.rich.compact-head{
  display:flex!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  margin-bottom:12px!important;
}
.protocol-type-editor{
  width:100%!important;
  border:1px solid #e6edf7!important;
  border-radius:16px!important;
  background:#fff!important;
  overflow:hidden!important;
  box-shadow:0 10px 26px rgba(15,23,42,.035)!important;
}
.protocol-type-header{
  display:grid!important;
  grid-template-columns:120px minmax(220px,1fr) 86px 96px 148px!important;
  gap:8px!important;
  align-items:center!important;
  padding:9px 12px!important;
  background:#f8fbff!important;
  border-bottom:1px solid #e6edf7!important;
  color:#64748b!important;
  font-size:10.5px!important;
  font-weight:900!important;
  text-transform:uppercase!important;
  letter-spacing:.05em!important;
}
form.protocol-type-row{
  display:grid!important;
  grid-template-columns:120px minmax(220px,1fr) 86px 96px 148px!important;
  grid-template-areas:"code name order active actions"!important;
  gap:8px!important;
  align-items:center!important;
  margin:0!important;
  padding:7px 12px!important;
  min-height:48px!important;
  background:#fff!important;
  border:0!important;
  border-bottom:1px solid #eef3f9!important;
  border-radius:0!important;
  box-shadow:none!important;
}
form.protocol-type-row:nth-of-type(odd){background:#fbfdff!important;}
form.protocol-type-row:last-child{border-bottom:0!important;}
form.protocol-type-row.protocol-type-new{
  background:#f8fbff!important;
  border-top:1px dashed #cbdaf4!important;
}
form.protocol-type-row .ptr-code{grid-area:code!important;}
form.protocol-type-row .ptr-name{grid-area:name!important;}
form.protocol-type-row .ptr-order{grid-area:order!important;}
form.protocol-type-row .ptr-active{grid-area:active!important;}
form.protocol-type-row .ptr-actions{grid-area:actions!important;}
form.protocol-type-row .ptr-field{
  display:block!important;
  margin:0!important;
  padding:0!important;
  min-width:0!important;
  font-size:0!important;
  line-height:1!important;
}
form.protocol-type-row .ptr-field>span{display:none!important;}
form.protocol-type-row .ptr-field input{
  display:block!important;
  width:100%!important;
  height:32px!important;
  min-height:32px!important;
  margin:0!important;
  padding:0 9px!important;
  border:1px solid #dbe5f2!important;
  border-radius:9px!important;
  background:#fff!important;
  color:#0f172a!important;
  font-size:12.5px!important;
  font-weight:750!important;
  line-height:32px!important;
  box-shadow:none!important;
}
form.protocol-type-row .ptr-code input{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace!important;
  font-size:12px!important;
  color:#334155!important;
}
form.protocol-type-row .ptr-order input{text-align:right!important;}
form.protocol-type-row .ptr-active{
  display:inline-flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px!important;
  width:100%!important;
  height:32px!important;
  margin:0!important;
  padding:0 8px!important;
  border:1px solid #dbe5f2!important;
  border-radius:9px!important;
  background:#fff!important;
  color:#334155!important;
  font-size:12px!important;
  font-weight:850!important;
  line-height:1!important;
  white-space:nowrap!important;
  box-sizing:border-box!important;
}
form.protocol-type-row .ptr-active input{
  appearance:auto!important;
  display:inline-block!important;
  width:15px!important;
  height:15px!important;
  min-width:15px!important;
  margin:0!important;
  padding:0!important;
  position:static!important;
  flex:0 0 15px!important;
  accent-color:var(--blue)!important;
}
form.protocol-type-row .ptr-active span{
  display:inline-block!important;
  margin:0!important;
  line-height:1!important;
  white-space:nowrap!important;
}
form.protocol-type-row .ptr-active-placeholder{
  border-style:dashed!important;
  color:#64748b!important;
  background:#f8fafc!important;
}
form.protocol-type-row .ptr-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:6px!important;
  margin:0!important;
  min-width:0!important;
}
form.protocol-type-row .ptr-actions .btn{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  height:32px!important;
  min-height:32px!important;
  margin:0!important;
  padding:0 10px!important;
  border-radius:9px!important;
  font-size:12px!important;
  font-weight:850!important;
  line-height:1!important;
  white-space:nowrap!important;
}
form.protocol-type-row .ptr-actions .btn.ghost.danger{
  background:#fff!important;
  border-color:#fecaca!important;
  color:#dc2626!important;
}

@media(max-width:860px){
  .protocol-types-settings{margin-top:12px!important;padding:14px!important;border-radius:18px!important;}
  .protocol-types-settings .card-head.rich.compact-head{margin-bottom:10px!important;}
  .protocol-types-settings .card-head.rich h2{font-size:18px!important;}
  .protocol-types-settings .card-head.rich p{font-size:12px!important;line-height:1.35!important;}
  .protocol-type-editor{
    display:grid!important;
    gap:10px!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
    overflow:visible!important;
  }
  .protocol-type-header{display:none!important;}
  form.protocol-type-row{
    display:grid!important;
    grid-template-columns:92px 68px minmax(0,1fr)!important;
    grid-template-areas:
      "code order active"
      "name name name"
      "actions actions actions"!important;
    gap:9px!important;
    align-items:end!important;
    min-height:0!important;
    padding:11px!important;
    border:1px solid #e4ebf6!important;
    border-radius:16px!important;
    background:#fff!important;
    box-shadow:0 10px 24px rgba(15,23,42,.045)!important;
  }
  form.protocol-type-row:nth-of-type(odd){background:#fff!important;}
  form.protocol-type-row.protocol-type-new{background:#f8fbff!important;border:1px dashed #bed0f8!important;}
  form.protocol-type-row .ptr-field>span{
    display:block!important;
    margin:0 0 5px!important;
    color:#64748b!important;
    font-size:10px!important;
    font-weight:900!important;
    text-transform:uppercase!important;
    letter-spacing:.05em!important;
    line-height:1!important;
  }
  form.protocol-type-row .ptr-field input{
    height:36px!important;
    min-height:36px!important;
    border-radius:11px!important;
    font-size:13px!important;
    line-height:36px!important;
  }
  form.protocol-type-row .ptr-active{
    justify-content:flex-start!important;
    height:36px!important;
    border:1px solid #e6edf7!important;
    background:#f8fafc!important;
    border-radius:12px!important;
    padding:0 10px!important;
    align-self:end!important;
  }
  form.protocol-type-row .ptr-actions{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
    width:100%!important;
  }
  form.protocol-type-row .ptr-actions .btn{
    width:100%!important;
    height:38px!important;
    min-height:38px!important;
    border-radius:12px!important;
    font-size:13px!important;
  }
  form.protocol-type-row.protocol-type-new .ptr-actions{grid-template-columns:1fr!important;}
}

@media(max-width:420px){
  form.protocol-type-row{
    grid-template-columns:1fr 76px!important;
    grid-template-areas:
      "code order"
      "name name"
      "active active"
      "actions actions"!important;
  }
  form.protocol-type-row .ptr-actions{grid-template-columns:1fr!important;}
}
