:root{--bg:#d9dadd;--panel:#eef0f3;--card:#fff;--text:#26303a;--muted:#6c7580;--line:#c7ccd2;--dark:#2d333a;--accent:#4b5967;--danger:#b42318;--success:#287d3c;--shadow:0 4px 14px rgba(0,0,0,.18)}body{margin:0;font:14px Arial,sans-serif;background:var(--bg);color:var(--text)}body.dark{--bg:#25282c;--panel:#33383e;--card:#3b4148;--text:#f3f5f7;--muted:#c3c7cb;--line:#59616a;--dark:#171a1e;--accent:#697989}.rail{width:44px;background:#edf0f3;border-right:1px solid #aeb4bb;position:fixed;left:0;top:0;bottom:0;z-index:30;padding-top:8px}.rail-btn{width:36px;height:36px;margin:3px 4px;border:1px solid #b6bcc3;background:#d8dce1;border-radius:3px;display:grid;place-items:center;font-size:21px;cursor:pointer}.sidebar{width:440px;background:var(--panel);border-right:1px solid #aeb4bb;box-shadow:var(--shadow);position:fixed;left:44px;top:0;bottom:28px;z-index:25;overflow:auto;padding:7px 10px 18px;transition:.2s}.side-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.side-title{text-align:center;font-weight:bold;font-size:16px;margin:2px 0 4px}.menu-btn{display:flex;align-items:center;justify-content:center;min-height:30px;border:1px solid #aeb4bb;background:#d8dce1;border-radius:3px;color:#303842;padding:5px 8px;text-align:center}.menu-btn:hover{background:#cdd3d9}.menu-btn .arr{margin-right:auto;font-weight:bold}.menu-section{margin-top:7px}.main{margin-left:484px;width:calc(100% - 484px);padding:18px 22px 54px;transition:.2s}.sidebar.closed~.main{margin-left:44px;width:calc(100% - 44px)}.topbar{height:48px;background:var(--dark);color:white;display:flex;align-items:center;gap:12px;padding:0 18px;border-radius:4px;margin-bottom:14px}.brand{font-size:18px;font-weight:bold;margin-right:auto}.company-pill{background:rgba(255,255,255,.12);padding:7px 11px;border-radius:4px}.card{background:var(--card);border:1px solid var(--line);border-radius:5px;padding:16px;margin-bottom:14px;box-shadow:0 2px 7px rgba(0,0,0,.08)}.card h1,.card h2,.card h3{margin-top:0}.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.grid4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.stat{background:var(--card);border:1px solid var(--line);border-radius:5px;padding:16px}.stat strong{font-size:26px;display:block;margin-top:8px}label{display:block;font-size:12px;font-weight:bold;margin-bottom:4px}input,select,textarea{width:100%;padding:8px 9px;border:1px solid var(--line);border-radius:4px;background:var(--card);color:var(--text)}textarea{min-height:72px}.btn,button{display:inline-flex;align-items:center;justify-content:center;gap:6px;background:#56616d;color:white;border:0;border-radius:4px;padding:8px 12px;cursor:pointer}.btn.primary{background:#2f6fa3}.btn.light{background:#dfe3e7;color:#20252b;border:1px solid #b9c0c7}.actions{display:flex;gap:7px;flex-wrap:wrap}.table-wrap{overflow:auto}.table{width:100%;border-collapse:collapse}.table th,.table td{border-bottom:1px solid var(--line);padding:8px;text-align:left;vertical-align:middle}.table th{background:rgba(100,110,120,.10);white-space:nowrap}.table input,.table select{min-width:80px}.alert{padding:10px 12px;border-radius:4px;background:#eaf8e4;border:1px solid #a8d59a;margin-bottom:12px;color:#215732}.badge{display:inline-block;padding:4px 7px;border-radius:12px;background:#dfe3e7;color:#303840;font-size:12px}.filterbar{display:grid;grid-template-columns:2fr 1fr 1fr auto;gap:8px;align-items:end}.bottom{position:fixed;left:44px;right:0;bottom:0;height:28px;background:#b9bdc3;border-top:1px solid #969ca3;display:flex;justify-content:space-between;align-items:center;padding:0 12px;font-size:12px;z-index:40}.login-page{min-height:100%;display:grid;place-items:center;background:#d8d9dc}.login-box{width:340px;background:#e9ebee;border:1px solid #9299a1;box-shadow:var(--shadow);padding:12px}.login-title{text-align:center;font-size:20px;border:1px solid #b8bdc4;background:#f1f2f4;padding:6px;margin-bottom:16px}.login-mark{text-align:center;font-size:70px;color:#8c9299;font-weight:bold}.totals{max-width:430px;margin-left:auto}.totals-row{display:flex;justify-content:space-between;padding:7px;border-bottom:1px solid var(--line)}.totals-row.grand{font-size:18px;font-weight:bold}
@media(max-width:1100px){.main{margin-left:404px;width:calc(100% - 404px)}}@media(max-width:760px){.sidebar{width:calc(100% - 44px)}.main,.sidebar.closed~.main{margin-left:44px;width:calc(100% - 44px);padding:10px}.topbar{height:auto;min-height:48px;flex-wrap:wrap;padding:9px}}
@media print{.rail,.sidebar,.topbar,.bottom,.no-print{display:none!important}}
/* Extended account, logo and document controls */
.login-links{display:flex;flex-direction:column;gap:7px;margin-top:12px;text-align:center}.login-links a{text-decoration:underline}.login-box.wide{max-width:560px}.settings-layout{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:18px;align-items:start}.logo-panel{border:1px solid var(--line);background:#f4f6f8;padding:14px}.logo-preview{height:150px;border:1px dashed #aab2bb;background:#fff;display:flex;align-items:center;justify-content:center;margin:8px 0 12px;overflow:hidden}.logo-preview img{width:100%;height:100%;object-fit:contain;padding:8px}.logo-preview span{color:#687582}.btn.warn,button.warn{background:#a36300;color:#fff}.btn.danger,button.danger{background:#a81515;color:#fff}.badge.cancelled{background:#f7d8d8;color:#8b0000}.alert.ok{background:#e1f4e4;color:#175826}.alert.err{background:#f8dddd;color:#7a1111}.card small{display:block;margin-top:5px;color:#687582;line-height:1.35}
body.dark .logo-panel{background:#303740;border-color:#59636e}body.dark .logo-preview{background:#fff;border-color:#77818c}body.dark .login-links a{color:#9fc6ff}body.dark .card small{color:#c1c8d0}
@media(max-width:950px){.settings-layout{grid-template-columns:1fr}.logo-panel{max-width:none}}


/* EXACT SELECTED DESIGN */
:root{--bg:#d8dade;--panel:#eef0f3;--panel2:#e4e7eb;--card:#f7f8fa;--text:#27313a;--muted:#6d7680;--line:#b9c0c8;--line2:#d0d5db;--dark:#2d333a;--accent:#536170;--danger:#b42318;--success:#287d3c;--blue:#365f8f;--shadow:0 5px 16px rgba(0,0,0,.18)}
*{box-sizing:border-box}html,body{height:100%}body{margin:0;font:13px Arial,Helvetica,sans-serif;background:var(--bg);color:var(--text)}a{text-decoration:none;color:inherit}button,input,select,textarea{font:inherit}body.dark{--bg:#272b30;--panel:#343a40;--panel2:#3d444c;--card:#40474f;--text:#f3f5f7;--muted:#c5c9cd;--line:#5d6670;--line2:#505862;--dark:#171b1f;--accent:#718092}
.app{min-height:100%;display:flex}.rail{width:42px;background:#e7eaee;border-right:1px solid #9da5ae;position:fixed;left:0;top:0;bottom:0;z-index:40;padding:6px 3px 4px;display:flex;flex-direction:column;align-items:center}.rail-btn{width:34px;height:34px;margin:2px 0;border:1px solid #aeb5bd;background:linear-gradient(#f1f3f5,#d7dce2);border-radius:3px;display:grid;place-items:center;font-size:20px;cursor:pointer;color:#293742;box-shadow:inset 0 1px #fff}.rail-btn:hover{background:#cbd2d9}.rail-exit{margin-top:auto}.sidebar{width:440px;background:var(--panel);border-right:1px solid #aeb4bb;box-shadow:var(--shadow);position:fixed;left:42px;top:0;bottom:28px;z-index:30;overflow:auto;padding:6px 8px 18px;transition:.2s}.sidebar.closed{transform:translateX(-105%)}.sidebar-brand{height:38px;display:flex;align-items:center;gap:9px;padding:0 8px;margin-bottom:4px;border:1px solid #c4c9cf;background:#f5f6f8;font-weight:bold}.sidebar-mark{width:25px;height:25px;border-radius:50%;background:#566370;color:#fff;display:grid;place-items:center;font-size:15px}.side-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}.compact-grid{grid-template-columns:1fr 1fr}.side-title{text-align:center;font-weight:bold;font-size:15px;margin:3px 0 5px;padding-bottom:2px;border-bottom:1px solid #c1c6cc}.menu-btn{display:flex;align-items:center;justify-content:flex-start;gap:7px;min-height:28px;border:1px solid #adb4bc;background:linear-gradient(#e9ecef,#d4d9de);border-radius:3px;color:#303842;padding:4px 7px;text-align:left;box-shadow:inset 0 1px #fff}.menu-btn:hover{background:#c9d0d7}.menu-btn .arr,.menu-btn .mi{width:18px;flex:0 0 18px;text-align:center;font-weight:bold}.menu-section{margin-top:8px}.main{margin-left:482px;width:calc(100% - 482px);padding:0 14px 48px;transition:.2s}.sidebar.closed~.main{margin-left:42px;width:calc(100% - 42px)}.workspace-head{height:34px;display:flex;align-items:flex-end;gap:4px;padding:4px 0 0}.company-switcher{height:28px;min-width:180px;background:#eef0f3;border:1px solid #aeb5bd;border-bottom:0;border-radius:3px 3px 0 0;padding:4px 8px;display:flex;align-items:center}.company-switcher select{border:0;background:transparent;padding:0;height:20px}.page-tab{height:28px;min-width:150px;max-width:320px;background:#f1f2f4;border:1px solid #aeb5bd;border-bottom:0;border-radius:3px 3px 0 0;padding:5px 8px;display:flex;align-items:center;gap:6px}.tab-icon{color:#607080}.tab-close{margin-left:auto;color:#777}.topbar{height:42px;background:var(--dark);color:#fff;display:flex;align-items:center;gap:12px;padding:0 15px;margin-bottom:10px;border-radius:3px}.brand{font-size:17px;font-weight:bold;margin-right:auto}.company-pill{background:rgba(255,255,255,.10);padding:6px 10px;border-radius:3px}.card{background:var(--card);border:1px solid var(--line);border-radius:4px;padding:14px;margin-bottom:12px;box-shadow:0 2px 8px rgba(0,0,0,.09)}.card h1,.card h2,.card h3{margin:0 0 11px}.card h2{font-size:18px}.card h3{font-size:15px;margin-top:13px;padding-bottom:4px;border-bottom:1px solid var(--line2)}.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.grid4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin-bottom:12px}.stat{background:var(--card);border:1px solid var(--line);border-top:3px solid #667686;border-radius:4px;padding:13px}.stat strong{font-size:24px;display:block;margin-top:7px}.muted{color:var(--muted)}label{display:block;font-size:12px;font-weight:bold;margin-bottom:3px}input,select,textarea{width:100%;height:31px;padding:5px 8px;border:1px solid var(--line);border-radius:3px;background:#fff;color:#222}body.dark input,body.dark select,body.dark textarea{background:#30363d;color:#fff}textarea{height:auto;min-height:66px}.btn,button{display:inline-flex;align-items:center;justify-content:center;gap:5px;background:#56616d;color:#fff;border:1px solid #4a5661;border-radius:3px;padding:7px 11px;cursor:pointer;box-shadow:inset 0 1px rgba(255,255,255,.12)}.btn:hover,button:hover{filter:brightness(.94)}.btn.primary{background:#365f8f}.btn.success{background:var(--success)}.btn.danger{background:var(--danger)}.btn.light{background:#e0e4e8;color:#20252b;border:1px solid #b7bec5}.actions{display:flex;gap:6px;flex-wrap:wrap}.table-wrap{overflow:auto;border:1px solid var(--line)}.table{width:100%;border-collapse:collapse;background:#fff}.table th,.table td{border:1px solid var(--line2);padding:6px 7px;text-align:left;vertical-align:middle}.table th{background:linear-gradient(#edf0f3,#dfe3e7);white-space:nowrap;font-weight:bold}.table tr:nth-child(even) td{background:#f6f7f8}.table input,.table select{min-width:75px;height:29px;border-radius:2px}.alert{padding:9px 11px;border-radius:3px;background:#fff0d5;border:1px solid #edcf96;margin-bottom:10px;color:#4b3922}.alert.ok{background:#e6f5e8;border-color:#a9d5ae;color:#22582a}.alert.err{background:#fde8e7;border-color:#e5aaa6;color:#7f1d16}.badge{display:inline-block;padding:3px 7px;border-radius:11px;background:#dfe3e7;color:#303840;font-size:11px}.badge.issued,.badge.paid{background:#d9f0dd;color:#1d6029}.badge.draft{background:#fff0c9;color:#795c00}.badge.cancelled{background:#f6d5d3;color:#8b2119}.filterbar{display:grid;grid-template-columns:2fr 1fr 1fr auto;gap:7px;align-items:end}.bottom{position:fixed;left:42px;right:0;bottom:0;height:28px;background:#babec4;border-top:1px solid #969ca3;display:flex;justify-content:space-between;align-items:center;padding:0 12px;font-size:11px;z-index:45}.login-page{min-height:100%;display:grid;place-items:center;background:#d6d7da}.login-box{width:350px;background:#e9ebee;border:1px solid #9299a1;box-shadow:var(--shadow);padding:12px}.login-title{text-align:center;font-size:19px;border:1px solid #b8bdc4;background:#f1f2f4;padding:7px;margin-bottom:15px}.login-mark{text-align:center;font-size:68px;color:#8c9299;font-weight:bold}.login-row{display:grid;grid-template-columns:75px 1fr;align-items:center;margin-bottom:8px}.right{text-align:right}.totals{max-width:400px;margin-left:auto;border:1px solid var(--line)}.totals-row{display:flex;justify-content:space-between;padding:6px 9px;border-bottom:1px solid var(--line);background:#fff}.totals-row.grand{font-size:17px;font-weight:bold;background:#e6e9ed}.hidden{display:none!important}
/* document editor */
#newCustomerBox{background:#f4f6f8;border:1px solid #c2c8cf;padding:12px!important;border-radius:3px!important}.document-shell .card,.document-editor.card{padding:12px}.document-actions{position:sticky;bottom:28px;background:rgba(238,240,243,.96);padding:8px;border-top:1px solid var(--line);z-index:10}
@media(max-width:1100px){.sidebar{width:360px}.main{margin-left:402px;width:calc(100% - 402px)}.stats,.grid4{grid-template-columns:repeat(2,1fr)}}@media(max-width:760px){.sidebar{width:calc(100% - 42px)}.main,.sidebar.closed~.main{margin-left:42px;width:calc(100% - 42px);padding:0 8px 10px}.stats,.grid2,.grid3,.grid4,.filterbar{grid-template-columns:1fr}.workspace-head{overflow:auto}.topbar{height:auto;min-height:42px;flex-wrap:wrap;padding:8px}.bottom{display:none}}
@media print{.rail,.sidebar,.workspace-head,.topbar,.bottom,.no-print{display:none!important}.main{margin:0!important;width:100%!important;padding:0}.card{box-shadow:none;border:0}}

/* Работещо затваряне на активния таб */
.tab-close{
  margin-left:auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:20px;
  height:20px;
  color:#4a5561;
  text-decoration:none;
  border-radius:2px;
  font-size:15px;
  line-height:1;
}
.tab-close:hover{background:#cfd5dc;color:#111}
.empty-workspace{position:relative;min-height:calc(100vh - 88px);overflow:hidden}
.empty-workspace .watermark{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:420px;
  font-weight:900;
  color:rgba(40,50,60,.06);
  user-select:none;
  pointer-events:none;
}
.empty-workspace .workspace-image{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);max-width:min(58vw,760px);max-height:min(68vh,640px);width:auto;height:auto;object-fit:contain;opacity:.72;filter:contrast(1.03) saturate(1.02) drop-shadow(0 8px 22px rgba(0,0,0,.08));user-select:none;pointer-events:none}.workspace-image-title{margin-top:22px}.workspace-preview{height:120px}body.dark .empty-workspace .workspace-image{opacity:.58;filter:brightness(.9) contrast(1.08) drop-shadow(0 8px 22px rgba(0,0,0,.22))}
body.dark .tab-close{color:#e8edf3}
body.dark .tab-close:hover{background:#4b5662;color:#fff}
body.dark .empty-workspace .watermark{color:rgba(255,255,255,.035)}

/* Унифицирани системни съобщения и защита от повторно изпълнение */
.server-flash{display:none!important}.alert-toast-hidden{display:none!important}
.app-toast-stack{position:fixed;top:76px;left:50%;transform:translateX(-50%);z-index:10050;display:flex;flex-direction:column;gap:10px;width:min(560px,calc(100vw - 32px));pointer-events:none}
.app-toast{min-height:48px;display:flex;align-items:center;gap:11px;padding:11px 12px 11px 14px;color:#fff;border:1px solid rgba(0,0,0,.25);border-radius:3px;box-shadow:0 7px 20px rgba(0,0,0,.32);opacity:0;transform:translateY(-16px) scale(.98);transition:opacity .2s ease,transform .2s ease;pointer-events:auto;font-size:15px;font-weight:700}
.app-toast.is-visible{opacity:1;transform:translateY(0) scale(1)}.app-toast.is-leaving{opacity:0;transform:translateY(-10px) scale(.98)}
.app-toast-success{background:#176b31}.app-toast-error{background:#8d150f}.app-toast-warning{background:#e6f7df;color:#215732;border-color:#9fd38e}.app-toast-info{background:#285a83}.app-toast-validation{background:#fff6f6;color:#7f1d16;border-color:#e6b0ab}
.app-toast-icon{width:27px;height:27px;flex:0 0 27px;display:grid;place-items:center;border:2px solid rgba(255,255,255,.85);border-radius:50%;font-size:17px}.app-toast-text{flex:1;line-height:1.35}.app-toast-close{width:28px;height:28px;padding:0!important;border:0!important;background:transparent!important;color:#fff!important;font-size:22px;box-shadow:none!important;opacity:.82}.app-toast-close:hover{opacity:1}.app-toast-validation .app-toast-icon{border-color:#cf2b21;background:#fff;color:#cf2b21}.app-toast-validation .app-toast-text{color:#7f1d16}.app-toast-validation .app-toast-close{color:#7f1d16!important}.app-toast-warning .app-toast-icon{border-color:#7bb96a;background:#f5fff1;color:#2a6a34}.app-toast-warning .app-toast-text{color:#215732}.app-toast-warning .app-toast-close{color:#215732!important}.alert:not(.ok):not(.err){background:#eaf8e4!important;border-color:#a8d59a!important;color:#215732!important}
.app-loading-overlay{position:fixed;inset:0;z-index:10040;display:flex;align-items:center;justify-content:center;background:rgba(18,22,27,.48);backdrop-filter:blur(1px);opacity:0;visibility:hidden;transition:opacity .15s ease,visibility .15s ease;cursor:wait}
.app-loading-overlay.is-visible{opacity:1;visibility:visible}.app-loading-box{min-width:330px;max-width:calc(100vw - 32px);display:flex;align-items:center;gap:15px;padding:18px 22px;background:#eef0f3;color:#222;border:1px solid #828b95;border-radius:4px;box-shadow:0 10px 34px rgba(0,0,0,.38)}.app-loading-box strong{display:block;font-size:16px;margin-bottom:4px}.app-loading-box small{display:block;color:#5f6872}
.app-spinner{width:34px;height:34px;flex:0 0 34px;border:4px solid #bdc5cd;border-top-color:#41566b;border-radius:50%;animation:app-spin .75s linear infinite}@keyframes app-spin{to{transform:rotate(360deg)}}
html.app-is-busy,html.app-is-busy body{cursor:wait!important}.is-processing{pointer-events:none!important;opacity:.72!important}.is-processing::after{content:' …'}.is-submitting{pointer-events:none}
body.dark .app-loading-box{background:#343b43;color:#fff;border-color:#68737e}body.dark .app-loading-box small{color:#cbd1d7}body.dark .app-spinner{border-color:#59636d;border-top-color:#eaf1f7}
@media(max-width:600px){.app-toast-stack{top:12px}.app-loading-box{min-width:0;width:calc(100vw - 32px)}}
.inline-access-form{display:flex;gap:5px;align-items:center;flex-wrap:wrap}.inline-access-form input,.inline-access-form select{width:auto;min-width:90px}.inline-access-form button{white-space:nowrap}

/* Начален екран и избор на фирма */
.start-screen-row{display:flex;align-items:flex-end;gap:10px;max-width:720px}
.start-screen-field{flex:1;min-width:280px}
.start-screen-save{height:31px;white-space:nowrap;margin:0}
.company-switcher{min-width:210px}
.company-switch-select{width:100%;font-weight:600;color:#26323d;cursor:pointer}
.company-switch-select:focus{outline:2px solid rgba(54,95,143,.25);outline-offset:1px}

/* Браузърът да не визуализира автоматично попълнени стойности */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill{
  -webkit-text-fill-color:inherit!important;
  -webkit-box-shadow:0 0 0 1000px #fff inset!important;
  transition:background-color 999999s ease-out 0s;
}
body.dark input:-webkit-autofill,
body.dark textarea:-webkit-autofill,
body.dark select:-webkit-autofill{
  -webkit-box-shadow:0 0 0 1000px #30363d inset!important;
}
@media(max-width:760px){
  .start-screen-row{align-items:stretch;flex-direction:column}
  .start-screen-field{min-width:0}
  .start-screen-save{width:100%}
}

.invoice-register-filters{display:grid;grid-template-columns:repeat(5,minmax(150px,1fr));gap:10px;align-items:end}
.invoice-register-filters .filter-actions{display:flex;gap:7px;align-items:center;flex-wrap:wrap;grid-column:1/-1}
.invoice-register-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:0 0 12px}
.invoice-register-summary .stat{background:#f8fafc;border:1px solid #b8c2cc;border-top:3px solid #52677b;padding:12px}
.invoice-register-summary .stat span{display:block;color:#687582;font-size:12px;margin-bottom:4px}
.invoice-register-summary .stat strong{font-size:20px;color:#18222c}
.pwa-install:not([hidden]){display:flex}
.menu-install{width:100%;font:inherit;text-align:left}
body.dark .invoice-register-summary .stat{background:#30363d;border-color:#59636e}
body.dark .invoice-register-summary .stat strong{color:#fff}
.center{text-align:center}
@media(max-width:1100px){.invoice-register-filters{grid-template-columns:repeat(3,1fr)}}
@media(max-width:720px){.invoice-register-filters{grid-template-columns:1fr}.invoice-register-summary{grid-template-columns:repeat(2,1fr)}}

.login-logo{height:135px;display:flex;align-items:center;justify-content:center;margin:4px 0 16px;overflow:hidden}
.login-logo img{width:100%;height:125px;max-width:270px;max-height:none;object-fit:contain;transform:scale(1.35);transform-origin:center}
.login-logo-preview{height:150px}

.remember-login{display:flex;align-items:center;gap:7px;margin:8px 0 12px;font-size:12px}.remember-login input{width:auto}.autofill-trap{position:absolute!important;left:-10000px!important;top:-10000px!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}

input[type="file"][data-auto-image-upload="1"]{cursor:pointer}
input[type="file"][data-auto-image-upload="1"]:disabled{opacity:.6;cursor:wait}

/* Автоматично качване на изображения */
input[type="file"][data-uploading="1"]{opacity:.65;cursor:wait}
.logo-preview img,.workspace-preview img,.login-logo-preview img{display:block}

/* Ясни функционални икони в лявото меню */
.ui-icon{width:21px;height:21px;display:inline-flex;align-items:center;justify-content:center;line-height:1}
.ui-icon svg{width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;display:block}
.rail-btn .ui-icon{width:22px;height:22px}
.menu-btn .ui-icon{width:17px;height:17px}
.menu-btn .arr,.menu-btn .mi{display:flex;align-items:center;justify-content:center}
.rail-btn[title]:hover::after{content:attr(title);position:fixed;left:44px;z-index:1000;background:#20252b;color:#fff;padding:6px 9px;border-radius:3px;font-size:12px;white-space:nowrap;box-shadow:0 2px 7px rgba(0,0,0,.25);pointer-events:none}
body.dark .rail-btn[title]:hover::after{background:#f2f4f6;color:#20252b}

/* Цялостна корекция на тъмната тема */
body.dark{
  --bg:#22272d;
  --panel:#2d333a;
  --panel2:#353c44;
  --card:#343b43;
  --text:#f3f6f8;
  --muted:#c8cfd6;
  --line:#59636e;
  --line2:#4b555f;
  --dark:#171b20;
  --accent:#7f93a8;
}

/* Лява иконна лента */
body.dark .rail{
  background:#1d2228;
  border-right-color:#48515a;
}
body.dark .rail-btn{
  background:#303841;
  border-color:#5a6570;
  color:#f2f5f7;
}
body.dark .rail-btn:hover{
  background:#3e4954;
  border-color:#758391;
  color:#fff;
}
body.dark .rail-btn:active{
  background:#4a5662;
}

/* Разгънато меню */
body.dark .sidebar{
  background:#292f36;
  border-right-color:#59636e;
  color:#f4f6f8;
}
body.dark .side-title,
body.dark .menu-section-title{
  color:#fff;
}
body.dark .menu-btn{
  background:#363e47;
  border-color:#5c6772;
  color:#f4f6f8;
}
body.dark .menu-btn:hover{
  background:#46515d;
  border-color:#798795;
  color:#fff;
}
body.dark .menu-btn .ui-icon{
  color:#dce5ec;
}

/* Горни табове и избор на фирма */
body.dark .workspace-head{
  color:#f4f6f8;
}
body.dark .company-switcher,
body.dark .page-tab{
  background:#343c45;
  border-color:#626d78;
  color:#f4f6f8;
}
body.dark .company-switcher select{
  color:#f4f6f8;
  background:#343c45;
}
body.dark .company-switcher select option{
  color:#111;
  background:#fff;
}
body.dark .page-tab .tab-icon,
body.dark .page-tab .tab-close{
  color:#e8edf2;
}

/* Основно съдържание */
body.dark .main{
  background:#22272d;
  color:#f3f6f8;
}
body.dark .topbar{
  background:#181d22;
  border-color:#48515a;
}
body.dark .card,
body.dark .panel,
body.dark .content-card{
  background:#30373f;
  border-color:#59636e;
  color:#f3f6f8;
}
body.dark table{
  color:#f3f6f8;
}
body.dark th{
  background:#3b444d;
  color:#fff;
  border-color:#65717c;
}
body.dark td{
  background:#30373f;
  color:#eef2f5;
  border-color:#56616c;
}
body.dark tr:nth-child(even) td{
  background:#343c44;
}

/* Полета */
body.dark input,
body.dark select,
body.dark textarea{
  background:#252b31;
  color:#f8fafb;
  border-color:#66717c;
}
body.dark input::placeholder,
body.dark textarea::placeholder{
  color:#aeb7c0;
}
body.dark input:focus,
body.dark select:focus,
body.dark textarea:focus{
  background:#2c333a;
  border-color:#91a7bc;
  box-shadow:0 0 0 2px rgba(145,167,188,.18);
}
body.dark label{
  color:#edf1f4;
}
body.dark small,
body.dark .muted{
  color:#c7ced5;
}

/* Начално изображение – без затъмняване */
body.dark .empty-workspace{
  background:#22272d;
}
body.dark .empty-workspace .workspace-image{
  opacity:1;
  filter:drop-shadow(0 10px 28px rgba(0,0,0,.35));
}
body.dark .empty-workspace::before{
  display:none !important;
}

/* Долна лента */
body.dark .bottom{
  background:#303840;
  color:#e5ebf0;
  border-top-color:#59636e;
}

/* Бутони */
body.dark button,
body.dark .btn{
  background:#465360;
  color:#fff;
  border-color:#687684;
}
body.dark button:hover,
body.dark .btn:hover{
  background:#566575;
}
body.dark .btn-danger{
  background:#8b3030;
  border-color:#aa4b4b;
}
body.dark .btn-danger:hover{
  background:#a33b3b;
}

/* Визуализации на изображения остават светли */
body.dark .logo-preview,
body.dark .workspace-preview,
body.dark .login-logo-preview{
  background:#fff;
  border-color:#73808b;
}


/* Компактен административен контрол и търсене в реално време */
.admin-card-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:11px}.admin-card-head h2{margin:0}.admin-live-search{width:min(420px,42vw)}.admin-live-search label{margin-bottom:3px}.admin-live-search input{height:32px}.admin-control-table{min-width:1120px}.admin-actions-cell{min-width:345px;white-space:nowrap}.admin-actions-row{display:flex;align-items:center;gap:6px;flex-wrap:nowrap}.admin-actions-row.compact{min-width:76px}.admin-icon-form,.admin-password-form{display:flex;align-items:center;margin:0}.admin-password-form{gap:5px;flex:1;min-width:235px}.admin-password-form input{width:145px;min-width:145px;height:30px}.admin-password-btn{height:30px;padding:5px 9px;white-space:nowrap}.admin-icon-btn{width:31px;height:30px;min-width:31px;padding:0;display:inline-grid;place-items:center;font-size:15px;line-height:1}.admin-icon-btn[disabled]{opacity:.45;cursor:not-allowed}.admin-filter-empty td{text-align:center!important;padding:18px!important;font-weight:bold;color:#6b747d;background:#f7f8f9!important}.admin-filter-empty[hidden]{display:none!important}body.dark .admin-filter-empty td{color:#d5dbe1;background:#30373f!important}
@media(max-width:1000px){.admin-card-head{align-items:stretch;flex-direction:column}.admin-live-search{width:100%}.admin-actions-cell{min-width:320px}}

/* Контрагент: поле с въвеждане и филтриране */
.counterparty-field{position:relative;min-width:0}
.counterparty-combobox{position:relative}
.counterparty-combobox>input{width:100%}
.counterparty-results{position:absolute;z-index:1200;left:0;right:0;top:calc(100% + 2px);max-height:280px;overflow:auto;background:#fff;border:1px solid #9da9b5;box-shadow:0 6px 18px rgba(0,0,0,.18);padding:2px}
.counterparty-results[hidden]{display:none!important}
.counterparty-option,.counterparty-new{display:flex;width:100%;align-items:center;justify-content:space-between;gap:12px;border:0;border-bottom:1px solid #e2e6ea;border-radius:0;background:#fff;color:#1c2733;padding:7px 9px;text-align:left;cursor:pointer;font:inherit}
.counterparty-option:hover,.counterparty-option:focus,.counterparty-new:hover,.counterparty-new:focus{background:#e8eef4;outline:none}
.counterparty-name{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.counterparty-eik{flex:0 0 auto;color:#66727e;font-size:.9em}
.counterparty-new{justify-content:flex-start;font-weight:600;color:#354b60;border-bottom:0}
body.dark .counterparty-results{background:#2f353b;border-color:#65717c}
body.dark .counterparty-option,body.dark .counterparty-new{background:#2f353b;color:#f4f6f8;border-color:#48525b}
body.dark .counterparty-option:hover,body.dark .counterparty-option:focus,body.dark .counterparty-new:hover,body.dark .counterparty-new:focus{background:#46515b}
body.dark .counterparty-eik{color:#cbd3da}

/* v7.9.27 — поле „Валута“ със същия дизайн като „Контрагент“ */
.currency-field{min-width:0}
.currency-combobox{position:relative}
.currency-combobox>input{width:100%}
.currency-native{position:absolute!important;left:-9999px!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}
.currency-results .currency-option.active{background:#e8eef4;outline:none}
.currency-no-result{display:block;padding:8px 10px;color:#66727e;background:#fff;font-size:.95em}
body.dark .currency-results .currency-option.active{background:#46515b}
body.dark .currency-no-result{background:#2f353b;color:#cbd3da}


/* Compact document lines editor */
.invoice-lines-wrap{overflow-x:auto;border:1px solid var(--line);background:#fff}.invoice-lines{width:100%;min-width:1180px;border-collapse:collapse;table-layout:fixed}.invoice-lines th,.invoice-lines td{border:1px solid var(--line2);padding:4px;vertical-align:middle}.invoice-lines th{background:linear-gradient(#edf0f3,#dfe3e7);font-size:12px;text-align:center;white-space:nowrap}.invoice-lines .line-no{width:38px}.invoice-lines .line-name{width:auto;text-align:left}.invoice-lines .line-qty{width:105px}.invoice-lines .line-unit{width:90px}.invoice-lines .line-price{width:115px}.invoice-lines .line-discount{width:105px}.invoice-lines .line-vat{width:90px}.invoice-lines .line-total{width:120px}.invoice-lines .line-actions{width:44px}.invoice-lines input,.invoice-lines select{height:30px;padding:4px 6px;border-radius:2px}.line-index{text-align:center;font-weight:bold;color:#59636d}.line-product-row{display:grid;grid-template-columns:minmax(170px,32%) minmax(260px,1fr);gap:5px}.line-description{min-width:0}.line-number-input{text-align:right}.line-total-cell{text-align:right;font-weight:bold;white-space:nowrap;background:#f4f6f8}.line-remove{width:30px;height:30px;padding:0;font-size:17px}.line-toolbar{display:flex;align-items:center;gap:12px;margin:8px 0 14px}.line-toolbar .muted{font-size:12px}body.dark .invoice-lines-wrap,body.dark .invoice-lines{background:#2c3238}body.dark .invoice-lines th{background:#394149;color:#fff}body.dark .line-total-cell{background:#343b42;color:#fff}@media(max-width:900px){.line-product-row{grid-template-columns:1fr}.invoice-lines{min-width:1050px}}

/* Compact company settings and global visual identity */
.company-settings-layout{grid-template-columns:minmax(0,1fr) 240px;gap:14px;align-items:start}
.company-logo-panel{padding:11px}
.company-logo-panel h3{margin-top:0}
.company-logo-preview{height:130px}
.visual-identity-heading{margin-top:16px!important}
.visual-identity-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:8px 0 16px}
.visual-identity-card{min-width:0;border:1px solid var(--line);background:#f4f6f8;padding:10px;border-radius:3px}
.visual-identity-card h4{margin:0 0 7px;font-size:14px}
.visual-identity-card .logo-preview{height:118px;margin:0 0 8px}
.visual-identity-card input[type=file]{height:auto;min-height:31px;padding:3px;max-width:100%}
.visual-identity-card small{min-height:34px}
.system-icon-preview img{width:auto!important;height:auto!important;max-width:92px!important;max-height:92px!important;object-fit:contain!important;padding:4px!important}
body.dark .visual-identity-card{background:#303740;border-color:#59636e}
@media(max-width:1150px){.visual-identity-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:950px){.company-settings-layout{grid-template-columns:1fr}.company-logo-panel{max-width:none}.visual-identity-grid{grid-template-columns:1fr}}

/* 4.5.1: document menu labels aligned consistently to the left */
.sidebar .side-grid .menu-btn,
.sidebar .compact-grid .menu-btn,
.sidebar .menu-section .menu-btn {
  display:flex !important;
  align-items:center !important;
  justify-content:flex-start !important;
  text-align:left !important;
}
.sidebar .side-grid .menu-btn > .arr,
.sidebar .side-grid .menu-btn > .mi,
.sidebar .compact-grid .menu-btn > .arr,
.sidebar .compact-grid .menu-btn > .mi,
.sidebar .menu-section .menu-btn > .arr,
.sidebar .menu-section .menu-btn > .mi {
  flex:0 0 18px !important;
  width:18px !important;
  min-width:18px !important;
  margin:0 !important;
  text-align:center !important;
}
.sidebar .side-grid .menu-btn > span:last-child,
.sidebar .compact-grid .menu-btn > span:last-child,
.sidebar .menu-section .menu-btn > span:last-child {
  display:block !important;
  flex:1 1 auto !important;
  min-width:0 !important;
  margin:0 !important;
  text-align:left !important;
}


/* Лични настройки: автоматично записване на позиции */
.personal-settings-grid{display:grid;grid-template-columns:minmax(280px,1fr) minmax(420px,2fr) auto;gap:14px;align-items:end}
.personal-toggle{border:1px solid var(--border,#c7ced6);background:rgba(255,255,255,.35);padding:10px 12px;border-radius:3px}
.personal-toggle label{display:flex;gap:8px;align-items:flex-start;font-weight:600}
.personal-toggle input[type="checkbox"]{width:auto;margin-top:2px}
.personal-toggle small,.personal-settings-grid small{display:block;margin-top:5px}
.sync-modal-overlay{position:fixed;inset:0;z-index:10000;background:rgba(20,27,34,.62);display:flex;align-items:center;justify-content:center;padding:20px}
.sync-modal{width:min(760px,96vw);max-height:88vh;overflow:auto;background:var(--card,#fff);color:var(--text,#17212b);border:1px solid var(--border,#b9c2cc);box-shadow:0 14px 40px rgba(0,0,0,.35);padding:20px;border-radius:5px}
.sync-modal h2{margin-top:0}
.sync-modal-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:16px}
.sync-modal-actions form{margin:0}
@media(max-width:900px){.personal-settings-grid{grid-template-columns:1fr}.personal-settings-save{justify-self:start}}

/* Клиенти и доставчици: моментално филтриране */
.customer-list-head{display:flex;align-items:end;justify-content:space-between;gap:18px;margin-bottom:10px}
.customer-list-head h2{margin:0}
.customer-live-filter{width:min(420px,100%)}
.customer-live-filter label{display:block;margin-bottom:4px;font-weight:600}
.customer-live-filter input{width:100%}
.customer-live-filter small{display:block;min-height:16px;margin-top:4px}
.customer-no-results{text-align:center;padding:18px !important;font-weight:600;color:var(--muted,#687582)}
@media(max-width:760px){.customer-list-head{align-items:stretch;flex-direction:column}.customer-live-filter{width:100%}}

/* Клиенти и доставчици: компактна заглавна зона без излишно празно пространство */
.customer-list-head{
    align-items:flex-start !important;
    margin-bottom:8px !important;
}
.customer-list-head h2{
    margin:2px 0 0 !important;
    line-height:31px;
}
.customer-live-filter{
    margin:0 !important;
}

/* v4.10: реално скриване на несъвпадащите контрагенти */
.counterparty-option[hidden],
.counterparty-new[hidden] {
    display: none !important;
}

/* v4.11: забрана за маркиране извън полетата за въвеждане */
html, body, body * {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Маркирането остава разрешено само в реални полета за въвеждане */
input,
textarea,
select,
option,
[contenteditable="true"],
[contenteditable=""],
.allow-selection,
.allow-selection * {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}


/* Глобално потискане на браузърното autofill UI */
body:not(.login-page) input::-webkit-contacts-auto-fill-button,
body:not(.login-page) input::-webkit-credentials-auto-fill-button,
body:not(.login-page) input::-webkit-caps-lock-indicator,
body:not(.login-page) input::-webkit-textfield-decoration-container {
  visibility: hidden !important;
  display: none !important;
  pointer-events: none !important;
  position: absolute !important;
  right: 0 !important;
}
body:not(.login-page) input:-webkit-autofill,
body:not(.login-page) input:-webkit-autofill:hover,
body:not(.login-page) input:-webkit-autofill:focus,
body:not(.login-page) textarea:-webkit-autofill,
body:not(.login-page) select:-webkit-autofill {
  -webkit-text-fill-color: inherit !important;
  -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
  transition: background-color 999999s ease-out 0s !important;
}
.autofill-decoy { display:none !important; }

/* Company payment methods */
.payment-method-settings{display:grid;grid-template-columns:minmax(260px,.8fr) minmax(360px,1.2fr);gap:18px;align-items:start;margin-bottom:18px}
.payment-method-manager{min-width:0}.payment-method-list{display:grid;gap:7px;margin-bottom:8px}.payment-method-row{display:grid;grid-template-columns:minmax(0,1fr) 34px;gap:7px;align-items:center}.payment-method-row input[readonly]{background:#fff;cursor:default}.payment-method-add{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px}.payment-method-add button{white-space:nowrap}.icon-button{width:34px;min-width:34px;padding:6px;text-align:center;font-weight:700}
body.dark .payment-method-row input[readonly]{background:#252b31}
@media(max-width:900px){.payment-method-settings{grid-template-columns:1fr}}

/* v4.17: личен профил, приветствие и подравняване на ДДС */
.company-settings-layout input[type="number"]{
  height:31px;
  line-height:31px;
  padding-top:0;
  padding-bottom:0;
  vertical-align:middle;
}
.personal-settings-grid-extended{
  grid-template-columns:minmax(260px,1fr) minmax(260px,1fr) minmax(420px,1.5fr) auto;
  align-items:end;
}
.personal-settings-actions{display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
.personal-settings-actions button{white-space:nowrap}
.workspace-welcome{
  position:absolute;
  top:18px;
  left:50%;
  transform:translateX(-50%);
  z-index:2;
  min-width:320px;
  max-width:calc(100% - 40px);
  padding:10px 18px;
  border:1px solid var(--line);
  border-radius:4px;
  background:rgba(247,248,250,.94);
  box-shadow:0 4px 16px rgba(0,0,0,.12);
  text-align:center;
}
.workspace-welcome strong{display:block;font-size:17px;color:var(--text)}
.workspace-welcome span{display:block;margin-top:3px;color:var(--muted);font-size:12px}
.empty-workspace{position:relative}
body.dark .workspace-welcome{background:rgba(52,58,64,.95)}
.personal-password-modal[hidden]{display:none!important}
.personal-password-modal{position:fixed;inset:0;z-index:10050;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(18,22,27,.62)}
.personal-password-dialog{width:min(500px,96vw);background:var(--card);color:var(--text);border:1px solid var(--line);border-radius:5px;box-shadow:0 16px 44px rgba(0,0,0,.38);padding:18px}
.personal-password-head{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.personal-password-head h2{margin:0;flex:1}
.personal-password-close{width:32px;height:32px;padding:0;font-size:23px;background:transparent;color:var(--text);border:1px solid var(--line)}
.personal-password-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
.grid1{display:grid;grid-template-columns:1fr;gap:12px}
body.modal-open{overflow:hidden}
@media(max-width:1250px){.personal-settings-grid-extended{grid-template-columns:repeat(2,minmax(0,1fr))}.personal-settings-actions{justify-content:flex-start}}
@media(max-width:760px){.personal-settings-grid-extended{grid-template-columns:1fr}.workspace-welcome{top:10px;min-width:0;width:calc(100% - 20px)}}


/* v4.18: коректно подравняване на личните настройки и полето ДДС % */
.personal-settings-grid-extended{
  align-items:start;
}
.personal-setting-field{
  display:flex;
  flex-direction:column;
  min-width:0;
}
.personal-setting-field>label{
  min-height:16px;
  display:flex;
  align-items:flex-end;
  margin-bottom:4px;
}
.personal-setting-field>input,
.personal-setting-field>select{
  height:31px;
  min-height:31px;
  margin:0;
}
.personal-setting-field>small{
  min-height:34px;
}
.personal-toggle{
  align-self:start;
  min-height:86px;
}
.personal-settings-actions{
  align-self:start;
  padding-top:37px;
}
.company-settings-layout input[type="number"][name="default_vat"]{
  display:block;
  width:100%;
  height:31px!important;
  min-height:31px!important;
  line-height:31px!important;
  padding:0 8px!important;
  margin:0!important;
  vertical-align:middle;
  text-align:left;
  overflow:visible;
  appearance:textfield;
  -moz-appearance:textfield;
}
.company-settings-layout input[type="number"][name="default_vat"]::-webkit-inner-spin-button,
.company-settings-layout input[type="number"][name="default_vat"]::-webkit-outer-spin-button{
  margin:0;
}
@media(max-width:1250px){
  .personal-settings-actions{padding-top:0;align-self:start}
  .personal-setting-field>small{min-height:0}
}

/* v4.19: ДДС % е на едно ниво с Основна валута */
.company-settings-layout input[type="number"][name="default_vat"]{box-sizing:border-box;}

/* v4.20: ДДС % използва стандартно текстово поле за точно вертикално подравняване */
.company-settings-layout .default-vat-field{
  display:block;
  width:100%;
  height:31px!important;
  min-height:31px!important;
  line-height:normal!important;
  padding:5px 8px!important;
  margin:0!important;
  text-align:left!important;
  box-sizing:border-box!important;
}


/* v4.21: настройки за изглед при споделяне на URL */
.social-share-settings{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:18px;align-items:start;margin-bottom:18px}
.social-share-fields{display:grid;gap:10px}.social-share-toggle{display:flex;align-items:center;gap:8px;font-size:13px}.social-share-image-card{border:1px solid var(--line);background:#f4f6f8;padding:12px}.social-share-image-card h4{margin:0 0 8px}.social-share-image-card .logo-preview{height:170px}.social-share-image-card .logo-preview img{object-fit:cover;padding:0}
body.dark .social-share-image-card{background:#30363d}
@media(max-width:900px){.social-share-settings{grid-template-columns:1fr}}


/* v4.23: режим за профилактика */
.maintenance-admin-box{border:1px solid #d5a94c;background:#fff8e8;border-radius:6px;padding:14px}
.maintenance-admin-box h3{margin:0 0 10px}
.maintenance-toggle{display:flex;align-items:center;gap:8px;font-weight:700;margin-bottom:5px}
.maintenance-fields{margin-top:12px}
.maintenance-body{margin:0;min-height:100vh;display:grid;place-items:center;background:#e5e9ed;font-family:Arial,sans-serif;padding:24px;box-sizing:border-box}
.maintenance-card{width:min(620px,100%);background:#fff;border:1px solid #c9d0d6;border-radius:10px;box-shadow:0 14px 38px rgba(0,0,0,.16);padding:34px;text-align:center;box-sizing:border-box}
.maintenance-logo{display:block;max-width:240px;max-height:120px;object-fit:contain;margin:0 auto 20px}
.maintenance-symbol{width:82px;height:82px;border-radius:50%;display:grid;place-items:center;margin:0 auto 20px;background:#2d343b;color:#fff;font-size:42px}
.maintenance-card h1{margin:0 0 18px;color:#252c33;font-size:28px}
.maintenance-message{font-size:17px;line-height:1.6;color:#3d4852;white-space:normal}
.maintenance-note{margin:22px 0 0;color:#6a7580}
.maintenance-admin-link{display:inline-block;margin-top:26px;color:#66717c;font-size:12px;text-decoration:none}
.maintenance-admin-link:hover{text-decoration:underline}
body.dark .maintenance-admin-box{background:#3b3424;border-color:#8f7335}
@media(max-width:600px){.maintenance-card{padding:26px 20px}.maintenance-card h1{font-size:24px}.maintenance-message{font-size:16px}}

/* v4.24: мобилен вход и управляем текст под логин формата */
.login-page input[type="password"],
.login-page input[type="email"]{
  -webkit-user-select:text!important;
  user-select:text!important;
  touch-action:manipulation;
  pointer-events:auto!important;
  opacity:1!important;
}
.login-custom-text{
  margin-top:12px;
  padding:10px 12px;
  border:1px solid #c6cbd1;
  border-radius:4px;
  background:#f6f7f9;
  color:#303840;
  font-size:13px;
  line-height:1.45;
  text-align:left;
  overflow-wrap:anywhere;
}
.login-custom-text-admin textarea{margin-top:8px;min-height:110px}
body.dark .login-custom-text{background:#2f353c;color:#f2f4f6;border-color:#59616a}
@media (max-width:520px){
  .login-box{width:calc(100vw - 28px);max-width:380px}
  .login-row{grid-template-columns:70px minmax(0,1fr)}
  .login-page input[type="password"],.login-page input[type="email"]{font-size:16px!important}
}

/* v4.25: центриран и пулсиращ адрес под логин формата */
.login-site-pulse{
  width:100%;
  margin:14px 0 2px;
  text-align:center;
  font-weight:700;
  letter-spacing:.2px;
}
.login-site-pulse a{
  display:inline-block;
  color:#365f8f;
  text-decoration:none;
  animation:loginSitePulse 1.6s ease-in-out infinite;
  transform-origin:center;
}
.login-site-pulse a:hover{
  text-decoration:underline;
}
@keyframes loginSitePulse{
  0%,100%{opacity:.45;transform:scale(.98)}
  50%{opacity:1;transform:scale(1.045)}
}
body.dark .login-site-pulse a{color:#8fc2ff}
@media (prefers-reduced-motion:reduce){
  .login-site-pulse a{animation:none;opacity:1;transform:none}
}

/* v4.26: мобилен вход и подравняване на ДДС в Стоки и услуги */
.login-page form[data-login-form="1"] input[type="email"],
.login-page form[data-login-form="1"] input[type="password"]{
  position:relative!important;
  z-index:2!important;
  min-height:34px!important;
  height:34px!important;
  line-height:normal!important;
  padding:6px 8px!important;
  -webkit-user-select:text!important;
  user-select:text!important;
  -webkit-touch-callout:default!important;
  touch-action:auto!important;
  pointer-events:auto!important;
}
.product-entry-grid .product-vat-input{
  text-align:left!important;
  line-height:31px!important;
  padding:0 8px!important;
  height:31px!important;
  box-sizing:border-box!important;
}
.product-entry-grid .product-price-with-vat{
  text-align:right;
  background:#f1f3f5;
  font-weight:700;
}
@media(max-width:760px){
  .product-entry-grid{grid-template-columns:1fr 1fr!important}
  .product-entry-grid .product-grid-spacer{display:none}
}

/* v4.27: реално въвеждане на парола през Safari/iOS/Android */
.login-page #login-secret-view{
  -webkit-appearance:none!important;
  appearance:none!important;
  -webkit-text-security:disc;
  caret-color:#111!important;
  color:#222!important;
  background:#fff!important;
  opacity:1!important;
  visibility:visible!important;
  pointer-events:auto!important;
  touch-action:manipulation!important;
  -webkit-user-select:text!important;
  user-select:text!important;
  font-size:16px!important;
}
.login-page #login-secret-view:focus{
  outline:2px solid #5b8fd1!important;
  outline-offset:0!important;
}


/* v4.28: числовите полета в позициите са подравнени като полето „Мярка“ */
.invoice-lines input[type="number"],
.invoice-lines .line-number-input{
  display:block!important;
  width:100%!important;
  height:30px!important;
  min-height:30px!important;
  line-height:30px!important;
  padding:0 7px!important;
  margin:0!important;
  text-align:left!important;
  vertical-align:middle!important;
  box-sizing:border-box!important;
  appearance:textfield!important;
  -moz-appearance:textfield!important;
  -webkit-appearance:none!important;
}
.invoice-lines input[type="number"]::-webkit-inner-spin-button,
.invoice-lines input[type="number"]::-webkit-outer-spin-button{
  -webkit-appearance:none!important;
  margin:0!important;
}
.invoice-lines td{vertical-align:middle!important}

/* Вътрешните линкове без href остават визуално и клавиатурно като линкове. */
a[data-safe-href]{cursor:pointer}


/* v4.29: числовите полета в позициите се държат като стандартно текстово поле,
   за да не се изместват надолу в Chrome/Edge/Safari. */
.invoice-lines input.line-number-input,
.invoice-lines input[name="quantity[]"],
.invoice-lines input[name="unit_price[]"],
.invoice-lines input[name="discount_percent[]"],
.invoice-lines input[name="vat_rate[]"]{
  display:block!important;
  width:100%!important;
  height:30px!important;
  min-height:30px!important;
  max-height:30px!important;
  line-height:normal!important;
  padding:5px 7px!important;
  margin:0!important;
  text-align:left!important;
  vertical-align:middle!important;
  box-sizing:border-box!important;
  font:inherit!important;
}


/* v4.31: търсене на стока/услуга по име, код или баркод */
.line-product-combobox{position:relative;width:100%;min-width:0}
.line-product-combobox .product-search-input{width:100%!important;min-width:0;height:30px!important;box-sizing:border-box}
.product-results{position:absolute;z-index:1200;left:0;right:0;top:calc(100% + 2px);max-height:260px;overflow:auto;background:#fff;border:1px solid #8e99a4;box-shadow:0 5px 14px rgba(0,0,0,.18)}
.product-option{display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;width:100%;padding:7px 9px!important;border:0!important;border-bottom:1px solid #e2e6ea!important;border-radius:0!important;background:#fff!important;color:#18212a!important;text-align:left!important;cursor:pointer}
.product-option:hover,.product-option.active{background:#e9f1fa!important}
.product-option-name{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.product-option-code{font-size:11px;color:#65717d;white-space:nowrap}
.product-no-results{padding:9px;color:#65717d;background:#fff}
body.dark .product-results{background:#2c3238;border-color:#59636d}
body.dark .product-option{background:#2c3238!important;color:#fff!important;border-bottom-color:#454e57!important}
body.dark .product-option:hover,body.dark .product-option.active{background:#3b4650!important}
body.dark .product-option-code,body.dark .product-no-results{color:#c4ccd3}
body.dark .product-no-results{background:#2c3238}

/* v4.32: live product chooser and reliable action controls */
.product-results:not([hidden]){display:block!important;}
.product-results[hidden]{display:none!important;}
.product-option{touch-action:manipulation;-webkit-tap-highlight-color:transparent;}
.product-search-input{cursor:text;}


/* v4.33: падащият списък за стоки е извън таблицата, за да не се реже от overflow */
.product-results-portal{
  position:fixed!important;
  right:auto!important;
  bottom:auto!important;
  z-index:99999!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  box-sizing:border-box!important;
}
.product-results-portal .product-option{min-height:34px!important;}


/* v4.36: българска дата с видим календар във всички модули */
.bg-date-picker{position:relative;display:flex;align-items:stretch;width:100%;min-width:0}
.bg-date-picker>input[data-original-type="date"]{flex:1 1 auto;width:100%;padding-right:40px!important}
.bg-date-button{position:absolute;right:1px;top:1px;bottom:1px;width:36px;min-width:36px;padding:0!important;border:0!important;border-left:1px solid #bcc5ce!important;border-radius:0 3px 3px 0!important;background:#f4f6f8!important;color:#27313a!important;display:flex!important;align-items:center!important;justify-content:center!important;font-size:16px!important;line-height:1!important;cursor:pointer!important;z-index:5!important;visibility:visible!important;opacity:1!important}
.bg-date-button:hover{background:#e7ebef!important}
.bg-calendar-popover{position:fixed;z-index:2147483000;background:#fff;border:1px solid #aeb8c2;border-radius:6px;box-shadow:0 10px 28px rgba(0,0,0,.24);padding:8px;box-sizing:border-box;font-size:14px;user-select:none}
.bg-cal-head{display:grid;grid-template-columns:38px 1fr 38px;align-items:center;gap:6px;margin-bottom:7px;text-align:center}
.bg-cal-nav{height:34px!important;min-height:34px!important;padding:0!important;font-size:24px!important;line-height:1!important}
.bg-cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:3px}
.bg-cal-week{font-size:11px;font-weight:700;color:#67727d;text-align:center;padding:4px 0}
.bg-cal-empty{height:34px}
.bg-cal-day{height:34px!important;min-height:34px!important;padding:0!important;border:1px solid transparent!important;background:transparent!important;color:#20252b!important;border-radius:4px!important;text-align:center!important}
.bg-cal-day:hover{background:#e8eef5!important;border-color:#aebdca!important}
.bg-cal-day.today{border-color:#607d98!important;font-weight:700!important}
.bg-cal-day.selected{background:#43596d!important;color:#fff!important}
.bg-cal-foot{display:flex;justify-content:space-between;gap:8px;border-top:1px solid #d4dbe1;margin-top:8px;padding-top:8px}
.bg-cal-foot button{height:30px!important;min-height:30px!important;padding:0 12px!important}
body.dark .bg-date-button{background:#323941!important;color:#f4f6f8!important;border-left-color:#59636d!important}
body.dark .bg-calendar-popover{background:#252b31;color:#f4f6f8;border-color:#59636d}
body.dark .bg-cal-week{color:#b9c2cb}
body.dark .bg-cal-day{color:#f4f6f8!important}
body.dark .bg-cal-day:hover{background:#3a434c!important}
@media(max-width:700px){.bg-date-button{width:42px;min-width:42px;font-size:18px!important}.bg-date-picker>input[data-original-type="date"]{padding-right:46px!important}.bg-calendar-popover{max-width:calc(100vw - 16px)}}

/* v4.35: стойностите във всички полета са вертикално центрирани като полето ЕИК */
body:not(.login-page) input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
body:not(.login-page) select {
  box-sizing:border-box!important;
  height:31px!important;
  min-height:31px!important;
  line-height:31px!important;
  padding:0 8px!important;
  vertical-align:middle!important;
}
body:not(.login-page) input[type="number"]{text-align:left!important;}
.document-limit-admin{border:1px solid var(--line);background:#f7f8fa;padding:12px;border-radius:4px}
body.dark .document-limit-admin{background:#2b3137}

/* v4.37: окончателно вертикално подравняване на всички полета като ЕИК */
body:not(.login-page) input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
body:not(.login-page) select {
  box-sizing:border-box!important;
  height:31px!important;
  min-height:31px!important;
  max-height:31px!important;
  line-height:normal!important;
  padding:5px 8px!important;
  margin:0!important;
  vertical-align:middle!important;
  text-align:left!important;
}
body:not(.login-page) input[data-number-as-text="1"]{
  -webkit-appearance:none!important;
  appearance:none!important;
  -moz-appearance:textfield!important;
}
body:not(.login-page) textarea{
  line-height:1.35!important;
  padding:7px 8px!important;
}

/* v5.5: заключване на предходни издадени документи */
.document-delete-locked{display:inline-flex;align-items:center;gap:4px;white-space:nowrap;font-size:12px;padding:4px 6px;border:1px solid #c8cdd2;border-radius:3px;background:#eef0f2;color:#59616a}

/* v5.10: много отворени модулни табове и възстановяване при затваряне */
.workspace-tabs{display:flex;align-items:flex-end;gap:4px;min-width:0;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;flex:1;padding-bottom:0}
.workspace-tab{height:28px;min-width:150px;max-width:320px;background:#f1f2f4;border:1px solid #aeb5bd;border-bottom:0;border-radius:3px 3px 0 0;display:flex;align-items:center;gap:6px;flex:0 0 auto;color:#27313a}
.workspace-tab.active{background:#fff;font-weight:bold}
.workspace-tab-title{border:0;background:transparent;color:inherit;box-shadow:none;padding:5px 2px 5px 8px;min-width:0;max-width:270px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;text-align:left;flex:1;cursor:pointer}
.workspace-tab-title:hover{filter:none;text-decoration:none}
.workspace-tab-close{width:24px;height:24px;min-width:24px;border:0;background:transparent;color:#6f7780;box-shadow:none;padding:0;display:grid;place-items:center;font-size:18px;line-height:1;border-radius:3px;cursor:pointer}
.workspace-tab-close:hover{background:#cfd5dc;color:#111;filter:none}
.tab-undo-toast{position:fixed;left:50%;bottom:42px;transform:translateX(-50%);z-index:1200;background:#2d333a;color:#fff;border:1px solid rgba(255,255,255,.2);box-shadow:0 7px 22px rgba(0,0,0,.3);border-radius:4px;padding:10px 12px;display:flex;align-items:center;gap:12px;min-width:330px;max-width:calc(100vw - 30px)}
.tab-undo-toast button{margin-left:auto;background:#fff;color:#26313b;border-color:#fff;padding:5px 10px}
.tab-undo-count{font-weight:bold;min-width:18px;text-align:center}
body.dark .workspace-tab{background:#343c45;border-color:#626d78;color:#f4f6f8}
body.dark .workspace-tab.active{background:#46515c}
body.dark .workspace-tab-close{color:#e8edf2}
body.dark .workspace-tab-close:hover{background:#4b5662;color:#fff}
@media(max-width:760px){.workspace-tabs{min-width:420px}.workspace-tab{min-width:135px}.tab-undo-toast{min-width:0;width:calc(100vw - 64px)}}

/* v5.11: tab titles never underline on hover/focus/active */
.workspace-tab-title,.workspace-tab-title:hover,.workspace-tab-title:focus,.workspace-tab-title:active,.workspace-tab a,.workspace-tab a:hover,.workspace-tab a:focus,.workspace-tab a:active{text-decoration:none!important}

/* v5.12: табът остава видим по време на обратното броене */
.workspace-tab.pending-close{opacity:.58;filter:grayscale(.25);box-shadow:inset 0 -2px 0 #c78600}
.workspace-tab.pending-close .workspace-tab-title{font-style:italic}
.workspace-tab.pending-close .workspace-tab-close{cursor:wait;opacity:.55}

/* v5.14: не показвай стария модул при ново стартиране преди пренасочването към Начало. */
html.bgf-start-guard,html.bgf-start-guard body{background:#dfe3e7!important;}
html.bgf-start-guard body{visibility:hidden!important;}

/* v5.15: автоматична проверка дали добавяният потребител вече съществува */
.user-email-status{margin-top:5px;padding:7px 9px;border:1px solid #c7ced6;border-radius:4px;font-size:12px;line-height:1.25;background:#f5f7f9;color:#4d5965}
.user-email-status.checking{background:#eef4fb;border-color:#9fbce0;color:#244b78}
.user-email-status.existing-user{background:#edf8ef;border-color:#9bc7a4;color:#245b31}
.user-email-status.new-user{background:#fff7e6;border-color:#dfbd70;color:#6b4a05}
.user-email-status.warning{background:#fff0f0;border-color:#d99b9b;color:#7b2020}
.user-email-status.error{background:#fff0f0;border-color:#d99b9b;color:#7b2020}
#companyUserPasswordField[hidden]{display:none!important}
#companyUserName[readonly]{background:#eef1f4;color:#46515c;cursor:default}

/* v5.16: известие при вход за чакащи заявки за достъп */
.access-request-notice{position:fixed;inset:0;z-index:10050;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(20,26,33,.62);backdrop-filter:blur(2px);animation:accessNoticeFade .18s ease-out}
.access-request-notice.is-closing{opacity:0;transition:opacity .18s ease}
.access-request-notice-card{position:relative;width:min(520px,calc(100vw - 32px));max-height:calc(100vh - 40px);overflow:auto;padding:28px;border:1px solid #c9d4df;border-radius:10px;background:#fff;box-shadow:0 18px 55px rgba(0,0,0,.3);text-align:center}
.access-request-notice-close{position:absolute;top:10px;right:12px;width:34px;height:34px;border:0;border-radius:6px;background:transparent;color:#4b5563;font-size:26px;line-height:30px;cursor:pointer}
.access-request-notice-close:hover{background:#eef2f6;color:#111827}
.access-request-notice-icon{font-size:42px;line-height:1;margin-bottom:10px}
.access-request-notice-card h2{margin:0 32px 10px;font-size:22px;color:#1f2937}
.access-request-notice-card p{margin:0 0 18px;color:#4b5563;line-height:1.45}
.access-request-company-list{margin:0 0 20px;border:1px solid #d8e0e8;border-radius:7px;overflow:hidden;text-align:left}
.access-request-company-list>div{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 12px;background:#f7f9fb;border-bottom:1px solid #d8e0e8}
.access-request-company-list>div:last-child{border-bottom:0}
.access-request-company-list span{display:inline-flex;min-width:28px;height:28px;align-items:center;justify-content:center;border-radius:999px;background:#b42318;color:#fff;font-weight:700}
.access-request-notice-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}
.access-request-notice-actions .btn,.access-request-notice-actions button{min-width:150px;text-decoration:none}
@keyframes accessNoticeFade{from{opacity:0}to{opacity:1}}
html[data-theme="dark"] .access-request-notice-card,body.dark .access-request-notice-card{background:#20262d;border-color:#48525d;color:#eef2f6}
html[data-theme="dark"] .access-request-notice-card h2,body.dark .access-request-notice-card h2{color:#fff}
html[data-theme="dark"] .access-request-notice-card p,body.dark .access-request-notice-card p{color:#cbd5df}
html[data-theme="dark"] .access-request-company-list,html[data-theme="dark"] .access-request-company-list>div,body.dark .access-request-company-list,body.dark .access-request-company-list>div{border-color:#48525d;background:#2a3139}
@media(max-width:600px){.access-request-notice{padding:12px}.access-request-notice-card{padding:24px 16px 18px}.access-request-notice-actions{flex-direction:column}.access-request-notice-actions .btn,.access-request-notice-actions button{width:100%}}


/* v5.19: бутоните в личните настройки са на един ред */
.personal-settings-grid-extended>.personal-settings-actions{
  grid-column:1/-1!important;
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:10px!important;
  flex-wrap:nowrap!important;
  width:100%!important;
  padding-top:0!important;
  margin-top:10px!important;
}
.personal-settings-grid-extended>.personal-settings-actions>button{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:auto!important;
  margin:0!important;
  white-space:nowrap!important;
}
@media(max-width:520px){
  .personal-settings-grid-extended>.personal-settings-actions{flex-wrap:wrap!important;}
}


/* v5.24 — модерен начален екран с управляем фон и централно изображение */
.empty-workspace.workspace-designed{position:relative;min-height:calc(100vh - 88px);overflow:hidden;background:linear-gradient(180deg,#f7fbff 0%,#eef6fd 50%,#e6f1fb 100%)}
.workspace-designed .workspace-background-layer{position:absolute;inset:0;background-image:linear-gradient(180deg,rgba(247,251,255,.34) 0%,rgba(236,246,255,.08) 45%,rgba(225,240,252,.02) 100%),var(--workspace-bg);background-repeat:no-repeat;background-position:center bottom;background-size:cover;opacity:.9;pointer-events:none;user-select:none}
.workspace-designed .workspace-welcome{z-index:3}
.workspace-designed .workspace-hero-card{position:absolute;z-index:2;left:50%;top:54%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;width:min(58vw,790px);height:min(62vh,610px);padding:18px;border:1px solid rgba(174,194,214,.72);border-radius:14px;background:rgba(255,255,255,.82);box-shadow:0 18px 45px rgba(30,82,130,.17);backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px)}
.workspace-designed .workspace-hero-card .workspace-image{position:static;transform:none;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;opacity:1;filter:none;border-radius:9px}
.workspace-designed .workspace-hero-card .watermark{position:static;transform:none;font-size:min(34vw,440px);line-height:1;color:rgba(57,105,151,.10)}
.workspace-background-preview{height:120px}
.workspace-background-preview img{width:100%;height:100%;object-fit:cover}
body.dark .empty-workspace.workspace-designed{background:#18222d}
body.dark .workspace-designed .workspace-background-layer{opacity:.44;filter:brightness(.58) saturate(.82)}
body.dark .workspace-designed .workspace-hero-card{background:rgba(38,45,53,.86);border-color:rgba(119,139,158,.7);box-shadow:0 18px 45px rgba(0,0,0,.35)}
@media(max-width:900px){.workspace-designed .workspace-hero-card{width:calc(100% - 34px);height:auto;max-height:64vh;top:56%;padding:10px}.workspace-designed .workspace-hero-card .workspace-image{max-height:58vh}.workspace-designed .workspace-background-layer{background-size:auto 100%;background-position:center bottom}}

/* v5.25 — падащото меню за избор на фирма винаги е над началния фон */
.workspace-head{
  position:relative;
  z-index:300!important;
  isolation:isolate;
  overflow:visible!important;
}
.company-switcher{
  position:relative;
  z-index:320!important;
  overflow:visible!important;
}
.company-switcher select,
.company-switch-select{
  position:relative;
  z-index:330!important;
}
.empty-workspace.workspace-designed{
  z-index:0;
}
.workspace-designed .workspace-background-layer{
  z-index:0;
}
.workspace-designed .workspace-welcome,
.workspace-designed .workspace-hero-card{
  z-index:2;
}
@media(max-width:760px){
  .workspace-head{overflow:visible!important;}
}

/* v5.26 — началният фон започва под менюто за избор на фирма */
.workspace-head{
  position:relative!important;
  z-index:500!important;
  min-height:38px!important;
  height:38px!important;
  padding:4px 0 6px!important;
  background:var(--bg)!important;
  overflow:visible!important;
}
.company-switcher{
  position:relative!important;
  z-index:520!important;
  border-bottom:1px solid #aeb5bd!important;
  border-radius:3px!important;
  background:#eef0f3!important;
}
.company-switcher select,
.company-switch-select{
  position:relative!important;
  z-index:540!important;
  background:#eef0f3!important;
}
.empty-workspace.workspace-designed{
  position:relative!important;
  z-index:1!important;
  margin-top:0!important;
  min-height:calc(100vh - 92px)!important;
  border-top:1px solid transparent;
}
.workspace-designed .workspace-background-layer{
  top:0!important;
}
body.dark .workspace-head{background:#20262d!important}
body.dark .company-switcher,
body.dark .company-switcher select,
body.dark .company-switch-select{background:#30363d!important;color:#fff!important;border-color:#626d78!important}

/* v5.27 — по-изчистена лента за избор на фирма на началния екран */
.workspace-head{
  position:relative!important;
  z-index:500!important;
  min-height:44px!important;
  height:44px!important;
  padding:6px 12px 6px 8px!important;
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  overflow:visible!important;
  background:linear-gradient(180deg,rgba(255,255,255,.96) 0%,rgba(238,245,252,.92) 100%)!important;
  border-bottom:1px solid rgba(151,174,197,.72)!important;
  box-shadow:0 2px 8px rgba(39,74,108,.10)!important;
}
.company-switcher{
  position:relative!important;
  z-index:520!important;
  min-width:255px!important;
  max-width:360px!important;
  height:32px!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  border-radius:7px!important;
  background:transparent!important;
  box-shadow:none!important;
}
.company-switcher::before{
  content:"";
  position:absolute;
  left:0;
  top:5px;
  bottom:5px;
  width:3px;
  border-radius:3px;
  background:linear-gradient(180deg,#4b8fd8,#1f5f9f);
  z-index:545;
  pointer-events:none;
}
.company-switcher select,
.company-switch-select{
  position:relative!important;
  z-index:540!important;
  width:100%!important;
  height:32px!important;
  min-height:32px!important;
  padding:4px 34px 4px 14px!important;
  border:1px solid #aab9c8!important;
  border-radius:7px!important;
  background:rgba(255,255,255,.98)!important;
  color:#22303d!important;
  font-weight:700!important;
  box-shadow:0 1px 3px rgba(26,55,82,.08)!important;
}
.company-switcher select:hover,
.company-switch-select:hover{
  border-color:#7e9fbe!important;
  background:#fff!important;
}
.company-switcher select:focus,
.company-switch-select:focus{
  outline:0!important;
  border-color:#4b86bd!important;
  box-shadow:0 0 0 3px rgba(75,134,189,.18)!important;
}
.workspace-tabs{
  align-self:stretch!important;
  padding-top:4px!important;
}
.empty-workspace.workspace-designed{
  min-height:calc(100vh - 98px)!important;
}
body.dark .workspace-head{
  background:linear-gradient(180deg,rgba(40,47,55,.98),rgba(31,38,46,.96))!important;
  border-bottom-color:#55616d!important;
  box-shadow:0 2px 8px rgba(0,0,0,.24)!important;
}
body.dark .company-switcher,
body.dark .company-switcher select,
body.dark .company-switch-select{
  background:transparent!important;
}
body.dark .company-switcher select,
body.dark .company-switch-select{
  background:#303943!important;
  color:#f4f7fa!important;
  border-color:#667482!important;
}
body.dark .company-switcher select:hover,
body.dark .company-switch-select:hover{background:#35414c!important}
@media(max-width:760px){
  .workspace-head{height:auto!important;min-height:44px!important;padding:6px!important;flex-wrap:nowrap!important}
  .company-switcher{min-width:210px!important;max-width:calc(100vw - 58px)!important}
}

/* v5.28 — фонът на началния екран запълва цялата работна зона */
.empty-workspace.workspace-designed{
  width:calc(100% + 28px)!important;
  margin-left:-14px!important;
  margin-right:-14px!important;
  min-height:calc(100vh - 98px)!important;
  background:linear-gradient(180deg,#f7fbff 0%,#eef6fd 50%,#e6f1fb 100%)!important;
  overflow:hidden!important;
}
.workspace-designed .workspace-background-layer{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  background-image:linear-gradient(180deg,rgba(247,251,255,.20) 0%,rgba(236,246,255,.04) 42%,rgba(225,240,252,0) 100%),var(--workspace-bg)!important;
  background-repeat:no-repeat!important;
  background-position:center center!important;
  background-size:cover!important;
  opacity:1!important;
}
.workspace-designed .workspace-hero-card{
  top:52%!important;
}
@media(max-width:760px){
  .empty-workspace.workspace-designed{
    width:calc(100% + 16px)!important;
    margin-left:-8px!important;
    margin-right:-8px!important;
    min-height:calc(100vh - 92px)!important;
  }
  .workspace-designed .workspace-background-layer{
    background-size:cover!important;
    background-position:center center!important;
  }
}


/* v5.29 — началният фон започва от самия горен край на работната зона */
.main:has(> .empty-workspace.workspace-designed){
  position:relative!important;
}
.main:has(> .empty-workspace.workspace-designed) .workspace-head{
  position:absolute!important;
  top:0!important;
  left:0!important;
  right:0!important;
  z-index:700!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  padding:6px 12px 6px 8px!important;
}
.main:has(> .empty-workspace.workspace-designed) .company-switcher{
  background:transparent!important;
}
.main:has(> .empty-workspace.workspace-designed) .empty-workspace.workspace-designed{
  margin-top:0!important;
  min-height:calc(100vh - 28px)!important;
}
body.dark .main:has(> .empty-workspace.workspace-designed) .workspace-head{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
@media(max-width:760px){
  .main:has(> .empty-workspace.workspace-designed) .workspace-head{
    padding:6px!important;
  }
  .main:has(> .empty-workspace.workspace-designed) .empty-workspace.workspace-designed{
    min-height:100vh!important;
  }
}


/* v5.30 — без хоризонтален скрол и без празна зона под началния фон */
.main:has(> .empty-workspace.workspace-designed){
  box-sizing:border-box!important;
  height:calc(100vh - 28px)!important;
  min-height:calc(100vh - 28px)!important;
  padding:0!important;
  overflow:hidden!important;
}
.main:has(> .empty-workspace.workspace-designed) .empty-workspace.workspace-designed{
  box-sizing:border-box!important;
  width:100%!important;
  height:100%!important;
  min-height:100%!important;
  margin:0!important;
  overflow:hidden!important;
}
.main:has(> .empty-workspace.workspace-designed) .workspace-background-layer{
  inset:0!important;
  width:100%!important;
  height:100%!important;
}
html,body{overflow-x:hidden!important;}
@media(max-width:760px){
  .main:has(> .empty-workspace.workspace-designed){
    height:100vh!important;
    min-height:100vh!important;
  }
  .main:has(> .empty-workspace.workspace-designed) .empty-workspace.workspace-designed{
    height:100%!important;
    min-height:100%!important;
  }
}


/* v5.31 - Modal preview for every document */
.document-preview-modal[hidden]{display:none!important}
.document-preview-modal{position:fixed;inset:0;z-index:25000;display:flex;align-items:center;justify-content:center;padding:18px}
.document-preview-backdrop{position:absolute;inset:0;background:rgba(25,31,38,.72);backdrop-filter:blur(2px)}
.document-preview-dialog{position:relative;z-index:1;width:min(1120px,96vw);height:min(900px,94vh);display:grid;grid-template-rows:auto 1fr auto;background:#f6f8fa;border:1px solid #b9c2cc;border-radius:10px;box-shadow:0 22px 70px rgba(0,0,0,.38);overflow:hidden}
.document-preview-header{display:flex;align-items:center;justify-content:space-between;padding:13px 16px;background:#fff;border-bottom:1px solid #cbd2da}
.document-preview-header h2{margin:0;font-size:18px;color:#202a34}
.document-preview-x{width:36px;height:36px;border:0;background:transparent;color:#606a74;font-size:30px;line-height:1;cursor:pointer;border-radius:6px}
.document-preview-x:hover{background:#edf1f5;color:#1f2831}
.document-preview-body{position:relative;min-height:0;background:#d9dde2;overflow:hidden}
.document-preview-body iframe{width:100%;height:100%;border:0;display:block;background:#d9dde2}
.document-preview-loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#eef2f6;color:#4b5661;font-weight:700;z-index:2}
.document-preview-loading.is-hidden{display:none}
.document-preview-actions{display:flex;align-items:center;justify-content:flex-end;gap:9px;flex-wrap:wrap;padding:12px 16px;background:#fff;border-top:1px solid #cbd2da}
.document-preview-actions button{min-height:36px}
.document-preview-actions .secondary{background:#657585;color:#fff}
.document-preview-actions .copy{background:#8a6336;color:#fff}
body.document-preview-open{overflow:hidden!important}
@media(max-width:700px){.document-preview-modal{padding:0}.document-preview-dialog{width:100vw;height:100vh;max-height:none;border-radius:0}.document-preview-actions{justify-content:stretch}.document-preview-actions button{flex:1 1 46%;font-size:12px;padding:8px}}
[data-theme="dark"] .document-preview-dialog,[data-theme="dark"] .document-preview-header,[data-theme="dark"] .document-preview-actions{background:#20262d;color:#eef3f7;border-color:#3c4650}
[data-theme="dark"] .document-preview-header h2{color:#f2f5f8}


/* v5.32: единен модален прозорец за потвърждение */
.app-confirm-modal[hidden]{display:none!important}
.app-confirm-modal{position:fixed;inset:0;z-index:30000;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(18,24,31,.58);backdrop-filter:blur(2px)}
.app-confirm-dialog{width:min(470px,96vw);display:flex;gap:16px;align-items:flex-start;background:var(--card,#fff);color:var(--text,#17212b);border:1px solid var(--border,#b9c2cc);border-radius:10px;box-shadow:0 22px 60px rgba(0,0,0,.35);padding:22px}
.app-confirm-icon{flex:0 0 46px;width:46px;height:46px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#fce7e7;color:#b42318;font-size:28px;font-weight:800;border:1px solid #f4b8b8}
.app-confirm-content{flex:1;min-width:0}
.app-confirm-content h2{margin:0 0 8px;font-size:19px;line-height:1.25}
.app-confirm-content p{margin:0;color:var(--muted,#5f6b76);line-height:1.5;font-size:14px}
.app-confirm-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px;flex-wrap:wrap}
.app-confirm-actions button{min-width:110px}
@media(max-width:560px){.app-confirm-dialog{padding:18px;gap:12px}.app-confirm-icon{width:40px;height:40px;flex-basis:40px}.app-confirm-actions{justify-content:stretch}.app-confirm-actions button{flex:1 1 120px}}


/* v5.33 — стабилен мобилен изглед без хоризонтално изместване */
@media(max-width:760px){
  html,body{
    width:100%!important;
    max-width:100%!important;
    overflow-x:hidden!important;
  }
  body{position:relative!important;}
  .app{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow-x:hidden!important;
  }
  .rail{
    width:42px!important;
    max-width:42px!important;
  }
  .sidebar{
    left:42px!important;
    width:calc(100vw - 42px)!important;
    max-width:calc(100vw - 42px)!important;
    box-sizing:border-box!important;
  }
  .main,
  .sidebar.closed~.main{
    margin-left:42px!important;
    width:calc(100vw - 42px)!important;
    max-width:calc(100vw - 42px)!important;
    min-width:0!important;
    box-sizing:border-box!important;
    overflow-x:hidden!important;
    padding-left:8px!important;
    padding-right:8px!important;
  }
  .workspace-head{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
    display:grid!important;
    grid-template-columns:minmax(178px,46%) minmax(0,1fr)!important;
    align-items:end!important;
    gap:5px!important;
    overflow:hidden!important;
  }
  .company-switcher{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    overflow:hidden!important;
  }
  .company-switcher select,
  .company-switch-select{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  .workspace-tabs{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    flex:initial!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-x:contain!important;
    touch-action:pan-x!important;
    scrollbar-width:none!important;
    scroll-behavior:smooth!important;
  }
  .workspace-tabs::-webkit-scrollbar{display:none!important;}
  .workspace-tab{
    min-width:140px!important;
    max-width:210px!important;
    flex:0 0 auto!important;
  }
  .workspace-tab-title{
    min-width:0!important;
    max-width:none!important;
  }
  .topbar,
  .card,
  .stats,
  .stat,
  .grid2,
  .grid3,
  .grid4,
  .filterbar{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
  }
  .card{overflow:hidden!important;}
  .table-wrap{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-x:contain!important;
    touch-action:pan-x pan-y!important;
  }
  .table-wrap>.table{
    width:max-content!important;
    min-width:100%!important;
    max-width:none!important;
  }
  .table th,.table td{
    white-space:nowrap!important;
  }
  .table td.actions{
    white-space:nowrap!important;
    min-width:220px!important;
  }
  .invoice-lines-wrap{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-x:contain!important;
  }
}

@media(max-width:430px){
  .workspace-head{
    grid-template-columns:minmax(165px,52%) minmax(0,1fr)!important;
    padding-left:5px!important;
    padding-right:5px!important;
  }
  .workspace-tab{min-width:132px!important;max-width:185px!important;}
  .company-switcher select,.company-switch-select{font-size:13px!important;}
  .topbar{padding:8px 9px!important;}
  .topbar .brand{font-size:16px!important;}
  .company-pill{max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
}

/* v5.34 — mobile: фирменият selector и welcome блокът са на отделни нива */
@media(max-width:760px){
  .main:has(> .empty-workspace.workspace-designed) .workspace-head{
    position:absolute!important;
    top:0!important;
    left:0!important;
    right:0!important;
    min-height:56px!important;
    padding:8px 8px 6px 8px!important;
    display:block!important;
    overflow:visible!important;
  }
  .main:has(> .empty-workspace.workspace-designed) .company-switcher{
    width:calc(100% - 8px)!important;
    max-width:100%!important;
    margin:0!important;
  }
  .main:has(> .empty-workspace.workspace-designed) .company-switcher select,
  .main:has(> .empty-workspace.workspace-designed) .company-switch-select{
    width:100%!important;
    max-width:100%!important;
    min-height:44px!important;
    font-size:16px!important;
    line-height:1.2!important;
    padding:8px 38px 8px 12px!important;
    box-sizing:border-box!important;
  }
  .workspace-designed .workspace-welcome{
    top:72px!important;
    left:12px!important;
    right:12px!important;
    transform:none!important;
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
    margin:0!important;
    padding:10px 12px!important;
    box-sizing:border-box!important;
  }
  .workspace-designed .workspace-welcome strong{
    font-size:16px!important;
    line-height:1.25!important;
  }
  .workspace-designed .workspace-welcome span{
    font-size:12px!important;
  }
  .workspace-designed .workspace-hero-card{
    top:58%!important;
    width:calc(100% - 28px)!important;
    max-height:58vh!important;
  }
}
@media(max-width:430px){
  .workspace-designed .workspace-welcome{
    top:68px!important;
  }
  .workspace-designed .workspace-hero-card{
    top:60%!important;
    max-height:55vh!important;
  }
}

/* v5.35 — мобилен header на два реда и фон без странични празни полета */
@media (max-width:760px){
  .workspace-head{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    align-items:stretch!important;
    gap:4px!important;
    height:auto!important;
    min-height:0!important;
    width:100%!important;
    max-width:100%!important;
    padding:5px 6px 0!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }
  .company-switcher{
    grid-column:1!important;
    grid-row:1!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    height:44px!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
    border-bottom:1px solid #aeb5bd!important;
    border-radius:7px!important;
    background:#fff!important;
  }
  .company-switcher select,
  .company-switch-select{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    height:42px!important;
    padding:7px 34px 7px 12px!important;
    font-size:15px!important;
    font-weight:700!important;
    line-height:1.2!important;
    box-sizing:border-box!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  .workspace-tabs{
    grid-column:1!important;
    grid-row:2!important;
    display:flex!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    padding:0!important;
    margin:0!important;
    box-sizing:border-box!important;
  }
  .workspace-tab{
    min-width:150px!important;
    max-width:min(78vw,260px)!important;
  }

  /* Начален екран: без сиви странични ивици */
  .main:has(> .empty-workspace.workspace-designed){
    padding-left:0!important;
    padding-right:0!important;
    overflow-x:hidden!important;
  }
  .main:has(> .empty-workspace.workspace-designed) .workspace-head{
    position:relative!important;
    inset:auto!important;
    z-index:50!important;
    padding:5px 6px 4px!important;
    background:rgba(247,251,255,.96)!important;
  }
  .main:has(> .empty-workspace.workspace-designed) .company-switcher{
    width:100%!important;
    max-width:100%!important;
  }
  .main:has(> .empty-workspace.workspace-designed) .workspace-tabs{
    display:none!important;
  }
  .main:has(> .empty-workspace.workspace-designed) .empty-workspace.workspace-designed{
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    border-radius:0!important;
  }
  .workspace-designed .workspace-background-layer{
    left:0!important;
    right:0!important;
    width:100%!important;
    max-width:100%!important;
    background-size:cover!important;
    background-position:center center!important;
  }
}

@media (max-width:430px){
  .company-switcher select,
  .company-switch-select{
    font-size:14px!important;
    padding-left:10px!important;
  }
  .workspace-tab{
    min-width:145px!important;
    max-width:235px!important;
  }
}


/* v5.36 — мобилно подравняване и светлочервена тема */
@media (max-width:760px){
  .company-switcher{
    height:50px!important;
    min-height:50px!important;
    overflow:visible!important;
  }
  .company-switcher select,
  .company-switch-select{
    height:48px!important;
    min-height:48px!important;
    padding:0 42px 0 14px!important;
    line-height:normal!important;
    font-size:15px!important;
    font-weight:700!important;
    -webkit-appearance:menulist-button!important;
    appearance:auto!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    overflow:hidden!important;
  }
  .main:has(> .empty-workspace.workspace-designed) .workspace-head{
    padding-bottom:6px!important;
  }
  .workspace-designed .workspace-welcome{
    top:18px!important;
  }
  .workspace-designed .workspace-hero-card{
    top:49%!important;
    width:calc(100% - 24px)!important;
    max-height:56vh!important;
  }
  .workspace-designed .workspace-hero-card .workspace-image{
    max-height:52vh!important;
  }
}
@media (max-width:430px){
  .company-switcher select,
  .company-switch-select{
    font-size:14px!important;
    padding-left:12px!important;
  }
  .workspace-designed .workspace-hero-card{
    top:47%!important;
    max-height:54vh!important;
  }
  .workspace-designed .workspace-hero-card .workspace-image{
    max-height:50vh!important;
  }
}

body.red-theme{
  --bg:#fff3f3;
  --panel:#fff8f8;
  --panel2:#fdeaea;
  --card:#fffafa;
  --text:#3d2020;
  --muted:#7f5b5b;
  --line:#e3b9b9;
  --line2:#edd0d0;
  --dark:#8f1f1f;
  --accent:#c74343;
  background:#f8e9e9!important;
  color:var(--text)!important;
}
body.red-theme .rail{background:#f6dddd;border-right-color:#dfb2b2}
body.red-theme .rail-btn{background:#fff5f5;border-color:#d7aaaa;color:#7d2626}
body.red-theme .rail-btn:hover{background:#f4cccc;border-color:#c77b7b;color:#651616}
body.red-theme .sidebar{background:#fff5f5;border-right-color:#dfb2b2;color:#3d2020}
body.red-theme .menu-btn{background:#fffafa;border-color:#ddb7b7;color:#5f2525}
body.red-theme .menu-btn:hover{background:#f8dede}
body.red-theme .workspace-head{background:linear-gradient(180deg,#fff9f9,#fdeeee)!important;border-bottom-color:#dfb2b2!important}
body.red-theme .company-switcher,
body.red-theme .company-switcher select,
body.red-theme .company-switch-select{background:#fffafa!important;color:#5a2020!important;border-color:#d7aaaa!important}
body.red-theme .workspace-tab{background:#fff8f8;border-color:#d8b0b0;color:#572727}
body.red-theme .workspace-tab.active{background:#f7d9d9}
body.red-theme .topbar{background:#8f2929;color:#fff}
body.red-theme .card,
body.red-theme .stat,
body.red-theme .filterbar{background:#fffafa;border-color:#dfbcbc}
body.red-theme input,
body.red-theme select,
body.red-theme textarea{background:#fffefe;color:#3d2020;border-color:#d7b3b3}
body.red-theme button,
body.red-theme .btn{background:#8f2929;border-color:#7c2020;color:#fff}
body.red-theme button.light,
body.red-theme .btn.light{background:#f6dddd;color:#5f2525;border-color:#d8aaaa}
body.red-theme .empty-workspace.workspace-designed{background:linear-gradient(180deg,#fff8f8 0%,#fdeeee 52%,#f9dddd 100%)!important}
body.red-theme .workspace-designed .workspace-background-layer{filter:hue-rotate(305deg) saturate(.72) brightness(1.04);opacity:.68}
body.red-theme .workspace-designed .workspace-hero-card{background:rgba(255,250,250,.90);border-color:rgba(211,143,143,.72);box-shadow:0 18px 45px rgba(143,41,41,.16)}
body.red-theme .workspace-welcome{background:rgba(255,250,250,.95);border-color:#ddb6b6}
body.red-theme .bottom{background:#f3dada;border-top-color:#d9aaaa;color:#5e2b2b}
body.red-theme .table th{background:linear-gradient(#fff6f6,#f3dada);color:#4f2525}
body.red-theme .table td{background:#fffdfd}
body.red-theme .app-toast-info{background:#9f3c3c}
body.red-theme .rail-btn[title]:hover::after{background:#7f2424;color:#fff}


/* v5.37 — четим фирмен selector и тема по подразбиране */
.company-select-shell{
  position:relative;
  display:flex;
  align-items:center;
  width:100%;
  min-width:0;
  height:100%;
  box-sizing:border-box;
}
.company-select-label{
  display:block;
  width:100%;
  min-width:0;
  padding:0 42px 0 14px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-weight:700;
  line-height:1.2;
  color:inherit;
  box-sizing:border-box;
}
.company-select-shell .company-switch-select{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  margin:0!important;
  opacity:0!important;
  cursor:pointer!important;
  z-index:3!important;
  -webkit-appearance:menulist!important;
  appearance:auto!important;
}
.company-select-chevron{
  position:absolute;
  right:15px;
  top:50%;
  width:10px;
  height:10px;
  border-right:3px solid currentColor;
  border-bottom:3px solid currentColor;
  transform:translateY(-65%) rotate(45deg);
  pointer-events:none;
  z-index:2;
}
@media (max-width:760px){
  .company-switcher{
    height:54px!important;
    min-height:54px!important;
    overflow:hidden!important;
  }
  .company-select-shell{height:52px!important;}
  .company-select-label{
    padding-left:16px!important;
    padding-right:48px!important;
    font-size:16px!important;
    line-height:1.25!important;
  }
  .company-select-chevron{right:18px!important;}
}
@media (max-width:430px){
  .company-select-label{font-size:15px!important;}
}
body.red-theme .company-select-label{color:#5a2020!important;}
body.dark .company-select-label,
html[data-theme="dark"] .company-select-label{color:#eef3f7!important;}


/* v5.38 — компактно фирмено меню, незабавно странично меню и корекции на червената тема */
.sidebar,
.main{
  transition:none!important;
}

/* Фирменият selector остава компактен на всички екрани */
.company-switcher{
  height:34px!important;
  min-height:34px!important;
  max-height:34px!important;
  padding:0 8px!important;
  border-radius:5px!important;
  overflow:hidden!important;
}
.company-select-shell{
  height:32px!important;
  min-height:32px!important;
  max-height:32px!important;
}
.company-select-label{
  display:flex!important;
  align-items:center!important;
  height:32px!important;
  min-height:32px!important;
  max-height:32px!important;
  padding:0 34px 0 10px!important;
  font-size:14px!important;
  line-height:32px!important;
  font-weight:700!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
.company-select-chevron{
  right:12px!important;
  width:8px!important;
  height:8px!important;
  border-width:2px!important;
}

/* Светлочервена тема — без зелено оцветяване на фоновото изображение */
body.red-theme .workspace-designed .workspace-background-layer{
  filter:none!important;
  opacity:.34!important;
}
body.red-theme .empty-workspace.workspace-designed::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(180deg,rgba(255,244,244,.44),rgba(255,225,225,.18));
  z-index:0;
}
body.red-theme .workspace-designed .workspace-welcome,
body.red-theme .workspace-designed .workspace-hero-card{
  z-index:2!important;
}

@media(max-width:760px){
  .workspace-head{
    gap:3px!important;
    padding-top:4px!important;
  }
  .company-switcher{
    height:46px!important;
    min-height:46px!important;
    max-height:46px!important;
    padding:0 8px!important;
  }
  .company-select-shell{
    height:44px!important;
    min-height:44px!important;
    max-height:44px!important;
  }
  .company-select-label{
    height:44px!important;
    min-height:44px!important;
    max-height:44px!important;
    line-height:44px!important;
    font-size:15px!important;
    padding:0 42px 0 12px!important;
  }
  .company-select-chevron{right:16px!important;}

  /* Началният екран се прибира нагоре и не оставя огромна празнина */
  .workspace-designed .workspace-welcome{
    top:14px!important;
  }
  .workspace-designed .workspace-hero-card{
    top:43%!important;
    width:calc(100% - 20px)!important;
    max-height:58vh!important;
  }
  .workspace-designed .workspace-hero-card .workspace-image{
    max-height:54vh!important;
  }

  /* Лични настройки: бутоните не излизат извън екрана */
  .personal-settings-actions{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
    width:100%!important;
  }
  .personal-settings-actions .btn,
  .personal-settings-actions button{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    white-space:normal!important;
  }
}

@media(max-width:430px){
  .company-select-label{
    font-size:14px!important;
  }
  .workspace-designed .workspace-hero-card{
    top:41%!important;
  }
}

/* v5.39 — компактен mobile selector и постоянна тема без премигване */
@media (max-width:760px){
  .workspace-head{
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    align-items:start!important;
  }
  .company-switcher,
  .main:has(> .empty-workspace.workspace-designed) .company-switcher{
    width:min(100%,300px)!important;
    max-width:300px!important;
    min-width:0!important;
    justify-self:start!important;
    height:40px!important;
    min-height:40px!important;
    max-height:40px!important;
    padding:0 6px!important;
    overflow:hidden!important;
  }
  .company-select-shell{
    height:38px!important;
    min-height:38px!important;
    max-height:38px!important;
  }
  .company-select-label{
    height:38px!important;
    min-height:38px!important;
    max-height:38px!important;
    line-height:38px!important;
    padding:0 34px 0 10px!important;
    font-size:14px!important;
    font-weight:700!important;
  }
  .company-select-chevron{right:12px!important;}
  .workspace-tabs{
    grid-row:2!important;
    width:100%!important;
    max-width:100%!important;
  }
}
@media (max-width:390px){
  .company-switcher,
  .main:has(> .empty-workspace.workspace-designed) .company-switcher{
    width:min(100%,280px)!important;
    max-width:280px!important;
  }
  .company-select-label{font-size:13px!important;}
}

/* Темата се задава още преди визуализиране на съдържанието. */
html[data-theme="dark"]{color-scheme:dark;}
html[data-theme="red"]{color-scheme:light;}


/* v5.40 — mobile settings, support modal and raised logout button */
.personal-settings-grid,
.personal-settings-grid-extended,
.personal-setting-field,
.personal-toggle{
  min-width:0;
  max-width:100%;
}
.personal-settings-actions{
  grid-column:1/-1;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  flex-wrap:wrap;
  width:100%;
  margin-top:10px;
}
.support-info-modal[hidden]{display:none!important;}
.support-info-modal{position:fixed;inset:0;z-index:10050;display:grid;place-items:center;padding:18px;}
.support-info-backdrop{position:absolute;inset:0;background:rgba(26,32,38,.58);backdrop-filter:blur(2px);}
.support-info-dialog{position:relative;width:min(620px,calc(100vw - 28px));max-height:calc(100vh - 36px);overflow:auto;background:var(--card);border:1px solid var(--line);border-radius:10px;box-shadow:0 20px 60px rgba(0,0,0,.28);}
.support-info-head{display:flex;align-items:center;gap:12px;padding:15px 18px;border-bottom:1px solid var(--line2);background:linear-gradient(#f8fafc,#eef2f6);}
.support-info-head h2{margin:0;font-size:20px;}
.support-info-x{margin-left:auto;width:36px;height:36px;padding:0;font-size:24px;line-height:1;background:transparent;color:#45515c;border:0;box-shadow:none;}
.support-info-body{padding:18px;display:grid;gap:12px;}
.support-info-row{display:grid;grid-template-columns:140px 1fr;gap:12px;padding:12px 14px;border:1px solid var(--line2);border-radius:6px;background:#f8fafb;}
.support-info-row a{color:#285e91;text-decoration:none;font-weight:600;word-break:break-word;}
.support-info-text{padding:14px;border-left:4px solid #4e86bd;background:#f7faff;border-radius:4px;line-height:1.55;}
.support-info-empty{padding:16px;text-align:center;color:var(--muted);}
.support-info-actions{display:flex;justify-content:flex-end;padding:12px 18px;border-top:1px solid var(--line2);}
body.dark .support-info-head{background:#2a3036;}
body.dark .support-info-row,body.dark .support-info-text{background:#252b31;color:#f1f4f7;}
body.red-theme .support-info-text{border-left-color:#b84a4a;background:#fff5f5;}
.support-admin-box{border:1px solid var(--line2);border-radius:6px;padding:12px;background:#fafbfc;}
body.dark .support-admin-box{background:#242a30;}
body.red-theme .support-admin-box{background:#fff7f7;}

@media(max-width:760px){
  .personal-settings-form,.personal-settings-grid,.personal-settings-grid-extended{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;
    max-width:100%!important;
    overflow:hidden!important;
  }
  .personal-setting-field,.personal-toggle{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }
  .personal-setting-field input,.personal-setting-field select,.personal-toggle input{
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
  }
  .personal-toggle label{display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;align-items:start!important;gap:10px!important;white-space:normal!important;}
  .personal-settings-actions{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:8px!important;
    width:100%!important;
    max-width:100%!important;
  }
  .personal-settings-actions button{width:100%!important;max-width:100%!important;min-width:0!important;white-space:normal!important;}
  .rail{padding-bottom:calc(18px + env(safe-area-inset-bottom))!important;}
  .rail-exit{transform:translateY(-10px)!important;}
  .support-info-modal{padding:10px;align-items:end;}
  .support-info-dialog{width:100%;max-height:88vh;border-radius:12px 12px 0 0;}
  .support-info-row{grid-template-columns:1fr;gap:4px;}
}

/* v5.42: вертикално центриране на полето за търсене при контрагентите */
.customer-live-filter input#customerListFilter,
.customer-live-filter input[type="search"]{
  display:block!important;
  width:100%!important;
  height:34px!important;
  min-height:34px!important;
  max-height:34px!important;
  padding:6px 10px!important;
  line-height:20px!important;
  vertical-align:middle!important;
  text-align:left!important;
  direction:ltr!important;
  unicode-bidi:plaintext!important;
  text-indent:0!important;
  box-sizing:border-box!important;
  appearance:none!important;
  -webkit-appearance:none!important;
}
.customer-live-filter input#customerListFilter::-webkit-search-decoration,
.customer-live-filter input#customerListFilter::-webkit-search-cancel-button,
.customer-live-filter input#customerListFilter::-webkit-search-results-button,
.customer-live-filter input#customerListFilter::-webkit-search-results-decoration{
  -webkit-appearance:none!important;
}


/* v7.1.1: Клиенти и доставчици — еднакво въвеждане и подравняване като ЕИК/БУЛСТАТ */
.counterparty-entry-form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.counterparty-entry-form select {
  display:block!important;
  width:100%!important;
  height:31px!important;
  min-height:31px!important;
  max-height:31px!important;
  margin:0!important;
  padding:5px 8px!important;
  box-sizing:border-box!important;
  font:inherit!important;
  line-height:normal!important;
  text-align:left!important;
  direction:ltr!important;
  vertical-align:middle!important;
  writing-mode:horizontal-tb!important;
  text-indent:0!important;
  caret-color:currentColor!important;
}
.counterparty-entry-form input::placeholder {
  text-align:left!important;
  direction:ltr!important;
}
.counterparty-entry-form #customerEik {
  flex:1 1 auto!important;
  min-width:0!important;
}
.counterparty-entry-form input:-webkit-autofill,
.counterparty-entry-form input:-webkit-autofill:hover,
.counterparty-entry-form input:-webkit-autofill:focus {
  -webkit-text-fill-color:var(--text)!important;
  caret-color:var(--text)!important;
}

/* BG Faktura 7.5.1: home notification sits just below the welcome card */
body.workspace-home-route .app-toast-stack{top:86px}
@media(max-width:600px){body.workspace-home-route .app-toast-stack{top:76px}}


/* BG Faktura 7.6 - Help / user guide */
.help-shell{display:grid;grid-template-columns:290px minmax(0,1fr);gap:16px;align-items:start}.help-nav{position:sticky;top:12px;padding:16px;max-height:calc(100vh - 105px);overflow:auto}.help-nav-head{display:flex;gap:12px;align-items:center;padding-bottom:14px;border-bottom:1px solid var(--border,#cbd3da)}.help-nav-head h2{margin:0;font-size:18px}.help-nav-head p{margin:3px 0 0;color:var(--muted,#687581);font-size:12px}.help-badge,.help-hero-icon{display:grid;place-items:center;border-radius:50%;font-weight:800;background:var(--accent,#2f6fed);color:#fff}.help-badge{width:42px;height:42px;font-size:24px;flex:0 0 auto}.help-search-label{display:block;margin-top:14px;font-weight:700;font-size:12px}.help-search{margin-top:6px;width:100%;text-align:left!important;direction:ltr!important}.help-toc{display:grid;gap:3px;margin-top:12px}.help-toc a{display:block;padding:8px 9px;border-radius:7px;text-decoration:none;color:inherit;font-size:13px}.help-toc a:hover{background:rgba(80,110,140,.12)}.help-print-btn{width:100%;margin-top:14px}.help-content{min-width:0;display:grid;gap:14px}.help-hero{display:flex;justify-content:space-between;gap:20px;align-items:center;padding:24px;background:linear-gradient(135deg,rgba(47,111,237,.12),rgba(47,111,237,.02))}.help-hero h1{font-size:28px;margin:5px 0 8px}.help-hero p{max-width:850px;margin:0;line-height:1.55}.help-kicker{font-size:12px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--accent,#2f6fed)}.help-hero-icon{width:80px;height:80px;font-size:46px;flex:0 0 auto}.help-quick-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.help-quick{display:grid;gap:6px;padding:15px;text-decoration:none;color:inherit;transition:transform .15s ease,box-shadow .15s ease}.help-quick:hover{transform:translateY(-2px)}.help-quick strong{font-size:14px}.help-quick span{font-size:12px;color:var(--muted,#687581);line-height:1.4}.help-section{padding:22px;scroll-margin-top:12px}.help-section h2{margin:0 0 12px;font-size:21px}.help-section h3{margin:18px 0 8px;font-size:15px}.help-section p{line-height:1.6}.help-list,.help-steps{padding-left:22px;line-height:1.65}.help-list li,.help-steps li{margin:4px 0}.help-steps li::marker{font-weight:800;color:var(--accent,#2f6fed)}.help-section details{border:1px solid var(--border,#cbd3da);border-radius:9px;margin-top:10px;overflow:hidden;background:rgba(255,255,255,.18)}.help-section summary{cursor:pointer;padding:12px 14px;font-weight:700;list-style-position:inside}.help-detail{padding:0 14px 13px}.help-detail p:last-child{margin-bottom:0}.help-note{border-left:4px solid;padding:12px 14px;margin:14px 0;border-radius:5px;line-height:1.5}.help-note.info{border-color:#2f6fed;background:rgba(47,111,237,.10)}.help-note.warning{border-color:#d28a00;background:rgba(210,138,0,.12)}.help-two-col{display:grid;grid-template-columns:1fr 1fr;gap:16px}.help-empty{padding:30px;text-align:center;font-weight:700}body.dark .help-hero{background:linear-gradient(135deg,rgba(90,145,255,.20),rgba(255,255,255,.02))}body.dark .help-section details{background:rgba(255,255,255,.03)}
@media(max-width:1100px){.help-shell{grid-template-columns:230px minmax(0,1fr)}.help-quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.help-shell{display:block}.help-nav{position:relative;top:auto;max-height:none;margin-bottom:12px}.help-toc{grid-template-columns:1fr 1fr}.help-hero{padding:18px}.help-hero h1{font-size:23px}.help-hero-icon{width:58px;height:58px;font-size:34px}.help-quick-grid{grid-template-columns:1fr}.help-section{padding:17px}.help-two-col{grid-template-columns:1fr}}
@media(max-width:480px){.help-toc{grid-template-columns:1fr}.help-hero-icon{display:none}}
@media print{.rail,.sidebar,.workspace-head,.topbar,.bottom,.help-nav,.help-quick-grid{display:none!important}.app,.main{display:block!important;margin:0!important;padding:0!important}.help-shell{display:block}.help-content{display:block}.help-hero,.help-section{box-shadow:none!important;border:1px solid #bbb!important;margin:0 0 12px!important;break-inside:avoid}.help-section details{break-inside:avoid}.help-section details>div{display:block!important}}

/* BG Faktura 7.8.0 — публична SEO секция на страницата за вход */
.login-shell{width:min(980px,calc(100% - 28px));display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:24px;align-items:stretch}
.login-seo-panel{background:linear-gradient(145deg,#ffffff,#eef4fa);border:1px solid #aeb7c1;border-radius:8px;box-shadow:0 8px 28px rgba(24,39,55,.16);padding:34px 38px;color:#1f2d3a;display:flex;flex-direction:column;justify-content:center}
.login-seo-brand{font-size:16px;font-weight:800;letter-spacing:.04em;color:#356fa4;margin-bottom:10px;text-transform:uppercase}
.login-seo-panel h1{font-size:31px;line-height:1.15;margin:0 0 14px;color:#173b64}
.login-seo-panel p{font-size:16px;line-height:1.55;margin:0 0 18px;color:#405365}
.login-seo-panel ul{margin:0;padding-left:20px;display:grid;gap:8px;font-size:14px;line-height:1.35}
.login-shell .login-box{width:auto;align-self:center}
.seo-admin-box{border:1px solid var(--line);background:rgba(74,112,148,.06);padding:14px;border-radius:5px}
@media(max-width:820px){.login-shell{grid-template-columns:1fr;max-width:430px;padding:18px 0}.login-seo-panel{order:2;padding:22px 24px}.login-seo-panel h1{font-size:24px}.login-seo-panel p{font-size:14px}.login-shell .login-box{order:1;width:100%}}

/* v7.8.1: compact login without visible SEO panel */
.login-shell.login-shell-compact{width:auto;display:block;max-width:380px}.login-shell.login-shell-compact .login-box{width:350px;max-width:calc(100vw - 28px)}

/* v7.9.6: SEO public content and compact contact form */
.login-shell.login-shell-compact{align-content:center;gap:18px;padding:28px 18px}
.seo-public-content{width:min(760px,calc(100vw - 36px));margin:0 auto;padding:18px 22px;border:1px solid #bcc4cc;border-radius:8px;background:rgba(255,255,255,.92);box-shadow:0 6px 22px rgba(0,0,0,.10);text-align:center;color:#25313b}
.seo-public-content h1{margin:0 0 9px;font-size:24px;line-height:1.2}
.seo-public-content p{margin:0 auto;max-width:680px;line-height:1.55;color:#4f5c67}
.seo-public-features{display:flex;justify-content:center;flex-wrap:wrap;gap:8px;margin-top:14px}
.seo-public-features span{padding:6px 10px;border:1px solid #ccd3da;border-radius:16px;background:#f6f8fa;font-size:12px;font-weight:700;color:#34424d}
.support-contact-dialog{width:min(620px,calc(100vw - 28px))}
.support-contact-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:12px}
.support-contact-chip{display:flex;flex-direction:column;gap:3px;min-width:0;padding:10px;border:1px solid var(--line);border-radius:5px;background:#f7f9fb;color:#27333d;text-decoration:none}
.support-contact-chip strong{font-size:11px;text-transform:uppercase;color:#687582}
.support-contact-chip span{overflow-wrap:anywhere;font-weight:700}
.support-contact-form{display:grid;gap:10px;margin-top:12px}
.support-contact-form>div>label,.support-contact-form .grid2 label{margin-bottom:4px}
.support-contact-status{min-height:20px;padding:0 2px;font-size:13px;font-weight:700}
.support-contact-status.is-loading{color:#52606d}.support-contact-status.is-success{color:#176b31}.support-contact-status.is-error{color:#a81515}
.support-honeypot{position:absolute!important;left:-10000px!important;width:1px!important;height:1px!important;opacity:0!important}
body.dark .seo-public-content,html[data-theme="dark"] .seo-public-content{background:rgba(43,49,56,.96);border-color:#59636d;color:#fff}
body.dark .seo-public-content p,html[data-theme="dark"] .seo-public-content p{color:#d1d7dd}
body.dark .seo-public-features span,html[data-theme="dark"] .seo-public-features span,body.dark .support-contact-chip{background:#30363d;border-color:#59636d;color:#fff}
@media(max-width:700px){.seo-public-content{padding:15px}.seo-public-content h1{font-size:20px}.support-contact-summary{grid-template-columns:1fr}.support-contact-form .grid2{grid-template-columns:1fr}}


/* v7.9.21 — стабилизиран общ дизайн на публичните форми */
body.login-page{
  min-height:100vh;
  background:linear-gradient(180deg,#d9dde2 0%,#d1d6dc 100%);
}
.login-page{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px 10px;
}
.login-shell.login-shell-unified{
  width:min(440px,calc(100vw - 20px));
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid #b6bec6;
  border-radius:9px;
  background:#edf1f4;
  box-shadow:0 12px 30px rgba(22,34,46,.13);
}
.login-shell.login-shell-unified .login-box{
  width:100%;
  max-width:none;
  box-sizing:border-box;
  padding:12px 12px 10px;
  border:0;
  box-shadow:none;
  background:transparent;
}
.login-shell.login-shell-unified .login-title{
  margin:0 0 8px;
  padding:0 0 7px;
  border:0;
  border-bottom:1px solid #cbd3db;
  background:transparent;
  text-align:center;
  font-size:16px;
  font-weight:800;
  color:#243445;
}
.login-shell.login-shell-unified .login-logo{
  width:100%;
  margin:0 0 9px;
  padding:0;
  overflow:hidden;
  border:1px solid #d2d9e0;
  border-radius:7px;
  background:#fff;
  line-height:0;
}
.login-shell.login-shell-unified .login-logo img{
  display:block;
  width:100%;
  height:auto;
  max-height:132px;
  object-fit:contain;
  object-position:center;
  margin:0 auto;
  transform:none;
}
.login-shell.login-shell-unified .login-row{
  display:grid;
  grid-template-columns:1fr;
  gap:3px;
  margin-bottom:7px;
}
.login-shell.login-shell-unified .login-row label{
  margin:0;
  font-size:12px;
  font-weight:700;
  color:#334455;
}
.login-shell.login-shell-unified .login-row input{
  width:100%;
  height:32px;
  box-sizing:border-box;
  padding:5px 9px;
}
.login-secret-view{
  -webkit-text-security:disc;
  text-security:disc;
  font-family:Arial,sans-serif;
  letter-spacing:1px;
}
.login-shell.login-shell-unified .remember-login{
  display:flex;
  align-items:center;
  gap:7px;
  margin:8px 0 9px;
  font-size:12px;
}
.login-shell.login-shell-unified .remember-login input{width:auto}
.login-shell.login-shell-unified form button{width:100%;height:34px}
.login-shell.login-shell-unified .login-links{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:6px 14px;
  margin-top:8px;
  padding-top:8px;
  border-top:1px solid #ccd4db;
  text-align:center;
}
.login-shell.login-shell-unified .login-links a{font-size:12.5px;line-height:1.25}
.login-shell.login-shell-unified .login-custom-text{
  width:100%;
  box-sizing:border-box;
  margin-top:8px;
  padding:7px 9px;
  text-align:center;
}
.login-shell.login-shell-unified .login-site-pulse{margin-top:7px;text-align:center}
.login-shell.login-shell-unified .seo-public-content{
  width:100%;
  box-sizing:border-box;
  margin:0;
  padding:9px 12px 10px;
  border:0;
  border-top:1px solid #cdd4db;
  border-radius:0;
  background:#f7f9fb;
  box-shadow:none;
  text-align:center;
}
.login-shell.login-shell-unified .seo-public-content h1{
  margin:0 0 4px;
  font-size:12.5px;
  line-height:1.25;
  color:#274d78;
}
.login-shell.login-shell-unified .seo-public-content p{
  margin:0 auto;
  max-width:410px;
  font-size:11.5px;
  line-height:1.38;
  color:#5b6670;
}
.login-shell.login-shell-unified .seo-public-features{display:none}
.autofill-trap{
  position:absolute!important;
  left:-10000px!important;
  top:-10000px!important;
  width:1px!important;
  height:1px!important;
  opacity:0!important;
  pointer-events:none!important;
}
body.dark .login-shell.login-shell-unified{background:#293139;border-color:#5d6771}
body.dark .login-shell.login-shell-unified .login-title{color:#f4f7fa;border-bottom-color:#59636d}
body.dark .login-shell.login-shell-unified .login-row label,body.dark .login-shell.login-shell-unified .remember-login{color:#d6dde5}
body.dark .login-shell.login-shell-unified .seo-public-content{background:#2f363d;border-top-color:#59636d}
body.dark .login-shell.login-shell-unified .seo-public-content h1{color:#e8f2fb}
body.dark .login-shell.login-shell-unified .seo-public-content p{color:#ccd4dc}
@media(max-width:520px){
  .login-page{align-items:flex-start;padding:10px 8px}
  .login-shell.login-shell-unified{width:min(100%,410px)}
  .login-shell.login-shell-unified .login-logo img{max-height:124px}
  .login-shell.login-shell-unified .login-links{flex-direction:column;gap:6px}
}

/* v7.9.17 — глобално оцветяване на активното поле */
body{
  --active-field-color:#fff2a8;
}
body :is(
  input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="file"]):not([type="color"]):not([type="range"]),
  select,
  textarea,
  [contenteditable="true"]
):focus{
  outline:none!important;
  border-color:color-mix(in srgb,var(--active-field-color) 68%,#68717b)!important;
  background-color:var(--active-field-color)!important;
  box-shadow:0 0 0 3px color-mix(in srgb,var(--active-field-color) 55%,transparent)!important;
  transition:border-color .12s ease,background-color .12s ease,box-shadow .12s ease!important;
}
body.dark :is(
  input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="file"]):not([type="color"]):not([type="range"]),
  select,
  textarea,
  [contenteditable="true"]
):focus{
  color:#111!important;
  background-color:var(--active-field-color)!important;
}
.active-field-color-setting{grid-column:span 2}
.active-field-color-control{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.active-field-color-control input[type="color"]{width:54px!important;height:34px!important;padding:2px!important;cursor:pointer}
.active-field-color-control span{min-width:76px;padding:7px 9px;border:1px solid var(--line);border-radius:4px;background:#fff;font-family:monospace;text-align:center}
.active-field-preview{margin-top:10px;max-width:360px}
.active-field-preview input{cursor:default}
body.dark .active-field-color-control span{background:#30363d;color:#fff;border-color:#626d78}
@media(max-width:760px){.active-field-color-setting{grid-column:1/-1}.active-field-color-control{align-items:stretch}.active-field-color-control .btn,.active-field-color-control button{flex:1}}

.active-field-preview input{
  cursor:default;
  text-align:left;
}


/* v7.9.23 — поле „Вид“ със същия дизайн като „Контрагент“ */
.document-type-field{min-width:0}
.document-type-combobox{position:relative}
.document-type-combobox #documentTypeSearch{
  width:100%;
  height:31px;
  padding:5px 34px 5px 8px;
  border:1px solid var(--line);
  border-radius:3px;
  background:#fff;
  color:#222;
  cursor:pointer;
  box-sizing:border-box;
}
.document-type-combobox::after{
  content:"";
  position:absolute;
  right:11px;
  top:12px;
  width:0;
  height:0;
  border-left:5px solid transparent;
  border-right:5px solid transparent;
  border-top:6px solid #53616e;
  pointer-events:none;
}
.document-type-native{position:absolute!important;left:-9999px!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}
.document-type-results{
  position:absolute;
  z-index:1200;
  left:0;
  right:0;
  top:calc(100% + 2px);
  max-height:280px;
  overflow:auto;
  background:#fff;
  border:1px solid #9da9b5;
  box-shadow:0 6px 18px rgba(0,0,0,.18);
  padding:2px;
}
.document-type-results[hidden]{display:none!important}
.document-type-option{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  min-height:28px;
  padding:6px 8px;
  border:0;
  border-bottom:1px solid #e0e4e8;
  border-radius:0;
  background:#fff;
  color:#1f2b36;
  box-shadow:none;
  text-align:left;
  font-weight:400;
}
.document-type-option:last-child{border-bottom:0}
.document-type-option:hover,.document-type-option.active{background:#edf3f8;color:#162536}
body.dark .document-type-combobox #documentTypeSearch{background:#30363d;color:#fff;border-color:#626d78}
body.dark .document-type-combobox::after{border-top-color:#dbe3ea}
body.dark .document-type-results{background:#2f353b;border-color:#65717c}
body.dark .document-type-option{background:#2f353b;color:#fff;border-bottom-color:#48515a}
body.dark .document-type-option:hover,body.dark .document-type-option.active{background:#3b4650}
body.red-theme .document-type-combobox #documentTypeSearch{background:#fffafa;color:#5a2020;border-color:#d7aaaa}
body.red-theme .document-type-results{background:#fffafa;border-color:#d7aaaa}
body.red-theme .document-type-option{background:#fffafa;color:#5a2020;border-bottom-color:#efd2d2}
body.red-theme .document-type-option:hover,body.red-theme .document-type-option.active{background:#f9e9e9}


/* v7.9.23 — заключен вид на документа */
.document-type-combobox.document-type-locked{position:relative}
.document-type-combobox.document-type-locked #documentTypeSearch{
  padding-right:38px!important;
  cursor:default!important;
  background:#eef1f4!important;
  color:#263442!important;
  user-select:none!important;
}
.document-type-combobox.document-type-locked::after{display:none!important}
.document-type-lock{
  position:absolute;right:10px;top:50%;transform:translateY(-50%);
  font-size:14px;line-height:1;opacity:.68;pointer-events:none
}
body.dark .document-type-combobox.document-type-locked #documentTypeSearch{background:#30363d!important;color:#fff!important;border-color:#626d78!important}
body.red-theme .document-type-combobox.document-type-locked #documentTypeSearch{background:#fff7f7!important;color:#5a2020!important;border-color:#d7aaaa!important}


/* v8.1.2 — унифициран дизайн на всички стандартни падащи менюта */
.unified-select{position:relative;min-width:0;width:100%}
.unified-select-input{
  width:100%!important;
  height:31px!important;
  padding:5px 34px 5px 8px!important;
  border:1px solid var(--line)!important;
  border-radius:3px!important;
  background:#fff!important;
  color:#222!important;
  cursor:pointer!important;
  box-sizing:border-box!important;
}
.unified-select::after{
  content:"";
  position:absolute;
  right:11px;
  top:12px;
  width:0;
  height:0;
  border-left:5px solid transparent;
  border-right:5px solid transparent;
  border-top:6px solid #53616e;
  pointer-events:none;
  transition:transform .12s ease;
}
.unified-select.is-open::after{transform:rotate(180deg)}
.unified-select-native{
  position:absolute!important;
  left:-9999px!important;
  width:1px!important;
  height:1px!important;
  opacity:0!important;
  pointer-events:none!important;
}
.unified-select-results{z-index:1400;max-height:280px}
.unified-select-option{min-height:29px}
.unified-select-option.active,
.unified-select-option.keyboard-active{background:#e8eef4!important;outline:none!important}
.unified-select-option:disabled{opacity:.48;cursor:not-allowed}
.unified-select-group{
  padding:6px 9px 4px;
  color:#63707c;
  background:#f1f4f6;
  border-bottom:1px solid #dbe1e6;
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
}
.unified-select-empty{padding:8px 10px;color:#66727e;background:#fff;font-size:.95em}
.unified-select-value{max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.unified-select.is-disabled .unified-select-input{
  background:#eef1f4!important;
  color:#6d7780!important;
  cursor:not-allowed!important;
}
.unified-select.is-disabled::after{opacity:.45}
body.dark .unified-select-input{background:#30363d!important;color:#fff!important;border-color:#626d78!important}
body.dark .unified-select::after{border-top-color:#dbe3ea}
body.dark .unified-select-results{background:#2f353b;border-color:#65717c}
body.dark .unified-select-option{background:#2f353b;color:#fff;border-color:#48525b}
body.dark .unified-select-option:hover,
body.dark .unified-select-option:focus,
body.dark .unified-select-option.active,
body.dark .unified-select-option.keyboard-active{background:#46515b!important}
body.dark .unified-select-group{background:#252b31;color:#c9d1d8;border-color:#48525b}
body.dark .unified-select-empty{background:#2f353b;color:#cbd3da}
body.dark .unified-select.is-disabled .unified-select-input{background:#272d33!important;color:#8f9aa4!important}
body.red-theme .unified-select-input{background:#fffafa!important;color:#5a2020!important;border-color:#d7aaaa!important}
body.red-theme .unified-select-results{background:#fffafa;border-color:#d7aaaa}
body.red-theme .unified-select-option{background:#fffafa;color:#5a2020;border-color:#efd2d2}
body.red-theme .unified-select-option:hover,
body.red-theme .unified-select-option:focus,
body.red-theme .unified-select-option.active,
body.red-theme .unified-select-option.keyboard-active{background:#f9e9e9!important}
body.red-theme .unified-select-group{background:#fff0f0;color:#7a3b3b;border-color:#efd2d2}
@media(max-width:760px){
  .unified-select-results{max-height:min(280px,45vh)}
  .unified-select-option{padding:8px 9px;min-height:36px}
}


/* v8.1.2 — надеждно фирмено меню и обновен прозорец за клиентско обслужване */
.company-switcher{overflow:visible!important;position:relative;z-index:80}
.company-menu{position:relative;width:100%;min-width:0;height:100%}
.company-menu-trigger{display:flex;align-items:center;width:100%;height:100%;min-height:32px;margin:0;padding:0 34px 0 10px;border:0;background:transparent;color:inherit;font:inherit;font-weight:700;text-align:left;cursor:pointer;box-shadow:none}
.company-menu-trigger:hover,.company-menu-trigger:focus-visible{background:rgba(72,105,137,.09);outline:none}
.company-menu-current{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.company-menu-chevron{position:absolute;right:12px;top:50%;width:8px;height:8px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:translateY(-68%) rotate(45deg);transition:transform .15s ease;pointer-events:none}
.company-menu.is-open .company-menu-chevron{transform:translateY(-30%) rotate(225deg)}
.company-menu-list{position:absolute;left:0;top:calc(100% + 7px);z-index:10020;width:max(100%,310px);max-width:min(430px,calc(100vw - 58px));max-height:320px;overflow:auto;padding:6px;background:var(--card);border:1px solid var(--line);border-radius:8px;box-shadow:0 16px 40px rgba(20,31,42,.24)}
.company-menu-list[hidden]{display:none!important}
.company-menu-option{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 28px;width:100%;padding:10px 38px 10px 11px;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--text);text-align:left;cursor:pointer;box-shadow:none}
.company-menu-option:hover,.company-menu-option:focus-visible{background:#eef4fa;border-color:#cad8e5;outline:none}
.company-menu-option.is-active{background:#e8f1fa;border-color:#b8cee2}
.company-menu-option-name{grid-column:1;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.company-menu-option-meta{grid-column:1;font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.company-menu-check{position:absolute;right:12px;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:#2f74ad;color:#fff;font-weight:900}
body.dark .company-menu-option:hover,body.dark .company-menu-option:focus-visible{background:#39434c;border-color:#5a6874}
body.dark .company-menu-option.is-active{background:#33495b;border-color:#547895}
@media(max-width:760px){.company-menu-list{width:min(360px,calc(100vw - 58px));max-width:calc(100vw - 58px)}}

.support-contact-dialog{width:min(680px,calc(100vw - 28px));border-radius:14px;overflow:hidden}
.support-info-head{padding:17px 20px;background:linear-gradient(135deg,#f8fbfe,#e8f1f8);border-bottom:1px solid #cbd7e2}
.support-info-heading{display:flex;align-items:center;gap:12px;min-width:0}
.support-info-heading-icon{flex:0 0 38px;height:38px;display:grid;place-items:center;border-radius:10px;background:#2f74ad;color:#fff;font-size:22px;font-weight:900;box-shadow:0 5px 14px rgba(47,116,173,.25)}
.support-info-heading h2{font-size:20px;line-height:1.15}
.support-info-heading p{margin:4px 0 0;color:#647483;font-size:13px;line-height:1.35}
.support-info-x{border-radius:8px}.support-info-x:hover{background:rgba(34,63,88,.08)}
.support-info-body{padding:18px 20px 20px;gap:10px;background:linear-gradient(180deg,#fff,#fbfcfd)}
.support-section-title{margin:1px 0 2px;font-size:12px;font-weight:900;letter-spacing:.06em;text-transform:uppercase;color:#647483}
.support-form-title{margin-top:7px;padding-top:14px;border-top:1px solid #dce3e9}
.support-contact-summary{gap:10px;margin-bottom:4px}
.support-contact-chip{position:relative;display:grid;grid-template-columns:32px minmax(0,1fr);grid-template-rows:auto auto;column-gap:9px;padding:11px 12px;border-radius:8px;background:#f7fafc;border-color:#d4dee7}
.support-chip-icon{grid-row:1/3;display:grid;place-items:center;width:30px;height:30px;border-radius:8px;background:#e5eff8;color:#2f6f9f;font-size:16px}
.support-contact-chip strong{grid-column:2;font-size:10px;letter-spacing:.05em;color:#6b7884}
.support-contact-chip span:not(.support-chip-icon){grid-column:2;font-size:13px;line-height:1.25}
.support-info-text{margin:4px 0 2px;padding:13px 14px;border-left:0;border:1px solid #d7e2ec;border-radius:8px;background:#f5f9fd;line-height:1.55;color:#354452}
.support-contact-form{gap:11px;margin-top:0;padding:0}
.support-contact-form input,.support-contact-form textarea{border-radius:7px;background:#fff}
.support-contact-form textarea{min-height:108px;resize:vertical}
.support-info-actions{margin-top:2px;padding:13px 0 0;border-top:1px solid #dce3e9;gap:8px}
.support-info-actions button{min-width:122px;border-radius:7px}
body.dark .support-info-head{background:linear-gradient(135deg,#303943,#252d34);border-bottom-color:#4c5863}
body.dark .support-info-heading p{color:#bbc5cd}
body.dark .support-info-body{background:#2b3137}
body.dark .support-section-title{color:#b8c2ca}
body.dark .support-contact-chip{background:#303840;border-color:#52606b;color:#fff}
body.dark .support-chip-icon{background:#3b5367;color:#d8ecfb}
body.dark .support-info-text{background:#303a43;border-color:#4e6272;color:#eef3f7}
body.dark .support-form-title,body.dark .support-info-actions{border-color:#4c5863}
@media(max-width:700px){.support-info-head{padding:14px 15px}.support-info-heading-icon{flex-basis:34px;height:34px}.support-info-heading h2{font-size:18px}.support-info-heading p{display:none}.support-info-body{padding:14px 15px 16px}.support-contact-summary{grid-template-columns:1fr}.support-info-actions{display:grid;grid-template-columns:1fr}.support-info-actions button{width:100%;min-width:0}}

/* v8.1.3 — адаптивен изглед при по-ниска резолюция без хоризонтални скролове */
@media (max-width:1366px){
  .main,.sidebar.closed~.main{padding-left:10px!important;padding-right:10px!important}
  .card{padding:11px!important}
  .grid2,.grid3,.grid4{gap:7px!important}
  .topbar{padding-left:12px!important;padding-right:12px!important}
  .table-wrap{overflow-x:hidden!important;max-width:100%!important}
  .table{width:100%!important;table-layout:fixed!important}
  .table th,.table td{white-space:normal!important;overflow-wrap:anywhere!important;font-size:12px!important;padding:5px!important}
  .table input,.table select,.table textarea{min-width:0!important;width:100%!important;max-width:100%!important;box-sizing:border-box!important}

  .invoice-lines-wrap{overflow-x:hidden!important;width:100%!important;max-width:100%!important}
  .invoice-lines{width:100%!important;min-width:0!important;table-layout:fixed!important}
  .invoice-lines th,.invoice-lines td{padding:3px!important;font-size:11px!important}
  .invoice-lines .line-no{width:3.5%!important}
  .invoice-lines .line-name{width:39%!important}
  .invoice-lines .line-qty{width:9%!important}
  .invoice-lines .line-unit{width:8%!important}
  .invoice-lines .line-price{width:10%!important}
  .invoice-lines .line-discount{width:9%!important}
  .invoice-lines .line-vat{width:7.5%!important}
  .invoice-lines .line-total{width:10%!important}
  .invoice-lines .line-actions{width:4%!important}
  .invoice-lines input,.invoice-lines select{min-width:0!important;width:100%!important;max-width:100%!important;height:29px!important;padding:3px 4px!important;box-sizing:border-box!important;font-size:12px!important}
  .line-remove{width:26px!important;height:28px!important;min-width:26px!important}
  .line-product-row{grid-template-columns:1fr!important;min-width:0!important}
  .line-name-cell,.line-product-combobox,.line-description{min-width:0!important;max-width:100%!important}
}

@media (max-width:1100px){
  .grid3,.grid4{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .filterbar{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .invoice-lines th,.invoice-lines td{font-size:10px!important;padding:2px!important}
  .invoice-lines input,.invoice-lines select{font-size:11px!important;padding:2px 3px!important}
  .invoice-lines .line-name{width:37%!important}
  .invoice-lines .line-qty{width:9%!important}
  .invoice-lines .line-unit{width:8%!important}
  .invoice-lines .line-price{width:10%!important}
  .invoice-lines .line-discount{width:10%!important}
  .invoice-lines .line-vat{width:8%!important}
  .invoice-lines .line-total{width:10%!important}
  .invoice-lines .line-actions{width:4.5%!important}
}

@media (max-width:760px){
  .table-wrap{overflow-x:hidden!important}
  .table-wrap>.table{width:100%!important;min-width:0!important;max-width:100%!important;table-layout:fixed!important}
  .table th,.table td{white-space:normal!important;overflow-wrap:anywhere!important}
  .invoice-lines-wrap{overflow-x:hidden!important}
  .invoice-lines{min-width:0!important;width:100%!important}
}

/* v8.1.4 — имената на контрагентите се съхраняват и визуализират с главни букви */
#customerName, #newCustomerName { text-transform: uppercase; }

/* BG Фактура 8.2.1 – professional login and safe modal forms */
.login-page-pro{min-height:100vh;margin:0;padding:28px 18px;box-sizing:border-box;background:radial-gradient(circle at 18% 10%,#fff 0,#f6faff 34%,#edf5ff 72%,#e7f0fb 100%);display:flex;align-items:center;justify-content:center;color:#162b45}
.login-pro-shell{width:min(1120px,calc(100vw - 36px));min-height:660px;display:grid;grid-template-columns:minmax(420px,520px) minmax(0,1fr);overflow:hidden;border:1px solid #d8e4f2;border-radius:22px;background:#fff;box-shadow:0 30px 90px rgba(27,65,111,.18)}
.login-pro-panel{padding:42px 48px 30px;display:flex;flex-direction:column;background:rgba(255,255,255,.98)}
.login-pro-brand{text-align:center}.login-pro-brand img{display:block;width:auto;height:auto;max-width:310px;max-height:86px;margin:0 auto 8px;object-fit:contain}.login-pro-brand small{display:block;color:#6d7e92;font-size:13px}.login-pro-fallback{display:flex;align-items:center;justify-content:center;gap:12px;color:#0b57c7;font-size:28px}.login-pro-fallback span{font-size:38px}.login-pro-rule{display:flex;align-items:center;margin:23px 0}.login-pro-rule:before,.login-pro-rule:after{content:"";height:1px;background:#dce6f1;flex:1}.login-pro-rule span{width:56px;height:3px;border-radius:99px;background:#1682f4}.login-pro-panel h1{margin:0 0 22px;text-align:center;font-size:23px;color:#142940}
.login-pro-panel form{display:flex;flex-direction:column;gap:14px}.login-pro-input{position:relative}.login-pro-input span{position:absolute;left:15px;top:50%;transform:translateY(-50%);width:22px;text-align:center;color:#2c72c8;font-weight:800;z-index:1}.login-pro-input input{width:100%;height:52px;box-sizing:border-box;padding:0 16px 0 48px;border:1px solid #cfdbea;border-radius:11px;background:#fbfdff;color:#172b43;font-size:15px;box-shadow:0 3px 10px rgba(45,79,118,.05)}.login-pro-input input:focus{outline:0;border-color:#1682f4;background:#fff;box-shadow:0 0 0 4px rgba(22,130,244,.12)}.login-pro-remember{display:flex;align-items:center;gap:9px;color:#475a70;font-size:13px}.login-pro-remember input{width:17px;height:17px;accent-color:#1477ed}.login-pro-submit{width:100%;min-height:52px;border:0;border-radius:11px;background:linear-gradient(180deg,#1b8aff,#0968df);color:#fff;font-size:16px;font-weight:800;cursor:pointer;box-shadow:0 11px 24px rgba(9,104,223,.24)}.login-pro-submit:hover{background:linear-gradient(180deg,#2b94ff,#075fce);transform:translateY(-1px)}.login-pro-submit:disabled{opacity:.65;cursor:wait;transform:none}.login-pro-separator{display:flex;align-items:center;gap:12px;margin:19px 0;color:#8391a2;font-size:12px}.login-pro-separator:before,.login-pro-separator:after{content:"";height:1px;background:#dce5ef;flex:1}.login-pro-links{display:grid;gap:10px}.login-pro-links button{border:0;background:none;padding:2px 0;text-align:left;color:#1269d4;font:600 13px/1.3 inherit;cursor:pointer}.login-pro-links button:before{content:"›";display:inline-grid;place-items:center;width:17px;height:17px;margin-right:9px;border:1px solid #5b96df;border-radius:50%;font-size:12px}.login-pro-links button:hover{text-decoration:underline}.login-pro-panel footer{margin-top:auto;padding-top:24px;display:flex;flex-direction:column;align-items:center;gap:4px;border-top:1px solid #e2eaf3;color:#718197;font-size:12px}.login-pro-panel footer strong{color:#315070;font-size:14px}.login-pro-panel footer a{color:#176cc9;text-decoration:none}.login-pro-visual{position:relative;display:flex;flex-direction:column;justify-content:space-between;padding:50px 44px 36px;background:linear-gradient(145deg,#f9fcff 0,#edf6ff 54%,#dfeeff 100%);overflow:hidden}.login-pro-visual:before{content:"";position:absolute;inset:auto -12% -12% -12%;height:42%;background:linear-gradient(180deg,rgba(28,133,244,.05),rgba(13,99,215,.18));border-radius:50% 50% 0 0/28% 28% 0 0}.login-pro-visual>div,.login-pro-visual>img,.login-pro-visual>section{position:relative;z-index:1}.login-pro-visual>div>span{font-size:11px;letter-spacing:.14em;color:#1474df;font-weight:900}.login-pro-visual h2{margin:12px 0 12px;font-size:34px;line-height:1.13;color:#102d54}.login-pro-visual p{max-width:560px;margin:0;color:#647991;line-height:1.6}.login-pro-visual img{display:block;width:min(100%,560px);height:auto;margin:18px auto;object-fit:contain;filter:drop-shadow(0 18px 28px rgba(42,91,145,.13))}.login-pro-visual section{display:flex;gap:10px;flex-wrap:wrap}.login-pro-visual section b{padding:9px 12px;border:1px solid #cfe0f3;border-radius:999px;background:rgba(255,255,255,.72);color:#365878;font-size:12px}
.auth-safe-backdrop[hidden]{display:none!important}.auth-safe-backdrop{position:fixed;inset:0;z-index:99999;display:flex;align-items:center;justify-content:center;padding:18px;background:rgba(7,26,54,.58);backdrop-filter:blur(5px)}.auth-safe-modal{position:relative;width:min(600px,100%);max-height:calc(100vh - 36px);overflow:auto;box-sizing:border-box;padding:30px;border:1px solid #d7e4f2;border-radius:20px;background:#fff;box-shadow:0 30px 90px rgba(9,35,75,.28)}.auth-safe-close{position:absolute;right:14px;top:13px;width:38px;height:38px;border:0;border-radius:50%;background:#edf4fb;color:#173b66;font-size:27px;cursor:pointer}.auth-safe-brand{display:flex;flex-direction:column;padding-right:48px;margin-bottom:20px}.auth-safe-brand strong{font-size:23px;color:#0b5ac8}.auth-safe-brand span,.auth-safe-modal>p{color:#6c7d91}.auth-safe-modal h2{margin:0 0 7px;color:#142b48}.auth-safe-modal>p{margin:0 0 20px}.auth-safe-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.auth-safe-field{display:flex;flex-direction:column;gap:6px}.auth-safe-field.full{grid-column:1/-1}.auth-safe-field span{font-size:12px;font-weight:800;color:#304863}.auth-safe-field input{width:100%;min-height:47px;box-sizing:border-box;padding:10px 13px;border:1px solid #cbd8e6;border-radius:10px;background:#fbfdff}.auth-safe-field input:focus{outline:0;border-color:#1682f4;box-shadow:0 0 0 4px rgba(22,130,244,.12)}.auth-safe-modal .login-pro-submit{margin-top:18px}.auth-safe-modal .alert{margin:0 0 16px;border-radius:10px;padding:12px 14px}.auth-modal-open{overflow:hidden}
@media(max-width:900px){.login-page-pro{padding:0}.login-pro-shell{width:100%;min-height:100vh;grid-template-columns:1fr;border:0;border-radius:0}.login-pro-panel{width:min(100%,520px);box-sizing:border-box;margin:auto;padding:34px 28px}.login-pro-visual{display:none}}
@media(max-width:620px){.login-pro-panel{padding:28px 20px}.login-pro-brand img{max-width:260px}.auth-safe-modal{padding:24px 18px;border-radius:15px}.auth-safe-grid{grid-template-columns:1fr}.auth-safe-field.full{grid-column:auto}}

/* BG Фактура 8.2.2 – compact professional login */
.login-page-pro{padding:14px 16px;overflow:hidden}
.login-pro-shell{width:min(940px,calc(100vw - 32px));min-height:0;height:min(700px,calc(100vh - 28px));grid-template-columns:minmax(360px,430px) minmax(0,1fr);border-radius:18px}
.login-pro-panel{padding:22px 34px 20px;min-height:0;overflow:auto}
.login-pro-brand img{max-width:250px;max-height:62px;margin-bottom:4px}
.login-pro-brand small{font-size:12px}
.login-pro-rule{margin:14px 0}
.login-pro-panel h1{margin-bottom:15px;font-size:21px}
.login-pro-panel form{gap:10px}
.login-pro-input input{height:44px;font-size:14px}
.login-pro-remember{font-size:12px}
.login-pro-submit{min-height:44px;font-size:15px}
.login-pro-separator{margin:12px 0}
.login-pro-links{gap:7px}
.login-pro-links button{font-size:12px}
.login-pro-panel footer{padding-top:12px;font-size:11px}
.login-pro-panel footer strong{font-size:13px}
.login-pro-visual{padding:30px 30px 24px}
.login-pro-visual h2{margin:8px 0 8px;font-size:27px}
.login-pro-visual p{font-size:13px;line-height:1.45}
.login-pro-visual img{width:min(100%,430px);max-height:420px;margin:10px auto;object-fit:contain}
.login-pro-visual section{gap:7px}
.login-pro-visual section b{padding:7px 10px;font-size:11px}
@media(max-height:760px) and (min-width:901px){
  .login-pro-shell{height:calc(100vh - 20px)}
  .login-page-pro{padding:10px 14px}
  .login-pro-panel{padding:18px 30px 16px}
  .login-pro-brand img{max-height:54px}
  .login-pro-rule{margin:10px 0}
  .login-pro-panel h1{margin-bottom:12px;font-size:19px}
  .login-pro-input input{height:40px}
  .login-pro-submit{min-height:40px}
  .login-pro-separator{margin:9px 0}
  .login-pro-links{gap:5px}
  .login-pro-panel footer{padding-top:8px}
  .login-pro-visual{padding:24px 28px 18px}
  .login-pro-visual h2{font-size:24px}
  .login-pro-visual img{max-height:360px;margin:6px auto}
}
@media(max-width:900px){
  .login-page-pro{overflow:auto;padding:0}
  .login-pro-shell{width:100%;height:auto;min-height:100vh}
  .login-pro-panel{overflow:visible;padding:28px 22px}
}

/* 8.2.3: login links aligned left and email confirmation in modal */
.login-pro-links{align-items:stretch!important;text-align:left!important}
.login-pro-links button{width:100%!important;text-align:left!important;justify-content:flex-start!important;padding-left:30px!important}
.auth-confirm-close{width:100%;margin-top:14px}

/* 8.2.4: блокиране на предложенията за запомнени профили в публичните модални форми */
.auth-safe-field input[data-real-name]{autocomplete:off}
.auth-safe-field .auth-safe-secret{-webkit-text-security:disc;text-security:disc}

/* BG Фактура 8.2.5 – branded login background */
.login-page-pro{
  position:relative;
  isolation:isolate;
  background:
    radial-gradient(circle at 14% 18%,rgba(255,255,255,.98) 0 7%,rgba(255,255,255,0) 28%),
    radial-gradient(circle at 86% 14%,rgba(90,174,255,.20) 0 10%,rgba(90,174,255,0) 36%),
    linear-gradient(135deg,#edf6ff 0%,#f8fbff 38%,#e8f3ff 68%,#dcecff 100%)!important;
}
.login-page-pro:before,
.login-page-pro:after{
  content:"";
  position:fixed;
  left:-8vw;
  right:-8vw;
  z-index:-1;
  pointer-events:none;
}
.login-page-pro:before{
  bottom:-20vh;
  height:48vh;
  border-radius:50% 50% 0 0/34% 34% 0 0;
  background:
    linear-gradient(180deg,rgba(34,146,255,.10),rgba(23,114,223,.28)),
    linear-gradient(90deg,rgba(16,92,190,.06),rgba(49,159,255,.22),rgba(15,87,180,.10));
  transform:rotate(-2deg);
  box-shadow:0 -28px 80px rgba(36,112,196,.10);
}
.login-page-pro:after{
  top:0;
  height:100%;
  opacity:.55;
  background-image:
    radial-gradient(circle,rgba(37,119,207,.20) 1.2px,transparent 1.2px),
    linear-gradient(120deg,transparent 0 72%,rgba(255,255,255,.52) 72% 72.4%,transparent 72.4%);
  background-size:28px 28px,100% 100%;
  background-position:calc(100% - 54px) 44px,0 0;
  mask-image:linear-gradient(90deg,transparent 0 55%,#000 78%,transparent 100%);
  -webkit-mask-image:linear-gradient(90deg,transparent 0 55%,#000 78%,transparent 100%);
}
.login-pro-shell{
  box-shadow:0 26px 70px rgba(29,83,145,.20),0 2px 10px rgba(23,75,130,.08)!important;
}
@media(max-width:900px){
  .login-page-pro:before{bottom:-12vh;height:34vh}
  .login-page-pro:after{opacity:.32;background-size:34px 34px}
}


/* v8.3.1 — Професионална синя тема, визуално свързана с login страницата */
body.blue-pro-theme{--blue-pro:#1677ea;--blue-pro-dark:#0d4f9f;--blue-pro-border:#c9ddef;--blue-pro-text:#12365e;--blue-pro-muted:#607a96;background:linear-gradient(135deg,#f8fbff 0%,#edf6ff 46%,#dceeff 100%);color:#163a60}
body.blue-pro-theme::before{content:"";position:fixed;inset:0;z-index:-2;pointer-events:none;background:radial-gradient(circle at 78% 12%,rgba(91,171,255,.18),transparent 30%),radial-gradient(circle at 14% 82%,rgba(49,143,239,.13),transparent 34%),linear-gradient(145deg,transparent 0 68%,rgba(113,183,249,.12) 68% 69%,transparent 69% 100%)}
body.blue-pro-theme .rail{background:rgba(242,248,255,.96);border-right:1px solid #bfd5e8;box-shadow:4px 0 18px rgba(43,101,153,.08)}
body.blue-pro-theme .rail-btn{background:#fff;border-color:#bfd3e6;color:#185a9d;box-shadow:0 2px 7px rgba(29,92,151,.08)}
body.blue-pro-theme .rail-btn:hover,body.blue-pro-theme .rail-btn.active{background:#e5f2ff;border-color:#72ace2;color:#0d5eb3;transform:translateY(-1px)}
body.blue-pro-theme .sidebar{background:rgba(249,252,255,.97);border-right:1px solid #c6d9ea;color:#173e65;box-shadow:8px 0 24px rgba(49,97,139,.08)}
body.blue-pro-theme .sidebar h3,body.blue-pro-theme .sidebar strong{color:#113b67}
body.blue-pro-theme .menu-btn{background:#fff;border-color:#c8daeb;color:#174a7a;border-radius:9px;box-shadow:0 3px 10px rgba(44,94,139,.06)}
body.blue-pro-theme .menu-btn:hover,body.blue-pro-theme .menu-btn.active{background:#e8f4ff;border-color:#7fb4e5;color:#0b60b7}
body.blue-pro-theme .workspace-head{background:rgba(247,251,255,.92)!important;border-bottom:1px solid #c7dced!important;box-shadow:0 5px 18px rgba(44,95,142,.08);backdrop-filter:blur(10px)}
body.blue-pro-theme .company-switcher,body.blue-pro-theme .company-switcher select,body.blue-pro-theme .company-switch-select{background:#fff!important;color:#133c65!important;border-color:#bfd5e8!important;border-radius:9px!important}
body.blue-pro-theme .workspace-tab{background:#eaf4fd;border-color:#b9d1e6;color:#244b70;border-radius:8px 8px 0 0}
body.blue-pro-theme .workspace-tab.active{background:#fff;color:#0f4e8c;box-shadow:0 -3px 10px rgba(36,95,148,.08)}
body.blue-pro-theme .workspace-tab-close{color:#5e7891}
body.blue-pro-theme .workspace-tab-close:hover{background:#d6eaff;color:#075dab}
body.blue-pro-theme .topbar{background:linear-gradient(135deg,#0f67c8,#1987ee);color:#fff;box-shadow:0 5px 18px rgba(15,93,175,.18)}
body.blue-pro-theme .main{background:transparent}
body.blue-pro-theme .card,body.blue-pro-theme .stat,body.blue-pro-theme .filterbar,body.blue-pro-theme .modal-card,body.blue-pro-theme .dialog-card{background:rgba(255,255,255,.94);border-color:#c9ddef;color:#173c62;box-shadow:0 12px 30px rgba(38,91,140,.10);border-radius:12px}
body.blue-pro-theme .card h1,body.blue-pro-theme .card h2,body.blue-pro-theme .card h3{color:#123f70}
body.blue-pro-theme input,body.blue-pro-theme select,body.blue-pro-theme textarea{background:#fbfdff;color:#173b60;border-color:#bdd3e7;border-radius:8px}
body.blue-pro-theme input:focus,body.blue-pro-theme select:focus,body.blue-pro-theme textarea:focus{border-color:#318de5!important;box-shadow:0 0 0 3px rgba(49,141,229,.14)!important;background:#fff}
body.blue-pro-theme button,body.blue-pro-theme .btn{background:linear-gradient(180deg,#278df2,#0872dc);border-color:#0766c4;color:#fff;border-radius:8px;box-shadow:0 5px 13px rgba(15,103,192,.18)}
body.blue-pro-theme button:hover,body.blue-pro-theme .btn:hover{filter:brightness(1.04);transform:translateY(-1px)}
body.blue-pro-theme button.light,body.blue-pro-theme .btn.light{background:#edf6ff;color:#155794;border-color:#b9d3e9;box-shadow:none}
body.blue-pro-theme button.success,body.blue-pro-theme .btn.success{background:linear-gradient(180deg,#2295ef,#0871d7);border-color:#0864bd}
body.blue-pro-theme table{background:#fff;border-color:#cbddec}
body.blue-pro-theme th{background:#eaf4fd;color:#174d7e;border-color:#c4d8e9}
body.blue-pro-theme td{border-color:#d8e5f0}
body.blue-pro-theme tr:hover td{background:#f1f8ff}
body.blue-pro-theme .empty-workspace.workspace-designed{background:linear-gradient(180deg,#f8fbff 0%,#eef7ff 52%,#e3f1fd 100%)}
body.blue-pro-theme .workspace-designed .workspace-background-layer{opacity:.38;filter:saturate(.72) hue-rotate(4deg)}
body.blue-pro-theme .workspace-designed .workspace-hero-card{background:rgba(255,255,255,.87);border-color:rgba(169,199,225,.8);box-shadow:0 22px 55px rgba(26,89,148,.17);backdrop-filter:blur(10px)}
body.blue-pro-theme .alert.ok{background:#e8f5ff;border-color:#80bce9;color:#14527e}
body.blue-pro-theme .alert.err{background:#fff1f1;border-color:#e4abab;color:#8a2c2c}
body.blue-pro-theme .modal-backdrop{background:rgba(17,55,91,.34);backdrop-filter:blur(3px)}
body.blue-pro-theme .personal-setting-field small,body.blue-pro-theme .muted{color:#657f98}
body.blue-pro-theme .ui-icon svg{stroke:currentColor}
@media(max-width:900px){body.blue-pro-theme .sidebar{box-shadow:10px 0 28px rgba(28,79,126,.18)}body.blue-pro-theme .card{border-radius:10px}}

/* v8.3.2 — refined Professional Blue theme: clean, restrained and login-consistent */
body.blue-pro-theme{
  background:
    radial-gradient(circle at 82% 10%,rgba(80,164,248,.16),transparent 30%),
    radial-gradient(circle at 12% 88%,rgba(56,145,232,.10),transparent 34%),
    linear-gradient(135deg,#f8fbff 0%,#eef6ff 55%,#e4f1fd 100%)!important;
}
body.blue-pro-theme .workspace-head{
  background:transparent!important;
  border-bottom:0!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
}
body.blue-pro-theme .company-switcher{
  background:rgba(255,255,255,.96)!important;
  border:1px solid #c7daec!important;
  border-radius:9px!important;
  box-shadow:0 5px 16px rgba(34,88,140,.10)!important;
  color:#153f69!important;
}
body.blue-pro-theme .company-menu-trigger{
  background:transparent!important;
  border:0!important;
  color:#153f69!important;
  box-shadow:none!important;
  border-radius:8px!important;
  transform:none!important;
  filter:none!important;
}
body.blue-pro-theme .company-menu-trigger:hover,
body.blue-pro-theme .company-menu-trigger:focus-visible{
  background:#edf6ff!important;
  color:#0c5fae!important;
}
body.blue-pro-theme .company-menu-list{
  padding:7px!important;
  background:#fff!important;
  border:1px solid #c8daea!important;
  border-radius:11px!important;
  box-shadow:0 18px 42px rgba(24,69,111,.20)!important;
}
body.blue-pro-theme .company-menu-option{
  background:#fff!important;
  color:#173d63!important;
  border:1px solid transparent!important;
  border-radius:8px!important;
  box-shadow:none!important;
  transform:none!important;
  filter:none!important;
}
body.blue-pro-theme .company-menu-option:hover,
body.blue-pro-theme .company-menu-option:focus-visible{
  background:#f1f7fd!important;
  border-color:#c9dced!important;
}
body.blue-pro-theme .company-menu-option.is-active{
  background:#e8f3fd!important;
  border-color:#a9c9e6!important;
}
body.blue-pro-theme .company-menu-option-name{color:#173d63!important}
body.blue-pro-theme .company-menu-option-meta{color:#6b8198!important}
body.blue-pro-theme .company-menu-check{
  background:#247fcf!important;
  color:#fff!important;
  box-shadow:none!important;
}
body.blue-pro-theme .rail{
  background:rgba(249,252,255,.96)!important;
  border-right-color:#cbdceb!important;
  box-shadow:3px 0 14px rgba(38,84,126,.07)!important;
}
body.blue-pro-theme .rail-btn{
  background:#fff!important;
  color:#285f91!important;
  border-color:#c5d8e8!important;
  box-shadow:0 2px 6px rgba(34,80,122,.07)!important;
  transform:none!important;
}
body.blue-pro-theme .rail-btn:hover,
body.blue-pro-theme .rail-btn.active{
  background:#eaf4fd!important;
  color:#0b67bb!important;
  border-color:#8ab8df!important;
}
body.blue-pro-theme .empty-workspace.workspace-designed{
  background:linear-gradient(180deg,rgba(248,252,255,.90),rgba(229,242,253,.78))!important;
}
body.blue-pro-theme .workspace-designed .workspace-background-layer{
  opacity:.62!important;
  filter:saturate(.82) brightness(1.03)!important;
}
body.blue-pro-theme .workspace-designed .workspace-hero-card{
  background:rgba(255,255,255,.92)!important;
  border:1px solid rgba(181,206,228,.86)!important;
  box-shadow:0 18px 45px rgba(28,78,126,.14)!important;
}
body.blue-pro-theme .bottom{
  background:rgba(239,246,252,.96)!important;
  color:#36536f!important;
  border-top-color:#c3d6e6!important;
}


/* v8.3.3 — видими бутони за затваряне на табовете, без премахване на синята тема */
.workspace-tab-close,
.tab-close{
  width:22px!important;
  height:22px!important;
  min-width:22px!important;
  padding:0!important;
  display:inline-grid!important;
  place-items:center!important;
  border:1px solid rgba(29,82,145,.30)!important;
  border-radius:5px!important;
  background:#ffffff!important;
  color:#1769c9!important;
  font-size:17px!important;
  font-weight:700!important;
  line-height:1!important;
  box-shadow:0 1px 2px rgba(0,0,0,.08)!important;
  opacity:1!important;
  visibility:visible!important;
}
.workspace-tab-close:hover,
.tab-close:hover{
  background:#d93025!important;
  border-color:#c5221f!important;
  color:#fff!important;
  filter:none!important;
}
body.dark .workspace-tab-close,
body.dark .tab-close{
  background:#eef4fb!important;
  border-color:#5c738f!important;
  color:#1769c9!important;
}
body.dark .workspace-tab-close:hover,
body.dark .tab-close:hover,
body.blue-pro-theme .workspace-tab-close:hover,
body.blue-pro-theme .tab-close:hover{
  background:#d93025!important;
  border-color:#c5221f!important;
  color:#fff!important;
}
body.blue-pro-theme .workspace-tab-close,
body.blue-pro-theme .tab-close{
  background:rgba(255,255,255,.98)!important;
  border-color:#8eb8e8!important;
  color:#0d66c2!important;
}


/* v8.3.6 — refined hover states for company switcher and top tabs */
body.blue-pro-theme .company-switcher,
body.blue-pro-theme .company-menu-trigger,
body.blue-pro-theme .workspace-tab,
body.blue-pro-theme .page-tab,
body.blue-pro-theme .workspace-tab-title,
body.blue-pro-theme .tab-close,
body.blue-pro-theme .workspace-tab-close{
  transition:background .16s ease,border-color .16s ease,box-shadow .16s ease,color .16s ease,transform .16s ease;
}
body.blue-pro-theme .company-switcher:hover{
  background:#ffffff!important;
  border-color:#9ec3e4!important;
  box-shadow:0 8px 18px rgba(29,86,137,.12)!important;
}
body.blue-pro-theme .company-menu-trigger:hover,
body.blue-pro-theme .company-menu-trigger:focus-visible{
  background:linear-gradient(180deg,#fbfdff 0%,#eef6ff 100%)!important;
  color:#0d5ea9!important;
  box-shadow:inset 0 0 0 1px rgba(162,196,227,.70)!important;
}
body.blue-pro-theme .company-menu-trigger:hover .company-menu-current,
body.blue-pro-theme .company-menu-trigger:focus-visible .company-menu-current{
  color:#0d5ea9!important;
}
body.blue-pro-theme .company-menu-trigger:hover .company-menu-chevron,
body.blue-pro-theme .company-menu-trigger:focus-visible .company-menu-chevron{
  color:#0d5ea9!important;
}
body.blue-pro-theme .workspace-tab,
body.blue-pro-theme .page-tab{
  background:#eaf4fd!important;
  border-color:#b9d1e6!important;
  color:#244b70!important;
}
body.blue-pro-theme .workspace-tab:hover:not(.active),
body.blue-pro-theme .page-tab:hover{
  background:linear-gradient(180deg,#fafdff 0%,#eef6ff 100%)!important;
  border-color:#9fc4e4!important;
  color:#0f568f!important;
  box-shadow:0 6px 14px rgba(27,84,135,.10)!important;
}
body.blue-pro-theme .workspace-tab.active,
body.blue-pro-theme .page-tab.active{
  background:#ffffff!important;
  border-color:#9fc4e4!important;
  color:#0d4f8e!important;
  box-shadow:0 -2px 10px rgba(27,84,135,.08)!important;
}
body.blue-pro-theme .workspace-tab.active:hover,
body.blue-pro-theme .page-tab.active:hover{
  background:#ffffff!important;
  color:#0d4f8e!important;
}
body.blue-pro-theme .workspace-tab-title,
body.blue-pro-theme .page-tab{
  color:inherit!important;
}
body.blue-pro-theme .workspace-tab:hover .workspace-tab-title,
body.blue-pro-theme .page-tab:hover{
  color:#0f568f!important;
}
body.blue-pro-theme .workspace-tab.active .workspace-tab-title,
body.blue-pro-theme .page-tab.active{
  color:#0d4f8e!important;
}
body.blue-pro-theme .workspace-tab-close,
body.blue-pro-theme .tab-close{
  background:rgba(255,255,255,.94)!important;
  border-color:#9fc1e2!important;
  color:#0d66c2!important;
  box-shadow:0 1px 2px rgba(0,0,0,.06)!important;
}
body.blue-pro-theme .workspace-tab:hover .workspace-tab-close,
body.blue-pro-theme .page-tab:hover .tab-close{
  background:#f3f9ff!important;
  border-color:#89b5dd!important;
  color:#0b5da8!important;
}
body.blue-pro-theme .workspace-tab-close:hover,
body.blue-pro-theme .tab-close:hover{
  background:#d93025!important;
  border-color:#c5221f!important;
  color:#fff!important;
  box-shadow:none!important;
}


/* v8.3.7 — remove unwanted outlines and refine top tabs in Professional Blue theme */
body.blue-pro-theme .company-menu-trigger,
body.blue-pro-theme .company-menu-trigger:hover,
body.blue-pro-theme .company-menu-trigger:focus,
body.blue-pro-theme .company-menu-trigger:focus-visible,
body.blue-pro-theme .workspace-tab-title,
body.blue-pro-theme .workspace-tab-title:hover,
body.blue-pro-theme .workspace-tab-title:focus,
body.blue-pro-theme .workspace-tab-title:focus-visible,
body.blue-pro-theme .workspace-tab-close,
body.blue-pro-theme .workspace-tab-close:hover,
body.blue-pro-theme .workspace-tab-close:focus,
body.blue-pro-theme .workspace-tab-close:focus-visible,
body.blue-pro-theme .tab-close,
body.blue-pro-theme .tab-close:hover,
body.blue-pro-theme .tab-close:focus,
body.blue-pro-theme .tab-close:focus-visible{
  outline:none!important;
  transform:none!important;
  filter:none!important;
  text-decoration:none!important;
}

body.blue-pro-theme .workspace-head{
  height:36px!important;
  gap:6px!important;
  padding:5px 0 0!important;
}
body.blue-pro-theme .workspace-tabs{
  gap:6px!important;
  align-items:flex-end!important;
}

body.blue-pro-theme .company-switcher{
  height:30px!important;
  padding:3px 6px!important;
  border-radius:10px!important;
  box-shadow:0 4px 12px rgba(31,83,131,.08)!important;
}
body.blue-pro-theme .company-switcher:hover{
  background:#fff!important;
  border-color:#bfd5e8!important;
  box-shadow:0 4px 12px rgba(31,83,131,.08)!important;
}
body.blue-pro-theme .company-menu-trigger{
  min-height:22px!important;
  padding:0 32px 0 10px!important;
  border-radius:8px!important;
  box-shadow:none!important;
}
body.blue-pro-theme .company-menu-trigger:hover,
body.blue-pro-theme .company-menu-trigger:focus,
body.blue-pro-theme .company-menu-trigger:focus-visible{
  background:#f4f9ff!important;
  color:#0d5ea9!important;
  box-shadow:none!important;
}
body.blue-pro-theme .company-menu-trigger:focus-visible,
body.blue-pro-theme .workspace-tab-title:focus-visible,
body.blue-pro-theme .workspace-tab-close:focus-visible{
  outline:none!important;
  box-shadow:none!important;
}

body.blue-pro-theme .workspace-tab,
body.blue-pro-theme .page-tab{
  height:30px!important;
  min-width:148px!important;
  max-width:340px!important;
  padding:0!important;
  background:linear-gradient(180deg,#f4f9ff 0%,#e8f2fc 100%)!important;
  border:1px solid #b7cee4!important;
  border-bottom:0!important;
  border-radius:10px 10px 0 0!important;
  color:#315b84!important;
  box-shadow:none!important;
}
body.blue-pro-theme .workspace-tab:hover:not(.active),
body.blue-pro-theme .page-tab:hover:not(.active){
  background:linear-gradient(180deg,#f8fbff 0%,#edf5fd 100%)!important;
  border-color:#a8c6e4!important;
  color:#1f578c!important;
  box-shadow:none!important;
}
body.blue-pro-theme .workspace-tab.active,
body.blue-pro-theme .page-tab.active{
  position:relative!important;
  background:#ffffff!important;
  border-color:#9dbfe0!important;
  color:#0d4f8e!important;
  box-shadow:0 5px 12px rgba(31,83,131,.06)!important;
}
body.blue-pro-theme .workspace-tab.active::after,
body.blue-pro-theme .page-tab.active::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:-1px;
  height:2px;
  background:#ffffff;
}
body.blue-pro-theme .workspace-tab-title{
  padding:6px 4px 6px 10px!important;
  min-width:0!important;
  font-weight:700!important;
  color:inherit!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
body.blue-pro-theme .workspace-tab-title:hover,
body.blue-pro-theme .workspace-tab-title:focus,
body.blue-pro-theme .workspace-tab-title:focus-visible{
  background:transparent!important;
  color:inherit!important;
  box-shadow:none!important;
}
body.blue-pro-theme .workspace-tab-close,
body.blue-pro-theme .tab-close{
  width:20px!important;
  height:20px!important;
  min-width:20px!important;
  margin:0 4px 0 0!important;
  border:0!important;
  border-radius:4px!important;
  background:transparent!important;
  color:#4f7ea8!important;
  box-shadow:none!important;
}
body.blue-pro-theme .workspace-tab:hover .workspace-tab-close,
body.blue-pro-theme .page-tab:hover .tab-close{
  background:#edf5fd!important;
  color:#2b639b!important;
}
body.blue-pro-theme .workspace-tab.active .workspace-tab-close,
body.blue-pro-theme .page-tab.active .tab-close{
  color:#3f6e98!important;
}
body.blue-pro-theme .workspace-tab-close:hover,
body.blue-pro-theme .workspace-tab-close:focus,
body.blue-pro-theme .workspace-tab-close:focus-visible,
body.blue-pro-theme .tab-close:hover,
body.blue-pro-theme .tab-close:focus,
body.blue-pro-theme .tab-close:focus-visible{
  background:#d93025!important;
  color:#fff!important;
  box-shadow:none!important;
}


/* v8.3.8 — final polished top workspace bar for Professional Blue theme */
body.blue-pro-theme .workspace-head{
  min-height:40px!important;
  height:40px!important;
  padding:5px 8px 0!important;
  margin:0 0 4px!important;
  display:flex!important;
  align-items:flex-end!important;
  gap:8px!important;
  background:rgba(247,251,255,.72)!important;
  border-bottom:1px solid rgba(188,211,232,.78)!important;
  box-shadow:0 4px 14px rgba(24,76,124,.05)!important;
  backdrop-filter:blur(8px)!important;
}
body.blue-pro-theme .company-switcher{
  flex:0 0 222px!important;
  min-width:222px!important;
  max-width:320px!important;
  height:32px!important;
  padding:0!important;
  margin:0!important;
  background:linear-gradient(180deg,#ffffff 0%,#f7fbff 100%)!important;
  border:1px solid #b9d2e8!important;
  border-bottom-color:#a8c7e2!important;
  border-radius:9px!important;
  box-shadow:0 3px 10px rgba(33,83,129,.08)!important;
  overflow:visible!important;
}
body.blue-pro-theme .company-switcher:hover{
  background:linear-gradient(180deg,#ffffff 0%,#f2f8fe 100%)!important;
  border-color:#9fc3e1!important;
  box-shadow:0 4px 12px rgba(33,83,129,.10)!important;
}
body.blue-pro-theme .company-menu-trigger{
  width:100%!important;
  height:30px!important;
  min-height:30px!important;
  padding:0 34px 0 12px!important;
  border-radius:8px!important;
  background:transparent!important;
  color:#164a78!important;
  font-size:13px!important;
  font-weight:700!important;
  letter-spacing:0!important;
}
body.blue-pro-theme .company-menu-trigger:hover,
body.blue-pro-theme .company-menu-trigger:focus,
body.blue-pro-theme .company-menu-trigger:focus-visible{
  background:rgba(231,242,252,.68)!important;
  color:#0f5da6!important;
  outline:none!important;
  box-shadow:none!important;
}
body.blue-pro-theme .company-menu-chevron{
  right:12px!important;
  width:7px!important;
  height:7px!important;
  border-width:0 2px 2px 0!important;
  color:#2d6d9f!important;
}
body.blue-pro-theme .workspace-tabs{
  min-width:0!important;
  flex:1 1 auto!important;
  gap:7px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  padding:0 0 0 1px!important;
}
body.blue-pro-theme .workspace-tab,
body.blue-pro-theme .page-tab{
  position:relative!important;
  height:32px!important;
  min-width:140px!important;
  max-width:300px!important;
  display:flex!important;
  align-items:center!important;
  gap:4px!important;
  padding:0 4px 0 0!important;
  margin:0!important;
  background:linear-gradient(180deg,#eef6fd 0%,#e1edf8 100%)!important;
  border:1px solid #b4cde3!important;
  border-bottom-color:#9fbfda!important;
  border-radius:9px 9px 0 0!important;
  color:#315b84!important;
  box-shadow:0 2px 6px rgba(32,82,127,.05)!important;
}
body.blue-pro-theme .workspace-tab:hover:not(.active),
body.blue-pro-theme .page-tab:hover:not(.active){
  background:linear-gradient(180deg,#f8fbff 0%,#ebf4fc 100%)!important;
  border-color:#9fc2e0!important;
  color:#1f588f!important;
  box-shadow:0 4px 10px rgba(32,82,127,.08)!important;
}
body.blue-pro-theme .workspace-tab.active,
body.blue-pro-theme .page-tab.active{
  background:#ffffff!important;
  border-color:#8fb6d8!important;
  border-bottom-color:#ffffff!important;
  color:#0e4d87!important;
  box-shadow:0 -2px 8px rgba(32,82,127,.07)!important;
}
body.blue-pro-theme .workspace-tab.active::before,
body.blue-pro-theme .page-tab.active::before{
  content:"";
  position:absolute;
  left:12px;
  right:12px;
  top:0;
  height:2px;
  border-radius:0 0 2px 2px;
  background:#1e7ed8;
}
body.blue-pro-theme .workspace-tab.active::after,
body.blue-pro-theme .page-tab.active::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:-2px;
  height:3px;
  background:#fff;
}
body.blue-pro-theme .workspace-tab-title{
  flex:1 1 auto!important;
  min-width:0!important;
  height:30px!important;
  padding:0 4px 0 12px!important;
  display:flex!important;
  align-items:center!important;
  border:0!important;
  background:transparent!important;
  color:inherit!important;
  font-size:13px!important;
  font-weight:700!important;
  line-height:1!important;
  text-align:left!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  box-shadow:none!important;
}
body.blue-pro-theme .workspace-tab-title:hover,
body.blue-pro-theme .workspace-tab-title:focus,
body.blue-pro-theme .workspace-tab-title:focus-visible{
  background:transparent!important;
  color:inherit!important;
  outline:none!important;
  box-shadow:none!important;
}
body.blue-pro-theme .workspace-tab-close,
body.blue-pro-theme .tab-close{
  flex:0 0 20px!important;
  width:20px!important;
  height:20px!important;
  min-width:20px!important;
  margin:0 1px 0 0!important;
  padding:0!important;
  display:grid!important;
  place-items:center!important;
  border:0!important;
  border-radius:5px!important;
  background:transparent!important;
  color:#51799d!important;
  font-size:16px!important;
  font-weight:700!important;
  line-height:1!important;
  box-shadow:none!important;
}
body.blue-pro-theme .workspace-tab:hover .workspace-tab-close,
body.blue-pro-theme .page-tab:hover .tab-close{
  background:rgba(221,236,249,.82)!important;
  color:#2f6798!important;
}
body.blue-pro-theme .workspace-tab-close:hover,
body.blue-pro-theme .workspace-tab-close:focus,
body.blue-pro-theme .workspace-tab-close:focus-visible,
body.blue-pro-theme .tab-close:hover,
body.blue-pro-theme .tab-close:focus,
body.blue-pro-theme .tab-close:focus-visible{
  background:#d93025!important;
  color:#fff!important;
  outline:none!important;
  box-shadow:none!important;
}
body.blue-pro-theme .company-menu-list{
  top:calc(100% + 6px)!important;
  min-width:320px!important;
  padding:7px!important;
  border:1px solid #b9d1e5!important;
  border-radius:10px!important;
  background:#fff!important;
  box-shadow:0 16px 38px rgba(24,69,111,.18)!important;
}
body.blue-pro-theme .company-menu-option{
  min-height:52px!important;
  padding:9px 40px 9px 11px!important;
  border-radius:8px!important;
}
body.blue-pro-theme .company-menu-option:hover,
body.blue-pro-theme .company-menu-option:focus-visible{
  background:#f3f8fd!important;
  border-color:#c6d9eb!important;
  outline:none!important;
}
body.blue-pro-theme .company-menu-option.is-active{
  background:#e8f2fb!important;
  border-color:#abc8e2!important;
}
@media(max-width:760px){
  body.blue-pro-theme .workspace-head{height:auto!important;min-height:0!important;padding:6px!important;align-items:stretch!important}
  body.blue-pro-theme .company-switcher{flex:0 0 auto!important;width:min(100%,300px)!important;min-width:0!important}
  body.blue-pro-theme .workspace-tabs{width:100%!important;padding-top:2px!important}
  body.blue-pro-theme .workspace-tab{min-width:132px!important}
}


/* v8.3.9 — personal custom theme builder */
.custom-theme-builder[hidden]{display:none!important}
.custom-theme-builder{grid-column:1/-1;padding:16px;border:1px solid #cbd9e6;border-radius:12px;background:linear-gradient(180deg,#fbfdff,#f3f8fc);box-shadow:0 8px 22px rgba(38,83,123,.08)}
.custom-theme-builder-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:14px}
.custom-theme-builder-head h3{margin:0 0 4px;font-size:16px}
.custom-theme-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.custom-theme-grid label{padding:10px;border:1px solid #d8e2eb;border-radius:9px;background:#fff}
.custom-theme-grid input[type="color"]{height:38px;padding:3px;cursor:pointer}
.custom-theme-grid input[type="text"]{margin-top:6px}
@media(max-width:900px){.custom-theme-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.custom-theme-builder-head{align-items:stretch;flex-direction:column}.custom-theme-grid{grid-template-columns:1fr}.custom-theme-builder-head button{width:100%}}

body.custom-profile-theme{--bg:var(--custom-bg,#eef6ff);--panel:var(--custom-sidebar,#f8fbff);--card:var(--custom-surface,#fff);--text:var(--custom-text,#173b60);--muted:var(--custom-muted,#667f98);--line:var(--custom-border,#bfd5e8);--line2:color-mix(in srgb,var(--custom-border,#bfd5e8) 72%,#fff);--dark:var(--custom-primary-dark,#0d5aa7);--accent:var(--custom-primary,#1677ea);background:linear-gradient(135deg,var(--custom-bg,#eef6ff),color-mix(in srgb,var(--custom-bg,#eef6ff) 82%,#fff));color:var(--custom-text,#173b60)}
body.custom-profile-theme .rail{background:var(--custom-sidebar,#f8fbff)!important;border-right-color:var(--custom-border,#bfd5e8)!important}
body.custom-profile-theme .rail-btn{background:var(--custom-surface,#fff)!important;color:var(--custom-primary-dark,#0d5aa7)!important;border-color:var(--custom-border,#bfd5e8)!important}
body.custom-profile-theme .rail-btn:hover,body.custom-profile-theme .rail-btn.active{background:color-mix(in srgb,var(--custom-primary,#1677ea) 12%,var(--custom-surface,#fff))!important;color:var(--custom-primary-dark,#0d5aa7)!important}
body.custom-profile-theme .sidebar{background:var(--custom-sidebar,#f8fbff)!important;border-right-color:var(--custom-border,#bfd5e8)!important;color:var(--custom-text,#173b60)!important}
body.custom-profile-theme .menu-btn{background:var(--custom-surface,#fff)!important;border-color:var(--custom-border,#bfd5e8)!important;color:var(--custom-text,#173b60)!important}
body.custom-profile-theme .menu-btn:hover,body.custom-profile-theme .menu-btn.active{background:color-mix(in srgb,var(--custom-primary,#1677ea) 12%,var(--custom-surface,#fff))!important;color:var(--custom-primary-dark,#0d5aa7)!important}
body.custom-profile-theme .company-switcher,body.custom-profile-theme .workspace-tab,body.custom-profile-theme .page-tab{background:var(--custom-surface,#fff)!important;border-color:var(--custom-border,#bfd5e8)!important;color:var(--custom-text,#173b60)!important}
body.custom-profile-theme .workspace-tab.active,body.custom-profile-theme .page-tab.active{color:var(--custom-primary-dark,#0d5aa7)!important;border-color:color-mix(in srgb,var(--custom-primary,#1677ea) 55%,var(--custom-border,#bfd5e8))!important}
body.custom-profile-theme .workspace-tab.active::before,body.custom-profile-theme .page-tab.active::before{background:var(--custom-primary,#1677ea)!important}
body.custom-profile-theme .topbar{background:linear-gradient(135deg,var(--custom-primary-dark,#0d5aa7),var(--custom-primary,#1677ea))!important;color:#fff!important}
body.custom-profile-theme .card,body.custom-profile-theme .stat,body.custom-profile-theme .filterbar,body.custom-profile-theme .modal-card,body.custom-profile-theme .dialog-card{background:var(--custom-surface,#fff)!important;border-color:var(--custom-border,#bfd5e8)!important;color:var(--custom-text,#173b60)!important}
body.custom-profile-theme input,body.custom-profile-theme select,body.custom-profile-theme textarea{background:var(--custom-surface,#fff)!important;color:var(--custom-text,#173b60)!important;border-color:var(--custom-border,#bfd5e8)!important}
body.custom-profile-theme input:focus,body.custom-profile-theme select:focus,body.custom-profile-theme textarea:focus{border-color:var(--custom-primary,#1677ea)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--custom-primary,#1677ea) 18%,transparent)!important}
body.custom-profile-theme button,body.custom-profile-theme .btn{background:linear-gradient(180deg,color-mix(in srgb,var(--custom-primary,#1677ea) 88%,#fff),var(--custom-primary,#1677ea))!important;border-color:var(--custom-primary-dark,#0d5aa7)!important;color:#fff!important}
body.custom-profile-theme button.light,body.custom-profile-theme .btn.light{background:color-mix(in srgb,var(--custom-primary,#1677ea) 9%,var(--custom-surface,#fff))!important;color:var(--custom-primary-dark,#0d5aa7)!important;border-color:var(--custom-border,#bfd5e8)!important}
body.custom-profile-theme th{background:color-mix(in srgb,var(--custom-primary,#1677ea) 10%,var(--custom-surface,#fff))!important;color:var(--custom-text,#173b60)!important;border-color:var(--custom-border,#bfd5e8)!important}
body.custom-profile-theme td{border-color:color-mix(in srgb,var(--custom-border,#bfd5e8) 72%,#fff)!important}
body.custom-profile-theme .muted,body.custom-profile-theme small{color:var(--custom-muted,#667f98)}
body.custom-profile-theme .empty-workspace.workspace-designed{background:linear-gradient(180deg,color-mix(in srgb,var(--custom-bg,#eef6ff) 70%,#fff),var(--custom-bg,#eef6ff))!important}
body.custom-profile-theme .bottom{background:color-mix(in srgb,var(--custom-bg,#eef6ff) 82%,#fff)!important;color:var(--custom-text,#173b60)!important;border-top-color:var(--custom-border,#bfd5e8)!important}


/* v8.3.10 — clean dropdown menus in Professional Blue theme across all pages and modules */
body.blue-pro-theme .counterparty-results,
body.blue-pro-theme .unified-select-results,
body.blue-pro-theme .currency-results,
body.blue-pro-theme .document-type-results,
body.blue-pro-theme .product-results{
  background:#ffffff!important;
  border:1px solid #bfd3e6!important;
  border-radius:8px!important;
  box-shadow:0 12px 28px rgba(24,69,111,.18)!important;
  padding:4px!important;
  overflow:auto!important;
}

body.blue-pro-theme .counterparty-option,
body.blue-pro-theme .counterparty-new,
body.blue-pro-theme .unified-select-option,
body.blue-pro-theme .currency-option,
body.blue-pro-theme .document-type-option,
body.blue-pro-theme .product-option{
  width:100%!important;
  min-height:32px!important;
  margin:0!important;
  padding:7px 10px!important;
  border:1px solid transparent!important;
  border-bottom:1px solid #e5edf5!important;
  border-radius:5px!important;
  background:#ffffff!important;
  color:#173d63!important;
  box-shadow:none!important;
  text-shadow:none!important;
  transform:none!important;
  filter:none!important;
  opacity:1!important;
  font-weight:400!important;
}

body.blue-pro-theme .counterparty-option:last-child,
body.blue-pro-theme .counterparty-new:last-child,
body.blue-pro-theme .unified-select-option:last-child,
body.blue-pro-theme .currency-option:last-child,
body.blue-pro-theme .document-type-option:last-child,
body.blue-pro-theme .product-option:last-child{
  border-bottom-color:transparent!important;
}

body.blue-pro-theme .counterparty-option:hover,
body.blue-pro-theme .counterparty-option:focus,
body.blue-pro-theme .counterparty-option:focus-visible,
body.blue-pro-theme .counterparty-new:hover,
body.blue-pro-theme .counterparty-new:focus,
body.blue-pro-theme .counterparty-new:focus-visible,
body.blue-pro-theme .unified-select-option:hover,
body.blue-pro-theme .unified-select-option:focus,
body.blue-pro-theme .unified-select-option:focus-visible,
body.blue-pro-theme .currency-option:hover,
body.blue-pro-theme .currency-option:focus,
body.blue-pro-theme .document-type-option:hover,
body.blue-pro-theme .document-type-option:focus,
body.blue-pro-theme .product-option:hover,
body.blue-pro-theme .product-option:focus{
  background:#eef6ff!important;
  color:#0d5598!important;
  border-color:#c8dced!important;
  box-shadow:none!important;
  outline:none!important;
  transform:none!important;
  filter:none!important;
}

body.blue-pro-theme .unified-select-option.active,
body.blue-pro-theme .unified-select-option.keyboard-active,
body.blue-pro-theme .counterparty-option.active,
body.blue-pro-theme .currency-option.active,
body.blue-pro-theme .document-type-option.active,
body.blue-pro-theme .product-option.active{
  background:#e3f1ff!important;
  color:#0c4f8d!important;
  border-color:#a9c9e6!important;
  font-weight:700!important;
  box-shadow:none!important;
}

body.blue-pro-theme .counterparty-name,
body.blue-pro-theme .unified-select-option .counterparty-name,
body.blue-pro-theme .currency-option .counterparty-name,
body.blue-pro-theme .document-type-option .counterparty-name,
body.blue-pro-theme .product-option .counterparty-name{
  color:inherit!important;
  font-weight:700!important;
}
body.blue-pro-theme .counterparty-eik,
body.blue-pro-theme .unified-select-value,
body.blue-pro-theme .unified-select-option .counterparty-eik,
body.blue-pro-theme .currency-option .counterparty-eik,
body.blue-pro-theme .document-type-option .counterparty-eik,
body.blue-pro-theme .product-option .counterparty-eik{
  color:#6b8198!important;
  font-weight:400!important;
}

body.blue-pro-theme .unified-select-group{
  margin:0!important;
  padding:6px 9px 5px!important;
  background:#f4f8fc!important;
  color:#617991!important;
  border-bottom:1px solid #d9e5ef!important;
  font-size:11px!important;
  font-weight:800!important;
}
body.blue-pro-theme .unified-select-empty,
body.blue-pro-theme .currency-no-result{
  padding:9px 10px!important;
  background:#fff!important;
  color:#6a7f93!important;
}
body.blue-pro-theme .unified-select-input{
  background:#ffffff!important;
  color:#173b60!important;
  border-color:#bdd3e7!important;
  box-shadow:none!important;
}
body.blue-pro-theme .unified-select-input:hover{
  border-color:#9fc0df!important;
}
body.blue-pro-theme .unified-select-input:focus{
  border-color:#318de5!important;
  box-shadow:0 0 0 3px rgba(49,141,229,.12)!important;
}


/* v8.3.11 — hard reset for dropdown option buttons in all themes and modules */
body.blue-pro-theme .unified-select-results button,
body.blue-pro-theme .counterparty-results button,
body.blue-pro-theme .currency-results button,
body.blue-pro-theme .document-type-results button,
body.blue-pro-theme .product-results button,
body.custom-profile-theme .unified-select-results button,
body.custom-profile-theme .counterparty-results button,
body.custom-profile-theme .currency-results button,
body.custom-profile-theme .document-type-results button,
body.custom-profile-theme .product-results button{
  appearance:none!important;
  -webkit-appearance:none!important;
  width:100%!important;
  min-height:32px!important;
  margin:0!important;
  padding:7px 10px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  border:0!important;
  border-bottom:1px solid #e4edf5!important;
  border-radius:0!important;
  background:#fff!important;
  background-image:none!important;
  color:#173d63!important;
  box-shadow:none!important;
  text-shadow:none!important;
  transform:none!important;
  filter:none!important;
  opacity:1!important;
  font-weight:400!important;
  text-align:left!important;
  line-height:1.25!important;
}
body.blue-pro-theme .unified-select-results button:last-child,
body.blue-pro-theme .counterparty-results button:last-child,
body.blue-pro-theme .currency-results button:last-child,
body.blue-pro-theme .document-type-results button:last-child,
body.blue-pro-theme .product-results button:last-child,
body.custom-profile-theme .unified-select-results button:last-child,
body.custom-profile-theme .counterparty-results button:last-child,
body.custom-profile-theme .currency-results button:last-child,
body.custom-profile-theme .document-type-results button:last-child,
body.custom-profile-theme .product-results button:last-child{
  border-bottom:0!important;
}
body.blue-pro-theme .unified-select-results button:hover,
body.blue-pro-theme .unified-select-results button:focus,
body.blue-pro-theme .unified-select-results button:focus-visible,
body.blue-pro-theme .counterparty-results button:hover,
body.blue-pro-theme .counterparty-results button:focus,
body.blue-pro-theme .currency-results button:hover,
body.blue-pro-theme .currency-results button:focus,
body.blue-pro-theme .document-type-results button:hover,
body.blue-pro-theme .document-type-results button:focus,
body.blue-pro-theme .product-results button:hover,
body.blue-pro-theme .product-results button:focus,
body.custom-profile-theme .unified-select-results button:hover,
body.custom-profile-theme .unified-select-results button:focus,
body.custom-profile-theme .counterparty-results button:hover,
body.custom-profile-theme .counterparty-results button:focus,
body.custom-profile-theme .currency-results button:hover,
body.custom-profile-theme .currency-results button:focus,
body.custom-profile-theme .document-type-results button:hover,
body.custom-profile-theme .document-type-results button:focus,
body.custom-profile-theme .product-results button:hover,
body.custom-profile-theme .product-results button:focus{
  background:#eef6ff!important;
  background-image:none!important;
  color:#0d5598!important;
  border-bottom-color:#d3e3f1!important;
  outline:none!important;
  box-shadow:none!important;
  transform:none!important;
  filter:none!important;
}
body.blue-pro-theme .unified-select-results button.active,
body.blue-pro-theme .unified-select-results button.keyboard-active,
body.blue-pro-theme .counterparty-results button.active,
body.blue-pro-theme .currency-results button.active,
body.blue-pro-theme .document-type-results button.active,
body.blue-pro-theme .product-results button.active,
body.custom-profile-theme .unified-select-results button.active,
body.custom-profile-theme .unified-select-results button.keyboard-active,
body.custom-profile-theme .counterparty-results button.active,
body.custom-profile-theme .currency-results button.active,
body.custom-profile-theme .document-type-results button.active,
body.custom-profile-theme .product-results button.active{
  background:#e3f1ff!important;
  background-image:none!important;
  color:#0c4f8d!important;
  font-weight:700!important;
  box-shadow:inset 3px 0 0 #2b82d6!important;
}
body.blue-pro-theme .unified-select-results,
body.blue-pro-theme .counterparty-results,
body.blue-pro-theme .currency-results,
body.blue-pro-theme .document-type-results,
body.blue-pro-theme .product-results,
body.custom-profile-theme .unified-select-results,
body.custom-profile-theme .counterparty-results,
body.custom-profile-theme .currency-results,
body.custom-profile-theme .document-type-results,
body.custom-profile-theme .product-results{
  padding:4px!important;
  background:#fff!important;
  border:1px solid #bfd3e6!important;
  border-radius:8px!important;
  box-shadow:0 12px 28px rgba(24,69,111,.18)!important;
}


/* v8.6.2 — еднаква позиция на избора на фирма при начален екран и отворени модули */
@media (min-width:761px){
  .main:has(> .empty-workspace.workspace-designed) .workspace-head{
    left:14px!important;
    right:14px!important;
    padding-left:8px!important;
    padding-right:8px!important;
  }
}


/* v8.6.3 — абсолютно еднаква хоризонтална позиция на избора на фирма */
@media (min-width:761px){
  /* При модулите .main има 14px вътрешен отстъп. На началния екран
     компенсираме точно със същите 14px, без допълнителен padding. */
  .main:has(> .empty-workspace.workspace-designed) .workspace-head{
    left:14px!important;
    right:14px!important;
    padding-left:0!important;
    padding-right:0!important;
  }
  .main:has(> .empty-workspace.workspace-designed) .company-switcher{
    margin-left:0!important;
  }
  /* Нормалните модулни екрани също без скрит допълнителен отстъп. */
  .main:not(:has(> .empty-workspace.workspace-designed)) .workspace-head{
    padding-left:0!important;
    padding-right:0!important;
  }
}


/* v8.6.4 — еднаква точна позиция на фирмения селектор във всички екрани */
@media (min-width:761px){
  /* Еднаква геометрия на горната работна лента при начален екран и модули. */
  body.blue-pro-theme .workspace-head,
  body.blue-pro-theme .main:has(> .empty-workspace.workspace-designed) .workspace-head,
  body.blue-pro-theme .main:not(:has(> .empty-workspace.workspace-designed)) .workspace-head{
    box-sizing:border-box!important;
    min-height:40px!important;
    height:40px!important;
    padding:5px 8px 0!important;
    margin:0 0 4px!important;
    align-items:flex-end!important;
  }
  /* Началният екран е с абсолютна лента, но без хоризонтална компенсация. */
  body.blue-pro-theme .main:has(> .empty-workspace.workspace-designed) .workspace-head{
    top:0!important;
    left:0!important;
    right:0!important;
  }
  body.blue-pro-theme .company-switcher,
  body.blue-pro-theme .main:has(> .empty-workspace.workspace-designed) .company-switcher,
  body.blue-pro-theme .main:not(:has(> .empty-workspace.workspace-designed)) .company-switcher{
    margin:0!important;
    transform:none!important;
  }
}


/* v8.8.1 — PWA welcome card: fully visible below the top workspace bar */
.workspace-designed .workspace-welcome{
  position:absolute!important;
  top:52px!important;
  left:50%!important;
  right:auto!important;
  transform:translateX(-50%)!important;
  z-index:620!important;
  width:auto!important;
  min-width:340px!important;
  max-width:min(560px,calc(100% - 40px))!important;
  margin:0!important;
  padding:11px 22px!important;
  box-sizing:border-box!important;
  overflow:visible!important;
  border:1px solid #aebdcb!important;
  border-radius:7px!important;
  background:#fff!important;
  color:#13273d!important;
  box-shadow:0 7px 22px rgba(24,54,84,.20)!important;
  opacity:1!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
.workspace-designed .workspace-welcome strong{
  display:block!important;
  margin:0!important;
  color:#13273d!important;
  font-size:17px!important;
  font-weight:800!important;
  line-height:1.25!important;
  white-space:normal!important;
  text-shadow:none!important;
}
.workspace-designed .workspace-welcome span{
  display:block!important;
  margin-top:3px!important;
  color:#526579!important;
  font-size:12px!important;
  font-weight:500!important;
  line-height:1.25!important;
  white-space:normal!important;
}
body.dark .workspace-designed .workspace-welcome{
  background:#252d36!important;
  border-color:#657586!important;
  color:#fff!important;
}
body.dark .workspace-designed .workspace-welcome strong{color:#fff!important;}
body.dark .workspace-designed .workspace-welcome span{color:#d2dbe4!important;}
@media(max-width:760px){
  .workspace-designed .workspace-welcome{
    top:58px!important;
    left:10px!important;
    right:10px!important;
    transform:none!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    padding:10px 14px!important;
  }
  .workspace-designed .workspace-welcome strong{font-size:15px!important;}
  .workspace-designed .workspace-welcome span{font-size:11px!important;}
}


/* v8.8.8 — надежден избор на фирма на мобилни устройства и iOS PWA */
@media(max-width:760px){
  .workspace-head,
  .main:has(> .empty-workspace.workspace-designed) .workspace-head,
  body.blue-pro-theme .workspace-head{
    overflow:visible!important;
    position:relative!important;
    z-index:1200!important;
  }
  .company-switcher,
  body.blue-pro-theme .company-switcher,
  .main:has(> .empty-workspace.workspace-designed) .company-switcher{
    position:relative!important;
    z-index:1300!important;
    width:calc(100vw - 116px)!important;
    min-width:0!important;
    max-width:none!important;
    height:52px!important;
    flex:0 0 auto!important;
    overflow:visible!important;
    touch-action:manipulation!important;
  }
  .company-menu,
  .company-menu-trigger{
    width:100%!important;
    height:100%!important;
    min-height:50px!important;
    touch-action:manipulation!important;
    -webkit-tap-highlight-color:transparent!important;
  }
  .company-menu-trigger{
    padding:0 42px 0 16px!important;
    font-size:16px!important;
    line-height:1.2!important;
    cursor:pointer!important;
    user-select:none!important;
    -webkit-user-select:none!important;
  }
  .company-menu-current{
    display:block!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  .company-menu-chevron{
    display:block!important;
    right:16px!important;
    width:10px!important;
    height:10px!important;
  }
  .company-menu-list{
    max-height:min(60vh,420px)!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
    padding:8px!important;
    border-radius:12px!important;
    box-shadow:0 18px 48px rgba(19,52,83,.28)!important;
    background:#fff!important;
    pointer-events:auto!important;
  }
  .company-menu-option{
    min-height:58px!important;
    padding:11px 42px 11px 13px!important;
    font-size:16px!important;
    touch-action:manipulation!important;
    pointer-events:auto!important;
  }
  .company-menu-option-name{font-size:16px!important;}
  .company-menu-option-meta{font-size:13px!important;margin-top:2px!important;}
}


/* v8.8.8 — вертикално центриране на активната фирма в мобилния selector */
@media(max-width:760px){
  .company-switcher,
  body.blue-pro-theme .company-switcher,
  .main:has(> .empty-workspace.workspace-designed) .company-switcher{
    display:flex!important;
    align-items:center!important;
  }
  .company-menu,
  .company-menu-trigger{
    display:flex!important;
    align-items:center!important;
  }
  .company-menu-trigger{
    justify-content:flex-start!important;
    padding-top:0!important;
    padding-bottom:0!important;
  }
  .company-menu-current{
    display:flex!important;
    align-items:center!important;
    min-height:50px!important;
    line-height:1.1!important;
  }
  .company-switcher > span{
    display:flex!important;
    align-items:center!important;
    width:100%!important;
    min-height:50px!important;
    padding:0 16px!important;
    margin:0!important;
    line-height:1.15!important;
    font-size:16px!important;
    font-weight:700!important;
    color:#2b4f77!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
}


/* v8.8.8 — потвърждението за активната фирма стои точно под Добре дошли */
body.workspace-home-route .app-toast-stack{
  left:50%!important;
  transform:translateX(-50%)!important;
  width:min(560px,calc(100vw - 32px))!important;
}
@media(max-width:600px){
  body.workspace-home-route .app-toast-stack{
    left:10px!important;
    right:10px!important;
    transform:none!important;
    width:auto!important;
  }
}


/* v8.8.8 — цялостна мобилна стабилизация за всички модули */
.mobile-orientation-lock{display:none}

@media (max-width:900px){
  html,body{max-width:100%;overflow-x:hidden!important}
  .main,.sidebar.closed~.main{
    margin-left:42px!important;
    width:calc(100% - 42px)!important;
    max-width:calc(100% - 42px)!important;
    padding:0 8px 18px!important;
    overflow-x:hidden!important;
  }
  .workspace-head,
  .main:has(> .empty-workspace.workspace-designed) .workspace-head,
  body.blue-pro-theme .workspace-head{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    gap:6px!important;
    height:auto!important;
    min-height:0!important;
    padding:7px 0 5px!important;
    overflow:visible!important;
    align-items:stretch!important;
    position:relative!important;
    z-index:1200!important;
  }
  .company-switcher,
  body.blue-pro-theme .company-switcher,
  .main:has(> .empty-workspace.workspace-designed) .company-switcher{
    grid-row:1!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:48px!important;
    margin:0!important;
    padding:0!important;
    flex:0 0 auto!important;
    overflow:visible!important;
  }
  .company-menu,.company-menu-trigger{
    width:100%!important;
    height:48px!important;
    min-height:48px!important;
  }
  .company-menu-trigger,
  body.blue-pro-theme .company-menu-trigger{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    padding:0 42px 0 16px!important;
    font-size:16px!important;
    line-height:1.15!important;
  }
  .company-menu-current{
    display:flex!important;
    align-items:center!important;
    min-height:48px!important;
    line-height:1.15!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  .workspace-tabs,
  body.blue-pro-theme .workspace-tabs{
    grid-row:2!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    display:flex!important;
    gap:5px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    padding:0 0 2px!important;
    scrollbar-width:none!important;
    -webkit-overflow-scrolling:touch!important;
  }
  .workspace-tabs::-webkit-scrollbar{display:none!important}
  .workspace-tab,
  body.blue-pro-theme .workspace-tab{
    flex:0 0 auto!important;
    min-width:132px!important;
    max-width:220px!important;
    height:34px!important;
  }
  .workspace-tab-title{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
  .workspace-tab-close{flex:0 0 22px!important;margin-right:3px!important}
  .topbar{
    min-height:44px!important;
    height:auto!important;
    padding:8px 10px!important;
    margin:0 0 8px!important;
    gap:8px!important;
    flex-wrap:nowrap!important;
  }
  .topbar .brand{min-width:0!important;font-size:17px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
  .company-pill{flex:0 0 auto!important;max-width:42%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}

  .card,.stat,.filterbar,.help-nav,.help-hero,.help-section{
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
  }
  .grid2,.grid3,.grid4,.filterbar,.stats{grid-template-columns:1fr!important}
  .filterbar{gap:8px!important}
  .filterbar .btn,.filterbar button{width:100%!important;min-height:42px!important}
  input,select,textarea{max-width:100%!important;box-sizing:border-box!important;font-size:16px!important}
  textarea{min-height:120px!important}

  .table-wrap,.invoice-lines-wrap{
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
    overflow-y:visible!important;
    -webkit-overflow-scrolling:touch!important;
  }
  .table-wrap>.table{min-width:720px!important;table-layout:auto!important}
  .invoice-lines{min-width:980px!important;table-layout:auto!important}
  .table th,.table td{white-space:nowrap!important;overflow-wrap:normal!important}

  .help-shell{display:block!important}
  .help-nav{position:relative!important;top:auto!important;max-height:none!important;margin-bottom:10px!important}
  .help-toc{grid-template-columns:1fr!important}
  .help-hero{display:block!important;padding:16px!important}
  .help-hero-icon{display:none!important}
  .help-quick-grid,.help-two-col{grid-template-columns:1fr!important}
  .help-section{padding:15px!important}

  .support-info-modal{
    padding:8px!important;
    place-items:center!important;
    align-items:center!important;
    overflow:hidden!important;
  }
  .support-info-dialog,.support-contact-dialog{
    width:calc(100vw - 16px)!important;
    max-width:680px!important;
    height:auto!important;
    max-height:calc(100dvh - 16px)!important;
    margin:0!important;
    border-radius:14px!important;
    overflow:hidden!important;
    display:flex!important;
    flex-direction:column!important;
  }
  .support-info-head{
    flex:0 0 auto!important;
    position:relative!important;
    padding:12px 14px!important;
    z-index:2!important;
  }
  .support-info-body{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
    padding:14px!important;
  }
  .support-contact-form{display:grid!important;grid-template-columns:1fr!important;gap:10px!important}
  .support-info-actions{
    position:sticky!important;
    bottom:0!important;
    z-index:3!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
    padding:12px 0 0!important;
    background:inherit!important;
  }
  .support-info-actions button{width:100%!important;min-height:46px!important}

  /* Начален екран: welcome и изображението вече са последователни, без застъпване */
  .main:has(> .empty-workspace.workspace-designed){overflow-x:hidden!important}
  .main:has(> .empty-workspace.workspace-designed) .empty-workspace.workspace-designed{
    position:relative!important;
    min-height:calc(100dvh - 62px)!important;
    overflow:hidden!important;
    padding:0 0 28px!important;
  }
  .workspace-designed .workspace-welcome{
    position:relative!important;
    top:auto!important;
    left:auto!important;
    right:auto!important;
    transform:none!important;
    width:calc(100% - 20px)!important;
    min-width:0!important;
    max-width:none!important;
    margin:72px 10px 18px!important;
    padding:12px 14px!important;
    z-index:20!important;
  }
  .workspace-designed .workspace-hero-card,
  body.blue-pro-theme .workspace-designed .workspace-hero-card{
    position:relative!important;
    top:auto!important;
    left:auto!important;
    right:auto!important;
    transform:none!important;
    width:calc(100% - 20px)!important;
    max-width:none!important;
    max-height:none!important;
    margin:0 10px 24px!important;
    padding:10px!important;
    z-index:10!important;
  }
  .workspace-designed .workspace-hero-card .workspace-image{
    display:block!important;
    width:100%!important;
    height:auto!important;
    max-width:100%!important;
    max-height:none!important;
    object-fit:contain!important;
  }
}

/* Задължително съобщение за хоризонтален режим при работа в модул */
@media (max-width:760px) and (orientation:portrait){
  body.mobile-module-active .mobile-orientation-lock{
    position:fixed!important;
    inset:0!important;
    z-index:2147483646!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:24px!important;
    background:rgba(248,251,255,.96)!important;
    backdrop-filter:blur(5px)!important;
    -webkit-backdrop-filter:blur(5px)!important;
  }
  body.mobile-module-active .mobile-orientation-lock-card{
    width:min(430px,100%)!important;
    padding:26px 22px!important;
    border:1px solid #c7d8e8!important;
    border-radius:18px!important;
    background:#fff!important;
    color:#172d45!important;
    text-align:center!important;
    box-shadow:0 18px 50px rgba(18,53,86,.20)!important;
  }
  .mobile-orientation-lock-icon{
    width:70px!important;
    height:70px!important;
    margin:0 auto 16px!important;
    display:grid!important;
    place-items:center!important;
    border-radius:50%!important;
    background:#eaf4fd!important;
    color:#176fc8!important;
    font-size:38px!important;
    font-weight:900!important;
  }
  .mobile-orientation-lock strong{display:block!important;font-size:21px!important;line-height:1.3!important}
  .mobile-orientation-lock span{display:block!important;margin-top:9px!important;font-size:14px!important;line-height:1.45!important;color:#5a6f84!important}
}


/* v8.8.8 — компактен landscape mobile изглед и винаги видима лява лента */
@media (max-width:950px) and (max-height:520px) and (orientation:landscape){
  html,body{height:100%;overflow-x:hidden!important;overflow-y:auto!important}
  body{font-size:13px!important}
  .rail{
    width:34px!important;
    padding:4px 2px 6px!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    scrollbar-width:none!important;
  }
  .rail::-webkit-scrollbar{display:none!important}
  .rail-btn{
    width:28px!important;
    height:28px!important;
    min-height:28px!important;
    margin:2px 0!important;
    font-size:16px!important;
    border-radius:8px!important;
  }
  .rail-exit{margin-top:8px!important}
  .bottom{display:none!important}
  .sidebar{left:34px!important;bottom:0!important}
  .main,.sidebar.closed~.main{
    margin-left:34px!important;
    width:calc(100% - 34px)!important;
    max-width:calc(100% - 34px)!important;
    padding:0 6px 12px!important;
  }
  .workspace-head{
    padding:4px 0 3px!important;
    gap:4px!important;
  }
  .company-switcher{height:40px!important}
  .company-menu,.company-menu-trigger{
    height:40px!important;
    min-height:40px!important;
  }
  .company-menu-trigger{
    padding:0 34px 0 12px!important;
    font-size:14px!important;
    border-radius:14px!important;
  }
  .company-menu-current{
    min-height:40px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
    font-size:14px!important;
    line-height:1.1!important;
  }
  .company-menu-label{line-height:1.1!important}
  .workspace-tabs{
    gap:4px!important;
    padding-bottom:1px!important;
  }
  .workspace-tab{
    min-width:112px!important;
    max-width:180px!important;
    height:30px!important;
    font-size:13px!important;
  }
  .workspace-tab-close{flex-basis:18px!important}
  .topbar{
    min-height:38px!important;
    padding:6px 10px!important;
    margin-bottom:6px!important;
  }
  .topbar .brand{font-size:15px!important}
  .company-pill{
    max-width:40%!important;
    padding:5px 8px!important;
    font-size:12px!important;
  }
  .card,.stat,.help-hero,.help-section{
    padding:10px!important;
    margin-bottom:8px!important;
  }
  .card h1,.card h2,.card h3{margin-bottom:8px!important}
  .card h1,.card h2{font-size:15px!important}
  input,select,textarea,.btn,button{font-size:14px!important}
  .btn,button{min-height:36px!important;padding:6px 10px!important}
  .filterbar,.grid2,.grid3,.grid4,.stats{gap:6px!important}
  .table th,.table td{padding:5px 6px!important;font-size:12px!important}
  .workspace-designed .workspace-welcome{
    margin:10px 8px 10px!important;
    padding:10px 12px!important;
    border-radius:14px!important;
  }
  .workspace-designed .workspace-welcome h1,
  .workspace-designed .workspace-welcome h2,
  .workspace-designed .workspace-welcome strong{
    font-size:15px!important;
    line-height:1.2!important;
  }
  .workspace-designed .workspace-welcome .muted,
  .workspace-designed .workspace-welcome p,
  .workspace-designed .workspace-welcome div:not(.btn):not(.actions){
    font-size:12px!important;
    line-height:1.3!important;
  }
  .workspace-designed .workspace-hero-card,
  body.blue-pro-theme .workspace-designed .workspace-hero-card{
    width:calc(100% - 16px)!important;
    margin:0 8px 12px!important;
    padding:8px!important;
    border-radius:16px!important;
  }
  .workspace-designed .workspace-hero-card .workspace-image{
    width:100%!important;
    height:auto!important;
    max-height:calc(100dvh - 180px)!important;
    object-fit:contain!important;
  }
  .support-info-modal{padding:6px!important}
  .support-info-dialog,.support-contact-dialog{
    width:calc(100vw - 12px)!important;
    max-height:calc(100dvh - 12px)!important;
    border-radius:12px!important;
  }
  .support-info-head{padding:10px 12px!important}
  .support-info-body{padding:12px!important}
  .support-info-actions{padding-top:10px!important}
}


/* v8.8.8 — мобилен начален екран като desktop и задължителен landscape режим */
@media (max-width:950px) and (orientation:landscape){
  .main:has(> .empty-workspace.workspace-designed) .empty-workspace.workspace-designed{
    position:relative!important;
    min-height:calc(100dvh - 50px)!important;
    height:calc(100dvh - 50px)!important;
    padding:0!important;
    overflow:hidden!important;
  }
  .workspace-designed .workspace-welcome{
    position:absolute!important;
    top:12px!important;
    left:50%!important;
    right:auto!important;
    transform:translateX(-50%)!important;
    width:auto!important;
    min-width:280px!important;
    max-width:min(72vw,520px)!important;
    margin:0!important;
    padding:9px 18px!important;
    border-radius:8px!important;
    text-align:center!important;
    z-index:30!important;
  }
  .workspace-designed .workspace-welcome strong{
    font-size:15px!important;
    line-height:1.2!important;
    white-space:nowrap!important;
  }
  .workspace-designed .workspace-welcome span{
    margin-top:2px!important;
    font-size:11px!important;
    line-height:1.2!important;
  }
  .workspace-designed .workspace-hero-card,
  body.blue-pro-theme .workspace-designed .workspace-hero-card{
    position:absolute!important;
    left:50%!important;
    top:55%!important;
    right:auto!important;
    transform:translate(-50%,-50%)!important;
    width:min(58vw,760px)!important;
    height:min(64vh,500px)!important;
    max-width:calc(100% - 28px)!important;
    max-height:calc(100dvh - 125px)!important;
    margin:0!important;
    padding:10px!important;
    border-radius:14px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    overflow:hidden!important;
  }
  .workspace-designed .workspace-hero-card .workspace-image{
    width:auto!important;
    height:auto!important;
    max-width:100%!important;
    max-height:100%!important;
    object-fit:contain!important;
  }
}

/* Съобщението за завъртане се показва винаги на телефон в портретен режим — включително началния екран */
@media (max-width:760px) and (orientation:portrait){
  .mobile-orientation-lock{
    position:fixed!important;
    inset:0!important;
    z-index:2147483646!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:24px!important;
    background:rgba(248,251,255,.97)!important;
    backdrop-filter:blur(5px)!important;
    -webkit-backdrop-filter:blur(5px)!important;
    pointer-events:auto!important;
  }
  .mobile-orientation-lock-card{
    width:min(430px,100%)!important;
    padding:26px 22px!important;
    border:1px solid #c7d8e8!important;
    border-radius:18px!important;
    background:#fff!important;
    color:#172d45!important;
    text-align:center!important;
    box-shadow:0 18px 50px rgba(18,53,86,.20)!important;
  }
}


/* v8.8.8 — full-bleed mobile landscape без бели полета и постоянен orientation guard */
@media (max-width:950px){
  html,body,.app{
    width:100%!important;
    min-width:100%!important;
    min-height:100dvh!important;
    margin:0!important;
    background:#e8f3fd!important;
  }
}

@media (max-width:950px) and (orientation:landscape){
  body.workspace-home-route,
  body.workspace-home-route .app,
  body.workspace-home-route .main,
  body.workspace-home-route .empty-workspace.workspace-designed{
    min-height:100dvh!important;
    margin:0!important;
  }
  body.workspace-home-route .main,
  body.workspace-home-route .sidebar.closed~.main{
    padding:0!important;
    overflow:hidden!important;
  }
  body.workspace-home-route .workspace-head{
    margin:0!important;
    padding:4px 6px 3px!important;
    box-sizing:border-box!important;
  }
  body.workspace-home-route .empty-workspace.workspace-designed{
    height:calc(100dvh - 47px)!important;
    min-height:calc(100dvh - 47px)!important;
    width:100%!important;
    max-width:none!important;
    border:0!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
  }
  body.workspace-home-route .workspace-designed .workspace-background-layer{
    position:absolute!important;
    inset:0!important;
    width:100%!important;
    height:100%!important;
    min-width:100%!important;
    min-height:100%!important;
    background-size:cover!important;
    background-position:center bottom!important;
  }
  body.workspace-home-route .workspace-designed .workspace-welcome{
    top:10px!important;
  }
  body.workspace-home-route .workspace-designed .workspace-hero-card,
  body.blue-pro-theme.workspace-home-route .workspace-designed .workspace-hero-card{
    top:56%!important;
    width:min(55vw,720px)!important;
    height:min(66vh,500px)!important;
    max-height:calc(100dvh - 112px)!important;
  }
}

/* iOS safe-area: фонът стига до ръбовете, контролите остават в безопасната зона */
@supports (padding: max(0px)){
  @media (max-width:950px) and (orientation:landscape){
    .rail{
      left:0!important;
      padding-left:max(2px,env(safe-area-inset-left))!important;
      width:calc(34px + env(safe-area-inset-left))!important;
      box-sizing:border-box!important;
      background:rgba(249,252,255,.98)!important;
    }
    .sidebar{left:calc(34px + env(safe-area-inset-left))!important}
    .main,.sidebar.closed~.main{
      margin-left:calc(34px + env(safe-area-inset-left))!important;
      width:calc(100% - 34px - env(safe-area-inset-left))!important;
      max-width:calc(100% - 34px - env(safe-area-inset-left))!important;
      padding-right:env(safe-area-inset-right)!important;
      box-sizing:border-box!important;
    }
    body.workspace-home-route .main,
    body.workspace-home-route .sidebar.closed~.main{
      padding-right:env(safe-area-inset-right)!important;
    }
  }
}

/* На всяко мобилно устройство в портретен режим се изисква завъртане */
@media (max-width:950px) and (orientation:portrait){
  .mobile-orientation-lock{
    position:fixed!important;
    inset:0!important;
    z-index:2147483646!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:24px max(24px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left))!important;
    box-sizing:border-box!important;
    background:rgba(248,251,255,.98)!important;
    pointer-events:auto!important;
  }
}


/* v8.8.16 — мобилен landscape 1:1 с desktop чрез автоматично мащабиране */
body.mobile-phone{background:#eef6ff!important}
body.mobile-phone .mobile-orientation-lock{display:none!important}

@media (orientation:portrait){
  body.mobile-phone .mobile-orientation-lock{
    position:fixed!important;
    inset:0!important;
    z-index:2147483647!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:24px!important;
    background:rgba(248,251,255,.98)!important;
    backdrop-filter:blur(6px)!important;
    -webkit-backdrop-filter:blur(6px)!important;
  }
  body.mobile-phone .mobile-orientation-lock-card{
    width:min(430px,100%)!important;
    padding:26px 22px!important;
    border:1px solid #c7d8e8!important;
    border-radius:18px!important;
    background:#fff!important;
    color:#172d45!important;
    text-align:center!important;
    box-shadow:0 18px 50px rgba(18,53,86,.20)!important;
  }
}

body.mobile-desktop-scale{
  width:100vw!important;
  min-width:0!important;
  min-height:100dvh!important;
  margin:0!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  background:#eef6ff!important;
}
body.mobile-desktop-scale .app{
  width:1366px!important;
  min-width:1366px!important;
  max-width:1366px!important;
  min-height:var(--mobile-canvas-height,768px)!important;
  zoom:var(--mobile-desktop-scale,1)!important;
  transform:none!important;
  transform-origin:top left!important;
  overflow:visible!important;
}
body.mobile-desktop-scale .rail{
  width:42px!important;
  left:0!important;
  top:0!important;
  bottom:0!important;
  padding:6px 3px 4px!important;
  overflow:visible!important;
}
body.mobile-desktop-scale .rail-btn{
  width:34px!important;
  height:34px!important;
  min-height:34px!important;
  margin:2px 0!important;
  font-size:20px!important;
  border-radius:3px!important;
}
body.mobile-desktop-scale .rail-exit{margin-top:auto!important}
body.mobile-desktop-scale .sidebar{
  width:440px!important;
  left:42px!important;
  top:0!important;
  bottom:28px!important;
  padding:6px 8px 18px!important;
}
body.mobile-desktop-scale .main,
body.mobile-desktop-scale .sidebar.closed~.main{
  margin-left:42px!important;
  width:calc(100% - 42px)!important;
  max-width:none!important;
  min-width:0!important;
  padding:0 14px 48px!important;
  overflow:visible!important;
}
body.mobile-desktop-scale .workspace-head,
body.mobile-desktop-scale .main:has(> .empty-workspace.workspace-designed) .workspace-head,
body.mobile-desktop-scale.blue-pro-theme .workspace-head{
  display:flex!important;
  grid-template-columns:none!important;
  grid-template-rows:none!important;
  align-items:flex-end!important;
  gap:4px!important;
  height:34px!important;
  min-height:34px!important;
  padding:4px 0 0!important;
  overflow:visible!important;
}
body.mobile-desktop-scale .company-switcher,
body.mobile-desktop-scale.blue-pro-theme .company-switcher,
body.mobile-desktop-scale .main:has(> .empty-workspace.workspace-designed) .company-switcher{
  width:auto!important;
  min-width:255px!important;
  max-width:360px!important;
  height:32px!important;
  margin:0!important;
  padding:0!important;
}
body.mobile-desktop-scale .company-menu,
body.mobile-desktop-scale .company-menu-trigger{
  width:100%!important;
  height:32px!important;
  min-height:32px!important;
}
body.mobile-desktop-scale .company-menu-trigger,
body.mobile-desktop-scale.blue-pro-theme .company-menu-trigger{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  padding:0 34px 0 12px!important;
  font-size:13px!important;
  line-height:1!important;
}
body.mobile-desktop-scale .company-menu-current{
  display:block!important;
  min-height:0!important;
  line-height:1.2!important;
  text-align:left!important;
}
body.mobile-desktop-scale .workspace-tabs,
body.mobile-desktop-scale.blue-pro-theme .workspace-tabs{
  display:flex!important;
  flex:1 1 auto!important;
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  gap:7px!important;
  padding:0 0 0 1px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
}
body.mobile-desktop-scale .workspace-tab,
body.mobile-desktop-scale.blue-pro-theme .workspace-tab{
  min-width:140px!important;
  max-width:300px!important;
  height:32px!important;
  font-size:13px!important;
}
body.mobile-desktop-scale .topbar{
  height:42px!important;
  min-height:42px!important;
  padding:0 15px!important;
  margin-bottom:10px!important;
  flex-wrap:nowrap!important;
}
body.mobile-desktop-scale .topbar .brand{font-size:17px!important}
body.mobile-desktop-scale .company-pill{max-width:none!important;padding:6px 10px!important;font-size:inherit!important}
body.mobile-desktop-scale .grid2{grid-template-columns:repeat(2,minmax(0,1fr))!important}
body.mobile-desktop-scale .grid3{grid-template-columns:repeat(3,minmax(0,1fr))!important}
body.mobile-desktop-scale .grid4{grid-template-columns:repeat(4,minmax(0,1fr))!important}
body.mobile-desktop-scale .stats{grid-template-columns:repeat(4,1fr)!important}
body.mobile-desktop-scale .filterbar{grid-template-columns:2fr 1fr 1fr auto!important}
body.mobile-desktop-scale .filterbar .btn,
body.mobile-desktop-scale .filterbar button{width:auto!important;min-height:0!important}
body.mobile-desktop-scale input,
body.mobile-desktop-scale select,
body.mobile-desktop-scale textarea{font-size:14px!important}
body.mobile-desktop-scale textarea{min-height:66px!important}
body.mobile-desktop-scale .card,
body.mobile-desktop-scale .stat,
body.mobile-desktop-scale .help-hero,
body.mobile-desktop-scale .help-section{padding:14px!important;margin-bottom:12px!important}
body.mobile-desktop-scale .table-wrap,
body.mobile-desktop-scale .invoice-lines-wrap{overflow:auto!important}
body.mobile-desktop-scale .table-wrap>.table{min-width:0!important;width:100%!important;table-layout:auto!important}
body.mobile-desktop-scale .table th,
body.mobile-desktop-scale .table td{white-space:normal!important}
body.mobile-desktop-scale .help-shell{display:grid!important}
body.mobile-desktop-scale .help-toc{grid-template-columns:1fr 1fr!important}
body.mobile-desktop-scale .help-quick-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
body.mobile-desktop-scale .help-two-col{grid-template-columns:1fr 1fr!important}
body.mobile-desktop-scale .workspace-designed .workspace-welcome{
  position:absolute!important;
  top:12px!important;
  left:50%!important;
  right:auto!important;
  transform:translateX(-50%)!important;
  width:auto!important;
  min-width:280px!important;
  max-width:520px!important;
  margin:0!important;
  padding:10px 16px!important;
}
body.mobile-desktop-scale .workspace-designed .workspace-hero-card,
body.mobile-desktop-scale.blue-pro-theme .workspace-designed .workspace-hero-card{
  position:absolute!important;
  top:50%!important;
  left:50%!important;
  right:auto!important;
  transform:translate(-50%,-46%)!important;
  width:min(680px,62vw)!important;
  max-width:680px!important;
  max-height:72vh!important;
  margin:0!important;
  padding:10px!important;
}
body.mobile-desktop-scale .workspace-designed .workspace-hero-card .workspace-image{
  display:block!important;
  width:100%!important;
  height:auto!important;
  max-width:100%!important;
  max-height:68vh!important;
  object-fit:contain!important;
}
body.mobile-desktop-scale .empty-workspace.workspace-designed{
  min-height:calc(var(--mobile-canvas-height,768px) - 34px)!important;
  height:calc(var(--mobile-canvas-height,768px) - 34px)!important;
  padding:0!important;
  overflow:hidden!important;
}
body.mobile-desktop-scale .support-info-dialog,
body.mobile-desktop-scale .support-contact-dialog{
  width:min(680px,calc(100vw - 28px))!important;
  max-height:calc(100vh - 28px)!important;
}


/* v8.8.16 — iPhone notch/Dynamic Island safe area при desktop 1:1 мащабиране */
:root{
  --bgf-safe-left:env(safe-area-inset-left,0px);
  --bgf-safe-right:env(safe-area-inset-right,0px);
  --bgf-safe-top:env(safe-area-inset-top,0px);
  --bgf-safe-bottom:env(safe-area-inset-bottom,0px);
}
body.mobile-desktop-scale{
  box-sizing:border-box!important;
  padding-left:var(--mobile-safe-left,0px)!important;
  padding-right:var(--mobile-safe-right,0px)!important;
  padding-top:0!important;
}
body.mobile-desktop-scale .app{
  transform-origin:top left!important;
}
@media (orientation:portrait){
  body.mobile-phone .mobile-orientation-lock{
    padding-top:max(24px,var(--bgf-safe-top))!important;
    padding-right:max(24px,var(--bgf-safe-right))!important;
    padding-bottom:max(24px,var(--bgf-safe-bottom))!important;
    padding-left:max(24px,var(--bgf-safe-left))!important;
  }
}


/* v8.8.16 — реален iPhone notch резерв в landscape, включително когато env() връща 0 */
body.mobile-desktop-scale.ios-notch-landscape{
  padding-left:max(var(--mobile-safe-left,48px),48px)!important;
  padding-right:max(var(--mobile-safe-right,48px),48px)!important;
}
body.mobile-desktop-scale.ios-notch-landscape .app{
  max-width:none!important;
}
@supports(padding:max(0px)){
  body.mobile-desktop-scale.ios-notch-landscape{
    padding-left:max(var(--mobile-safe-left,48px),48px)!important;
    padding-right:max(var(--mobile-safe-right,48px),48px)!important;
  }
}


/* v8.8.16 — универсален адаптивен desktop изглед за телефони и таблети */
body.mobile-desktop-scale{
  padding:0!important;
  width:100%!important;
  min-width:0!important;
  overflow-x:hidden!important;
  background:#eef6ff!important;
}
body.mobile-desktop-scale .app{
  position:relative!important;
  width:var(--mobile-design-width,960px)!important;
  min-width:var(--mobile-design-width,960px)!important;
  max-width:var(--mobile-design-width,960px)!important;
  min-height:var(--mobile-canvas-height,680px)!important;
  margin-left:var(--mobile-safe-design-left,0px)!important;
  margin-right:var(--mobile-safe-design-right,0px)!important;
  zoom:var(--mobile-desktop-scale,1)!important;
  transform:none!important;
  transform-origin:top left!important;
}
body.mobile-desktop-scale .rail{
  position:absolute!important;
  left:0!important;
  top:0!important;
  bottom:auto!important;
  height:var(--mobile-canvas-height,680px)!important;
  min-height:var(--mobile-canvas-height,680px)!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  scrollbar-width:none!important;
}
body.mobile-desktop-scale .rail::-webkit-scrollbar{display:none!important}
body.mobile-desktop-scale .sidebar{position:absolute!important}
body.mobile-desktop-scale .main,
body.mobile-desktop-scale .sidebar.closed~.main{
  margin-left:42px!important;
  width:calc(var(--mobile-design-width,960px) - 42px)!important;
  max-width:calc(var(--mobile-design-width,960px) - 42px)!important;
}
body.mobile-desktop-scale .workspace-designed .workspace-hero-card,
body.mobile-desktop-scale.blue-pro-theme .workspace-designed .workspace-hero-card{
  width:min(680px,68%)!important;
  max-height:76%!important;
}
body.mobile-desktop-scale .workspace-designed .workspace-hero-card .workspace-image{max-height:72%!important}

/* Телефон: desktop логика, но с четими контроли */
body.mobile-desktop-scale.mobile-phone .rail{width:46px!important;padding:7px 4px!important}
body.mobile-desktop-scale.mobile-phone .rail-btn{
  width:38px!important;height:38px!important;min-height:38px!important;font-size:21px!important;margin:3px 0!important;border-radius:8px!important
}
body.mobile-desktop-scale.mobile-phone .main,
body.mobile-desktop-scale.mobile-phone .sidebar.closed~.main{
  margin-left:46px!important;
  width:calc(var(--mobile-design-width,960px) - 46px)!important;
  max-width:calc(var(--mobile-design-width,960px) - 46px)!important;
  padding:0 12px 42px!important;
}
body.mobile-desktop-scale.mobile-phone .company-switcher{min-width:250px!important;height:38px!important}
body.mobile-desktop-scale.mobile-phone .company-menu,
body.mobile-desktop-scale.mobile-phone .company-menu-trigger{height:38px!important;min-height:38px!important}
body.mobile-desktop-scale.mobile-phone .company-menu-trigger{font-size:15px!important}
body.mobile-desktop-scale.mobile-phone .workspace-head{height:40px!important;min-height:40px!important}
body.mobile-desktop-scale.mobile-phone .workspace-tab{height:36px!important;font-size:14px!important}
body.mobile-desktop-scale.mobile-phone .topbar{height:46px!important;min-height:46px!important}
body.mobile-desktop-scale.mobile-phone input,
body.mobile-desktop-scale.mobile-phone select,
body.mobile-desktop-scale.mobile-phone textarea,
body.mobile-desktop-scale.mobile-phone button,
body.mobile-desktop-scale.mobile-phone .btn{font-size:15px!important}
body.mobile-desktop-scale.mobile-phone .workspace-designed .workspace-welcome{top:14px!important;padding:12px 18px!important}

/* Таблет: без прекомерно смаляване */
body.mobile-desktop-scale.mobile-device:not(.mobile-phone) .rail-btn{width:36px!important;height:36px!important;min-height:36px!important;font-size:20px!important}
body.mobile-desktop-scale.mobile-device:not(.mobile-phone) .main,
body.mobile-desktop-scale.mobile-device:not(.mobile-phone) .sidebar.closed~.main{padding-right:16px!important}

/* Портретен режим: винаги изисква хоризонтален изглед за телефони и таблети */
@media (orientation:portrait){
  body.mobile-device .mobile-orientation-lock{
    position:fixed!important;
    inset:0!important;
    z-index:2147483646!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:max(24px,var(--bgf-safe-top)) max(24px,var(--bgf-safe-right)) max(24px,var(--bgf-safe-bottom)) max(24px,var(--bgf-safe-left))!important;
    background:rgba(248,251,255,.98)!important;
    backdrop-filter:blur(6px)!important;
    -webkit-backdrop-filter:blur(6px)!important;
  }
}


/* v8.8.16 — реален responsive mobile/tablet layout без умаляване на целия desktop canvas */
body.mobile-responsive-landscape{
  padding-left:max(env(safe-area-inset-left,0px),12px)!important;
  padding-right:max(env(safe-area-inset-right,0px),12px)!important;
  overflow-x:hidden!important;
}
body.mobile-responsive-landscape .app{
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  min-height:100dvh!important;
  margin:0!important;
  zoom:1!important;
  transform:none!important;
}
body.mobile-responsive-landscape .rail{
  position:fixed!important;
  left:max(env(safe-area-inset-left,0px),12px)!important;
  top:0!important;
  bottom:0!important;
  width:42px!important;
  height:auto!important;
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  z-index:70!important;
  scrollbar-width:none!important;
}
body.mobile-responsive-landscape .rail::-webkit-scrollbar{display:none!important}
body.mobile-responsive-landscape .rail-btn{
  width:34px!important;
  height:34px!important;
  min-height:34px!important;
  margin:2px 0!important;
  font-size:19px!important;
}
body.mobile-responsive-landscape .sidebar{
  position:fixed!important;
  left:calc(max(env(safe-area-inset-left,0px),12px) + 42px)!important;
  top:0!important;
  bottom:0!important;
  width:min(420px,calc(100vw - 76px - max(env(safe-area-inset-left,0px),12px) - max(env(safe-area-inset-right,0px),12px)))!important;
  z-index:65!important;
}
body.mobile-responsive-landscape .sidebar.closed{transform:translateX(-110%)!important}
body.mobile-responsive-landscape .main,
body.mobile-responsive-landscape .sidebar.closed~.main{
  margin-left:42px!important;
  width:calc(100% - 42px)!important;
  max-width:calc(100% - 42px)!important;
  min-width:0!important;
  padding:0 8px 18px!important;
  overflow-x:hidden!important;
}
body.mobile-responsive-landscape .workspace-head{
  display:flex!important;
  align-items:flex-end!important;
  gap:6px!important;
  height:auto!important;
  min-height:42px!important;
  padding:5px 0 4px!important;
  overflow:visible!important;
}
body.mobile-responsive-landscape .company-switcher{
  flex:0 1 320px!important;
  width:min(320px,42vw)!important;
  min-width:190px!important;
  max-width:320px!important;
  height:38px!important;
}
body.mobile-responsive-landscape .company-menu,
body.mobile-responsive-landscape .company-menu-trigger{height:38px!important;min-height:38px!important}
body.mobile-responsive-landscape .company-menu-trigger{font-size:15px!important;padding:0 38px 0 14px!important}
body.mobile-responsive-landscape .company-menu-current{display:flex!important;align-items:center!important;min-height:38px!important}
body.mobile-responsive-landscape .workspace-tabs{
  flex:1 1 auto!important;
  min-width:0!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  gap:5px!important;
}
body.mobile-responsive-landscape .workspace-tab{min-width:120px!important;max-width:220px!important;height:34px!important}
body.mobile-responsive-landscape .topbar{min-height:42px!important;height:auto!important;padding:7px 10px!important;margin-bottom:8px!important}
body.mobile-responsive-landscape .card,
body.mobile-responsive-landscape .stat,
body.mobile-responsive-landscape .filterbar,
body.mobile-responsive-landscape .help-hero,
body.mobile-responsive-landscape .help-section{max-width:100%!important;box-sizing:border-box!important}
body.mobile-responsive-landscape .grid2{grid-template-columns:repeat(2,minmax(0,1fr))!important}
body.mobile-responsive-landscape .grid3{grid-template-columns:repeat(2,minmax(0,1fr))!important}
body.mobile-responsive-landscape .grid4{grid-template-columns:repeat(2,minmax(0,1fr))!important}
body.mobile-responsive-landscape .stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}
body.mobile-responsive-landscape .filterbar{grid-template-columns:minmax(0,1.5fr) minmax(160px,.8fr) auto!important}
body.mobile-responsive-landscape input,
body.mobile-responsive-landscape select,
body.mobile-responsive-landscape textarea,
body.mobile-responsive-landscape button,
body.mobile-responsive-landscape .btn{font-size:15px!important}
body.mobile-responsive-landscape .table-wrap,
body.mobile-responsive-landscape .invoice-lines-wrap{overflow-x:auto!important;-webkit-overflow-scrolling:touch!important}
body.mobile-responsive-landscape .table-wrap>.table{min-width:760px!important;table-layout:auto!important}
body.mobile-responsive-landscape .workspace-designed .workspace-welcome{
  position:absolute!important;
  top:14px!important;
  left:50%!important;
  right:auto!important;
  transform:translateX(-50%)!important;
  width:min(460px,52vw)!important;
  min-width:300px!important;
  max-width:460px!important;
  margin:0!important;
  padding:10px 16px!important;
}
body.mobile-responsive-landscape .workspace-designed .workspace-hero-card,
body.mobile-responsive-landscape.blue-pro-theme .workspace-designed .workspace-hero-card{
  position:absolute!important;
  top:50%!important;
  left:50%!important;
  transform:translate(-50%,-44%)!important;
  width:min(640px,62vw)!important;
  max-width:640px!important;
  max-height:72vh!important;
  margin:0!important;
  padding:10px!important;
}
body.mobile-responsive-landscape .workspace-designed .workspace-hero-card .workspace-image{
  width:100%!important;
  height:auto!important;
  max-height:66vh!important;
  object-fit:contain!important;
}
body.mobile-responsive-landscape .empty-workspace.workspace-designed{
  min-height:calc(100dvh - 46px)!important;
  height:calc(100dvh - 46px)!important;
  overflow:hidden!important;
}
body.mobile-responsive-landscape .support-info-dialog,
body.mobile-responsive-landscape .support-contact-dialog{
  width:min(680px,calc(100vw - 96px))!important;
  max-height:calc(100dvh - 20px)!important;
}
@media (orientation:portrait){
  body.mobile-device .mobile-orientation-lock{display:flex!important}
}

/* v8.8.16 — цялостно преработен мобилен и таблетен интерфейс */
@media (max-width:1024px){
  :root{
    --mobile-safe-left:max(env(safe-area-inset-left,0px),0px);
    --mobile-safe-right:max(env(safe-area-inset-right,0px),0px);
    --mobile-rail:48px;
  }
  html,body{width:100%;max-width:100%;min-height:100%;overflow-x:hidden!important}
  body{padding:0!important;margin:0!important}
  .app{display:block!important;min-height:100dvh!important;width:100%!important}

  /* Постоянна и безопасна лява лента */
  .rail{
    position:fixed!important;
    left:var(--mobile-safe-left)!important;
    top:0!important;
    bottom:0!important;
    width:var(--mobile-rail)!important;
    height:100dvh!important;
    box-sizing:border-box!important;
    padding:6px 4px calc(6px + env(safe-area-inset-bottom,0px))!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    z-index:5000!important;
    scrollbar-width:none!important;
    -webkit-overflow-scrolling:touch!important;
  }
  .rail::-webkit-scrollbar{display:none!important}
  .rail-btn{
    width:38px!important;
    height:38px!important;
    min-width:38px!important;
    min-height:38px!important;
    flex:0 0 38px!important;
    margin:2px 0!important;
    padding:0!important;
    border-radius:9px!important;
    font-size:20px!important;
  }
  .rail-exit{margin-top:auto!important}

  /* Страничното меню е overlay и никога не измества съдържанието */
  .sidebar{
    position:fixed!important;
    left:calc(var(--mobile-safe-left) + var(--mobile-rail))!important;
    top:0!important;
    bottom:0!important;
    width:min(360px,calc(100vw - var(--mobile-safe-left) - var(--mobile-safe-right) - var(--mobile-rail) - 12px))!important;
    max-width:none!important;
    box-sizing:border-box!important;
    z-index:4900!important;
    transform:translateX(-110%)!important;
    transition:transform .2s ease!important;
    overflow-y:auto!important;
    padding:10px 10px calc(18px + env(safe-area-inset-bottom,0px))!important;
    box-shadow:12px 0 28px rgba(20,55,90,.24)!important;
  }
  .sidebar:not(.closed){transform:translateX(0)!important}
  .sidebar.closed{transform:translateX(-110%)!important}
  body.mobile-sidebar-open::after{
    content:"";
    position:fixed;
    inset:0;
    z-index:4800;
    background:rgba(16,36,58,.38);
    backdrop-filter:blur(2px);
    -webkit-backdrop-filter:blur(2px);
  }

  /* Работната зона използва цялото свободно място */
  .main,.sidebar.closed~.main,.sidebar~.main{
    margin-left:calc(var(--mobile-safe-left) + var(--mobile-rail))!important;
    width:calc(100vw - var(--mobile-safe-left) - var(--mobile-safe-right) - var(--mobile-rail))!important;
    max-width:none!important;
    min-width:0!important;
    box-sizing:border-box!important;
    padding:0 10px calc(18px + env(safe-area-inset-bottom,0px))!important;
    overflow-x:hidden!important;
  }
  .bottom{display:none!important}

  /* Горна лента */
  .workspace-head,
  .main:has(> .empty-workspace.workspace-designed) .workspace-head,
  body.blue-pro-theme .workspace-head{
    position:relative!important;
    z-index:1200!important;
    display:flex!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    gap:7px!important;
    width:100%!important;
    height:auto!important;
    min-height:54px!important;
    padding:7px 0!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }
  .company-switcher,
  body.blue-pro-theme .company-switcher,
  .main:has(> .empty-workspace.workspace-designed) .company-switcher{
    flex:0 1 310px!important;
    width:min(310px,100%)!important;
    min-width:170px!important;
    max-width:310px!important;
    height:42px!important;
    margin:0!important;
  }
  .company-menu,.company-menu-trigger{
    width:100%!important;
    height:42px!important;
    min-height:42px!important;
  }
  .company-menu-trigger,
  body.blue-pro-theme .company-menu-trigger{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    padding:0 38px 0 14px!important;
    font-size:15px!important;
    line-height:1.15!important;
  }
  .company-menu-current{
    display:flex!important;
    align-items:center!important;
    min-height:42px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  .workspace-tabs,
  body.blue-pro-theme .workspace-tabs{
    flex:1 1 auto!important;
    min-width:0!important;
    max-width:none!important;
    display:flex!important;
    gap:5px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    padding:0 0 1px!important;
    scrollbar-width:none!important;
  }
  .workspace-tabs::-webkit-scrollbar{display:none!important}
  .workspace-tab,
  body.blue-pro-theme .workspace-tab{
    flex:0 0 auto!important;
    min-width:126px!important;
    max-width:220px!important;
    height:34px!important;
  }

  /* Заглавия и съдържание */
  .topbar{min-height:44px!important;height:auto!important;padding:8px 11px!important;margin:0 0 8px!important;gap:8px!important}
  .topbar .brand{min-width:0!important;font-size:16px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
  .company-pill{max-width:42%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
  .card,.stat,.filterbar,.help-nav,.help-hero,.help-section{max-width:100%!important;min-width:0!important;box-sizing:border-box!important}
  .grid2,.grid3,.grid4,.stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .filterbar{grid-template-columns:minmax(180px,2fr) minmax(130px,1fr) auto!important;gap:8px!important}
  input,select,textarea{max-width:100%!important;box-sizing:border-box!important;font-size:16px!important}
  .table-wrap,.invoice-lines-wrap{width:100%!important;max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch!important}
  .table-wrap>.table{min-width:720px!important}
  .invoice-lines{min-width:960px!important}

  /* Начален екран — чист responsive layout, без застъпване */
  .main:has(> .empty-workspace.workspace-designed){padding-bottom:0!important}
  .empty-workspace.workspace-designed{
    position:relative!important;
    width:100%!important;
    min-height:calc(100dvh - 58px)!important;
    height:auto!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
    padding:14px!important;
  }
  .workspace-designed .workspace-welcome{
    position:relative!important;
    inset:auto!important;
    transform:none!important;
    width:min(520px,calc(100% - 20px))!important;
    min-width:0!important;
    max-width:520px!important;
    margin:0 auto 14px!important;
    padding:12px 16px!important;
    box-sizing:border-box!important;
    z-index:20!important;
  }
  .workspace-designed .workspace-hero-card,
  body.blue-pro-theme .workspace-designed .workspace-hero-card{
    position:relative!important;
    inset:auto!important;
    transform:none!important;
    width:min(720px,calc(100% - 20px))!important;
    max-width:720px!important;
    height:auto!important;
    max-height:none!important;
    margin:0 auto!important;
    padding:10px!important;
    box-sizing:border-box!important;
    z-index:10!important;
  }
  .workspace-designed .workspace-hero-card .workspace-image{
    display:block!important;
    width:100%!important;
    height:auto!important;
    max-width:100%!important;
    max-height:calc(100dvh - 190px)!important;
    object-fit:contain!important;
  }

  /* Модали */
  .support-info-modal,.document-preview-modal{padding:10px!important}
  .support-info-dialog,.support-contact-dialog,.document-preview-dialog{
    width:calc(100vw - var(--mobile-safe-left) - var(--mobile-safe-right) - 20px)!important;
    max-width:760px!important;
    max-height:calc(100dvh - 20px)!important;
    overflow:hidden!important;
  }
  .support-info-body{overflow-y:auto!important;-webkit-overflow-scrolling:touch!important}
}

/* Телефони */
@media (max-width:760px){
  :root{--mobile-rail:44px}
  .rail-btn{width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;flex-basis:36px!important}
  .main,.sidebar.closed~.main,.sidebar~.main{padding-left:7px!important;padding-right:7px!important}
  .workspace-head{display:grid!important;grid-template-columns:1fr!important;grid-template-rows:auto auto!important;gap:5px!important}
  .company-switcher{grid-row:1!important;width:100%!important;max-width:none!important;min-width:0!important}
  .workspace-tabs{grid-row:2!important;width:100%!important}
  .grid2,.grid3,.grid4,.stats,.filterbar{grid-template-columns:1fr!important}
  .filterbar .btn,.filterbar button{width:100%!important;min-height:42px!important}
  .topbar{flex-wrap:nowrap!important}
  .empty-workspace.workspace-designed{padding:10px!important}
  .workspace-designed .workspace-welcome{width:100%!important;margin-bottom:10px!important}
  .workspace-designed .workspace-hero-card{width:100%!important}
  .workspace-designed .workspace-hero-card .workspace-image{max-height:calc(100dvh - 205px)!important}
}

/* Нисък landscape екран: запазва четим размер и използва цялата височина */
@media (max-width:1024px) and (max-height:560px) and (orientation:landscape){
  :root{--mobile-rail:40px}
  .rail{padding-top:4px!important}
  .rail-btn{width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important;flex-basis:32px!important;font-size:18px!important}
  .workspace-head{min-height:48px!important;padding:4px 0!important}
  .company-switcher,.company-menu,.company-menu-trigger{height:38px!important;min-height:38px!important}
  .company-menu-current{min-height:38px!important}
  .empty-workspace.workspace-designed{min-height:calc(100dvh - 50px)!important;padding:8px 10px!important}
  .workspace-designed .workspace-welcome{max-width:430px!important;margin-bottom:8px!important;padding:8px 12px!important}
  .workspace-designed .workspace-welcome strong{font-size:15px!important}
  .workspace-designed .workspace-welcome span{font-size:11px!important}
  .workspace-designed .workspace-hero-card{width:min(620px,calc(100% - 10px))!important;padding:7px!important}
  .workspace-designed .workspace-hero-card .workspace-image{max-height:calc(100dvh - 145px)!important}
  .card,.stat,.help-hero,.help-section{padding:10px!important;margin-bottom:8px!important}
}

/* В портретен режим на телефон и таблет винаги се изисква хоризонтален изглед */
@media (max-width:1024px) and (orientation:portrait){
  .mobile-orientation-lock{
    position:fixed!important;
    inset:0!important;
    z-index:2147483647!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:max(20px,env(safe-area-inset-top,0px)) max(20px,env(safe-area-inset-right,0px)) max(20px,env(safe-area-inset-bottom,0px)) max(20px,env(safe-area-inset-left,0px))!important;
    background:#f7fbff!important;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
  }
}


/* v8.8.16 — чист мобилен drawer без изместване, изрязване и размазване */
@media (max-width:1024px){
  :root{
    --mobile-safe-left:max(env(safe-area-inset-left,0px),0px);
    --mobile-safe-right:max(env(safe-area-inset-right,0px),0px);
    --mobile-rail:44px;
  }
  html,body{max-width:100%!important;overflow-x:hidden!important}
  .rail{
    left:var(--mobile-safe-left)!important;
    width:var(--mobile-rail)!important;
    z-index:9100!important;
  }
  .main,.sidebar~.main,.sidebar.closed~.main{
    margin-left:calc(var(--mobile-safe-left) + var(--mobile-rail))!important;
    width:calc(100vw - var(--mobile-safe-left) - var(--mobile-safe-right) - var(--mobile-rail))!important;
    max-width:none!important;
    min-width:0!important;
    padding-left:8px!important;
    padding-right:8px!important;
    box-sizing:border-box!important;
  }
  .sidebar{
    position:fixed!important;
    left:calc(var(--mobile-safe-left) + var(--mobile-rail) + 6px)!important;
    top:6px!important;
    bottom:6px!important;
    width:min(520px,calc(100vw - var(--mobile-safe-left) - var(--mobile-safe-right) - var(--mobile-rail) - 18px))!important;
    max-width:none!important;
    z-index:9000!important;
    box-sizing:border-box!important;
    padding:12px!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    border:1px solid #b9cfe2!important;
    border-radius:14px!important;
    background:rgba(250,253,255,.99)!important;
    box-shadow:0 18px 45px rgba(18,53,86,.28)!important;
    transform:none!important;
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
    transition:opacity .16s ease,visibility .16s ease!important;
  }
  .sidebar.closed{
    transform:none!important;
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }
  body.mobile-sidebar-open::after{
    content:"";
    position:fixed!important;
    inset:0!important;
    z-index:8900!important;
    background:rgba(12,34,56,.28)!important;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
  }
  .sidebar .sidebar-brand{
    position:sticky!important;
    top:0!important;
    z-index:2!important;
    background:#f7fbff!important;
    border-radius:9px!important;
    margin-bottom:10px!important;
  }
  .sidebar .side-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .sidebar .menu-btn{min-height:40px!important;padding:7px 9px!important;border-radius:8px!important;font-size:14px!important}
  .sidebar .side-title{font-size:14px!important;margin:5px 0 7px!important}
  body:not(.mobile-sidebar-open) .sidebar{opacity:0!important;visibility:hidden!important;pointer-events:none!important}
  body.mobile-sidebar-open .sidebar:not(.closed){opacity:1!important;visibility:visible!important;pointer-events:auto!important}
}

@media (max-width:760px){
  .sidebar{width:calc(100vw - var(--mobile-safe-left) - var(--mobile-safe-right) - var(--mobile-rail) - 14px)!important}
  .sidebar .side-grid,.sidebar .compact-grid{grid-template-columns:1fr!important}
  .workspace-head{display:grid!important;grid-template-columns:1fr!important;grid-template-rows:auto auto!important}
  .company-switcher{width:100%!important;max-width:none!important}
  .workspace-tabs{width:100%!important}
}

@media (max-width:1024px) and (orientation:landscape){
  .empty-workspace.workspace-designed{
    padding:10px 12px!important;
    min-height:calc(100dvh - 54px)!important;
  }
  .workspace-designed .workspace-welcome{
    width:min(430px,calc(100% - 20px))!important;
    margin:0 auto 10px!important;
    padding:9px 13px!important;
  }
  .workspace-designed .workspace-hero-card,
  body.blue-pro-theme .workspace-designed .workspace-hero-card{
    width:min(650px,calc(100% - 20px))!important;
    margin:0 auto!important;
    padding:8px!important;
  }
  .workspace-designed .workspace-hero-card .workspace-image{
    width:100%!important;
    height:auto!important;
    max-height:calc(100dvh - 165px)!important;
    object-fit:contain!important;
  }
}


/* v8.8.16 — четими надписи на мобилната лента и меню без посивяване */
@media (max-width:1024px){
  body.mobile-sidebar-open::after{
    display:none!important;
    content:none!important;
    background:transparent!important;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
  }
  body.mobile-sidebar-open .main,
  body.mobile-sidebar-open .workspace-head,
  body.mobile-sidebar-open .empty-workspace,
  body.mobile-sidebar-open .topbar{
    filter:none!important;
    opacity:1!important;
  }
  .rail{overflow:visible!important}
  .rail-btn{
    position:relative!important;
    overflow:visible!important;
  }
  .rail-btn::after{
    content:attr(aria-label);
    position:absolute!important;
    left:calc(100% + 8px)!important;
    top:50%!important;
    transform:translateY(-50%) translateX(-4px)!important;
    display:block!important;
    width:max-content!important;
    max-width:min(300px,calc(100vw - 90px))!important;
    padding:7px 10px!important;
    border:1px solid #8fb4d5!important;
    border-radius:7px!important;
    background:#ffffff!important;
    color:#153f68!important;
    font-size:14px!important;
    font-weight:700!important;
    line-height:1.25!important;
    white-space:normal!important;
    text-align:left!important;
    box-shadow:0 8px 22px rgba(18,53,86,.20)!important;
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
    z-index:2147483647!important;
    transition:opacity .12s ease,transform .12s ease,visibility .12s ease!important;
  }
  .rail-btn:hover::after,
  .rail-btn:focus-visible::after,
  .rail-btn.mobile-label-visible::after{
    opacity:1!important;
    visibility:visible!important;
    transform:translateY(-50%) translateX(0)!important;
  }
  .sidebar{
    background:#fafdff!important;
    opacity:1!important;
    box-shadow:0 16px 38px rgba(18,53,86,.22)!important;
  }
  .sidebar.closed{
    opacity:0!important;
  }
}


/* v8.8.17 — корекции: mobile/tablet drawer под header, без застъпване на welcome и hero */
@media (max-width:1024px), ((pointer:coarse) and (max-width:1366px)){
  :root{
    --mobile-safe-left:max(env(safe-area-inset-left,0px),0px);
    --mobile-safe-right:max(env(safe-area-inset-right,0px),0px);
    --mobile-rail:44px;
  }

  /* header винаги стои над drawer-а */
  .workspace-head,
  .main:has(> .empty-workspace.workspace-designed) .workspace-head,
  body.blue-pro-theme .workspace-head{
    position:relative!important;
    z-index:9200!important;
    margin-bottom:6px!important;
  }

  /* drawer започва под горния header и не го застъпва */
  .sidebar{
    top:60px!important;
    bottom:8px!important;
    max-height:calc(100dvh - 68px)!important;
    left:calc(var(--mobile-safe-left) + var(--mobile-rail) + 6px)!important;
    width:min(420px,calc(100vw - var(--mobile-safe-left) - var(--mobile-safe-right) - var(--mobile-rail) - 18px))!important;
    z-index:9000!important;
  }
  .sidebar .sidebar-brand{
    position:sticky!important;
    top:0!important;
    z-index:3!important;
  }

  /* начален екран: подредба една под друга, без застъпване */
  .workspace-home-route .empty-workspace.workspace-designed,
  .empty-workspace.workspace-designed{
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:12px!important;
    padding:12px!important;
    box-sizing:border-box!important;
  }
  .workspace-home-route .workspace-designed .workspace-welcome,
  .workspace-designed .workspace-welcome{
    position:relative!important;
    inset:auto!important;
    transform:none!important;
    flex:0 0 auto!important;
    width:min(560px,100%)!important;
    max-width:100%!important;
    margin:0 auto!important;
    padding:12px 16px!important;
    z-index:20!important;
  }
  .workspace-home-route .workspace-designed .workspace-hero-card,
  .workspace-designed .workspace-hero-card,
  body.blue-pro-theme .workspace-designed .workspace-hero-card{
    position:relative!important;
    inset:auto!important;
    transform:none!important;
    flex:1 1 auto!important;
    width:min(760px,100%)!important;
    max-width:100%!important;
    height:auto!important;
    max-height:none!important;
    margin:0 auto!important;
    padding:10px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    z-index:10!important;
  }
  .workspace-home-route .workspace-designed .workspace-hero-card .workspace-image,
  .workspace-designed .workspace-hero-card .workspace-image{
    display:block!important;
    width:auto!important;
    max-width:100%!important;
    height:auto!important;
    max-height:calc(100dvh - 230px)!important;
    object-fit:contain!important;
  }
}

@media (max-width:760px){
  .sidebar{
    top:56px!important;
    width:calc(100vw - var(--mobile-safe-left) - var(--mobile-safe-right) - var(--mobile-rail) - 14px)!important;
    max-height:calc(100dvh - 64px)!important;
  }
  .workspace-designed .workspace-welcome{
    width:100%!important;
    padding:10px 12px!important;
  }
  .workspace-designed .workspace-hero-card{
    width:100%!important;
    padding:8px!important;
  }
  .workspace-designed .workspace-hero-card .workspace-image{
    max-height:calc(100dvh - 215px)!important;
  }
}

@media (max-width:1024px) and (orientation:landscape){
  .workspace-designed .workspace-welcome{
    width:min(470px,100%)!important;
  }
  .workspace-designed .workspace-hero-card,
  body.blue-pro-theme .workspace-designed .workspace-hero-card{
    width:min(680px,100%)!important;
  }
  .workspace-designed .workspace-hero-card .workspace-image{
    max-height:calc(100dvh - 190px)!important;
  }
}


/* 8.8.19 footer overlap fix */
.bottom{height:auto!important;min-height:28px!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto auto!important;gap:12px!important;align-items:center!important;padding:4px 12px!important;line-height:1.2!important}
.bottom span{min-width:0}
.bottom-brand{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bottom-user{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;justify-self:end;color:#274a74;font-weight:600;max-width:min(38vw,520px)}
.bottom-datetime{white-space:nowrap;justify-self:end;font-weight:600}
body.dark .bottom-user{color:#dfeaf7}
@media (max-width:1280px){
  .bottom{grid-template-columns:minmax(0,1fr) auto!important;grid-template-areas:'brand brand' 'user datetime'!important;row-gap:3px!important}
  .bottom-brand{grid-area:brand}
  .bottom-user{grid-area:user;justify-self:start;max-width:none}
  .bottom-datetime{grid-area:datetime;justify-self:end}
}
@media (max-width:980px){
  .bottom-brand{display:none}
  .bottom{grid-template-columns:minmax(0,1fr) auto!important;grid-template-areas:'user datetime'!important}
}


/* 8.8.21 action buttons tidy layout across modules */
.table td.actions{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  align-content:center!important;
  gap:5px!important;
  white-space:normal!important;
  min-width:185px!important;
  width:185px!important;
  overflow:visible!important;
}
.table td.actions>*{flex:0 0 auto!important;max-width:100%!important}
.table td.actions .btn,
.table td.actions button,
.table td.actions a{
  flex:0 0 auto!important;
  white-space:nowrap!important;
  font-size:12px!important;
  line-height:1.15!important;
  padding:5px 9px!important;
  min-height:28px!important;
}
.table td.actions .document-delete-locked{
  display:inline-flex!important;
  align-items:center!important;
  white-space:nowrap!important;
  font-size:11px!important;
  line-height:1.15!important;
  padding:5px 8px!important;
  border:1px solid var(--line)!important;
  border-radius:3px!important;
  background:rgba(255,255,255,.72)!important;
  color:var(--muted)!important;
}
.workspace-designed .workspace-welcome{display:none!important;}

@media (max-width:900px){
  .table td.actions{min-width:170px!important;width:170px!important;gap:4px!important}
  .table td.actions .btn,.table td.actions button,.table td.actions a{font-size:11px!important;padding:4px 7px!important;min-height:26px!important}
}


/* 8.8.22 table/status/filter alignment refinements */
.badge{
  font-size:10px!important;
  line-height:1.15!important;
  padding:2px 6px!important;
  white-space:nowrap!important;
}
.table td.actions{
  min-width:228px!important;
  width:228px!important;
  gap:4px!important;
}
.table td.actions .btn,
.table td.actions button,
.table td.actions a{
  min-height:26px!important;
  padding:4px 8px!important;
  font-size:12px!important;
}
.table td.actions .document-delete-locked{
  font-size:10px!important;
  padding:4px 6px!important;
}
.filterbar{
  align-items:center!important;
}
.filterbar > div{
  min-width:0!important;
}
.filterbar input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.filterbar select{
  height:32px!important;
  line-height:32px!important;
  padding-top:0!important;
  padding-bottom:0!important;
  box-sizing:border-box!important;
  vertical-align:middle!important;
}
.filterbar button,
.filterbar .btn{
  min-height:32px!important;
  height:32px!important;
  align-self:end!important;
  margin-top:18px!important;
  line-height:1!important;
}


/* 8.8.23 documents filter and action column cleanup */
.documents-filterbar{
  grid-template-columns:minmax(0,1fr) 300px 110px!important;
  gap:8px!important;
  align-items:start!important;
}
.documents-filterbar .filterbar-submit{
  display:flex!important;
  flex-direction:column!important;
  justify-content:flex-start!important;
}
.documents-filterbar .filterbar-submit label{
  visibility:hidden!important;
  margin-bottom:3px!important;
}
.documents-filterbar .filterbar-submit button,
.documents-filterbar .filterbar-submit .btn{
  width:100%!important;
  min-height:31px!important;
  height:31px!important;
  margin-top:0!important;
  align-self:stretch!important;
}
.documents-table th:nth-child(7),
.documents-table td:nth-child(7){
  width:72px!important;
  min-width:72px!important;
  white-space:nowrap!important;
}
.documents-table th:last-child,
.documents-table td.actions{
  width:198px!important;
  min-width:198px!important;
}
.documents-table td.actions{
  display:grid!important;
  grid-template-columns:repeat(2,max-content)!important;
  justify-content:start!important;
  align-content:center!important;
  gap:5px 6px!important;
  white-space:normal!important;
  overflow:visible!important;
}
.documents-table td.actions > *{
  flex:none!important;
  max-width:100%!important;
}
.documents-table td.actions .document-delete-locked{
  grid-column:1 / -1!important;
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.documents-table td.actions .btn,
.documents-table td.actions button,
.documents-table td.actions a{
  min-height:25px!important;
  padding:4px 8px!important;
  font-size:12px!important;
}
@media (max-width:980px){
  .documents-filterbar{grid-template-columns:minmax(0,1fr) 220px 100px!important;}
  .documents-table th:last-child,
  .documents-table td.actions{width:186px!important;min-width:186px!important;}
}
@media (max-width:760px){
  .documents-filterbar{grid-template-columns:1fr!important;}
  .documents-filterbar .filterbar-submit label{display:none!important;}
  .documents-filterbar .filterbar-submit button,
  .documents-filterbar .filterbar-submit .btn{width:100%!important;}
}


/* 8.8.24 global table and filter polish for all modules */
.filterbar{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(220px,300px) 110px!important;
  gap:8px!important;
  align-items:start!important;
}
.filterbar > div,
.filterbar > .filterbar-submit{
  min-width:0!important;
}
.filterbar input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.filterbar select{
  height:31px!important;
  min-height:31px!important;
  box-sizing:border-box!important;
}
.filterbar > button,
.filterbar > .btn,
.filterbar .filterbar-submit > button,
.filterbar .filterbar-submit > .btn{
  width:100%!important;
  height:31px!important;
  min-height:31px!important;
  margin-top:17px!important;
  align-self:start!important;
}
.filterbar .filterbar-submit label{margin-bottom:3px!important;}
.table td.actions{
  display:grid!important;
  grid-template-columns:repeat(2,max-content)!important;
  justify-content:start!important;
  align-content:center!important;
  gap:5px 6px!important;
  min-width:196px!important;
  width:196px!important;
  white-space:normal!important;
  overflow:visible!important;
}
.table td.actions > *{
  flex:none!important;
  max-width:100%!important;
}
.table td.actions .btn,
.table td.actions button,
.table td.actions a{
  min-height:25px!important;
  padding:4px 8px!important;
  font-size:12px!important;
  line-height:1.15!important;
  white-space:nowrap!important;
}
.table td.actions .document-delete-locked{
  grid-column:1 / -1!important;
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:10px!important;
  line-height:1.15!important;
  padding:4px 6px!important;
}
.table .badge{
  font-size:10px!important;
  line-height:1.15!important;
  padding:2px 6px!important;
  white-space:nowrap!important;
}
@media (max-width:980px){
  .filterbar{grid-template-columns:minmax(0,1fr) minmax(180px,240px) 100px!important;}
  .table td.actions{min-width:186px!important;width:186px!important;}
}
@media (max-width:760px){
  .filterbar{grid-template-columns:1fr!important;}
  .filterbar > button,
  .filterbar > .btn,
  .filterbar .filterbar-submit > button,
  .filterbar .filterbar-submit > .btn{margin-top:0!important;}
  .table td.actions{min-width:174px!important;width:174px!important;gap:4px 5px!important;}
  .table td.actions .btn,
  .table td.actions button,
  .table td.actions a{font-size:11px!important;padding:4px 7px!important;}
}


/* 8.8.25 final global table geometry and equal action controls */
.table{
  table-layout:auto!important;
}
.table th,
.table td{
  padding:7px 8px!important;
  vertical-align:middle!important;
  line-height:1.25!important;
}
.table th{
  height:32px!important;
}
.table tbody tr{
  min-height:44px!important;
}
.table td.actions{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(88px,1fr))!important;
  grid-auto-rows:28px!important;
  align-items:stretch!important;
  justify-content:stretch!important;
  align-content:center!important;
  gap:5px 6px!important;
  width:214px!important;
  min-width:214px!important;
  max-width:214px!important;
  padding:6px!important;
  white-space:normal!important;
  overflow:visible!important;
  box-sizing:border-box!important;
}
.table td.actions > *{
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  box-sizing:border-box!important;
}
.table td.actions .btn,
.table td.actions button,
.table td.actions a{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  height:28px!important;
  min-height:28px!important;
  padding:4px 7px!important;
  font-size:11px!important;
  line-height:1!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.table td.actions .document-delete-locked{
  grid-column:1 / -1!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  height:28px!important;
  min-height:28px!important;
  padding:4px 7px!important;
  font-size:10px!important;
  line-height:1!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  box-sizing:border-box!important;
}
.table .badge{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:20px!important;
  padding:2px 7px!important;
  font-size:10px!important;
  line-height:1!important;
  white-space:nowrap!important;
}
.filterbar{
  min-height:58px!important;
}
.filterbar label{
  min-height:15px!important;
  margin-bottom:4px!important;
  line-height:1.2!important;
}
.filterbar input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.filterbar select,
.filterbar button,
.filterbar .btn{
  height:32px!important;
  min-height:32px!important;
  box-sizing:border-box!important;
}
.filterbar > button,
.filterbar > .btn,
.filterbar .filterbar-submit > button,
.filterbar .filterbar-submit > .btn{
  margin-top:19px!important;
}
@media (max-width:980px){
  .table td.actions{
    grid-template-columns:repeat(2,minmax(82px,1fr))!important;
    width:200px!important;
    min-width:200px!important;
    max-width:200px!important;
  }
}
@media (max-width:760px){
  .table th,.table td{padding:6px 7px!important;}
  .table td.actions{
    grid-template-columns:repeat(2,minmax(76px,1fr))!important;
    width:184px!important;
    min-width:184px!important;
    max-width:184px!important;
    gap:4px!important;
  }
  .table td.actions .btn,
  .table td.actions button,
  .table td.actions a{font-size:10px!important;padding:4px 6px!important;}
  .filterbar > button,
  .filterbar > .btn,
  .filterbar .filterbar-submit > button,
  .filterbar .filterbar-submit > .btn{margin-top:0!important;}
}


/* 8.8.26 three primary document actions on one row */
.documents-table th:last-child,
.documents-table td.actions{
  width:286px!important;
  min-width:286px!important;
  max-width:286px!important;
}
.documents-table td.actions{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(82px,1fr))!important;
  grid-auto-flow:row!important;
  grid-auto-rows:28px!important;
  gap:5px!important;
  align-items:stretch!important;
  align-content:center!important;
  justify-content:stretch!important;
  padding:6px!important;
  overflow:visible!important;
}
.documents-table td.actions > .btn,
.documents-table td.actions > button,
.documents-table td.actions > a{
  order:1!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  height:28px!important;
  min-height:28px!important;
  padding:4px 6px!important;
  font-size:11px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.documents-table td.actions .document-delete-locked{
  order:2!important;
  grid-column:1 / -1!important;
  width:100%!important;
  max-width:none!important;
  height:26px!important;
  min-height:26px!important;
  justify-content:center!important;
  padding:4px 6px!important;
}
@media (max-width:1100px){
  .documents-table th:last-child,
  .documents-table td.actions{
    width:262px!important;
    min-width:262px!important;
    max-width:262px!important;
  }
  .documents-table td.actions{
    grid-template-columns:repeat(3,minmax(74px,1fr))!important;
    gap:4px!important;
  }
  .documents-table td.actions > .btn,
  .documents-table td.actions > button,
  .documents-table td.actions > a{
    font-size:10px!important;
    padding:4px 5px!important;
  }
}


/* 8.8.27 align documents search button with the type select */
.documents-filterbar{
  align-items:end!important;
}
.documents-filterbar > div,
.documents-filterbar > .filterbar-submit{
  align-self:end!important;
}
.documents-filterbar .filterbar-submit{
  padding-top:0!important;
}
.documents-filterbar .filterbar-submit label{
  display:block!important;
  visibility:hidden!important;
  height:14px!important;
  line-height:14px!important;
  margin:0 0 4px!important;
}
.documents-filterbar .filterbar-submit > button,
.documents-filterbar .filterbar-submit > .btn,
.documents-filterbar .filterbar-submit button,
.documents-filterbar .filterbar-submit .btn{
  margin-top:0!important;
  align-self:stretch!important;
  vertical-align:top!important;
}


/* 8.8.28 global filter controls alignment in all modules */
.filterbar{
  align-items:end!important;
}
.filterbar > div,
.filterbar > .filterbar-submit,
.filterbar > button,
.filterbar > .btn{
  align-self:end!important;
}
.filterbar label{
  min-height:14px!important;
  line-height:14px!important;
  margin:0 0 4px!important;
}
.filterbar input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.filterbar select,
.filterbar button,
.filterbar .btn{
  height:32px!important;
  min-height:32px!important;
  line-height:1!important;
  box-sizing:border-box!important;
}
.filterbar > button,
.filterbar > .btn,
.filterbar .filterbar-submit > button,
.filterbar .filterbar-submit > .btn{
  margin-top:0!important;
  align-self:end!important;
}
.filterbar .filterbar-submit{
  display:flex!important;
  flex-direction:column!important;
  justify-content:flex-end!important;
}
.filterbar .filterbar-submit label{
  display:block!important;
  visibility:hidden!important;
  min-height:14px!important;
  height:14px!important;
  line-height:14px!important;
  margin:0 0 4px!important;
}
@media (max-width:760px){
  .filterbar{
    align-items:stretch!important;
  }
  .filterbar > div,
  .filterbar > .filterbar-submit,
  .filterbar > button,
  .filterbar > .btn{
    align-self:stretch!important;
  }
  .filterbar .filterbar-submit label{
    display:none!important;
  }
  .filterbar > button,
  .filterbar > .btn,
  .filterbar .filterbar-submit > button,
  .filterbar .filterbar-submit > .btn{
    width:100%!important;
  }
}


/* 8.8.29 support contact modal fit and usability fix */
.support-info-modal{
  padding:12px!important;
  place-items:center!important;
  align-items:center!important;
}
.support-info-dialog,
.support-contact-dialog{
  width:min(720px,calc(100vw - 24px))!important;
  max-width:720px!important;
  max-height:calc(100dvh - 24px)!important;
  height:auto!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
  border-radius:14px!important;
}
.support-info-head{
  flex:0 0 auto!important;
  position:sticky!important;
  top:0!important;
  z-index:3!important;
}
.support-info-body{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow-y:auto!important;
  -webkit-overflow-scrolling:touch!important;
  padding:16px 20px 18px!important;
}
.support-contact-summary{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
.support-contact-form .grid2{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
.support-contact-form textarea{min-height:92px!important;max-height:180px!important}
.support-info-actions{
  position:sticky!important;
  bottom:0!important;
  z-index:2!important;
  background:linear-gradient(180deg,rgba(255,255,255,.92),#fff 22%)!important;
  margin-top:8px!important;
  padding:12px 0 0!important;
}
body.dark .support-info-actions{background:linear-gradient(180deg,rgba(43,49,55,.92),#2b3137 22%)!important}
@media (max-width:760px){
  .support-info-modal{padding:8px!important}
  .support-info-dialog,.support-contact-dialog{width:calc(100vw - 16px)!important;max-height:calc(100dvh - 16px)!important}
  .support-contact-summary,.support-contact-form .grid2{grid-template-columns:1fr!important}
  .support-info-body{padding:14px 14px 16px!important}
}


/* 8.8.30 larger workspace hero image with less empty space */
.workspace-home-route .workspace-designed .workspace-hero-card,
.workspace-designed .workspace-hero-card,
body.blue-pro-theme .workspace-designed .workspace-hero-card{
  width:min(66vw,920px)!important;
  height:min(70vh,690px)!important;
  padding:10px!important;
}
.workspace-home-route .workspace-designed .workspace-hero-card .workspace-image,
.workspace-designed .workspace-hero-card .workspace-image{
  max-width:100%!important;
  max-height:100%!important;
  width:auto!important;
  height:auto!important;
}
@media (max-width:1100px){
  .workspace-home-route .workspace-designed .workspace-hero-card,
  .workspace-designed .workspace-hero-card,
  body.blue-pro-theme .workspace-designed .workspace-hero-card{
    width:min(76vw,860px)!important;
    height:min(72vh,660px)!important;
    padding:8px!important;
  }
}
@media (max-width:760px){
  .workspace-home-route .workspace-designed .workspace-hero-card,
  .workspace-designed .workspace-hero-card,
  body.blue-pro-theme .workspace-designed .workspace-hero-card{
    width:calc(100% - 8px)!important;
    height:auto!important;
    max-height:calc(100dvh - 110px)!important;
    padding:6px!important;
  }
  .workspace-home-route .workspace-designed .workspace-hero-card .workspace-image,
  .workspace-designed .workspace-hero-card .workspace-image{
    max-height:calc(100dvh - 125px)!important;
  }
}


/* 8.8.31 make workspace start image larger and remove excess surrounding space */
.workspace-home-route .workspace-designed .workspace-hero-card,
.workspace-designed .workspace-hero-card,
body.blue-pro-theme .workspace-designed .workspace-hero-card{
  width:fit-content!important;
  max-width:min(78vw,1120px)!important;
  height:auto!important;
  max-height:none!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  top:54%!important;
}
.workspace-home-route .workspace-designed .workspace-hero-card .workspace-image,
.workspace-designed .workspace-hero-card .workspace-image{
  width:min(78vw,1120px)!important;
  max-width:100%!important;
  height:auto!important;
  max-height:78vh!important;
  display:block!important;
  border-radius:10px!important;
}
@media (max-width:1100px){
  .workspace-home-route .workspace-designed .workspace-hero-card,
  .workspace-designed .workspace-hero-card,
  body.blue-pro-theme .workspace-designed .workspace-hero-card{
    max-width:min(84vw,980px)!important;
  }
  .workspace-home-route .workspace-designed .workspace-hero-card .workspace-image,
  .workspace-designed .workspace-hero-card .workspace-image{
    width:min(84vw,980px)!important;
    max-height:76vh!important;
  }
}
@media (max-width:760px){
  .workspace-home-route .workspace-designed .workspace-hero-card,
  .workspace-designed .workspace-hero-card,
  body.blue-pro-theme .workspace-designed .workspace-hero-card{
    max-width:calc(100% - 4px)!important;
    top:52%!important;
  }
  .workspace-home-route .workspace-designed .workspace-hero-card .workspace-image,
  .workspace-designed .workspace-hero-card .workspace-image{
    width:calc(100vw - 76px)!important;
    max-width:100%!important;
    max-height:calc(100dvh - 105px)!important;
  }
}


/* 9.2.1 workspace toast above hero card + subtle bottom-only shadow */
.workspace-home-route .app-toast-stack{
  transform:translateX(-50%)!important;
  z-index:10060!important;
}
.workspace-home-route .workspace-designed .workspace-hero-card,
.workspace-designed .workspace-hero-card,
body.blue-pro-theme .workspace-designed .workspace-hero-card{
  padding:0 0 10px 0!important;
  background:transparent!important;
  border:0!important;
  box-shadow:0 18px 24px -16px rgba(23,74,122,.34)!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  border-radius:0!important;
}
body.dark .workspace-designed .workspace-hero-card{
  background:transparent!important;
  border-color:transparent!important;
  box-shadow:0 18px 26px -16px rgba(0,0,0,.52)!important;
}
.workspace-home-route .workspace-designed .workspace-hero-card .workspace-image,
.workspace-designed .workspace-hero-card .workspace-image{
  border-radius:10px!important;
}


/* v9.3.1 — orientation guard само за реални телефони/таблети.
   Преоразмерен desktop/PWA прозорец никога не се блокира. */
.mobile-orientation-lock{display:none!important}
@media (orientation:portrait){
  body.mobile-device .mobile-orientation-lock{
    position:fixed!important;
    inset:0!important;
    z-index:2147483647!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    box-sizing:border-box!important;
    padding:max(24px,env(safe-area-inset-top,0px)) max(24px,env(safe-area-inset-right,0px)) max(24px,env(safe-area-inset-bottom,0px)) max(24px,env(safe-area-inset-left,0px))!important;
    background:
      radial-gradient(circle at 18% 15%,rgba(60,151,255,.18),transparent 34%),
      radial-gradient(circle at 84% 82%,rgba(35,201,190,.14),transparent 32%),
      linear-gradient(145deg,#f8fbff 0%,#edf5ff 100%)!important;
    pointer-events:auto!important;
  }
  body.mobile-device .mobile-orientation-lock-card{
    position:relative!important;
    width:min(440px,100%)!important;
    padding:34px 28px 28px!important;
    border:1px solid rgba(126,163,201,.38)!important;
    border-radius:24px!important;
    background:rgba(255,255,255,.96)!important;
    color:#102a46!important;
    text-align:center!important;
    box-shadow:0 24px 70px rgba(27,67,108,.18),0 3px 12px rgba(27,67,108,.08)!important;
    backdrop-filter:blur(12px)!important;
    -webkit-backdrop-filter:blur(12px)!important;
  }
  body.mobile-device .mobile-orientation-lock-icon{
    position:relative!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:92px!important;
    height:92px!important;
    margin:0 auto 22px!important;
    border-radius:28px!important;
    background:linear-gradient(145deg,#1177ed,#045fcb)!important;
    color:#fff!important;
    box-shadow:0 14px 30px rgba(10,103,214,.25)!important;
    font-size:0!important;
  }
  body.mobile-device .mobile-orientation-phone{
    display:block!important;
    font-family:Arial,sans-serif!important;
    font-size:54px!important;
    line-height:1!important;
    font-weight:400!important;
    transform:rotate(90deg)!important;
  }
  body.mobile-device .mobile-orientation-arrow{
    position:absolute!important;
    right:-9px!important;
    bottom:-8px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:38px!important;
    height:38px!important;
    border:4px solid #fff!important;
    border-radius:50%!important;
    background:#16a085!important;
    color:#fff!important;
    font-size:24px!important;
    line-height:1!important;
    box-shadow:0 7px 18px rgba(15,98,91,.25)!important;
  }
  body.mobile-device .mobile-orientation-lock strong{
    display:block!important;
    margin:0!important;
    font-size:22px!important;
    line-height:1.28!important;
    letter-spacing:-.25px!important;
  }
  body.mobile-device .mobile-orientation-lock span:not(.mobile-orientation-phone):not(.mobile-orientation-arrow){
    display:block!important;
    margin-top:11px!important;
    color:#536b84!important;
    font-size:15px!important;
    line-height:1.5!important;
  }
  body.mobile-device .mobile-orientation-lock small{
    display:block!important;
    margin-top:18px!important;
    padding-top:16px!important;
    border-top:1px solid #e4edf6!important;
    color:#7890a8!important;
    font-size:12px!important;
    line-height:1.45!important;
  }
}

/* v9.5.8 — consolidated desktop/PWA home workspace rules.
   This single block replaces the accumulated 9.3.2–9.5.8 override patches. */
html,body{overflow-x:hidden}

@media (min-width:761px){
  body:not(.mobile-device).workspace-home-route,
  body:not(.mobile-device).workspace-home-route .app{
    width:100%;
    height:100vh;
    height:100dvh;
    min-height:100vh;
    min-height:100dvh;
    overflow:hidden;
  }

  body:not(.mobile-device).workspace-home-route .main,
  body:not(.mobile-device).workspace-home-route .sidebar.closed~.main{
    position:relative!important;
    display:block!important;
    min-width:0!important;
    height:calc(100vh - 28px)!important;
    height:calc(100dvh - 28px)!important;
    min-height:0!important;
    padding:0!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }

  body:not(.mobile-device).workspace-home-route .workspace-head,
  body:not(.mobile-device).workspace-home-route .main:has(> .empty-workspace.workspace-designed) > .workspace-head,
  body:not(.mobile-device).workspace-head:has(+ .empty-workspace.workspace-designed){
    position:absolute!important;
    inset:0 auto auto 0!important;
    z-index:700!important;
    display:flex!important;
    align-items:center!important;
    width:263px!important;
    min-width:263px!important;
    max-width:263px!important;
    height:44px!important;
    min-height:44px!important;
    padding:6px 0 6px 8px!important;
    margin:0!important;
    gap:0!important;
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }

  body:not(.mobile-device).workspace-home-route .workspace-tabs,
  body:not(.mobile-device).workspace-head:has(+ .empty-workspace.workspace-designed) .workspace-tabs{
    display:none!important;
  }

  body:not(.mobile-device) .company-switcher,
  body:not(.mobile-device).blue-pro-theme .company-switcher,
  body:not(.mobile-device).workspace-home-route .company-switcher{
    position:relative!important;
    flex:0 0 255px!important;
    display:block!important;
    width:255px!important;
    min-width:255px!important;
    max-width:255px!important;
    height:32px!important;
    min-height:32px!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }

  body:not(.mobile-device) .company-menu,
  body:not(.mobile-device) .company-menu-trigger,
  body:not(.mobile-device) .company-select-shell{
    width:255px!important;
    min-width:255px!important;
    max-width:255px!important;
    height:32px!important;
    min-height:32px!important;
    box-sizing:border-box!important;
  }

  body:not(.mobile-device) .company-menu-trigger{
    display:flex!important;
    align-items:center!important;
    padding:0 34px 0 14px!important;
    font-size:14px!important;
    line-height:1.15!important;
  }

  body:not(.mobile-device) .company-menu-current{
    width:100%!important;
    min-width:0!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }

  body:not(.mobile-device) .company-menu-list{
    width:255px!important;
    min-width:255px!important;
    max-width:255px!important;
    box-sizing:border-box!important;
  }

  body:not(.mobile-device).workspace-home-route .empty-workspace.workspace-designed{
    position:absolute!important;
    inset:0!important;
    width:100%!important;
    max-width:none!important;
    height:100%!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }

  body:not(.mobile-device).workspace-home-route .workspace-designed .workspace-background-layer{
    position:absolute!important;
    inset:0!important;
    width:100%!important;
    height:100%!important;
    background-size:cover!important;
    background-position:center center!important;
    background-repeat:no-repeat!important;
  }

  body:not(.mobile-device).workspace-home-route .workspace-designed .workspace-hero-card,
  body:not(.mobile-device).workspace-home-route.blue-pro-theme .workspace-designed .workspace-hero-card{
    position:absolute!important;
    left:50%!important;
    top:52%!important;
    right:auto!important;
    bottom:auto!important;
    transform:translate(-50%,-50%)!important;
    width:min(760px,calc(100% - 48px))!important;
    height:auto!important;
    max-width:calc(100% - 48px)!important;
    max-height:calc(100dvh - 92px)!important;
    margin:0!important;
    padding:0 0 8px!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }

  body:not(.mobile-device).workspace-home-route .workspace-designed .workspace-hero-card .workspace-image{
    position:relative!important;
    left:auto!important;
    top:auto!important;
    transform:none!important;
    display:block!important;
    width:100%!important;
    height:auto!important;
    max-width:100%!important;
    max-height:calc(100dvh - 100px)!important;
    object-fit:contain!important;
    margin:0 auto!important;
  }
}

@media (min-width:761px) and (max-height:760px){
  body:not(.mobile-device).workspace-home-route .workspace-designed .workspace-hero-card,
  body:not(.mobile-device).workspace-home-route.blue-pro-theme .workspace-designed .workspace-hero-card{
    width:min(660px,calc(100% - 36px))!important;
    max-height:calc(100dvh - 74px)!important;
  }
  body:not(.mobile-device).workspace-home-route .workspace-designed .workspace-hero-card .workspace-image{
    max-height:calc(100dvh - 82px)!important;
  }
}

/* v9.5.8 — unified company selector for profiles with one or multiple companies. */
.company-switcher > span{display:none!important}
.company-menu-single{width:100%!important;height:100%!important}
.company-menu-trigger-static{
  cursor:default!important;
  user-select:none!important;
  padding-right:14px!important;
}
.company-menu-trigger-static:hover,
.company-menu-trigger-static:focus,
.company-menu-trigger-static:focus-visible{
  background:transparent!important;
  outline:0!important;
  box-shadow:none!important;
}
.company-menu-single .company-menu-current{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}


/* v9.3.5.12 — избор между PWA и Desktop инсталация */
.install-choice-modal[hidden]{display:none!important}
.install-choice-modal{position:fixed;inset:0;z-index:2147483600;display:flex;align-items:center;justify-content:center;padding:22px}
.install-choice-backdrop{position:absolute;inset:0;background:rgba(11,38,72,.48);backdrop-filter:blur(5px)}
.install-choice-dialog{position:relative;width:min(860px,calc(100vw - 30px));max-height:calc(100vh - 30px);overflow:auto;background:#fff;border:1px solid #d6e2ee;border-radius:22px;box-shadow:0 28px 90px rgba(10,45,85,.28);padding:28px}
.install-choice-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;border-bottom:1px solid #e4edf5;padding-bottom:18px}
.install-choice-brand{display:flex;align-items:center;gap:15px}.install-choice-brand img{width:64px;height:64px;object-fit:contain}.install-choice-brand h2{margin:0;color:#0b2e63;font-size:26px}.install-choice-brand p{margin:5px 0 0;color:#61758a}
.install-choice-x{width:38px;height:38px;border:0;border-radius:50%;background:#eef4fa;color:#244b75;font-size:25px;line-height:1;cursor:pointer}
.install-choice-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:22px}
.install-choice-card{border:1px solid #cfdeeb;border-radius:17px;background:linear-gradient(180deg,#fff,#f7fbff);padding:22px;display:flex;flex-direction:column;min-height:295px}
.install-choice-card-icon{width:76px;height:76px;border-radius:18px;background:#eaf4ff;display:flex;align-items:center;justify-content:center;color:#146ec7;margin-bottom:16px}.install-choice-card-icon svg{width:44px;height:44px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.install-choice-card.desktop .install-choice-card-icon{background:#eef1ff;color:#4726a7}
.install-choice-card h3{font-size:22px;color:#12355e;margin:0 0 8px}.install-choice-card p{color:#61758a;line-height:1.55;margin:0 0 12px}.install-choice-card ul{margin:0 0 18px;padding-left:20px;color:#36536f;line-height:1.7}.install-choice-card .install-choice-action{margin-top:auto;width:100%;height:46px;border-radius:10px;border:0;background:#1677ea;color:#fff;font-weight:700;cursor:pointer}.install-choice-card.desktop .install-choice-action{background:#4828a8}.install-choice-card .install-choice-hint{font-size:12px;color:#7c8da0;margin-top:9px}.install-choice-card .install-choice-action:disabled{opacity:.65;cursor:wait}
.install-choice-note{margin:18px 0 0;padding:12px 14px;border-radius:10px;background:#f4f8fc;color:#5b7087;font-size:13px;text-align:center}
body.dark .install-choice-dialog{background:#252b31;border-color:#485561}.dark .install-choice-card{background:#2d343b;border-color:#526170}.dark .install-choice-brand h2,.dark .install-choice-card h3{color:#fff}.dark .install-choice-brand p,.dark .install-choice-card p,.dark .install-choice-card ul,.dark .install-choice-note{color:#d1dae3}.dark .install-choice-note{background:#303941}
@media(max-width:720px){.install-choice-grid{grid-template-columns:1fr}.install-choice-dialog{padding:20px}.install-choice-brand h2{font-size:22px}}

/* v9.6.2 — Desktop licenses integrated admin panel */
.desktop-license-panel{padding:18px 0 28px}.desktop-license-panel h1{margin:0;color:var(--text,#17324d)}.desktop-license-panel .card{background:var(--card,#fff);border:1px solid var(--border,#d9e4ee);border-radius:14px;padding:20px;margin-bottom:18px}.desktop-license-panel .grid{display:grid;grid-template-columns:2fr 2fr 1fr 1fr auto;gap:10px}.desktop-license-panel .release{grid-template-columns:1.2fr 1fr auto}.desktop-license-panel .approve{display:flex;gap:7px;align-items:center;flex-wrap:wrap}.desktop-license-panel input,.desktop-license-panel textarea,.desktop-license-panel select,.desktop-license-panel button{padding:10px;border:1px solid #bfcddd;border-radius:8px}.desktop-license-panel button{background:#0d5eaf;color:#fff;cursor:pointer}.desktop-license-panel .secondary{background:#fff;color:#0d5eaf}.desktop-license-panel .danger{background:#b42318}.desktop-license-panel table{width:100%;border-collapse:collapse}.desktop-license-panel th,.desktop-license-panel td{padding:9px;border-bottom:1px solid #e5edf4;text-align:left;vertical-align:top}.desktop-license-panel .key{font:700 18px Consolas;background:#eef7ff;padding:12px;border-radius:8px}.desktop-license-panel .keyrow{display:flex;align-items:center;gap:8px;min-width:250px}.desktop-license-panel .keyvalue{font-family:Consolas,monospace;white-space:nowrap}.desktop-license-panel .bad{color:#b42318}.desktop-license-panel .ok{color:#157347}.desktop-license-panel .pending{color:#b76e00}.desktop-license-panel .muted{color:#687786;font-size:12px}.desktop-license-panel .release-meta{margin-top:8px;padding:10px;background:#f4f8fc;border-radius:8px}.desktop-license-panel .wide{grid-column:1/3}.desktop-notify-grid{grid-template-columns:minmax(260px,520px) auto!important;align-items:center}
.install-choice-select-label{display:block;margin:2px 0 6px;color:#36536f;font-weight:700}.install-choice-select{width:100%;height:42px;border:1px solid #c9d8e7;border-radius:10px;padding:0 10px;margin-bottom:12px;background:#fff;color:#17324d}.install-choice-progress{height:8px;border-radius:999px;background:#e5edf4;overflow:hidden;margin:10px 0}.install-choice-progress>div{height:100%;width:0;background:#1677ea;transition:width .15s ease}.install-choice-open{display:inline-flex;align-items:center;justify-content:center;width:100%;height:42px;border-radius:10px;background:#157347;color:#fff!important;text-decoration:none;font-weight:700;margin-top:8px}.install-choice-open[hidden],.install-choice-progress[hidden]{display:none!important}

/* v9.6.32 — корекция на входа при телефон в хоризонтално положение */
@media (orientation:landscape) and (max-width:950px) and (max-height:620px){
  html,body.login-page-pro{min-height:100%;height:100%;}
  body.login-page-pro{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:8px 10px!important;
    overflow:auto!important;
    box-sizing:border-box!important;
  }
  .login-pro-shell{
    width:min(860px,calc(100vw - 20px))!important;
    height:auto!important;
    min-height:0!important;
    margin:auto!important;
    grid-template-columns:1fr!important;
    border:1px solid #d8e4f2!important;
    border-radius:16px!important;
    overflow:visible!important;
    box-shadow:0 16px 44px rgba(27,65,111,.18)!important;
  }
  .login-pro-panel{
    width:100%!important;
    min-height:0!important;
    margin:0!important;
    padding:14px 20px 12px!important;
    overflow:visible!important;
    box-sizing:border-box!important;
    display:grid!important;
    grid-template-columns:minmax(190px,.72fr) minmax(390px,1.28fr)!important;
    grid-template-areas:
      "brand form"
      "title form"
      "footer links"!important;
    column-gap:24px!important;
    row-gap:8px!important;
    align-items:center!important;
  }
  .login-pro-brand{grid-area:brand!important;text-align:center!important;align-self:end!important;}
  .login-pro-brand img{max-width:190px!important;max-height:46px!important;margin:0 auto 3px!important;}
  .login-pro-brand small{font-size:11px!important;line-height:1.2!important;}
  .login-pro-fallback{font-size:21px!important;gap:8px!important;}
  .login-pro-fallback span{font-size:28px!important;}
  .login-pro-rule{display:none!important;}
  .login-pro-panel h1{grid-area:title!important;margin:0!important;font-size:18px!important;align-self:start!important;}
  .login-pro-panel>form{grid-area:form!important;gap:7px!important;align-self:center!important;}
  .login-pro-input input{height:40px!important;font-size:14px!important;border-radius:9px!important;}
  .login-pro-remember{font-size:11px!important;margin:0!important;}
  .login-pro-submit{min-height:40px!important;font-size:14px!important;border-radius:9px!important;}
  .login-pro-separator{display:none!important;}
  .login-pro-links{
    grid-area:links!important;
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:4px 10px!important;
    align-self:start!important;
  }
  .login-pro-links button{font-size:11px!important;line-height:1.25!important;padding:3px 0!important;}
  .login-pro-links button:last-child{grid-column:1/-1!important;}
  .login-pro-links button:before{width:15px!important;height:15px!important;margin-right:6px!important;font-size:10px!important;}
  .login-custom-text{display:none!important;}
  .login-pro-panel footer{
    grid-area:footer!important;
    margin:0!important;
    padding:8px 0 0!important;
    gap:2px!important;
    font-size:10px!important;
    align-self:start!important;
  }
  .login-pro-panel footer strong{font-size:12px!important;}
  .login-pro-visual{display:none!important;}
}

@media (orientation:landscape) and (max-width:700px) and (max-height:500px){
  .login-pro-panel{
    grid-template-columns:150px minmax(330px,1fr)!important;
    column-gap:14px!important;
    padding:10px 14px!important;
  }
  .login-pro-brand img{max-width:145px!important;max-height:38px!important;}
  .login-pro-brand small,.login-pro-panel footer span{display:none!important;}
  .login-pro-panel h1{font-size:16px!important;}
}


/* v9.6.32 — единно компактно показване във всички документни модули.
   Заключването за изтриване остава функционално, но не се визуализира като отделен ред. */
.document-delete-locked,
.documents-table .document-delete-locked,
.table td.actions .document-delete-locked {
  display: none !important;
}

/* v9.6.32 — responsive Desktop license devices and release history */
.activated-devices-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.activated-devices-head h2{margin:0}
.activated-devices-head input{max-width:420px;width:100%;padding:9px 12px!important;border:1px solid #bfd3e8!important;border-radius:8px!important}
.activated-devices-wrap,.release-history-wrap{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
#activated-devices-table{min-width:1180px}
#activated-devices-table th:last-child{min-width:420px}
.release-history-table{table-layout:fixed}
.release-history-table th:nth-child(1){width:100px}.release-history-table th:nth-child(2){width:105px}.release-history-table th:nth-child(3){width:125px}.release-history-table th:nth-child(5){width:165px}
.release-history-table .release-notes{white-space:normal;line-height:1.45;overflow-wrap:anywhere}
.release-status{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:12px;font-weight:700}
.release-status-published{background:#e7f7ed;color:#157347}.release-status-archived{background:#edf2f7;color:#5b6b7d}
@media (max-width:1280px){
  .activated-devices-card{padding:14px!important}
  .activated-devices-head{margin-bottom:12px}
  .activated-devices-head input{max-width:none}
  .activated-devices-wrap{overflow:visible}
  #activated-devices-table{min-width:0;display:block}
  #activated-devices-table thead{display:none}
  #activated-devices-table tbody{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  #activated-devices-table tr{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 18px;border:1px solid #cfe0ef;border-radius:12px;background:#fff;padding:12px;box-shadow:0 4px 14px rgba(28,72,116,.07)}
  #activated-devices-table td{display:grid;grid-template-columns:128px minmax(0,1fr);align-items:start;gap:8px;border-bottom:1px solid #edf2f7!important;padding:7px 0!important;min-width:0;overflow-wrap:anywhere}
  #activated-devices-table td:before{content:attr(data-label);font-weight:700;color:#36536f}
  #activated-devices-table td[data-label="Действия"]{grid-column:1/-1;display:block;border-bottom:0!important;padding-top:10px!important}
  #activated-devices-table td[data-label="Действия"]:before{display:block;margin-bottom:7px}
  #activated-devices-table .device-actions-inline{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px!important;white-space:normal!important}
  #activated-devices-table .device-actions-inline form,#activated-devices-table .device-actions-inline button{width:100%;white-space:normal!important}
}
@media (max-width:900px){
  #activated-devices-table tbody{grid-template-columns:1fr}
  .release-history-table,.release-history-table tbody,.release-history-table tr,.release-history-table td{display:block;width:100%}
  .release-history-table thead{display:none}
  .release-history-table tr{border:1px solid #d6e2ee;border-radius:10px;padding:10px;margin-bottom:10px;background:#fff}
  .release-history-table td{display:grid;grid-template-columns:120px minmax(0,1fr);gap:10px;border-bottom:1px solid #edf2f7!important;padding:7px 0!important}
  .release-history-table td:before{content:attr(data-label);font-weight:700;color:#36536f}
  .release-history-table td:last-child{border-bottom:0!important}
}
@media (max-width:620px){
  #activated-devices-table tr{grid-template-columns:1fr}
  #activated-devices-table td{grid-template-columns:112px minmax(0,1fr)}
  #activated-devices-table .device-actions-inline{grid-template-columns:1fr}
}


/* v9.6.35 — centered activation filter and visible active Desktop license */
.activated-devices-head input#activation-live-filter{height:38px!important;min-height:38px!important;box-sizing:border-box!important;padding:0 12px!important;line-height:normal!important;vertical-align:middle!important}
.activated-devices-head input#activation-live-filter::placeholder{line-height:normal!important}
.desktop-user-license{margin:0 0 12px;padding:10px 11px;border:1px solid #d7cef8;border-radius:10px;background:#f6f3ff}
.desktop-user-license>span{display:block;margin-bottom:6px;color:#4f3b91;font-size:12px;font-weight:700}
.desktop-user-license-row{display:flex;align-items:center;gap:8px}
.desktop-user-license code{flex:1;min-width:0;padding:8px 9px;border-radius:8px;background:#fff;border:1px solid #ded7f5;color:#2c1b69;font-family:Consolas,monospace;font-size:13px;font-weight:700;overflow-wrap:anywhere;user-select:all}
.desktop-user-license-copy{height:34px!important;min-width:72px!important;padding:0 10px!important;border-radius:8px!important;background:#5b37bb!important;color:#fff!important}
.desktop-user-license-unavailable{padding:8px 9px;border-radius:8px;background:#fff;border:1px solid #ded7f5;color:#2c1b69;font-family:Consolas,monospace;font-weight:700}
.desktop-user-license-unavailable small{display:block;margin-top:4px;color:#7d719c;font-family:inherit;font-weight:400}
body.dark .desktop-user-license{background:#30294a;border-color:#5c4d8a}
body.dark .desktop-user-license code,body.dark .desktop-user-license-unavailable{background:#272233;border-color:#514669;color:#fff}
@media(max-width:620px){.desktop-user-license-row{align-items:stretch;flex-direction:column}.desktop-user-license-copy{width:100%}}

/* BG Faktura 9.6.35 - modern release history */
.release-history-modern{margin-top:16px}.release-history-titlebar{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}.release-history-titlebar h3{margin:0 0 10px}.release-history-info{margin:0;padding:10px 14px;border:1px solid #cfe0f2;border-radius:8px;background:#f8fbff;color:#315579}.release-history-filters{display:grid;grid-template-columns:minmax(260px,1.5fr) minmax(170px,.9fr) minmax(170px,.9fr) minmax(160px,.75fr) auto;gap:12px;margin:18px 0}.release-history-filters input,.release-history-filters select,.release-history-filters button{height:42px;margin:0}.release-search-box{position:relative;display:block}.release-search-box input{width:100%;padding-right:42px}.release-search-box>span:last-child{position:absolute;right:14px;top:50%;transform:translateY(-50%);font-size:24px;color:#315579;pointer-events:none}.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.release-history-layout{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(390px,1fr);border:1px solid #deebf6;border-radius:14px;overflow:hidden;background:#fff;box-shadow:0 8px 24px rgba(33,93,151,.08)}.release-history-list-panel{min-width:0;padding:16px 0 0}.release-history-table-head,.release-history-row{display:grid;grid-template-columns:105px 110px 125px minmax(210px,1fr) 160px 26px;align-items:center;gap:10px}.release-history-table-head{padding:0 20px 12px;color:#24517e;font-weight:700;font-size:13px}.release-history-row{width:calc(100% - 20px);margin:0 10px;padding:15px 10px;border:0;border-top:1px solid #e4edf5;border-radius:0;background:#fff;color:#183f68;text-align:left;box-shadow:none;cursor:pointer}.release-history-row:hover{background:#f7fbff}.release-history-row.is-selected{border:1px solid #9ecbfa;border-radius:9px;background:#f1f8ff;box-shadow:0 4px 14px rgba(31,126,223,.08)}.release-cell{min-width:0}.release-version{font-size:14px}.release-notes-preview{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.45;color:#315579}.release-arrow{font-size:24px;color:#32699d;text-align:center}.release-status{display:inline-flex;align-items:center;width:max-content;padding:4px 9px;border-radius:7px;font-size:12px;font-weight:700}.release-status-published{background:#e2f7e8;color:#237541;border:1px solid #bfe9ca}.release-status-archived{background:#edf3f8;color:#60778d;border:1px solid #d4e0ea}.release-history-empty{padding:30px;text-align:center;color:#6f8498}.release-history-pagination{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 20px;border-top:1px solid #e4edf5}.release-history-pagination label{display:flex;align-items:center;gap:8px;white-space:nowrap}.release-history-pagination select{width:72px;height:36px}.release-page-buttons{display:flex;align-items:center;gap:6px}.release-page-buttons button,.release-page-buttons span button{min-width:36px;height:36px;padding:0 10px}.release-page-buttons span{display:flex;gap:6px}.release-page-buttons .is-active{background:#187de0;color:#fff;border-color:#187de0}.release-detail-panel{min-width:0;padding:18px;border-left:1px solid #e4edf5;background:#fff}.release-detail-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.release-detail-heading h3{margin:0 0 16px}.release-detail-close{border:0;background:transparent;color:#24517e;box-shadow:none;font-size:28px;line-height:1;padding:0 4px}.release-detail-grid{display:grid;grid-template-columns:110px minmax(0,1fr) 115px minmax(0,1fr);gap:17px 10px;margin:20px 0;padding-bottom:18px;border-bottom:1px solid #dce8f3}.release-detail-grid dt{color:#5c7792}.release-detail-grid dd{margin:0;color:#173f68;overflow-wrap:anywhere}.release-detail-wide{grid-column:span 3}.release-sha{display:flex;align-items:center;gap:8px}.release-sha span{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.release-sha button{flex:0 0 auto;min-width:36px;padding:7px}.release-full-notes h4,.release-detail-actions h4{margin:0 0 12px;color:#173f68}.release-full-notes>div{min-height:110px;padding:14px;border:1px solid #cfe0f2;border-radius:8px;background:#fbfdff;white-space:pre-wrap;line-height:1.65;color:#244e75}.release-detail-actions{margin-top:18px;padding-top:18px;border-top:1px solid #dce8f3}.release-detail-actions .btn,.release-detail-actions button{display:inline-flex;align-items:center;justify-content:center;margin:0 8px 8px 0;text-decoration:none}.release-clear-filters{white-space:nowrap}
@media(max-width:1200px){.release-history-filters{grid-template-columns:1fr 1fr 1fr}.release-history-layout{grid-template-columns:1fr}.release-detail-panel{border-left:0;border-top:1px solid #e4edf5}.release-history-table-head,.release-history-row{grid-template-columns:95px 105px 115px minmax(180px,1fr) 145px 20px}}
@media(max-width:850px){.release-history-filters{grid-template-columns:1fr 1fr}.release-history-table-head{display:none}.release-history-row{grid-template-columns:1fr auto;padding:14px}.release-history-row .release-cell{grid-column:1}.release-history-row .release-cell:nth-child(2){grid-column:2;grid-row:1}.release-history-row .release-arrow{grid-column:2;grid-row:2/6}.release-history-pagination{flex-wrap:wrap}.release-detail-grid{grid-template-columns:105px minmax(0,1fr)}.release-detail-wide{grid-column:2}.release-history-layout{border-radius:10px}}
@media(max-width:560px){.release-history-filters{grid-template-columns:1fr}.release-history-pagination{align-items:flex-start;flex-direction:column}.release-page-buttons{width:100%;justify-content:center}.release-detail-panel{padding:14px}.release-detail-grid{grid-template-columns:1fr}.release-detail-grid dt{font-weight:700}.release-detail-grid dd,.release-detail-wide{grid-column:1}.release-detail-actions .btn,.release-detail-actions button{width:100%;margin-right:0}}
.release-detail-panel.is-collapsed>*:not(.release-detail-heading):not(#detail-current-badge){display:none}.release-detail-panel.is-collapsed{align-self:start}.release-detail-panel.is-collapsed .release-detail-heading{margin-bottom:16px}.release-detail-panel.is-collapsed .release-detail-heading h3{margin-bottom:0}.release-detail-panel.is-collapsed #detail-current-badge{display:inline-flex!important}

/* 9.7.0 release history visual alignment fix */
.release-history-titlebar{margin-bottom:6px}
.release-history-titlebar h3{font-size:18px;color:#173f68}
.release-history-info{max-width:100%;line-height:1.45}
.release-history-filters{align-items:center}
.release-history-filters input,
.release-history-filters select,
.release-history-filters button{border-radius:8px!important}
.release-history-layout{grid-template-columns:minmax(0,1.62fr) minmax(420px,1fr)!important;border:1px solid #d9e7f4!important;border-radius:14px!important;box-shadow:0 8px 24px rgba(33,93,151,.06)!important;background:#fff!important}
.release-history-list-panel{padding:14px 0 0!important;background:#fff!important}
.release-history-table-head{padding:0 18px 14px!important;color:#25507e!important;font-size:13px!important}
.release-history-table-head,.release-history-row{grid-template-columns:95px 108px 122px minmax(235px,1fr) 170px 24px!important}
button.release-history-row,
body.blue-pro-theme button.release-history-row,
body.custom-profile-theme button.release-history-row{appearance:none!important;-webkit-appearance:none!important;display:grid!important;width:calc(100% - 20px)!important;margin:0 10px!important;padding:16px 10px!important;background:#fff!important;background-image:none!important;color:#183f68!important;border:0!important;border-top:1px solid #e4edf5!important;border-radius:0!important;box-shadow:none!important;text-align:left!important;min-height:auto!important;transform:none!important;filter:none!important}
button.release-history-row:hover,
body.blue-pro-theme button.release-history-row:hover,
body.custom-profile-theme button.release-history-row:hover{background:#f7fbff!important;filter:none!important;transform:none!important}
button.release-history-row.is-selected,
body.blue-pro-theme button.release-history-row.is-selected,
body.custom-profile-theme button.release-history-row.is-selected{background:#f2f8ff!important;border:1px solid #9ecbfa!important;border-radius:10px!important;box-shadow:0 4px 14px rgba(31,126,223,.08)!important;margin-top:6px!important;margin-bottom:6px!important}
.release-history-row .release-cell,.release-history-row .release-arrow{color:inherit!important}
.release-history-row .release-version b{font-size:14px;color:#18456f}
.release-history-row .release-notes-preview{color:#315579!important}
.release-history-row .muted{color:#7a8ea4!important}
.release-arrow{font-size:20px!important;color:#6285a8!important}
.release-status{display:inline-flex!important;align-items:center!important;justify-content:center!important;padding:4px 10px!important;border-radius:8px!important;font-size:12px!important;font-weight:700!important;min-height:0!important;line-height:1.2!important;box-shadow:none!important}
.release-status-published{background:#e2f7e8!important;color:#237541!important;border:1px solid #bfe9ca!important}
.release-status-archived{background:#edf3f8!important;color:#60778d!important;border:1px solid #d4e0ea!important}
.release-history-pagination{padding:16px 18px!important;background:#fff!important}
.release-page-buttons button,
.release-detail-actions button,
.release-detail-actions .btn,
body.blue-pro-theme .release-detail-actions button,
body.blue-pro-theme .release-detail-actions .btn,
body.custom-profile-theme .release-detail-actions button,
body.custom-profile-theme .release-detail-actions .btn{min-height:38px!important;border-radius:8px!important;box-shadow:none!important;text-decoration:none!important}
.release-page-buttons button.secondary,
.release-detail-actions button.secondary,
body.blue-pro-theme .release-page-buttons button.secondary,
body.blue-pro-theme .release-detail-actions button.secondary,
body.custom-profile-theme .release-page-buttons button.secondary,
body.custom-profile-theme .release-detail-actions button.secondary{background:#fff!important;color:#24517e!important;border:1px solid #c9d9e8!important}
.release-page-buttons .is-active{background:#187de0!important;color:#fff!important;border-color:#187de0!important}
.release-detail-panel{padding:18px 18px 20px!important;background:#fff!important;border-left:1px solid #e4edf5!important}
.release-detail-heading h3{margin:0 0 16px!important;color:#173f68!important;font-size:18px!important}
button.release-detail-close,
body.blue-pro-theme button.release-detail-close,
body.custom-profile-theme button.release-detail-close{background:transparent!important;background-image:none!important;border:0!important;color:#4f6d8d!important;box-shadow:none!important;min-height:auto!important;padding:0 4px!important;font-size:30px!important;line-height:1!important;transform:none!important;filter:none!important}
button.release-detail-close:hover,
body.blue-pro-theme button.release-detail-close:hover,
body.custom-profile-theme button.release-detail-close:hover{color:#173f68!important;background:transparent!important}
.release-detail-grid{gap:16px 12px!important;margin:18px 0!important;padding-bottom:18px!important}
.release-detail-grid dt{color:#5c7792!important}
.release-detail-grid dd{color:#173f68!important}
.release-full-notes h4,.release-detail-actions h4{color:#173f68!important}
.release-full-notes>div{min-height:118px!important;border-radius:8px!important;background:#fbfdff!important;border:1px solid #cfe0f2!important;line-height:1.6!important}
.release-sha button,
body.blue-pro-theme .release-sha button,
body.custom-profile-theme .release-sha button{background:#fff!important;color:#24517e!important;border:1px solid #c9d9e8!important;min-width:38px!important;min-height:38px!important;padding:0!important;box-shadow:none!important}
@media (max-width:1200px){.release-history-layout{grid-template-columns:1fr!important}.release-detail-panel{border-left:0!important;border-top:1px solid #e4edf5!important}}
@media (max-width:850px){.release-history-filters{grid-template-columns:1fr 1fr!important}.release-history-table-head{display:none!important}.release-history-row{grid-template-columns:1fr auto!important}.release-detail-grid{grid-template-columns:105px minmax(0,1fr)!important}.release-detail-wide{grid-column:2!important}}

/* 9.6.39 release search field alignment and page size hardening */
.release-search-box input#release-history-search,
.release-history-filters input[type="search"]{
  height:42px!important;
  min-height:42px!important;
  box-sizing:border-box!important;
  padding:0 42px 0 14px!important;
  line-height:normal!important;
  vertical-align:middle!important;
  -webkit-appearance:none!important;
  appearance:none!important;
}
.release-search-box input#release-history-search::placeholder,
.release-history-filters input[type="search"]::placeholder{
  line-height:normal!important;
}
.release-history-list{min-height:0}

/* 9.6.39 enforce pagination visibility */
.release-history-row[hidden]{display:none!important}

/* 9.6.43 unify release search input with standard form fields */
.release-history-filters .release-search-box input#release-history-search,
body.blue-pro-theme .release-history-filters .release-search-box input#release-history-search,
body.custom-profile-theme .release-history-filters .release-search-box input#release-history-search{
  width:100%!important;
  height:38px!important;
  min-height:38px!important;
  box-sizing:border-box!important;
  margin:0!important;
  padding:0 42px 0 12px!important;
  border:1px solid #bfd3e8!important;
  border-radius:7px!important;
  background:#fff!important;
  background-image:none!important;
  color:#173f68!important;
  font:inherit!important;
  font-size:13px!important;
  font-weight:400!important;
  line-height:38px!important;
  text-align:left!important;
  direction:ltr!important;
  vertical-align:middle!important;
  box-shadow:none!important;
  outline:none!important;
  -webkit-appearance:none!important;
  appearance:none!important;
}
.release-history-filters .release-search-box input#release-history-search:focus,
body.blue-pro-theme .release-history-filters .release-search-box input#release-history-search:focus,
body.custom-profile-theme .release-history-filters .release-search-box input#release-history-search:focus{
  background:#fff!important;
  border-color:#318de5!important;
  box-shadow:0 0 0 3px rgba(49,141,229,.14)!important;
  text-align:left!important;
}
.release-history-filters .release-search-box input#release-history-search::placeholder{
  color:#6c7d91!important;
  opacity:1!important;
  line-height:38px!important;
  text-align:left!important;
}
.release-history-filters .release-search-box input#release-history-search::-webkit-search-cancel-button,
.release-history-filters .release-search-box input#release-history-search::-webkit-search-decoration{
  -webkit-appearance:none!important;
  appearance:none!important;
}

/* 9.6.43 unify activated devices search input with standard form fields */
.activated-devices-head input#activation-live-filter,
body.blue-pro-theme .activated-devices-head input#activation-live-filter,
body.custom-profile-theme .activated-devices-head input#activation-live-filter{
  width:100%!important;
  max-width:420px!important;
  height:38px!important;
  min-height:38px!important;
  box-sizing:border-box!important;
  margin:0!important;
  padding:0 12px!important;
  border:1px solid #bfd3e8!important;
  border-radius:7px!important;
  background:#fff!important;
  background-image:none!important;
  color:#173f68!important;
  font:inherit!important;
  font-size:13px!important;
  font-weight:400!important;
  line-height:38px!important;
  text-align:left!important;
  direction:ltr!important;
  vertical-align:middle!important;
  box-shadow:none!important;
  outline:none!important;
  -webkit-appearance:none!important;
  appearance:none!important;
}
.activated-devices-head input#activation-live-filter:focus,
body.blue-pro-theme .activated-devices-head input#activation-live-filter:focus,
body.custom-profile-theme .activated-devices-head input#activation-live-filter:focus{
  background:#fff!important;
  border-color:#318de5!important;
  box-shadow:0 0 0 3px rgba(49,141,229,.14)!important;
  text-align:left!important;
}
.activated-devices-head input#activation-live-filter::placeholder{
  color:#6c7d91!important;
  opacity:1!important;
  line-height:38px!important;
  text-align:left!important;
}
.activated-devices-head input#activation-live-filter::-webkit-search-cancel-button,
.activated-devices-head input#activation-live-filter::-webkit-search-decoration{
  -webkit-appearance:none!important;
  appearance:none!important;
}
@media(max-width:1200px){
  .activated-devices-head input#activation-live-filter{max-width:none!important}
}

/* 9.6.43 exact standard input rendering for both live-search fields */
.release-history-filters .release-search-box input#release-history-search,
body.blue-pro-theme .release-history-filters .release-search-box input#release-history-search,
body.custom-profile-theme .release-history-filters .release-search-box input#release-history-search,
.activated-devices-head input#activation-live-filter,
body.blue-pro-theme .activated-devices-head input#activation-live-filter,
body.custom-profile-theme .activated-devices-head input#activation-live-filter{
  display:block!important;
  width:100%!important;
  height:31px!important;
  min-height:31px!important;
  max-height:31px!important;
  box-sizing:border-box!important;
  margin:0!important;
  padding:5px 8px!important;
  border:1px solid var(--line,#bfd3e8)!important;
  border-radius:3px!important;
  background:#fff!important;
  background-image:none!important;
  color:#222!important;
  font-family:Arial,sans-serif!important;
  font-size:13px!important;
  font-weight:400!important;
  font-style:normal!important;
  line-height:19px!important;
  text-align:left!important;
  text-indent:0!important;
  direction:ltr!important;
  vertical-align:middle!important;
  box-shadow:none!important;
  outline:none!important;
  transform:none!important;
  writing-mode:horizontal-tb!important;
  appearance:none!important;
  -webkit-appearance:none!important;
}
.release-history-filters .release-search-box input#release-history-search:focus,
body.blue-pro-theme .release-history-filters .release-search-box input#release-history-search:focus,
body.custom-profile-theme .release-history-filters .release-search-box input#release-history-search:focus,
.activated-devices-head input#activation-live-filter:focus,
body.blue-pro-theme .activated-devices-head input#activation-live-filter:focus,
body.custom-profile-theme .activated-devices-head input#activation-live-filter:focus{
  background:#fff!important;
  color:#222!important;
  border-color:#318de5!important;
  box-shadow:0 0 0 3px rgba(49,141,229,.14)!important;
  line-height:19px!important;
  text-align:left!important;
  text-indent:0!important;
}
.release-history-filters .release-search-box input#release-history-search::placeholder,
.activated-devices-head input#activation-live-filter::placeholder{
  color:#687582!important;
  opacity:1!important;
  line-height:19px!important;
  text-align:left!important;
}
.release-search-box{display:flex!important;align-items:center!important;height:42px!important}
.release-search-box>span:last-child{top:50%!important}
.activated-devices-head{align-items:center!important}
.activated-devices-head input#activation-live-filter{max-width:420px!important}
@media(max-width:1200px){.activated-devices-head input#activation-live-filter{max-width:none!important}}


/* 9.7.0 unify search fields with standard rounded inputs */
.release-history-filters .release-search-box{position:relative;display:block}
.release-history-filters .release-search-box input#release-history-search,
body.blue-pro-theme .release-history-filters .release-search-box input#release-history-search,
body.custom-profile-theme .release-history-filters .release-search-box input#release-history-search,
.activated-devices-head input#activation-live-filter,
body.blue-pro-theme .activated-devices-head input#activation-live-filter,
body.custom-profile-theme .activated-devices-head input#activation-live-filter{
  width:100%!important;
  height:31px!important;
  min-height:31px!important;
  box-sizing:border-box!important;
  padding:5px 34px 5px 8px!important;
  border:1px solid var(--line)!important;
  border-radius:3px!important;
  background:#fff!important;
  color:#222!important;
  box-shadow:none!important;
  line-height:20px!important;
  outline:none!important;
  appearance:none!important;
  -webkit-appearance:none!important;
}
.release-history-filters .release-search-box input#release-history-search:focus,
body.blue-pro-theme .release-history-filters .release-search-box input#release-history-search:focus,
body.custom-profile-theme .release-history-filters .release-search-box input#release-history-search:focus,
.activated-devices-head input#activation-live-filter:focus,
body.blue-pro-theme .activated-devices-head input#activation-live-filter:focus,
body.custom-profile-theme .activated-devices-head input#activation-live-filter:focus{
  border-color:#9fb5cb!important;
  background:#fff!important;
  box-shadow:none!important;
}
.release-history-filters .release-search-box input#release-history-search::placeholder,
.activated-devices-head input#activation-live-filter::placeholder{
  color:#8a95a1!important;
  opacity:1!important;
  line-height:20px!important;
}
.release-history-filters .release-search-box > span:last-child{
  right:10px!important;
  top:50%!important;
  transform:translateY(-50%)!important;
  font-size:16px!important;
  color:#5b7187!important;
}
.activated-devices-head{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;flex-wrap:wrap!important;padding-right:10px!important}
.activated-devices-head input#activation-live-filter{max-width:360px!important;margin-right:6px!important}
@media(max-width:1200px){.activated-devices-head{padding-right:0!important}.activated-devices-head input#activation-live-filter{max-width:none!important;margin-right:0!important}}

/* 9.7.0 final spacing and rounded input unification */
.release-history-filters{
  padding:8px 0 10px!important;
  align-items:center!important;
}
.release-history-filters .release-search-box{
  height:34px!important;
  min-height:34px!important;
  display:flex!important;
  align-items:center!important;
}
.release-history-filters .release-search-box input#release-history-search,
body.blue-pro-theme .release-history-filters .release-search-box input#release-history-search,
body.custom-profile-theme .release-history-filters .release-search-box input#release-history-search,
.activated-devices-head input#activation-live-filter,
body.blue-pro-theme .activated-devices-head input#activation-live-filter,
body.custom-profile-theme .activated-devices-head input#activation-live-filter{
  height:34px!important;
  min-height:34px!important;
  padding:0 34px 0 12px!important;
  border:1px solid #bfd3e8!important;
  border-radius:8px!important;
  background:#fff!important;
  color:#26303a!important;
  line-height:32px!important;
  box-shadow:none!important;
}
.release-history-filters .release-search-box input#release-history-search::placeholder,
.activated-devices-head input#activation-live-filter::placeholder{
  line-height:32px!important;
  color:#7a8794!important;
}
.release-history-filters .release-search-box input#release-history-search:focus,
body.blue-pro-theme .release-history-filters .release-search-box input#release-history-search:focus,
body.custom-profile-theme .release-history-filters .release-search-box input#release-history-search:focus,
.activated-devices-head input#activation-live-filter:focus,
body.blue-pro-theme .activated-devices-head input#activation-live-filter:focus,
body.custom-profile-theme .activated-devices-head input#activation-live-filter:focus{
  border-color:#7fb3e6!important;
  box-shadow:0 0 0 3px rgba(49,141,229,.10)!important;
}
.activated-devices-head{
  padding:4px 12px 10px 0!important;
  margin-bottom:4px!important;
}
.activated-devices-head input#activation-live-filter{
  max-width:360px!important;
  margin:0 4px 0 0!important;
}
@media(max-width:1200px){
  .activated-devices-head{padding:4px 0 10px!important}
  .activated-devices-head input#activation-live-filter{max-width:none!important;margin:0!important}
}

/* v9.7.0 - stable action forms and counterparty quick-add */
.inline-action-form{display:inline-flex;margin:0;padding:0;vertical-align:middle}
.inline-action-form .btn{margin:0}
.counterparty-results .counterparty-new-top{position:sticky;top:0;z-index:3;background:var(--panel,#fff);border-bottom:1px solid rgba(120,130,140,.28);box-shadow:0 3px 8px rgba(0,0,0,.06)}

/* v9.6.39 - clean counterparty chooser: action header never overlaps scrolling rows */
.counterparty-results.counterparty-results-fixed-head{
  max-height:none!important;
  overflow:hidden!important;
  padding:0!important;
  background:#fff!important;
}
.counterparty-results-fixed-head .counterparty-new-top{
  position:relative!important;
  top:auto!important;
  z-index:2!important;
  flex:0 0 auto!important;
  min-height:36px!important;
  background:#fff!important;
  border-bottom:1px solid #cfd7df!important;
  box-shadow:none!important;
}
.counterparty-results-fixed-head .counterparty-options-scroll{
  display:block!important;
  max-height:242px!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain;
  background:#fff!important;
}
body.dark .counterparty-results.counterparty-results-fixed-head,
body.dark .counterparty-results-fixed-head .counterparty-new-top,
body.dark .counterparty-results-fixed-head .counterparty-options-scroll{
  background:#2f353b!important;
}
body.blue-pro-theme .counterparty-results.counterparty-results-fixed-head,
body.blue-pro-theme .counterparty-results-fixed-head .counterparty-new-top,
body.blue-pro-theme .counterparty-results-fixed-head .counterparty-options-scroll{
  background:#fff!important;
}

/* 9.7.0 — keep the original document action layout while POST forms remain secure. */
.documents-table td.actions > form.document-action-inline{display:contents!important}
.documents-table td.actions > form.document-action-inline > .btn{
  order:1!important;width:100%!important;min-width:0!important;max-width:none!important;
  height:28px!important;min-height:28px!important;padding:4px 6px!important;font-size:11px!important;
  white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
}
@media(max-width:1100px){.documents-table td.actions > form.document-action-inline > .btn{font-size:10px!important;padding:4px 5px!important}}


/* Payment page summary 9.7.0 */
.payment-page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:14px}.payment-page-head h2{margin:0 0 3px}.payment-state{display:inline-flex;align-items:center;justify-content:center;padding:5px 10px;border-radius:999px;font-weight:800;font-size:12px;white-space:nowrap}.payment-state.unpaid{background:#fff2c7;color:#7a5700}.payment-state.partial{background:#e8f1ff;color:#165a9d}.payment-state.paid{background:#dff5e5;color:#287a3f}.payment-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0 0 16px}.payment-summary-box{border:1px solid #cbd9e8;background:#f7fbff;border-radius:8px;padding:12px 14px}.payment-summary-box span{display:block;color:#61758a;font-size:12px;margin-bottom:4px}.payment-summary-box strong{display:block;color:#173f68;font-size:20px;line-height:1.15}.payment-summary-box.remaining{background:#eef6ff;border-color:#a9c9eb}.payment-summary-box.remaining strong{font-size:22px}.payment-complete-note{margin:2px 0 16px;padding:11px 13px;border:1px solid #b9dfc3;background:#edf9f0;color:#286b39;border-radius:8px;font-weight:700}.payment-page-card .table-wrap{margin-top:8px}
@media(max-width:760px){.payment-page-head{align-items:stretch;flex-direction:column}.payment-state{align-self:flex-start}.payment-summary-grid{grid-template-columns:1fr}.payment-summary-box strong,.payment-summary-box.remaining strong{font-size:19px}}

/* BG Faktura 9.8.0 FINAL STABLE — document workflow refinements */
.document-related-note{display:block;margin-top:2px;font-size:10px;color:var(--muted);white-space:nowrap}
.btn.danger-outline,.danger-outline{background:#fff!important;color:#a72a22!important;border:1px solid #d9a3a0!important;box-shadow:none!important}
.btn.danger-outline:hover,.danger-outline:hover{background:#fff3f2!important}
.documents-table td.actions{align-items:center}
@media (min-width:1100px){.documents-table td.actions>.btn,.documents-table td.actions>.document-action-inline>.btn{min-width:74px}}

/* v18.08.2026 — modal payments from Documents */
.payment-modal[hidden]{display:none!important}.payment-modal{position:fixed;inset:0;z-index:2147482500;display:flex;align-items:center;justify-content:center;padding:20px}.payment-modal-backdrop{position:absolute;inset:0;background:rgba(15,35,55,.48);backdrop-filter:blur(2px)}.payment-modal-dialog{position:relative;z-index:1;width:min(1180px,96vw);height:min(760px,92vh);background:#fff;border:1px solid #b9cfe3;border-radius:14px;box-shadow:0 22px 60px rgba(8,42,75,.28);display:grid;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden}.payment-modal-header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:16px 18px 12px;border-bottom:1px solid #d3e1ed;background:#f7fbff}.payment-modal-header h2{margin:0 0 3px;font-size:20px;color:#173f68}.payment-modal-header p{margin:0;color:#6c8093;font-size:13px}.payment-modal-x{width:36px;height:36px;min-width:36px;padding:0;border-radius:8px;font-size:24px;line-height:1;background:#fff;color:#365b7b;border:1px solid #c6d8e8}.payment-modal-body{position:relative;min-height:0;background:#eef6ff}.payment-modal-content{width:100%;height:100%;overflow:auto;background:#eef6ff;display:block;padding:14px}.payment-modal-content .payment-page-card{margin:0}.payment-modal-error{margin:18px;padding:16px;border:1px solid #efb8b8;border-radius:8px;background:#fff0f0;color:#9d3030}.payment-modal-loading[hidden]{display:none!important}.payment-modal-loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#61758a;font-weight:700;background:#eef6ff;z-index:2}.payment-modal-actions{display:flex;justify-content:flex-end;gap:9px;padding:11px 16px;border-top:1px solid #d3e1ed;background:#fff}.payment-modal-actions [data-payment-next][disabled]{opacity:.45;cursor:not-allowed}.payment-embed-body{margin:0!important;background:#eef6ff!important;min-height:100vh;color:#173b60}.payment-embed-main{padding:14px}.payment-embed-main .payment-page-card{margin:0}.payment-embed-flash{margin:0 0 10px;padding:10px 12px;border-radius:7px;font-weight:700;border:1px solid #b9d7ed;background:#f7fbff;color:#245779}.payment-embed-flash.success{border-color:#b9dfc3;background:#edf9f0;color:#286b39}.payment-embed-flash.warning{border-color:#ead59b;background:#fff8df;color:#7a5700}.payment-embed-flash.error,.payment-embed-flash.validation{border-color:#efb8b8;background:#fff0f0;color:#9d3030}.payment-embed-main .payment-page-head h2{font-size:18px}.payment-embed-main .payment-summary-box strong{font-size:18px}.payment-embed-main .payment-summary-box.remaining strong{font-size:20px}
body.dark .payment-modal-dialog,body.dark .payment-modal-actions{background:#20262c;border-color:#3c4a56}body.dark .payment-modal-header{background:#252d35;border-color:#3c4a56}body.dark .payment-modal-header h2{color:#e6eef5}body.dark .payment-modal-header p{color:#9fb0bf}body.dark .payment-modal-x{background:#2a333c;color:#dbe7f1;border-color:#465666}
@media(max-width:760px){.payment-modal{padding:6px}.payment-modal-dialog{width:100%;height:97vh;border-radius:10px}.payment-modal-header{padding:11px 12px}.payment-modal-header p{display:none}.payment-modal-actions{padding:8px 10px}.payment-embed-main{padding:8px}}

/* Размери на идентификаторите и наименованията на контрагентите. */
#customerListTable{min-width:880px!important;table-layout:auto!important}
#customerListTable th:nth-child(1),#customerListTable td:nth-child(1){min-width:120px;white-space:nowrap;overflow-wrap:normal;word-break:normal}
#customerListTable th:nth-child(3),#customerListTable td:nth-child(3){min-width:125px;white-space:nowrap;overflow-wrap:normal;word-break:normal;font-variant-numeric:tabular-nums}
#customerListTable th:nth-child(4),#customerListTable td:nth-child(4){min-width:145px;white-space:nowrap;overflow-wrap:normal;word-break:normal;font-variant-numeric:tabular-nums}
#customerListTable th:nth-child(2){min-width:180px}
#customerListTable .actions{white-space:nowrap}
#customerListTable{max-width:none!important}
#customerListTable.table td:nth-child(3),#customerListTable.table td:nth-child(4){overflow-wrap:normal!important;word-break:keep-all!important}
.document-email-modal[hidden]{display:none!important}
.document-email-modal{position:fixed;inset:0;z-index:26000;display:flex;align-items:center;justify-content:center;padding:18px}
.document-email-backdrop{position:absolute;inset:0;background:rgba(17,31,45,.58)}
.document-email-dialog{position:relative;width:min(550px,96vw);background:#fff;border-radius:9px;box-shadow:0 15px 45px #0005;overflow:hidden;color:#26303a}
.document-email-fields{padding:17px 20px;display:grid;gap:7px}
.document-email-fields label{margin-top:5px}.document-email-fields textarea{min-height:120px}
.document-email-attachment{margin:8px 0 0;color:#526478;font-size:13px}
.document-email-result{min-height:18px;margin:3px 0;color:#255779;font-size:13px}

.table-wrap.customer-list-table-wrap{overflow-x:auto!important;overflow-y:auto!important;max-width:100%!important}

/* Клиентски интерфейс: менюто се отваря върху работната област. */
body:not(.login-page) .sidebar~.main,
body:not(.login-page) .sidebar.closed~.main{
  margin-left:var(--bgf-rail-offset,46px)!important;
  width:calc(100% - var(--bgf-rail-offset,46px))!important;
  max-width:none!important;
  box-sizing:border-box!important;
}
.bgf-menu-backdrop{display:none;position:fixed;inset:0;z-index:29;background:rgba(18,34,54,.37)}
body.bgf-menu-open .bgf-menu-backdrop{display:block}
body.bgf-menu-open .sidebar:not(.closed){z-index:35!important}
body.bgf-menu-open .rail{z-index:40!important}
@media(max-width:1024px){
  body:not(.login-page) .sidebar~.main,
  body:not(.login-page) .sidebar.closed~.main{margin-left:var(--mobile-rail,46px)!important;width:calc(100% - var(--mobile-rail,46px))!important}
}

/* Обратна връзка за изпращане на документи; същата визуална система като останалите диалози. */
.document-email-progress[hidden]{display:none!important}
.document-email-progress{display:flex;align-items:center;gap:13px;margin:7px 0 4px;padding:11px 12px;border:1px solid #d2e2f2;border-radius:7px;background:#f3f8fd;color:#194d7b;min-height:55px}
.document-email-progress-content{display:flex;flex-direction:column;gap:4px;font-size:12px;line-height:1.35}
.document-email-progress-content strong{font-size:13px}
.document-email-spinner{width:23px;height:23px;border:3px solid #c2d9ed;border-top-color:#1377d4;border-radius:50%;flex:0 0 auto;animation:bgf-email-spin .8s linear infinite}
@keyframes bgf-email-spin{to{transform:rotate(360deg)}}
.document-email-progress[data-stage="success"]{background:#eff9f1;border-color:#b9e4c3;color:#226c35}
.document-email-progress[data-stage="error"]{background:#fff4f2;border-color:#edc7c2;color:#9f2c24}
.document-email-progress[data-stage="success"] .document-email-spinner,.document-email-progress[data-stage="error"] .document-email-spinner{animation:none;border:0;border-radius:50%;display:grid;place-items:center;background:currentColor;width:23px;height:23px}
.document-email-progress[data-stage="success"] .document-email-spinner::after{content:"✓";color:white;font-weight:bold;font-size:15px}
.document-email-progress[data-stage="error"] .document-email-spinner::after{content:"!";color:white;font-weight:bold;font-size:16px}
.document-email-result[data-state="error"]{color:#9f2c24}
.document-email-result[data-state="success"]{color:#226c35}
@media(prefers-reduced-motion:reduce){.document-email-spinner{animation-duration:2s}}

/* Compact document correction control: inherits each active theme. */
.documents-table .bgf-correction-button{min-width:32px;min-height:28px;padding:5px 7px;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;line-height:1}
.documents-table .bgf-correction-button svg{display:block;flex-shrink:0;color:inherit}

/* Consistent compact document actions and disabled email state */
.documents-table .bgf-correction-button{width:34px!important;min-width:34px!important;max-width:34px!important;height:30px!important;min-height:30px!important;padding:4px!important;box-sizing:border-box!important;flex:0 0 34px!important}
.documents-table .bgf-correction-button svg{width:16px;height:16px}
#documentEmailOpen:disabled{opacity:.55!important;filter:grayscale(1);cursor:not-allowed!important;box-shadow:none!important}
.bgf-editor-context{display:block!important;position:static!important}


/* Invoice correction controls live in the preview header; inherit theme colors. */
.bgf-preview-header-controls{display:flex;align-items:center;gap:8px;flex-shrink:0}
.bgf-correction-countdown{font-size:13px;font-weight:600;font-variant-numeric:tabular-nums;padding:7px 9px;border:1px solid var(--border,#cbd2da);border-radius:6px;color:inherit;background:var(--card,#f3f6fa);white-space:nowrap}
.bgf-preview-correction-form{margin:0;display:flex;align-items:center}
.bgf-preview-pencil{height:36px;width:36px;border:1px solid var(--border,#cbd2da);border-radius:6px;background:var(--card,#f5f8fc);color:inherit;display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0}
.bgf-preview-pencil:hover{filter:brightness(.94)}
.bgf-preview-pencil svg{display:block}
.bgf-preview-header-controls [hidden]{display:none!important}
@media(max-width:500px){.bgf-preview-header-controls{gap:4px}.bgf-correction-countdown{padding:6px;font-size:12px}}

/* 9.6.23: expanded navigation must cover company selector and its labels.
   Closed state and normal company switcher behavior are unchanged. */
body.bgf-menu-open .bgf-menu-backdrop{z-index:110!important}
body.bgf-menu-open .sidebar:not(.closed){z-index:120!important}
body.bgf-menu-open .rail{z-index:130!important}

/* 9.6.24: keep the company switcher behind the expanded navigation.
   The workspace header previously used z-index:9200 and overlaid the nav. */
body:not(.login-page):has(#sidebar:not(.closed)) .main > .workspace-head,
body:not(.login-page):has(#sidebar:not(.closed)) .main:has(> .empty-workspace.workspace-designed) > .workspace-head,
body.blue-pro-theme:has(#sidebar:not(.closed)) .main > .workspace-head{
  z-index:1!important;
}
body:not(.login-page):has(#sidebar:not(.closed)) .main > .workspace-head .company-switcher{
  visibility:hidden!important;
  pointer-events:none!important;
}
body:not(.login-page):has(#sidebar:not(.closed)) .sidebar{
  z-index:10000!important;
}

/* 9.6.28: One coherent drawer brand across ALL profile themes. */
body.bgf-menu-open .main > .workspace-head,
body.bgf-menu-open .main > .workspace-head .company-switcher,
body.bgf-menu-open .main > .workspace-head .company-menu,
body.bgf-menu-open .main > .workspace-head .company-menu-list{
 visibility:hidden!important;pointer-events:none!important;
}
#sidebar:not(.closed) .sidebar-brand{
 display:flex!important;flex-direction:row!important;align-items:center!important;
 justify-content:flex-start!important;gap:10px!important;
 box-sizing:border-box!important;width:100%!important;
}
#sidebar:not(.closed) .sidebar-brand>.sidebar-mark{
 display:inline-flex!important;flex:0 0 25px!important;width:25px!important;height:25px!important;
 align-items:center!important;justify-content:center!important;
 opacity:1!important;visibility:visible!important;
}
#sidebar:not(.closed) .sidebar-brand>.sidebar-brand-title{
 display:inline-flex!important;position:relative!important;
 visibility:visible!important;opacity:1!important;
 flex:1 1 auto!important;width:auto!important;min-width:0!important;max-width:none!important;
 align-items:center!important;white-space:nowrap!important;
 font-size:15px!important;line-height:25px!important;font-weight:700!important;
 text-indent:0!important;letter-spacing:normal!important;
 color:#233e5b!important;-webkit-text-fill-color:#233e5b!important;
}
body.dark #sidebar:not(.closed) .sidebar-brand>.sidebar-brand-title{
 color:#f2f5f9!important;-webkit-text-fill-color:#f2f5f9!important;
}
body.red-theme #sidebar:not(.closed) .sidebar-brand>.sidebar-brand-title{
 color:#6d2427!important;-webkit-text-fill-color:#6d2427!important;
}
body.blue-pro-theme #sidebar:not(.closed) .sidebar-brand>.sidebar-brand-title{
 color:#173d63!important;-webkit-text-fill-color:#173d63!important;
}
body.custom-profile-theme #sidebar:not(.closed) .sidebar-brand>.sidebar-brand-title{
 color:var(--custom-text,#173b60)!important;
 -webkit-text-fill-color:var(--custom-text,#173b60)!important;
}
/* Explicit readable selected/disabled company labels in every theme. */
body.red-theme .company-menu-option.is-active,
body.red-theme .company-menu-option:disabled{
 color:#6c2527!important;
}
body.red-theme .company-menu-option.is-active .company-menu-option-name,
body.red-theme .company-menu-option:disabled .company-menu-option-name{
 color:#6c2527!important;-webkit-text-fill-color:#6c2527!important;
}
body.red-theme .company-menu-option.is-active .company-menu-option-meta{
 color:#874d51!important;-webkit-text-fill-color:#874d51!important;
}


/* 9.6.29 — unified readable branding in opened navigation drawer. */
body:not(.login-page) #sidebar:not(.closed) > .sidebar-brand{
  display:flex!important;align-items:center!important;gap:10px!important;
  height:38px!important;min-height:38px!important;padding:0 10px!important;
  background:#f5f7fa!important;border:1px solid #b9c8d7!important;
  color:#1e446e!important;-webkit-text-fill-color:#1e446e!important;
  opacity:1!important;visibility:visible!important;
}
body:not(.login-page) #sidebar:not(.closed) > .sidebar-brand > .sidebar-brand-title{
  display:block!important;flex:1 1 auto!important;width:auto!important;
  font-family:inherit!important;font-size:16px!important;font-weight:800!important;
  line-height:24px!important;white-space:nowrap!important;overflow:visible!important;
  color:#1e446e!important;-webkit-text-fill-color:#1e446e!important;
  opacity:1!important;visibility:visible!important;text-indent:0!important;
  font-size-adjust:none!important;
}
body.dark #sidebar:not(.closed) > .sidebar-brand{
  background:#333e49!important;border-color:#647383!important;
  color:#fff!important;-webkit-text-fill-color:#fff!important;
}
body.dark #sidebar:not(.closed) > .sidebar-brand > .sidebar-brand-title{
  color:#fff!important;-webkit-text-fill-color:#fff!important;
}
body.red-theme #sidebar:not(.closed) > .sidebar-brand{
  background:#fff0f0!important;border-color:#d5a7aa!important;
  color:#76262b!important;-webkit-text-fill-color:#76262b!important;
}
body.red-theme #sidebar:not(.closed) > .sidebar-brand > .sidebar-brand-title{
  color:#76262b!important;-webkit-text-fill-color:#76262b!important;
}
body.blue-pro-theme #sidebar:not(.closed) > .sidebar-brand{
  background:#eaf5ff!important;border-color:#b5d3eb!important;
  color:#173d63!important;-webkit-text-fill-color:#173d63!important;
}
body.blue-pro-theme #sidebar:not(.closed) > .sidebar-brand > .sidebar-brand-title{
  color:#173d63!important;-webkit-text-fill-color:#173d63!important;
}
body.custom-profile-theme #sidebar:not(.closed) > .sidebar-brand{
  background:var(--custom-surface,#fff)!important;
  border-color:var(--custom-border,#b9cfe2)!important;
  color:var(--custom-text,#173b60)!important;
  -webkit-text-fill-color:var(--custom-text,#173b60)!important;
}
body.custom-profile-theme #sidebar:not(.closed) > .sidebar-brand > .sidebar-brand-title{
  color:var(--custom-text,#173b60)!important;
  -webkit-text-fill-color:var(--custom-text,#173b60)!important;
}
/* Company items must remain legible even in disabled or selected state. */
body.red-theme .company-menu-option:disabled .company-menu-option-name,
body.red-theme .company-menu-option.is-active .company-menu-option-name{
  color:#74272b!important;-webkit-text-fill-color:#74272b!important;opacity:1!important;
}
body.red-theme .company-menu-option:disabled .company-menu-option-meta,
body.red-theme .company-menu-option.is-active .company-menu-option-meta{
  color:#8b5457!important;-webkit-text-fill-color:#8b5457!important;
}

/* 9.6.30 — Red theme company selector: identical legibility in all open/hover/focus states. */
body.red-theme .workspace-head .company-switcher,
body.red-theme .workspace-head .company-menu,
body.red-theme .workspace-head .company-menu-trigger,
body.red-theme .workspace-head .company-menu-trigger:hover,
body.red-theme .workspace-head .company-menu-trigger:focus,
body.red-theme .workspace-head .company-menu-trigger:focus-visible,
body.red-theme .workspace-head .company-menu.is-open .company-menu-trigger{
  opacity:1!important;filter:none!important;visibility:visible!important;
}
body.red-theme .workspace-head .company-menu-trigger,
body.red-theme .workspace-head .company-menu-trigger:hover,
body.red-theme .workspace-head .company-menu-trigger:focus,
body.red-theme .workspace-head .company-menu.is-open .company-menu-trigger{
  background:#8d292c!important;border-color:#782326!important;
  color:#fff!important;-webkit-text-fill-color:#fff!important;
}
body.red-theme .workspace-head .company-menu-current,
body.red-theme .workspace-head .company-menu-chevron{
  opacity:1!important;color:#fff!important;-webkit-text-fill-color:#fff!important;
}
body.red-theme .workspace-head .company-menu-list{
  background:#fff8f8!important;border-color:#d6a7a9!important;
  opacity:1!important;filter:none!important;
}
body.red-theme .workspace-head .company-menu-option{
  opacity:1!important;filter:none!important;
  background:#8d292c!important;border-color:#7b2529!important;
  color:#fff!important;-webkit-text-fill-color:#fff!important;
}
/* 9.6.31: distinct hover/focus, without overriding the selected company. */
body.red-theme .workspace-head .company-menu-option:not(.is-active):not(:disabled):hover,
body.red-theme .workspace-head .company-menu-option:not(.is-active):not(:disabled):focus-visible{
  background:#b33b40!important;border-color:#d96d73!important;
  color:#fff!important;-webkit-text-fill-color:#fff!important;
  box-shadow:inset 3px 0 0 #fff,0 2px 8px rgba(85,16,23,.23)!important;
}
body.red-theme .workspace-head .company-menu-option:not(.is-active):not(:disabled):hover .company-menu-option-name,
body.red-theme .workspace-head .company-menu-option:not(.is-active):not(:disabled):focus-visible .company-menu-option-name{
  color:#fff!important;-webkit-text-fill-color:#fff!important;
}
body.red-theme .workspace-head .company-menu-option:not(.is-active):not(:disabled):hover .company-menu-option-meta,
body.red-theme .workspace-head .company-menu-option:not(.is-active):not(:disabled):focus-visible .company-menu-option-meta{
  color:#ffe7e7!important;-webkit-text-fill-color:#ffe7e7!important;
}
body.red-theme .workspace-head .company-menu-option .company-menu-option-name{
  color:#fff!important;-webkit-text-fill-color:#fff!important;opacity:1!important;
}
body.red-theme .workspace-head .company-menu-option .company-menu-option-meta{
  color:#f1c9c9!important;-webkit-text-fill-color:#f1c9c9!important;opacity:1!important;
}
body.red-theme .workspace-head .company-menu-option.is-active{
  background:#e8f2ff!important;border-color:#9fc3e6!important;
  color:#68242b!important;-webkit-text-fill-color:#68242b!important;
}
body.red-theme .workspace-head .company-menu-option.is-active .company-menu-option-name{
  color:#68242b!important;-webkit-text-fill-color:#68242b!important;
}
body.red-theme .workspace-head .company-menu-option.is-active .company-menu-option-meta{
  color:#79585e!important;-webkit-text-fill-color:#79585e!important;
}
/* Keep existing drawer behavior authoritative in red theme too. */
body.red-theme.bgf-menu-open .main>.workspace-head,
body.red-theme.bgf-menu-open .main>.workspace-head .company-switcher{
  visibility:hidden!important;pointer-events:none!important;
}

/* 9.6.32 — Red theme: visible hover on company selector trigger and options. */
body.red-theme:not(.bgf-menu-open) .workspace-head .company-menu-trigger:not(.company-menu-trigger-static):hover,
body.red-theme:not(.bgf-menu-open) .workspace-head .company-menu-trigger:not(.company-menu-trigger-static):focus-visible {
 background:#b94146!important;
 border-color:#e59a9d!important;
 box-shadow:0 0 0 2px rgba(198,68,75,.24),0 4px 12px rgba(80,18,23,.18)!important;
 filter:none!important;
}
body.red-theme .workspace-head .company-menu-option:not(.is-active):hover,
body.red-theme .workspace-head .company-menu-option:not(.is-active):focus-visible {
 background:#bb454c!important;
 border-color:#f0aeb2!important;
 box-shadow:inset 4px 0 0 #fff,0 2px 9px rgba(75,12,20,.28)!important;
 filter:none!important;
}
body.red-theme .workspace-head .company-menu-option.is-active:hover,
body.red-theme .workspace-head .company-menu-option.is-active:focus-visible {
 background:#cddff5!important;
 border-color:#659bd4!important;
 box-shadow:inset 4px 0 0 #2b78b4!important;
 filter:none!important;
}

/* BG Faktura 9.6.37 — applies only in Edge/Chromium window-controls-overlay */
.bgf-pwa-window-title{display:none!important}
@media(display-mode:window-controls-overlay){
 html.bgf-wco-enabled .bgf-pwa-window-title{display:flex!important;position:fixed;z-index:2147480000;top:env(titlebar-area-y,0px);left:env(titlebar-area-x,0px);width:env(titlebar-area-width,calc(100% - 160px));height:env(titlebar-area-height,32px);align-items:center;box-sizing:border-box;padding:0 12px;font-size:13px;font-weight:700;color:#133b65;background:#eaf4ff;app-region:drag;-webkit-app-region:drag;pointer-events:auto}
 html.bgf-wco-enabled body.dark .bgf-pwa-window-title{background:#252b31;color:#fff}
 html.bgf-wco-enabled body.red-theme .bgf-pwa-window-title{background:#fff0f0;color:#782525}
 html.bgf-wco-enabled body.blue-pro-theme .bgf-pwa-window-title{background:#e8f3ff;color:#124a80}
 html.bgf-wco-enabled body.custom-profile-theme .bgf-pwa-window-title{background:var(--custom-surface,#eaf4ff);color:var(--custom-text,#133b65)}
}


/* BG Faktura 9.6.38: old installed Edge WCO apps must not overlap content.
   New installs use the normal standalone title bar through manifest. */
@media (display-mode:window-controls-overlay) {
 html.bgf-wco-enabled body:not(.login-page) {
  box-sizing:border-box!important;
  padding-top:env(titlebar-area-height,32px)!important;
 }
 html.bgf-wco-enabled body:not(.login-page) .rail,
 html.bgf-wco-enabled body:not(.login-page) .sidebar {
  top:env(titlebar-area-height,32px)!important;
 }
 html.bgf-wco-enabled body:not(.login-page) .bgf-pwa-window-title {
  overflow:hidden!important;
  white-space:nowrap!important;
  text-overflow:ellipsis!important;
 }
}

/* 9.6.45: Responsive document-email dialog; keep server diagnostics in audit only. */
.document-email-modal{padding:clamp(8px,2.2vw,22px);box-sizing:border-box;overscroll-behavior:contain}
.document-email-dialog{width:min(560px,100%);max-width:100%;max-height:calc(100dvh - 2*clamp(8px,2.2vw,22px));display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box}
.document-email-dialog>.document-preview-header{flex:0 0 auto;min-width:0}
.document-email-dialog>.document-email-fields{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:clamp(10px,2.3vw,20px);gap:clamp(5px,1.2vh,10px);box-sizing:border-box}
.document-email-dialog>.document-preview-actions{flex:0 0 auto;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;padding:clamp(9px,1.5vw,14px);min-width:0}
.document-email-fields input,.document-email-fields textarea{width:100%;max-width:100%;min-width:0;box-sizing:border-box}
.document-email-fields textarea{min-height:74px;height:clamp(80px,17vh,160px);resize:vertical}
.document-email-progress{min-width:0}
.document-email-progress-content{min-width:0;overflow-wrap:anywhere}
.document-email-attachment{overflow-wrap:anywhere}
.document-email-result:empty{display:none;min-height:0}
@media(max-width:600px){
 .document-email-modal{padding:8px;align-items:center}
 .document-email-dialog{width:100%;max-height:calc(100dvh - 16px);border-radius:10px}
 .document-email-dialog>.document-preview-header{padding:10px 12px}
 .document-email-dialog>.document-email-fields{padding:12px}
 .document-email-dialog>.document-preview-actions{padding:10px 12px}
 .document-email-dialog>.document-preview-actions .btn{flex:1 1 auto;min-width:100px}
}
@media(max-height:560px){
 .document-email-modal{align-items:center;padding:6px}
 .document-email-dialog{max-height:calc(100dvh - 12px)}
 .document-email-dialog>.document-email-fields{padding:8px 14px;gap:5px}
 .document-email-fields textarea{min-height:55px;height:70px}
}
@supports not (height:100dvh){.document-email-dialog{max-height:calc(100vh - 24px)}}

/* Logout confirmation and clean rail: no hover tooltip bubbles. */
.rail-btn::after,.rail-btn::before,.rail-btn[title]:hover::after,.rail-btn.mobile-label-visible::after{content:none!important;display:none!important;visibility:hidden!important;opacity:0!important}
.bgf-logout-modal[hidden]{display:none!important}
.bgf-logout-modal{position:fixed;inset:0;z-index:2147483647;background:rgba(12,24,39,.58);display:flex;align-items:center;justify-content:center;padding:18px}
.bgf-logout-dialog{background:var(--card,#fff);color:var(--text,#172638);border:1px solid var(--line,#d5dfe7);border-radius:12px;padding:24px;max-width:440px;width:100%;box-shadow:0 20px 75px rgba(0,0,0,.3)}
.bgf-logout-dialog h2{font-size:20px;margin:0 0 10px}.bgf-logout-dialog p{line-height:1.5;margin:0 0 16px}
.bgf-logout-dialog input{width:100%;box-sizing:border-box;height:40px}
.bgf-logout-error{min-height:18px;color:#c52828;font-size:13px;margin:8px 0!important}
.bgf-logout-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}
body.bgf-logout-open{overflow:hidden}

/* Dialog styled to match the BG Faktura desktop updater window. */
.bgf-logout-modal{padding:12px!important;box-sizing:border-box!important;background:rgba(19,32,51,.52)!important}
.bgf-logout-dialog{width:min(606px,100%)!important;max-width:606px!important;max-height:calc(100dvh - 24px)!important;overflow:auto!important;padding:0!important;border:1px solid #c1d3e4!important;border-radius:7px!important;box-shadow:0 18px 58px rgba(9,30,58,.28)!important;background:#f0f6fb!important;color:#112b50!important;font-family:Arial,system-ui,sans-serif!important;box-sizing:border-box!important}
.bgf-logout-window-title{height:32px;display:flex;align-items:center;padding:0 9px;background:#ebf2f8;color:#17202b;font-size:12px;font-weight:400;border-radius:7px 7px 0 0;box-sizing:border-box}
.bgf-logout-inner{background:#fff;border:1px solid #d2e1f0;border-radius:20px;margin:10px 20px 13px;padding:18px 25px 18px;box-shadow:0 0 0 1px rgba(212,225,238,.2);text-align:center;box-sizing:border-box}
.bgf-logout-brand{display:flex;align-items:center;justify-content:center;gap:10px;margin:0 0 14px;color:#08265a!important;font-weight:750;font-size:clamp(25px,4vw,34px);line-height:1.15;letter-spacing:-.5px}
.bgf-logout-brand img{height:55px;width:55px;object-fit:contain;flex:none}
.bgf-logout-dialog h2{font-size:17px!important;font-weight:700!important;color:#102a54!important;line-height:1.3!important;text-align:center!important;margin:0 0 9px!important}
.bgf-logout-description{color:#687b96!important;font-size:13px!important;line-height:1.5!important;text-align:center!important;margin:0 0 14px!important}
.bgf-logout-dialog form{display:block;text-align:left;max-width:425px;margin:0 auto}
.bgf-logout-dialog label{color:#20324c!important;display:block!important;font-size:13px!important;font-weight:600!important;margin:0 0 6px!important}
.bgf-logout-dialog #bgfLogoutPassword{display:block!important;width:100%!important;max-width:100%!important;height:39px!important;border:1px solid #b8cde0!important;border-radius:8px!important;padding:8px 11px!important;background:#fff!important;color:#1b314c!important;font-size:15px!important;outline:none!important;box-shadow:none!important;appearance:none!important}
.bgf-logout-dialog #bgfLogoutPassword:focus{border-color:#3a8fdd!important;box-shadow:0 0 0 3px rgba(49,140,230,.12)!important}
.bgf-logout-dialog #bgfLogoutPassword[aria-invalid="true"]{border-color:#b83535!important}
.bgf-logout-error{display:block;min-height:18px!important;font-size:12px!important;color:#b4232b!important;margin:5px 0 6px!important;line-height:1.4!important}
.bgf-logout-error:empty{visibility:hidden}
.bgf-logout-actions{display:flex!important;justify-content:center!important;align-items:center!important;gap:11px!important;flex-wrap:wrap!important;margin-top:4px!important}
.bgf-logout-actions button{border-radius:7px!important;min-height:34px!important;padding:7px 17px!important;font-size:13px!important;font-weight:600!important;line-height:1.2!important;cursor:pointer!important;box-shadow:none!important;min-width:105px!important}
.bgf-logout-actions .bgf-logout-cancel{color:#2162a7!important;background:#edf5ff!important;border:1px solid #bad5f3!important}
.bgf-logout-actions .bgf-logout-confirm{color:#fff!important;background:#1875db!important;border:1px solid #1169ca!important}
.bgf-logout-actions .bgf-logout-confirm:hover:not(:disabled){background:#0d66c9!important}
.bgf-logout-actions button:disabled{opacity:.65!important;cursor:default!important}
@media(max-width:540px){.bgf-logout-inner{margin:8px;padding:16px 12px}.bgf-logout-brand{font-size:25px}.bgf-logout-brand img{width:43px;height:43px}.bgf-logout-dialog h2{font-size:16px!important}}

/* BG Faktura — customers/suppliers: stable column geometry and compact actions.
   Scope intentionally limited to #customerListTable; document tables remain unchanged. */
#customerListTable.table{
  width:100%!important;
  min-width:980px!important;
  max-width:100%!important;
  table-layout:fixed!important;
}
#customerListTable.table th:nth-child(1),
#customerListTable.table td:nth-child(1){width:10%!important;min-width:0!important}
#customerListTable.table th:nth-child(2),
#customerListTable.table td:nth-child(2){width:auto!important;min-width:0!important;overflow-wrap:anywhere!important;word-break:normal!important}
#customerListTable.table th:nth-child(3),
#customerListTable.table td:nth-child(3){width:11%!important;min-width:0!important}
#customerListTable.table th:nth-child(4),
#customerListTable.table td:nth-child(4){width:12%!important;min-width:0!important}
#customerListTable.table th:nth-child(5),
#customerListTable.table td:nth-child(5){width:18%!important;min-width:0!important;overflow-wrap:anywhere!important}
#customerListTable.table th:nth-child(6),
#customerListTable.table td:nth-child(6){width:160px!important;min-width:160px!important;max-width:160px!important}
#customerListTable.table td.actions{
  display:table-cell!important;
  width:160px!important;
  min-width:160px!important;
  max-width:160px!important;
  padding:5px 6px!important;
  vertical-align:middle!important;
  white-space:nowrap!important;
}
#customerListTable.table td.actions>a.btn,
#customerListTable.table td.actions>form.inline-action-form{
  display:inline-flex!important;
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  margin:0!important;
  vertical-align:middle!important;
}
#customerListTable.table td.actions>a.btn{margin-right:5px!important}
#customerListTable.table td.actions>form.inline-action-form>button{
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  margin:0!important;
}
