.portal{max-width:1480px;margin:auto;padding:32px}.portal-header{background:#272c34;color:white;padding:20px 32px;display:flex;justify-content:space-between;align-items:center;gap:18px}.portal-header strong{color:#ffd43b;font-size:22px}.portal-header .btn{color:#fff;background:#384354}.portal-title{margin:24px 0;display:flex;align-items:center;justify-content:space-between;gap:16px}.portal-title h1{font-size:32px}.portal p{line-height:1.7;color:#6b778b}.portal-nav,.portal-actions,.portal-filters{display:flex;gap:12px;flex-wrap:wrap;margin:20px 0}.portal-nav .active{background:#165dcc;color:white}.container-cards{display:grid;grid-template-columns:repeat(4,1fr);gap:18px}.container-card{padding:24px;border:1px solid #dbe1eb;border-radius:14px;background:white;text-align:left;cursor:pointer}.container-card.selected{border:2px solid #165dcc}.container-card b{font-size:25px;display:block;margin-bottom:12px}.container-card span{color:#6b778b;font-size:13px}.portal .panel{padding:22px;margin:20px 0}.portal label{display:flex;flex-direction:column;gap:8px;font-size:13px}.portal input,.portal select,.portal textarea{padding:11px;border:1px solid #ccd5e3;border-radius:7px;background:white;max-width:100%}.portal input[type=checkbox]{width:18px;height:18px;min-height:0}.portal .checks label{display:flex;flex-direction:row;align-items:center;padding:9px}.portal-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.portal th,.portal td{font-size:12px;padding:12px;vertical-align:top}.portal .notice{padding:15px;background:#fff7d6;border-radius:8px;margin:16px 0;line-height:1.7}.portal .errors{background:#fff0ee;color:#9e3727;padding:15px;border-radius:8px;white-space:pre-wrap;max-height:220px;overflow:auto}.portal .table-scroll{max-height:540px;overflow:auto}.portal th{position:sticky;top:0;background:#edf2f9}.portal .subtle{font-size:12px;color:#748094}.portal .success{color:#165dcc;font-weight:600}.portal a{color:#165dcc}.portal .checks{max-height:250px;overflow:auto}.portal button:disabled{opacity:.45;cursor:not-allowed}.portal .history-controls{display:flex;gap:12px;flex-wrap:wrap}.portal .history-controls label{flex:1;min-width:150px}@media(max-width:900px){.portal{padding:16px}.container-cards{grid-template-columns:repeat(2,1fr)}.portal-grid{grid-template-columns:1fr 1fr}.portal-title{align-items:flex-start;flex-direction:column}.portal-header{padding:16px}}@media(max-width:520px){.portal-grid{grid-template-columns:1fr}.portal h1{font-size:25px}}

/* Работният регистър запазва логиката на Excel: един ред за заварка, етапите в колони. */
.portal:has(.reg-board){max-width:none;padding:24px clamp(12px,2.4vw,40px)}
.reg-board{margin-top:20px;background:#fff;border:1px solid #d6deeb;border-radius:18px;box-shadow:0 14px 40px #182a4912;overflow:hidden;color:#263241}
.reg-titlebar{display:flex;justify-content:space-between;gap:24px;align-items:center;padding:22px 28px;background:linear-gradient(115deg,#293440,#334b65 68%,#175ab3);color:#fff;border-bottom:5px solid #f9cf41}
.reg-kicker{font-size:11px;letter-spacing:.14em;font-weight:800;color:#ffda59}.reg-titlebar h2{font-size:30px;margin:8px 0 3px}.reg-titlebar h2 span{font-weight:400;color:#dce7f7}.reg-titlebar p{margin:0;color:#c5d2e2;font-size:13px}.reg-counter{text-align:right;white-space:nowrap}.reg-counter strong{font-size:30px;display:block;color:#ffdc59}.reg-counter strong span{font-size:18px;color:#fff}.reg-counter small{font-size:12px;color:#cbd7e5}
.reg-actionbar,.reg-filterbar,.reg-grid-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 24px;border-bottom:1px solid #dde4ee}.reg-toolbar{display:flex;align-items:end;gap:12px;flex-wrap:wrap}.reg-toolbar label{min-width:170px;font-weight:700;color:#455367}.reg-toolbar input,.reg-toolbar select{height:40px;min-width:170px}.reg-self{font-size:13px;padding-bottom:12px}.reg-tip{padding:11px 24px;background:#fff9df;color:#66551e;font-size:12px;border-bottom:1px solid #f0e6bc}
.reg-filterbar{justify-content:flex-start;background:#f8fafd}.reg-filterbar label{min-width:170px;flex:1;max-width:360px;font-weight:700;color:#4a5b6d}.reg-filterbar input,.reg-filterbar select{height:39px;padding:8px}.reg-grid-head{padding:9px 24px;font-size:12px;background:#f1f5fa}.reg-grid-head b{font-size:14px}.reg-grid-head div{display:flex;gap:10px;align-items:center}.reg-pager{border:1px solid #cbd5e4;border-radius:6px;background:#fff;padding:5px 10px;cursor:pointer}
.reg-table-wrap{overflow:auto;max-height:min(65vh,720px);scrollbar-color:#aebbd0 #edf2f7}.reg-table{border-collapse:separate;border-spacing:0;min-width:1670px;width:100%;table-layout:auto}.portal .reg-table th,.portal .reg-table td{font-size:12px;padding:0;border-right:1px solid #d6deea;border-bottom:1px solid #dfe5ed;vertical-align:middle;white-space:nowrap}.portal .reg-table th{position:sticky;top:0;background:#b8cbe3;color:#23364f;text-align:center;padding:13px 10px;z-index:2;font-weight:800}.reg-table tbody tr:nth-child(even){background:#f4f8fd}.reg-table tbody tr:hover{background:#fff9db}.portal .reg-table td:not(.reg-stage){padding:10px}.reg-table td.reg-stick,.reg-table th.reg-stick{position:sticky;left:0;z-index:3;min-width:245px;max-width:245px;background:#e9f0f9;text-align:left;overflow:hidden;text-overflow:ellipsis}.reg-table td.reg-stick-two,.reg-table th.reg-stick-two{position:sticky;left:245px;z-index:3;min-width:85px;background:#e9f0f9;font-weight:800}.reg-table th.reg-stick,.reg-table th.reg-stick-two{z-index:5;background:#b8cbe3}.reg-cell-select{border:0!important;border-radius:0!important;background:transparent!important;min-width:112px;max-width:130px;width:100%;padding:8px 7px!important;font-size:12px;color:#263241;font-weight:700}.reg-cell-select:focus{outline:2px solid #1662cb;outline-offset:-2px}.reg-cell-select:disabled{opacity:1;color:#5e6b7c;appearance:none}.reg-stage small{display:block;color:#66788e;font-size:10px;padding:0 7px 7px;line-height:1.3}.reg-stage.reg-done{background:#e5f4e7}.reg-stage.reg-fail{background:#ffe8e1}.reg-na{text-align:center;color:#a0aabb}.reg-link{border:0;background:none;color:#0b5dc4;cursor:pointer;font-weight:700;padding:5px 7px;white-space:nowrap}.reg-link:hover{text-decoration:underline}.reg-link.danger,.reg-edit-form .danger{color:#b22d2d}.reg-history{border-top:1px solid #dbe2ed;padding:16px 24px}.reg-history summary{cursor:pointer;font-weight:800;color:#294467}.reg-history-scroll{overflow:auto;max-height:350px;margin-top:14px}.reg-history-scroll table{width:100%;border-collapse:collapse}.reg-history-scroll th,.reg-history-scroll td{border-bottom:1px solid #e2e8f1;text-align:left}.reg-history-count{font-size:12px;color:#607083;margin:10px 0}.reg-archive-row{display:flex;justify-content:space-between;gap:15px;align-items:center;padding:10px 0;border-bottom:1px solid #e1e7ef}.reg-empty{padding:48px 38px}.reg-empty h2{font-size:26px;margin:10px 0}.reg-empty details{margin-top:22px}.reg-edit-form{padding:20px 24px;background:#edf4fd;border-bottom:1px solid #cddbed}.reg-edit-form h3{margin:0 0 14px}.reg-form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;margin-bottom:14px}.reg-edit-form label{font-weight:700}.reg-edit-form input,.reg-edit-form select{background:#fff}.reg-edit-form .reg-toolbar{margin-top:10px}
@media(max-width:900px){.reg-actionbar,.reg-filterbar{align-items:stretch;flex-direction:column}.reg-filterbar label{max-width:none}.reg-titlebar{padding:18px}.reg-titlebar h2{font-size:24px}.reg-table-wrap{max-height:67vh}}
.reg-container-section{padding:19px 24px 22px;background:#f6f9fd;border-bottom:1px solid #d9e3ef}.reg-container-intro{display:flex;justify-content:space-between;align-items:center;gap:16px}.reg-container-intro .reg-kicker{color:#195aa8}.reg-container-intro h3{font-size:19px;margin:4px 0}.reg-container-intro p{font-size:12px;margin:0;color:#5c6c7f}.reg-status{border-radius:100px;padding:7px 13px;background:#fff1c9;color:#805b0c;font-size:12px;font-weight:800;white-space:nowrap}.reg-status.is-done{background:#dbf1e2;color:#146735}.reg-container-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:16px}.reg-container-card{border:1px solid #cfdaea;border-radius:12px;background:#fff;padding:16px;display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:88px}.reg-container-card>div{display:flex;align-items:center;gap:12px;min-width:0}.reg-container-card b{font-size:15px}.reg-container-card small{font-size:11px;color:#607083}.reg-container-icon{display:grid;place-items:center;flex:none;background:#eaf2ff;color:#145fc1;width:37px;height:37px;border-radius:9px;font-size:21px}.reg-container-card .reg-cell-select{border:1px solid #c4d1e4!important;border-radius:7px!important;background:white!important;min-width:135px;max-width:180px}.reg-container-card .reg-container-meta{font-size:11px;color:#546579;white-space:nowrap}.reg-container-done{border-color:#9fd7b1;background:#f1fbf3}.reg-container-fail{border-color:#efad9c;background:#fff6f3}.reg-export-footer{border-top:1px solid #dae3ee;background:#f7fafd;padding:17px 24px;display:flex;align-items:center;justify-content:space-between;gap:20px}.reg-export-footer b{color:#223c5c}.reg-export-footer p{font-size:12px;margin:4px 0 0}.reg-table{min-width:1390px}@media(max-width:900px){.reg-container-cards{grid-template-columns:1fr}.reg-container-card{flex-wrap:wrap}.reg-export-footer{align-items:flex-start;flex-direction:column}}@media(max-width:520px){.reg-container-intro{align-items:flex-start;flex-direction:column}}
.portal-header{padding:14px 28px;min-height:68px;gap:20px;background:#202a37;border-bottom:3px solid #f4ce45}
.portal-header strong{letter-spacing:-.7px;font-size:23px;white-space:nowrap}.portal-product{font-size:10px;letter-spacing:.12em;color:#aebdce}.portal-header>span:last-of-type{font-size:12px;margin-left:auto}.portal-sync{font-size:11px;color:#c7dfd4;display:flex;align-items:center;gap:8px}.portal-sync:before{content:'';width:6px;height:6px;border-radius:50%;background:#75c9a0;flex:none}.portal-sync.offline{color:#ffda82}.portal-sync.offline:before{background:#ffca55}
body:has(.portal){background:#f4f6f9}.portal,.portal:has(.reg-board){max-width:1720px;padding:22px 28px 36px}.portal-title{margin:0 0 18px;align-items:center}.portal-title h1{font-size:27px;letter-spacing:-.8px}.portal-title>div>p{font-size:9px;letter-spacing:.15em;font-weight:800;margin-bottom:5px;color:#7b8798}.portal-title>label{width:185px;font-size:10px}.portal-title input{min-height:37px;padding:8px 11px}.portal-nav{gap:5px;margin:0 0 18px;padding:5px;background:#e9eef5;border:1px solid #e0e6ef;border-radius:11px;width:fit-content}.portal-nav .btn{min-height:35px;padding:8px 15px;border:0;box-shadow:none;background:transparent;color:#536276}.portal-nav .active{background:white;color:#174f9d;box-shadow:0 2px 5px #23354e12}.portal-nav .btn:hover{background:#ffffffad}
.portal .btn{font-size:12px;min-height:38px;border-radius:8px;padding:9px 14px;transition:background .15s,box-shadow .15s}.portal .btn.primary{background:#1d5fc6;color:#fff!important;box-shadow:0 2px 3px #174a9114}.portal .btn.primary:hover{background:#164fa8}.portal .btn.secondary{border-color:#dce3ec;background:white;color:#46566c}.portal .btn.secondary:hover{background:#f2f6fb}.portal button:focus-visible,.portal a:focus-visible{outline:3px solid #81aeef;outline-offset:2px}.portal input:focus,.portal select:focus,.portal textarea:focus{border-color:#7ca8e2;box-shadow:0 0 0 3px #1b65cc10}.portal input,.portal select,.portal textarea{min-height:38px;font-size:12px}
.container-cards{gap:10px}.container-card{border:1px solid #e0e6ef;border-radius:10px;padding:15px 18px;box-shadow:0 2px 3px #26395003;transition:border-color .15s,background .15s}.container-card:hover{border-color:#9bbce8;background:#fbfdff}.container-card.selected{border:1px solid #83a9dd;background:#f0f6ff;box-shadow:inset 3px 0 #2467c6}.container-card b{font-size:18px;letter-spacing:-.3px;margin-bottom:5px}.container-card span{font-size:11px;line-height:1.5}
.reg-board{margin-top:15px;border-radius:12px;box-shadow:0 4px 20px #22355006;border-color:#dfe5ed}.reg-titlebar{background:white;color:#243650;padding:19px 22px;border-bottom:1px solid #e3e9f1;position:relative}.reg-titlebar:before{content:'';position:absolute;left:0;top:20px;bottom:20px;width:4px;background:#edc540;border-radius:0 3px 3px 0}.reg-titlebar .reg-kicker{color:#718198;font-size:9px;letter-spacing:.13em}.reg-titlebar h2{font-size:23px;margin:5px 0 4px;letter-spacing:-.5px}.reg-titlebar h2 span{color:#6d7d91;font-size:19px}.reg-titlebar p{color:#8490a0;font-size:11px}.reg-counter strong{color:#1d5fc6;font-size:25px}.reg-counter strong span{color:#8b98a9;font-size:16px;font-weight:500}.reg-counter small{color:#76859a;font-size:10px}
.reg-actionbar{padding:13px 20px;gap:14px;flex-wrap:wrap}.reg-toolbar{gap:8px;align-items:end}.reg-toolbar label{min-width:145px;gap:5px;font-size:10px;color:#718096}.reg-toolbar input,.reg-toolbar select{min-width:145px;height:37px}.reg-actionbar>.reg-toolbar:last-child{margin-left:auto}.reg-tip{background:#fbfcfe;color:#7c8898;font-size:11px;border-bottom:1px solid #e7ecf3;padding:9px 20px}.reg-self{padding-bottom:9px;font-size:12px}
.reg-container-section{padding:15px 20px;background:#f9fbfd}.reg-container-intro{gap:12px;align-items:start}.reg-container-intro .reg-kicker{font-size:8px;color:#7690af}.reg-container-intro h3{font-size:15px;margin:3px 0 4px}.reg-container-intro p{font-size:11px;line-height:1.5;max-width:650px}.reg-status{font-size:10px;padding:5px 10px;letter-spacing:.02em}.reg-container-cards{margin-top:12px;gap:12px}.reg-container-card{border-color:#e0e7ef;border-radius:9px;padding:12px;min-height:74px;display:grid;grid-template-columns:minmax(0,1fr) 145px;gap:7px 12px}.reg-container-card>div{display:grid;grid-template-columns:29px 1fr;gap:2px 9px;align-items:center}.reg-container-icon{grid-row:1/3;width:29px;height:29px;font-size:17px;border-radius:7px}.reg-container-card b{font-size:12px;line-height:1.3}.reg-container-card small{grid-column:2;font-size:9px;white-space:normal}.reg-container-card .reg-cell-select{min-width:0;max-width:none;width:145px;min-height:34px;padding:6px 9px!important;background:#fff!important;font-size:11px}.reg-container-card .reg-container-meta{grid-column:1/-1;font-size:10px;color:#778698;white-space:normal;padding-left:38px}.reg-container-done{background:#f5fbf7;border-color:#d1e8da}.reg-container-fail{background:#fff6f3;border-color:#efd6cc}
.reg-filterbar{padding:12px 20px;gap:10px;background:white;display:grid;grid-template-columns:1.25fr 1.25fr 1fr .8fr;align-items:end}.reg-filterbar label{max-width:none;min-width:0;font-size:10px;color:#718096;gap:5px}.reg-filterbar input,.reg-filterbar select{font-size:11px;min-height:35px;height:35px;background:#f9fbfd;border-color:#e0e6ef}.reg-grid-head{background:#f8fafd;padding:8px 20px;color:#7a889a;font-size:10px}.reg-grid-head b{font-size:11px;color:#40546e}.reg-pager{padding:3px 9px;min-height:27px;color:#537197}
.portal .reg-table th{background:#eaf0f7;color:#455b76;padding:11px 9px;font-size:10px;letter-spacing:.01em;border-color:#dfe7f1}.portal .reg-table td{font-size:11px;border-color:#e8edf3;color:#506279}.portal .reg-table td:not(.reg-stage){padding:10px 9px}.reg-table tbody tr:nth-child(even){background:#fafcff}.reg-table tbody tr:hover{background:#fffbed}.reg-table td.reg-stick,.reg-table td.reg-stick-two{background:#f3f7fc}.reg-table th.reg-stick,.reg-table th.reg-stick-two{background:#e4edf8}.reg-table td.reg-stick-two{color:#284971}.reg-cell-select{min-height:34px;font-size:11px;font-weight:600;color:#59708b}.reg-stage.reg-done{background:#eef8f1}.reg-stage.reg-done select{color:#287047}.reg-stage.reg-fail{background:#fff0eb}.reg-stage.reg-fail select{color:#b34f39}.reg-stage small{font-size:9px;line-height:1.4;color:#83908d;padding-left:8px;padding-bottom:7px}.reg-link{font-size:10px;padding:5px}.reg-link.danger{color:#ad5a51}.reg-table-wrap{max-height:62vh}.reg-history{padding:14px 20px}.reg-history summary{font-size:12px;color:#536b88}.reg-export-footer{padding:15px 20px;background:#f8fafd}.reg-export-footer b{font-size:12px}.reg-export-footer p{font-size:11px;max-width:650px;line-height:1.5}.reg-export-footer .btn{flex:none}
.portal .panel{border:1px solid #e1e7ef;box-shadow:0 4px 18px #22355004;border-radius:12px;padding:24px;margin:15px 0}.portal .panel h2{font-size:20px;margin-bottom:8px}.portal .panel>p{font-size:12px;margin-bottom:17px}.portal .panel table{width:100%;border-collapse:collapse}.portal .panel th{text-align:left;font-size:11px;background:#eff4fa;color:#61738b}.portal .panel td{border-bottom:1px solid #edf1f6;color:#4a5d76}.portal .notice{background:#f3f7fd;color:#5c7392;border:1px solid #e1e9f4;font-size:12px}.portal input[type=file]{padding:18px;background:#f7faff;border:1px dashed #a9bfdc;border-radius:9px}.portal .checks label{font-size:12px;gap:10px;border-bottom:1px solid #edf1f6}.portal .portal-login{max-width:430px;margin:9vh auto;padding:32px}.portal-login label{margin:15px 0}.portal-login .btn{width:100%;margin-top:10px}.reg-edit-form{background:#f1f6fd;padding:20px;border-top:1px solid #dbe6f4}.reg-edit-form h3{font-size:16px}.reg-edit-form>.btn{margin-top:12px;margin-right:8px}
@media(max-width:1100px){.portal-product{display:none}.reg-actionbar>.reg-toolbar:last-child{margin-left:0}.reg-container-cards{grid-template-columns:1fr 1fr}.reg-container-card{grid-template-columns:1fr}.reg-container-card .reg-cell-select{width:100%}.reg-container-card .reg-container-meta{padding-left:0}}
@media(max-width:900px){.portal,.portal:has(.reg-board){padding:16px}.portal-header{padding:12px 18px;gap:12px;flex-wrap:wrap}.portal-sync{font-size:10px;order:4;width:100%}.portal-header>span:last-of-type{margin-left:auto}.portal-title{flex-direction:row;align-items:center}.portal-title h1{font-size:23px}.portal-title>label{width:150px}.portal-nav{flex-wrap:wrap;width:100%}.portal-nav .btn{flex:1;padding:8px 10px;font-size:11px}.container-cards{grid-template-columns:repeat(4,1fr);gap:7px}.container-card{padding:11px}.container-card b{font-size:16px}.container-card span{font-size:9px}.reg-actionbar{flex-direction:row;align-items:center}.reg-filterbar{grid-template-columns:1fr 1fr}.reg-export-footer{flex-direction:row;align-items:center}.reg-container-cards{grid-template-columns:1fr 1fr}}
@media(max-width:560px){.portal-title{align-items:flex-start;gap:10px}.portal-title h1{font-size:20px}.portal-title>label{width:120px}.portal-title>div>p{font-size:8px}.container-cards{grid-template-columns:1fr 1fr}.reg-titlebar{padding:17px}.reg-titlebar h2{font-size:20px}.reg-titlebar h2 span{font-size:16px}.reg-actionbar,.reg-filterbar,.reg-container-section{padding:12px}.reg-actionbar>.reg-toolbar{width:100%}.reg-toolbar label{flex:1;min-width:120px}.reg-toolbar input,.reg-toolbar select{min-width:0;width:100%}.reg-actionbar .btn{flex:1}.reg-container-cards{grid-template-columns:1fr}.reg-container-card{grid-template-columns:1fr 130px}.reg-container-card .reg-cell-select{width:130px}.reg-container-intro{flex-direction:row}.reg-export-footer{flex-direction:column;align-items:stretch}.reg-table td.reg-stick,.reg-table th.reg-stick{min-width:205px;max-width:205px}.reg-table td.reg-stick-two,.reg-table th.reg-stick-two{left:205px}}

.order-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:20px;margin:20px 0}.order-card{margin:0!important}.order-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.order-description{min-height:2.5em;white-space:pre-wrap}.order-card progress{width:100%;height:8px;accent-color:#2763bd}.order-card .portal-actions{flex-wrap:wrap}.portal-header [data-tab=home]{white-space:nowrap}#order-form textarea{min-height:70px}@media(max-width:560px){.order-grid{grid-template-columns:1fr}}

.order-search{max-width:420px;margin-top:18px}.order-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,350px),1fr))}.order-card[hidden]{display:none}.order-card h2{overflow-wrap:anywhere}.order-card .order-description{min-height:0;margin-bottom:12px}.order-card progress{border:0;border-radius:8px;overflow:hidden;background:#e7edf5}.order-card progress::-webkit-progress-bar{background:#e7edf5}.order-card progress::-webkit-progress-value{background:#2763bd;border-radius:8px}#order-form>label{display:flex;flex-direction:column;gap:7px;margin-top:16px}.portal .btn.danger{color:#a83636;border-color:#e5c8c8}.portal .btn.danger:hover{background:#fff1f1}
