/* Studio360 master patch — samo UI/navigacija, bez izmjene baze i poslovne logike. */
:root{--s360-top-gap:24px;--s360-safe-bottom:env(safe-area-inset-bottom,0px)}

/* Desktop korisnički meni je dio headera stranice, nije fixed i ne prekriva polja. */
.desktop-user-menu{position:relative;z-index:35;display:flex;align-items:center;justify-content:flex-end;margin-left:auto;flex:0 0 auto;max-width:min(300px,32vw)}
.desktop-user-row{display:flex;justify-content:flex-end;align-items:center;margin:0 0 14px;min-height:50px}
.desktop-user-button{border:1px solid rgba(215,198,170,.85);background:rgba(255,253,248,.92);backdrop-filter:blur(14px);box-shadow:0 12px 28px rgba(28,22,12,.10);border-radius:18px;min-height:48px;padding:7px 10px 7px 8px;display:flex;align-items:center;gap:10px;cursor:pointer;color:#17191d;font:inherit;max-width:100%}
.desktop-user-button:hover{background:#fff8eb;border-color:#d0a348}
.desktop-user-avatar{width:36px;height:36px;border-radius:13px;background:linear-gradient(135deg,#111214,#2b2b2b);display:grid;place-items:center;color:#fff;flex:0 0 auto}
.desktop-user-avatar svg{width:18px;height:18px;fill:currentColor}.desktop-user-text{display:grid;gap:1px;text-align:left;min-width:0}.desktop-user-text strong{font-size:14px;line-height:1;max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.desktop-user-text small{font-size:12px;color:#756c60}.desktop-user-caret{font-size:13px;color:#6d6255;margin-left:2px}.desktop-profile-popover{position:absolute;right:0;top:calc(100% + 10px);width:230px;background:rgba(255,253,248,.98);border:1px solid rgba(231,220,203,.95);border-radius:20px;box-shadow:0 22px 60px rgba(28,22,12,.18);padding:8px;z-index:190}.profile-popover-head{padding:10px 12px 12px;border-bottom:1px solid rgba(231,220,203,.75);margin-bottom:6px}.profile-popover-head strong{display:block;font-size:14px}.profile-popover-head small{display:block;color:#73695e;margin-top:3px;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.desktop-profile-popover a,.profile-popover a{display:flex;align-items:center;gap:9px;min-height:40px;padding:9px 10px;border-radius:13px;text-decoration:none;font-weight:850;color:#242019}.desktop-profile-popover a:hover,.profile-popover a:hover{background:#fff0d1}.desktop-profile-popover a.danger,.profile-popover a.danger{color:#9f2419}.desktop-profile-popover svg,.profile-popover svg{width:18px;height:18px;fill:currentColor;flex:0 0 auto}
@media(min-width:1201px){.sidebar-footer.user-card,.slim-user-card{display:none!important}.mobile-topbar{display:none!important}.main:not(.full){padding-top:28px;padding-right:28px}.desktop-user-menu{display:flex!important}}
@media(max-width:1200px){.desktop-user-menu{display:none!important}.profile-popover{position:fixed;right:10px;top:calc(var(--mobile-topbar-h,62px) + 8px);width:min(260px,calc(100vw - 20px));background:#fffdf8;border:1px solid rgba(231,220,203,.95);border-radius:18px;box-shadow:0 18px 50px rgba(20,18,14,.22);padding:8px;z-index:1300}.mobile-user-action{display:grid!important;place-items:center}}

/* Poruke u programu — čiste, vidljive, bez ružnog browser osjećaja */
.app-flash,.alert.app-flash{display:flex!important;align-items:flex-start;gap:10px;border-radius:18px!important;padding:13px 15px!important;background:#fff8e5!important;border:1px solid #f2cf78!important;color:#46340f!important;box-shadow:0 14px 34px rgba(61,43,5,.08)!important;margin:0 0 14px!important}.app-flash strong{font-size:13px;text-transform:uppercase;letter-spacing:.04em;white-space:nowrap}.app-flash span{line-height:1.35}.app-error-card{max-width:860px;margin:20px auto;background:#fffdf8;border:1px solid #ffd1cc;border-radius:24px;padding:22px;display:grid;grid-template-columns:54px 1fr;gap:16px}.app-error-card .error-icon{width:54px;height:54px;border-radius:18px;background:#fff1f0;color:#b42318;display:grid;place-items:center;font-weight:900;font-size:26px}.app-error-card h1{margin:0 0 8px}.app-error-card pre{white-space:pre-wrap;overflow:auto;background:#111;color:#fff;padding:12px;border-radius:14px}.error-actions{display:flex;gap:10px;flex-wrap:wrap;margin:14px 0}

/* Obavjestenja — fiksno gore, bez trzanja stranice */
.s360-page-toast{
  position:fixed!important;
  top:18px!important;
  right:22px!important;
  z-index:10080!important;
  width:min(460px,calc(100vw - 28px))!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 38px!important;
  gap:12px!important;
  align-items:start!important;
  border:1px solid rgba(242,207,120,.72)!important;
  border-radius:18px!important;
  background:rgba(255,248,229,.97)!important;
  color:#46340f!important;
  box-shadow:0 22px 70px rgba(31,24,9,.22)!important;
  padding:14px 14px 14px 16px!important;
  backdrop-filter:blur(14px)!important;
  transform:translateY(0);
  transition:opacity .18s ease,transform .18s ease!important;
}
.s360-page-toast.is-hiding{opacity:0!important;transform:translateY(-8px)!important;pointer-events:none!important}
.s360-page-toast strong{display:block!important;margin:0 0 3px!important;font-size:12px!important;text-transform:uppercase!important;letter-spacing:.04em!important;color:#7b5a10!important}
.s360-page-toast span{display:block!important;min-width:0!important;line-height:1.38!important;font-weight:750!important}
.s360-page-toast-close{width:34px!important;height:34px!important;border-radius:12px!important;border:1px solid rgba(120,90,22,.18)!important;background:#fffdf8!important;color:#4d3a12!important;cursor:pointer!important;font-size:20px!important;line-height:1!important;display:grid!important;place-items:center!important}
.s360-page-toast-close:hover{background:#111214!important;color:#fff!important;border-color:#111214!important}

/* Login — centrirano i premium, bez rezanja */
body.login-page{min-height:100dvh;background:radial-gradient(circle at 78% 22%,rgba(210,166,71,.24),transparent 33%),radial-gradient(circle at 20% 76%,rgba(17,18,20,.10),transparent 36%),linear-gradient(135deg,#f7f0e5,#efe5d5)}body.login-page .app{width:100%;min-height:100dvh}body.login-page .main.full{min-height:100dvh;display:grid!important;place-items:center!important;padding:20px!important;overflow:hidden}.login-wrap{width:100%;min-height:auto!important;display:grid;place-items:center;padding:0!important;position:relative}.login-wrap:before{content:'360';position:absolute;right:max(4vw,18px);top:50%;transform:translateY(-50%);font-weight:950;font-size:min(31vw,260px);letter-spacing:-.12em;color:rgba(17,18,20,.045);pointer-events:none;line-height:1}.login-card{position:relative;z-index:1;width:min(440px,94vw)!important;border-radius:30px!important;padding:30px!important;background:rgba(255,253,248,.94)!important;backdrop-filter:blur(16px);box-shadow:0 24px 70px rgba(32,24,12,.16)!important}.login-brand{margin-bottom:22px!important}.login-card .btn.primary{min-height:50px;border-radius:16px;font-size:15px}

/* Mobilna navigacija: bez donje trake koja prekriva forme */
.mobile-bottom-actions{display:none!important}.module-shell{max-width:100%}.module-headline{min-width:0}.module-tabs-unified{max-width:100%}.module-tabs-unified .module-tabs{max-width:100%}
@media(max-width:1200px){body:not(.guest):not(.login-page){padding-top:var(--mobile-topbar-h,62px)!important}.main{max-width:100vw!important;overflow-x:hidden!important}.module-shell{margin-bottom:10px!important}.module-headline{align-items:center!important}.module-name h1{line-height:1.06!important}.module-tabs-unified{position:sticky!important;top:var(--mobile-topbar-h,62px)!important;z-index:75!important;background:rgba(245,239,230,.95)!important;padding:7px 0!important;margin-bottom:12px!important;border-bottom:1px solid rgba(231,220,203,.7)!important}.module-tabs-unified .module-tabs{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;gap:7px!important;-webkit-overflow-scrolling:touch;scrollbar-width:none}.module-tabs-unified .module-tabs::-webkit-scrollbar{display:none}.module-tabs-unified .module-tab,.module-tabs-unified button.module-tab{flex:0 0 auto!important;min-height:38px!important;padding:0 12px!important;border-radius:999px!important;font-size:12.5px!important;white-space:nowrap!important}.sidebar{overscroll-behavior:contain}.sidebar-scroll{overflow-y:auto!important;-webkit-overflow-scrolling:touch}.sidebar-footer{display:none!important}}
@media(max-width:520px){.module-icon-box{width:40px!important;height:40px!important;border-radius:14px!important}.module-inline-back{width:40px!important;height:40px!important;min-width:40px!important;border-radius:14px!important}.module-name h1{font-size:22px!important}.main{padding-left:10px!important;padding-right:10px!important}.card{padding:12px!important;border-radius:18px!important}}

/* Mobilne forme i modali: dugmad se ne gube */
@media(max-width:760px){
  .s360-page-toast{top:calc(var(--mobile-topbar-h,62px) + 8px)!important;left:10px!important;right:10px!important;width:auto!important}
  .grid-form{grid-template-columns:1fr!important;gap:11px!important}.grid-form .wide,.wide{grid-column:1!important}input,select,textarea{font-size:16px!important;min-height:46px!important;max-width:100%!important}.actions,.row-actions{gap:8px}.actions .btn,.wide.actions .btn{min-height:44px}.card{max-width:100%;overflow:hidden}.table-wrap{max-width:100%;overflow-x:auto!important}.table-wrap table{min-width:720px}.searchbar{display:grid!important;grid-template-columns:1fr!important}.searchbar input,.searchbar select,.searchbar .btn{width:100%!important;min-width:0!important}
  .modal{position:fixed!important;inset:0!important;z-index:3000!important;padding:0!important;background:rgba(17,18,20,.62)!important;display:block!important}.modal[hidden]{display:none!important}.modal-card{width:100vw!important;height:100dvh!important;max-height:100dvh!important;border-radius:0!important;padding:0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;background:#fffdf8!important}.modal-card .page-head.compact{position:sticky!important;top:0!important;z-index:4!important;margin:0!important;padding:12px 14px!important;background:rgba(255,253,248,.96)!important;border-bottom:1px solid rgba(231,220,203,.85)!important;backdrop-filter:blur(12px)}.modal-card .page-head.compact h2{font-size:20px!important;line-height:1.1!important}.modal-card .page-head.compact p{display:none!important}.modal-card form{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;padding:14px!important;display:grid!important;align-content:start!important}.modal-card .actions:last-child,.modal-card .wide.actions:last-child{position:sticky!important;bottom:0!important;background:linear-gradient(180deg,rgba(255,253,248,.76),#fffdf8 28%)!important;border-top:1px solid rgba(231,220,203,.85)!important;margin:8px -14px -14px!important;padding:12px 14px calc(14px + var(--s360-safe-bottom))!important;display:grid!important;grid-template-columns:1fr!important;z-index:5}.modal-card .actions:last-child .btn,.modal-card .wide.actions:last-child .btn{width:100%!important;min-height:48px!important}
  form[data-warn-unsaved="1"]>.actions:last-child,form[data-warn-unsaved="1"] .wizard-step.active .actions,form[data-warn-unsaved="1"] .wizard-step.active .sticky-actions{position:sticky!important;bottom:0!important;z-index:60!important;background:linear-gradient(180deg,rgba(255,253,248,.72),#fffdf8 30%)!important;border-top:1px solid rgba(231,220,203,.9)!important;margin:12px -12px -12px!important;padding:12px 12px calc(12px + var(--s360-safe-bottom))!important;display:grid!important;grid-template-columns:1fr!important}.wizard-step.active .actions .btn,.wizard-step.active .sticky-actions .btn{width:100%;min-height:48px}.wizard-steps{position:sticky!important;top:calc(var(--mobile-topbar-h,62px) + 52px)!important;z-index:64!important;background:rgba(245,239,230,.96)!important;backdrop-filter:blur(10px);padding:6px 0!important;display:flex!important;gap:6px!important;overflow-x:auto!important}.wizard-steps button{flex:0 0 auto!important;min-height:38px!important;white-space:nowrap!important}.doc-summary{grid-template-columns:1fr!important}.app-error-card{grid-template-columns:1fr;margin:12px 0}.app-flash{display:block!important}.app-flash strong{display:block;margin-bottom:4px}
}

/* Dokument stavke na telefonu: nema izlaska van ekrana */
@media(max-width:760px){body[data-page="documents"] #itemsTable{min-width:0!important}body[data-page="documents"] #itemsTable thead{display:none!important}body[data-page="documents"] #itemsTable,body[data-page="documents"] #itemsTable tbody,body[data-page="documents"] #itemsTable tr,body[data-page="documents"] #itemsTable td{display:block!important;width:100%!important}body[data-page="documents"] #itemsTable tr{border:1px solid rgba(231,220,203,.95)!important;border-radius:18px!important;padding:10px!important;margin:0 0 10px!important;background:#fff!important}body[data-page="documents"] #itemsTable td{border:0!important;padding:6px 0!important}body[data-page="documents"] #itemsTable td:before{content:attr(data-label);display:block;font-weight:900;font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:#756b5e;margin-bottom:4px}body[data-page="documents"] #itemsTable select,body[data-page="documents"] #itemsTable input{width:100%!important;min-width:0!important}.service-select,.item-select{min-width:0!important;width:100%!important}}


/* Studio360 master UX zakrpa — korisnički meni skrola sa stranicom i ne prekriva unos. */
@media(min-width:1201px){
  .module-headline{align-items:center!important;flex-wrap:nowrap!important;gap:14px!important}
  .module-headline .desktop-user-menu{align-self:center;margin-left:auto}
  .module-headline .module-name{min-width:0;max-width:calc(100% - 360px)}
  .desktop-user-row .desktop-user-menu{margin-left:0}
  body.form-focus .desktop-profile-popover{display:none!important}
}
@media(max-width:1380px) and (min-width:1201px){
  .desktop-user-text small{display:none}.desktop-user-button{min-height:46px;padding-right:9px}.desktop-user-menu{max-width:240px}.module-name h1{font-size:36px}
}
@media(max-width:1200px){.desktop-user-row{display:none!important}.desktop-user-caret{display:none}}

/* Dosljedna dugmad i poruke u formama. */
.form-hint,.validation-summary{border:1px solid rgba(231,220,203,.95);background:#fffaf0;border-radius:18px;padding:12px 14px;color:#3d3122;line-height:1.35}
.validation-summary{border-color:#f2b5ad;background:#fff4f2;color:#84251b;margin-bottom:12px;box-shadow:0 12px 28px rgba(132,37,27,.08)}
.validation-summary strong{display:block;margin-bottom:6px}.validation-summary ul{margin:0;padding-left:18px}.validation-summary li{margin:4px 0}
.form input.s360-smart-invalid,.form select.s360-smart-invalid,.form textarea.s360-smart-invalid{border-color:#b42318!important;box-shadow:0 0 0 4px rgba(180,35,24,.14)!important;background:#fff7f6!important}
.btn.danger,button.danger,.danger.btn{background:#fff1f0!important;border-color:#ffccc7!important;color:#a01810!important}.btn.primary{box-shadow:0 12px 26px rgba(17,18,20,.14)}
@media(max-width:760px){
  .wizard-card{overflow:visible!important}.wizard-step.active{min-width:0!important}.wizard-step.active .actions,.wizard-step.active .sticky-actions{box-shadow:0 -14px 28px rgba(38,28,10,.08)}
  .validation-summary{position:relative;margin:0 0 12px!important}
}
