:root{--bg:#f5f6f8;--card:#fff;--text:#20242a;--muted:#6e7681;--line:#dfe3e8;--accent:#1f6feb;--ok:#e8f5ec;--oktext:#16783c;--wait:#fff4d6;--waittext:#7a5a00;--bad:#fde8e8;--badtext:#a22424}
*{box-sizing:border-box}body{margin:0;font-family:Arial,Helvetica,sans-serif;background:var(--bg);color:var(--text)}.wrap{max-width:1180px;margin:auto;padding:0 18px}header{background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:10}.head{height:62px;display:flex;align-items:center;justify-content:space-between}.brand{font-weight:800;font-size:20px;text-decoration:none;color:#111}nav{display:flex;gap:18px}nav a{color:#333;text-decoration:none}main{padding-top:28px;padding-bottom:60px}h1{margin:0 0 6px;font-size:30px}h2{font-size:18px;margin:0 0 16px}.muted,.small{color:var(--muted)}.small{font-size:12px;margin-top:4px}.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:18px;margin:18px 0}.grid4,.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.grid4{grid-template-columns:repeat(4,minmax(0,1fr))}.wide{grid-column:1/-1}label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:700}input,textarea,select{width:100%;border:1px solid #cbd1d8;border-radius:8px;padding:11px 12px;font:inherit;background:#fff}textarea{resize:vertical}button,.button{display:inline-block;border:1px solid #cbd1d8;background:#fff;border-radius:8px;padding:10px 14px;text-decoration:none;color:#222;cursor:pointer;font-weight:700}.primary{background:var(--accent);color:#fff;border-color:var(--accent)}.table-wrap{overflow:auto;background:#fff;border:1px solid var(--line);border-radius:12px}table{width:100%;border-collapse:collapse;min-width:850px}th,td{text-align:left;padding:13px;border-bottom:1px solid var(--line);vertical-align:top}th{font-size:12px;color:var(--muted);background:#fafbfc}.tz{font-weight:800;color:var(--accent);text-decoration:none}.pill{display:inline-block;border-radius:999px;padding:5px 9px;font-size:12px;font-weight:800}.pill.ok{background:var(--ok);color:var(--oktext)}.pill.wait{background:var(--wait);color:var(--waittext)}.pill.bad{background:var(--bad);color:var(--badtext)}.smallbtn{padding:6px 10px;font-size:12px}.lookup{display:flex;gap:10px;max-width:520px;margin:18px 0}.lookup input{font-size:18px}.object-head{background:#eef4ff;border:1px solid #d3e3ff;padding:14px;border-radius:10px;display:flex;gap:14px;flex-wrap:wrap;margin:14px 0}.object-head b{font-size:18px}.upload{border:2px dashed #cbd1d8;border-radius:10px;padding:16px;background:#fafbfc}.status-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:18px 0}.status{background:#fff;border:1px solid var(--line);border-radius:10px;padding:14px;display:flex;justify-content:space-between;gap:8px;align-items:center}.two-col{display:grid;grid-template-columns:1fr 1fr;gap:18px}.two-col .card{margin:0}dl{display:grid;grid-template-columns:130px 1fr;gap:8px 12px}dt{color:var(--muted)}dd{margin:0;word-break:break-word}.photo-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.photo-grid a{text-decoration:none;color:#333;font-size:12px}.photo-grid img{width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:8px;border:1px solid var(--line)}.photo-grid span{display:block;padding-top:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.approval{display:grid;grid-template-columns:220px 1fr auto;gap:10px}.notice{margin-top:12px;background:#fff4d6;border-radius:8px;padding:12px}.badbox{background:var(--bad)}summary{font-weight:800;cursor:pointer;font-size:18px}.detailform{margin-top:16px}.title-row{display:flex;justify-content:space-between;align-items:flex-start;gap:20px}
@media(max-width:760px){.wrap{padding:0 12px}.head{height:auto;padding-top:12px;padding-bottom:12px;display:block}.brand{display:block;margin-bottom:9px}nav{gap:12px;font-size:14px}main{padding-top:18px}h1{font-size:25px}.grid4,.form-grid,.two-col,.status-grid{grid-template-columns:1fr}.grid4 .primary{grid-column:1/-1}.approval{grid-template-columns:1fr}.photo-grid{grid-template-columns:repeat(2,1fr)}.title-row{display:block}.title-row .button{margin-top:12px;width:100%;text-align:center}.object-head{display:block}.object-head span{display:block;margin-top:5px}.lookup{display:grid;grid-template-columns:1fr auto}.card{padding:14px}}

/* v2 mobile montage */
.lookup-card{max-width:620px;margin-top:16px}.lookup-card input{font-size:18px;font-weight:700}.montage-head{display:grid;grid-template-columns:150px 115px minmax(0,1fr);gap:12px 18px}.montage-head>div{display:flex;flex-direction:column;gap:4px}.montage-head .wide-info{grid-column:1/-1}.montage-head .power-info strong{white-space:nowrap}.eyebrow{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);font-weight:800}.form-section{margin:14px 0}.section-title{display:flex;align-items:flex-start;gap:12px;margin-bottom:16px}.section-title h2{margin:0 0 3px}.section-title p{margin:0;color:var(--muted);font-size:13px}.stepnum{flex:0 0 28px;height:28px;border-radius:50%;background:#eaf2ff;color:var(--accent);display:grid;place-items:center;font-weight:900}.optional{font-size:11px;color:var(--muted);font-weight:400}.subgroup-title{margin:16px 0 9px;font-size:13px;font-weight:800;color:#4b5563}.phase-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.cable-grid{grid-template-columns:2fr 1fr 1fr}.big-upload{display:flex;align-items:center;text-align:center;gap:6px;padding:22px}.big-upload span{font-size:16px}.big-upload small{font-weight:400;color:var(--muted)}.montage-selected-photo-count{font-size:14px;color:var(--accent);font-weight:800}.big-upload input{margin-top:8px;background:#fff}.existing-photos{margin-bottom:10px;padding:10px 12px;border-radius:8px;background:#eef4ff}.note-label{margin-top:14px}.sticky-submit{display:flex;gap:10px;align-items:center;margin:18px 0}.submit-big{font-size:16px;padding:14px 20px}.secondary-link{background:#fff}.successbox{background:var(--ok);color:var(--oktext);border:1px solid #cce8d5}.empty-hint{max-width:620px;border:1px dashed #cbd1d8;border-radius:12px;padding:24px;color:var(--muted);background:#fff}
@media(max-width:760px){.lookup-card{padding:10px;margin-bottom:12px}.montage-head{grid-template-columns:1fr}.montage-head .wide-info{grid-column:auto}.phase-grid,.cable-grid{grid-template-columns:1fr}.form-section{margin:10px 0}.section-title{margin-bottom:14px}.sticky-submit{position:sticky;bottom:0;background:rgba(245,246,248,.96);padding:10px 0 12px;margin:6px 0;display:grid;grid-template-columns:1fr}.submit-big,.secondary-link{width:100%;text-align:center;padding:14px}.big-upload{padding:18px 12px}}

/* v3 setup workbook import */
.import-card{max-width:860px}.import-form{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:end}.import-form .big-upload{padding:15px}.subtle{background:#eef4ff}.import-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:18px 0}.import-table{margin-top:16px}.import-table table{min-width:1050px}.compare-line{display:flex;justify-content:space-between;gap:10px;align-items:center;margin:4px 0}.compare-line .pill{white-space:nowrap}.conflict-row{background:#fffafa}.conflict-text{color:var(--badtext);margin-top:6px}.import-confirm{display:flex;justify-content:flex-end;gap:10px;margin:18px 0 36px}.import-confirm button{min-width:220px}
@media(max-width:760px){.import-form{grid-template-columns:1fr}.import-summary{grid-template-columns:1fr 1fr}.import-confirm{display:grid;grid-template-columns:1fr}.import-confirm .button,.import-confirm button{width:100%;text-align:center}.import-table{margin-left:-12px;margin-right:-12px;border-radius:0}}

/* v4 RYBA base + duplicate points */
.source-card{display:flex;justify-content:space-between;align-items:center;gap:20px}.source-card h2{margin:4px 0}.search-card{padding-top:10px;padding-bottom:12px}.dashboard-search{max-width:none;margin:0 0 8px}.dashboard-search input{font-size:16px}.point-line{color:#4b5563}.readonly-note{margin:14px 0;padding:10px 12px;border-radius:8px;background:#eef4ff;color:#385782;font-size:13px}.source-dl{grid-template-columns:170px 1fr}.choice-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.choice-card{display:flex;flex-direction:column;gap:5px;text-decoration:none;color:var(--text);border:1px solid var(--line);border-radius:10px;padding:14px;background:#fff}.choice-card:hover{border-color:#9dbce9;background:#f8fbff}.choice-card b{color:var(--accent);font-size:18px}.choice-card small{color:var(--muted)}.field-title{display:flex;align-items:baseline;gap:6px;min-height:16px}.optional-inline{font-size:11px;color:var(--muted);font-weight:400}.worker-grid>label{gap:6px}.badtext{color:var(--badtext)}
@media(max-width:760px){.source-card{display:block}.source-card form{margin-top:12px}.source-card button{width:100%}.choice-list{grid-template-columns:1fr}.source-dl{grid-template-columns:1fr}.source-dl dt{font-weight:700;margin-top:6px}.source-dl dd{padding-bottom:5px}}

.source-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.source-actions form{margin:0}.tiny{font-size:11px;margin-top:4px}.adpu-draft-note{max-width:180px;text-align:center}.action-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}


/* v5.6: одинаковая геометрия полей даты и времени в форме монтажа */
.worker-grid input[type="date"],
.worker-grid input[type="time"]{
    box-sizing:border-box;
    height:42px;
    min-height:42px;
    padding-top:10px;
    padding-bottom:10px;
    line-height:20px;
}
.worker-grid>label:nth-child(3),
.worker-grid>label:nth-child(4){
    align-self:start;
}


/* v5.8: примеры в полях чуть бледнее основного текста */
input::placeholder,
textarea::placeholder{
    color:#9aa3b2;
    opacity:0.72;
}


/* v5.11: Тип ТТ + два коэффициента + ИКК в одной строке */
.ct-main-row{
    display:grid;
    grid-template-columns: 2fr repeat(4, minmax(0, 1fr));
    gap:12px;
    align-items:end;
    margin-top:14px;
}
.ct-main-row label{
    min-width:0;
}
.ct-main-row input{
    width:100%;
    box-sizing:border-box;
}
@media (max-width: 760px){
    .ct-main-row{
        grid-template-columns:1fr 1fr;
    }
}
@media (max-width: 480px){
    .ct-main-row{
        grid-template-columns:1fr;
    }
}


/* v5.14: две кнопки документов */
.doc-actions{
    display:flex;
    flex-direction:column;
    gap:6px;
    align-items:flex-start;
}
.object-doc-actions{
    display:flex;
    flex-direction:column;
    gap:8px;
    align-items:stretch;
    min-width:220px;
}


/* v5.15: кнопки документов — синие */
.doc-actions a,
.documents a,
a.doc-button,
a[href^="/adpu/"],
a[href^="/completion-letter/"]{
    background:#2563eb !important;
    color:#fff !important;
    border-color:#2563eb !important;
}
.doc-actions a:hover,
.documents a:hover,
a.doc-button:hover,
a[href^="/adpu/"]:hover,
a[href^="/completion-letter/"]:hover{
    background:#1d4ed8 !important;
    border-color:#1d4ed8 !important;
    color:#fff !important;
}


/* v5.16: проверка ПУ в ФГИС АРШИН */
.meter-serial-row{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
}
.inline-form{
    display:inline;
    margin:0;
}
.arshin-button{
    padding:7px 10px;
    min-height:auto;
    white-space:nowrap;
}
.arshin-result{
    border-left:3px solid #cbd5e1;
    padding-left:10px;
}
.arshin-result.ok{
    border-left-color:#16a34a;
}
.arshin-result.error,
.arshin-result.not_found{
    border-left-color:#dc2626;
}
@media (max-width: 640px){
    .meter-serial-row{
        align-items:flex-start;
        flex-direction:column;
    }
}


/* v5.20: автоматическая проверка GRmetr при импорте наладки */
.import-confirm-grmetr{
    display:block;
}
.grmetr-check{
    display:flex;
    align-items:flex-start;
    gap:10px;
    padding:12px 14px;
    margin:14px 0;
    border:1px solid #dbe3ef;
    border-radius:10px;
    background:#f8fbff;
    cursor:pointer;
}
.grmetr-check input{
    width:18px;
    height:18px;
    margin-top:2px;
    flex:0 0 auto;
}
.grmetr-check span{
    display:flex;
    flex-direction:column;
    gap:4px;
}
.grmetr-check small{
    color:#64748b;
    line-height:1.35;
}


/* v5.23: комфорт интерфейса без смены визуального стиля */
html{scroll-behavior:smooth}
body{line-height:1.38}

button,.button,
input,textarea,select,
.choice-card,.tz,nav a{
    transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease,color .15s ease,transform .05s ease;
}
button:hover,.button:hover{
    border-color:#aeb7c2;
    background:#f8fafc;
}
button:active,.button:active{transform:translateY(1px)}
.primary:hover{
    background:#185fce;
    border-color:#185fce;
}
input:hover,textarea:hover,select:hover{border-color:#aeb7c2}
input:focus,textarea:focus,select:focus{
    outline:none;
    border-color:#79a7e8;
    box-shadow:0 0 0 3px rgba(31,111,235,.10);
}
a:focus-visible,button:focus-visible{
    outline:3px solid rgba(31,111,235,.20);
    outline-offset:2px;
}

.main-nav{gap:6px}
.main-nav a{
    padding:8px 11px;
    border-radius:8px;
    color:#4b5563;
    font-weight:700;
}
.main-nav a:hover{background:#f3f6fa;color:#20242a}
.main-nav a.active{
    background:#eef4ff;
    color:var(--accent);
}

.page-heading,.page-topbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}
.page-topbar{
    justify-content:flex-start;
    flex-wrap:wrap;
    min-height:30px;
    margin:0 0 14px;
}
.back-link{
    display:inline-flex;
    align-items:center;
    min-height:30px;
    padding:5px 8px;
    margin-left:-8px;
    border-radius:7px;
    color:#55606d;
    text-decoration:none;
    font-size:13px;
    font-weight:700;
}
.back-link:hover{background:#e9edf2;color:#20242a}

.title-row p,.page-heading p,.mobile-title p{margin-top:6px;margin-bottom:0}
.card>p:last-child{margin-bottom:0}
.card-actions,.form-actions{
    display:flex;
    gap:8px;
    align-items:center;
    flex-wrap:wrap;
    margin-top:16px;
}
.form-actions{justify-content:flex-end}

.table-wrap table thead th{
    position:sticky;
    top:0;
    z-index:2;
    box-shadow:0 1px 0 var(--line);
}
.object-row:hover td{background:#fbfcfe}
.object-row:last-child td{border-bottom:0}

.status{min-height:58px}
.status-grid{align-items:stretch}

details.card>summary{
    margin:-2px 0;
    padding:2px 0;
}
details.card[open]>summary{margin-bottom:4px}

.doc-actions a{
    text-align:center;
    width:100%;
}
.object-doc-actions .button{text-align:center}

.lookup input{min-width:0}
.lookup button{white-space:nowrap}

.action-row{align-items:center}
.action-row .button,.action-row button{white-space:nowrap}

@media(max-width:760px){
    .main-nav{
        display:grid;
        grid-template-columns:repeat(3,1fr);
        gap:6px;
        width:100%;
    }
    .main-nav a{text-align:center;padding:8px 6px}
    .page-topbar{margin-bottom:10px}
    .back-link{margin-left:-5px}
    .form-actions{
        display:grid;
        grid-template-columns:1fr;
    }
    .form-actions .button,.form-actions button{
        width:100%;
        text-align:center;
    }
    .object-doc-actions{
        margin-top:14px;
        min-width:0;
    }
    .card-actions{
        display:grid;
        grid-template-columns:1fr;
    }
    .card-actions .button{width:100%;text-align:center}
}



/* v5.27: ручная перезапись конфликтов наладки в РЫБУ */
.conflict-table .overwrite-conflict-btn{
    white-space:nowrap;
    padding:7px 10px;
    font-size:12px;
}
.conflict-table .overwrite-conflict-btn.overwrite-done{
    background:var(--ok);
    color:var(--oktext);
    border-color:#cce8d5;
}
.conflict-table .overwrite-conflict-btn:disabled{
    cursor:default;
    opacity:.9;
}
.conflict-table td:last-child{min-width:160px}


/* v5.30: авторизация и роли */
.head{gap:16px}
.head .main-nav{margin-left:auto}
.user-menu{
    display:flex;
    align-items:center;
    gap:8px;
    padding-left:12px;
    border-left:1px solid var(--line);
}
.user-name{
    color:#303844;
    text-decoration:none;
    font-size:13px;
    font-weight:700;
    max-width:180px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.user-name:hover{color:var(--accent)}
.logout-link{
    color:var(--muted);
    text-decoration:none;
    font-size:12px;
}
.logout-link:hover{color:var(--badtext)}

.auth-body{
    min-height:100%;
    background:var(--bg);
}
.auth-shell{
    max-width:460px;
    margin:0 auto;
    padding:70px 18px;
}
.auth-card{
    background:#fff;
    border:1px solid var(--line);
    border-radius:14px;
    padding:26px;
}
.auth-card-wide{max-width:520px}
.auth-brand{
    font-weight:900;
    font-size:20px;
    margin-bottom:24px;
}
.auth-card h1{font-size:28px}
.auth-form{
    display:grid;
    gap:14px;
    margin-top:20px;
}
.auth-submit{
    margin-top:4px;
    min-height:44px;
}

.password-form{
    max-width:560px;
    display:grid;
    gap:14px;
}
.password-form button{justify-self:start}

.user-create-grid{
    display:grid;
    grid-template-columns:1.1fr 1.4fr 1fr 1.2fr auto;
    gap:10px;
    align-items:end;
}
.users-table table{min-width:1100px}
.users-table td{vertical-align:middle}
.user-display-input{margin-bottom:6px}
.user-active-check{
    display:flex;
    flex-direction:row;
    align-items:center;
    gap:8px;
    font-weight:400;
}
.user-active-check input{
    width:18px;
    height:18px;
}
.inline-password-form{
    display:flex;
    gap:6px;
    align-items:center;
}
.inline-password-form input{min-width:150px}
.field-note{
    color:var(--muted);
    font-size:11px;
    font-weight:400;
}
input[readonly]{
    background:#f5f7f9;
    color:#4b5563;
}
.access-denied{
    max-width:620px;
    margin-top:30px;
}

@media(max-width:900px){
    .head{
        flex-wrap:wrap;
        padding-top:10px;
        padding-bottom:10px;
        height:auto;
    }
    .head .main-nav{
        order:3;
        width:100%;
        margin-left:0;
    }
    .user-menu{margin-left:auto}
    .user-create-grid{grid-template-columns:1fr 1fr}
    .user-create-grid button{width:100%}
}
@media(max-width:560px){
    .auth-shell{padding:30px 12px}
    .auth-card{padding:20px 16px}
    .user-menu{
        padding-left:0;
        border-left:0;
    }
    .user-name{max-width:140px}
    .user-create-grid{grid-template-columns:1fr}
}


/* v5.32: показать / скрыть пароль */
.password-field{
    position:relative;
    width:100%;
}
.password-field input{
    width:100%;
    padding-right:88px;
}
.password-toggle{
    position:absolute;
    right:6px;
    top:50%;
    transform:translateY(-50%);
    min-height:32px;
    padding:4px 8px;
    border:0;
    border-radius:6px;
    background:transparent;
    color:var(--accent);
    font-size:12px;
    font-weight:700;
    cursor:pointer;
}
.password-toggle:hover{
    background:#eef4ff;
    border:0;
}
.password-toggle:active{
    transform:translateY(-50%);
}
.password-toggle:focus-visible{
    outline:2px solid rgba(31,111,235,.25);
    outline-offset:1px;
}
.inline-password-form .password-field{
    min-width:150px;
}
@media(max-width:560px){
    .password-field input{
        padding-right:82px;
    }
}


/* v5.34: отдельная постоянная папка данных */
.storage-path{
    padding:10px 12px;
    border:1px solid var(--line);
    border-radius:8px;
    background:#f7f9fb;
    font-family:Consolas,monospace;
    font-size:13px;
    overflow-wrap:anywhere;
}
.storage-steps{
    margin:10px 0 0 22px;
    padding:0;
}
.storage-steps li{
    margin:8px 0;
}


/* v5.35: удаление пользователей */
.danger-button{
    color:#b42318;
    border-color:#f0c7c3;
    background:#fff;
}
.danger-button:hover{
    color:#8f1d14;
    border-color:#e7aaa4;
    background:#fff6f5;
}
.user-delete-cell{
    min-width:105px;
    text-align:center;
}


/* v5.36: мобильная версия + сетевой запуск */
.network-dl{grid-template-columns:150px minmax(0,1fr)}
.network-url-list{display:grid;gap:10px}
.network-url{
    display:block;padding:14px;border:1px solid #cbd1d8;border-radius:10px;
    background:#f8fbff;color:var(--accent);font-size:17px;font-weight:800;
    text-decoration:none;overflow-wrap:anywhere
}
.network-url:hover{border-color:#9dbce9;background:#eef5ff}

@media(max-width:760px){
    html{-webkit-text-size-adjust:100%}
    body{overflow-x:hidden}
    .wrap{padding-left:10px;padding-right:10px}
    main{padding-top:14px;padding-bottom:42px}

    .head{
        display:flex;align-items:center;flex-wrap:wrap;gap:8px 10px;
        padding-top:9px;padding-bottom:9px
    }
    .brand{margin:0;font-size:18px}
    .user-menu{margin-left:auto;gap:7px}
    .user-name{max-width:135px}
    .main-nav{
        order:3;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
        gap:6px;width:100%;margin:0
    }
    .main-nav a{
        min-height:42px;display:flex;align-items:center;justify-content:center;
        padding:8px 6px;font-size:13px
    }
    .main-nav a:only-child{grid-column:1/-1}

    input,textarea,select{font-size:16px;min-height:44px;padding:10px 11px}
    textarea{min-height:88px}
    button,.button{
        min-height:44px;display:inline-flex;align-items:center;justify-content:center
    }

    .card{padding:13px;margin:12px 0;border-radius:10px}
    .mobile-title p{font-size:13px}
    .section-title{gap:9px}
    .section-title h2{font-size:17px}
    .section-title p{font-size:12px}
    .stepnum{flex-basis:26px;width:26px;height:26px}

    .lookup{max-width:none;width:100%}
    .lookup input{min-width:0;font-size:16px}
    .lookup-card input{font-size:17px}

    .object-head{padding:12px;overflow-wrap:anywhere}
    .montage-head strong,.montage-head b{overflow-wrap:anywhere}

    .big-upload{align-items:stretch;flex-direction:column}
    .big-upload input[type="file"]{max-width:100%;padding:9px}

    .photo-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
    .photo-grid a{min-width:0}

    .sticky-submit{z-index:8;border-top:1px solid rgba(223,227,232,.95)}
    .submit-big,.secondary-link{min-height:50px}

    .network-dl{grid-template-columns:1fr;gap:4px}
    .network-dl dt{font-weight:700;margin-top:8px}
}

@media(max-width:520px){
    .lookup,.dashboard-search{grid-template-columns:1fr}
    .lookup button,.lookup .button,.dashboard-search button,.dashboard-search .button{width:100%}
    .source-actions{display:grid;grid-template-columns:1fr}
    .source-actions form,.source-actions .button{width:100%}
}

@media(max-width:640px){
    .table-wrap:has(.dashboard-table){
        overflow:visible;background:transparent;border:0;border-radius:0
    }
    .dashboard-table{min-width:0;display:block}
    .dashboard-table thead{display:none}
    .dashboard-table tbody{display:grid;gap:10px}
    .dashboard-table tr{
        display:block;background:#fff;border:1px solid var(--line);
        border-radius:11px;overflow:hidden
    }
    .dashboard-table td{
        display:grid;grid-template-columns:96px minmax(0,1fr);align-items:center;
        gap:10px;width:100%;padding:9px 11px;border-bottom:1px solid var(--line)
    }
    .dashboard-table td:last-child{border-bottom:0}
    .dashboard-table td::before{
        content:attr(data-label);color:var(--muted);font-size:11px;font-weight:800;
        text-transform:uppercase;letter-spacing:.03em
    }
    .dashboard-table .dashboard-main-cell{display:block;padding-top:11px;padding-bottom:11px}
    .dashboard-table .dashboard-main-cell::before{display:block;margin-bottom:5px}
    .dashboard-table .tz{font-size:18px}
    .dashboard-table .doc-actions{gap:7px;align-items:stretch}
    .dashboard-table .doc-actions a{width:100%;min-height:42px;text-align:center}
}

@media(max-width:360px){
    .wrap{padding-left:8px;padding-right:8px}
    .brand{font-size:17px}
    .user-name{max-width:105px}
    .main-nav a{font-size:12px}
    .dashboard-table td{grid-template-columns:82px minmax(0,1fr);gap:7px}
}


/* v5.37: внешний доступ */
.external-access-card h3{
    margin:18px 0 8px;
    font-size:16px;
}
.external-access-card .notice{
    margin-top:12px;
}


/* v5.38: тест внешнего доступа через ngrok */
.ngrok-card{
    border-top:3px solid #cbd5e1;
}
.ngrok-card .storage-steps{
    margin-top:12px;
}


/* v5.40: заметные промежутки между кнопками на мобильном */
@media(max-width:640px){
    .dashboard-table .doc-actions{
        gap:12px;
    }
    .dashboard-table .doc-actions a{
        margin:0;
    }
    .object-doc-actions{
        gap:12px;
    }
    .card-actions,
    .form-actions{
        row-gap:10px;
    }
}


/* v5.52: реальные интервалы мобильных кнопок документов + входящие монтажи */
.nav-badge{
    display:inline-flex;
    min-width:20px;
    height:20px;
    padding:0 6px;
    margin-left:5px;
    border-radius:999px;
    align-items:center;
    justify-content:center;
    background:#d92d20;
    color:#fff;
    font-size:11px;
    font-weight:900;
    line-height:1;
    vertical-align:middle;
}
.montage-alert{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    background:#eef6ff;
    border:1px solid #bfdbfe;
    margin:12px 0 18px;
}
.montage-alert .small{margin-top:4px}
.montage-alert .button{flex:0 0 auto}

.inbox-heading{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:14px;
}
.inbox-summary{margin-bottom:14px}
.montage-inbox-list{display:grid;gap:12px}
.montage-event{margin:0}
.montage-event.unread{
    border-color:#93c5fd;
    box-shadow:0 0 0 2px rgba(37,99,235,.06);
}
.montage-event.read{opacity:.88}
.montage-event-top{
    display:flex;
    justify-content:space-between;
    gap:18px;
    align-items:flex-start;
}
.event-title-row{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
}
.event-title-row .tz{font-size:20px}
.inbox-new{
    background:#dbeafe;
    color:#1d4ed8;
}
.event-object{font-weight:800;margin-top:5px}
.event-time{text-align:right;white-space:nowrap;font-size:13px}
.tiny{font-size:11px}
.event-meta{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
    margin-top:14px;
}
.event-meta>div{
    padding:10px 12px;
    border:1px solid var(--line);
    border-radius:9px;
    background:#f8fafc;
}
.event-meta span{
    display:block;
    color:var(--muted);
    font-size:11px;
    font-weight:700;
    margin-bottom:4px;
}
.event-meta b{overflow-wrap:anywhere}
.event-note{
    margin-top:12px;
    padding:10px 12px;
    background:#fff8e6;
    border-radius:8px;
    overflow-wrap:anywhere;
}
.event-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin-top:14px;
}
.event-actions form{margin:0}

/* На старой мобильной разметке .dashboard-main-cell задавал display:block,
   поэтому обычный gap у .doc-actions не работал. Здесь принудительно
   возвращаем flex-контейнер именно ячейке документов. */
@media(max-width:640px){
    .dashboard-table td.dashboard-main-cell.doc-actions{
        display:flex !important;
        flex-direction:column !important;
        align-items:stretch !important;
        gap:11px !important;
    }
    .dashboard-table td.dashboard-main-cell.doc-actions::before{
        display:block;
        margin-bottom:0;
    }
    .dashboard-table td.dashboard-main-cell.doc-actions a{
        width:100%;
        margin:0 !important;
    }

    .montage-alert{
        display:grid;
        grid-template-columns:1fr;
    }
    .montage-alert .button{width:100%;text-align:center}

    .inbox-heading{
        display:grid;
        grid-template-columns:1fr;
        align-items:stretch;
    }
    .inbox-heading form,.inbox-heading button{width:100%}

    .montage-event-top{
        display:grid;
        grid-template-columns:1fr;
        gap:8px;
    }
    .event-time{text-align:left}
    .event-meta{grid-template-columns:1fr}
    .event-actions{
        display:grid;
        grid-template-columns:1fr;
        gap:9px;
    }
    .event-actions form,.event-actions button{
        width:100%;
    }
}


/* v5.53: пункты верхнего меню без переноса строк */
.main-nav{
    flex-wrap:nowrap;
}
.main-nav a{
    white-space:nowrap !important;
    flex:0 0 auto;
}

/* Если окно уже, чем вся строка меню, лучше горизонтальная прокрутка,
   чем перенос названия пункта на две строки. */
@media(min-width:641px){
    .main-nav{
        overflow-x:auto;
        overflow-y:hidden;
        scrollbar-width:thin;
        max-width:100%;
    }
}

/* В мобильной сетке тоже запрещаем перенос текста внутри кнопки. */
@media(max-width:640px){
    .main-nav a{
        white-space:nowrap !important;
        min-width:0;
    }
}


/* v5.55: iPhone/mobile — поля монтажа больше не выходят за границы карточки */
@media(max-width:640px){
    /* Любой grid/flex-элемент формы должен иметь право сжиматься. */
    .montage-form,
    .montage-form *,
    .montage-head,
    .montage-head > div,
    .form-section,
    .form-section > *,
    .form-grid,
    .form-grid > *,
    .two-col,
    .two-col > *,
    .grid4,
    .grid4 > *,
    .field-row,
    .field-row > *{
        min-width:0 !important;
        box-sizing:border-box;
    }

    /* Карточки/секции не могут стать шире области экрана. */
    .montage-form,
    .montage-form .card,
    .montage-form .form-section{
        width:100% !important;
        max-width:100% !important;
        overflow-x:hidden;
    }

    /* На телефоне монтажная форма всегда в одну колонку. */
    .montage-form .form-grid,
    .montage-form .two-col,
    .montage-form .grid4,
    .montage-form .field-row{
        display:grid !important;
        grid-template-columns:minmax(0,1fr) !important;
        width:100% !important;
        max-width:100% !important;
    }

    /* Safari/iOS иногда назначает date/time собственную intrinsic width.
       width:0 + min-width:100% заставляет их жить в ширине родителя. */
    .montage-form input,
    .montage-form select,
    .montage-form textarea{
        display:block;
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
        box-sizing:border-box !important;
    }

    .montage-form input[type="date"],
    .montage-form input[type="time"],
    .montage-form input[type="datetime-local"]{
        -webkit-appearance:none;
        appearance:none;
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
        box-sizing:border-box !important;
    }

    /* Конкретно нижняя зона формы со временем/датой и снятым ПУ. */
    .montage-form label{
        width:100%;
        max-width:100%;
        min-width:0;
    }

    /* Кнопки внизу также не растягивают страницу. */
    .montage-form .form-actions,
    .montage-form .card-actions{
        width:100%;
        max-width:100%;
        min-width:0;
    }
    .montage-form .form-actions button,
    .montage-form .form-actions .button,
    .montage-form .card-actions button,
    .montage-form .card-actions .button{
        width:100%;
        max-width:100%;
        box-sizing:border-box;
    }
}

/* Дополнительная страховка от горизонтального скролла на узких iPhone. */
@media(max-width:430px){
    html,body{max-width:100%;overflow-x:hidden}
    main.wrap{max-width:100%;overflow-x:hidden}
}


/* v5.57: очистка обработанных записей «Новые монтажи» */
.inbox-heading-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    justify-content:flex-end;
}
.inbox-heading-actions form{margin:0}
.danger-soft{
    color:#b42318;
    border-color:#f1c0bb;
    background:#fff7f6;
}
.danger-soft:hover{
    background:#fff0ee;
    border-color:#e9a7a0;
}
@media(max-width:640px){
    .inbox-heading-actions{
        display:grid;
        grid-template-columns:1fr;
        width:100%;
    }
    .inbox-heading-actions form,
    .inbox-heading-actions button{
        width:100%;
    }
}


/* v5.58: логотип Энерго-Альянс в рабочей шапке */
.brand-logo{
    display:flex !important;
    align-items:center;
    flex:0 0 auto;
    width:auto;
    max-width:325px;
    min-width:0;
    padding:0 !important;
    background:transparent !important;
    text-decoration:none;
    overflow:hidden;
}
.brand-logo img{
    display:block;
    width:auto;
    height:48px;
    max-width:100%;
    object-fit:contain;
    object-position:left center;
}

/* На телефоне логотип компактный; существующие кнопки/меню не меняем. */
@media(max-width:640px){
    .brand-logo{
        max-width:190px;
        flex:1 1 150px;
    }
    .brand-logo img{
        width:100%;
        height:auto;
        max-height:46px;
        object-fit:contain;
        object-position:left center;
    }
}
@media(max-width:390px){
    .brand-logo{
        max-width:165px;
        flex-basis:135px;
    }
    .brand-logo img{
        max-height:42px;
    }
}


/* v5.62: компактное управление пользователями в Android */
.mobile-user-create,
.mobile-user-edit,
.mobile-password-reset{
    display:grid;
    gap:12px;
}
.mobile-user-list{
    display:grid;
    gap:12px;
}
.mobile-user-card{
    margin:0;
}
.mobile-user-head{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:12px;
    margin-bottom:12px;
}
.mobile-user-name{
    font-size:18px;
    font-weight:800;
    overflow-wrap:anywhere;
}
.mobile-user-status{
    flex:0 0 auto;
    padding:5px 9px;
    border-radius:999px;
    font-size:11px;
    font-weight:800;
}
.mobile-user-status.is-active{
    background:#e9f8ef;
    color:#18794e;
}
.mobile-user-status.is-disabled{
    background:#f2f4f7;
    color:#667085;
}
.mobile-current-user{
    padding:8px 10px;
    margin:0 0 12px;
    border-radius:8px;
    background:#eef4ff;
    color:#2457a7;
    font-size:12px;
    font-weight:700;
}
.mobile-user-active-row{
    min-height:46px;
    flex-direction:row;
    justify-content:space-between;
    align-items:center;
    padding:0 2px;
}
.mobile-user-active-row input{
    width:22px;
    height:22px;
    min-height:0;
}
.mobile-user-meta{
    display:grid;
    gap:3px;
    padding:9px 10px;
    background:#f7f9fb;
    border-radius:8px;
    color:var(--muted);
    font-size:11px;
}
.mobile-user-separator{
    height:1px;
    background:var(--line);
    margin:15px 0;
}
.mobile-password-reset{
    margin-bottom:10px;
}
.mobile-delete-user{
    margin-top:8px;
}
.mobile-full-button{
    width:100%;
    text-align:center;
}
.mobile-users-title{
    margin-bottom:8px;
}

@media(max-width:640px){
    .mobile-user-create-card h2{
        margin-bottom:14px;
    }
    .mobile-user-card{
        padding:14px;
    }
}


/* v5.63: актуальные страницы «Данные» и «Доступ» */
.network-url-main{
    font-size:20px;
    font-weight:800;
    padding:12px 14px;
}
.access-ready{margin-top:14px}
.access-chain{
    display:grid;
    grid-template-columns:1fr auto 1fr auto 1fr auto 1fr;
    gap:9px;
    align-items:center;
}
.access-chain>div:not(.access-arrow){
    min-width:0;
    padding:12px;
    border:1px solid var(--line);
    border-radius:9px;
    background:#f8fafc;
}
.access-chain b,.access-chain span{display:block}
.access-chain span{
    margin-top:4px;
    color:var(--muted);
    font-size:11px;
    overflow-wrap:anywhere;
}
.access-arrow{
    color:var(--muted);
    font-weight:900;
    text-align:center;
}
.access-tools{display:grid;gap:10px}
.access-tools>div{
    display:grid;
    grid-template-columns:minmax(190px,auto) 1fr;
    gap:14px;
    align-items:start;
    padding:11px 12px;
    border:1px solid var(--line);
    border-radius:9px;
}
.access-tools span{
    color:var(--muted);
    font-size:12px;
}
.access-lan-details{margin-top:14px}
.access-lan-details summary{
    cursor:pointer;
    font-weight:700;
    color:#44505f;
}
.storage-main-card .storage-path{margin-top:3px}

@media(max-width:760px){
    .access-chain{grid-template-columns:1fr}
    .access-arrow{transform:rotate(90deg)}
    .access-tools>div{
        grid-template-columns:1fr;
        gap:4px;
    }
}


/* v5.64: статистика монтажей */
.stats-filter-card{margin-bottom:12px}
.stats-presets{
    display:flex;
    flex-wrap:wrap;
    gap:7px;
    margin-bottom:14px;
}
.stats-presets .button{
    min-height:36px;
    padding:8px 11px;
    font-size:12px;
}
.stats-preset-active{
    background:#eef4ff !important;
    border-color:#b7d1f7 !important;
    color:var(--accent) !important;
}
.stats-custom-form{
    display:grid;
    grid-template-columns:minmax(240px,1.5fr) minmax(180px,.85fr) minmax(180px,.85fr) 110px;
    gap:10px;
    align-items:end;
}
.stats-custom-form label{
    display:grid;
    grid-template-rows:auto 42px;
    gap:5px;
    min-width:0;
    margin:0;
}
.stats-custom-form select,
.stats-custom-form input[type="date"]{
    width:100%;
    height:42px;
    min-height:42px;
    box-sizing:border-box;
}
.stats-custom-form .primary{
    width:110px;
    height:42px;
    min-height:42px;
    align-self:end;
}
.stats-scope-line{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    align-items:center;
    margin:2px 0 12px;
    color:var(--muted);
    font-size:13px;
}
.stats-scope-line a{
    margin-left:6px;
    color:var(--accent);
    text-decoration:none;
    font-weight:700;
}
.stats-cards{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:10px;
}
.stats-card{
    background:#fff;
    border:1px solid var(--line);
    border-radius:11px;
    padding:14px 15px;
}
.stats-card span{
    display:block;
    color:var(--muted);
    font-size:12px;
    font-weight:700;
}
.stats-card strong{
    display:block;
    margin-top:5px;
    font-size:28px;
    line-height:1;
}
.stats-rule{margin:10px 0 18px}
.stats-table{min-width:650px}
.stats-table th,.stats-table td{padding:10px 12px}
.stats-installer-link{
    color:var(--accent);
    text-decoration:none;
    font-weight:800;
}
.stats-bottom-grid{align-items:start}
.stats-daily-list{
    display:grid;
    gap:6px;
}
.stats-daily-list>div{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:9px 10px;
    border:1px solid var(--line);
    border-radius:8px;
}
.stats-daily-list b{font-size:16px}
.stats-recent-list{
    display:grid;
    gap:6px;
}
.stats-recent-item{
    display:flex;
    justify-content:space-between;
    gap:12px;
    padding:9px 10px;
    border:1px solid var(--line);
    border-radius:8px;
    text-decoration:none;
    color:inherit;
}
.stats-recent-item:hover{background:#f8fafc}
.stats-recent-item span{
    display:block;
    margin-top:3px;
    color:var(--muted);
    font-size:11px;
}
.stats-recent-right{
    flex:0 0 auto;
    text-align:right;
}
.stats-recent-right strong{
    display:block;
    margin-top:3px;
    font-size:12px;
}

/* v5.64: более компактное desktop-меню без горизонтального скролла */
@media(min-width:901px){
    .head{gap:8px}
    .brand-logo img{height:40px}
    .head .main-nav{
        flex:1 1 auto;
        min-width:0;
        justify-content:center;
        gap:2px;
        overflow:visible !important;
        max-width:none !important;
        scrollbar-width:none;
    }
    .head .main-nav a{
        padding:6px 7px;
        font-size:12px;
    }
    .user-menu{
        gap:5px;
        padding-left:8px;
    }
    .user-name{
        max-width:125px;
        font-size:12px;
    }
    .logout-link{font-size:11px}
}

/* На более узком desktop/tablet меню переносится на вторую строку,
   а не превращается в горизонтальный скролл. */
@media(min-width:641px) and (max-width:1100px){
    .head{
        height:auto;
        flex-wrap:wrap;
        padding-top:8px;
        padding-bottom:8px;
    }
    .head .main-nav{
        order:3;
        width:100%;
        margin-left:0;
        justify-content:flex-start;
        flex-wrap:wrap !important;
        overflow:visible !important;
    }
}

@media(max-width:760px){
    .stats-custom-form{
        grid-template-columns:1fr 1fr;
    }
    .stats-custom-form label:first-of-type{
        grid-column:1/-1;
    }
    .stats-custom-form .primary{
        width:100%;
    }
    .stats-cards{
        grid-template-columns:1fr 1fr;
    }
    .stats-bottom-grid{grid-template-columns:1fr}
}
@media(max-width:520px){
    .stats-custom-form{grid-template-columns:1fr}
    .stats-custom-form label:first-of-type{grid-column:auto}
    .stats-cards{grid-template-columns:1fr 1fr}
    .stats-card{padding:12px}
    .stats-card strong{font-size:24px}
    .stats-recent-item{align-items:flex-start}
}


/* v5.66: структура КС и журнал документов */
.section-tabs{
    display:flex;
    gap:6px;
    align-items:center;
    margin:0 0 14px;
    padding:4px;
    width:max-content;
    max-width:100%;
    border:1px solid var(--line);
    border-radius:10px;
    background:#f5f7fa;
}
.section-tabs a{
    padding:8px 15px;
    border-radius:7px;
    color:#4b5563;
    font-size:13px;
    font-weight:800;
    text-decoration:none;
}
.section-tabs a.active{
    background:#fff;
    color:var(--accent);
    box-shadow:0 1px 4px rgba(16,24,40,.08);
}

.ks-doc-beta{margin-bottom:12px}
.ks-doc-counters{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:9px;
    margin-bottom:12px;
}
.ks-doc-counter{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:11px 13px;
    border:1px solid var(--line);
    border-radius:10px;
    background:#fff;
    color:inherit;
    text-decoration:none;
}
.ks-doc-counter span{
    color:var(--muted);
    font-size:12px;
    font-weight:700;
}
.ks-doc-counter b{font-size:22px}
.ks-doc-counter.active{
    border-color:#b7d1f7;
    background:#f4f8ff;
}
.ks-doc-search{margin-bottom:12px}
.ks-doc-table{min-width:1260px}
.ks-doc-table th{
    white-space:nowrap;
}
.ks-doc-table td{
    vertical-align:top;
}
.ks-doc-table td:first-child{
    min-width:190px;
}
.ks-doc-select{
    width:100%;
    min-width:155px;
    margin-bottom:8px;
}
.tiny-label{
    display:block;
    margin:0 0 3px;
    color:var(--muted);
    font-size:10px;
    font-weight:700;
}
.ks-doc-date-group{
    min-width:150px;
    margin-bottom:10px;
}
.ks-doc-date-group:last-child{margin-bottom:0}
.ks-doc-date-group>b{
    display:block;
    margin-bottom:5px;
    font-size:11px;
}
.ks-doc-date-group label{
    display:block;
    margin-bottom:5px;
    color:var(--muted);
    font-size:9px;
}
.ks-doc-date-group input{
    width:100%;
    min-height:34px;
    margin-top:2px;
    padding:5px 7px;
    font-size:11px;
}
.ks-doc-comment{
    min-width:180px;
    min-height:92px;
    resize:vertical;
}
.ks-doc-save-cell{
    min-width:100px;
    text-align:center;
}
.ks-doc-save{
    width:100%;
    min-width:90px;
}
.ks-doc-updated{
    margin-top:7px;
}
.settings-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
}
.settings-link-card{
    text-decoration:none;
    color:inherit;
}
.settings-link-card:hover{
    border-color:#b7d1f7;
    box-shadow:0 3px 12px rgba(16,24,40,.06);
}
.settings-link-card h2{margin-bottom:5px}
.settings-link-card p{
    margin:0;
    color:var(--muted);
}

@media(min-width:901px){
    .head .main-nav a{
        padding-left:9px;
        padding-right:9px;
    }
}

@media(max-width:760px){
    .ks-doc-counters{
        grid-template-columns:1fr 1fr;
    }
    .settings-grid{
        grid-template-columns:1fr;
    }
    .section-tabs{
        width:100%;
    }
    .section-tabs a{
        flex:1 1 auto;
        text-align:center;
    }
}


/* v5.67: улучшение оформления КС / Документы / Настройки */
.ks-nav-shell{
    margin:0 0 18px;
    padding:16px 18px;
    border:1px solid #d9e6f7;
    border-radius:16px;
    background:linear-gradient(180deg,#f7fbff 0%,#eef5ff 100%);
    box-shadow:0 6px 20px rgba(31,111,235,.06);
}
.ks-nav-head h2{
    margin:2px 0 6px;
    font-size:20px;
}
.ks-nav-head p{
    margin:0;
    max-width:850px;
}
.ks-main-tabs{
    margin-top:14px;
    padding:6px;
    width:100%;
    border:1px solid #dbe7f6;
    border-radius:14px;
    background:rgba(255,255,255,.82);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.7);
}
.ks-main-tabs a{
    display:flex;
    flex-direction:column;
    gap:3px;
    min-width:190px;
    padding:12px 16px;
    border-radius:11px;
    border:1px solid transparent;
    background:transparent;
}
.ks-main-tabs a:hover{
    background:#f6faff;
    border-color:#d7e6fb;
}
.ks-main-tabs a.active{
    background:linear-gradient(180deg,#2f7df5 0%,#1f6feb 100%);
    color:#fff;
    border-color:#1f6feb;
    box-shadow:0 8px 18px rgba(31,111,235,.24);
}
.ks-main-tabs a.active .tab-subtitle{color:rgba(255,255,255,.84)}
.tab-title{
    font-size:15px;
    font-weight:900;
    line-height:1.15;
}
.tab-subtitle{
    color:#667085;
    font-size:12px;
    font-weight:700;
    line-height:1.2;
}

.settings-heading{margin-bottom:14px}
.settings-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:14px;
}
.settings-link-card{
    display:flex;
    align-items:center;
    gap:14px;
    min-height:132px;
    margin:0;
    text-decoration:none !important;
    color:inherit !important;
    box-shadow:0 2px 10px rgba(16,24,40,.03);
}
.settings-link-card:hover{
    border-color:#b7d1f7;
    background:#fbfdff;
    box-shadow:0 8px 24px rgba(31,111,235,.08);
    transform:translateY(-1px);
}
.settings-icon{
    flex:0 0 52px;
    width:52px;
    height:52px;
    border-radius:14px;
    display:grid;
    place-items:center;
    font-size:24px;
    background:#eef4ff;
}
.settings-body{flex:1 1 auto;min-width:0}
.settings-body h2{margin:0 0 8px;font-size:18px}
.settings-body p{margin:0;color:var(--muted);line-height:1.45}
.settings-arrow{
    flex:0 0 auto;
    color:#8b95a5;
    font-size:24px;
    font-weight:700;
}

.ks-doc-page-head{margin-bottom:8px}
.ks-doc-beta{
    margin-bottom:14px;
    border:1px solid #cfe0f8;
    background:#f6faff;
    color:#385782;
    line-height:1.5;
}
.ks-doc-counters{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:10px;
    margin-bottom:14px;
}
.ks-doc-counter{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    min-height:74px;
    padding:14px 16px;
    border:1px solid var(--line);
    border-radius:14px;
    background:#fff;
    color:inherit;
    text-decoration:none;
    box-shadow:0 2px 8px rgba(16,24,40,.03);
}
.ks-doc-counter:hover{
    border-color:#bfd5f6;
    background:#fbfdff;
    box-shadow:0 8px 18px rgba(31,111,235,.07);
}
.ks-doc-counter span{
    color:#667085;
    font-size:12px;
    font-weight:800;
    line-height:1.2;
}
.ks-doc-counter b{
    font-size:24px;
    line-height:1;
}
.ks-doc-counter.active{
    border-color:#9fc1f1;
    background:linear-gradient(180deg,#f7fbff 0%,#eef5ff 100%);
    box-shadow:0 8px 18px rgba(31,111,235,.07);
}
.ks-doc-search{
    margin-bottom:14px;
    box-shadow:0 2px 8px rgba(16,24,40,.03);
}
.ks-doc-list{
    display:grid;
    gap:14px;
}
.ks-doc-card{
    margin:0;
    padding:18px;
    border-radius:16px;
    box-shadow:0 2px 10px rgba(16,24,40,.03);
}
.ks-doc-card-head{
    display:flex;
    justify-content:space-between;
    gap:16px;
    align-items:flex-start;
    margin-bottom:16px;
    padding-bottom:14px;
    border-bottom:1px solid #edf1f5;
}
.ks-doc-object{min-width:0}
.ks-doc-object-row{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
    margin:2px 0 4px;
}
.ks-doc-applicant{max-width:920px;line-height:1.45}
.ks-doc-top-actions{flex:0 0 auto}
.ks-doc-save-top{min-width:116px}
.ks-doc-card-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:14px;
}
.ks-doc-block{
    background:#fafbfd;
    border:1px solid #e7ecf2;
    border-radius:14px;
    padding:14px;
}
.ks-doc-block-title{
    margin:0 0 12px;
    font-size:14px;
    font-weight:900;
    color:#243041;
}
.ks-doc-select{margin-bottom:10px}
.ks-doc-dates-block{grid-column:span 2}
.ks-doc-date-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
}
.ks-doc-date-group{
    min-width:0;
    margin:0;
    padding:12px;
    border:1px solid #e9edf2;
    border-radius:12px;
    background:#fff;
}
.ks-doc-date-group b{
    font-size:12px;
    margin-bottom:8px;
}
.ks-doc-date-group label{
    font-size:11px;
    color:#667085;
    margin-bottom:8px;
}
.ks-doc-date-group label:last-child{margin-bottom:0}
.ks-doc-date-group input{
    min-height:40px;
    padding:8px 10px;
    font-size:13px;
    background:#fff;
}
.ks-doc-comment-block{display:flex;flex-direction:column}
.ks-doc-comment{
    min-width:0;
    min-height:140px;
    height:100%;
    background:#fff;
}
.ks-doc-bottom-actions{
    margin-top:14px;
    padding-top:14px;
    border-top:1px solid #edf1f5;
}
.ks-doc-save-bottom{min-width:128px}

@media(max-width:1100px){
    .ks-doc-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
    .ks-doc-dates-block{grid-column:1/-1}
}
@media(max-width:760px){
    .ks-nav-shell{padding:14px}
    .ks-nav-head h2{font-size:18px}
    .ks-main-tabs{
        width:100%;
        flex-direction:column;
    }
    .ks-main-tabs a{
        min-width:0;
        width:100%;
    }
    .settings-grid{grid-template-columns:1fr}
    .settings-link-card{min-height:0;padding:16px}
    .settings-icon{width:46px;height:46px;font-size:22px}
    .ks-doc-counters{grid-template-columns:1fr 1fr}
    .ks-doc-card{padding:14px}
    .ks-doc-card-head{
        flex-direction:column;
        align-items:stretch;
    }
    .ks-doc-save-top{width:100%}
    .ks-doc-card-grid{grid-template-columns:1fr}
    .ks-doc-dates-block{grid-column:auto}
    .ks-doc-date-grid{grid-template-columns:1fr}
    .ks-doc-save-bottom{width:100%}
}


/* v5.68: компактная навигация КС и журнал документов как на обычном сайте */
.compact-page-heading{margin-bottom:12px}
.compact-page-heading h1{font-size:26px}
.compact-page-heading p{margin-top:4px}

.ks-subnav-wrap{
    display:flex;
    align-items:center;
    gap:12px;
    margin:0 0 16px;
    padding:8px 10px;
    border:1px solid #dce3eb;
    border-radius:12px;
    background:#fff;
    box-shadow:0 2px 8px rgba(16,24,40,.03);
}
.ks-subnav-label{
    flex:0 0 auto;
    padding:0 4px;
    color:#344054;
    font-size:18px;
    font-weight:900;
}
.ks-subnav{
    display:flex;
    gap:6px;
    align-items:center;
    flex-wrap:wrap;
}
.ks-subnav a{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:36px;
    padding:8px 14px;
    border:1px solid #d6dde6;
    border-radius:9px;
    background:#f8fafc;
    color:#344054;
    text-decoration:none;
    font-size:13px;
    font-weight:800;
}
.ks-subnav a:hover{background:#f1f6fd;border-color:#b9cceb;color:#1f5fb8}
.ks-subnav a.active{
    border-color:#1f6feb;
    background:#1f6feb;
    color:#fff;
    box-shadow:0 3px 8px rgba(31,111,235,.18);
}

.ks-filter-pills{
    display:flex;
    gap:8px;
    align-items:center;
    flex-wrap:wrap;
    margin:0 0 12px;
}
.ks-filter-pill{
    display:inline-flex;
    align-items:center;
    gap:8px;
    min-height:36px;
    padding:7px 11px;
    border:1px solid #d6dde6;
    border-radius:9px;
    background:#fff;
    color:#475467;
    text-decoration:none;
    font-size:12px;
    font-weight:800;
}
.ks-filter-pill b{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:24px;
    height:22px;
    padding:0 7px;
    border-radius:999px;
    background:#eef2f6;
    color:#344054;
    font-size:11px;
}
.ks-filter-pill:hover{border-color:#b9cceb;background:#f8fbff}
.ks-filter-pill.active{border-color:#9dbce9;background:#eef4ff;color:#1f5fb8}
.ks-filter-pill.active b{background:#1f6feb;color:#fff}

.compact-notice{margin:0 0 12px;padding:9px 11px;font-size:12px}
.ks-compact-search{margin:0 0 12px;padding:10px 12px}
.ks-search-row{display:flex;gap:8px;align-items:center;margin-bottom:4px}
.ks-search-row input{min-height:38px;padding:8px 10px;font-size:14px}
.ks-search-row button,.ks-search-row .button{min-height:38px;padding:8px 12px}

/* v5.74: one compact filter form, shared by admins and document assistants. */
.ks-document-filter-form{display:grid;grid-template-columns:minmax(150px,1fr) minmax(170px,1fr) minmax(200px,1.6fr) 94px 94px 94px;gap:10px;align-items:end;margin-bottom:8px}
.ks-document-filter-form label{min-width:0;font-size:12px;gap:5px}
.ks-document-filter-form input,.ks-document-filter-form select{min-width:0;max-width:100%;min-height:38px;padding:8px 10px;font-size:13px}
.ks-document-filter-form button,.ks-document-filter-form .button{display:inline-flex;align-items:center;justify-content:center;width:100%;min-width:0;min-height:38px;padding:8px 12px;text-align:center}
.ks-document-advanced-filters{grid-column:1/-1;display:grid;grid-template-columns:minmax(150px,.9fr) repeat(3,minmax(150px,1fr));gap:8px;align-items:end;padding:8px 9px;border:1px solid #dbe5f1;border-radius:9px;background:#f8fbff}
.ks-document-advanced-title{align-self:center;font-size:12px;font-weight:800;color:#334155}
.ks-document-advanced-title small{display:block;margin-top:2px;font-size:10px;font-weight:500;color:#64748b}
@media(max-width:1000px){
    .ks-document-filter-form{grid-template-columns:repeat(2,minmax(0,1fr))}
    .ks-document-filter-form label:nth-of-type(3){grid-column:1/-1}
    .ks-document-advanced-filters{grid-template-columns:repeat(2,minmax(0,1fr))}
    .ks-document-advanced-title{grid-column:1/-1}
}
@media(max-width:520px){
    .ks-document-filter-form{grid-template-columns:minmax(0,1fr)}
    .ks-document-advanced-filters{grid-template-columns:minmax(0,1fr)}
    .ks-document-advanced-title{grid-column:auto}
}

.ks-doc-compact-wrap{border-radius:10px}
.ks-doc-compact-table{min-width:980px;font-size:12px}
.ks-doc-compact-table th{padding:9px 10px;font-size:11px;white-space:nowrap}
.ks-doc-compact-table td{padding:9px 10px;vertical-align:middle;line-height:1.3}
.ks-doc-compact-table tbody tr:hover td{background:#fbfcfe}
.ks-doc-compact-table .tz{font-size:14px}
.ks-doc-applicant-cell{max-width:280px}
.ks-doc-responsibles,.ks-doc-date-summary{font-size:11px;color:#475467;white-space:nowrap}
.ks-doc-responsibles>div,.ks-doc-date-summary>div{display:grid;grid-template-columns:24px auto;align-items:baseline;min-height:17px;line-height:17px}
.ks-doc-date-summary>div{grid-template-columns:24px 10ch auto;column-gap:5px;font-variant-numeric:tabular-nums}
.ks-doc-responsibles span,.ks-doc-date-summary .doc-date-label{color:#8a94a3;font-weight:800}
.ks-doc-date-summary .doc-date-value{color:#475467;font-weight:400}
.ks-doc-action-cell{text-align:right;white-space:nowrap}

.doc-status{
    display:inline-flex;
    align-items:center;
    gap:7px;
    max-width:165px;
    color:#344054;
    font-weight:700;
    line-height:1.25;
}
.doc-status i{width:9px;height:9px;border-radius:50%;flex:0 0 9px;background:#98a2b3}
.doc-exec-prep i,.doc-id-prep i{background:#4c78d0}
.doc-exec-approval i{background:#d9a428}
.doc-exec-print i,.doc-id-print i{background:#d9a428}
.doc-exec-bad i,.doc-id-bad i{background:#d94b64}

.pager{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:12px;
    margin:12px 0;
    color:#667085;
    font-size:12px;
}
.docs-migration-note{margin-top:12px}

.doc-edit-topbar{margin-bottom:8px}
.doc-edit-header{margin-bottom:12px}
.doc-edit-title-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.doc-edit-title-row h1{font-size:27px;margin:0}
.doc-edit-header p{margin:5px 0 0}
.doc-edit-card{margin:0;padding:16px}
.doc-edit-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,.9fr);gap:12px;align-items:start}
.doc-edit-section{
    min-width:0;
    padding:13px;
    border:1px solid #e3e8ef;
    border-radius:12px;
    background:#fafbfd;
}
.doc-edit-section h2{margin:0 0 11px;font-size:15px}
.doc-edit-section label{gap:4px;margin-bottom:9px;font-size:11px;min-width:0}
.doc-edit-section select,.doc-edit-section input{min-height:38px;padding:8px 10px;font-size:13px;min-width:0;max-width:100%}
/* v5.73: native date fields wrap within their own card instead of overflowing. */
.doc-edit-dates{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr));gap:8px}
.doc-edit-comment-section textarea{min-height:150px;background:#fff}
.doc-edit-comment-section .tiny{margin-top:8px}
.doc-edit-actions{
    display:flex;
    justify-content:flex-end;
    gap:8px;
    margin-top:12px;
    padding-top:12px;
    border-top:1px solid #edf1f5;
}
.doc-edit-actions .button,.doc-edit-actions button{min-width:110px}

/* Settings: compact cards */
.settings-grid{gap:10px}
.settings-link-card{min-height:100px;padding:14px;margin:0}
.settings-icon{width:44px;height:44px;flex-basis:44px;border-radius:11px;font-size:20px}
.settings-body h2{font-size:16px;margin-bottom:5px}
.settings-body p{font-size:12px;line-height:1.35}

/* Statistics: controls read like separate buttons, not one text string */
.stats-presets{gap:7px;margin-bottom:10px}
.stats-presets .button{min-height:34px;padding:7px 10px;border-radius:8px}
.stats-filter-card{padding:13px;margin:0 0 10px}
.stats-cards{gap:8px}
.stats-card{padding:11px 12px;border-radius:9px}
.stats-card strong{font-size:24px}
.stats-rule{margin:8px 0 12px;padding:9px 11px;font-size:11px}

@media(max-width:900px){
    .doc-edit-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
    .doc-edit-comment-section{grid-column:1/-1}
}
@media(max-width:760px){
    .ks-subnav-wrap{align-items:flex-start;gap:8px;padding:8px}
    .ks-subnav-label{padding-top:7px;font-size:16px}
    .ks-subnav{flex:1 1 auto}
    .ks-subnav a{flex:1 1 auto;min-width:90px;padding:8px 9px}
    .ks-filter-pills{display:grid;grid-template-columns:1fr 1fr}
    .ks-filter-pill{justify-content:space-between}
    .ks-search-row{display:grid;grid-template-columns:1fr auto}
    .ks-search-row .button{grid-column:1/-1;text-align:center}
    .doc-edit-grid{grid-template-columns:minmax(0,1fr)}
    .doc-edit-comment-section{grid-column:auto}
    .doc-edit-actions{display:grid;grid-template-columns:1fr 1fr}
    .doc-edit-actions .button,.doc-edit-actions button{width:100%;text-align:center}
}
@media(max-width:520px){
    .ks-subnav-wrap{display:block}
    .ks-subnav-label{margin-bottom:7px}
    .ks-subnav{display:grid;grid-template-columns:repeat(3,1fr)}
    .ks-subnav a{min-width:0}
    .doc-edit-dates{grid-template-columns:minmax(0,1fr)}
}


/* v5.69: импорт статусов из РЫБЫ + выравнивание кнопок */
.doc-edit-actions .button,
.doc-edit-actions button,
.ks-doc-action-cell .button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    text-align:center;
}
.doc-status.doc-exec-done,
.doc-status.doc-id-done{
    background:#e8f5ec;
    color:#16783c;
    border-color:#cce8d5;
}
.doc-status.doc-exec-done i,
.doc-status.doc-id-done i{
    background:#2fb36d;
}
.docs-sync-line{
    margin:10px 2px 0;
    color:var(--muted);
    font-size:11px;
    line-height:1.35;
}


/* v5.71: отдельные ИД / КС+РС, сводка и цвета статусов документов */
.doc-status.doc-exec-done,
.doc-status.doc-id-done,
.doc-status.doc-ks-done{
    background:transparent !important;
    color:#344054 !important;
    border-color:transparent !important;
}
.doc-status.doc-exec-done i,
.doc-status.doc-id-done i,
.doc-status.doc-ks-done i{background:#2fb36d}
.doc-ks-prep i{background:#4c78d0}
.doc-ks-ready i{background:#d9a428}

.ks-doc-compact-table{min-width:1080px}
.doc-edit-grid{grid-template-columns:repeat(3,minmax(0,1fr)) minmax(0,.9fr)}
.doc-ks-hint{margin-top:10px;line-height:1.35}

.doc-stats-card{margin:0 0 12px;padding:14px}
.doc-stats-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    margin-bottom:12px;
}
.doc-stats-head h2{margin:0 0 3px;font-size:17px}
.doc-stats-head p{margin:0;font-size:11px}
.doc-stats-total{
    display:flex;
    align-items:center;
    gap:8px;
    flex:0 0 auto;
    padding:7px 10px;
    border:1px solid #dce3eb;
    border-radius:9px;
    background:#f8fafc;
}
.doc-stats-total span{font-size:11px;color:#667085;font-weight:700}
.doc-stats-total b{font-size:18px;color:#1f6feb}
.doc-stats-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
}
.doc-stat-group{
    border:1px solid #e3e8ef;
    border-radius:10px;
    background:#fbfcfe;
    padding:10px 11px;
}
.doc-stat-group h3{
    margin:0 0 7px;
    font-size:13px;
    color:#344054;
}
.doc-stat-group>div{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:4px 0;
    border-top:1px solid #eef1f5;
    font-size:11px;
}
.doc-stat-group>div:first-of-type{border-top:0}
.doc-stat-group>div span{color:#667085}
.doc-stat-group>div b{font-size:13px;color:#344054}
/* Цвет цифр совпадает с цветом соответствующего статуса в журнале документов. */
.doc-stat-group>div.status-prep b{color:#4c78d0}
.doc-stat-group>div.status-warn b{color:#d9a428}
.doc-stat-group>div.status-done b{color:#2fb36d}
.doc-stat-group>div.status-bad b{color:#d94b64}
.stats-section-label{
    margin:10px 0 6px;
    font-size:15px;
    font-weight:900;
    color:#344054;
}

@media(max-width:1100px){
    .doc-edit-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
    .doc-edit-comment-section{grid-column:1/-1}
}
@media(max-width:760px){
    .doc-stats-grid{grid-template-columns:1fr}
    .doc-stats-head{align-items:flex-start}
    .doc-edit-grid{grid-template-columns:minmax(0,1fr)}
    .doc-edit-comment-section{grid-column:auto}
}


/* v5.76: цвета статистики, ровная строка фильтра монтажей и одинаковые кнопки документов */
@media(max-width:1000px){
    .ks-document-filter-form button,
    .ks-document-filter-form .button{width:100%;}
}

/* v5.78 — журнал изменений */
.logs-head{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:14px}.logs-head h1{margin-bottom:4px}.logs-total{white-space:nowrap;padding:10px 14px;border:1px solid var(--border,#d8e0ea);border-radius:12px;background:#fff}.logs-filters{display:grid;grid-template-columns:minmax(210px,1.1fr) minmax(190px,1fr) minmax(180px,.9fr) auto;gap:10px;align-items:end}.logs-filters label{margin:0}.logs-filter-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.logs-filter-actions .button,.logs-filter-actions button{min-width:104px;text-align:center;justify-content:center}.audit-list{display:grid;gap:10px;margin-top:14px}.audit-event{padding:15px 16px}.audit-event-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.audit-main{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.audit-time{font-variant-numeric:tabular-nums;color:#65758b;font-size:13px}.audit-section{background:#eef4fb;border:1px solid #dbe7f4;border-radius:999px;padding:4px 8px;font-size:12px}.audit-tz-actions{display:flex;align-items:center;gap:8px}.audit-tz{font-weight:800;font-size:16px;color:#1769d2;text-decoration:none}.audit-action{font-weight:700;margin:10px 0 8px}.audit-changes{display:grid;gap:6px}.audit-change{display:grid;grid-template-columns:minmax(160px,.9fr) minmax(180px,1fr) 24px minmax(180px,1fr);align-items:stretch;border-top:1px solid #edf0f4;padding-top:7px;gap:8px}.audit-field{font-weight:600;display:flex;align-items:center}.audit-before,.audit-after{display:grid;grid-template-columns:auto 1fr;align-items:start;gap:7px;min-width:0}.audit-before span,.audit-after span{font-size:11px;text-transform:uppercase;letter-spacing:.03em;color:#7b8798;padding-top:2px}.audit-before b,.audit-after b{font-weight:600;overflow-wrap:anywhere;white-space:pre-wrap}.audit-before b{color:#7b4d4d}.audit-after b{color:#276640}.audit-arrow{display:flex;align-items:center;justify-content:center;color:#8190a5}.logs-pagination{margin:14px 0;display:flex;align-items:center;justify-content:center;gap:10px}.empty-state{text-align:center;margin-top:14px}.page-topbar{display:flex;align-items:center;justify-content:space-between;gap:10px}
@media (max-width:850px){.logs-head{align-items:flex-start}.logs-filters{grid-template-columns:1fr 1fr}.logs-filter-actions{grid-column:1/-1}.audit-event-head{align-items:flex-start;flex-direction:column}.audit-change{grid-template-columns:1fr}.audit-arrow{display:none}.audit-before,.audit-after{grid-template-columns:52px 1fr}.audit-tz-actions{width:100%;justify-content:space-between}}
@media (max-width:560px){.logs-head{display:block}.logs-total{display:inline-block;margin-top:8px}.logs-filters{grid-template-columns:1fr}.logs-filter-actions{grid-column:auto}.audit-event{padding:12px}.audit-main{gap:6px 8px}.audit-time{width:100%}.audit-tz-actions .button{min-height:36px}.audit-change{padding-top:9px}.audit-field{margin-bottom:2px}}

/* v5.79: единый более компактный интерфейс + явный пользователь/время в логах */
@media (min-width:761px){
    body{font-size:14px;line-height:1.32}
    .wrap{max-width:1280px;padding-left:14px;padding-right:14px}
    .head{height:52px}
    .brand-logo img{height:36px}
    main{padding-top:18px;padding-bottom:42px}
    h1{font-size:25px;line-height:1.18;margin-bottom:4px}
    h2{font-size:16px;margin-bottom:11px}
    h3{margin-top:10px;margin-bottom:8px}
    .small{font-size:11px}

    .card{padding:13px 14px;margin:12px 0;border-radius:10px}
    .grid4,.form-grid{gap:10px}
    .two-col{gap:12px}
    label{gap:4px;font-size:12px}
    input,textarea,select{border-radius:7px;padding:8px 10px;font-size:13px;min-height:36px}
    button,.button{border-radius:7px;padding:8px 11px;font-size:13px;line-height:1.2;min-height:34px}
    .smallbtn{padding:5px 8px;font-size:11px;min-height:29px}

    .table-wrap{border-radius:10px}
    th,td{padding:9px 10px}
    th{font-size:11px}
    td{font-size:13px}
    .pill{padding:4px 7px;font-size:11px}
    .lookup{gap:8px;margin:12px 0}
    .lookup input{font-size:15px}
    .object-head{padding:10px 12px;margin:10px 0;gap:10px;border-radius:8px}
    .object-head b{font-size:16px}
    .upload{padding:12px;border-radius:8px}
    .status-grid{gap:8px;margin:12px 0}
    .status{padding:10px 11px;border-radius:8px}
    dl{grid-template-columns:120px 1fr;gap:6px 10px}
    .photo-grid{gap:8px}
    .approval{gap:8px}
    .notice{margin-top:9px;padding:9px 10px}
    summary{font-size:16px}
    .detailform{margin-top:12px}
    .title-row{gap:14px}

    .main-nav a{padding:5px 7px;font-size:12px}
    .user-menu{font-size:12px}
    .page-topbar{margin-bottom:10px;min-height:26px}
    .back-link{min-height:27px;padding:4px 7px;font-size:12px}
    .card-actions,.form-actions{gap:7px;margin-top:11px}

    .form-section{margin:10px 0}
    .section-title{gap:9px;margin-bottom:11px}
    .section-title p{font-size:12px}
    .stepnum{flex-basis:24px;height:24px;font-size:12px}
    .subgroup-title{margin:11px 0 7px;font-size:12px}
    .phase-grid{gap:8px}
    .big-upload{padding:15px}
    .big-upload span{font-size:14px}
    .existing-photos{padding:8px 10px;margin-bottom:8px}
    .note-label{margin-top:10px}
    .sticky-submit{gap:8px;margin:12px 0}
    .submit-big{font-size:14px;padding:10px 15px}
    .empty-hint{padding:17px}

    .source-card{gap:14px}
    .choice-list{gap:8px}
    .choice-card{padding:10px 11px;border-radius:8px}
    .choice-card b{font-size:16px}
    .readonly-note{margin:10px 0;padding:8px 10px;font-size:12px}
    .action-row{gap:7px;margin-top:10px}

    .section-tabs{margin-bottom:10px;padding:3px}
    .section-tabs a{padding:6px 11px;font-size:12px}
    .compact-page-heading{margin-bottom:9px}
    .compact-page-heading h1{font-size:24px}
    .ks-subnav-wrap{gap:9px;margin-bottom:11px;padding:6px 8px;border-radius:9px}
    .ks-subnav-label{font-size:16px}
    .ks-subnav{gap:5px}
    .ks-subnav a{min-height:31px;padding:6px 10px;border-radius:7px;font-size:12px}
    .ks-filter-pills{gap:6px;margin-bottom:9px}
    .ks-filter-pill{min-height:31px;padding:5px 9px;border-radius:7px;font-size:11px}
    .ks-filter-pill b{height:19px;min-width:21px;font-size:10px}
    .compact-notice{margin-bottom:9px;padding:7px 9px;font-size:11px}
    .ks-compact-search{margin-bottom:9px;padding:8px 10px}
    .ks-search-row{gap:6px}
    .ks-search-row input,.ks-search-row button,.ks-search-row .button{min-height:34px;padding:7px 9px}
    .ks-document-filter-form{gap:7px;margin-bottom:6px}
    .ks-document-filter-form input,.ks-document-filter-form select,.ks-document-filter-form button,.ks-document-filter-form .button{min-height:34px;padding:6px 8px;font-size:12px}
    .ks-doc-compact-table th,.ks-doc-compact-table td{padding:7px 8px}
    .ks-doc-compact-table{font-size:11px}
    .ks-doc-compact-table .tz{font-size:13px}
    .doc-edit-header{margin-bottom:9px}
    .doc-edit-title-row h1{font-size:24px}
    .doc-edit-card{padding:12px}
    .doc-edit-grid{gap:9px}
    .doc-edit-section{padding:10px;border-radius:9px}
    .doc-edit-section h2{margin-bottom:8px;font-size:14px}
    .doc-edit-section label{margin-bottom:7px}
    .doc-edit-section select,.doc-edit-section input{min-height:34px;padding:6px 8px;font-size:12px}
    .doc-edit-comment-section textarea{min-height:118px}
    .doc-edit-actions{margin-top:9px;padding-top:9px}

    .settings-grid{gap:8px}
    .settings-link-card{min-height:82px;padding:10px}
    .settings-icon{width:38px;height:38px;flex-basis:38px;font-size:18px}
    .settings-body h2{font-size:14px;margin-bottom:3px}
    .settings-body p{font-size:11px}

    .stats-presets{gap:5px;margin-bottom:8px}
    .stats-presets .button{min-height:30px;padding:5px 8px;font-size:12px}
    .stats-filter-card{padding:10px;margin-bottom:8px}
    .stats-cards{gap:6px}
    .stats-card{padding:8px 10px;border-radius:8px}
    .stats-card strong{font-size:21px}
    .stats-rule{margin:6px 0 9px;padding:7px 9px;font-size:10px}
    .doc-stats-card{margin-bottom:9px;padding:10px}
    .doc-stats-head{gap:10px;margin-bottom:9px}
    .doc-stats-head h2{font-size:15px}
    .doc-stats-total{padding:5px 8px;border-radius:7px}
    .doc-stats-total b{font-size:16px}
    .doc-stats-grid{gap:7px}
    .doc-stat-group{padding:8px 9px;border-radius:8px}
    .doc-stat-group h3{margin-bottom:5px;font-size:12px}
    .doc-stat-group>div{padding:3px 0;font-size:10px}
    .doc-stat-group>div b{font-size:12px}
    .stats-section-label{margin:8px 0 5px;font-size:13px}

    .logs-head{gap:12px;margin-bottom:9px}
    .logs-total{padding:7px 10px;border-radius:9px;font-size:12px}
    .logs-filters{gap:7px}
    .logs-filter-actions{gap:6px}
    .logs-filter-actions .button,.logs-filter-actions button{min-width:88px}
    .audit-list{gap:7px;margin-top:10px}
    .audit-event{padding:10px 12px}
    .audit-event-head{gap:9px}
    .audit-main{gap:7px}
    .audit-time{font-size:12px}
    .audit-section{padding:3px 7px;font-size:11px}
    .audit-tz{font-size:14px}
    .audit-action{margin:7px 0 6px}
    .audit-changes{gap:4px}
    .audit-change{grid-template-columns:minmax(145px,.9fr) minmax(160px,1fr) 18px minmax(160px,1fr);padding-top:5px;gap:6px;font-size:12px}
    .logs-pagination{margin:10px 0;gap:8px}
}

.audit-actor{display:inline-flex;align-items:baseline;gap:5px;flex-wrap:wrap}
.audit-actor strong{color:#20242a}
.audit-actor small{font-size:11px;color:#667085;font-weight:600}
.audit-actor em{font-style:normal;font-size:10px;color:#7b8798;background:#f4f6f8;border-radius:999px;padding:2px 6px}
.audit-time{font-weight:700;color:#526174}

/* На телефоне тоже уменьшаем избыточные отступы, но сохраняем удобный размер нажатия. */
@media (max-width:760px){
    body{font-size:14px}
    .wrap{padding-left:10px;padding-right:10px}
    main{padding-top:13px;padding-bottom:38px}
    h1{font-size:22px}
    h2{font-size:16px}
    .card{padding:11px;margin:10px 0;border-radius:9px}
    label{font-size:12px;gap:4px}
    input,textarea,select{padding:9px 10px;font-size:14px;border-radius:7px}
    button,.button{padding:9px 11px;border-radius:7px;font-size:13px}
    .head{padding-top:8px;padding-bottom:8px}
    .brand{margin-bottom:6px}
    .brand-logo img{max-height:38px}
    .main-nav{gap:4px}
    .main-nav a{padding:6px 7px;font-size:12px}
    .user-menu{font-size:12px}
    .object-head{padding:10px;margin:9px 0}
    .status-grid{gap:7px;margin:10px 0}
    .status{padding:9px 10px}
    .section-title{margin-bottom:10px}
    .form-section{margin:8px 0}
    .ks-subnav-wrap{margin-bottom:10px}
    .ks-doc-card{padding:11px}
    .doc-stats-card{padding:10px}
    .stats-card{padding:9px}
    .stats-card strong{font-size:21px}
    .logs-total{padding:7px 9px;border-radius:8px}
    .audit-list{gap:7px;margin-top:9px}
    .audit-event{padding:10px}
    .audit-time{font-size:12px}
    .audit-actor{gap:4px}
}

/* v5.80: Compact UI — плотнее, единообразнее и удобнее на desktop/mobile */
:root{
    --ui-control-h:32px;
    --ui-control-h-mobile:42px;
    --ui-radius:8px;
    --ui-gap:8px;
}

/* Универсальная кнопка возврата: работает через history, при прямом входе ведёт в раздел роли. */
.global-backbar{
    display:flex;
    align-items:center;
    min-height:28px;
    margin:0 0 6px;
}
.global-back-button{
    margin:0;
    border:1px solid #d9e0e8;
    background:#fff;
    min-height:27px;
    padding:4px 9px;
    box-shadow:0 1px 2px rgba(16,24,40,.03);
}
.global-back-button:hover{border-color:#b9c6d5;background:#f8fafc}
/* Старые локальные «Назад» больше не дублируют универсальную кнопку. */
.page-topbar .back-link{display:none}
.page-topbar:has(> .back-link:only-child){display:none}
.page-topbar:has(> .back-link:last-child):not(:has(> :not(.back-link))){display:none}

@media (min-width:761px){
    body{font-size:13px;line-height:1.27}
    .wrap{max-width:1420px;padding-left:12px;padding-right:12px}
    header{box-shadow:0 1px 3px rgba(16,24,40,.04)}
    .head{height:46px;gap:6px}
    .brand-logo{max-width:250px}
    .brand-logo img{height:31px}
    .head .main-nav{gap:1px}
    .head .main-nav a{
        min-height:28px;
        padding:5px 7px;
        border-radius:6px;
        font-size:11.5px;
        line-height:1;
    }
    .nav-badge{min-width:17px;height:17px;padding:0 5px;font-size:9px;margin-left:4px}
    .user-menu{gap:5px;padding-left:7px}
    .user-name{max-width:120px;font-size:11px}
    .logout-link{font-size:10.5px}

    main{padding-top:9px;padding-bottom:30px}
    h1{font-size:22px;line-height:1.13;margin-bottom:2px}
    h2{font-size:14px;margin-bottom:8px}
    h3{font-size:13px}
    .muted{line-height:1.3}
    .small{font-size:10.5px;margin-top:2px}
    .compact-page-heading{margin-bottom:6px}
    .compact-page-heading h1{font-size:22px}
    .title-row p,.page-heading p,.mobile-title p{margin-top:3px}

    .card{padding:9px 10px;margin:8px 0;border-radius:8px}
    .notice{padding:7px 9px;margin-top:6px;border-radius:7px}
    .grid4,.form-grid,.two-col{gap:8px}
    label{font-size:11px;gap:3px}
    input,textarea,select{
        min-height:var(--ui-control-h);
        padding:6px 8px;
        border-radius:6px;
        font-size:12px;
    }
    textarea{min-height:70px}
    button,.button{
        min-height:30px;
        padding:6px 9px;
        border-radius:6px;
        font-size:12px;
    }
    .smallbtn{min-height:26px;padding:4px 7px;font-size:10.5px}
    .pill{padding:3px 6px;font-size:10px}
    .eyebrow{font-size:10px}

    .table-wrap{border-radius:8px}
    th,td{padding:6px 8px}
    th{font-size:10px;line-height:1.15}
    td{font-size:11.5px;line-height:1.24}
    .table-wrap table thead th{top:46px}
    .tz{font-size:12.5px}

    .lookup{gap:6px;margin:8px 0}
    .lookup input{font-size:13px}
    .search-card{padding-top:7px;padding-bottom:7px}
    .source-card{gap:10px;align-items:center}
    .source-card h2{margin:2px 0 3px}
    .source-actions{gap:5px}
    .action-row{gap:5px;margin-top:8px}

    .object-head{padding:8px 10px;margin:7px 0;gap:8px}
    .object-head b{font-size:14px}
    .status-grid{gap:6px;margin:8px 0}
    .status{min-height:44px;padding:7px 8px}
    dl{grid-template-columns:108px 1fr;gap:4px 8px}
    .upload{padding:9px}
    .photo-grid{gap:6px}

    .page-topbar{min-height:22px;margin-bottom:5px}
    .global-backbar{min-height:24px;margin-bottom:4px}
    .global-back-button{min-height:25px;padding:3px 8px;font-size:11px}
    .card-actions,.form-actions{gap:5px;margin-top:8px}

    .ks-subnav-wrap{gap:7px;margin-bottom:7px;padding:4px 6px;border-radius:7px}
    .ks-subnav-label{font-size:14px}
    .ks-subnav{gap:3px}
    .ks-subnav a{min-height:28px;padding:4px 9px;border-radius:6px;font-size:11px}
    .ks-filter-pills{gap:4px;margin-bottom:6px}
    .ks-filter-pill{min-height:28px;padding:4px 7px;border-radius:6px;font-size:10.5px}
    .ks-filter-pill b{height:18px;min-width:19px;padding:0 5px;font-size:9px}
    .compact-notice{margin-bottom:6px;padding:5px 7px;font-size:10.5px}
    .ks-compact-search{margin-bottom:6px;padding:6px 8px}
    .ks-search-row{gap:5px;margin-bottom:2px}
    .ks-search-row input,.ks-search-row button,.ks-search-row .button{min-height:30px;padding:5px 7px;font-size:11.5px}
    .ks-document-filter-form{grid-template-columns:minmax(140px,.9fr) minmax(150px,.95fr) minmax(190px,1.5fr) 82px 82px 82px;gap:5px;margin-bottom:4px}
    .ks-document-filter-form label{font-size:10.5px;gap:3px}
    .ks-document-filter-form input,.ks-document-filter-form select,.ks-document-filter-form button,.ks-document-filter-form .button{min-height:30px;padding:5px 7px;font-size:11px}
    .ks-doc-compact-table th,.ks-doc-compact-table td{padding:5px 6px}
    .ks-doc-compact-table{font-size:10.5px}
    .ks-doc-compact-table .tz{font-size:12px}
    .ks-doc-responsibles,.ks-doc-date-summary{font-size:10px}
    .ks-doc-responsibles>div,.ks-doc-date-summary>div{min-height:15px;line-height:15px}

    .doc-edit-header{margin-bottom:6px}
    .doc-edit-title-row h1{font-size:21px}
    .doc-edit-card{padding:9px}
    .doc-edit-grid{gap:7px}
    .doc-edit-section{padding:8px;border-radius:7px}
    .doc-edit-section h2{margin-bottom:6px;font-size:12.5px}
    .doc-edit-section label{margin-bottom:5px;font-size:10px}
    .doc-edit-section select,.doc-edit-section input{min-height:30px;padding:5px 7px;font-size:11px}
    .doc-edit-dates{gap:6px}
    .doc-edit-comment-section textarea{min-height:96px}
    .doc-edit-actions{margin-top:7px;padding-top:7px}
    .doc-edit-actions .button,.doc-edit-actions button{min-width:92px}

    .settings-grid{gap:6px}
    .settings-link-card{min-height:68px;padding:8px;gap:9px}
    .settings-icon{width:32px;height:32px;flex-basis:32px;border-radius:8px;font-size:15px}
    .settings-body h2{font-size:13px;margin-bottom:2px}
    .settings-body p{font-size:10.5px;line-height:1.25}
    .settings-arrow{font-size:18px}

    .doc-stats-card{margin-bottom:6px;padding:8px}
    .doc-stats-head{gap:8px;margin-bottom:6px}
    .doc-stats-head h2{font-size:14px;margin-bottom:1px}
    .doc-stats-head p{font-size:10px}
    .doc-stats-total{padding:4px 7px;border-radius:6px}
    .doc-stats-total span{font-size:10px}
    .doc-stats-total b{font-size:15px}
    .doc-stats-grid{gap:5px}
    .doc-stat-group{padding:6px 7px;border-radius:7px}
    .doc-stat-group h3{margin-bottom:4px;font-size:11.5px}
    .doc-stat-group>div{padding:2px 0;font-size:9.8px}
    .doc-stat-group>div b{font-size:11px}
    .stats-section-label{margin:6px 0 4px;font-size:12px}
    .stats-filter-card{padding:7px 8px;margin-bottom:6px}
    .stats-presets{gap:4px;margin-bottom:6px}
    .stats-presets .button{min-height:27px;padding:4px 7px;font-size:10.5px}
    .stats-custom-form{grid-template-columns:minmax(210px,1.35fr) minmax(145px,.8fr) minmax(145px,.8fr) 86px;gap:6px}
    .stats-custom-form label{grid-template-rows:auto 32px;gap:3px;font-size:10.5px}
    .stats-custom-form select,.stats-custom-form input[type="date"],.stats-custom-form .primary{height:32px;min-height:32px}
    .stats-custom-form .primary{width:86px}
    .stats-scope-line{gap:4px;margin:1px 0 6px;font-size:11px}
    .stats-cards{gap:5px}
    .stats-card{padding:6px 8px;border-radius:7px}
    .stats-card span{font-size:10px}
    .stats-card strong{font-size:19px;margin-top:3px}
    .stats-rule{margin:4px 0 7px;padding:5px 7px;font-size:9.5px}
    .stats-table th,.stats-table td{padding:6px 8px}
    .stats-daily-list,.stats-recent-list{gap:4px}
    .stats-daily-list>div,.stats-recent-item{padding:6px 8px;border-radius:6px}
    .stats-daily-list b{font-size:13px}

    .logs-head{gap:8px;margin-bottom:6px}
    .logs-head p{margin:2px 0 0}
    .logs-total{padding:5px 8px;border-radius:7px;font-size:11px}
    .logs-filters{grid-template-columns:minmax(190px,1.1fr) minmax(170px,1fr) minmax(150px,.8fr) auto;gap:5px;padding:7px 8px}
    .logs-filter-actions{gap:5px}
    .logs-filter-actions .button,.logs-filter-actions button{min-width:76px}
    .audit-list{gap:5px;margin-top:7px}
    .audit-event{padding:7px 9px}
    .audit-event-head{gap:6px}
    .audit-main{gap:5px}
    .audit-time{font-size:10.5px}
    .audit-actor small{font-size:9.5px}
    .audit-actor em{font-size:9px;padding:1px 5px}
    .audit-section{padding:2px 6px;font-size:9.5px}
    .audit-tz{font-size:12.5px}
    .audit-action{margin:5px 0 4px;font-size:11px}
    .audit-changes{gap:3px}
    .audit-change{grid-template-columns:minmax(125px,.8fr) minmax(150px,1fr) 14px minmax(150px,1fr);padding-top:4px;gap:5px;font-size:10.5px}
    .audit-before span,.audit-after span{font-size:9px}
}

/* Мобильная версия: компактная шапка, одна прокручиваемая строка меню,
   но поля и основные кнопки остаются достаточно крупными для пальца. */
@media (max-width:760px){
    .wrap{padding-left:8px;padding-right:8px}
    .head{
        display:flex;
        align-items:center;
        flex-wrap:wrap;
        gap:5px 8px;
        padding-top:5px;
        padding-bottom:5px;
    }
    .brand-logo{max-width:155px;flex:1 1 120px}
    .brand-logo img{max-height:31px}
    .user-menu{gap:5px}
    .user-name{max-width:105px;font-size:11px}
    .logout-link{font-size:10px}
    .main-nav{
        order:3;
        display:flex !important;
        flex-wrap:nowrap !important;
        width:100%;
        gap:4px;
        overflow-x:auto !important;
        overflow-y:hidden;
        padding:1px 0 2px;
        scroll-snap-type:x proximity;
        scrollbar-width:none;
        -webkit-overflow-scrolling:touch;
    }
    .main-nav::-webkit-scrollbar{display:none}
    .main-nav a{
        flex:0 0 auto !important;
        min-height:34px;
        padding:6px 9px;
        border:1px solid #e0e5eb;
        border-radius:7px;
        background:#f8fafc;
        font-size:11px;
        scroll-snap-align:center;
    }
    .main-nav a.active{border-color:#bdd3f4;background:#eaf2ff}
    .nav-badge{min-width:17px;height:17px;padding:0 5px;font-size:9px}

    main{padding-top:7px;padding-bottom:30px}
    .global-backbar{margin-bottom:4px;min-height:31px}
    .global-back-button{min-height:32px;padding:5px 9px;font-size:11.5px}
    h1{font-size:20px;line-height:1.15}
    h2{font-size:14px}
    .compact-page-heading{margin-bottom:6px}
    .compact-page-heading h1{font-size:20px}
    .title-row p,.page-heading p,.mobile-title p{margin-top:3px;font-size:11.5px}
    .card{padding:9px;margin:7px 0;border-radius:8px}
    .notice{padding:7px 8px;margin-top:6px}
    label{font-size:11.5px}
    input,textarea,select{min-height:var(--ui-control-h-mobile);padding:8px 9px;font-size:14px}
    button,.button{min-height:40px;padding:8px 10px;font-size:12px}
    .smallbtn{min-height:34px;padding:6px 8px;font-size:11px}
    .pill{padding:3px 6px;font-size:10px}

    .ks-subnav-wrap{display:flex;align-items:center;gap:6px;margin-bottom:7px;padding:5px 6px;overflow-x:auto}
    .ks-subnav-label{font-size:13px;padding:0;flex:0 0 auto}
    .ks-subnav{display:flex;flex-wrap:nowrap;gap:4px;overflow-x:auto;scrollbar-width:none}
    .ks-subnav::-webkit-scrollbar{display:none}
    .ks-subnav a{flex:0 0 auto;min-width:0;min-height:32px;padding:5px 9px;font-size:11px}
    .ks-filter-pills{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:5px;margin-bottom:7px;scrollbar-width:none}
    .ks-filter-pills::-webkit-scrollbar{display:none}
    .ks-filter-pill{flex:0 0 auto;min-height:34px;padding:6px 8px;font-size:10.5px}

    .source-card{gap:8px}
    .source-card h2{font-size:13px;overflow-wrap:anywhere}
    .source-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
    .source-actions form,.source-actions .button,.source-actions button{width:100%}
    .lookup,.dashboard-search{gap:5px;margin:7px 0}
    .dashboard-table tbody{gap:7px}
    .dashboard-table tr{border-radius:8px}
    .dashboard-table td{grid-template-columns:82px minmax(0,1fr);gap:7px;padding:7px 8px}
    .dashboard-table td::before{font-size:9px}
    .dashboard-table .tz{font-size:15px}
    .dashboard-table td.dashboard-main-cell.doc-actions{gap:7px !important}
    .dashboard-table td.dashboard-main-cell.doc-actions a{min-height:36px}

    .doc-stats-head{margin-bottom:6px}
    .doc-stats-head h2{font-size:13px}
    .doc-stats-head p{font-size:10px}
    .doc-stats-total{padding:4px 7px}
    .doc-stats-grid{grid-template-columns:1fr;gap:5px}
    .doc-stat-group{padding:6px 8px}
    .doc-stat-group h3{font-size:11.5px;margin-bottom:4px}
    .doc-stat-group>div{padding:2px 0;font-size:10px}
    .doc-stat-group>div b{font-size:11px}
    .stats-section-label{margin:6px 0 4px;font-size:12px}
    .stats-filter-card{padding:7px}
    .stats-presets{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:4px;margin-bottom:6px;scrollbar-width:none}
    .stats-presets::-webkit-scrollbar{display:none}
    .stats-presets .button{flex:0 0 auto;min-height:34px;padding:6px 8px;font-size:10.5px}
    .stats-custom-form{grid-template-columns:1fr 1fr;gap:6px}
    .stats-custom-form label:first-of-type{grid-column:1/-1}
    .stats-custom-form label{grid-template-rows:auto 42px;gap:3px}
    .stats-custom-form select,.stats-custom-form input[type="date"],.stats-custom-form .primary{height:42px;min-height:42px}
    .stats-custom-form .primary{width:100%}
    .stats-cards{grid-template-columns:1fr 1fr;gap:5px}
    .stats-card{padding:7px 8px}
    .stats-card span{font-size:10px}
    .stats-card strong{font-size:18px;margin-top:2px}
    .stats-rule{margin:5px 0 7px;padding:6px 7px;font-size:9.5px}

    .logs-head{margin-bottom:6px}
    .logs-total{padding:5px 7px;font-size:10.5px}
    .logs-filters{gap:6px;padding:8px}
    .audit-list{gap:5px;margin-top:7px}
    .audit-event{padding:8px}
    .audit-action{margin:5px 0 4px;font-size:11px}
    .audit-change{font-size:10.5px;gap:4px}

    .photo-grid{gap:6px}
    .event-meta{gap:6px;margin-top:8px}
    .event-meta>div{padding:7px 8px}
    .event-note{margin-top:8px;padding:7px 8px}
    .event-actions{gap:6px;margin-top:8px}
}

@media (max-width:430px){
    .brand-logo{max-width:142px}
    .user-name{max-width:88px}
    .stats-custom-form{grid-template-columns:1fr}
    .stats-custom-form label:first-of-type{grid-column:auto}
    .source-actions{grid-template-columns:1fr}
}


/* v5.81: исправление компактной таблицы и логики кнопок «Назад» */
/* Заголовок таблицы закрепляется у верхнего края самой таблицы. В v5.80 top:46px
   сдвигал подписи колонок внутрь первой строки. */
.table-wrap table thead th{top:0 !important}

/* Кнопка возврата показывается только там, где шаблон действительно является
   подразделом/карточкой. Глобальной кнопки на основных разделах больше нет. */
.page-topbar .back-link,
.doc-edit-topbar .back-link{
    display:inline-flex !important;
}
.page-topbar:empty{display:none}

/* Маленькая пометка под документами не раздувает строку и остаётся строго
   под кнопками, а не выглядит отдельным элементом таблицы. */
.dashboard-table .doc-actions .tiny{
    width:100%;
    margin:0;
    padding-top:1px;
    text-align:center;
    font-size:8.5px;
    line-height:1.05;
    white-space:nowrap;
}
@media (max-width:760px){
    .dashboard-table .doc-actions .tiny{font-size:9px;line-height:1.1}
}

/* v5.82 — тестовый компактный импорт ТЗ из Word */
.tz-import-card{max-width:900px}
.tz-import-intro{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}
.tz-import-intro h2,.tz-import-help h2{margin:0 0 5px}
.tz-upload-form{display:grid;grid-template-columns:minmax(280px,1fr) auto;gap:10px;align-items:end;margin-top:14px}
.file-drop{margin:0}.file-drop input[type=file]{width:100%;padding:7px 9px;background:#fff}
.import-success,.import-duplicate{display:flex;justify-content:space-between;align-items:center;gap:12px}
.import-field-list{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}.import-field-list span{font-size:12px;background:#f4f7fa;border:1px solid #e1e7ee;border-radius:999px;padding:4px 8px}
.tz-preview-form{padding-top:14px}
.tz-preview-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 12px}
.import-field{margin:0;min-width:0}.import-field>span{display:flex;align-items:baseline;justify-content:space-between;gap:8px;font-weight:700}.import-field>span small{font-weight:500;color:#7a8798}
.import-field input,.import-field textarea{width:100%;margin-top:4px}.import-field textarea{resize:vertical;min-height:56px}
.import-wide{grid-column:1/-1}
.missing-field>span:after{content:'не найдено';font-size:10px;font-weight:700;color:#9b5f00;background:#fff3cd;border-radius:999px;padding:2px 6px}
.missing-field input,.missing-field textarea{border-color:#d9a428;background:#fffdf5}
.import-save-bar{display:flex;justify-content:space-between;align-items:center;gap:14px;border-top:1px solid #e7ebf0;margin-top:14px;padding-top:12px}
.import-back-link{display:inline-flex!important}
@media(max-width:760px){.tz-upload-form{grid-template-columns:1fr}.tz-preview-grid{grid-template-columns:1fr}.import-wide{grid-column:auto}.import-save-bar,.import-success,.import-duplicate{align-items:stretch;flex-direction:column}.import-save-bar .card-actions{width:100%}.import-save-bar .card-actions>*{flex:1;text-align:center}.tz-import-intro{align-items:center}}

/* v5.86: compact key fields for Word TZ import */
.tz-import-key-row{display:grid;grid-template-columns:minmax(150px,.65fr) minmax(190px,1fr) minmax(230px,1.15fr);gap:10px 12px;margin-bottom:10px}
.import-field select{width:100%;margin-top:4px}
.review-field>span:after{content:'проверить';font-size:10px;font-weight:700;color:#875d00;background:#fff3cd;border-radius:999px;padding:2px 6px}
.review-field textarea,.review-field input{border-color:#d9a428;background:#fffdf5}
@media(max-width:760px){.tz-import-key-row{grid-template-columns:1fr}}


/* v5.87: более компактное согласование мастера в карточке ТЗ */
.approval-card h2{margin-bottom:4px}
.approval-card>p{margin:0 0 6px}
@media (min-width:761px){
    .approval-card{padding-top:8px;padding-bottom:8px}
    .approval{grid-template-columns:190px minmax(260px,1fr) 128px;gap:7px;align-items:stretch}
    .approval select,.approval button,.approval textarea{height:32px;min-height:32px;padding-top:5px;padding-bottom:5px}
    .approval button.primary{display:flex;align-items:center;justify-content:center;text-align:center;white-space:nowrap;line-height:1;padding:0 8px}
    .approval textarea{resize:vertical;overflow:auto}
    .approval-card .notice{margin-top:6px;padding:6px 8px}
}
@media (max-width:760px){
    .approval-card>p{margin-bottom:7px}
    .approval textarea{min-height:56px}
}


/* v5.90: понятные placeholder-ы в импорте ТЗ + компактные даты поверки ТТ */
.tz-preview-form .import-field select:required:invalid{color:rgba(88,101,117,.58);font-weight:500}
.tz-preview-form .import-field select:valid{color:var(--text);font-weight:800}
.tz-preview-form .import-field select option{color:var(--text);font-weight:600}
.tz-preview-form .import-field select option[value=""]{color:#9aa3b2;font-weight:400}
.ct-verification-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:2px}
.ct-verification-phase{border:1px solid #e3e8ef;border-radius:8px;padding:7px 8px;background:#fafbfc}
.ct-verification-phase>b{display:block;margin-bottom:5px;font-size:12px}
.ct-verification-phase label{display:block;margin:5px 0 0;font-size:11px;color:var(--muted);font-weight:700}
.ct-verification-phase input{width:100%;margin-top:3px}
@media(max-width:760px){.ct-verification-grid{grid-template-columns:1fr}}


/* v5.91: расчётный коэффициент ТТ между ТТ-2 и ИКК */
.ct-main-row .calculated-field{
    background:#f6f8fb;
    color:#172033;
    font-weight:700;
    cursor:default;
}

/* v5.93: опциональный расчёт потерь кабеля */
.cable-grid{grid-template-columns:1.8fr .85fr .8fr .7fr .7fr}
.cable-loss-actions{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
    margin-top:10px;
}
.loss-mkd-check{
    display:flex;
    flex-direction:row;
    align-items:center;
    gap:7px;
    font-size:12px;
    font-weight:600;
    color:#4b5563;
}
.loss-mkd-check input{width:16px;height:16px;margin:0}
#calculate_cable_loss{padding:7px 12px;font-size:12px;white-space:nowrap}
#cable_loss_status{min-height:14px}
@media(max-width:760px){
    .cable-grid{grid-template-columns:1fr}
    .cable-loss-actions{align-items:flex-start;flex-direction:column}
    #calculate_cable_loss{width:100%;text-align:center}
}

/* v5.95: материал кабеля выбирается явно, без угадывания по марке */
.cable-grid select:required:invalid{color:#9aa3b2;font-weight:500}
.cable-grid select:valid{color:var(--text);font-weight:700}

/* v5.99: фильтры журнала по дням и периодам */
.logs-filter-card{padding:9px 10px;margin:8px 0 0}
.logs-periods{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:8px}
.logs-periods .button{min-height:30px;padding:5px 9px;font-size:11px;border-radius:7px;display:inline-flex;align-items:center;justify-content:center}
.logs-periods .button.active{background:var(--accent);border-color:var(--accent);color:#fff}
.logs-periods .button.active:hover{background:#185fce;border-color:#185fce}
.logs-filter-card .logs-filters{display:grid;grid-template-columns:minmax(175px,1.25fr) minmax(150px,1fr) minmax(145px,.9fr) minmax(125px,.72fr) minmax(125px,.72fr) auto;gap:6px;align-items:end;padding:0;margin:0}
.logs-filter-card .logs-filters label{margin:0}
.logs-filter-card .logs-filter-actions{display:grid;grid-template-columns:1fr 1fr;gap:5px}
.logs-filter-card .logs-filter-actions .button,.logs-filter-card .logs-filter-actions button{min-width:76px;min-height:32px;padding:6px 9px;font-size:11px;display:inline-flex;align-items:center;justify-content:center}
.logs-period-note{margin-top:6px;color:var(--muted);font-size:10px}
@media(max-width:1050px){
  .logs-filter-card .logs-filters{grid-template-columns:repeat(3,minmax(0,1fr))}
  .logs-filter-card .logs-filter-actions{grid-column:1/-1;grid-template-columns:repeat(2,minmax(0,150px))}
}
@media(max-width:700px){
  .logs-filter-card .logs-filters{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:520px){
  .logs-periods{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
  .logs-periods .button{width:100%}
  .logs-filter-card .logs-filters{grid-template-columns:1fr}
  .logs-filter-card .logs-filter-actions{grid-column:auto;grid-template-columns:1fr 1fr}
  .logs-period-note{font-size:9.5px}
}


/* v5.100: мягкие примеры в фильтрах логов */
.logs-filter-card input::placeholder{color:#a7afbb;opacity:.68;font-weight:400}
.logs-filter-card input[name="date_from"],
.logs-filter-card input[name="date_to"]{font-variant-numeric:tabular-nums}

/* v5.101 — единая понятная статистика + сроки ТЗ/заявки */
.application-card{padding:10px 12px;margin-bottom:10px}
.application-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:8px}
.application-card-head h2{margin:0 0 2px;font-size:15px}
.application-card-head p{margin:0;font-size:10.5px}
.application-state{display:inline-flex;align-items:center;min-height:26px;padding:4px 9px;border-radius:999px;font-size:11px;font-weight:800;white-space:nowrap}
.application-state.ok{background:#eaf8f0;color:#238653}
.application-state.wait{background:#fff7df;color:#a16d00}
.application-grid{display:grid;grid-template-columns:minmax(155px,.9fr) minmax(145px,.8fr) minmax(170px,.95fr) minmax(135px,.75fr) 90px;gap:7px;align-items:end}
.application-grid label{display:grid;grid-template-rows:auto 32px;gap:3px;font-size:10.5px;font-weight:700}
.application-grid input[type="date"],.application-grid input[readonly]{height:32px;padding:5px 8px;font-size:11px}
.application-check{border:1px solid var(--line);border-radius:7px;padding:5px 9px;height:32px;display:flex!important;grid-template-rows:none!important;flex-direction:row;align-items:center;justify-content:space-between;gap:8px;background:#fff}
.application-check input{width:17px;height:17px;margin:0}
.application-days{height:32px;border:1px solid var(--line);border-radius:7px;padding:4px 8px;display:flex;flex-direction:column;justify-content:center;background:#f8fafc}
.application-days span{font-size:8.5px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}
.application-days b{font-size:11px;white-space:nowrap}
.application-days.ok b{color:#238653}.application-days.wait b{color:#a16d00}
.application-save{height:32px;min-height:32px;padding:5px 9px}
.application-readonly-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.application-readonly-grid>div{border:1px solid var(--line);border-radius:7px;padding:6px 8px;background:#fafbfd}
.application-readonly-grid span{display:block;font-size:9px;color:var(--muted);margin-bottom:2px}.application-readonly-grid b{font-size:11px}

.doc-matrix-card{padding:10px 12px;margin-bottom:8px}
.doc-matrix-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:7px}
.doc-matrix-head h2{margin:0 0 2px;font-size:15px}.doc-matrix-head p{margin:0;font-size:10px}
.doc-matrix-wrap{border:1px solid var(--line);border-radius:8px;overflow:auto}
.doc-matrix{width:100%;min-width:520px;border-collapse:collapse;background:#fff}
.doc-matrix th,.doc-matrix td{padding:5px 10px;border-bottom:1px solid #edf0f4;text-align:center;font-size:10.5px}
.doc-matrix th:first-child,.doc-matrix td:first-child{text-align:left;font-weight:700;color:#475467;width:36%}
.doc-matrix th{background:#f7f9fc;color:#344054;font-size:10px;text-transform:none}
.doc-matrix td:not(:first-child){font-weight:800;font-size:12px}
.doc-matrix tr:last-child td{border-bottom:0}.doc-total-row td{background:#fbfcfe;font-weight:800!important;color:#1f2937!important}
.doc-matrix .status-prep{color:#4c78d0}.doc-matrix .status-warn{color:#c98a00}.doc-matrix .status-done{color:#26945b}.doc-matrix .status-bad{color:#d94b64}.doc-matrix .doc-empty{color:#c1c7d0;font-weight:500}

.stats-section-block{margin:0 0 9px}
.stats-section-heading{display:flex;justify-content:space-between;align-items:end;gap:10px;margin:0 0 5px}
.stats-section-heading h2{font-size:13px;margin:0}.stats-section-heading p{font-size:9.5px;color:var(--muted);margin:1px 0 0}
.work-kpi-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.work-kpi{min-width:0;border:1px solid var(--line);border-radius:8px;background:#fff;padding:7px 9px;box-shadow:0 1px 2px rgba(16,24,40,.03)}
.work-kpi span{display:block;font-size:9.5px;color:#667085;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.work-kpi strong{display:block;font-size:21px;line-height:1;margin:3px 0 2px}.work-kpi small{display:block;font-size:8.8px;color:#98a2b3}
.work-kpi.main strong{color:#1f6feb}.work-kpi.success strong{color:#24965d}.work-kpi.warning strong{color:#c98a00}.work-kpi.neutral strong{color:#596579}
.stats-context-strip{display:flex;flex-wrap:wrap;gap:10px;margin-top:5px;padding:5px 8px;border-radius:7px;background:#f6f8fb;color:#667085;font-size:9.5px}.stats-context-strip b{color:#344054}
.application-kpi-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.application-kpi{border:1px solid var(--line);border-radius:8px;background:#fff;padding:7px 9px}.application-kpi span{display:block;font-size:9.5px;color:#667085;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.application-kpi strong{display:inline-block;font-size:19px;line-height:1.1;margin-top:3px}.application-kpi small{font-size:9px;color:#98a2b3;margin-left:3px}
.installer-stats-card{padding:10px 12px;margin-bottom:9px}.installer-summary-table{min-width:780px}.installer-summary-table th,.installer-summary-table td{padding:6px 8px;font-size:10.5px}.stat-success{color:#24965d!important;font-weight:800}.stat-attention{color:#c98a00!important;font-weight:800}
.stats-daily-work>div{display:grid;grid-template-columns:minmax(108px,1.25fr) repeat(5,minmax(58px,.72fr));align-items:center;gap:4px}.stats-daily-work .stats-daily-head{font-size:8.5px;color:#667085;background:#f7f9fc;font-weight:700}.stats-daily-work .stats-daily-head span:not(:first-child){text-align:center}.stats-daily-work b{text-align:center}.stats-daily-work .stat-bad{color:#d94b64!important;font-weight:800}.stats-daily-work .stat-neutral{color:#596579!important;font-weight:800}

@media(max-width:1050px){
  .application-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.application-save{width:100%}
  .work-kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.application-kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:760px){
  .application-card{padding:9px}.application-card-head{align-items:center}.application-grid{grid-template-columns:1fr 1fr}.application-grid label,.application-grid .application-days,.application-save{min-width:0}.application-save{grid-column:1/-1}
  .application-readonly-grid{grid-template-columns:1fr 1fr}
  .doc-matrix-card{padding:8px}.doc-matrix th,.doc-matrix td{padding:5px 7px}
  .work-kpi-grid,.application-kpi-grid{grid-template-columns:1fr 1fr}.work-kpi,.application-kpi{padding:7px 8px}.work-kpi strong{font-size:19px}
  .stats-context-strip{gap:6px}.stats-daily-work{overflow-x:auto}.stats-daily-work>div{min-width:610px;grid-template-columns:112px repeat(5,92px)}
}


/* v5.102: компактный список «Новые монтажи» ближе к размерам вкладки ТЗ */
.montage-inbox-list{gap:10px}
.montage-event{
    padding:12px 14px;
    border-radius:12px;
}
.montage-event-top{gap:12px}
.event-title-row .tz{font-size:16px;line-height:1.2}
.event-object{font-size:14px;line-height:1.25;margin-top:3px}
.montage-event .small{font-size:12px;line-height:1.3}
.event-time{font-size:12px}
.event-meta{gap:8px;margin-top:10px}
.event-meta>div{padding:8px 10px;border-radius:8px}
.event-meta span{font-size:10px;margin-bottom:3px}
.event-note{margin-top:10px;padding:8px 10px;font-size:13px}
.event-actions{gap:8px;margin-top:10px}
.event-actions .button,
.event-actions .primary{padding:8px 12px;font-size:13px;border-radius:8px}
.inbox-new{font-size:10px;padding:3px 6px}
.inbox-summary{padding:10px 12px}
@media(max-width:640px){
    .montage-event{padding:12px}
    .event-title-row .tz{font-size:18px}
}


/* v5.104: быстрый признак СУБ в карточке ТЗ */
.card-heading-inline{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:8px;
}
.card-heading-inline h2{margin:0}
.sub-toggle-form{margin:0}
.sub-toggle{
    display:flex;
    align-items:center;
    gap:6px;
    padding:5px 8px;
    border:1px solid var(--line);
    border-radius:8px;
    background:#f8fafc;
    cursor:pointer;
    user-select:none;
    line-height:1;
}
.sub-toggle input{width:15px;height:15px;margin:0}
.sub-toggle span{font-weight:800;font-size:12px}
.sub-toggle small{font-size:10px;color:var(--muted);font-weight:600}
.sub-toggle.active{background:#fff7ed;border-color:#fdba74}
.sub-toggle.active span{color:#c2410c}
.sub-pill,.stat-sub-label{color:#c2410c}
.sub-saved-note{margin:-2px 0 6px;color:#15803d}
@media(max-width:640px){
    .card-heading-inline{align-items:center}
    .sub-toggle{padding:7px 9px}
}

/* v5.105: расширенный дневной отчёт без увеличения карточки */
.stats-daily-work>div>span:first-child{white-space:nowrap}


/* v5.106: краткая информация о ТЗ/заявке/СУБ прямо в списке ТЗ */
.tz-brief{
    margin-top:5px;
    display:grid;
    gap:2px;
    font-size:10.5px;
    line-height:1.25;
    color:#667085;
}
.tz-brief b{color:#344054;font-weight:700}
.tz-brief-ok{color:#36804a}
.tz-brief-ok b{color:#237a3b}
.tz-brief-wait{color:#9a6700}
.tz-brief-wait b{color:#8a5b00}
.tz-brief-sub{
    display:inline-block;
    padding:1px 5px;
    border-radius:999px;
    background:#e9eef8;
    color:#334e8a;
    font-weight:800;
    font-size:9.5px;
    vertical-align:1px;
}
@media(max-width:640px){
    .tz-brief{font-size:10px;gap:3px}
}


/* v5.108: ровное вертикальное/горизонтальное выравнивание кнопок статистики и верхнего меню */
.stats-presets .button{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    text-align:center !important;
    line-height:1 !important;
}
.main-nav a{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    text-align:center !important;
    line-height:1 !important;
}


/* v5.109: компактная нижняя статистика — длинные периоды по месяцам */
.stats-compact-heading{
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    gap:10px;
    margin-bottom:8px;
}
.stats-compact-heading h2{margin:0}


/* v5.110: зонирование статистики на независимые блоки */
.stats-zone-card{padding:12px 12px 10px;margin:0 0 10px}
.stats-zone-title{display:flex;justify-content:space-between;align-items:end;gap:10px;margin:0 0 8px}
.stats-zone-title h2{margin:0;font-size:16px}
.stats-zone-title p{margin:2px 0 0}
.stats-zone-filter{margin-bottom:8px}
.stats-embedded-card{margin:0 0 8px}
.stats-zone-card .stats-embedded-card:last-child{margin-bottom:0}
@media(max-width:640px){
  .stats-zone-card{padding:10px 10px 8px}
  .stats-zone-title h2{font-size:15px}
}


/* v5.112: фильтры статистики обновляют только свой блок, без перезагрузки страницы */
.stats-zone-card{transition:opacity .12s ease}
.stats-zone-card.stats-zone-loading{opacity:.62;pointer-events:none}
.stats-zone-card.stats-zone-loading .stats-zone-filter{cursor:progress}


/* v5.115: быстрые статусы документов прямо в журнале */
.doc-inline-status{display:inline-flex;align-items:center;gap:5px;max-width:none;min-width:148px}
.doc-inline-status-select{appearance:auto;-webkit-appearance:menulist;width:137px;min-width:0;height:30px;min-height:30px;padding:3px 20px 3px 4px;border:1px solid transparent;border-radius:6px;background:transparent;color:#344054;font:inherit;font-weight:700;cursor:pointer}
.doc-inline-status-select:hover,.doc-inline-status-select:focus{border-color:#ccd5e0;background:#fff;outline:none}
.doc-inline-status.is-saving{opacity:.65}
.doc-inline-save-mark{width:13px;min-width:13px;font-size:11px;font-weight:900;text-align:center;color:#98a2b3}
.doc-inline-save-mark.ok{color:#24965d}.doc-inline-save-mark.error{color:#d94b64}.doc-inline-save-mark.saving{color:#667085}
@media(max-width:760px){.doc-inline-status{min-width:138px}.doc-inline-status-select{width:128px}}

/* v5.116: быстрые ответственные и даты в журнале документов */
.ks-doc-responsibles>div.doc-inline-field{display:grid;grid-template-columns:24px minmax(118px,1fr) 13px;align-items:center;gap:3px;min-height:27px;line-height:normal}
.doc-inline-field-select{width:100%;min-width:118px;height:26px;min-height:26px;padding:2px 18px 2px 4px;border:1px solid transparent;border-radius:5px;background:transparent;color:#475467;font:inherit;cursor:pointer}
.doc-inline-field-select:hover,.doc-inline-field-select:focus{border-color:#ccd5e0;background:#fff;outline:none}
.doc-inline-field.is-saving,.doc-inline-dates.is-saving{opacity:.65}
.doc-inline-field-mark{display:inline-block;width:13px;min-width:13px;font-size:10px;font-style:normal;font-weight:900;text-align:center;color:#98a2b3}
.doc-inline-field-mark.ok{color:#24965d}.doc-inline-field-mark.error{color:#d94b64}.doc-inline-field-mark.saving{color:#667085}
.ks-doc-date-summary>div.doc-inline-dates{display:grid;grid-template-columns:24px minmax(108px,1fr) minmax(108px,1fr) 13px;align-items:center;gap:4px;min-height:30px;line-height:normal}
.doc-inline-dates label{display:flex;align-items:center;gap:2px;margin:0;color:#8a94a3;font-size:9px;font-weight:800}
.doc-inline-date{width:100%;min-width:96px;height:26px;min-height:26px;padding:1px 2px;border:1px solid transparent;border-radius:5px;background:transparent;color:#475467;font:inherit;font-size:10px;font-variant-numeric:tabular-nums;cursor:pointer}
.doc-inline-date:hover,.doc-inline-date:focus{border-color:#ccd5e0;background:#fff;outline:none}
@media(max-width:760px){
  .ks-doc-responsibles>div.doc-inline-field{grid-template-columns:25px minmax(132px,1fr) 13px}
  .ks-doc-date-summary>div.doc-inline-dates{grid-template-columns:25px minmax(118px,1fr) minmax(118px,1fr) 13px}
}
/* v5.116 date picker: дата читается как дд.мм.гггг, календарь открывается кликом по ней */
.doc-inline-date-box{display:flex;align-items:center;gap:3px;margin:0;min-width:108px;color:#8a94a3;font-size:9px;font-weight:800}
.doc-inline-date-box em{font-style:normal}
.doc-inline-date-box .doc-date-value{position:relative;display:inline-flex;align-items:center;min-width:84px;height:25px;padding:0 4px;border:1px solid transparent;border-radius:5px;color:#475467;font-size:10px;font-weight:400;white-space:nowrap;cursor:pointer}
.doc-inline-date-box:hover .doc-date-value,.doc-inline-date-box:focus-within .doc-date-value{border-color:#ccd5e0;background:#fff}
.doc-inline-date-box .doc-inline-date{position:absolute;inset:0;width:100%;height:100%;min-width:0;padding:0;border:0;opacity:0;cursor:pointer}


/* v5.117: аккуратный компактный журнал документов */
.ks-doc-compact-wrap{overflow:auto}
.ks-doc-compact-table{min-width:1180px;border-collapse:separate;border-spacing:0 6px;font-size:12px}
.ks-doc-compact-table thead th{padding:8px 10px;font-size:11px;color:#667085;background:#f8fafc;border-bottom:1px solid #e4e7ec}
.ks-doc-compact-table tbody td{padding:10px 10px;vertical-align:middle;background:#fff;border-top:1px solid #eef2f6;border-bottom:1px solid #eef2f6}
.ks-doc-compact-table tbody td:first-child{border-left:1px solid #eef2f6;border-radius:10px 0 0 10px;min-width:108px}
.ks-doc-compact-table tbody td:last-child{border-right:1px solid #eef2f6;border-radius:0 10px 10px 0}
.ks-doc-compact-table tbody tr:hover td{background:#fbfdff}
.ks-doc-compact-table .tz{display:inline-block;font-size:14px;line-height:1.15}
.ks-doc-compact-table .tiny{margin-top:2px}
.ks-doc-applicant{font-size:14px;line-height:1.25;font-weight:600;color:#1d2939;max-width:245px}
.ks-doc-status-cell{min-width:150px}
.doc-inline-status{display:grid;grid-template-columns:10px minmax(112px,1fr) 13px;align-items:center;gap:6px;min-width:135px}
.doc-inline-status i{justify-self:center}
.doc-inline-status-select{width:100%;height:32px;min-height:32px;padding:4px 28px 4px 10px;border:1px solid #d0d5dd;border-radius:8px;background:#fff;color:#1d2939;font-size:12px;font-weight:700;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.doc-inline-status-select:hover,.doc-inline-status-select:focus{border-color:#98a2b3;background:#fff}
.ks-doc-responsibles,.ks-doc-date-summary{font-size:11px;color:#475467;white-space:normal}
.ks-doc-responsibles{min-width:150px}
.ks-doc-responsibles>div.doc-inline-field{display:grid;grid-template-columns:34px minmax(112px,1fr) 13px;align-items:center;gap:6px;min-height:30px;margin:3px 0}
.doc-mini-label,.doc-date-label{display:inline-flex;align-items:center;justify-content:center;height:22px;padding:0 6px;border-radius:999px;background:#f2f4f7;color:#667085;font-size:10px;font-weight:800;line-height:1}
.doc-inline-field-select{width:100%;min-width:0;height:30px;min-height:30px;padding:4px 26px 4px 9px;border:1px solid #d0d5dd;border-radius:8px;background:#fff;color:#344054;font-size:12px;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.doc-inline-field-select:hover,.doc-inline-field-select:focus{border-color:#98a2b3;background:#fff}
.ks-doc-date-summary{min-width:250px}
.ks-doc-date-summary>div.doc-inline-dates{display:grid;grid-template-columns:34px minmax(90px,1fr) minmax(90px,1fr) 13px;align-items:center;gap:6px;min-height:31px;margin:3px 0}
.doc-inline-date-box{display:flex;align-items:center;gap:4px;min-width:0}
.doc-inline-date-box em{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;background:#f2f4f7;color:#667085;font-size:9px;font-weight:800;flex:0 0 auto}
.doc-inline-date-box .doc-date-value{position:relative;display:flex;align-items:center;min-width:0;width:100%;height:30px;padding:0 10px;border:1px solid #d0d5dd;border-radius:8px;background:#fff;color:#344054;font-size:11px;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.doc-inline-date-box:hover .doc-date-value,.doc-inline-date-box:focus-within .doc-date-value{border-color:#98a2b3;background:#fff}
.doc-inline-date-box .doc-inline-date{position:absolute;inset:0;width:100%;height:100%;padding:0;border:0;opacity:0;cursor:pointer}
.doc-inline-field-mark,.doc-inline-save-mark{width:13px;min-width:13px;justify-self:center}
@media(max-width:1200px){
  .ks-doc-compact-table{min-width:1120px}
  .ks-doc-applicant{max-width:210px;font-size:13px}
}
@media(max-width:760px){
  .ks-doc-compact-table{min-width:1080px;font-size:11px}
  .ks-doc-status-cell{min-width:142px}
  .doc-inline-status{grid-template-columns:10px minmax(104px,1fr) 13px}
  .doc-inline-status-select{height:30px;font-size:11px}
  .ks-doc-responsibles>div.doc-inline-field{grid-template-columns:32px minmax(100px,1fr) 13px}
  .ks-doc-date-summary>div.doc-inline-dates{grid-template-columns:32px minmax(84px,1fr) minmax(84px,1fr) 13px}
}

/* v5.119: роль отдельно, доступы к рабочим разделам — чекбоксами */
.user-permission-wide{grid-column:1/-1}
.user-permission-title{display:block;margin:3px 0 6px;font-size:11px;color:#475467}
.user-permissions{display:flex;flex-wrap:wrap;gap:6px 8px}
.user-permissions.compact{margin-top:4px}
.user-permission-check{display:inline-flex;align-items:center;gap:5px;min-height:28px;padding:4px 8px;border:1px solid #d9e0e8;border-radius:8px;background:#fff;color:#344054;font-size:11px;font-weight:700;cursor:pointer}
.user-permission-check:hover{border-color:#b8c5d4;background:#f9fbfd}
.user-permission-check input{width:15px;height:15px;margin:0;accent-color:#1f6feb}
.user-permission-check.mandatory{background:#f4f7fb;color:#667085}
.user-permission-check:has(input:checked){border-color:#b8d1f4;background:#f3f8ff;color:#245fa9}
.user-permissions-note{margin-top:5px;line-height:1.25}
.user-role-access-cell{min-width:390px}
.user-role-access-cell>.user-display-input,.user-role-access-cell>select{max-width:220px;margin-right:6px}
.user-create-submit{align-self:end}
.permissions-users-table table{min-width:1320px}
@media(max-width:760px){
  .user-permissions{gap:5px}
  .user-permission-check{font-size:10.5px;padding:5px 7px}
  .user-permission-wide{grid-column:auto}
  .user-create-submit{width:100%}
}


/* v5.120: layout ролей/доступов + принудительное обновление оформления */
@media(min-width:901px){
  .user-create-grid .user-permission-wide{grid-column:1/-1;grid-row:2}
  .user-create-grid .user-create-submit{grid-column:5;grid-row:1;align-self:end;white-space:nowrap}
}
@media(max-width:900px){
  .user-create-grid .user-permission-wide,.user-create-grid .user-create-submit{grid-column:1/-1;grid-row:auto}
}


/* v5.121: компактные права пользователей + компактный журнал документов */
.user-permission-title{
    margin:2px 0 4px;
    font-size:10px;
}
.user-permissions,
.user-permissions.compact{
    gap:3px 7px;
    margin-top:2px;
}
.user-permission-check{
    min-height:18px;
    padding:0 2px;
    gap:3px;
    border:0;
    border-radius:4px;
    background:transparent;
    font-size:10px;
    font-weight:600;
    line-height:18px;
}
.user-permission-check:hover{
    border:0;
    background:#f6f8fb;
}
.user-permission-check input{
    width:12px;
    height:12px;
    margin:0;
    flex:0 0 12px;
}
.user-permission-check.mandatory{
    background:transparent;
    color:#667085;
}
.user-permission-check:has(input:checked){
    border:0;
    background:transparent;
    color:#245fa9;
}
.user-permissions-note{
    margin-top:2px;
    font-size:9px;
    line-height:1.15;
}
.user-role-access-cell{min-width:320px}
.permissions-users-table table{min-width:1180px}
.user-role-access-cell>.user-display-input,
.user-role-access-cell>select{
    max-width:205px;
    min-height:30px;
    height:30px;
    padding-top:3px;
    padding-bottom:3px;
}

/* Документы: ближе по плотности к таблице ТЗ */
.ks-doc-compact-table{
    min-width:1040px;
    border-collapse:collapse;
    border-spacing:0;
    font-size:11px;
}
.ks-doc-compact-table thead th{
    padding:5px 7px;
    font-size:10px;
}
.ks-doc-compact-table tbody td{
    padding:5px 7px;
    border-top:1px solid #e9edf2;
    border-bottom:0;
    background:#fff;
}
.ks-doc-compact-table tbody td:first-child{
    min-width:88px;
    border-left:0;
    border-radius:0;
}
.ks-doc-compact-table tbody td:last-child{
    border-right:0;
    border-radius:0;
}
.ks-doc-compact-table .tz{
    font-size:12.5px;
    line-height:1.1;
}
.ks-doc-compact-table .tiny{
    margin-top:1px;
    font-size:9px;
}
.ks-doc-applicant{
    max-width:200px;
    font-size:12px;
    line-height:1.15;
    font-weight:600;
}
.ks-doc-status-cell{min-width:122px}
.doc-inline-status{
    grid-template-columns:8px minmax(100px,1fr) 10px;
    gap:4px;
    min-width:118px;
}
.doc-inline-status-select{
    height:27px;
    min-height:27px;
    padding:2px 22px 2px 7px;
    border-radius:6px;
    font-size:11px;
    box-shadow:none;
}
.doc-inline-save-mark{
    width:10px;
    min-width:10px;
    font-size:9px;
}
.ks-doc-responsibles{min-width:135px}
.ks-doc-responsibles>div.doc-inline-field{
    grid-template-columns:24px minmax(96px,1fr) 10px;
    gap:4px;
    min-height:23px;
    margin:1px 0;
}
.doc-mini-label,.doc-date-label{
    height:17px;
    min-width:22px;
    padding:0 4px;
    border-radius:4px;
    font-size:8.5px;
}
.doc-inline-field-select{
    height:23px;
    min-height:23px;
    padding:1px 20px 1px 6px;
    border-radius:5px;
    font-size:10px;
    box-shadow:none;
}
.doc-inline-field-mark{
    width:10px;
    min-width:10px;
    font-size:8px;
}
.ks-doc-date-summary{min-width:210px}
.ks-doc-date-summary>div.doc-inline-dates{
    grid-template-columns:24px minmax(76px,1fr) minmax(76px,1fr) 10px;
    gap:3px;
    min-height:23px;
    margin:1px 0;
}
.doc-inline-date-box{
    gap:2px;
}
.doc-inline-date-box em{
    width:14px;
    height:14px;
    font-size:8px;
}
.doc-inline-date-box .doc-date-value{
    height:23px;
    padding:0 6px;
    border-radius:5px;
    font-size:9.5px;
    font-weight:500;
    box-shadow:none;
}
@media(max-width:1200px){
    .ks-doc-compact-table{min-width:1010px}
    .ks-doc-applicant{max-width:180px;font-size:11.5px}
}
@media(max-width:760px){
    .user-permission-check{font-size:9.5px}
    .user-permission-check input{width:12px;height:12px}
    .permissions-users-table table{min-width:1080px}
    .ks-doc-compact-table{min-width:1000px}
    .ks-doc-status-cell{min-width:116px}
    .doc-inline-status{grid-template-columns:8px minmax(96px,1fr) 10px}
    .ks-doc-responsibles>div.doc-inline-field{grid-template-columns:22px minmax(92px,1fr) 10px}
    .ks-doc-date-summary>div.doc-inline-dates{grid-template-columns:22px minmax(74px,1fr) minmax(74px,1fr) 10px}
}


/* v5.122: права — 5 компактных пунктов в ряд; даты открывают календарь по всей ячейке */
.user-permissions,
.user-permissions.compact{
    display:grid;
    grid-template-columns:repeat(5, minmax(46px, 58px));
    align-items:start;
    gap:4px 5px;
    width:max-content;
    max-width:100%;
    margin-top:2px;
}
.user-permission-check{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:flex-start;
    gap:2px;
    min-width:0;
    min-height:30px;
    padding:1px 2px;
    border:0;
    background:transparent;
    font-size:8.5px;
    font-weight:600;
    line-height:1.05;
    text-align:center;
    cursor:pointer;
}
.user-permission-check span{
    display:block;
    width:100%;
    min-height:18px;
    overflow-wrap:anywhere;
}
.user-permission-check input{
    width:10px;
    height:10px;
    margin:0;
    flex:0 0 10px;
}
.user-permissions-note{
    max-width:300px;
    margin-top:2px;
    font-size:8px;
    line-height:1.15;
}
.user-role-access-cell{min-width:305px}

.doc-inline-date-box{cursor:pointer}
.doc-inline-date-box .doc-date-value{cursor:pointer}
.doc-inline-date-box .doc-inline-date{
    pointer-events:none;
    opacity:0;
}

@media(max-width:760px){
    .user-permissions,
    .user-permissions.compact{grid-template-columns:repeat(5, minmax(44px, 54px));gap:4px}
    .user-permission-check{font-size:8px}
    .user-permission-check input{width:10px;height:10px}
}


/* v5.123: единая геометрия журнала документов и понятные подписи дат */
.ks-doc-compact-table thead th:nth-child(n+3){text-align:center}
.ks-doc-compact-table tbody td{vertical-align:middle}
.ks-doc-compact-table tbody tr{height:92px}
.ks-doc-status-cell{text-align:center}
.doc-inline-status{margin:0 auto;grid-template-columns:8px 116px 10px;min-width:138px;justify-content:center}
.doc-inline-status-select{width:116px;height:25px;min-height:25px;padding:1px 20px 1px 7px;font-size:10.5px}
.ks-doc-responsibles{min-width:150px}
.ks-doc-responsibles>div.doc-inline-field{grid-template-columns:24px 118px 10px;gap:4px;min-height:25px;margin:1px 0;justify-content:center}
.doc-inline-field-select{width:118px;height:25px;min-height:25px;padding:1px 20px 1px 7px;font-size:10px}
.doc-mini-label,.doc-date-label{height:17px;min-width:22px;padding:0 4px;font-size:8px}
.ks-doc-date-summary{min-width:212px;padding-top:3px!important}
.doc-date-columns-head,
.ks-doc-date-summary>div.doc-inline-dates{display:grid;grid-template-columns:24px 82px 82px 10px;gap:4px;align-items:center;justify-content:center}
.doc-date-columns-head{height:13px;margin:0 0 1px;color:#7b8796;font-size:7.4px;font-weight:700;line-height:1;text-align:center;text-transform:none;letter-spacing:.01em}
.doc-date-columns-head span:nth-child(2),.doc-date-columns-head span:nth-child(3){white-space:nowrap}
.ks-doc-date-summary>div.doc-inline-dates{min-height:25px;margin:1px 0}
.doc-inline-date-box{display:block;min-width:0;margin:0}
.doc-inline-date-box .doc-date-value{justify-content:center;width:82px;min-width:82px;height:25px;padding:0 4px;font-size:9.5px;font-weight:500;text-align:center}
.ks-doc-applicant-cell,.ks-doc-compact-table tbody td:first-child{vertical-align:middle}
.ks-doc-applicant{line-height:1.15}

/* Права пользователей: строго 5 пунктов в ряд, ещё компактнее */
.user-permissions,.user-permissions.compact{
    display:grid!important;
    grid-template-columns:repeat(5, 50px)!important;
    grid-auto-flow:row!important;
    gap:3px 4px!important;
    width:266px!important;
    max-width:266px!important;
    margin-top:2px!important;
}
.user-permission-check{
    width:50px!important;
    min-width:50px!important;
    min-height:27px!important;
    padding:0!important;
    gap:1px!important;
    font-size:7.5px!important;
    line-height:1!important;
}
.user-permission-check input{width:9px!important;height:9px!important;flex:0 0 9px!important}
.user-permission-check span{min-height:15px!important;line-height:1!important}
.user-permissions-note{max-width:266px!important;font-size:7px!important;line-height:1.05!important;margin-top:2px!important}
.user-role-access-cell{min-width:285px!important}
@media(max-width:760px){
  .user-permissions,.user-permissions.compact{grid-template-columns:repeat(5, 48px)!important;width:256px!important;max-width:256px!important}
  .user-permission-check{width:48px!important;min-width:48px!important;font-size:7px!important}
}


/* v5.124: ответственный и даты находятся прямо под своим статусом */
.ks-doc-stage-table{min-width:980px;border-spacing:0 4px}
.ks-doc-stage-table thead th:nth-child(n+3){text-align:center}
.ks-doc-stage-table tbody tr{height:auto}
.ks-doc-stage-table tbody td{padding:8px 10px}
.ks-doc-stage-table .ks-doc-applicant-cell{min-width:190px}
.ks-doc-stage-cell{min-width:225px;vertical-align:middle!important}
.doc-stage-block{display:flex;flex-direction:column;gap:4px;max-width:238px;margin:0 auto}
.doc-stage-block .doc-inline-status{display:grid;grid-template-columns:8px minmax(0,1fr) 10px;gap:5px;width:100%;min-width:0;margin:0 0 2px}
.doc-stage-block .doc-inline-status-select{width:100%;height:27px;min-height:27px;font-size:10.5px}
.doc-stage-field{display:grid!important;grid-template-columns:74px minmax(0,1fr) 10px!important;gap:5px!important;align-items:center!important;min-height:24px!important;margin:0!important;line-height:normal!important}
.doc-stage-label{color:#667085;font-size:8.5px;font-weight:700;line-height:1.05;text-align:left;white-space:nowrap}
.doc-stage-field .doc-inline-field-select{width:100%;min-width:0;height:24px;min-height:24px;padding:1px 20px 1px 6px;border:1px solid #d0d5dd;border-radius:5px;background:#fff;font-size:9.5px;box-shadow:none}
.doc-stage-field .doc-inline-date-box{display:block;width:100%;min-width:0;margin:0}
.doc-stage-field .doc-date-value{display:flex;align-items:center;justify-content:flex-start;width:100%;min-width:0;height:24px;padding:0 6px;border:1px solid #d0d5dd;border-radius:5px;background:#fff;font-size:9px;font-weight:500;text-align:left;box-shadow:none}
.doc-stage-field .doc-inline-field-mark{width:10px;min-width:10px;font-size:8px}
.doc-stage-block .doc-inline-status-select:hover,
.doc-stage-block .doc-inline-status-select:focus,
.doc-stage-field .doc-inline-field-select:hover,
.doc-stage-field .doc-inline-field-select:focus,
.doc-stage-field .doc-inline-date-box:hover .doc-date-value,
.doc-stage-field .doc-inline-date-box:focus-within .doc-date-value{border-color:#98a2b3;background:#fff}
@media(max-width:1100px){
  .ks-doc-stage-table{min-width:920px}
  .ks-doc-stage-cell{min-width:205px}
  .doc-stage-block{max-width:220px}
  .doc-stage-field{grid-template-columns:68px minmax(0,1fr) 9px!important}
  .doc-stage-label{font-size:8px}
}
@media(max-width:760px){
  .ks-doc-stage-table{min-width:900px}
  .ks-doc-stage-cell{min-width:200px}
}

/* v5.124 compatibility + field-label cleanup */
.doc-stage-label.doc-date-label{height:auto;min-width:0;padding:0;border-radius:0;background:transparent;color:#667085;font-size:8.5px;font-weight:700;line-height:1.05;justify-content:flex-start}
.doc-legacy-sent{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}

.doc-stage-block>.doc-date-label{display:none!important}


/* v5.125: ровная компактная сетка внутри Выполнение / ИД / КС+РС */
.ks-doc-stage-table{min-width:1040px;border-spacing:0 4px}
.ks-doc-stage-table tbody td{padding:7px 9px}
.ks-doc-stage-table .ks-doc-applicant-cell{min-width:205px}
.ks-doc-stage-cell{min-width:235px;vertical-align:middle!important}
.doc-stage-block{
    display:grid;
    grid-auto-rows:26px;
    row-gap:3px;
    width:230px;
    max-width:230px;
    margin:0 auto;
}
/* Одинаковая сетка у статуса, ответственного и обеих дат:
   слева подпись/точка, по центру поле, справа индикатор сохранения. */
.doc-stage-block .doc-inline-status,
.doc-stage-block .doc-stage-field{
    display:grid!important;
    grid-template-columns:72px 142px 10px!important;
    align-items:center!important;
    gap:3px!important;
    width:230px!important;
    min-width:230px!important;
    max-width:230px!important;
    min-height:26px!important;
    margin:0!important;
    line-height:normal!important;
}
.doc-stage-block .doc-inline-status>i{
    grid-column:1;
    justify-self:end;
    margin-right:4px;
}
.doc-stage-block .doc-inline-status-select{
    grid-column:2;
    width:142px!important;
    height:26px!important;
    min-height:26px!important;
    padding:1px 22px 1px 7px!important;
    border:1px solid #d0d5dd!important;
    border-radius:6px!important;
    background:#fff!important;
    color:#1d2939!important;
    font-size:10.5px!important;
    font-weight:700!important;
    box-shadow:none!important;
}
.doc-stage-block .doc-inline-save-mark{
    grid-column:3;
    width:10px!important;
    min-width:10px!important;
    font-size:8px!important;
}
.doc-stage-label{
    grid-column:1;
    display:block;
    color:#667085;
    font-size:8.5px;
    font-weight:700;
    line-height:1;
    text-align:right;
    white-space:nowrap;
    padding-right:4px;
}
.doc-stage-field .doc-inline-field-select,
.doc-stage-field .doc-inline-date-box{
    grid-column:2;
    width:142px!important;
    min-width:142px!important;
    max-width:142px!important;
}
.doc-stage-field .doc-inline-field-select{
    height:26px!important;
    min-height:26px!important;
    padding:1px 22px 1px 7px!important;
    border:1px solid #d0d5dd!important;
    border-radius:6px!important;
    background:#fff!important;
    color:#344054!important;
    font-size:9.5px!important;
    box-shadow:none!important;
}
.doc-stage-field .doc-inline-date-box{
    display:block!important;
    margin:0!important;
}
.doc-stage-field .doc-date-value{
    position:relative;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    width:142px!important;
    min-width:142px!important;
    max-width:142px!important;
    height:26px!important;
    padding:0 24px 0 7px!important;
    border:1px solid #d0d5dd!important;
    border-radius:6px!important;
    background:#fff!important;
    color:#344054!important;
    font-size:9.5px!important;
    font-weight:500!important;
    font-variant-numeric:tabular-nums;
    text-align:left!important;
    box-shadow:none!important;
    cursor:pointer!important;
}
/* Небольшой календарь справа, чтобы было очевидно, что поле кликабельное. */
.doc-stage-field .doc-date-value::after{
    content:'▣';
    position:absolute;
    right:7px;
    top:50%;
    transform:translateY(-50%);
    color:#98a2b3;
    font-size:8px;
    pointer-events:none;
}
.doc-stage-field .doc-inline-field-mark{
    grid-column:3;
    width:10px!important;
    min-width:10px!important;
    font-size:8px!important;
}
.doc-stage-block .doc-inline-status-select:hover,
.doc-stage-block .doc-inline-status-select:focus,
.doc-stage-field .doc-inline-field-select:hover,
.doc-stage-field .doc-inline-field-select:focus,
.doc-stage-field .doc-inline-date-box:hover .doc-date-value,
.doc-stage-field .doc-inline-date-box:focus-within .doc-date-value{
    border-color:#98a2b3!important;
    outline:none!important;
}
/* Старые вспомогательные элементы из прежней верстки здесь не участвуют. */
.doc-stage-block .doc-date-label,
.doc-stage-block .doc-legacy-sent{display:none!important}
@media(max-width:1100px){
    .ks-doc-stage-table{min-width:1000px}
    .ks-doc-stage-cell{min-width:225px}
    .doc-stage-block{width:220px;max-width:220px}
    .doc-stage-block .doc-inline-status,
    .doc-stage-block .doc-stage-field{
        grid-template-columns:68px 136px 10px!important;
        width:220px!important;min-width:220px!important;max-width:220px!important;
    }
    .doc-stage-block .doc-inline-status-select,
    .doc-stage-field .doc-inline-field-select,
    .doc-stage-field .doc-inline-date-box,
    .doc-stage-field .doc-date-value{
        width:136px!important;min-width:136px!important;max-width:136px!important;
    }
}


/* v5.129: компактная галерея фото в карточке ТЗ */
.object-photo-card{padding:12px 14px;margin:10px 0}
.object-photo-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
.object-photo-head h2{margin:0;font-size:14px}
.object-photo-count{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:20px;padding:0 6px;margin-left:4px;border-radius:999px;background:#eef2f6;color:#667085;font-size:10px;font-weight:800;vertical-align:middle}
.object-photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(72px,82px));gap:7px;align-items:start}
.object-photo-thumb{position:relative;display:block;width:82px;height:82px;border-radius:8px;overflow:hidden;border:1px solid var(--line);background:#f7f9fc;text-decoration:none}
.object-photo-thumb img{display:block;width:100%;height:100%;object-fit:cover}
.object-photo-thumb>span{position:absolute;right:4px;bottom:4px;display:flex;align-items:center;justify-content:center;min-width:19px;height:19px;padding:0 5px;border-radius:999px;background:rgba(17,24,39,.72);color:#fff;font-size:9px;font-weight:800;line-height:1}
.object-photo-thumb.photo-extra{display:none}
.object-photo-grid.is-expanded .object-photo-thumb.photo-extra{display:block}
.object-photo-toggle{margin-top:8px;padding:5px 9px;font-size:10px}
@media(max-width:760px){
  .object-photo-card{padding:10px 11px}
  .object-photo-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
  .object-photo-thumb{width:100%;height:auto;aspect-ratio:1/1}
}

/* v5.143 — collapsible history + photos in object card */
.btn-icon{display:inline-flex;align-items:center;justify-content:center;min-width:16px;font-size:14px;line-height:1}
.object-top-history-btn,.object-doc-actions .button,.fold-actions .button{display:inline-flex;align-items:center;gap:7px;justify-content:center}
.fold-card{padding:0;overflow:hidden}
.fold-card>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 18px;cursor:pointer;user-select:none}
.fold-card>summary::-webkit-details-marker{display:none}
.fold-summary-main{min-width:0;display:flex;align-items:center;gap:12px;flex:1 1 auto;flex-wrap:wrap}
.fold-summary-extra{display:flex;align-items:center;gap:8px;min-width:0}
.fold-content{padding:0 18px 18px}
.fold-icon{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:999px;background:#eef4ff;color:#2563eb;font-size:18px;flex:0 0 auto}
.fold-title{font-size:15px;font-weight:800;color:#1f2a44}
.fold-meta{font-size:12px;color:#6b7788}
.fold-arrow{width:10px;height:10px;border-right:2px solid #6b7788;border-bottom:2px solid #6b7788;transform:rotate(45deg);transition:transform .18s ease;margin-right:4px;flex:0 0 auto}
.details-card[open] .fold-arrow,
.fold-card[open] .fold-arrow{transform:rotate(225deg);margin-top:6px}
.fold-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:14px}
.history-timeline{display:grid;gap:0;margin-top:2px;position:relative}
.history-item{display:grid;grid-template-columns:18px minmax(132px,152px) minmax(220px,1fr) minmax(150px,180px);gap:12px;align-items:center;padding:9px 0;border-top:1px solid #edf0f4}
.history-item:first-child{border-top:none}
.history-dot{width:10px;height:10px;border-radius:999px;background:#98b4df;margin-left:4px;position:relative}
.history-dot::before{content:"";position:absolute;left:4px;top:-16px;bottom:100%;width:2px;background:#d8e4f4}
.history-item:first-child .history-dot::before{display:none}
.history-when{display:flex;align-items:center;gap:10px;color:#46556b;font-variant-numeric:tabular-nums}
.history-when b{font-size:14px}
.history-when span{font-size:13px;color:#718099}
.history-what{font-weight:700;color:#1f2a44;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.history-section{display:inline-flex;align-items:center;padding:3px 8px;border-radius:999px;background:#eef4fb;border:1px solid #dbe7f4;color:#56708f;font-size:11px;font-weight:700}
.history-who{color:#46556b;font-size:14px;justify-self:start}
.photo-preview-strip{display:flex;align-items:center;gap:7px;overflow:hidden}
.photo-preview-mini{display:inline-flex;width:42px;height:42px;border-radius:8px;overflow:hidden;border:1px solid var(--line);background:#f7f9fc;flex:0 0 auto}
.photo-preview-mini img{display:block;width:100%;height:100%;object-fit:cover}
.fold-card-photo .fold-content{padding-top:2px}
.object-photo-actions{margin-top:10px}
.object-photo-card>summary{padding-bottom:14px}
.object-photo-card .object-photo-grid{margin-top:0}
.object-doc-actions .button{min-width:190px}
.object-top-history-btn .btn-icon{font-size:13px}
@media (max-width:980px){
  .history-item{grid-template-columns:18px minmax(118px,140px) 1fr;align-items:start}
  .history-who{grid-column:2 / -1;padding-left:0;font-size:13px;color:#66758b}
}
@media (max-width:700px){
  .fold-card>summary{padding:14px 14px}
  .fold-content{padding:0 14px 14px}
  .fold-summary-main{gap:10px}
  .fold-icon{width:28px;height:28px;font-size:16px}
  .fold-title{font-size:14px}
  .fold-meta{flex-basis:100%;padding-left:38px}
  .photo-preview-strip{gap:5px}
  .photo-preview-mini{width:34px;height:34px}
  .history-item{grid-template-columns:16px 1fr;gap:8px;padding:8px 0}
  .history-when{grid-column:2 / -1;font-size:13px}
  .history-what{grid-column:2 / -1}
  .history-who{grid-column:2 / -1}
}

/* v5.144 — expandable cards on main TZ list */
.dashboard-expand-head{width:38px;padding-left:4px!important;padding-right:4px!important}
.dashboard-expand-cell{width:38px;padding:8px 6px!important;text-align:center;vertical-align:middle!important}
.dashboard-expand-toggle{width:30px;height:30px;padding:0;border:1px solid #d7dde6;border-radius:8px;background:#fff;display:inline-flex;align-items:center;justify-content:center;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.dashboard-expand-toggle span{width:8px;height:8px;border-right:2px solid #52719a;border-bottom:2px solid #52719a;transform:rotate(45deg);transition:transform .16s ease;margin-top:-4px}
.dashboard-expand-toggle[aria-expanded="true"] span{transform:rotate(225deg);margin-top:4px}
.dashboard-expand-row[hidden]{display:none!important}
.dashboard-expand-row td{padding:0 8px 10px!important;background:#f8fbff!important;border-top:0!important}
.dashboard-expand-content{border:1px solid #dbe5f1;border-radius:10px;background:#fff;overflow:hidden}
.dashboard-quick-loading{padding:16px;color:#667085;font-size:12px}
.dashboard-quick-panel{padding:10px 12px}
.dashboard-quick-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:2px 2px 9px;border-bottom:1px solid #edf1f5}
.dashboard-quick-head>div{display:flex;align-items:baseline;gap:10px;min-width:0}
.dashboard-quick-head b{font-size:14px;color:#1263d6}
.dashboard-quick-head span{font-size:12px;color:#667085;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.quick-section{border-bottom:1px solid #edf1f5}
.quick-section:last-child{border-bottom:0}
.quick-section>summary{list-style:none;display:flex;align-items:center;gap:10px;min-height:42px;padding:8px 4px;cursor:pointer}
.quick-section>summary::-webkit-details-marker{display:none}
.quick-section-title{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:800;color:#1f2a44;min-width:0}
.quick-section-title svg,.dashboard-doc-btn svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}
.quick-count{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:18px;padding:0 5px;border-radius:999px;background:#eef2f7;color:#667085;font-size:9px}
.quick-chevron{margin-left:auto;width:8px;height:8px;border-right:2px solid #718099;border-bottom:2px solid #718099;transform:rotate(45deg);transition:transform .16s ease;margin-right:6px;margin-top:-4px;flex:0 0 auto}
.quick-section[open] .quick-chevron{transform:rotate(225deg);margin-top:4px}
.quick-section-body{padding:2px 4px 11px 32px}
.quick-history-list{display:grid}
.quick-history-row{display:grid;grid-template-columns:10px 145px minmax(200px,1fr) minmax(130px,180px);gap:10px;align-items:center;padding:6px 0;border-top:1px solid #f0f2f5;font-size:11px}
.quick-history-row:first-child{border-top:0}
.quick-dot{width:7px;height:7px;border-radius:999px;background:#75a6e7}
.quick-time{font-variant-numeric:tabular-nums;color:#596980}
.quick-history-row b{font-size:11px;color:#26354d}
.quick-user{color:#667085}
.quick-more-link{display:inline-block;margin-top:8px;color:#1769d2;text-decoration:none;font-size:11px;font-weight:700}
.quick-photo-preview{display:flex;gap:4px;margin-left:auto}
.quick-photo-preview img{width:32px;height:32px;object-fit:cover;border-radius:6px;border:1px solid #dde3ea}
.quick-photo-grid{display:grid;grid-template-columns:repeat(auto-fill,64px);gap:6px;margin-bottom:6px}
.quick-photo-grid a{position:relative;width:64px;height:64px;border-radius:7px;overflow:hidden;border:1px solid #dde3ea;background:#f7f9fc}
.quick-photo-grid img{width:100%;height:100%;object-fit:cover;display:block}
.quick-photo-grid a span{position:absolute;right:3px;bottom:3px;min-width:16px;height:16px;padding:0 4px;display:flex;align-items:center;justify-content:center;border-radius:999px;background:rgba(17,24,39,.7);color:#fff;font-size:8px;font-weight:800}
.dashboard-doc-btn{display:flex!important;align-items:center;justify-content:center;gap:5px}
.dashboard-doc-btn svg{width:13px;height:13px}
@media(max-width:640px){
  .dashboard-expand-head{display:none!important}
  .dashboard-expand-cell{display:flex!important;justify-content:flex-end!important;grid-template-columns:1fr!important;padding:5px 8px!important}
  .dashboard-expand-cell::before{display:none!important}
  .dashboard-expand-row{display:block!important;border:0!important;padding:0!important;background:transparent!important}
  .dashboard-expand-row[hidden]{display:none!important}
  .dashboard-expand-row td{display:block!important;padding:0 0 8px!important;border:0!important;background:transparent!important}
  .dashboard-expand-row td::before{display:none!important}
  .dashboard-expand-content{border-radius:8px}
  .dashboard-quick-head{align-items:flex-start}
  .dashboard-quick-head>div{display:block}
  .dashboard-quick-head span{display:block;margin-top:2px}
  .quick-section-body{padding-left:4px}
  .quick-history-row{grid-template-columns:9px 1fr;gap:6px}
  .quick-time,.quick-history-row b,.quick-user{grid-column:2}
  .quick-photo-preview img{width:28px;height:28px}
}

/* v5.146: quick filters and accessible status explanations. */
.dashboard-filter-pills{margin-top:3px;margin-bottom:12px}
.status-hint{display:inline-block;vertical-align:middle;text-align:left}
.status-hint>summary{list-style:none;cursor:pointer;user-select:none;display:inline-flex;align-items:center;flex-wrap:nowrap;gap:4px;white-space:nowrap;word-break:normal;width:max-content}
.status-hint>summary::-webkit-details-marker{display:none}
.status-hint>summary:focus-visible{outline:2px solid #1f6feb;outline-offset:3px}
.status-hint>summary span{opacity:.75;font-size:.9em;flex:none;white-space:nowrap}
.status-hint-text{max-width:180px;min-width:105px;padding:7px 0 3px;font-size:11px;line-height:1.4;color:#536176;white-space:normal;overflow-wrap:anywhere;font-weight:400}
.dashboard-empty{text-align:center!important;padding:24px!important}
.dashboard-empty p{margin:6px 0 12px}
.object-row{scroll-margin-top:85px}
@media(max-width:760px){
  .dashboard-filter-pills{display:grid!important;grid-template-columns:1fr 1fr;overflow:visible!important;gap:6px!important}
  .dashboard-filter-pills .ks-filter-pill{justify-content:space-between;white-space:normal;min-height:36px}
  .status-hint-text{max-width:180px;font-size:12px}
}

/* v5.149: компактная сводка документов и более наглядные KPI статистики */
.doc-overview-card{
    padding:12px 13px 13px;
    border:1px solid #e2e7ee;
    border-radius:11px;
    background:#fff;
}
.doc-overview-card .doc-stats-head{margin-bottom:9px}
.doc-overview-card .doc-stats-head h2{font-size:15px}
.doc-overview-card .doc-stats-head p{font-size:10px;color:#7a8595}
.doc-overview-card .doc-stats-total{
    padding:5px 8px;
    border-color:#e3e8ef;
    background:#fafbfc;
}
.doc-overview-card .doc-stats-total b{font-size:16px;color:#1f6feb}

.doc-complete-card{
    display:grid;
    grid-template-columns:34px minmax(0,1fr);
    gap:9px;
    align-items:center;
    margin-bottom:8px;
    padding:9px 10px;
    border:1px solid #e4e4f4;
    border-radius:9px;
    background:linear-gradient(90deg,#fbfaff 0%,#fff 58%);
}
.doc-complete-icon,
.doc-summary-icon{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
}
.doc-complete-icon{
    width:34px;
    height:34px;
    border-radius:8px;
    background:#f0efff;
    color:#655cc9;
}
.doc-complete-icon svg,
.doc-summary-icon svg,
.stats-kpi-icon svg{
    width:18px;
    height:18px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.8;
    stroke-linecap:round;
    stroke-linejoin:round;
}
.doc-complete-body>span{
    display:block;
    margin-bottom:1px;
    color:#485267;
    font-size:10.5px;
    font-weight:800;
}
.doc-complete-value{
    display:flex;
    align-items:baseline;
    gap:6px;
    min-width:0;
}
.doc-complete-value strong{
    color:#20293a;
    font-size:20px;
    line-height:1.05;
}
.doc-complete-value small{
    color:#8791a0;
    font-size:9.5px;
    font-weight:600;
}
.doc-progress{
    height:5px;
    margin-top:5px;
    overflow:hidden;
    border-radius:999px;
    background:#e9edf3;
}
.doc-progress i{
    display:block;
    height:100%;
    max-width:100%;
    border-radius:inherit;
    background:var(--doc-accent,#4c78d0);
}
.doc-progress-complete{height:4px;background:#ebeaf7}
.doc-progress-complete i{background:#6a63d5}

.doc-summary-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:8px;
}
.doc-summary-card{
    --doc-accent:#4c78d0;
    --doc-soft:#eff4ff;
    min-width:0;
    padding:9px 10px 8px;
    border:1px solid #e3e8ef;
    border-radius:9px;
    background:#fff;
    box-shadow:0 1px 2px rgba(16,24,40,.025);
}
.doc-summary-execution{--doc-accent:#4c78d0;--doc-soft:#edf3ff}
.doc-summary-id{--doc-accent:#2fa36a;--doc-soft:#eaf8f0}
.doc-summary-ks{--doc-accent:#d7a427;--doc-soft:#fff7db}
.doc-summary-heading{
    display:flex;
    align-items:center;
    gap:7px;
    margin-bottom:5px;
}
.doc-summary-heading h3{
    margin:0;
    color:#344054;
    font-size:11.5px;
    font-weight:850;
}
.doc-summary-icon{
    width:25px;
    height:25px;
    border-radius:7px;
    background:var(--doc-soft);
    color:var(--doc-accent);
}
.doc-summary-icon svg{width:14px;height:14px;stroke-width:1.9}
.doc-summary-primary{
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    gap:8px;
}
.doc-summary-primary span{
    color:#707b8d;
    font-size:9.5px;
    font-weight:650;
}
.doc-summary-primary strong{
    color:#273142;
    font-size:19px;
    line-height:1;
}
.doc-summary-sub{
    margin-top:1px;
    color:#98a2b3;
    font-size:8.8px;
    text-align:right;
}
.doc-summary-card .doc-progress{height:4px;margin:5px 0 6px;background:#edf0f4}
.doc-summary-statuses{
    display:flex;
    flex-wrap:wrap;
    gap:4px 8px;
    min-height:16px;
}
.doc-summary-status{
    display:inline-flex;
    align-items:center;
    gap:3px;
    color:#7c8797;
    font-size:8.8px;
    white-space:nowrap;
}
.doc-summary-status b{font-size:9.5px;color:#5b6677}
.doc-summary-status::before{
    content:'';
    width:5px;
    height:5px;
    flex:0 0 5px;
    border-radius:50%;
    background:#8ba5d8;
}
.doc-summary-status.status-prep::before{background:#6d8fcf}
.doc-summary-status.status-print::before{background:#d7a427}
.doc-summary-status.status-approval::before{background:#8b72d9}
.doc-summary-status.status-approval b{color:#7359c8}
.doc-summary-status.status-ready::before{background:#d7a427}
.doc-summary-status.status-bad::before{background:#d96776}
.doc-summary-status.status-bad b{color:#c85768}

/* KPI-карточки: компактные цветовые акценты и единая иконографика. */
.work-kpi,
.application-kpi{
    position:relative;
    overflow:hidden;
    border-color:#e2e7ee;
    box-shadow:0 1px 2px rgba(16,24,40,.03);
}
.work-kpi::before,
.application-kpi::before{
    content:'';
    position:absolute;
    left:0;
    right:0;
    top:0;
    height:2px;
    background:var(--kpi-accent,#6b7b91);
}
.work-kpi.main{--kpi-accent:#4c78d0;--kpi-soft:#eef4ff;--kpi-ink:#4c78d0}
.work-kpi.success{--kpi-accent:#2fa36a;--kpi-soft:#eaf8f0;--kpi-ink:#27915e}
.work-kpi.warning{--kpi-accent:#d5a129;--kpi-soft:#fff6da;--kpi-ink:#b88208}
.work-kpi-grid .work-kpi:nth-child(4){--kpi-accent:#d96a78;--kpi-soft:#fff0f2;--kpi-ink:#c35362}
.work-kpi.neutral{--kpi-accent:#7067ca;--kpi-soft:#f1efff;--kpi-ink:#625ab8}
.stats-kpi-top{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:6px;
}
.work-kpi .stats-kpi-top>span,
.application-kpi .stats-kpi-top>span{
    min-width:0;
    margin:0;
    color:#667085;
    font-size:9.2px;
    font-weight:650;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.stats-kpi-icon{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:22px;
    height:22px;
    flex:0 0 22px;
    border-radius:7px;
    color:var(--kpi-ink,#65748a);
    background:var(--kpi-soft,#f1f4f7);
}
.stats-kpi-icon svg{width:13px;height:13px;stroke-width:1.9}
.work-kpi strong{color:var(--kpi-ink,#344054)!important}

.stats-context-strip{
    gap:5px;
    padding:0;
    background:transparent;
}
.stats-context-strip .context-chip{
    display:inline-flex;
    align-items:center;
    gap:4px;
    min-height:22px;
    padding:3px 7px;
    border:1px solid #e5e9ef;
    border-radius:999px;
    background:#f8fafc;
    color:#667085;
    font-size:8.8px;
}
.stats-context-strip .context-chip b{color:#3f4b5e;font-size:9.5px}
.stats-context-strip .context-sub{background:#eef4ff;border-color:#dce8fb}
.stats-context-strip .context-remark{background:#fff8e8;border-color:#f3e6bc}
.stats-context-strip .context-pending{background:#f0f7ff;border-color:#dceaf9}
.stats-context-strip .context-noapp{background:#fff1f3;border-color:#f5dfe3}

.application-kpi.app-wait{--kpi-accent:#d5a129;--kpi-soft:#fff6da;--kpi-ink:#b88208}
.application-kpi.app-built{--kpi-accent:#4c78d0;--kpi-soft:#eef4ff;--kpi-ink:#4c78d0}
.application-kpi.app-overdue{--kpi-accent:#d96a78;--kpi-soft:#fff0f2;--kpi-ink:#c35362}
.application-kpi.app-received{--kpi-accent:#2fa36a;--kpi-soft:#eaf8f0;--kpi-ink:#27915e}
.application-kpi.app-average{--kpi-accent:#7067ca;--kpi-soft:#f1efff;--kpi-ink:#625ab8}
.application-kpi strong{color:var(--kpi-ink,#344054)}
.application-kpi small{margin-left:3px}

@media(max-width:1050px){
    .doc-summary-grid{grid-template-columns:1fr 1fr}
    .doc-summary-ks{grid-column:1/-1}
}
@media(max-width:760px){
    .doc-overview-card{padding:9px}
    .doc-complete-card{grid-template-columns:30px minmax(0,1fr);padding:8px}
    .doc-complete-icon{width:30px;height:30px}
    .doc-complete-value strong{font-size:18px}
    .doc-summary-grid{grid-template-columns:1fr;gap:6px}
    .doc-summary-ks{grid-column:auto}
    .doc-summary-card{padding:8px 9px}
    .doc-summary-statuses{gap:4px 7px}
    .stats-kpi-icon{width:20px;height:20px;flex-basis:20px}
    .work-kpi .stats-kpi-top>span,.application-kpi .stats-kpi-top>span{font-size:9px}
}

/* v5.151: постоянное боковое меню + расторжение ТЗ */
:root{--sidebar-w:224px;--topbar-h:54px}
body.app-shell{background:#f6f8fb;min-height:100vh}
.app-sidebar{
    position:fixed;inset:0 auto 0 0;width:var(--sidebar-w);z-index:40;
    display:flex;flex-direction:column;padding:14px 12px 16px;
    background:#fff;border-right:1px solid #e3e8ef;box-shadow:1px 0 8px rgba(16,24,40,.025);
}
.sidebar-brand-wrap{height:54px;display:flex;align-items:center;padding:0 7px 10px}
.sidebar-brand{display:flex;align-items:center;width:100%;min-width:0;text-decoration:none}
.sidebar-brand img{display:block;max-width:168px;width:100%;height:auto;object-fit:contain}
.branch-switcher{position:relative;margin:3px 0 12px}
.branch-current{
    width:100%;min-height:52px;padding:8px 10px;border:1px solid #e2e8f0;border-radius:11px;
    display:flex;align-items:center;justify-content:space-between;gap:8px;background:#f8fafc;color:#273142;text-align:left;
}
.branch-current:hover{background:#f3f7fb;border-color:#d5deea}
.branch-copy{display:flex;min-width:0;flex-direction:column;gap:1px}
.branch-copy small{font-size:9.5px;line-height:1.2;color:#8a94a5;font-weight:700;text-transform:uppercase;letter-spacing:.04em}
.branch-copy strong{font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.branch-current svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;flex:0 0 auto;transition:transform .15s ease}
.branch-current[aria-expanded="true"] svg{transform:rotate(180deg)}
.branch-menu{
    position:absolute;left:0;right:0;top:calc(100% + 5px);z-index:60;padding:6px;
    background:#fff;border:1px solid #e0e6ee;border-radius:10px;box-shadow:0 12px 28px rgba(16,24,40,.12)
}
.branch-option{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px;border-radius:7px;font-size:11px;font-weight:750;background:#eef5ff;color:#295ea8}
.branch-coming{padding:8px 7px 5px;color:#8b95a4;font-size:9px;line-height:1.35}
.sidebar-nav{display:flex!important;flex-direction:column;gap:4px!important;min-height:0;overflow:auto;padding:2px 0}
.sidebar-nav a{
    position:relative;display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:10px;
    min-height:40px;padding:8px 10px;border-radius:9px;color:#4a5870;text-decoration:none;font-size:12px;font-weight:700;line-height:1!important;
}
.sidebar-nav a:hover{background:#f4f7fb;color:#22324a}
.sidebar-nav a.active{background:#eaf2ff;color:#1767d9}
.sidebar-nav a svg{width:18px;height:18px;flex:0 0 18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.sidebar-divider{height:1px;background:#edf0f4;margin:6px 8px}
.sidebar-badge{margin-left:auto;display:grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:#e65061;color:#fff;font-size:9px}
.app-topbar{
    position:fixed;top:0;left:var(--sidebar-w);right:0;height:var(--topbar-h);z-index:30;
    display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 22px;
    background:rgba(255,255,255,.96);border-bottom:1px solid #e6eaf0;backdrop-filter:blur(8px)
}
.sidebar-toggle{display:none;width:38px;height:38px;padding:0;border:1px solid #dde4ec;border-radius:9px;background:#fff;color:#40516b}
.sidebar-toggle svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.topbar-branch{min-width:0;color:#7a8597;font-size:11px;font-weight:700}
.topbar-user{margin-left:auto;display:flex;align-items:center;gap:12px;font-size:11px}
.topbar-user .user-name{color:#31425c;font-weight:750;text-decoration:none}
.topbar-user .logout-link{color:#7b8798;text-decoration:none}
.topbar-user a:hover{color:#1f6feb}
.app-main{margin-left:var(--sidebar-w);padding:calc(var(--topbar-h) + 14px) 18px 42px;min-height:100vh}
.app-content{width:100%;max-width:1500px;margin:0 auto}
.app-content>.page-heading:first-child,.app-content>.page-topbar:first-child{margin-top:0}
.sidebar-overlay{display:none}
.guest-header{background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:10}
.guest-head{height:62px;display:flex;align-items:center}
.guest-head .brand-logo img{max-height:38px;width:auto}

/* Карточка расторжения. */
.object-title-line{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.object-title-line h1{margin-bottom:0}
.termination-badge{display:inline-flex;align-items:center;gap:5px;padding:5px 9px;border-radius:999px;background:#fff0f2;color:#c9344e;font-size:10px;font-weight:800;border:1px solid #f6d4da}
.termination-badge::before{content:'!';display:grid;place-items:center;width:14px;height:14px;border:1.5px solid currentColor;border-radius:50%;font-size:9px;line-height:1}
.termination-card{padding:12px 14px;margin:10px 0;border-color:#e6eaf0;background:#fff}
.termination-card.active{border-color:#f2c9d0;background:linear-gradient(90deg,#fff7f8 0%,#fff 70%)}
.termination-head{display:flex;align-items:flex-start;gap:9px;margin-bottom:9px}
.termination-head h2{margin:0 0 1px;font-size:14px}
.termination-head p{margin:0;font-size:9.5px}
.termination-icon{display:grid;place-items:center;width:28px;height:28px;flex:0 0 28px;border-radius:8px;background:#fff1f3;color:#d83f57}
.termination-icon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.termination-form{display:grid;grid-template-columns:minmax(150px,.7fr) minmax(210px,1fr) auto;gap:10px;align-items:end}
.termination-check{height:39px;display:flex;flex-direction:row;align-items:center;gap:8px;padding:0 10px;border:1px solid #e1e6ec;border-radius:8px;background:#fff;cursor:pointer}
.termination-check input{width:17px;height:17px;margin:0;accent-color:#2563eb;flex:0 0 auto}
.termination-check span{font-size:11.5px;font-weight:750}
.termination-date-label{gap:4px;font-size:9.5px;color:#68758a}
.termination-date-label input{height:39px;padding:7px 10px;font-size:11px}
.termination-date-label input:disabled{background:#f4f6f8;color:#a1a9b5}
.termination-save{height:39px;padding:0 14px}
.termination-card.active .termination-save{border-color:#e2b8c0;color:#a33d4e;background:#fff}
.termination-saved{margin:7px 0 0;color:#2f855a}
.termination-readonly{display:flex;align-items:center;gap:10px;padding:7px 10px;border-radius:8px;background:#fff;border:1px solid #f0d8dd;font-size:11px}
.termination-readonly b{color:#c9344e}.termination-readonly span{color:#667085}

/* Архив расторгнутых в списке ТЗ. */
.dashboard-table tr.terminated-row td{background:#fffafb}
.dashboard-table tr.terminated-row:hover td{background:#fff5f7}
.tz-terminated-tag{display:inline-flex;margin-left:5px;padding:2px 5px;border-radius:999px;background:#fff0f2;color:#c53b51;font-size:8px;font-weight:800;vertical-align:middle;border:1px solid #f2d4da}

@media(max-width:980px){
    :root{--sidebar-w:220px}
    .app-sidebar{transform:translateX(-102%);transition:transform .18s ease;box-shadow:8px 0 28px rgba(16,24,40,.14)}
    .app-sidebar.open{transform:translateX(0)}
    .app-topbar{left:0;padding:0 12px}
    .sidebar-toggle{display:grid;place-items:center;flex:0 0 38px}
    .app-main{margin-left:0;padding:calc(var(--topbar-h) + 10px) 10px 34px}
    .sidebar-overlay{position:fixed;inset:0;z-index:35;background:rgba(15,23,42,.28);display:block}
    .sidebar-overlay[hidden]{display:none}
    body.sidebar-open{overflow:hidden}
    .topbar-branch{display:block}
}
@media(max-width:700px){
    .app-topbar{height:50px}.app-main{padding-top:60px}
    .topbar-user{gap:8px}.topbar-user .user-name{max-width:135px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
    .termination-card{padding:11px}
    .termination-form{grid-template-columns:1fr}
    .termination-check{height:40px}
    .termination-date-label input,.termination-save{height:40px}
}

/* v5.152: облегчённая статистика — меньше карточек и рамок, больше воздуха. */
#stats-zone-overall.stats-zone-card{
    padding:10px 12px 12px;
    border-color:#e8edf3;
    background:#fff;
    box-shadow:0 1px 3px rgba(16,24,40,.025);
}
#stats-zone-overall .stats-zone-title{margin-bottom:6px}
#stats-zone-overall .stats-zone-filter{margin-bottom:6px}
#stats-zone-overall .stats-scope-line{margin:1px 0 7px}

#stats-zone-overall .doc-overview-card{
    margin:0;
    padding:8px 0 14px;
    border:0;
    border-bottom:1px solid #e7ebf1;
    border-radius:0;
    background:transparent;
    box-shadow:none;
}
#stats-zone-overall .doc-stats-head{
    align-items:center;
    margin:0 0 8px;
    padding:0 2px;
}
.stats-title-with-icon{display:flex;align-items:center;gap:9px;min-width:0}
.stats-title-with-icon>div{min-width:0}
.stats-section-icon{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:31px;
    height:31px;
    flex:0 0 31px;
    border-radius:8px;
    color:#65748a;
    background:#f3f6fa;
}
.stats-section-icon svg{
    width:17px;
    height:17px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.85;
    stroke-linecap:round;
    stroke-linejoin:round;
}
.stats-section-icon-doc{color:#665bd2;background:#f2f0ff}
.stats-section-icon-work{color:#1f6feb;background:#edf4ff}
.stats-section-icon-app{color:#d39a0b;background:#fff7df}
#stats-zone-overall .doc-stats-head h2,
#stats-zone-overall .stats-section-heading h2{font-size:14px;line-height:1.15}
#stats-zone-overall .doc-stats-head p,
#stats-zone-overall .stats-section-heading p{font-size:9.5px;line-height:1.35;color:#7d8797}
#stats-zone-overall .doc-stats-total{
    display:flex;
    align-items:baseline;
    gap:6px;
    padding:5px 8px;
    border:0;
    background:#f7f9fc;
}
#stats-zone-overall .doc-stats-total span{font-size:9.5px}
#stats-zone-overall .doc-stats-total b{font-size:17px}

.doc-flat-grid{
    display:grid;
    grid-template-columns:1.18fr 1fr 1fr 1fr;
    align-items:stretch;
}
.doc-flat-item{
    --doc-accent:#4c78d0;
    --doc-soft:#eef4ff;
    min-width:0;
    padding:4px 13px 3px;
    background:transparent;
}
.doc-flat-item+ .doc-flat-item{border-left:1px solid #e6eaf0}
.doc-flat-complete{--doc-accent:#6b61d5;--doc-soft:#f1efff}
.doc-flat-grid .doc-summary-execution{--doc-accent:#4c78d0;--doc-soft:#edf3ff}
.doc-flat-grid .doc-summary-id{--doc-accent:#2fa36a;--doc-soft:#eaf8f0}
.doc-flat-grid .doc-summary-ks{--doc-accent:#d7a427;--doc-soft:#fff7db}
.doc-flat-item .doc-summary-heading{margin-bottom:4px;gap:7px}
.doc-flat-item .doc-summary-heading h3{font-size:10.8px;color:#344054}
.doc-flat-item .doc-summary-icon{width:27px;height:27px;border-radius:7px}
.doc-flat-item .doc-summary-icon svg{width:14px;height:14px}
.doc-flat-value{display:flex;align-items:baseline;gap:6px;min-width:0;margin-top:1px}
.doc-flat-value strong{font-size:21px;line-height:1;color:#263044}
.doc-flat-value small{font-size:9px;color:#8b95a5;font-weight:600;white-space:nowrap}
.doc-flat-item .doc-progress{height:4px;margin:6px 0 6px;background:#edf0f4}
.doc-flat-complete .doc-progress{background:#eceaf9}
.doc-flat-item .doc-summary-statuses{gap:4px 9px;min-height:14px}
.doc-flat-item .doc-summary-status{font-size:8.7px}
.doc-flat-item .doc-summary-status b{font-size:9.3px}

#stats-zone-overall .stats-section-block{
    margin:0;
    padding:14px 2px 12px;
    border-bottom:1px solid #e7ebf1;
}
#stats-zone-overall .stats-section-block:last-child{border-bottom:0;padding-bottom:4px}
#stats-zone-overall .stats-section-heading{
    align-items:center;
    margin:0 0 9px;
}
#stats-zone-overall .stats-section-heading-with-context{align-items:center}
#stats-zone-overall .stats-context-strip{
    display:flex;
    flex-wrap:wrap;
    justify-content:flex-end;
    gap:0;
    margin:0;
    padding:0;
    background:transparent;
}
#stats-zone-overall .stats-context-strip .context-chip{
    min-height:auto;
    padding:0 8px;
    border:0;
    border-right:1px solid #e1e6ec;
    border-radius:0;
    background:transparent!important;
    font-size:8.8px;
    color:#778294;
}
#stats-zone-overall .stats-context-strip .context-chip:last-child{border-right:0;padding-right:0}
#stats-zone-overall .stats-context-strip .context-chip b{font-size:9.3px;color:#344054}
#stats-zone-overall .stats-context-strip .context-noapp b{color:#c85768}

#stats-zone-overall .work-kpi-grid,
#stats-zone-overall .application-kpi-grid{
    gap:0;
}
#stats-zone-overall .work-kpi,
#stats-zone-overall .application-kpi{
    display:grid;
    grid-template-columns:34px minmax(0,1fr);
    grid-template-rows:auto auto auto;
    column-gap:8px;
    align-content:center;
    min-height:72px;
    padding:5px 13px;
    overflow:visible;
    border:0;
    border-radius:0;
    background:transparent;
    box-shadow:none;
}
#stats-zone-overall .work-kpi+ .work-kpi,
#stats-zone-overall .application-kpi+ .application-kpi{border-left:1px solid #e5e9ef}
#stats-zone-overall .work-kpi::before,
#stats-zone-overall .application-kpi::before{display:none}
#stats-zone-overall .stats-kpi-top{display:contents}
#stats-zone-overall .work-kpi .stats-kpi-top>span,
#stats-zone-overall .application-kpi .stats-kpi-top>span{
    grid-column:2;
    grid-row:1;
    align-self:end;
    color:#647084;
    font-size:9.3px;
    line-height:1.2;
}
#stats-zone-overall .stats-kpi-icon{
    grid-column:1;
    grid-row:1/4;
    align-self:start;
    width:30px;
    height:30px;
    margin-top:1px;
    border-radius:8px;
}
#stats-zone-overall .stats-kpi-icon svg{width:15px;height:15px}
#stats-zone-overall .work-kpi strong,
#stats-zone-overall .application-kpi strong{
    grid-column:2;
    grid-row:2;
    align-self:center;
    margin:3px 0 0;
    font-size:22px;
    line-height:1;
}
#stats-zone-overall .work-kpi small,
#stats-zone-overall .application-kpi small{
    grid-column:2;
    grid-row:3;
    display:block;
    margin:2px 0 0;
    color:#9099a8;
    font-size:8.8px;
    line-height:1.2;
}

@media(max-width:1180px){
    .doc-flat-grid{grid-template-columns:1fr 1fr}
    .doc-flat-item:nth-child(3){border-left:0}
    .doc-flat-item:nth-child(n+3){border-top:1px solid #e6eaf0;padding-top:9px;margin-top:5px}
    #stats-zone-overall .stats-section-heading-with-context{align-items:flex-start;flex-direction:column}
    #stats-zone-overall .stats-context-strip{justify-content:flex-start;padding-left:40px}
}
@media(max-width:900px){
    #stats-zone-overall .work-kpi-grid,#stats-zone-overall .application-kpi-grid{grid-template-columns:1fr 1fr}
    #stats-zone-overall .work-kpi:nth-child(odd),#stats-zone-overall .application-kpi:nth-child(odd){border-left:0}
    #stats-zone-overall .work-kpi:nth-child(n+3),#stats-zone-overall .application-kpi:nth-child(n+3){border-top:1px solid #e5e9ef}
}
@media(max-width:760px){
    #stats-zone-overall.stats-zone-card{padding:9px}
    .doc-flat-grid{grid-template-columns:1fr}
    .doc-flat-item{padding:8px 4px}
    .doc-flat-item+ .doc-flat-item{border-left:0;border-top:1px solid #e6eaf0;margin-top:0}
    #stats-zone-overall .stats-context-strip{padding-left:0;gap:4px 0}
    #stats-zone-overall .stats-context-strip .context-chip{padding:0 6px}
    #stats-zone-overall .work-kpi-grid,#stats-zone-overall .application-kpi-grid{grid-template-columns:1fr}
    #stats-zone-overall .work-kpi+ .work-kpi,#stats-zone-overall .application-kpi+ .application-kpi{border-left:0;border-top:1px solid #e5e9ef}
    #stats-zone-overall .work-kpi,#stats-zone-overall .application-kpi{min-height:66px;padding:7px 4px}
}

/* v5.153: дата сдачи АДПУ хранится и редактируется прямо в карточке ТЗ. */
.adpu-date-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin:2px 0 10px;
    padding:8px 0;
    border-top:1px solid #eef1f5;
    border-bottom:1px solid #eef1f5;
}
.adpu-date-title{display:flex;align-items:center;gap:8px;min-width:0}
.adpu-date-title>div{display:grid;gap:1px}
.adpu-date-title b{font-size:11.5px;color:#344054}
.adpu-date-title small{font-size:9.5px;color:#98a2b3}
.adpu-date-icon{display:grid;place-items:center;width:28px;height:28px;flex:0 0 28px;border-radius:8px;background:#f2f6ff;color:#2f6fed}
.adpu-date-icon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.adpu-date-row.is-closed .adpu-date-icon{background:#edf9f2;color:#15965f}
.adpu-date-row.is-closed .adpu-date-title small{color:#15965f}
.adpu-date-form{display:flex;align-items:center;justify-content:flex-end;gap:7px;margin:0}
.adpu-date-form input[type="date"]{height:34px;min-width:150px;padding:6px 9px;font-size:10.5px}
.adpu-date-form .button{height:34px;padding:0 10px}
.adpu-date-saved{font-size:9.5px;font-weight:700;color:#15965f;white-space:nowrap}
.adpu-date-readonly{font-size:11px;color:#344054}
@media(max-width:700px){
    .adpu-date-row{align-items:stretch;flex-direction:column;gap:7px}
    .adpu-date-form{justify-content:stretch}
    .adpu-date-form input[type="date"]{min-width:0;flex:1}
}

/* v5.154: облегчённая статистика монтажников, компактный фильтр и ровные легенды документов. */
#stats-zone-installers.installer-zone-card{
    padding:10px 12px 12px;
    border-color:#e8edf3;
    background:#fff;
    box-shadow:0 1px 3px rgba(16,24,40,.025);
}
#stats-zone-installers .installer-zone-title{margin-bottom:7px}
#stats-zone-installers .installer-zone-filter{
    padding:0;
    margin:0 0 9px;
    border:0;
    background:transparent;
    box-shadow:none;
}
.installer-filter-row{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:6px 10px;
}
#stats-zone-installers .installer-presets{
    display:flex;
    flex-wrap:wrap;
    gap:5px;
    margin:0;
}
#stats-zone-installers .installer-presets .button{
    min-height:30px;
    height:30px;
    padding:5px 9px;
    font-size:10.5px;
    border-radius:7px;
}
#stats-zone-installers .installer-date-form{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:5px;
    margin:0;
}
#stats-zone-installers .installer-date-form label{
    display:flex;
    align-items:center;
    gap:5px;
    margin:0;
    color:#475467;
    font-size:10.5px;
    font-weight:700;
}
#stats-zone-installers .installer-date-form input[type="date"]{
    width:142px;
    min-width:142px;
    height:30px;
    min-height:30px;
    padding:4px 7px;
    font-size:10.5px;
}
#stats-zone-installers .installer-date-form .primary,
#stats-zone-installers .installer-date-form .installer-reset{
    width:auto;
    height:30px;
    min-height:30px;
    padding:0 10px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-size:10.5px;
    line-height:1;
}
#stats-zone-installers .installer-reset{background:#fff}

.installer-kpi-strip{
    display:grid;
    grid-template-columns:repeat(6,minmax(0,1fr));
    gap:0;
    margin:2px 0 12px;
    padding:6px 0 10px;
    border-bottom:1px solid #e7ebf1;
}
.installer-kpi{
    --installer-accent:#4c78d0;
    --installer-soft:#eef4ff;
    display:grid;
    grid-template-columns:34px minmax(0,1fr);
    gap:8px;
    align-items:center;
    min-height:58px;
    padding:4px 13px;
}
.installer-kpi+ .installer-kpi{border-left:1px solid #e5e9ef}
.installer-kpi i{
    display:grid;
    place-items:center;
    width:30px;
    height:30px;
    border-radius:8px;
    color:var(--installer-accent);
    background:var(--installer-soft);
}
.installer-kpi i svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.85;stroke-linecap:round;stroke-linejoin:round}
.installer-kpi div{min-width:0}
.installer-kpi span{display:block;color:#6b7688;font-size:9.4px;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.installer-kpi strong{display:block;margin-top:3px;font-size:22px;line-height:1;color:var(--installer-accent)}
.installer-kpi-tz{--installer-accent:#2f6fed;--installer-soft:#edf4ff}
.installer-kpi-adpu{--installer-accent:#26965f;--installer-soft:#eaf8f0}
.installer-kpi-previous{--installer-accent:#6f63d8;--installer-soft:#f1efff}
.installer-kpi-noapp{--installer-accent:#c98a00;--installer-soft:#fff6da}
.installer-kpi-remarks{--installer-accent:#d65b6b;--installer-soft:#fff0f2}

.installer-table-section{padding:0 2px}
.installer-table-heading{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin:0 0 8px;
}
.installer-table-heading h2{margin:0;font-size:14px;line-height:1.15}
.installer-table-heading p{margin:2px 0 0;color:#7d8797;font-size:9.5px;line-height:1.3}
.installer-search{
    display:flex;
    flex-direction:row;
    align-items:center;
    gap:6px;
    min-width:220px;
    height:31px;
    padding:0 8px;
    border:1px solid #dce3ec;
    border-radius:8px;
    background:#fff;
    color:#98a2b3;
    font-weight:400;
}
.installer-search>span{
    flex:0 0 auto;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:14px;
    height:14px;
    line-height:1;
}
.installer-search input{
    flex:1 1 auto;
    width:auto;
    min-width:0;
    height:29px!important;
    min-height:0!important;
    padding:0!important;
    margin:0;
    border:0;
    border-radius:0;
    outline:0;
    background:transparent;
    font-size:10.5px;
    line-height:29px;
    font-weight:400;
}
.installer-modern-table{min-width:1040px;border-collapse:separate;border-spacing:0}
.installer-modern-table th,
.installer-modern-table td{padding:6px 8px;font-size:10.2px;vertical-align:middle}
.installer-modern-table thead th{background:#f8fafc;color:#677386;font-weight:800;white-space:nowrap}
.installer-summary-row td{border-top:1px solid #eef1f5}
.installer-summary-row:first-of-type td{border-top:0}
.installer-name{color:#1f6feb;font-weight:800}
.installer-expand-button{
    width:18px;
    height:18px;
    margin:0 4px 0 -2px;
    padding:0;
    border:0;
    background:transparent;
    color:#667085;
    font-size:18px;
    line-height:18px;
    cursor:pointer;
    transform:rotate(0deg);
    transition:transform .12s ease,color .12s ease;
    vertical-align:-1px;
}
.installer-expand-button.is-open{transform:rotate(90deg);color:#1f6feb}
.installer-modern-table .stat-main,
.installer-modern-table .stat-rate{color:#1f6feb;font-weight:800}
.stat-bad{color:#c85768!important;font-weight:800}
.installer-detail-row td{padding:0 8px 8px;background:#fbfcfe}
.installer-detail-table-wrap{overflow-x:auto;padding:5px 0 0 24px}
.installer-detail-table{width:100%;min-width:840px;border-collapse:collapse}
.installer-detail-table th,
.installer-detail-table td{padding:5px 7px;border-bottom:1px solid #eef1f5;font-size:9.7px;text-align:left;vertical-align:top}
.installer-detail-table th{color:#7b8697;background:#f8fafc;font-weight:800;white-space:nowrap}
.installer-detail-table td a{color:#1f6feb;text-decoration:none;font-weight:800}
.installer-detail-table td:last-child{min-width:220px}

/* Число и подпись легенды документов выровнены по центру цветной точки. */
.doc-summary-status{
    align-items:center;
    line-height:1;
}
.doc-summary-status::before{align-self:center;margin:0}
.doc-summary-status b{display:inline-flex;align-items:center;line-height:1}

@media(max-width:1180px){
    .installer-kpi-strip{grid-template-columns:repeat(3,minmax(0,1fr))}
    .installer-kpi:nth-child(4){border-left:0;border-top:1px solid #e5e9ef}
    .installer-kpi:nth-child(5),
    .installer-kpi:nth-child(6){border-top:1px solid #e5e9ef}
    .installer-table-heading{align-items:flex-start;flex-direction:column}
    .installer-search{width:100%;min-width:0}
}
@media(max-width:760px){
    #stats-zone-installers.installer-zone-card{padding:9px}
    .installer-filter-row{align-items:flex-start;flex-direction:column}
    #stats-zone-installers .installer-presets{width:100%;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
    #stats-zone-installers .installer-presets::-webkit-scrollbar{display:none}
    #stats-zone-installers .installer-date-form{width:100%}
    #stats-zone-installers .installer-date-form label{flex:1 1 145px}
    #stats-zone-installers .installer-date-form input[type="date"]{width:100%;min-width:0}
    .installer-kpi-strip{grid-template-columns:1fr 1fr}
    .installer-kpi:nth-child(odd){border-left:0}
    .installer-kpi:nth-child(n+3){border-top:1px solid #e5e9ef}
}
@media(max-width:520px){
    .installer-kpi-strip{grid-template-columns:1fr}
    .installer-kpi+ .installer-kpi{border-left:0;border-top:1px solid #e5e9ef}
    #stats-zone-installers .installer-date-form .primary,
    #stats-zone-installers .installer-date-form .installer-reset{flex:1 1 100px}
}

/* v5.155: единый компактный фильтр периода для документов, монтажников и детализации. */
.stats-inline-filter-row{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:6px 10px;
}
.stats-inline-filter-row .stats-inline-presets{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:5px;
    margin:0;
}
.stats-inline-filter-row .stats-inline-presets .button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    height:30px;
    min-height:30px;
    padding:5px 9px;
    border-radius:7px;
    font-size:10.5px;
    line-height:1;
    white-space:nowrap;
}
.stats-inline-date-form{
    display:flex!important;
    grid-template-columns:none!important;
    align-items:center!important;
    flex-wrap:nowrap;
    gap:5px;
    margin:0;
}
.stats-inline-date-form label{
    display:inline-flex!important;
    grid-template-rows:none!important;
    flex-direction:row!important;
    align-items:center!important;
    gap:4px!important;
    min-width:0;
    margin:0!important;
    color:#475467;
    font-size:10.5px;
    font-weight:700;
    line-height:1;
    white-space:nowrap;
}
.stats-inline-date-form label>span{
    display:inline-block;
    min-width:auto;
    margin:0;
    line-height:30px;
}
.stats-inline-date-form input[type="date"]{
    box-sizing:border-box;
    width:136px!important;
    min-width:136px!important;
    max-width:136px;
    height:30px!important;
    min-height:30px!important;
    padding:4px 7px;
    font-size:10.5px;
    font-variant-numeric:tabular-nums;
    line-height:1;
}
.stats-inline-date-form .primary,
.stats-inline-date-form .stats-inline-reset{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:auto!important;
    height:30px!important;
    min-height:30px!important;
    padding:0 10px;
    font-size:10.5px;
    line-height:1;
    white-space:nowrap;
    align-self:center!important;
}
.stats-inline-date-form .stats-inline-reset{background:#fff}

/* Все три фильтра используют одну геометрию; старые локальные правила монтажников не меняют строку дат. */
#stats-zone-installers .stats-inline-date-form label{
    display:inline-flex!important;
    flex-direction:row!important;
    align-items:center!important;
}
#stats-zone-installers .stats-inline-date-form input[type="date"]{
    width:136px!important;
    min-width:136px!important;
    max-width:136px!important;
}

@media(max-width:1080px){
    .stats-inline-filter-row{align-items:flex-start}
    .stats-inline-date-form{flex-wrap:wrap}
}
@media(max-width:760px){
    .stats-inline-filter-row{align-items:flex-start;flex-direction:column}
    .stats-inline-filter-row .stats-inline-presets{
        width:100%;
        flex-wrap:nowrap;
        overflow-x:auto;
        scrollbar-width:none;
    }
    .stats-inline-filter-row .stats-inline-presets::-webkit-scrollbar{display:none}
    .stats-inline-date-form{width:100%;flex-wrap:wrap}
    .stats-inline-date-form label{flex:1 1 150px}
    .stats-inline-date-form input[type="date"]{
        width:100%!important;
        min-width:0!important;
        max-width:none!important;
        flex:1 1 auto;
    }
}
@media(max-width:520px){
    .stats-inline-date-form label{flex:1 1 100%}
    .stats-inline-date-form .primary,
    .stats-inline-date-form .stats-inline-reset{flex:1 1 110px}
}

/* v5.156: поиск по монтажникам не наследует вертикальную геометрию обычного label/input. */
.installer-search input::placeholder{color:#98a2b3;opacity:1}

/* v5.157: выравнивание чисел и подписей в легенде документов */
.doc-summary-statuses{align-items:center}
.doc-summary-status{
  display:inline-flex;
  align-items:center;
  gap:4px;
  line-height:1.1;
}
.doc-summary-status::before{align-self:center;margin:0}
.doc-summary-status b,
.doc-summary-status span{display:inline-flex;align-items:center;line-height:1.1}
.doc-summary-status b{min-width:22px;justify-content:flex-start}

/* v5.158: оптическое центрирование KPI-иконок относительно подписи и числа */
#stats-zone-overall .stats-kpi-icon{
    align-self:center;
    margin-top:0;
}
.installer-kpi i{
    align-self:center;
    transform:translateY(2px);
}
.installer-kpi div{
    display:flex;
    flex-direction:column;
    justify-content:center;
    min-height:34px;
}

/* v5.159: точное центрирование KPI и легенд статистики */
/* Документы: точка центрируется по строке, число и подпись сидят на одной базовой линии. */
.doc-summary-statuses{
    display:flex;
    align-items:center;
}
.doc-summary-status{
    position:relative;
    display:inline-flex;
    align-items:baseline;
    gap:3px;
    padding-left:9px;
    line-height:12px;
    vertical-align:middle;
}
.doc-summary-status::before{
    position:absolute;
    left:0;
    top:50%;
    margin:0;
    transform:translateY(-50%);
}
.doc-summary-status b,
.doc-summary-status span{
    display:inline;
    min-width:0;
    line-height:12px;
    vertical-align:baseline;
}
.doc-summary-status b{
    font-variant-numeric:tabular-nums;
}

/* Выполненные работы и Заявки: иконка центрируется именно по крупному числу. */
#stats-zone-overall .stats-kpi-icon{
    grid-column:1;
    grid-row:2;
    align-self:center!important;
    justify-self:start;
    margin:0!important;
    transform:none!important;
}
#stats-zone-overall .work-kpi .stats-kpi-top>span,
#stats-zone-overall .application-kpi .stats-kpi-top>span{
    align-self:end;
}
#stats-zone-overall .work-kpi strong,
#stats-zone-overall .application-kpi strong{
    align-self:center;
    margin-top:0;
}

/* Монтажники и СУБ: подпись над числом, иконка строго по центру крупного числа. */
.installer-kpi{
    grid-template-columns:34px minmax(0,1fr);
    grid-template-rows:auto auto;
    column-gap:8px;
    row-gap:1px;
    align-items:center;
}
.installer-kpi>div{
    display:contents!important;
    min-height:0!important;
}
.installer-kpi>div>span{
    grid-column:2;
    grid-row:1;
    align-self:end;
    margin:0;
    line-height:1.15;
}
.installer-kpi>div>strong{
    grid-column:2;
    grid-row:2;
    align-self:center;
    margin:0;
    line-height:1;
    font-variant-numeric:tabular-nums;
}
.installer-kpi>i{
    grid-column:1;
    grid-row:2;
    align-self:center!important;
    justify-self:start;
    margin:0!important;
    transform:none!important;
}

/* v5.160: единый размер основных заголовков и ключ у блока монтажников */
#stats-zone-overall .doc-stats-head h2{
    font-size:16px;
    line-height:1.15;
}
#stats-zone-installers .installer-zone-title h2{
    font-size:16px;
    line-height:1.15;
    margin:0;
}
#stats-zone-installers .installer-zone-title p{
    margin:2px 0 0;
}


/* v5.162: полноценный ключ и подсветка поиска монтажников по контуру */
.installer-search{transition:border-color .15s ease, box-shadow .15s ease}
.installer-search:focus-within{border-color:#8ab4ff; box-shadow:0 0 0 2px rgba(31,111,235,.16)}
.installer-search input:focus{outline:none; box-shadow:none}
.stats-section-icon-work svg{stroke:none; fill:currentColor}


/* v5.163: компактные двухстрочные заголовки детализации монтажника; № ТЗ всегда целиком */
.installer-detail-table th{
  vertical-align:middle;
  line-height:1.12;
}
.installer-detail-table .th-two-line{
  display:inline-block;
  line-height:1.12;
  white-space:normal;
}
.installer-detail-table .tz-nowrap{
  white-space:nowrap!important;
  min-width:78px;
}
.installer-detail-table td.tz-nowrap a{white-space:nowrap}

/* v5.164: общая таблица монтажников — типографика как в таблице "По дням" и центрирование */
.installer-modern-table th{
    font-size:8.5px;
    color:#667085;
    background:#f7f9fc;
    font-weight:700;
    line-height:1.15;
}
.installer-modern-table td{
    font-size:13px;
    line-height:1.15;
}
.installer-modern-table th:first-child,
.installer-modern-table td:first-child{
    text-align:left;
}
.installer-modern-table th:not(:first-child),
.installer-modern-table td:not(:first-child){
    text-align:center;
}
.installer-modern-table td:not(:first-child){
    font-variant-numeric:tabular-nums;
}
.installer-modern-table .installer-name{
    font-size:13px;
}

/* v5.165: крупный текст только в общей таблице; детализация возвращена к компактному размеру. Заголовки без жирного. */
.installer-modern-table > thead > tr > th{
    font-size:8.5px;
    font-weight:400;
    line-height:1.15;
}
.installer-modern-table > tbody > tr > td{
    font-size:13px;
    line-height:1.15;
}
.installer-modern-table > tbody > tr > td:not(:first-child){
    text-align:center;
    font-variant-numeric:tabular-nums;
}
.installer-detail-table th,
.installer-detail-table td{
    font-size:9.7px;
    line-height:1.12;
}
.installer-detail-table th{
    font-weight:400;
}

/* v5.166: тонкие заголовки детализации и более компактная общая таблица монтажников */
.installer-detail-table thead th,
.installer-detail-table thead th .th-two-line{
    font-weight:400!important;
}
.installer-modern-table > tbody > tr > td{
    font-size:11.5px;
    line-height:1.15;
}
.installer-modern-table .installer-name{
    font-size:11.5px;
}

/* v5.167: адрес в детализации монтажника читается слева */
.installer-detail-table th:last-child,
.installer-detail-table td:last-child{
    text-align:left!important;
}


/* v5.168: пояснение единиц учёта АДПУ в блоке монтажников */
.installer-kpi{grid-template-rows:auto auto auto}
.installer-kpi>div>small{
  grid-column:2;
  grid-row:3;
  display:block;
  margin-top:2px;
  color:#98a2b3;
  font-size:8.3px;
  line-height:1.15;
  white-space:nowrap;
}
.installer-kpi>i{grid-row:2}


/* v5.171/v5.224: компактный переключатель «Напряжение подано» как у субподряда */
.voltage-supplied-row{margin:0 0 12px}
.voltage-supplied-check{
  display:inline-flex;align-items:center;gap:7px;flex-wrap:wrap;
  padding:6px 9px;border:1px solid var(--line);border-radius:8px;
  background:#f8fafc;cursor:pointer;user-select:none;line-height:1;
}
.voltage-supplied-check input{width:15px;height:15px;margin:0;accent-color:#1f6feb;flex:0 0 15px}
.voltage-supplied-check span{font-weight:800;font-size:12px;line-height:1.1}
.voltage-supplied-check small{font-size:10px;color:var(--muted);font-weight:600;line-height:1.15;flex-basis:100%;padding-left:22px}
.voltage-supplied-check.active{background:#eef6ff;border-color:#b9d5ff}
.voltage-supplied-check.active span{color:#125cc8}

/* v5.174: спокойная визуальная полировка без изменения функционала */
/* 1) Единая иерархия заголовков и отступов статистики. */
#stats-zone-overall .doc-stats-head h2,
#stats-zone-overall .stats-section-heading h2,
#stats-zone-installers .installer-zone-title h2,
#stats-zone-installers .installer-table-heading h2{
    font-size:15px;
    line-height:1.2;
    font-weight:700;
}
#stats-zone-overall .doc-stats-head p,
#stats-zone-overall .stats-section-heading p,
#stats-zone-installers .installer-zone-title p,
#stats-zone-installers .installer-table-heading p{
    margin-top:2px;
    color:#7d8797;
    line-height:1.35;
}
#stats-zone-overall .doc-stats-head,
#stats-zone-overall .stats-section-heading,
#stats-zone-installers .installer-zone-title,
#stats-zone-installers .installer-table-heading{
    min-height:34px;
}
#stats-zone-overall .stats-section-block{padding-top:13px;padding-bottom:13px}
#stats-zone-installers .installer-kpi-strip{margin-top:7px;margin-bottom:9px}

/* 2) Меньше визуального шума в таблицах: заголовки обычного начертания,
      жирным остаются только действительно важные значения и имена. */
.stats-table thead th,
.installer-modern-table > thead > tr > th,
.installer-detail-table thead th,
.installer-detail-table thead th .th-two-line{
    font-weight:400!important;
    color:#667085;
}
.stats-table tbody td{font-weight:400}
.installer-modern-table .installer-name,
.installer-summary-table .installer-name,
.installer-detail-table .tz-nowrap a{
    font-weight:600!important;
}
.installer-modern-table td b,
.installer-modern-table td strong,
.installer-detail-table td b,
.installer-detail-table td strong{
    font-weight:600;
}

/* 3) Карточка ТЗ: чуть больше воздуха между смысловыми строками,
      без увеличения общей крупности интерфейса. */
.two-col{gap:16px}
.two-col .card{padding:17px 18px}
.two-col .card dl{row-gap:9px;column-gap:14px}
.two-col .card dt{line-height:1.35}
.two-col .card dd{line-height:1.35}
.card-heading-inline{margin-bottom:9px}
.adpu-date-row{margin-bottom:12px}

/* 4) Единая геометрия компактных фильтров и поиска. */
.stats-inline-date-form input[type="date"],
.installer-search{
    height:31px;
    border-radius:8px;
}
.installer-search{min-height:31px}
.stats-inline-date-form label{gap:3px}
.stats-inline-date-form label>span{line-height:1}

/* 5) Мобильный вид: фильтры не зажимаются, таблицы остаются прокручиваемыми. */
@media(max-width:700px){
    #stats-zone-overall .stats-section-heading,
    #stats-zone-installers .installer-zone-title,
    #stats-zone-installers .installer-table-heading{
        min-height:0;
    }
    .stats-inline-filter-row{align-items:stretch}
    .stats-inline-date-form{width:100%}
    .stats-inline-date-form label{min-width:0}
    .installer-search{width:100%;min-width:0}
    .stats-table-wrap,
    .table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
    .two-col{gap:10px}
    .two-col .card{padding:14px}
    .two-col .card dl{grid-template-columns:115px minmax(0,1fr);column-gap:10px}
}
@media(max-width:520px){
    .two-col .card dl{grid-template-columns:1fr;row-gap:4px}
    .two-col .card dt{margin-top:6px}
}


/* v5.175: каска + ключ для блока Монтажники и СУБ */
.stats-section-icon-installers{color:#1f6feb;background:#edf4ff}
.stats-section-icon-installers svg{
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

/* v5.179: выравнивание KPI в блоке монтажников; подпись под АДПУ не должна сдвигать число и иконку */
.installer-kpi{
    grid-template-columns:34px minmax(0,1fr);
    grid-template-rows:12px 24px 12px;
    column-gap:8px;
    row-gap:1px;
    align-items:stretch;
    align-content:center;
    min-height:60px;
}
.installer-kpi>div>span{
    grid-column:2;
    grid-row:1;
    align-self:end;
}
.installer-kpi>div>strong{
    grid-column:2;
    grid-row:2;
    align-self:center;
    line-height:1;
}
.installer-kpi>div>small{
    grid-column:2;
    grid-row:3;
    align-self:start;
    margin-top:0;
    min-height:10px;
}
.installer-kpi>i{
    grid-column:1;
    grid-row:2;
    align-self:center !important;
    justify-self:start;
}

/* v5.180: читаемая иконка «график + ключ» для блока выполненных работ */
.stats-section-icon-work-chart{
    width:34px;
    height:34px;
    flex-basis:34px;
}
.stats-section-icon-work-chart .work-chart-wrench-icon{
    width:22px!important;
    height:22px!important;
    display:block;
    fill:currentColor!important;
    stroke:none!important;
}


/* v5.181: чёткая иконка «столбики + гаечный ключ» */
.stats-section-icon-work-chart{
    width:36px;
    height:36px;
    flex-basis:36px;
}
.stats-section-icon-work-chart .work-chart-wrench-icon{
    width:25px!important;
    height:25px!important;
    display:block;
    fill:none!important;
    stroke:none!important;
}
.stats-section-icon-work-chart .work-chart-bar{
    fill:currentColor!important;
    stroke:none!important;
}
.stats-section-icon-work-chart .work-wrench-stroke{
    fill:none!important;
    stroke:currentColor!important;
    stroke-width:2.35!important;
    stroke-linecap:round!important;
    stroke-linejoin:round!important;
}


/* v5.182: approved Completed Works icon from the visual mockup */
.stats-section-icon-work-approved{
  overflow:hidden;
  padding:0;
  background:transparent;
}
.stats-section-icon-work-approved img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:8px;
}

/* v5.185: ручные статусы этапов + СУБ без перезагрузки */
.tz-stage-status{
  display:inline-grid;
  grid-template-columns:minmax(94px,auto) 12px;
  align-items:center;
  gap:4px;
  max-width:142px;
  vertical-align:middle;
}
.tz-stage-status-select{
  width:100%;
  min-width:94px;
  height:27px;
  min-height:27px;
  padding:2px 20px 2px 8px;
  border:1px solid transparent;
  border-radius:999px;
  font-size:10.5px;
  line-height:1;
  font-weight:800;
  cursor:pointer;
  outline:none;
  box-shadow:none;
}
.tz-stage-status.stage-ready .tz-stage-status-select{background:var(--ok);color:var(--oktext);border-color:#ccebd9}
.tz-stage-status.stage-waiting .tz-stage-status-select{background:var(--wait);color:var(--waittext);border-color:#f1dfae}
.tz-stage-status.stage-remark .tz-stage-status-select{background:var(--bad);color:var(--badtext);border-color:#f2c8d0}
/* v5.187: раскрытый список статусов всегда нейтральный, без цветов текущего статуса */
.tz-stage-status-select option{background:#fff!important;color:#222!important}
.tz-stage-status.is-manual .tz-stage-status-select{box-shadow:inset 0 0 0 1px rgba(31,111,235,.18)}
.tz-stage-status-select:hover,.tz-stage-status-select:focus{border-color:#98a2b3}
.tz-stage-status.is-saving{opacity:.62}
.tz-stage-save-mark{width:12px;text-align:center;font-size:11px;font-weight:900;color:#667085}
.tz-stage-save-mark.ok{color:#26945b}.tz-stage-save-mark.error{color:#d94b64}.tz-stage-save-mark.saving{color:#667085}
.dashboard-table .tz-stage-status{min-width:112px;max-width:132px}
.dashboard-table .tz-stage-status-select{font-size:10px;min-width:100px;height:25px;min-height:25px;padding-left:7px}
.status-grid .tz-stage-status{min-width:118px;max-width:152px}
.status-grid .tz-stage-status-select{font-size:11px;height:28px;min-height:28px}
.sub-toggle.is-saving{opacity:.62}
.sub-toggle-save-mark{display:inline-flex;align-items:center;justify-content:center;min-width:10px;font-style:normal;font-size:10px;font-weight:900;color:#667085}
.sub-toggle-save-mark.ok{color:#26945b}.sub-toggle-save-mark.warn,.sub-toggle-save-mark.error{color:#d68b00}
@media(max-width:760px){
  .status-grid .tz-stage-status{max-width:none;width:100%}
  .status-grid .tz-stage-status-select{width:100%;min-width:0}
}
@media(max-width:640px){
  .dashboard-table .tz-stage-status{max-width:none;width:100%}
  .dashboard-table .tz-stage-status-select{width:100%;min-width:0}
}

/* v5.188: не даём правой рабочей части списка ТЗ «съезжать» при сужении окна.
   До мобильной карточки (640px) таблица сохраняет рабочую ширину и прокручивается
   по горизонтали вместо сжатия статусов, документов и стрелки раскрытия. */
@media(min-width:641px){
  .dashboard-table{min-width:1080px}
  .dashboard-table th:nth-child(1),
  .dashboard-table td:nth-child(1){width:205px;min-width:205px}
  .dashboard-table th:nth-child(2),
  .dashboard-table td:nth-child(2){min-width:290px}
  .dashboard-table .tz-brief>div{white-space:nowrap}
  .dashboard-table th:nth-child(3),
  .dashboard-table th:nth-child(4),
  .dashboard-table th:nth-child(5),
  .dashboard-table th:nth-child(6),
  .dashboard-table td:nth-child(3),
  .dashboard-table td:nth-child(4),
  .dashboard-table td:nth-child(5),
  .dashboard-table td:nth-child(6){width:122px;padding-left:6px;padding-right:6px}
  .dashboard-table th:nth-child(7),
  .dashboard-table td:nth-child(7){width:126px}
  .dashboard-table th:nth-child(8),
  .dashboard-table td:nth-child(8){width:42px}
}


/* v5.189: при узком окне список ТЗ перестраивается в компактную карточку,
   а не уходит вправо за пределы экрана. Документы всегда остаются доступными
   без горизонтальной прокрутки. Полный табличный вид сохраняется на широком окне. */
@media (min-width:641px) and (max-width:1600px){
  .table-wrap:has(.dashboard-table){
    overflow:visible!important;
    background:transparent;
    border:0;
    border-radius:0;
  }
  .dashboard-table{
    display:block;
    min-width:0!important;
    width:100%;
  }
  .dashboard-table thead{display:none}
  .dashboard-table tbody{display:grid;gap:9px}
  .dashboard-table tr.object-row{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr)) 40px;
    width:100%;
    background:#fff;
    border:1px solid var(--line);
    border-radius:10px;
    overflow:hidden;
  }
  .dashboard-table tr.object-row>td{
    width:auto!important;
    min-width:0!important;
    padding:8px 10px!important;
    border-bottom:1px solid var(--line);
    vertical-align:top;
  }
  .dashboard-table tr.object-row>td:nth-child(1){
    grid-column:1/2;
    grid-row:1;
  }
  .dashboard-table tr.object-row>td:nth-child(2){
    grid-column:2/5;
    grid-row:1;
    border-left:1px solid var(--line);
  }
  .dashboard-table tr.object-row>td:nth-child(1)::before,
  .dashboard-table tr.object-row>td:nth-child(2)::before{display:none}

  .dashboard-table tr.object-row>td:nth-child(3){grid-column:1;grid-row:2}
  .dashboard-table tr.object-row>td:nth-child(4){grid-column:2;grid-row:2}
  .dashboard-table tr.object-row>td:nth-child(5){grid-column:3;grid-row:2}
  .dashboard-table tr.object-row>td:nth-child(6){grid-column:4;grid-row:2}
  .dashboard-table tr.object-row>td:nth-child(n+3):nth-child(-n+6){
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:4px;
    border-left:1px solid var(--line);
  }
  .dashboard-table tr.object-row>td:nth-child(3){border-left:0}
  .dashboard-table tr.object-row>td:nth-child(n+3):nth-child(-n+6)::before{
    content:attr(data-label);
    display:block;
    color:var(--muted);
    font-size:9px;
    font-weight:800;
    line-height:1.1;
  }
  .dashboard-table tr.object-row .tz-stage-status{
    width:100%;
    min-width:0;
    max-width:none;
    grid-template-columns:minmax(0,1fr) 12px;
  }
  .dashboard-table tr.object-row .tz-stage-status-select{
    width:100%;
    min-width:0;
  }

  .dashboard-table tr.object-row>td:nth-child(7){
    grid-column:1/5;
    grid-row:3;
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:7px!important;
    align-items:stretch!important;
    border-bottom:0;
  }
  .dashboard-table tr.object-row>td:nth-child(7)::before{
    content:attr(data-label);
    display:block;
    grid-column:1/-1;
    margin:0;
    color:var(--muted);
    font-size:9px;
    font-weight:800;
    line-height:1.1;
  }
  .dashboard-table tr.object-row>td:nth-child(7) a{
    width:100%!important;
    min-width:0;
    margin:0!important;
  }
  .dashboard-table tr.object-row>td:nth-child(7) .tiny{grid-column:1/-1}

  .dashboard-table tr.object-row>td:nth-child(8){
    grid-column:5;
    grid-row:1/4;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:6px!important;
    border-left:1px solid var(--line);
    border-bottom:0;
  }
  .dashboard-table tr.object-row>td:nth-child(8)::before{display:none!important}

  .dashboard-expand-row{
    display:block!important;
    width:100%;
    border:0!important;
    padding:0!important;
    background:transparent!important;
  }
  .dashboard-expand-row[hidden]{display:none!important}
  .dashboard-expand-row td{
    display:block!important;
    width:100%!important;
    padding:0 0 8px!important;
    border:0!important;
    background:transparent!important;
  }
  .dashboard-expand-row td::before{display:none!important}
}

/* v5.190: адаптивный журнал документов без горизонтального ухода КС + РС.
   На среднем окне: ТЗ/заявитель сверху, три типа документов ровной строкой ниже.
   На узком окне: документные блоки складываются вертикально. */
@media (min-width:821px) and (max-width:1600px){
  .table-wrap:has(.ks-doc-stage-table){
    overflow:visible!important;
    background:transparent;
    border:0;
    border-radius:0;
  }
  .ks-doc-stage-table{
    display:block;
    width:100%;
    min-width:0!important;
    border-spacing:0;
  }
  .ks-doc-stage-table thead{display:none}
  .ks-doc-stage-table tbody{display:grid;gap:9px}
  .ks-doc-stage-table tbody>tr{
    display:grid;
    grid-template-columns:repeat(6,minmax(0,1fr));
    width:100%;
    background:#fff;
    border:1px solid var(--line);
    border-radius:10px;
    overflow:hidden;
  }
  .ks-doc-stage-table tbody>tr>td{
    width:auto!important;
    min-width:0!important;
    padding:8px 10px!important;
    border:0!important;
    border-radius:0!important;
    background:#fff;
  }
  .ks-doc-stage-table tbody>tr>td:nth-child(1){
    grid-column:1/2;
    grid-row:1;
    border-bottom:1px solid var(--line)!important;
  }
  .ks-doc-stage-table tbody>tr>td:nth-child(2){
    grid-column:2/7;
    grid-row:1;
    border-left:1px solid var(--line)!important;
    border-bottom:1px solid var(--line)!important;
  }
  .ks-doc-stage-table tbody>tr>td:nth-child(3){grid-column:1/3;grid-row:2}
  .ks-doc-stage-table tbody>tr>td:nth-child(4){grid-column:3/5;grid-row:2;border-left:1px solid var(--line)!important}
  .ks-doc-stage-table tbody>tr>td:nth-child(5){grid-column:5/7;grid-row:2;border-left:1px solid var(--line)!important}
  .ks-doc-stage-table .ks-doc-applicant-cell{min-width:0!important}
  .ks-doc-stage-table .ks-doc-applicant{max-width:none!important;font-size:12px;line-height:1.2}
  .ks-doc-stage-cell{
    display:flex!important;
    flex-direction:column;
    min-width:0!important;
    padding-top:7px!important;
  }
  .ks-doc-stage-cell::before{
    content:attr(data-label);
    display:block;
    margin:0 0 5px;
    color:#667085;
    font-size:9px;
    font-weight:800;
    line-height:1.1;
    text-align:left;
  }
  .ks-doc-stage-cell .doc-stage-block{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
    grid-auto-rows:26px;
  }
  .ks-doc-stage-cell .doc-stage-block .doc-inline-status,
  .ks-doc-stage-cell .doc-stage-block .doc-stage-field{
    grid-template-columns:68px minmax(0,1fr) 10px!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
  }
  .ks-doc-stage-cell .doc-stage-block .doc-inline-status-select,
  .ks-doc-stage-cell .doc-stage-block .doc-inline-field-select{
    width:100%!important;
    min-width:0!important;
  }
  .ks-doc-stage-cell .doc-stage-block .doc-inline-date-box,
  .ks-doc-stage-cell .doc-stage-block .doc-date-value{
    width:100%!important;
    min-width:0!important;
  }
}

@media (max-width:820px){
  .table-wrap:has(.ks-doc-stage-table){
    overflow:visible!important;
    background:transparent;
    border:0;
    border-radius:0;
  }
  .ks-doc-stage-table{
    display:block;
    width:100%;
    min-width:0!important;
    border-spacing:0;
  }
  .ks-doc-stage-table thead{display:none}
  .ks-doc-stage-table tbody{display:grid;gap:9px}
  .ks-doc-stage-table tbody>tr{
    display:grid;
    grid-template-columns:minmax(102px,.32fr) minmax(0,1fr);
    width:100%;
    background:#fff;
    border:1px solid var(--line);
    border-radius:10px;
    overflow:hidden;
  }
  .ks-doc-stage-table tbody>tr>td{
    width:auto!important;
    min-width:0!important;
    padding:8px 10px!important;
    border:0!important;
    border-radius:0!important;
    background:#fff;
  }
  .ks-doc-stage-table tbody>tr>td:nth-child(1){
    grid-column:1;
    grid-row:1;
    border-bottom:1px solid var(--line)!important;
  }
  .ks-doc-stage-table tbody>tr>td:nth-child(2){
    grid-column:2;
    grid-row:1;
    border-left:1px solid var(--line)!important;
    border-bottom:1px solid var(--line)!important;
  }
  .ks-doc-stage-table tbody>tr>td:nth-child(3){grid-column:1/3;grid-row:2}
  .ks-doc-stage-table tbody>tr>td:nth-child(4){grid-column:1/3;grid-row:3;border-top:1px solid var(--line)!important}
  .ks-doc-stage-table tbody>tr>td:nth-child(5){grid-column:1/3;grid-row:4;border-top:1px solid var(--line)!important}
  .ks-doc-stage-table .ks-doc-applicant-cell{min-width:0!important}
  .ks-doc-stage-table .ks-doc-applicant{max-width:none!important;font-size:12px;line-height:1.2;overflow-wrap:anywhere}
  .ks-doc-stage-cell{
    display:grid!important;
    grid-template-columns:78px minmax(0,1fr);
    gap:6px;
    align-items:start;
    min-width:0!important;
  }
  .ks-doc-stage-cell::before{
    content:attr(data-label);
    display:block;
    padding-top:6px;
    color:#475467;
    font-size:10px;
    font-weight:800;
    line-height:1.1;
  }
  .ks-doc-stage-cell .doc-stage-block{
    width:100%!important;
    min-width:0!important;
    max-width:430px!important;
    margin:0!important;
  }
  .ks-doc-stage-cell .doc-stage-block .doc-inline-status,
  .ks-doc-stage-cell .doc-stage-block .doc-stage-field{
    grid-template-columns:70px minmax(0,1fr) 10px!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
  }
  .ks-doc-stage-cell .doc-stage-block .doc-inline-status-select,
  .ks-doc-stage-cell .doc-stage-block .doc-inline-field-select,
  .ks-doc-stage-cell .doc-stage-block .doc-inline-date-box,
  .ks-doc-stage-cell .doc-stage-block .doc-date-value{
    width:100%!important;
    min-width:0!important;
  }
}

@media (max-width:480px){
  .ks-doc-stage-table tbody>tr{grid-template-columns:1fr}
  .ks-doc-stage-table tbody>tr>td:nth-child(1),
  .ks-doc-stage-table tbody>tr>td:nth-child(2),
  .ks-doc-stage-table tbody>tr>td:nth-child(3),
  .ks-doc-stage-table tbody>tr>td:nth-child(4),
  .ks-doc-stage-table tbody>tr>td:nth-child(5){grid-column:1}
  .ks-doc-stage-table tbody>tr>td:nth-child(1){grid-row:1}
  .ks-doc-stage-table tbody>tr>td:nth-child(2){grid-row:2;border-left:0!important;border-top:1px solid var(--line)!important}
  .ks-doc-stage-table tbody>tr>td:nth-child(3){grid-row:3}
  .ks-doc-stage-table tbody>tr>td:nth-child(4){grid-row:4}
  .ks-doc-stage-table tbody>tr>td:nth-child(5){grid-row:5}
  .ks-doc-stage-cell{grid-template-columns:1fr;gap:4px}
  .ks-doc-stage-cell::before{padding-top:0}
  .ks-doc-stage-cell .doc-stage-block{max-width:none!important}
}

/* v5.194: более свободные кнопки документов. PDF — только текст, без иконки. */
.doc-download-pair{
    display:grid;
    grid-template-columns:minmax(0,1fr) 40px;
    gap:6px;
    width:100%;
    align-items:stretch;
}
.doc-download-pair>a:first-child{
    min-width:0;
    width:100%;
    padding-left:8px!important;
    padding-right:8px!important;
    line-height:1.12!important;
}
.doc-download-pair>a.pdf-icon-btn{
    width:40px!important;
    min-width:40px!important;
    max-width:40px!important;
    min-height:100%;
    padding:0 5px!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    background:#fff5f5!important;
    color:#d92d20!important;
    border-color:#f3aaa4!important;
    font-weight:800!important;
    font-size:10px!important;
    line-height:1!important;
    white-space:nowrap!important;
}
.doc-download-pair>a.pdf-icon-btn:hover{
    background:#fee4e2!important;
    color:#b42318!important;
    border-color:#ef8f87!important;
}
.pdf-btn-label{
    display:inline-block;
    font:inherit;
    letter-spacing:.15px;
}
.object-doc-actions .pdf-icon-btn{
    min-width:40px!important;
    width:40px!important;
}
.dashboard-table .doc-actions .doc-download-pair{
    width:100%;
    min-width:0;
}
.dashboard-table .doc-actions .doc-download-pair .pdf-icon-btn{
    width:40px!important;
    min-width:40px!important;
}
/* На широком экране столбцу документов нужна реальная ширина: три пары кнопок
   больше не сдавливают подписи в узкую полоску. */
@media(min-width:1601px){
    .dashboard-table th:nth-child(7),
    .dashboard-table td:nth-child(7){width:220px!important;min-width:220px!important}
    .dashboard-table .dashboard-doc-btn{
        min-height:38px;
        font-size:10px;
        line-height:1.12;
        padding-top:5px;
        padding-bottom:5px;
    }
}
@media(max-width:640px){
    .doc-download-pair{grid-template-columns:minmax(0,1fr) 42px;gap:7px}
    .pdf-icon-btn,
    .object-doc-actions .pdf-icon-btn,
    .dashboard-table .doc-actions .doc-download-pair .pdf-icon-btn{
        width:42px!important;
        min-width:42px!important;
        max-width:42px!important;
    }
}


/* v5.203 — compact source data: read-only by default, edit on demand */
.source-data-card{position:relative;padding:14px 16px 15px;margin-top:12px;margin-bottom:14px}
.source-data-card>summary{padding-right:132px;font-size:16px;line-height:28px;min-height:28px}
.source-data-card[open]>summary{margin-bottom:10px}
.source-data-card .source-dl{margin:0;grid-template-columns:170px minmax(0,1fr);gap:6px 14px}
.source-data-card .source-dl dt{font-size:12px;line-height:1.35}
.source-data-card .source-dl dd{font-size:13px;line-height:1.35}
.source-edit-toggle{position:absolute;right:14px;top:11px;display:inline-flex;align-items:center;gap:6px;padding:6px 10px;background:#fff;color:#285b9b;border-color:#c9d8eb;z-index:2}
.source-edit-toggle:hover,.source-edit-toggle.is-active{background:#eef5ff;border-color:#9cbce8}
.source-edit-toggle .btn-icon{font-size:12px}
.source-edit-form{margin-top:2px;padding:12px;border:1px solid #dbe4ef;border-radius:10px;background:#f8fafc}
.source-edit-form[hidden]{display:none!important}
.source-view[hidden]{display:none!important}
.source-edit-panel-head{display:flex;justify-content:space-between;gap:12px;margin-bottom:10px;color:#334155}
.source-edit-panel-head b{display:block;font-size:13px;margin-bottom:2px}
.source-edit-panel-head span{display:block;font-size:11px;color:#667085;font-weight:400}
.source-edit-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px 10px}
.source-edit-grid .source-wide{grid-column:1/-1}
.source-edit-grid label{gap:4px;font-size:11px;color:#475467}
.source-edit-grid input,.source-edit-grid textarea,.source-edit-grid select{padding:7px 9px;border-radius:7px;font-size:12px;background:#fff}
.source-edit-grid textarea{min-height:54px}
.source-save-row{display:flex;align-items:center;gap:8px;margin-top:10px;padding-top:10px;border-top:1px solid #e5eaf0}
.source-save-row .button{padding:7px 11px;font-size:12px}
.source-saved-note{font-size:12px;font-weight:800;color:#24764a}
.source-saved-toast{margin:9px 0 0 184px;padding:0}

/* Object card polish: slightly tighter vertical rhythm without changing section order. */
.title-row{margin-bottom:10px}
.status-grid{margin:12px 0;gap:8px}
.status{padding:10px 12px}
.status>b{font-size:13px}
.two-col{gap:12px}
.two-col .card{padding:14px 16px}
.two-col .card h2{font-size:16px;margin-bottom:10px}
.approval-card,.termination-card,.fold-card-history{margin-top:12px;margin-bottom:12px}

@media(max-width:1000px){
  .source-edit-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
  .source-data-card{padding:12px}
  .source-data-card>summary{padding-right:0;margin-bottom:8px}
  .source-edit-toggle{position:static;margin:0 0 10px;width:auto}
  .source-data-card .source-dl{grid-template-columns:1fr;gap:2px}
  .source-data-card .source-dl dt{font-weight:700;margin-top:7px}
  .source-data-card .source-dl dd{padding-bottom:2px}
  .source-edit-grid{grid-template-columns:1fr}
  .source-edit-grid .source-wide{grid-column:auto}
  .source-save-row{align-items:stretch;flex-direction:column}
  .source-save-row .button{width:100%;text-align:center}
  .source-saved-toast{margin-left:0}
}

/* v5.204 — refreshed ТЗ card: spacious main area + compact right sidebar */
.object-v204-backbar{margin-bottom:8px}
.object-v204-layout{display:grid;grid-template-columns:minmax(0,1fr) 278px;gap:14px;align-items:start}
.object-v204-main{min-width:0}
.object-v204-sidebar{display:grid;gap:12px;position:sticky;top:12px;min-width:0}
.object-v204-layout .card{border-color:#dfe7f1;box-shadow:0 4px 14px rgba(41,72,112,.045)}

.object-hero-v204{padding:16px 18px 14px;margin:0 0 12px;border-radius:13px;background:linear-gradient(180deg,#fff 0%,#fcfdff 100%)}
.object-hero-top{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}
.object-hero-title-wrap{min-width:0;flex:1}
.object-hero-title-line{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.object-hero-prefix{font-size:13px;font-weight:900;color:#2563eb;letter-spacing:.02em}
.object-hero-title-line h1{font-size:24px;line-height:1;margin:0;color:#13213a;letter-spacing:.01em}
.object-hero-chip{display:inline-flex;align-items:center;min-height:25px;padding:4px 9px;border:1px solid transparent;border-radius:8px;font-size:10.5px;font-weight:800;white-space:nowrap}
.object-hero-chip.ok{background:#e7f8ef;color:#177548;border-color:#d2f0df}
.object-hero-chip.wait{background:#fff4d9;color:#9a6200;border-color:#f5e4b5}
.object-hero-chip.neutral{background:#f7f9fc;color:#52647c;border-color:#e4eaf2}
.object-hero-person{display:grid;grid-template-columns:36px minmax(0,1fr);gap:10px;align-items:start}
.object-hero-building{display:grid;place-items:center;width:36px;height:36px;border-radius:10px;background:#f0f5ff;color:#2867d8;font-size:20px;font-weight:900}
.object-hero-person b,.object-hero-person span,.object-hero-person strong{display:block}
.object-hero-person b{font-size:15px;line-height:1.25;color:#17243b;margin-bottom:2px}
.object-hero-person span{font-size:12px;line-height:1.35;color:#53647a;margin-bottom:3px}
.object-hero-person strong{font-size:12px;line-height:1.35;color:#2e4d76;font-weight:700}
.object-hero-edit{flex:0 0 auto;margin-top:2px;color:#2563eb;border-color:#bcd0ed;background:#fff}
.object-hero-facts{display:grid;grid-template-columns:.75fr 1fr 1.35fr 1.35fr;gap:9px;margin-top:14px}
.object-fact{display:flex;align-items:center;gap:9px;min-width:0;padding:9px 10px;border:1px solid #e4ebf4;border-radius:10px;background:#fbfcff}
.object-fact-icon{display:grid;place-items:center;flex:0 0 auto;width:29px;height:29px;border-radius:8px;background:#eef5ff;color:#2466df;font-size:15px}
.object-fact div{min-width:0}
.object-fact b,.object-fact small{display:block}
.object-fact b{font-size:11.5px;color:#1e2d44;line-height:1.25;white-space:normal;overflow-wrap:anywhere}
.object-fact small{font-size:9.5px;color:#8190a5;margin-top:2px}
.object-hero-meta{font-size:9.5px;color:#9aa6b5;margin-top:9px}

.object-v204-section{margin:10px 0!important;border-radius:11px!important;padding:0!important;overflow:hidden}
.object-v204-section>summary{list-style:none;display:flex;align-items:center;gap:9px;min-height:44px;padding:9px 13px!important;margin:0!important;cursor:pointer;border:0;background:#fff;font-size:14px;font-weight:850;color:#16233a}
.object-v204-section>summary::-webkit-details-marker{display:none}
.object-v204-section>summary::after{content:'›';margin-left:auto;color:#6f829d;font-size:22px;font-weight:400;line-height:1;transform:rotate(0deg);transition:transform .15s ease}
.object-v204-section[open]>summary::after{transform:rotate(90deg)}
.object-v204-section[open]>summary{border-bottom:1px solid #e8edf4}
.object-section-icon{display:grid;place-items:center;width:27px;height:27px;border-radius:8px;background:#eef5ff;color:#2866d6;font-size:15px;flex:0 0 auto}
.object-section-icon.setup{background:#edf4ff;color:#2670df}.object-section-icon.montage{background:#f4efff;color:#7b4bd1}.object-section-icon.approval{background:#eaf8ef;color:#27915b}.object-section-icon.termination{background:#fff0f1;color:#d34f61}
.object-stage-title{font-weight:850}
.object-stage-summary-pill{margin-left:auto;margin-right:4px;display:inline-flex;align-items:center;justify-content:center;min-width:76px;padding:4px 9px;border-radius:8px;font-size:10px;font-weight:850}
.object-stage-summary-pill.ok{background:#e4f7ec;color:#1c7b4c}.object-stage-summary-pill.wait{background:#fff3d6;color:#9a6200}.object-stage-summary-pill.bad{background:#fde9ec;color:#b62f49}
.object-stage-content{padding:13px 15px 15px}
.object-stage-content dl{margin:0;grid-template-columns:155px minmax(0,1fr);gap:6px 12px}
.object-stage-content dl dt{font-size:11px;color:#66778d}.object-stage-content dl dd{font-size:12px;color:#1e2b3d}
.object-stage-content .card-actions{margin-top:12px}

.source-data-card{position:relative}
.source-data-card>summary{padding-right:145px!important}
.source-data-card .source-view{padding:12px 15px 15px}
.source-data-card .source-dl{display:grid;grid-template-columns:135px minmax(0,1fr) 135px minmax(0,1fr);gap:0;margin:0}
.source-data-card .source-dl dt,.source-data-card .source-dl dd{padding:7px 8px;border-bottom:1px solid #edf1f6;margin:0;min-width:0}
.source-data-card .source-dl dt{font-size:10.5px;color:#74849a;font-weight:600}
.source-data-card .source-dl dd{font-size:11.5px;color:#223047;overflow-wrap:anywhere}
.source-edit-toggle{right:12px;top:7px;padding:5px 9px;font-size:10.5px}
.source-edit-form{margin:12px 14px 14px;background:#f9fbfd}
.source-saved-toast{margin:0 15px 12px}

.object-side-card{padding:13px;border-radius:12px;margin:0!important}
.object-side-head{display:flex;align-items:center;justify-content:space-between;padding-bottom:9px;margin-bottom:3px;border-bottom:1px solid #edf1f5}
.object-side-head h2{font-size:14px;margin:0;color:#18263d}
.object-side-status-list>div{display:grid;grid-template-columns:minmax(0,1fr) 112px;align-items:center;gap:8px;padding:9px 0;border-bottom:1px solid #edf1f5}
.object-side-status-list>div:last-child{border-bottom:0}
.object-side-status-list>div>span{font-size:11.5px;font-weight:750;color:#26364e}
.object-side-status-list .tz-stage-status{min-width:0;width:100%;max-width:none}
.object-side-status-list .tz-stage-status-select{width:100%;min-width:0;height:27px;min-height:27px;font-size:10px;padding:3px 22px 3px 7px}
.object-side-status-list .pill{justify-self:end;font-size:10px;min-width:76px;text-align:center}

.object-side-date-form{display:grid;gap:8px;padding-top:8px}
.object-side-date-form label,.object-side-adpu-form label{display:grid;gap:4px;font-size:10px;color:#75859b;font-weight:650}
.object-side-date-form input[type=date],.object-side-adpu-form input[type=date]{width:100%;min-width:0;padding:6px 7px;border-radius:7px;font-size:11px;background:#fff}
.object-side-check{grid-template-columns:1fr auto!important;align-items:center;padding:6px 0}
.object-side-check input{width:16px;height:16px}
.object-side-term{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 8px;border-radius:8px;background:#f7f9fc;font-size:10px}.object-side-term span{color:#7b899b}.object-side-term b{font-size:10.5px}.object-side-term.ok b{color:#18814e}.object-side-term.wait b{color:#a36a08}
.object-side-save{width:100%;justify-content:center}
.object-side-adpu-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;align-items:end;margin-top:10px;padding-top:10px;border-top:1px solid #edf1f5}.object-side-adpu-form .adpu-date-saved{grid-column:1/-1}
.object-side-readonly>div{display:flex;justify-content:space-between;gap:8px;padding:8px 0;border-bottom:1px solid #edf1f5;font-size:10.5px}.object-side-readonly>div:last-child{border-bottom:0}.object-side-readonly span{color:#78879a}.object-side-readonly b{text-align:right;color:#26364e}
.object-side-docs{display:grid;gap:7px;padding-top:8px}.object-side-docs .doc-download-pair{grid-template-columns:minmax(0,1fr) 38px;gap:5px}.object-side-docs .doc-download-pair.single{grid-template-columns:1fr}.object-side-docs .button{min-height:34px;padding:7px 8px;font-size:10.5px;justify-content:center}.object-side-docs .pdf-icon-btn{min-width:38px!important;width:38px!important;padding:0!important}.object-side-docs .adpu-draft-note{margin-top:8px}

@media(max-width:1200px){
  .object-v204-layout{grid-template-columns:minmax(0,1fr) 250px}
  .object-hero-facts{grid-template-columns:repeat(2,minmax(0,1fr))}
  .source-data-card .source-dl{grid-template-columns:120px minmax(0,1fr) 120px minmax(0,1fr)}
}
@media(max-width:980px){
  .object-v204-layout{grid-template-columns:1fr}
  .object-v204-sidebar{position:static;grid-template-columns:repeat(3,minmax(0,1fr));grid-row:1;margin-bottom:12px}
  .object-v204-main{grid-row:2}
  .object-hero-facts{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
  .object-v204-sidebar{grid-template-columns:1fr}
  .object-hero-top{display:block}.object-hero-edit{margin-top:10px}.object-hero-title-line h1{font-size:21px}
  .object-hero-facts{grid-template-columns:1fr}
  .source-data-card>summary{padding-right:12px!important}.source-edit-toggle{position:static;margin:8px 12px 0}
  .source-data-card .source-dl{grid-template-columns:1fr}.source-data-card .source-dl dt{padding-bottom:2px;border-bottom:0;font-weight:750}.source-data-card .source-dl dd{padding-top:2px}
  .object-stage-content dl{grid-template-columns:1fr}.object-stage-content dl dt{padding-top:5px;font-weight:750}.object-stage-summary-pill{min-width:68px}
}

/* v5.205 — object card: unified line icons + background-saving key dates */
.object-icon-sprite{position:absolute;width:0;height:0;overflow:hidden;pointer-events:none}
.ui-svg{width:1em;height:1em;display:block;fill:none;stroke:currentColor;stroke-width:1.85;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.btn-icon .ui-svg{width:15px;height:15px}
.object-hero-building .ui-svg{width:22px;height:22px}
.object-fact-icon .ui-svg{width:18px;height:18px}
.object-section-icon .ui-svg,.object-history-icon .ui-svg{width:17px;height:17px}
.object-side-title-icon .ui-svg{width:17px;height:17px}

.object-hero-building,
.object-fact-icon,
.object-section-icon,
.fold-icon.object-history-icon,
.object-side-title-icon{
  box-shadow:none;
}
.object-hero-building{background:#eef5ff;color:#2563eb}
.object-fact-icon{background:#eef5ff;color:#1769f5}
.object-section-icon{background:#edf4ff;color:#1769f5}
.object-section-icon.setup{background:#edf4ff;color:#1769f5}
.object-section-icon.montage{background:#f2ecff;color:#7c4ee4}
.object-section-icon.approval{background:#e9f8ef;color:#1d9b5f}
.object-section-icon.termination{background:#fff0f2;color:#e04f61}
.fold-icon.object-history-icon{display:grid;place-items:center;width:27px;height:27px;border-radius:8px;background:#edf4ff;color:#1769f5;flex:0 0 auto}

.object-side-head h2{display:flex;align-items:center;gap:7px}
.object-side-title-icon{display:grid;place-items:center;width:25px;height:25px;border-radius:7px;background:#eef5ff;color:#1769f5;flex:0 0 auto}

.object-side-status-list>.object-side-status-row{
  display:grid;
  grid-template-columns:30px minmax(0,1fr) 104px;
  align-items:center;
  gap:8px;
  padding:9px 0;
  border-bottom:1px solid #edf1f5;
}
.object-side-status-list>.object-side-status-row:last-child{border-bottom:0}
.object-status-name{font-size:11.5px;font-weight:750;color:#26364e}
.object-status-icon{display:grid;place-items:center;width:28px;height:28px;border-radius:9px}
.object-status-icon .ui-svg{width:16px;height:16px;stroke-width:2.2}
.object-status-icon.ok{background:#e4f7ec;color:#15945a}
.object-status-icon.wait{background:#fff3d6;color:#d49308}
.object-status-icon.bad{background:#fde9ec;color:#c83f56}
.object-side-status-list>.object-side-status-row>.tz-stage-status,
.object-side-status-list>.object-side-status-row>.pill,
.object-side-status-list>.object-side-status-row>.status-hint{grid-column:3;min-width:0;width:100%;justify-self:stretch}
.object-side-status-list>.object-side-status-row>.status-hint summary{width:100%;justify-content:center}

.object-side-date-form{gap:0;padding-top:3px}
.object-side-date-form>label{padding:9px 0;border-bottom:1px solid #edf1f5}
.object-side-date-form>label:first-child{padding-top:6px}
.object-side-check{padding:9px 0!important;border-bottom:1px solid #edf1f5}
.object-side-date-form input[type=date],.object-side-adpu-form input[type=date]{min-height:32px;border-color:#d9e2ee;background:#fff}
.object-side-term{margin-top:8px}
.object-side-adpu-form{display:block;margin-top:10px;padding-top:10px;border-top:1px solid #edf1f5}
.object-side-adpu-form label{display:grid;gap:5px}
.object-side-save{display:none!important}
.background-save-state{font-size:9.5px;font-weight:750;white-space:nowrap;min-height:14px;color:#8492a5}
.background-save-state.saving{color:#64748b}
.background-save-state.saved{color:#178150}
.background-save-state.error{color:#c63f53}

.object-side-docs .btn-icon{display:grid;place-items:center}
.object-side-docs .btn-icon .ui-svg{width:14px;height:14px}
.source-edit-toggle .btn-icon,.object-hero-edit .btn-icon{display:grid;place-items:center}

@media(max-width:1100px){
  .object-side-status-list>.object-side-status-row{grid-template-columns:28px minmax(0,1fr) 96px}
}

/* v5.206 — object card visual parity with approved mockup */
.object-v204-layout{grid-template-columns:minmax(0,1fr) 286px;gap:16px}
.object-v204-layout .card{border:1px solid #dbe6f2;box-shadow:0 4px 16px rgba(43,75,116,.045)}
.object-hero-v204{padding:18px 20px 16px;border-radius:14px;margin-bottom:14px}
.object-hero-title-line{gap:10px;margin-bottom:14px}
.object-hero-prefix{font-size:16px;color:#0b67f3}
.object-hero-title-line h1{font-size:27px;color:#12213d;letter-spacing:.005em}
.object-tz-copy{display:grid;place-items:center;width:28px;height:28px;min-height:0;padding:0;border:0;background:transparent;color:#587196;border-radius:7px}
.object-tz-copy:hover{background:#eef5ff;color:#1769f5}
.object-tz-copy .ui-svg{width:18px;height:18px;stroke-width:1.9}
.object-hero-chip{min-height:30px;padding:5px 12px;border-radius:9px;font-size:11.5px}
.object-hero-person{grid-template-columns:48px minmax(0,1fr);gap:12px;align-items:center}
.object-hero-building{width:48px;height:48px;border-radius:12px;background:#eef5ff;color:#2b4f7f}
.object-hero-building .ui-svg{width:27px;height:27px;stroke-width:1.75}
.object-hero-person b{font-size:16px;line-height:1.25;margin-bottom:3px}
.object-hero-person span{font-size:12.5px;line-height:1.35;margin-bottom:3px}
.object-hero-person strong{font-size:12.5px;line-height:1.35;color:#2d4d76}
.object-hero-edit,.source-edit-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:132px;min-height:42px;padding:9px 13px;border:1px solid #8cb5ff!important;border-radius:9px!important;background:#fff!important;color:#0967e8!important;font-size:12px!important;font-weight:800!important;box-shadow:none!important}
.object-hero-edit:hover,.source-edit-toggle:hover{background:#f5f9ff!important;border-color:#5e98f2!important}
.object-hero-edit .btn-icon .ui-svg,.source-edit-toggle .btn-icon .ui-svg{width:16px;height:16px;stroke-width:1.9}
.object-hero-facts{grid-template-columns:.8fr 1.1fr 1.45fr 1.45fr;gap:10px;margin-top:16px}
.object-fact{min-height:70px;gap:11px;padding:11px 12px;border-color:#dfe8f3;border-radius:11px;background:#fcfdff}
.object-fact-icon{width:42px;height:42px;border-radius:11px;background:#eef5ff;color:#0b67f3}
.object-fact-icon .ui-svg{width:23px;height:23px;stroke-width:1.8}
.object-fact b{font-size:12.5px;line-height:1.25;color:#172642}
.object-fact small{font-size:10.5px;color:#8090a7;margin-top:3px}
.object-hero-meta{font-size:10.5px;margin-top:10px;color:#8d9aac}

.object-v204-section{margin:11px 0!important;border-radius:12px!important}
.object-v204-section>summary{min-height:54px;padding:9px 15px!important;gap:11px;font-size:16px;color:#14213c}
.object-v204-section>summary::after{content:'›';margin-left:8px;color:#617995;font-size:24px;font-weight:400;line-height:1;transform:none;transition:transform .15s ease}
.object-v204-section[open]>summary::after{transform:rotate(90deg)}
.object-section-icon,.fold-icon.object-history-icon{width:38px!important;height:38px!important;border-radius:10px!important}
.object-section-icon .ui-svg,.object-history-icon .ui-svg{width:21px!important;height:21px!important;stroke-width:1.9}
.object-section-icon.setup{background:#eef5ff;color:#0967ef}
.object-section-icon.montage{background:#f3efff;color:#7d4ae8}
.object-section-icon.approval{background:#e9f8ef;color:#1d9b5f}
.object-section-icon.termination{background:#fff0f2;color:#eb3f55}
.fold-icon.object-history-icon{background:#eef5ff;color:#0967ef}
.object-stage-title,.fold-title{font-size:16px;font-weight:850}
.object-stage-summary-pill{margin-left:auto;margin-right:0;min-width:100px;padding:6px 13px;border-radius:10px;font-size:11px}
.object-stage-summary-pill.ok{background:#e4f7ec;color:#167b48}
.object-stage-summary-pill.wait{background:#fff2d3;color:#a16600}
.object-stage-summary-pill.bad{background:#fde9ec;color:#b62f49}
/* The history template already contains its own legacy arrow; use only the unified one. */
.object-v204-section .fold-arrow{display:none!important}
.fold-summary-main{min-width:0}
.fold-card-history>summary .fold-summary-main{display:flex;align-items:center;gap:11px;min-width:0;flex:1}
.fold-card-history .fold-meta{font-size:12px;color:#71829a;font-weight:600;margin-left:5px}

.source-data-card>summary{padding-right:160px!important}
.source-edit-toggle{right:14px;top:6px}
.source-data-card .source-view{padding:11px 18px 17px}
.source-data-card .source-dl{grid-template-columns:170px minmax(0,1fr) 150px minmax(0,1fr)}
.source-data-card .source-dl dt,.source-data-card .source-dl dd{padding:8px 10px}
.source-data-card .source-dl dt{font-size:11.5px;color:#708199;font-weight:600}
.source-data-card .source-dl dd{font-size:12.5px;line-height:1.35;color:#1d2e49}

.object-side-card{padding:15px;border-radius:13px}
.object-side-head{padding-bottom:11px;margin-bottom:4px}
.object-side-head h2{font-size:16px;color:#14213c}
.object-side-title-icon{width:30px;height:30px;border-radius:9px}
.object-side-title-icon .ui-svg{width:18px;height:18px}
.object-side-status-list>.object-side-status-row{grid-template-columns:32px minmax(0,1fr) 108px;gap:9px;padding:10px 0}
.object-status-icon{width:30px;height:30px;border-radius:10px}
.object-status-name{font-size:12px}
.object-side-status-list .tz-stage-status-select{height:31px;min-height:31px;border-radius:9px;font-size:10.5px}
.object-side-docs{gap:8px}
.object-side-docs .button{min-height:40px;border-radius:9px;font-size:11px}
.object-side-docs .pdf-icon-btn{border-color:#ff9ca4;color:#d92f3f;background:#fff}

@media(max-width:1200px){
  .object-v204-layout{grid-template-columns:minmax(0,1fr) 260px}
  .object-hero-facts{grid-template-columns:repeat(2,minmax(0,1fr))}
  .source-data-card .source-dl{grid-template-columns:140px minmax(0,1fr) 130px minmax(0,1fr)}
}
@media(max-width:980px){
  .object-v204-layout{grid-template-columns:1fr}
  .object-v204-sidebar{position:static;grid-template-columns:repeat(3,minmax(0,1fr));grid-row:1;margin-bottom:12px}
  .object-v204-main{grid-row:2}
}
@media(max-width:760px){
  .object-v204-sidebar{grid-template-columns:1fr}
  .object-hero-title-line h1{font-size:23px}
  .object-hero-person{grid-template-columns:42px minmax(0,1fr)}
  .object-hero-building{width:42px;height:42px}
  .object-hero-facts{grid-template-columns:1fr}
  .source-data-card>summary{padding-right:14px!important}
  .source-edit-toggle{position:static;margin:8px 12px 0;min-width:0;min-height:38px}
  .source-data-card .source-dl{grid-template-columns:1fr}
  .object-v204-section>summary{font-size:14px}
  .object-stage-title,.fold-title{font-size:14px}
  .object-stage-summary-pill{min-width:86px}
}
/* v5.206 arrow placement: exactly like the approved card mockup */
.source-data-card>summary::after{margin-left:auto;margin-right:142px}
.termination-card>summary::after{margin-left:auto}
.object-photo-card>summary::after{margin-left:auto}
@media(max-width:760px){.source-data-card>summary::after{margin-left:auto;margin-right:0}}


/* v5.207 — robust inline icons, matching the approved card mockup */
.object-section-icon,.fold-icon.object-history-icon{display:grid!important;place-items:center!important;overflow:hidden}
.object-section-icon .ui-svg,.fold-icon.object-history-icon .ui-svg{display:block!important;width:22px!important;height:22px!important;min-width:22px!important;min-height:22px!important;stroke:currentColor!important;stroke-width:2!important;fill:none!important}
.object-section-icon.approval .ui-svg{width:23px!important;height:23px!important}
.object-section-icon.termination .ui-svg{width:22px!important;height:22px!important}
.object-section-icon.montage .ui-svg{width:22px!important;height:22px!important}
.object-stage-summary-pill{margin-left:auto!important;margin-right:2px!important}


/* v5.208 — final icon cleanup and layout alignment */
.object-v204-layout{grid-template-columns:minmax(0,1fr) 286px;gap:16px}
.object-v204-layout .card{border:1px solid #dbe6f2;box-shadow:0 2px 10px rgba(43,75,116,.035)}
.object-hero-v204{padding:16px 18px 14px;border-radius:14px;margin-bottom:14px}
.object-hero-top{align-items:flex-start}
.object-hero-title-line{gap:9px;margin-bottom:12px}
.object-hero-prefix{font-size:15px}
.object-hero-title-line h1{font-size:22px;line-height:1.05;letter-spacing:.002em}
.object-tz-copy{width:26px;height:26px}
.object-hero-chip{min-height:28px;padding:4px 11px;border-radius:9px;font-size:11px;font-weight:800}
.object-hero-person{grid-template-columns:42px minmax(0,1fr);gap:10px;align-items:center}
.object-hero-building{display:flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:11px;background:#eef4ff;color:#476489;line-height:0}
.object-hero-building .ui-svg{width:24px;height:24px;stroke-width:1.8}
.object-hero-person b{font-size:14px;line-height:1.24;margin-bottom:2px}
.object-hero-person span{font-size:11.5px;line-height:1.35;margin-bottom:2px}
.object-hero-person strong{font-size:11.5px;line-height:1.32;color:#244c7a}
.object-hero-edit,.source-edit-toggle{min-width:126px;min-height:40px;padding:8px 12px;border-radius:10px!important;font-size:11.5px!important}
.object-hero-facts{grid-template-columns:.8fr 1.1fr 1.45fr 1.45fr;gap:10px;margin-top:14px}
.object-fact{min-height:60px;gap:10px;padding:10px 12px;border-color:#dfe8f3;border-radius:11px;background:#fcfdff}
.object-fact-icon{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:10px;background:#eef4ff;color:#0c67f5;line-height:0}
.object-fact-icon .ui-svg{width:20px;height:20px;stroke-width:1.9}
.object-fact b{font-size:11.75px;line-height:1.25;color:#172642}
.object-fact small{font-size:10px;color:#8090a7;margin-top:2px}
.object-hero-meta{font-size:10px;margin-top:10px;color:#8d9aac}

.object-v204-section{margin:11px 0!important;border-radius:12px!important;overflow:hidden}
.object-v204-section>summary{position:relative;list-style:none;display:flex;align-items:center;gap:11px;min-height:52px;padding:9px 50px 9px 15px!important;margin:0!important;cursor:pointer;font-size:15px;font-weight:850;color:#14213c}
.object-v204-section>summary::-webkit-details-marker{display:none}
.object-v204-section>summary::after{content:'›';position:absolute;right:16px;top:50%;transform:translateY(-50%) rotate(0deg);color:#617995;font-size:24px;font-weight:400;line-height:1;transition:transform .15s ease}
.object-v204-section[open]>summary::after{transform:translateY(-50%) rotate(90deg)}
.object-v204-section[open]>summary{border-bottom:1px solid #e8edf4}
.object-section-icon,.fold-icon.object-history-icon{display:flex!important;align-items:center!important;justify-content:center!important;width:34px!important;height:34px!important;border-radius:10px!important;overflow:hidden;line-height:0;flex:0 0 34px}
.object-section-icon .ui-svg,.fold-icon.object-history-icon .ui-svg{display:block!important;width:18px!important;height:18px!important;min-width:18px!important;min-height:18px!important;stroke:currentColor!important;stroke-width:2!important;fill:none!important;stroke-linecap:round;stroke-linejoin:round}
.object-section-icon.setup{background:#eef5ff;color:#0967ef}
.object-section-icon.montage{background:#f3efff;color:#7d4ae8}
.object-section-icon.approval{background:#e9f8ef;color:#1d9b5f}
.object-section-icon.termination{background:#fff0f2;color:#eb3f55}
.fold-icon.object-history-icon{background:#eef5ff;color:#0967ef}
.object-stage-title,.fold-title{font-size:15px;font-weight:850}
.object-stage-summary-pill{margin-left:auto!important;margin-right:22px!important;min-width:96px;padding:6px 13px;border-radius:10px;font-size:11px}
.object-stage-summary-pill.ok{background:#e4f7ec;color:#167b48}.object-stage-summary-pill.wait{background:#fff2d3;color:#a16600}.object-stage-summary-pill.bad{background:#fde9ec;color:#b62f49}
.fold-card-history .fold-meta{font-size:12px;color:#71829a;font-weight:600;margin-left:5px}
.fold-card-history>summary .fold-summary-main{display:flex;align-items:center;gap:11px;min-width:0;flex:1}
.object-v204-section .fold-arrow{display:none!important}

.source-data-card{position:relative}
.source-data-card>summary{padding-right:200px!important}
.source-edit-toggle{position:absolute;right:50px;top:6px;z-index:2}
.source-data-card .source-view{padding:11px 18px 17px}
.source-data-card .source-dl{grid-template-columns:150px minmax(0,1fr) 135px minmax(0,1fr)}
.source-data-card .source-dl dt,.source-data-card .source-dl dd{padding:8px 10px}
.source-data-card .source-dl dt{font-size:11px;color:#708199;font-weight:600}
.source-data-card .source-dl dd{font-size:12px;line-height:1.35;color:#1d2e49}

.object-side-card{padding:15px;border-radius:13px}
.object-side-head{padding-bottom:11px;margin-bottom:4px}
.object-side-head h2{font-size:16px;color:#14213c}
.object-side-title-icon{width:30px;height:30px;border-radius:9px}
.object-side-title-icon .ui-svg{width:18px;height:18px}
.object-side-status-list>.object-side-status-row{grid-template-columns:32px minmax(0,1fr) 108px;gap:9px;padding:10px 0}
.object-status-icon{width:30px;height:30px;border-radius:10px}
.object-status-name{font-size:12px}
.object-side-status-list .tz-stage-status-select{height:31px;min-height:31px;border-radius:9px;font-size:10.5px}
.object-side-docs{gap:8px}
.object-side-docs .button{min-height:40px;border-radius:9px;font-size:11px}
.object-side-docs .pdf-icon-btn{border-color:#ff9ca4;color:#d92f3f;background:#fff}

@media(max-width:1200px){
  .object-v204-layout{grid-template-columns:minmax(0,1fr) 260px}
  .object-hero-facts{grid-template-columns:repeat(2,minmax(0,1fr))}
  .source-data-card .source-dl{grid-template-columns:132px minmax(0,1fr) 118px minmax(0,1fr)}
}
@media(max-width:980px){
  .object-v204-layout{grid-template-columns:1fr}
  .object-v204-sidebar{position:static;grid-template-columns:repeat(3,minmax(0,1fr));grid-row:1;margin-bottom:12px}
  .object-v204-main{grid-row:2}
}
@media(max-width:760px){
  .object-v204-sidebar{grid-template-columns:1fr}
  .object-hero-title-line h1{font-size:21px}
  .object-hero-person{grid-template-columns:38px minmax(0,1fr)}
  .object-hero-building{width:38px;height:38px}
  .object-hero-building .ui-svg{width:22px;height:22px}
  .object-hero-facts{grid-template-columns:1fr}
  .source-data-card>summary{padding-right:15px!important}
  .source-edit-toggle{position:static;margin:8px 12px 0;min-width:0;min-height:38px}
  .source-data-card .source-dl{grid-template-columns:1fr}
  .object-v204-section>summary{font-size:14px;padding-right:42px!important}
  .object-stage-title,.fold-title{font-size:14px}
  .object-stage-summary-pill{min-width:86px;margin-right:20px!important}
}


/* v5.209 — final compact alignment cleanup requested by user */
.object-v204-layout{grid-template-columns:minmax(0,1fr) 300px;gap:18px}
.object-v204-layout .card{border:1px solid #dbe6f2;box-shadow:0 2px 10px rgba(43,75,116,.03)}
.object-hero-v204{padding:14px 18px 12px;border-radius:14px;margin-bottom:12px}
.object-hero-top{align-items:flex-start;gap:12px}
.object-hero-title-line{gap:9px;margin-bottom:10px}
.object-hero-prefix{font-size:15px}
.object-hero-title-line h1{font-size:21px;line-height:1.05;letter-spacing:.002em}
.object-tz-copy{width:24px;height:24px}
.object-tz-copy .ui-svg{width:16px;height:16px}
.object-hero-chip{min-height:28px;padding:4px 10px;border-radius:9px;font-size:10.5px;font-weight:800}
.object-hero-person{display:block;min-width:0}
.object-hero-building{display:none!important}
.object-hero-person b{display:block;font-size:14px;line-height:1.24;margin-bottom:2px}
.object-hero-person span{display:block;font-size:11.5px;line-height:1.32;margin-bottom:2px}
.object-hero-person strong{display:block;font-size:11.5px;line-height:1.32;color:#244c7a}
.object-hero-edit{align-self:flex-start;min-width:124px;min-height:38px;padding:7px 12px;font-size:11.5px!important}
.object-hero-facts{grid-template-columns:.78fr 1.05fr 1.4fr 1.4fr;gap:9px;margin-top:12px}
.object-fact{min-height:56px;gap:9px;padding:9px 11px;border-radius:11px;background:#fcfdff}
.object-fact-icon{display:flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:10px;background:#eef4ff;color:#0c67f5;line-height:0}
.object-fact-icon .ui-svg{width:18px;height:18px;stroke-width:1.95}
.object-fact b{font-size:11.75px;line-height:1.22;color:#172642}
.object-fact small{font-size:9.75px;color:#8090a7;margin-top:1px}
.object-hero-meta{font-size:10px;margin-top:9px;color:#8d9aac}

.object-v204-section{margin:10px 0!important;border-radius:12px!important;overflow:hidden}
.object-v204-section>summary{position:relative;list-style:none;display:flex;align-items:center;gap:11px;min-height:50px;padding:8px 50px 8px 15px!important;margin:0!important;cursor:pointer;font-size:15px;font-weight:850;color:#14213c}
.object-v204-section>summary::-webkit-details-marker{display:none}
.object-v204-section>summary::after{content:'›';position:absolute;right:16px;top:50%;transform:translateY(-50%) rotate(0deg);color:#617995;font-size:24px;font-weight:400;line-height:1;transition:transform .15s ease}
.object-v204-section[open]>summary::after{transform:translateY(-50%) rotate(90deg)}
.object-v204-section[open]>summary{border-bottom:1px solid #e8edf4}
.object-section-icon,.fold-icon.object-history-icon{display:flex!important;align-items:center!important;justify-content:center!important;width:34px!important;height:34px!important;border-radius:10px!important;overflow:hidden;line-height:0;flex:0 0 34px}
.object-section-icon .ui-svg,.fold-icon.object-history-icon .ui-svg{display:block!important;width:18px!important;height:18px!important;min-width:18px!important;min-height:18px!important;stroke:currentColor!important;stroke-width:2!important;fill:none!important;stroke-linecap:round;stroke-linejoin:round}
.object-section-icon.setup{background:#eef5ff;color:#0967ef}
.object-section-icon.montage{background:#f3efff;color:#7d4ae8}
.object-section-icon.approval{background:#e9f8ef;color:#1d9b5f}
.object-section-icon.termination{background:#fff0f2;color:#eb3f55}
.fold-icon.object-history-icon{background:#eef5ff;color:#0967ef}
.object-stage-title,.fold-title{font-size:15px;font-weight:850}
.object-stage-summary-pill{margin-left:auto!important;margin-right:22px!important;min-width:96px;padding:6px 13px;border-radius:10px;font-size:11px}

.source-data-card{position:relative}
.source-data-card>summary{padding-right:190px!important}
.source-edit-toggle{position:absolute;right:54px;top:5px;z-index:2;min-width:124px;min-height:38px;padding:7px 12px;font-size:11.5px!important}
.source-data-card .source-view{padding:10px 16px 16px}
.source-data-card .source-dl{grid-template-columns:145px minmax(0,1fr) 130px minmax(0,1fr)}
.source-data-card .source-dl dt,.source-data-card .source-dl dd{padding:8px 9px}
.source-data-card .source-dl dt{font-size:11px;color:#708199;font-weight:600}
.source-data-card .source-dl dd{font-size:12px;line-height:1.35;color:#1d2e49}
.source-data-card>summary::after{right:16px!important;margin:0!important}

.object-side-card{padding:16px 15px;border-radius:13px}
.object-side-head{padding-bottom:12px;margin-bottom:4px}
.object-side-head h2{font-size:16px;color:#14213c}
.object-side-title-icon{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:9px;line-height:0}
.object-side-title-icon .ui-svg{width:17px;height:17px}
.object-side-status-list>.object-side-status-row{grid-template-columns:30px minmax(0,1fr) 92px;gap:10px;padding:11px 0;align-items:center}
.object-status-icon{width:28px;height:28px;border-radius:10px}
.object-status-name{font-size:12px;line-height:1.2}
.object-side-status-list .tz-stage-status-select{height:33px;min-height:33px;border-radius:10px;font-size:10.5px;padding:0 26px 0 10px}
.object-side-date-form label,.object-side-adpu-form label{display:grid;gap:6px;margin:0 0 12px}
.object-side-date-form label span,.object-side-adpu-form label span{font-size:11px;color:#7b8aa0;font-weight:600}
.object-side-date-form input[type='date'],.object-side-adpu-form input[type='date']{height:36px;border-radius:9px;padding:0 10px;font-size:12px}
.object-side-check{display:flex!important;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.object-side-check span{font-size:11px;color:#7b8aa0;font-weight:600}
.object-side-check input{margin-left:auto}
.object-side-term{margin:2px 0 0;padding:10px 12px;border-radius:9px;font-size:11px}
.object-side-term b{font-size:12px}
.object-side-docs{gap:10px}
.object-side-docs .button{min-height:42px;border-radius:10px;font-size:11px;padding:0 12px}
.doc-download-pair{display:grid;grid-template-columns:minmax(0,1fr) 58px;gap:8px;align-items:stretch}
.doc-download-pair.single{grid-template-columns:1fr}
.object-side-docs .pdf-icon-btn{display:flex;align-items:center;justify-content:center;min-width:58px;border-radius:10px;border-color:#ff9ca4;color:#d92f3f;background:#fff;font-size:11px;font-weight:800}

@media(max-width:1200px){
  .object-v204-layout{grid-template-columns:minmax(0,1fr) 280px}
  .object-hero-facts{grid-template-columns:repeat(2,minmax(0,1fr))}
  .source-data-card .source-dl{grid-template-columns:132px minmax(0,1fr) 118px minmax(0,1fr)}
}
@media(max-width:980px){
  .object-v204-layout{grid-template-columns:1fr}
  .object-v204-sidebar{position:static;grid-template-columns:repeat(3,minmax(0,1fr));grid-row:1;margin-bottom:12px}
  .object-v204-main{grid-row:2}
}
@media(max-width:760px){
  .object-v204-sidebar{grid-template-columns:1fr}
  .object-hero-title-line h1{font-size:20px}
  .object-hero-facts{grid-template-columns:1fr}
  .source-data-card>summary{padding-right:16px!important}
  .source-edit-toggle{position:static;margin:8px 12px 0;min-width:0;min-height:38px}
  .source-data-card .source-dl{grid-template-columns:1fr}
  .object-v204-section>summary{font-size:14px;padding-right:42px!important}
  .object-stage-title,.fold-title{font-size:14px}
  .object-stage-summary-pill{min-width:86px;margin-right:20px!important}
}


/* v5.210 — compact/proportional right sidebar */
.object-v204-layout{grid-template-columns:minmax(0,1fr) 292px;gap:16px}
.object-v204-sidebar{gap:12px}
.object-side-card{padding:13px 14px;border-radius:12px;margin:0!important}
.object-side-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-bottom:9px;margin-bottom:1px;border-bottom:1px solid #e9eef5}
.object-side-head h2{display:flex;align-items:center;gap:8px;margin:0;font-size:15px;line-height:1.2;color:#14213c}
.object-side-title-icon{display:inline-flex;align-items:center;justify-content:center;width:27px;height:27px;border-radius:8px;line-height:0;flex:0 0 27px}
.object-side-title-icon .ui-svg{width:16px;height:16px}

/* statuses: short, balanced rows */
.object-side-status-list{display:grid}
.object-side-status-list>.object-side-status-row{display:grid;grid-template-columns:26px minmax(0,1fr) 104px;gap:8px;align-items:center;min-height:45px;padding:7px 0;border-bottom:1px solid #edf1f5}
.object-side-status-list>.object-side-status-row:last-child{border-bottom:0}
.object-status-icon{display:flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:9px;line-height:0}
.object-status-icon .ui-svg{width:14px;height:14px}
.object-status-name{font-size:11.5px;line-height:1.2;font-weight:700;color:#34445c;white-space:nowrap}
.object-side-status-list>.object-side-status-row>.tz-stage-status,
.object-side-status-list>.object-side-status-row>.pill,
.object-side-status-list>.object-side-status-row>.status-hint{grid-column:3;min-width:0;width:100%;justify-self:stretch}
.object-side-status-list .tz-stage-status-select{width:100%;height:31px;min-height:31px;padding:0 24px 0 9px;border-radius:9px;font-size:10.5px;line-height:1.1;font-weight:800}

/* key dates: label left, compact control right */
.object-dates-card-v204 .object-side-head{margin-bottom:0}
.object-side-date-form{display:grid;gap:0;padding:0}
.object-side-date-form>label,
.object-side-adpu-form>label{display:grid!important;grid-template-columns:92px minmax(0,1fr);align-items:center;gap:10px;margin:0!important;padding:9px 0!important;border-bottom:1px solid #edf1f5;font-size:inherit}
.object-side-date-form>label:first-child{padding-top:9px!important}
.object-side-date-form label span,
.object-side-adpu-form label span{font-size:10.5px;line-height:1.25;color:#7a899f;font-weight:650;text-align:left}
.object-side-date-form input[type='date'],
.object-side-adpu-form input[type='date']{justify-self:end;width:142px;height:34px;min-height:34px;padding:0 8px;border-radius:8px;font-size:11.5px;background:#fff;border:1px solid #d6e0ec}
.object-side-check{display:grid!important;grid-template-columns:1fr auto!important;align-items:center;gap:10px;padding:9px 0!important;margin:0!important;border-bottom:1px solid #edf1f5}
.object-side-check span{font-size:10.5px!important;line-height:1.25;color:#7a899f!important;font-weight:650!important;text-align:left!important}
.object-side-check input{justify-self:end;width:16px;height:16px;margin:0!important}
.object-side-term{display:grid;grid-template-columns:92px minmax(0,1fr);align-items:center;gap:10px;margin:0;padding:9px 0;border-radius:0;background:transparent;border-bottom:1px solid #edf1f5;font-size:10.5px}
.object-side-term span{color:#7a899f;font-weight:650}
.object-side-term b{justify-self:end;font-size:11px;line-height:1.25;text-align:right;white-space:normal}
.object-side-adpu-form{display:grid;gap:0}
.object-side-adpu-form>label{border-bottom:0!important;padding-bottom:2px!important}
.background-save-state{font-size:9.5px;line-height:1;color:#71907f;white-space:nowrap}

/* documents: compact buttons and predictable icon placement */
.object-actions-card-v204 .object-side-head{margin-bottom:5px}
.object-side-docs{display:grid;gap:7px;padding-top:4px}
.object-side-docs .doc-download-pair{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:6px;align-items:stretch;width:100%}
.object-side-docs .doc-download-pair.single{grid-template-columns:1fr}
.object-side-docs .button{display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:7px;min-height:36px;height:36px;padding:0 10px!important;border-radius:8px;font-size:10.5px;line-height:1.1;text-align:left;white-space:nowrap;overflow:hidden}
.object-side-docs .button>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.object-side-docs .btn-icon{display:flex!important;align-items:center!important;justify-content:center!important;width:15px;height:15px;flex:0 0 15px;line-height:0}
.object-side-docs .btn-icon .ui-svg{width:14px!important;height:14px!important}
.object-side-docs .pdf-icon-btn{display:flex!important;align-items:center!important;justify-content:center!important;min-width:44px!important;width:44px!important;height:36px!important;min-height:36px!important;padding:0!important;border-radius:8px!important;border-color:#f4a7ad!important;background:#fff8f8!important;color:#cf2f3d!important;font-size:10px!important;font-weight:850!important;text-align:center!important}
.object-side-docs .pdf-btn-label{display:block;overflow:visible!important}
.object-actions-card-v204 .adpu-draft-note{margin:7px 2px 0;font-size:9.5px;line-height:1.25;text-align:left;color:#8491a3}

@media(max-width:1200px){
  .object-v204-layout{grid-template-columns:minmax(0,1fr) 280px}
  .object-side-date-form>label,.object-side-adpu-form>label,.object-side-term{grid-template-columns:84px minmax(0,1fr)}
  .object-side-date-form input[type='date'],.object-side-adpu-form input[type='date']{width:136px}
  .object-side-status-list>.object-side-status-row{grid-template-columns:26px minmax(0,1fr) 100px}
}
@media(max-width:980px){
  .object-v204-layout{grid-template-columns:1fr}
  .object-v204-sidebar{position:static;grid-template-columns:repeat(3,minmax(0,1fr));grid-row:1;margin-bottom:12px;gap:10px}
}
@media(max-width:760px){
  .object-v204-sidebar{grid-template-columns:1fr}
  .object-side-date-form>label,.object-side-adpu-form>label,.object-side-term{grid-template-columns:96px minmax(0,1fr)}
  .object-side-date-form input[type='date'],.object-side-adpu-form input[type='date']{width:150px;max-width:100%}
}


/* v5.211 — tighter proportions and aligned columns */
.object-v204-layout{grid-template-columns:minmax(0,1fr) 284px;gap:16px;align-items:start}
.object-v204-main,.object-v204-sidebar{align-self:start}
.object-v204-sidebar{gap:10px}
.object-v204-layout .card{border-radius:12px}

.object-hero-v204{padding:12px 16px 10px;margin-bottom:10px}
.object-hero-top{gap:10px}
.object-hero-title-line{gap:8px;margin-bottom:8px}
.object-hero-prefix{font-size:14px}
.object-hero-title-line h1{font-size:18px;line-height:1.05}
.object-hero-chip{min-height:26px;padding:3px 9px;border-radius:8px;font-size:10px}
.object-tz-copy{width:22px;height:22px}
.object-tz-copy .ui-svg{width:15px;height:15px}
.object-hero-person b{font-size:13px}
.object-hero-person span,.object-hero-person strong{font-size:11px}
.object-hero-edit,.source-edit-toggle{min-width:108px;min-height:34px;padding:6px 10px;border-radius:8px!important;font-size:10.5px!important;gap:6px}
.object-hero-edit .btn-icon .ui-svg,.source-edit-toggle .btn-icon .ui-svg{width:14px;height:14px}
.object-hero-facts{gap:8px;margin-top:10px}
.object-fact{min-height:50px;gap:8px;padding:8px 10px;border-radius:10px}
.object-fact-icon{width:30px;height:30px;border-radius:9px}
.object-fact-icon .ui-svg{width:16px;height:16px}
.object-fact b{font-size:11px}
.object-fact small{font-size:9px}
.object-hero-meta{font-size:9.5px;margin-top:7px}

.object-v204-section{margin:8px 0!important}
.object-v204-section>summary{min-height:42px;padding:7px 42px 7px 13px!important;gap:10px;font-size:14px}
.object-v204-section>summary::after{right:14px;font-size:22px}
.object-section-icon,.fold-icon.object-history-icon{width:30px!important;height:30px!important;flex-basis:30px;border-radius:9px!important}
.object-section-icon .ui-svg,.fold-icon.object-history-icon .ui-svg{width:16px!important;height:16px!important;min-width:16px!important;min-height:16px!important;stroke-width:2!important}
.object-stage-title,.fold-title{font-size:14px}
.object-stage-summary-pill{margin-right:18px!important;min-width:84px;padding:5px 10px;border-radius:9px;font-size:10px}
.fold-card-history .fold-meta{font-size:11px}
.source-data-card>summary{padding-right:170px!important}
.source-edit-toggle{right:44px;top:4px}

.object-side-card{padding:12px 13px;border-radius:12px}
.object-side-head{padding-bottom:9px;margin-bottom:2px}
.object-side-head h2{font-size:14px}
.object-side-title-icon{width:26px;height:26px;border-radius:8px}
.object-side-title-icon .ui-svg{width:15px;height:15px}
.object-side-status-list>.object-side-status-row{grid-template-columns:26px minmax(0,1fr) 88px;gap:8px;padding:9px 0}
.object-status-icon{width:24px;height:24px;border-radius:8px}
.object-status-icon .ui-svg{width:13px;height:13px}
.object-status-name{font-size:11px}
.object-side-status-list .tz-stage-status-select{height:29px;min-height:29px;border-radius:9px;font-size:10px;padding:0 24px 0 8px}
.object-side-date-form label,.object-side-adpu-form label{margin:0 0 10px}
.object-side-date-form label span,.object-side-adpu-form label span,.object-side-check span{font-size:10px}
.object-side-date-form input[type='date'],.object-side-adpu-form input[type='date']{height:33px;border-radius:8px;padding:0 9px;font-size:11px}
.object-side-term{padding:8px 10px;border-radius:8px;font-size:10px}.object-side-term b{font-size:11px}
.object-side-docs{gap:8px}
.object-side-docs .button{min-height:34px;border-radius:8px;font-size:10px;padding:0 10px}
.doc-download-pair{grid-template-columns:minmax(0,1fr) 46px;gap:6px}
.object-side-docs .pdf-icon-btn{min-width:46px;border-radius:8px;font-size:10px}
.adpu-draft-note{font-size:10px;line-height:1.25;margin-top:6px}

@media(max-width:1200px){
  .object-v204-layout{grid-template-columns:minmax(0,1fr) 268px;gap:14px}
}
@media(max-width:760px){
  .object-v204-section>summary{padding-right:38px!important}
  .object-stage-summary-pill{margin-right:16px!important;min-width:78px}
}


/* v5.212 — align top edge of right column with left hero card */
.object-v204-layout{align-items:start}
.object-v204-main{padding-top:0;margin-top:0}
.object-v204-sidebar{align-self:start;margin-top:8px;padding-top:0}
@media(max-width:980px){.object-v204-sidebar{margin-top:0}}


/* v5.213 — status words must fit without clipping */
.object-v204-layout{grid-template-columns:minmax(0,1fr) 296px;gap:16px}
.object-side-status-list>.object-side-status-row{grid-template-columns:26px minmax(0,1fr) 104px;gap:8px}
.object-side-status-list .tz-stage-status-select{width:100%;height:30px;min-height:30px;padding:0 24px 0 9px;font-size:10px;line-height:1.1}
@media(max-width:1200px){.object-v204-layout{grid-template-columns:minmax(0,1fr) 286px}.object-side-status-list>.object-side-status-row{grid-template-columns:26px minmax(0,1fr) 102px}}


/* v5.214 — compact subcontractor toggle */
.card-heading-inline{justify-content:flex-start;gap:8px;margin-bottom:6px}
.sub-toggle{display:inline-flex;align-items:center;gap:7px;width:auto;min-width:0;padding:5px 9px;border-radius:7px;background:#fff;line-height:1.15}
.sub-toggle input{width:14px;height:14px;flex:0 0 14px;margin:0}
.sub-toggle span{font-size:11px;font-weight:700;white-space:nowrap}
.sub-toggle small{display:none}
.sub-toggle.active{background:#fff7ed;border-color:#fdba74}
.sub-toggle.active span{color:#c2410c}


/* v5.215 — align columns and keep subcontractor inline */
.object-v204-sidebar{margin-top:0!important}
.sub-toggle{display:inline-flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;gap:7px!important;width:auto!important;min-width:0!important;padding:5px 9px!important}
.sub-toggle input{width:14px!important;height:14px!important;flex:0 0 14px!important;margin:0!important}
.sub-toggle span{display:inline-block!important;font-size:11px!important;font-weight:700!important;white-space:nowrap!important;line-height:1.2!important}
.card-heading-inline{display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:8px!important;margin-bottom:6px!important}


/* v5.216 — sidebar stage labels must never truncate */
.object-v204-layout{grid-template-columns:minmax(0,1fr) 304px}
.object-side-status-list>.object-side-status-row{grid-template-columns:26px minmax(0,1fr) 116px;gap:8px}
.object-side-status-list>.object-side-status-row>.tz-stage-status{display:block!important;width:100%!important;max-width:none!important;min-width:0!important}
.object-side-status-list>.object-side-status-row>.tz-stage-status .tz-stage-status-select{display:block;width:100%!important;min-width:0!important;height:30px;min-height:30px;padding:0 21px 0 10px;font-size:10px;line-height:30px;font-weight:800;white-space:nowrap;text-overflow:clip;overflow:visible}
.object-side-status-list>.object-side-status-row>.tz-stage-status .tz-stage-save-mark{display:none!important}
@media(max-width:1200px){.object-v204-layout{grid-template-columns:minmax(0,1fr) 296px}.object-side-status-list>.object-side-status-row{grid-template-columns:26px minmax(0,1fr) 112px}}


/* v5.218 — compact document readiness inside the free workflow area */
.dashboard-workflow-cell{vertical-align:top!important;padding:8px 8px 9px!important}
.dashboard-stage-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;align-items:center}
.dashboard-stage-item{min-width:0}
.dashboard-stage-label{display:none}
.dashboard-stage-item .tz-stage-status{display:block!important;width:100%!important;max-width:none!important;min-width:0!important}
.dashboard-stage-item .tz-stage-save-mark{display:none!important}
.dashboard-stage-item .tz-stage-status-select{
  display:block;width:100%!important;min-width:0!important;max-width:none!important;
  height:28px;min-height:28px;padding:0 22px!important;border-radius:999px;
  font-size:10px;line-height:28px;font-weight:800;
  text-align:center!important;text-align-last:center!important;
}
.dashboard-document-readiness{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 10px;
  width:min(100%,520px);margin-top:8px;padding-top:7px;border-top:1px solid #e9eef5;
}
.dashboard-doc-mini{min-width:0;display:grid;grid-template-columns:1fr;gap:4px;padding:0 4px}
.dashboard-doc-mini+.dashboard-doc-mini{border-left:1px solid #e8edf4;padding-left:12px}
.dashboard-doc-mini-title{font-size:9.5px;line-height:1.05;color:#66758b;font-weight:700;white-space:nowrap}
.dashboard-doc-mini-status{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;width:max-content;max-width:100%;
  min-height:24px;padding:4px 10px;border-radius:999px;border:1px solid transparent;
  font-size:9.5px;line-height:1;font-weight:800;white-space:nowrap;
}
.dashboard-doc-mini-status i{width:7px;height:7px;border-radius:50%;background:currentColor;flex:0 0 7px}
.dashboard-doc-mini-status.ready{background:#e8f7ed;color:#148044;border-color:#cdebd8}
.dashboard-doc-mini-status.progress{background:#fff4d9;color:#9b6800;border-color:#f0dfb2}
.dashboard-doc-mini-status.prep{background:#f1f4f8;color:#66758b;border-color:#e1e6ee}
.dashboard-doc-mini-status.blocked{background:#fdecef;color:#b43b52;border-color:#f3ccd4}
.dashboard-doc-complete{
  grid-column:1/-1;display:flex;align-items:center;justify-content:center;gap:6px;
  min-height:24px;padding:4px 10px;border-radius:8px;background:#e7f7ec;color:#137b42;
  font-size:9.5px;line-height:1;font-weight:850;
}
.dashboard-doc-complete span{display:inline-grid;place-items:center;width:15px;height:15px;border-radius:50%;background:#16964f;color:#fff;font-size:10px;line-height:1}

/* Dashboard status selects: center the label visually and remove the hidden save-column offset. */
.dashboard-table .dashboard-stage-grid .tz-stage-status-select{box-sizing:border-box}
.dashboard-table .dashboard-stage-grid .tz-stage-status{grid-template-columns:1fr!important;gap:0!important}

@media(min-width:1601px){
  .dashboard-table td.dashboard-workflow-cell{width:auto!important;min-width:460px!important}
  .dashboard-table td.doc-actions{width:220px!important;min-width:220px!important}
  .dashboard-table td.dashboard-expand-cell{width:42px!important;min-width:42px!important;padding-left:5px!important;padding-right:5px!important}
}

/* The medium desktop/card layout now has five real cells because workflow spans four table columns. */
@media (min-width:641px) and (max-width:1600px){
  .dashboard-table tr.object-row{grid-template-columns:minmax(205px,.95fr) minmax(305px,2.05fr) 40px!important}
  .dashboard-table tr.object-row>td:nth-child(1){grid-column:1!important;grid-row:1!important}
  .dashboard-table tr.object-row>td:nth-child(2){grid-column:2!important;grid-row:1!important;border-left:1px solid var(--line)}
  .dashboard-table tr.object-row>td.dashboard-workflow-cell{grid-column:1/3!important;grid-row:2!important;border-left:0!important;border-bottom:1px solid var(--line)!important}
  .dashboard-table tr.object-row>td.dashboard-workflow-cell::before{display:none!important}
  .dashboard-table tr.object-row>td.doc-actions{grid-column:1/3!important;grid-row:3!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px!important;border-bottom:0!important}
  .dashboard-table tr.object-row>td.doc-actions::before{grid-column:1/-1}
  .dashboard-table tr.object-row>td.dashboard-expand-cell{grid-column:3!important;grid-row:1/4!important;display:flex!important;align-items:center!important;justify-content:center!important;border-left:1px solid var(--line)!important;border-bottom:0!important}
  .dashboard-stage-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .dashboard-document-readiness{width:min(100%,560px)}
}

@media(max-width:640px){
  .dashboard-workflow-cell{display:block!important}
  .dashboard-stage-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .dashboard-stage-label{display:block;margin:0 0 4px;font-size:9px;color:var(--muted);font-weight:800}
  .dashboard-document-readiness{grid-template-columns:1fr;margin-top:10px;width:100%}
  .dashboard-doc-mini{grid-template-columns:90px minmax(0,1fr);align-items:center;gap:8px;padding:0}
  .dashboard-doc-mini+.dashboard-doc-mini{border-left:0;border-top:1px solid #edf1f5;padding:6px 0 0}
  .dashboard-doc-mini-status{justify-content:flex-start}
}


/* v5.219 — lighter document readiness: three compact states OR one compact complete pill */
.dashboard-document-readiness{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px 9px;
  width:min(100%,430px);margin-top:6px;padding-top:6px;border-top:1px solid #edf1f5;
}
.dashboard-document-readiness.is-complete{grid-template-columns:1fr;width:max-content;max-width:100%;border-top-color:#edf4ef}
.dashboard-doc-mini{min-width:0;display:grid;grid-template-columns:1fr;gap:3px;padding:0 2px}
.dashboard-doc-mini+.dashboard-doc-mini{border-left:1px solid #edf1f5;padding-left:10px}
.dashboard-doc-mini-title{font-size:9px;line-height:1.05;color:#7a8799;font-weight:500;white-space:nowrap}
.dashboard-doc-mini-status{
  display:inline-flex;align-items:center;justify-content:center;gap:5px;width:max-content;max-width:100%;
  min-height:22px;padding:3px 9px;border-radius:999px;border:1px solid transparent;
  font-size:9px;line-height:1;font-weight:700;white-space:nowrap;
}
.dashboard-doc-mini-status i{width:6px;height:6px;border-radius:50%;background:currentColor;flex:0 0 6px}
.dashboard-doc-complete{
  grid-column:1/-1;justify-self:start;display:inline-flex;align-items:center;gap:6px;
  min-height:22px;padding:4px 10px;border-radius:999px;background:#e9f7ee;color:#157d45;
  border:1px solid #cfe9d7;font-size:9px;line-height:1;font-weight:700;white-space:nowrap;
}
.dashboard-doc-complete span{display:inline-grid;place-items:center;width:14px;height:14px;border-radius:50%;background:#16964f;color:#fff;font-size:9px;line-height:1}

@media(max-width:1100px){
  .dashboard-document-readiness{width:min(100%,380px)}
}
@media(max-width:760px){
  .dashboard-document-readiness{grid-template-columns:1fr;width:100%;gap:6px;padding-top:6px}
  .dashboard-doc-mini{grid-template-columns:90px minmax(0,1fr);align-items:center;gap:8px;padding:0}
  .dashboard-doc-mini+.dashboard-doc-mini{border-left:0;border-top:1px solid #edf1f5;padding:6px 0 0}
  .dashboard-doc-complete{justify-self:stretch;justify-content:center}
}


/* v5.220 — keep the document-actions column inside normal table geometry on wide screens */
@media(min-width:1601px){
  .dashboard-table td.doc-actions{
    display:table-cell!important;
    vertical-align:middle!important;
    width:220px!important;
    min-width:220px!important;
    padding:8px 8px!important;
    box-sizing:border-box;
  }
  .dashboard-table td.doc-actions .doc-download-pair{
    width:100%;
    margin:0;
  }
  .dashboard-table td.doc-actions .doc-download-pair + .doc-download-pair{
    margin-top:6px;
  }
  .dashboard-table td.doc-actions .tiny{
    display:block;
    margin-top:5px;
  }
  .dashboard-table td.dashboard-expand-cell{
    display:table-cell!important;
    vertical-align:middle!important;
    text-align:center!important;
    width:42px!important;
    min-width:42px!important;
    padding:8px 5px!important;
    box-sizing:border-box;
  }
}


/* v5.221 — align document readiness to the outer workflow statuses */
.dashboard-document-readiness{
  width:100%!important;
  max-width:none!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  column-gap:0!important;
  row-gap:6px!important;
}
.dashboard-doc-mini{
  display:grid!important;
  grid-template-columns:auto!important;
  width:max-content!important;
  max-width:100%!important;
  justify-items:center!important;
  gap:3px!important;
  padding:0!important;
  border-left:0!important;
}
.dashboard-doc-mini:nth-child(1){justify-self:start!important}
.dashboard-doc-mini:nth-child(2){justify-self:center!important}
.dashboard-doc-mini:nth-child(3){justify-self:end!important}
.dashboard-doc-mini-title{
  width:100%;
  text-align:center!important;
  font-weight:500!important;
}
.dashboard-doc-mini-status{justify-self:center!important}
.dashboard-document-readiness.is-complete{
  width:100%!important;
  max-width:none!important;
  grid-template-columns:1fr!important;
}
.dashboard-document-readiness.is-complete .dashboard-doc-complete{
  justify-self:center!important;
  justify-content:center!important;
}
@media(max-width:760px){
  .dashboard-document-readiness{grid-template-columns:1fr!important}
  .dashboard-doc-mini:nth-child(1),
  .dashboard-doc-mini:nth-child(2),
  .dashboard-doc-mini:nth-child(3){justify-self:stretch!important;width:100%!important}
}


/* v5.222 — document readiness without dots; centered text */
.dashboard-doc-mini-status{
  justify-content:center!important;
  text-align:center!important;
  gap:0!important;
}
.dashboard-doc-mini-status i{display:none!important}


/* v5.223: more compact montage inbox + top application presence */
.montage-inbox-list{gap:8px}
.montage-event{padding:10px 12px;border-radius:11px}
.montage-event-top{gap:10px;align-items:flex-start}
.event-title-row{gap:7px}
.event-title-row .tz{font-size:15px;line-height:1.15}
.event-object{font-size:13px;line-height:1.2;margin-top:2px}
.event-flags{display:flex;flex-wrap:wrap;gap:6px;margin-top:5px}
.event-flag{display:inline-flex;align-items:center;min-height:20px;padding:2px 8px;border-radius:999px;border:1px solid transparent;font-size:10.5px;line-height:1;font-weight:700;white-space:nowrap}
.event-flag.ok{background:#e8f6ec;border-color:#cae9d2;color:#237a3b}
.event-flag.wait{background:#fff3db;border-color:#f0d79b;color:#9a6700}
.montage-event .small{font-size:11.5px;line-height:1.25;margin-top:4px}
.event-time{font-size:11.5px;white-space:nowrap}
.event-time b{font-size:11.5px}
.event-meta{gap:6px;margin-top:8px}
.event-meta>div{padding:7px 9px;border-radius:8px}
.event-meta span{font-size:9.5px;margin-bottom:2px}
.event-meta b{font-size:12px;line-height:1.15}
.event-note{margin-top:8px;padding:7px 9px;font-size:12px;border-radius:8px}
.event-actions{gap:7px;margin-top:8px;flex-wrap:wrap}
.event-actions .button,.event-actions .primary{padding:7px 11px;font-size:12px;border-radius:8px;min-height:34px}
.inbox-new{font-size:9.5px;padding:2px 6px}
.inbox-summary{padding:9px 11px}
@media(max-width:640px){
  .montage-event{padding:10px}
  .event-title-row .tz{font-size:16px}
  .event-time{font-size:11px}
  .event-meta{grid-template-columns:1fr}
}


/* v5.225 — mobile polish: horizontal document readiness, sane object card, smaller montage checkboxes */
@media(max-width:760px){
  /* On phone, keep the object card main content first and remove narrow-fit issues. */
  .object-v204-main{order:1;min-width:0}
  .object-v204-sidebar{order:2;grid-row:auto!important;grid-template-columns:1fr!important;gap:10px;min-width:0;width:100%;margin-bottom:0!important}
  .object-v204-layout,.object-v204-main,.object-v204-sidebar,.object-hero-v204,.object-v204-section,.object-side-card{min-width:0}
  .object-hero-v204{padding:10px 12px 9px}
  .object-hero-title-line{gap:6px;row-gap:6px}
  .object-hero-chip{min-height:24px;padding:3px 8px;font-size:9.5px}
  .object-hero-person b,.object-hero-person span,.object-hero-person strong{white-space:normal;word-break:break-word}
  .object-hero-facts{grid-template-columns:1fr!important;gap:7px!important;margin-top:8px!important}
  .object-fact,.object-fact.object-fact-wide{width:100%;min-width:0;padding:8px 10px!important}
  .object-fact>div{min-width:0}
  .object-fact b,.object-fact small{display:block;white-space:normal;word-break:break-word}
  .object-side-date-form>label,
  .object-side-adpu-form>label,
  .object-side-term{grid-template-columns:1fr!important;gap:6px!important;align-items:start}
  .object-side-date-form input[type='date'],
  .object-side-adpu-form input[type='date']{width:100%!important;max-width:100%!important;justify-self:stretch!important}
  .object-side-check{grid-template-columns:1fr auto!important}
  .object-side-term b{justify-self:start!important;text-align:left!important}

  /* In mobile dashboard, keep document readiness horizontal like on desktop. */
  .dashboard-document-readiness{grid-template-columns:repeat(3,minmax(0,1fr))!important;width:100%!important;max-width:none!important;column-gap:0!important;row-gap:6px!important;padding-top:6px!important}
  .dashboard-doc-mini{width:100%!important;max-width:100%!important;justify-items:center!important;gap:3px!important;padding:0 2px!important;grid-template-columns:1fr!important;align-items:start!important}
  .dashboard-doc-mini:nth-child(1){justify-self:start!important}
  .dashboard-doc-mini:nth-child(2){justify-self:center!important}
  .dashboard-doc-mini:nth-child(3){justify-self:end!important}
  .dashboard-doc-mini+.dashboard-doc-mini{border-top:0!important;border-left:1px solid #edf1f5!important;padding:0 0 0 8px!important}
  .dashboard-doc-mini-title{width:100%!important;text-align:center!important;font-size:8.5px!important;font-weight:500!important;white-space:normal!important}
  .dashboard-doc-mini-status{justify-content:center!important;text-align:center!important;min-height:21px!important;padding:3px 8px!important;font-size:8.5px!important}
  .dashboard-document-readiness.is-complete{grid-template-columns:1fr!important}
  .dashboard-document-readiness.is-complete .dashboard-doc-complete{justify-self:center!important;justify-content:center!important;width:auto!important;max-width:100%!important}

  /* Montage toggles / checkboxes — smaller and visually calmer on phones. */
  .voltage-supplied-check{display:inline-flex!important;align-items:flex-start!important;justify-content:flex-start!important;gap:6px!important;padding:7px 9px!important;border-radius:8px!important;max-width:100%}
  .voltage-supplied-check input{width:14px!important;height:14px!important;flex:0 0 14px!important;margin-top:1px!important;transform:scale(.88)!important;transform-origin:center center;accent-color:#1f6feb}
  .voltage-supplied-check span{font-size:11px!important;line-height:1.15!important}
  .voltage-supplied-check small{font-size:9px!important;line-height:1.15!important;padding-left:20px!important}
  .loss-mkd-check{display:inline-flex!important;align-items:center!important;justify-content:flex-start!important;gap:6px!important;font-size:11px!important;line-height:1.2!important}
  .loss-mkd-check input{width:14px!important;height:14px!important;flex:0 0 14px!important;transform:scale(.88)!important;transform-origin:center center;accent-color:#1f6feb}
}


/* v5.226 — optional CT block in montage */
.tt-toggle-row{margin:14px 0 10px}
.tt-toggle-check{
  display:inline-flex;align-items:center;gap:7px;flex-wrap:wrap;
  padding:7px 10px;border:1px solid var(--line);border-radius:9px;
  background:#f8fafc;cursor:pointer;user-select:none;line-height:1;
}
.tt-toggle-check input{width:15px;height:15px;margin:0;accent-color:#1f6feb;flex:0 0 15px}
.tt-toggle-check span{font-weight:800;font-size:12px;line-height:1.1}
.tt-toggle-check small{font-size:10px;color:var(--muted);font-weight:600;line-height:1.15;flex-basis:100%;padding-left:22px}
.tt-toggle-check.active{background:#eef6ff;border-color:#b9d5ff}
.tt-toggle-check.active span{color:#125cc8}
.ct-fields-block{overflow:hidden;max-height:2000px;opacity:1;transform:translateY(0);transition:max-height .22s ease,opacity .18s ease,transform .18s ease;margin-top:0}
.ct-fields-block.is-collapsed{max-height:0;opacity:0;transform:translateY(-4px);pointer-events:none;margin-top:-4px}
@media(max-width:760px){
  .tt-toggle-row{margin:12px 0 8px}
  .tt-toggle-check{padding:7px 9px;border-radius:8px;max-width:100%}
  .tt-toggle-check input{width:14px;height:14px;flex:0 0 14px;transform:scale(.88);transform-origin:center center}
  .tt-toggle-check span{font-size:11px;line-height:1.15}
  .tt-toggle-check small{font-size:9px;line-height:1.15;padding-left:20px}
}


/* v5.227 — compact mobile montage toggles + denser new-montages cards */
/* Desktop / common compactness for "Новые монтажи" */
.montage-inbox-list{gap:7px !important}
.montage-event{padding:9px 11px !important;border-radius:10px !important}
.montage-event-top{gap:8px !important;align-items:flex-start !important}
.event-title-row{gap:6px !important}
.event-title-row .tz{font-size:14px !important;line-height:1.12 !important}
.event-object{font-size:12.5px !important;line-height:1.18 !important;margin-top:1px !important}
.event-flags{gap:5px !important;margin-top:4px !important}
.event-flag{min-height:18px !important;padding:2px 7px !important;font-size:10px !important}
.montage-event .small{font-size:11px !important;line-height:1.2 !important;margin-top:3px !important}
.event-time,.event-time b{font-size:11px !important;line-height:1.15 !important}
.event-meta{gap:5px !important;margin-top:7px !important}
.event-meta>div{padding:6px 8px !important;border-radius:7px !important}
.event-meta span{font-size:9px !important;margin-bottom:2px !important}
.event-meta b{font-size:11.5px !important;line-height:1.1 !important}
.event-note{margin-top:7px !important;padding:6px 8px !important;font-size:11.5px !important;border-radius:7px !important}
.event-actions{gap:6px !important;margin-top:7px !important}
.event-actions .button,.event-actions .primary{padding:6px 10px !important;font-size:11.5px !important;min-height:32px !important;border-radius:7px !important}
.inbox-new{font-size:9px !important;padding:1px 6px !important}
.inbox-summary{padding:8px 10px !important}

/* Phone: move text to the right of checkbox and make the control visibly smaller */
@media(max-width:760px){
  .voltage-supplied-check,
  .tt-toggle-check{
    display:grid !important;
    grid-template-columns:14px minmax(0,1fr) !important;
    grid-template-rows:auto auto !important;
    align-items:center !important;
    column-gap:8px !important;
    row-gap:2px !important;
    padding:7px 10px !important;
    border-radius:8px !important;
    max-width:100% !important;
    width:auto !important;
  }
  .voltage-supplied-check input,
  .tt-toggle-check input{
    grid-column:1 !important;
    grid-row:1 / span 2 !important;
    width:14px !important;
    height:14px !important;
    min-width:14px !important;
    min-height:14px !important;
    margin:0 !important;
    transform:none !important;
    align-self:start !important;
  }
  .voltage-supplied-check span,
  .tt-toggle-check span{
    grid-column:2 !important;
    grid-row:1 !important;
    font-size:11px !important;
    line-height:1.15 !important;
    font-weight:700 !important;
    text-align:left !important;
    white-space:normal !important;
  }
  .voltage-supplied-check small,
  .tt-toggle-check small{
    grid-column:2 !important;
    grid-row:2 !important;
    padding-left:0 !important;
    font-size:9px !important;
    line-height:1.15 !important;
    text-align:left !important;
    white-space:normal !important;
    flex-basis:auto !important;
  }

  .loss-mkd-check{
    display:grid !important;
    grid-template-columns:14px minmax(0,1fr) !important;
    align-items:center !important;
    gap:8px !important;
    font-size:11px !important;
    line-height:1.2 !important;
  }
  .loss-mkd-check input{
    width:14px !important;height:14px !important;min-width:14px !important;min-height:14px !important;
    margin:0 !important;transform:none !important;
  }

  /* Slightly denser mobile new-montages page too */
  .montage-event{padding:9px !important}
  .event-meta>div{padding:6px 7px !important}
  .event-actions{gap:7px !important}
  .event-actions .button,.event-actions .primary{min-height:31px !important;padding:6px 9px !important;font-size:11.5px !important}
}


/* v5.228 — same compact montage toggles in desktop web UI */
.voltage-supplied-check,
.tt-toggle-check{
  display:grid !important;
  grid-template-columns:14px minmax(0,1fr) !important;
  grid-template-rows:auto auto !important;
  align-items:center !important;
  column-gap:7px !important;
  row-gap:2px !important;
  width:max-content !important;
  max-width:100% !important;
  min-width:0 !important;
  padding:6px 9px !important;
  border-radius:8px !important;
}
.voltage-supplied-check input,
.tt-toggle-check input{
  grid-column:1 !important;
  grid-row:1 / span 2 !important;
  width:14px !important;
  height:14px !important;
  min-width:14px !important;
  min-height:14px !important;
  margin:0 !important;
  transform:none !important;
  align-self:center !important;
}
.voltage-supplied-check span,
.tt-toggle-check span{
  grid-column:2 !important;
  grid-row:1 !important;
  display:block !important;
  font-size:11px !important;
  line-height:1.15 !important;
  font-weight:700 !important;
  text-align:left !important;
  white-space:normal !important;
}
.voltage-supplied-check small,
.tt-toggle-check small{
  grid-column:2 !important;
  grid-row:2 !important;
  display:block !important;
  padding-left:0 !important;
  font-size:9px !important;
  line-height:1.15 !important;
  font-weight:600 !important;
  text-align:left !important;
  white-space:normal !important;
  flex-basis:auto !important;
}

/* desktop inbox: keep cards visibly denser, not just mobile */
@media(min-width:761px){
  .montage-inbox-list{gap:6px !important}
  .montage-event{padding:8px 10px !important}
  .montage-event-top{gap:7px !important}
  .event-meta{margin-top:6px !important;gap:5px !important}
  .event-meta>div{padding:5px 7px !important}
  .event-actions{margin-top:6px !important;gap:5px !important}
  .event-actions .button,.event-actions .primary{min-height:30px !important;padding:5px 9px !important;font-size:11px !important}
}


/* v5.230 — installer/partner account-driven selectors */
.worker-grid select{width:100%;min-width:0;box-sizing:border-box}
.worker-grid .field-note{display:block;margin-top:4px;font-size:9.5px;line-height:1.2;color:var(--muted);font-weight:600}
@media(max-width:760px){
  .worker-grid select{height:40px;min-height:40px;font-size:14px}
  .worker-grid .field-note{font-size:9px;margin-top:3px}
}


/* v5.232 — optional removed-meter block, styled like the CT toggle */
.removed-meter-toggle-row{margin:2px 0 10px}
.removed-meter-toggle-check{
  display:grid;grid-template-columns:14px minmax(0,1fr);grid-template-rows:auto auto;
  align-items:center;column-gap:7px;row-gap:2px;width:max-content;max-width:100%;
  padding:6px 9px;border:1px solid var(--line);border-radius:8px;background:#f8fafc;
  cursor:pointer;user-select:none;line-height:1;
}
.removed-meter-toggle-check input{
  grid-column:1;grid-row:1 / span 2;width:14px;height:14px;min-width:14px;min-height:14px;
  margin:0;accent-color:#1f6feb;align-self:center;
}
.removed-meter-toggle-check span{grid-column:2;grid-row:1;font-size:11px;line-height:1.15;font-weight:700;text-align:left}
.removed-meter-toggle-check small{grid-column:2;grid-row:2;font-size:9px;line-height:1.15;color:var(--muted);font-weight:600;text-align:left}
.removed-meter-toggle-check.active{background:#eef6ff;border-color:#b9d5ff}
.removed-meter-toggle-check.active span{color:#125cc8}
.removed-meter-fields{overflow:hidden;max-height:420px;opacity:1;transform:translateY(0);transition:max-height .22s ease,opacity .18s ease,transform .18s ease}
.removed-meter-fields.is-collapsed{max-height:0;opacity:0;transform:translateY(-4px);pointer-events:none}
@media(max-width:760px){
  .removed-meter-toggle-row{margin:2px 0 8px}
  .removed-meter-toggle-check{column-gap:8px;padding:7px 10px;width:auto}
}


/* v5.234 — denser dashboard statuses and document buttons */
.dashboard-stage-grid{gap:7px!important}
.dashboard-stage-item .tz-stage-status-select{
  height:24px!important;
  min-height:24px!important;
  padding:0 18px!important;
  border-radius:999px!important;
  font-size:9.5px!important;
  line-height:24px!important;
  font-weight:500!important;
}
.dashboard-table .tz-stage-status-select{font-weight:500!important}
.dashboard-workflow-cell{padding-top:7px!important;padding-bottom:7px!important}
.dashboard-document-readiness{margin-top:5px!important;padding-top:5px!important}

@media(min-width:761px){
  .dashboard-table td.doc-actions{padding:6px 7px!important}
  .dashboard-table td.doc-actions .doc-download-pair + .doc-download-pair{margin-top:4px!important}
  .dashboard-table .dashboard-doc-btn{
    min-height:32px!important;
    height:32px!important;
    padding:0 9px!important;
    border-radius:7px!important;
    font-size:9.5px!important;
    line-height:1.05!important;
    font-weight:600!important;
    gap:4px!important;
  }
  .dashboard-table .dashboard-doc-btn svg{width:12px!important;height:12px!important}
  .dashboard-table .doc-actions .doc-download-pair .pdf-icon-btn{
    width:36px!important;
    min-width:36px!important;
    max-width:36px!important;
    height:32px!important;
    min-height:32px!important;
    padding:0!important;
    border-radius:7px!important;
    font-size:9px!important;
    font-weight:700!important;
  }
  .dashboard-table .doc-actions .doc-download-pair{grid-template-columns:minmax(0,1fr) 36px!important;gap:5px!important}
  .dashboard-table td.doc-actions .tiny{margin-top:3px!important;font-size:8.5px!important;line-height:1.1!important}
}


/* v5.235 — dashboard status keeps only its own status border after manual change */
.dashboard-table .tz-stage-status.is-manual .tz-stage-status-select{box-shadow:none!important}
.dashboard-table .tz-stage-status-select:focus{outline:none!important;box-shadow:none!important}
.dashboard-table .tz-stage-status.stage-ready .tz-stage-status-select:focus{border-color:#ccebd9!important}
.dashboard-table .tz-stage-status.stage-waiting .tz-stage-status-select:focus{border-color:#f1dfae!important}
.dashboard-table .tz-stage-status.stage-remark .tz-stage-status-select:focus{border-color:#f2c8d0!important}


/* v5.236 — center text in the stage-status dropdown */
.tz-stage-status-select{
  text-align:center!important;
  text-align-last:center!important;
}
.tz-stage-status-select option{
  text-align:center!important;
  text-align-last:center!important;
}


/* v5.237 — visually center dashboard document-button labels independently of their icons */
@media(min-width:761px){
  .dashboard-table .dashboard-doc-btn{
    display:grid!important;
    grid-template-columns:14px minmax(0,1fr) 14px!important;
    align-items:center!important;
    justify-content:stretch!important;
    column-gap:4px!important;
  }
  .dashboard-table .dashboard-doc-btn svg{
    grid-column:1!important;
    justify-self:center!important;
    margin:0!important;
  }
  .dashboard-table .dashboard-doc-btn>span{
    grid-column:2!important;
    justify-self:stretch!important;
    text-align:center!important;
    min-width:0!important;
  }
  .dashboard-table .dashboard-doc-btn::after{
    content:"";
    grid-column:3!important;
    width:14px;
    height:1px;
  }
}


/* v5.238 — live montage inbox badge + SSE toast */
.sidebar-badge[hidden]{display:none!important}
.sidebar-badge.live-pulse{animation:montage-badge-pulse .55s ease}
@keyframes montage-badge-pulse{
  0%{transform:scale(.82)}
  55%{transform:scale(1.18)}
  100%{transform:scale(1)}
}
.live-montage-toast-stack{
  position:fixed;right:18px;top:70px;z-index:1200;
  display:grid;gap:8px;width:min(330px,calc(100vw - 32px));pointer-events:none;
}
.live-montage-toast{
  display:grid;gap:3px;padding:11px 13px;border:1px solid #b9d5ff;border-radius:11px;
  background:rgba(255,255,255,.97);box-shadow:0 10px 28px rgba(28,63,112,.16);
  color:#172033;text-decoration:none;pointer-events:auto;
  animation:montage-toast-in .2s ease-out;
}
.live-montage-toast:hover{border-color:#7fb0ff;box-shadow:0 12px 30px rgba(28,63,112,.2)}
.live-montage-toast b{font-size:12px;line-height:1.2;color:#125cc8}
.live-montage-toast span{font-size:11.5px;line-height:1.25;font-weight:700;overflow-wrap:anywhere}
.live-montage-toast small{font-size:9.5px;line-height:1.2;color:var(--muted)}
.live-montage-toast.leaving{opacity:0;transform:translateY(-5px);transition:opacity .2s ease,transform .2s ease}
@keyframes montage-toast-in{
  from{opacity:0;transform:translateY(-6px)}
  to{opacity:1;transform:translateY(0)}
}
@media(max-width:760px){
  .live-montage-toast-stack{right:10px;top:62px;width:calc(100vw - 20px)}
  .live-montage-toast{padding:10px 11px}
}


/* v5.239 — show full signed-in user name in the top bar */
.topbar-user .user-name{
  max-width:none!important;
  overflow:visible!important;
  text-overflow:clip!important;
  white-space:nowrap!important;
}
@media(max-width:700px){
  .topbar-user .user-name{max-width:none!important;overflow:visible!important;text-overflow:clip!important;white-space:nowrap!important;font-size:10px}
}


/* v5.240 — keep dashboard document actions pinned to the top of each row */
@media(min-width:1601px){
  .dashboard-table td.doc-actions{
    vertical-align:top!important;
    padding-top:7px!important;
    padding-bottom:6px!important;
  }
  .dashboard-table td.doc-actions .doc-download-pair:first-of-type{margin-top:0!important}
}


/* v5.242 — reserve Excel info is a compact informational strip */
.backup-source-card{
  padding:9px 12px !important;
  min-height:0 !important;
  gap:14px !important;
  align-items:center !important;
}
.backup-source-card>div:first-child{min-width:0;display:grid;grid-template-columns:auto auto;column-gap:8px;row-gap:2px;align-items:baseline}
.backup-source-card .eyebrow{grid-column:1;font-size:8.5px !important;line-height:1.1;letter-spacing:.055em}
.backup-source-card h2{grid-column:2;margin:0 !important;font-size:12px !important;line-height:1.1}
.backup-source-card p{grid-column:1/-1;margin:0 !important;line-height:1.2}
.backup-source-card p.muted{font-size:10.5px !important}
.backup-source-card p.small{font-size:9.5px !important;color:#738096}
.backup-source-card .source-actions{flex:0 0 auto;margin:0 !important}
.backup-source-card .source-actions .button{display:inline-flex !important;align-items:center !important;justify-content:center !important;gap:6px !important;min-height:30px !important;height:30px;padding:5px 10px !important;font-size:10.5px !important;border-radius:7px !important;white-space:nowrap;text-align:center !important;vertical-align:middle !important}
@media(max-width:760px){
  .backup-source-card{padding:8px 10px !important;display:flex !important;flex-direction:column !important;align-items:stretch !important;gap:7px !important}
  .backup-source-card>div:first-child{grid-template-columns:auto 1fr}
  .backup-source-card .source-actions{display:block !important;width:100% !important}
  .backup-source-card .source-actions .button{width:100% !important}
}


/* v5.244: аккуратная и адаптивная страница пользователей */
.user-create-card{padding:16px 18px}
.user-create-card h2{margin-bottom:12px}
.user-create-grid{
    grid-template-columns:minmax(180px,1fr) minmax(220px,1.25fr) minmax(170px,.85fr) minmax(230px,1.1fr) auto;
    gap:12px;
    align-items:end;
}
.user-create-grid .user-permission-wide{
    grid-column:1/-1;
}
.user-create-grid .user-create-submit{
    min-height:40px;
    padding:0 16px;
    white-space:nowrap;
}

.user-permission-title,
.user-manage-permissions-head{
    display:block;
    margin:0 0 8px;
    font-size:12px;
    font-weight:700;
    color:#344054;
}
.user-permissions,
.user-permissions.compact{
    display:flex !important;
    flex-wrap:wrap;
    align-items:flex-start;
    gap:8px 10px !important;
    width:auto !important;
    max-width:none !important;
    margin-top:0 !important;
}
.user-permission-check{
    display:inline-flex !important;
    flex-direction:row !important;
    align-items:center !important;
    justify-content:flex-start !important;
    width:auto !important;
    min-width:0 !important;
    min-height:32px !important;
    padding:0 10px !important;
    gap:7px !important;
    border:1px solid #d0d5dd !important;
    border-radius:999px !important;
    background:#fff !important;
    font-size:11px !important;
    font-weight:600 !important;
    line-height:1 !important;
    text-align:left !important;
}
.user-permission-check:hover{background:#f8fafc !important;border-color:#bfc9d6 !important}
.user-permission-check span{
    display:inline-block !important;
    width:auto !important;
    min-height:0 !important;
    line-height:1.15 !important;
    overflow-wrap:normal !important;
    white-space:normal;
}
.user-permission-check input{
    width:14px !important;
    height:14px !important;
    flex:0 0 14px !important;
}
.user-permission-check.mandatory{
    background:#f5f7fb !important;
    color:#667085 !important;
}
.user-permission-check:has(input:checked){
    background:#eef6ff !important;
    border-color:#bcd2ee !important;
    color:#1d4f91 !important;
}
.user-permissions-note{
    max-width:none !important;
    margin-top:8px !important;
    font-size:11px !important;
    line-height:1.35 !important;
}

.users-desktop-list{
    display:grid;
    gap:14px;
    margin-top:14px;
}
.user-manage-card{
    padding:16px 18px;
    border-radius:16px;
}
.user-manage-head{
    display:flex;
    justify-content:space-between;
    gap:16px;
    align-items:flex-start;
    margin-bottom:14px;
}
.user-manage-name-row{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
}
.user-manage-name{
    font-size:20px;
    font-weight:800;
    color:#101828;
    line-height:1.15;
}
.user-self-badge{
    display:inline-flex;
    align-items:center;
    height:24px;
    padding:0 10px;
    border-radius:999px;
    background:#eef4ff;
    color:#2453a6;
    font-size:11px;
    font-weight:700;
}
.user-manage-meta{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    justify-content:flex-end;
}
.user-meta-item{
    min-width:140px;
    padding:9px 12px;
    border:1px solid #e3e8ef;
    border-radius:12px;
    background:#fbfcfe;
}
.user-meta-item span,
.user-field-caption{
    display:block;
    margin-bottom:4px;
    font-size:11px;
    color:#667085;
}
.user-meta-item b,
.user-field-view strong{
    font-size:13px;
    color:#101828;
}
.user-inline-fields{
    display:grid;
    grid-template-columns:minmax(220px,1.5fr) minmax(180px,.9fr) 120px;
    gap:12px;
    align-items:end;
}
.user-inline-fields.compact-view{
    grid-template-columns:repeat(2, minmax(220px, 1fr));
}
.user-field-view{
    padding:10px 12px;
    border:1px solid #e3e8ef;
    border-radius:12px;
    background:#fbfcfe;
}
.user-active-inline{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    min-height:42px;
    padding:0 12px;
    border:1px solid #d0d5dd;
    border-radius:12px;
    background:#fff;
    font-weight:600;
}
.user-active-inline input{
    width:18px;
    height:18px;
    margin:0;
}
.user-manage-form{
    display:grid;
    gap:14px;
}
.user-manage-permissions-wrap{
    padding:12px 14px;
    border:1px solid #e4e7ec;
    border-radius:14px;
    background:#fcfdff;
}
.user-manage-actions-row{
    display:flex;
    justify-content:flex-end;
}
.user-secondary-row{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:14px;
    margin-top:14px;
    padding-top:14px;
    border-top:1px solid #eef2f6;
}
.user-password-inline{
    display:grid;
    grid-template-columns:auto minmax(260px, 1fr) auto;
    gap:10px;
    align-items:end;
    flex:1 1 auto;
}
.user-password-inline .password-field,
.user-password-inline input[type="password"]{
    width:100%;
}
.user-password-label{
    font-size:12px;
    font-weight:700;
    color:#344054;
    padding-bottom:10px;
}
.user-delete-slot{
    display:flex;
    justify-content:flex-end;
    align-items:center;
    min-width:150px;
}
.current-user-note{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:38px;
    padding:0 12px;
    border-radius:10px;
    background:#f7f9fc;
}
.user-protected-box{
    display:grid;
    gap:10px;
}

@media (max-width: 1300px){
    .user-create-grid{
        grid-template-columns:repeat(2, minmax(220px,1fr));
    }
    .user-create-grid .user-create-submit{
        width:100%;
    }
    .user-manage-head{
        flex-direction:column;
    }
    .user-manage-meta{
        justify-content:flex-start;
    }
    .user-inline-fields{
        grid-template-columns:1fr 200px 120px;
    }
    .user-password-inline{
        grid-template-columns:1fr auto;
    }
    .user-password-label{
        grid-column:1/-1;
        padding-bottom:0;
    }
}
@media (max-width: 980px){
    .user-inline-fields,
    .user-inline-fields.compact-view{
        grid-template-columns:1fr;
    }
    .user-secondary-row{
        flex-direction:column;
        align-items:stretch;
    }
    .user-password-inline{
        width:100%;
        grid-template-columns:1fr;
    }
    .user-delete-slot{
        min-width:0;
        width:100%;
        justify-content:flex-start;
    }
    .user-delete-slot form,
    .user-delete-slot .current-user-note{
        width:100%;
    }
}
@media (max-width: 900px){
    .user-create-grid{
        grid-template-columns:1fr;
    }
}



/* v5.246 — страница пользователей приведена к согласованному компактному макету */
.user-create-card{
  padding:14px 16px!important;
  border-radius:18px!important;
  box-shadow:0 8px 26px rgba(18,38,63,.045)!important;
}
.user-create-card h2{
  margin:0 0 12px!important;
  font-size:17px!important;
  line-height:1.2!important;
}
.user-create-grid{
  display:grid!important;
  grid-template-columns:minmax(150px,.9fr) minmax(170px,1fr) minmax(160px,.8fr) minmax(180px,.9fr) minmax(320px,1.45fr) auto!important;
  gap:10px 12px!important;
  align-items:end!important;
}
.user-create-grid>label{font-size:11px!important;font-weight:700!important;color:#344054}
.user-create-grid input,.user-create-grid select{
  height:40px!important;min-height:40px!important;padding:8px 12px!important;font-size:13px!important;border-radius:12px!important
}
.user-create-grid .password-field input{padding-right:72px!important}
.user-create-grid .user-permission-wide{grid-column:5!important;grid-row:1!important;align-self:end!important}
.user-create-grid .user-permission-title{font-size:11px!important;margin:0 0 7px!important;font-weight:700!important;color:#475467}
.user-create-grid .user-create-submit{
  grid-column:6!important;grid-row:1!important;height:40px!important;min-height:40px!important;padding:0 18px!important;font-size:13px!important;border-radius:12px!important;white-space:nowrap!important
}
.user-permissions,.user-permissions.compact{
  display:flex!important;flex-wrap:wrap!important;gap:8px!important;width:auto!important;max-width:none!important;margin:0!important
}
.user-permission-chip{
  position:relative;display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 12px;border:1px solid #d9e1eb;border-radius:12px;background:#fff;color:#607086;font-size:11px;font-weight:600;line-height:1;cursor:pointer;white-space:nowrap;transition:.16s ease
}
.user-permission-chip input{width:14px!important;height:14px!important;margin:0!important;accent-color:#1f6feb;flex:0 0 14px}
.user-permission-chip:has(input:checked){background:#eef6ff;border-color:#bed4f4;color:#185aa7}
.user-permission-chip.mandatory{background:#f3f6fa;color:#667085}
.user-permission-chip:hover{border-color:#b7c7dc;background:#f9fbfd}
.user-hidden-form{display:none!important}
.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}

.users-list-card{padding:0!important;overflow:hidden!important;border-radius:18px!important;box-shadow:0 8px 26px rgba(18,38,63,.045)!important}
.users-list-head{padding:16px 18px 12px;border-bottom:1px solid #e9edf3}
.users-list-head h2{margin:0;font-size:18px;line-height:1.2}
.users-list-head p{margin:4px 0 0;font-size:12px;color:#667085}
.users-compact-head,.user-compact-row{
  display:grid;
  grid-template-columns:minmax(250px,1.25fr) minmax(140px,.55fr) minmax(300px,1.18fr) 92px 150px minmax(205px,.82fr);
  column-gap:14px;
  align-items:center;
}
.users-compact-head{
  padding:10px 18px;
  background:#f8fafc;
  border-bottom:1px solid #e8edf4;
  color:#667085;
  font-size:12px;
  font-weight:700;
}
.users-compact-list{display:grid}
.user-compact-row{position:relative;min-height:74px;padding:14px 18px;border-bottom:1px solid #edf1f6;background:#fff}
.user-compact-row:last-child{border-bottom:0}
.user-compact-row.is-current{background:#fbfdff}
.user-compact-row:hover{background:#fcfdff}
.user-compact-person{min-width:0;position:relative}
.user-compact-person b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:18px;line-height:1.15;color:#0f1728}
.user-compact-person>span{display:block;margin-top:6px;font-size:13px;color:#7a8799}
.user-compact-person em{display:inline-flex;margin-left:8px;padding:3px 8px;border-radius:999px;background:#eef4ff;color:#2453a6;font-size:11px;font-style:normal;font-weight:700;vertical-align:middle}
.editable-person input{width:100%;height:40px!important;min-height:40px!important;padding:7px 10px!important;border:1px solid transparent!important;background:transparent!important;border-radius:10px!important;font-size:18px!important;font-weight:700!important;color:#101828!important}
.editable-person input:hover,.editable-person input:focus{border-color:#d6dde7!important;background:#fff!important}
.user-role-cell select,.user-role-readonly{width:100%;height:40px!important;min-height:40px!important;padding:7px 12px!important;border-radius:12px!important;font-size:13px!important;font-weight:600!important;background-color:#fff}
.user-access-cell{min-width:0}
.user-access-cell .user-permissions{flex-wrap:wrap!important;gap:6px!important}
.user-access-cell .user-permission-chip{height:30px;padding:0 10px;font-size:10.5px;border-radius:10px}
.user-access-cell .user-permission-chip input{width:12px!important;height:12px!important;flex-basis:12px!important}
.user-switch{display:inline-flex;align-items:center;justify-content:center;gap:0;width:auto;cursor:pointer}
.user-switch>input{position:absolute;opacity:0;pointer-events:none}
.user-switch-track{position:relative;display:inline-block;width:46px;height:26px;border-radius:999px;background:#cfd6df;transition:.18s}
.user-switch-track i{position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.18);transition:.18s}
.user-switch>input:checked+.user-switch-track{background:#1f6feb}
.user-switch>input:checked+.user-switch-track i{transform:translateX(20px)}
.user-login-meta{min-width:0;font-variant-numeric:tabular-nums}
.user-login-meta b{display:block;font-size:15px;line-height:1.2;color:#344054;white-space:nowrap;font-weight:700}
.user-login-meta span{display:block;margin-top:4px;font-size:12px;color:#8491a3;white-space:nowrap}
.user-row-actions{display:flex;align-items:center;justify-content:flex-start;gap:8px;min-width:0;position:relative;flex-wrap:wrap}
.user-row-actions form{margin:0}
.user-row-actions .button,.user-row-actions summary.button{height:38px!important;min-height:38px!important;padding:0 14px!important;border-radius:10px!important;font-size:12px!important;line-height:36px!important;white-space:nowrap}
.user-row-actions summary{list-style:none;cursor:pointer}
.user-row-actions summary::-webkit-details-marker{display:none}
.user-password-pop{position:relative}
.user-password-pop[open]>summary{background:#eef4ff;border-color:#b9d2f5;color:#165cb5}
.user-password-popover{position:absolute;z-index:50;right:0;top:44px;width:280px;padding:12px;border:1px solid #d7dee8;border-radius:12px;background:#fff;box-shadow:0 10px 28px rgba(26,45,76,.15);display:grid;grid-template-columns:1fr auto;gap:8px;align-items:end}
.user-password-popover label{grid-column:1/-1;font-size:11px;font-weight:700}
.user-password-popover .password-field{margin-top:5px}
.user-password-popover input{height:36px!important;min-height:36px!important;font-size:12px!important;padding-right:70px!important}
.user-password-popover .password-toggle{font-size:10px!important;padding:0 8px!important}
.user-password-popover>.button{grid-column:2;height:34px!important;min-height:34px!important}
.user-role-readonly,.user-access-readonly,.user-active-readonly{font-size:13px;color:#475467}
.user-access-readonly{color:#667085}
.user-active-readonly.on{color:#147a42;font-weight:700}
.user-active-readonly.off{color:#a33b4e;font-weight:700}

@media(max-width:1500px){
  .user-create-grid{grid-template-columns:minmax(150px,.95fr) minmax(180px,1.1fr) minmax(150px,.8fr) minmax(180px,.95fr) minmax(280px,1.3fr) auto!important}
  .users-compact-head,.user-compact-row{grid-template-columns:minmax(220px,1.15fr) minmax(130px,.58fr) minmax(260px,1.15fr) 82px 135px minmax(185px,.8fr);column-gap:10px}
  .user-compact-person b,.editable-person input{font-size:16px!important}
}
@media(max-width:1280px){
  .user-create-grid{grid-template-columns:repeat(2,minmax(220px,1fr))!important}
  .user-create-grid .user-permission-wide{grid-column:1/-1!important;grid-row:auto!important}
  .user-create-grid .user-create-submit{grid-column:1/-1!important;grid-row:auto!important;width:100%}
  .users-compact-head,.user-compact-row{grid-template-columns:minmax(180px,1fr) minmax(120px,.65fr) minmax(240px,1.2fr) 76px 120px minmax(190px,.9fr);column-gap:8px}
  .user-compact-person b,.editable-person input{font-size:14px!important}
  .user-login-meta b{font-size:13px}.user-login-meta span{font-size:11px}
}
@media(max-width:1080px){
  .users-compact-head{display:none}
  .user-compact-row{grid-template-columns:minmax(190px,1.2fr) minmax(140px,.75fr) minmax(250px,1.35fr) 72px;grid-template-areas:"person role access active" "login login actions actions";row-gap:10px;padding:12px 14px}
  .user-compact-person{grid-area:person}.user-role-cell,.user-role-readonly{grid-area:role}.user-access-cell,.user-access-readonly{grid-area:access}.user-switch,.user-active-readonly{grid-area:active}.user-login-meta{grid-area:login}.user-row-actions{grid-area:actions;justify-content:flex-end}
}
@media(max-width:760px){
  .user-create-grid{grid-template-columns:1fr!important}
  .user-compact-row{grid-template-columns:1fr 1fr;grid-template-areas:"person role" "access access" "active login" "actions actions"}
  .user-row-actions{justify-content:flex-start}
}
@media(max-width:520px){
  .user-compact-row{grid-template-columns:1fr;grid-template-areas:"person" "role" "access" "active" "login" "actions"}
  .user-login-meta b,.user-login-meta span{white-space:normal}
  .user-password-popover{left:0;right:auto;width:min(280px,calc(100vw - 36px))}
}


/* v5.247 — финальная компактность страницы пользователей + новый cache-bust */
.user-create-card{padding:12px 14px!important}
.user-create-card h2{font-size:16px!important;margin-bottom:10px!important}
.user-create-grid{
  grid-template-columns:minmax(140px,.85fr) minmax(170px,1fr) minmax(145px,.72fr) minmax(170px,.88fr) minmax(290px,1.3fr) auto!important;
  gap:8px 10px!important;
}
.user-create-grid>label{font-size:10px!important;gap:4px!important}
.user-create-grid input,.user-create-grid select{height:34px!important;min-height:34px!important;padding:5px 9px!important;font-size:11.5px!important;border-radius:9px!important}
.user-create-grid .password-field input{padding-right:64px!important}
.user-create-grid .password-toggle{font-size:10px!important;padding:0 7px!important}
.user-create-grid .user-create-submit{height:34px!important;min-height:34px!important;padding:0 14px!important;font-size:11.5px!important;border-radius:9px!important}
.user-create-grid .user-permission-title{font-size:10px!important;margin-bottom:5px!important}
.user-create-grid .user-permissions{gap:4px!important;flex-wrap:nowrap!important}
.user-create-grid .user-permission-chip{height:26px!important;padding:0 8px!important;border-radius:8px!important;font-size:9px!important;gap:4px!important}
.user-create-grid .user-permission-chip input{width:11px!important;height:11px!important;flex-basis:11px!important}

.users-list-head{padding:11px 14px 9px!important}
.users-list-head h2{font-size:16px!important}
.users-list-head p{font-size:10.5px!important;margin-top:2px!important}
.users-compact-head{padding:7px 14px!important;font-size:10px!important}
.users-compact-head,.user-compact-row{
  grid-template-columns:minmax(235px,1.18fr) minmax(135px,.56fr) minmax(300px,1.28fr) 72px 142px minmax(220px,.85fr)!important;
  column-gap:10px!important;
}
.user-compact-row{min-height:58px!important;padding:8px 14px!important}
.user-compact-person b{font-size:14px!important;line-height:1.12!important}
.user-compact-person>span{margin-top:3px!important;font-size:10px!important}
.user-compact-person em{margin-left:6px!important;padding:2px 6px!important;font-size:8.5px!important}
.editable-person input{height:31px!important;min-height:31px!important;padding:4px 7px!important;border-radius:7px!important;font-size:13px!important}
.user-role-cell select,.user-role-readonly{height:32px!important;min-height:32px!important;padding:4px 24px 4px 8px!important;border-radius:8px!important;font-size:10.5px!important}
.user-access-cell .user-permissions{flex-wrap:nowrap!important;gap:4px!important}
.user-access-cell .user-permission-chip{height:24px!important;padding:0 7px!important;font-size:8.5px!important;border-radius:7px!important;gap:4px!important}
.user-access-cell .user-permission-chip input{width:10px!important;height:10px!important;flex-basis:10px!important}
.user-switch-track{width:38px!important;height:22px!important}
.user-switch-track i{top:3px!important;left:3px!important;width:16px!important;height:16px!important}
.user-switch>input:checked+.user-switch-track i{transform:translateX(16px)!important}
.user-login-meta b{font-size:11px!important}
.user-login-meta span{margin-top:2px!important;font-size:9px!important}
.user-row-actions{gap:5px!important;flex-wrap:nowrap!important}
.user-row-actions .button,.user-row-actions summary.button{height:30px!important;min-height:30px!important;padding:0 9px!important;border-radius:8px!important;font-size:9.5px!important;line-height:28px!important}
.user-password-popover{top:34px!important;width:250px!important;padding:9px!important;border-radius:10px!important}
.user-password-popover input{height:30px!important;min-height:30px!important;font-size:10px!important}
.user-password-popover>.button{height:28px!important;min-height:28px!important}
.user-role-readonly,.user-access-readonly,.user-active-readonly{font-size:10.5px!important}

@media(max-width:1500px){
  .user-create-grid{grid-template-columns:minmax(135px,.85fr) minmax(165px,1fr) minmax(140px,.72fr) minmax(165px,.85fr) minmax(265px,1.2fr) auto!important}
  .users-compact-head,.user-compact-row{grid-template-columns:minmax(210px,1.12fr) minmax(125px,.58fr) minmax(260px,1.2fr) 68px 128px minmax(195px,.85fr)!important;column-gap:8px!important}
}
@media(max-width:1280px){
  .user-create-grid{grid-template-columns:repeat(2,minmax(210px,1fr))!important}
  .user-create-grid .user-permission-wide{grid-column:1/-1!important;grid-row:auto!important}
  .user-create-grid .user-permissions{flex-wrap:wrap!important}
  .user-create-grid .user-create-submit{grid-column:1/-1!important;grid-row:auto!important;width:100%!important}
  .users-compact-head,.user-compact-row{grid-template-columns:minmax(180px,1fr) minmax(115px,.64fr) minmax(235px,1.22fr) 64px 118px minmax(185px,.9fr)!important;column-gap:7px!important}
}
@media(max-width:1080px){
  .users-compact-head{display:none!important}
  .user-compact-row{grid-template-columns:minmax(180px,1.15fr) minmax(130px,.75fr) minmax(240px,1.35fr) 66px!important;grid-template-areas:"person role access active" "login login actions actions"!important;row-gap:7px!important;padding:9px 10px!important}
  .user-row-actions{justify-content:flex-end!important}
}
@media(max-width:760px){
  .user-create-grid{grid-template-columns:1fr!important}
  .user-compact-row{grid-template-columns:1fr 1fr!important;grid-template-areas:"person role" "access access" "active login" "actions actions"!important}
  .user-access-cell .user-permissions{flex-wrap:wrap!important}
  .user-row-actions{justify-content:flex-start!important;flex-wrap:wrap!important}
}


/* v5.248 — строгая геометрия строк пользователей: всё по одной оси */
.user-permission-chip{
  flex-direction:row!important;
  align-items:center!important;
  justify-content:center!important;
}
.user-permission-chip span{
  display:inline-block!important;
  width:auto!important;
  min-height:0!important;
  line-height:1!important;
  margin:0!important;
  white-space:nowrap!important;
}
.user-switch{
  flex-direction:row!important;
  align-items:center!important;
  justify-content:center!important;
}

/* Верхняя форма: права остаются в одной строке на широком экране. */
.user-create-grid{
  grid-template-columns:minmax(150px,.8fr) minmax(190px,1.05fr) minmax(145px,.72fr) minmax(180px,.9fr) minmax(390px,1.55fr) auto!important;
  column-gap:10px!important;
  row-gap:8px!important;
}
.user-create-grid .user-permission-wide{min-width:0!important}
.user-create-grid .user-permissions{
  flex-wrap:nowrap!important;
  gap:4px!important;
}
.user-create-grid .user-permission-chip{
  height:26px!important;
  padding:0 7px!important;
  gap:4px!important;
  font-size:8.5px!important;
}

/* Таблица: одинаковая сетка заголовка и каждой строки. */
.users-compact-head,.user-compact-row{
  grid-template-columns:minmax(250px,1.18fr) 175px minmax(330px,1.45fr) 76px 160px 225px!important;
  column-gap:12px!important;
  align-items:center!important;
}
.users-compact-head{padding:7px 14px!important}
.user-compact-row{
  min-height:62px!important;
  padding:8px 14px!important;
}
.user-compact-row>*{
  min-width:0!important;
  align-self:center!important;
}
.user-compact-person{
  display:grid!important;
  grid-template-columns:1fr auto!important;
  grid-template-rows:auto auto!important;
  align-items:center!important;
  column-gap:6px!important;
  row-gap:2px!important;
}
.user-compact-person b,
.editable-person input{
  grid-column:1!important;
  grid-row:1!important;
  margin:0!important;
  font-size:12.5px!important;
  line-height:1.1!important;
  font-weight:700!important;
}
.user-compact-person>span{
  grid-column:1!important;
  grid-row:2!important;
  margin:0!important;
  font-size:9px!important;
  line-height:1.1!important;
}
.user-compact-person em{
  grid-column:2!important;
  grid-row:1!important;
  margin:0!important;
  align-self:center!important;
  font-size:8px!important;
  padding:2px 5px!important;
}
.editable-person input{
  width:100%!important;
  height:28px!important;
  min-height:28px!important;
  padding:3px 5px!important;
  border:1px solid transparent!important;
  background:transparent!important;
  border-radius:6px!important;
}
.editable-person input:hover,.editable-person input:focus{
  border-color:#cfd8e5!important;
  background:#fff!important;
}
.user-role-cell select,.user-role-readonly{
  height:30px!important;
  min-height:30px!important;
  padding:3px 24px 3px 8px!important;
  border-radius:7px!important;
  font-size:9.5px!important;
  line-height:1!important;
  font-weight:600!important;
}
.user-access-cell{
  display:flex!important;
  align-items:center!important;
}
.user-access-cell .user-permissions{
  display:flex!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  gap:4px!important;
  width:100%!important;
}
.user-access-cell .user-permission-chip{
  flex:0 0 auto!important;
  height:24px!important;
  min-height:24px!important;
  padding:0 6px!important;
  border-radius:7px!important;
  gap:3px!important;
  font-size:8px!important;
  line-height:1!important;
}
.user-access-cell .user-permission-chip input{
  width:10px!important;
  height:10px!important;
  flex:0 0 10px!important;
  margin:0!important;
}
.user-switch{justify-self:center!important;margin:0!important}
.user-switch-track{width:36px!important;height:20px!important}
.user-switch-track i{top:3px!important;left:3px!important;width:14px!important;height:14px!important}
.user-switch>input:checked+.user-switch-track i{transform:translateX(16px)!important}
.user-login-meta{
  align-self:center!important;
  margin:0!important;
}
.user-login-meta b{font-size:10px!important;line-height:1.1!important;margin:0!important}
.user-login-meta span{font-size:8px!important;line-height:1.1!important;margin-top:2px!important}
.user-row-actions{
  align-self:center!important;
  display:flex!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:5px!important;
  margin:0!important;
}
.user-row-actions form,.user-row-actions details{margin:0!important}
.user-row-actions .button,.user-row-actions summary.button{
  height:28px!important;
  min-height:28px!important;
  padding:0 8px!important;
  border-radius:7px!important;
  font-size:8.5px!important;
  line-height:26px!important;
}

/* На среднем экране переходим на две аккуратные строки, а не сжимаем колонки до перекосов. */
@media(max-width:1600px){
  .user-create-grid{grid-template-columns:repeat(2,minmax(220px,1fr))!important}
  .user-create-grid .user-permission-wide{grid-column:1/-1!important;grid-row:auto!important}
  .user-create-grid .user-permissions{flex-wrap:wrap!important}
  .user-create-grid .user-create-submit{grid-column:1/-1!important;grid-row:auto!important;width:100%!important}
  .users-compact-head{display:none!important}
  .user-compact-row{
    grid-template-columns:minmax(210px,1.05fr) 150px minmax(310px,1.5fr) 70px!important;
    grid-template-areas:"person role access active" "login login actions actions"!important;
    row-gap:7px!important;
    padding:9px 12px!important;
  }
  .user-compact-person{grid-area:person!important}
  .user-role-cell,.user-role-readonly{grid-area:role!important}
  .user-access-cell,.user-access-readonly{grid-area:access!important}
  .user-switch,.user-active-readonly{grid-area:active!important}
  .user-login-meta{grid-area:login!important}
  .user-row-actions{grid-area:actions!important;justify-content:flex-end!important}
}
@media(max-width:800px){
  .user-create-grid{grid-template-columns:1fr!important}
  .user-compact-row{
    grid-template-columns:1fr 1fr!important;
    grid-template-areas:"person role" "access access" "active login" "actions actions"!important;
  }
  .user-access-cell .user-permissions{flex-wrap:wrap!important}
  .user-row-actions{justify-content:flex-start!important;flex-wrap:wrap!important}
}
@media(max-width:520px){
  .user-compact-row{
    grid-template-columns:1fr!important;
    grid-template-areas:"person" "role" "access" "active" "login" "actions"!important;
  }
}


/* v5.249 — password popover must not be clipped and closes naturally */
.users-list-card{overflow:visible!important}
.users-compact-list,.user-compact-row,.user-row-actions,.user-password-pop{overflow:visible!important}
.user-password-pop{z-index:20}
.user-password-pop[open]{z-index:120}
.user-password-popover{z-index:500!important}
/* Keep the last rows' popovers inside the visible page area when possible. */
.user-compact-row:nth-last-child(-n+2) .user-password-popover{top:auto!important;bottom:38px!important}
@media(max-width:1080px){
  .user-compact-row:nth-last-child(-n+2) .user-password-popover{top:34px!important;bottom:auto!important}
}


/* v5.251 — dashboard document buttons stay top-aligned after removing draft note */
@media(min-width:761px){
  .dashboard-table td.doc-actions{
    vertical-align:top!important;
    align-content:start!important;
    padding-top:7px!important;
    padding-bottom:7px!important;
  }
  .dashboard-table td.doc-actions .doc-download-pair{margin-top:0!important;margin-bottom:4px!important}
  .dashboard-table td.doc-actions .doc-download-pair:last-of-type{margin-bottom:0!important}
}

/* v5.253 — keep all three document buttons on the same baseline in collapsed/medium dashboard rows */
@media (min-width:641px) and (max-width:1600px){
  .dashboard-table tr.object-row>td.doc-actions .doc-download-pair,
  .dashboard-table tr.object-row>td.doc-actions .doc-download-pair + .doc-download-pair{
    margin-top:0!important;
    margin-bottom:0!important;
    align-self:start!important;
  }
}


/* v5.257 — visually center native dropdown items against the popup window */
.dashboard-table .tz-stage-status-select option{
  text-align:center!important;
  text-align-last:center!important;
  text-indent:-7px!important;
}


/* v5.258 — hard mobile reset for ТЗ card: desktop 304px sidebar must never squeeze phone layout */
@media(max-width:980px){
  .object-v204-layout{
    display:block!important;
    grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }
  .object-v204-main,
  .object-v204-sidebar{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }
  .object-v204-sidebar{
    position:static!important;
    margin:0!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:10px!important;
  }
}

@media(max-width:760px){
  html,body.app-shell{max-width:100%;overflow-x:hidden!important}
  .app-main{
    width:100%!important;
    max-width:100vw!important;
    min-width:0!important;
    padding-left:8px!important;
    padding-right:8px!important;
    overflow-x:hidden!important;
    box-sizing:border-box!important;
  }
  .app-content{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0!important;
    box-sizing:border-box!important;
  }
  .object-v204-backbar{
    width:100%!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  .object-v204-layout{
    display:flex!important;
    flex-direction:column!important;
    gap:10px!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }
  .object-v204-main{
    order:1!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
  }
  .object-v204-sidebar{
    order:2!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:10px!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
  }
  .object-v204-main>* ,
  .object-v204-sidebar>* ,
  .object-hero-v204,
  .object-v204-section,
  .object-side-card{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
  }
  .object-hero-v204{padding:11px 12px 10px!important}
  .object-hero-top,
  .object-hero-title-wrap,
  .object-hero-person,
  .object-hero-facts,
  .object-fact,
  .object-fact>div{
    min-width:0!important;
    max-width:100%!important;
  }
  .object-hero-title-line{
    width:100%!important;
    max-width:100%!important;
    gap:6px!important;
    row-gap:6px!important;
  }
  .object-hero-title-line h1{
    font-size:20px!important;
    line-height:1.08!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
  }
  .object-hero-person b,
  .object-hero-person span,
  .object-hero-person strong,
  .object-fact b,
  .object-fact small{
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
  }
  .object-hero-facts{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:7px!important;
  }
  .object-v204-section>summary{
    width:100%!important;
    max-width:100%!important;
    box-sizing:border-box!important;
    white-space:normal!important;
  }
  .object-v204-section .fold-body,
  .object-v204-section .source-view,
  .object-v204-section .source-edit-form{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
  }
  .object-side-head,
  .object-side-status-list,
  .object-side-date-form,
  .object-side-adpu-form,
  .object-side-docs{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
  }
  .object-side-status-list>.object-side-status-row{
    grid-template-columns:30px minmax(82px,1fr) minmax(112px,44%)!important;
    gap:8px!important;
    width:100%!important;
    min-width:0!important;
  }
  .object-side-status-list>.object-side-status-row>.object-status-name{
    min-width:0!important;
    white-space:normal!important;
    word-break:normal!important;
    overflow-wrap:anywhere!important;
  }
  .object-side-status-list>.object-side-status-row>.tz-stage-status{
    min-width:0!important;
    width:100%!important;
  }
  .object-side-status-list .tz-stage-status-select{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  .object-side-date-form>label,
  .object-side-adpu-form>label,
  .object-side-term{
    grid-template-columns:minmax(100px,42%) minmax(0,1fr)!important;
    gap:8px!important;
    align-items:center!important;
  }
  .object-side-date-form input[type='date'],
  .object-side-adpu-form input[type='date']{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    justify-self:stretch!important;
    box-sizing:border-box!important;
  }
  .object-side-check{
    grid-template-columns:minmax(0,1fr) auto!important;
    width:100%!important;
  }
  .object-side-term b{
    justify-self:end!important;
    text-align:right!important;
    min-width:0!important;
    overflow-wrap:anywhere!important;
  }
  .object-side-docs .doc-download-pair{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    grid-template-columns:minmax(0,1fr) 44px!important;
  }
  .object-side-docs .doc-download-pair.single{grid-template-columns:minmax(0,1fr)!important}
  .object-side-docs .button{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  .source-data-card .source-dl,
  .source-edit-grid,
  .application-readonly-grid{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    grid-template-columns:minmax(0,1fr)!important;
  }
}


/* v5.259 — iPhone containment fixes for object card forms */
@media(max-width:760px){
  /* Shared containment: no form control may exceed the card inner width. */
  .object-stage-content,
  .source-data-card .source-edit-form,
  .object-dates-card-v204,
  .termination-form,
  .source-edit-grid,
  .source-edit-grid>label,
  .termination-date-label,
  .object-side-date-form>label,
  .object-side-adpu-form>label{
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }

  /* Source data edit: the old desktop horizontal margins made width:100% overflow on phone. */
  .source-data-card .source-edit-form{
    width:auto!important;
    margin:8px 0 10px!important;
    padding:10px!important;
    overflow:hidden!important;
  }
  .source-edit-grid{
    width:100%!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:9px!important;
  }
  .source-edit-grid .source-wide{grid-column:auto!important}
  .source-edit-grid input,
  .source-edit-grid textarea,
  .source-edit-grid select{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    inline-size:100%!important;
    max-inline-size:100%!important;
    min-inline-size:0!important;
    box-sizing:border-box!important;
  }
  .source-save-row{max-width:100%!important;min-width:0!important;flex-wrap:wrap!important}

  /* Termination: single-column form, date control strictly contained inside the card. */
  .termination-card .object-stage-content{overflow:hidden!important}
  .termination-form{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;
    gap:10px!important;
  }
  .termination-check,
  .termination-date-label,
  .termination-save{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
  }
  .termination-date-label input[type='date']{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    inline-size:100%!important;
    max-inline-size:100%!important;
    min-inline-size:0!important;
    box-sizing:border-box!important;
  }

  /* Key dates: keep the neat two-column layout but allow iOS date inputs to shrink. */
  .object-dates-card-v204{overflow:hidden!important}
  .object-side-date-form>label,
  .object-side-adpu-form>label,
  .object-side-term{
    width:100%!important;
    grid-template-columns:minmax(0,42%) minmax(0,58%)!important;
    gap:8px!important;
  }
  .object-side-date-form input[type='date'],
  .object-side-adpu-form input[type='date']{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    inline-size:100%!important;
    max-inline-size:100%!important;
    min-inline-size:0!important;
    -webkit-min-logical-width:0!important;
    box-sizing:border-box!important;
  }
  .object-side-check{grid-template-columns:minmax(0,1fr) auto!important}
}

@media(max-width:430px){
  /* Extra safety for narrow iPhones: a little more room for the date field. */
  .object-side-date-form>label,
  .object-side-adpu-form>label,
  .object-side-term{
    grid-template-columns:minmax(0,39%) minmax(0,61%)!important;
  }
}


/* v5.260 — stronger iPhone Safari containment for date fields + taller source textarea */
@media(max-width:760px){
  /* iOS date controls keep an intrinsic width unless native appearance is neutralized. */
  .object-side-date-form>label,
  .object-side-adpu-form>label,
  .termination-date-label{
    overflow:hidden!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }

  .object-side-date-form input[type='date'],
  .object-side-adpu-form input[type='date'],
  .termination-date-label input[type='date']{
    -webkit-appearance:none!important;
    appearance:none!important;
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    inline-size:100%!important;
    max-inline-size:100%!important;
    min-inline-size:0!important;
    margin:0!important;
    padding:0 10px!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
    text-align:center!important;
    text-align-last:center!important;
    font-size:13px!important;
    line-height:1.2!important;
  }
  .object-side-date-form input[type='date']::-webkit-date-and-time-value,
  .object-side-adpu-form input[type='date']::-webkit-date-and-time-value,
  .termination-date-label input[type='date']::-webkit-date-and-time-value{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    text-align:center!important;
  }
  .object-side-date-form input[type='date']::-webkit-datetime-edit,
  .object-side-adpu-form input[type='date']::-webkit-datetime-edit,
  .termination-date-label input[type='date']::-webkit-datetime-edit{
    width:100%!important;
    min-width:0!important;
    text-align:center!important;
  }

  /* Key dates stay compact but the right control may never exceed its grid cell. */
  .object-side-date-form>label,
  .object-side-adpu-form>label,
  .object-side-term{
    grid-template-columns:minmax(118px,40%) minmax(0,1fr)!important;
    width:100%!important;
    max-width:100%!important;
    column-gap:8px!important;
  }
  .object-side-date-form>label>span,
  .object-side-adpu-form>label>span{
    min-width:0!important;
    overflow-wrap:anywhere!important;
  }

  /* Termination date: contain the full native control inside the form card. */
  .termination-card .object-stage-content,
  .termination-form,
  .termination-date-label{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  .termination-date-label input[type='date']{
    height:44px!important;
    border-radius:9px!important;
  }

  /* Source edit: long point-of-connection text needs a real multiline editing area on phones. */
  .source-data-card .source-edit-form{
    overflow:visible!important;
  }
  .source-edit-grid textarea{
    white-space:pre-wrap!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
    line-height:1.35!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }
  .source-edit-grid .source-tp-field textarea,
  .source-edit-grid textarea[name='tp']{
    min-height:132px!important;
    height:132px!important;
    max-height:240px!important;
    padding:10px 11px!important;
  }
  .source-edit-grid textarea[name='address'],
  .source-edit-grid textarea[name='feeder_04']{
    min-height:76px!important;
  }
}

@media(max-width:390px){
  .object-side-date-form>label,
  .object-side-adpu-form>label,
  .object-side-term{
    grid-template-columns:minmax(108px,38%) minmax(0,1fr)!important;
  }
  .object-side-date-form input[type='date'],
  .object-side-adpu-form input[type='date'],
  .termination-date-label input[type='date']{
    font-size:12px!important;
    padding-left:6px!important;
    padding-right:6px!important;
  }
}


/* v5.261 — mobile key dates centered/narrower + compact history summary */
@media(max-width:760px){
  /* Key dates: compact, centered date controls inside the right column. */
  .object-side-date-form>label,
  .object-side-adpu-form>label{
    grid-template-columns:minmax(118px,40%) minmax(0,1fr)!important;
    align-items:center!important;
  }
  .object-side-date-form input[type='date'],
  .object-side-adpu-form input[type='date']{
    width:min(220px,100%)!important;
    max-width:220px!important;
    min-width:0!important;
    height:40px!important;
    min-height:40px!important;
    justify-self:center!important;
    padding:0 8px!important;
    line-height:40px!important;
    text-align:center!important;
    text-align-last:center!important;
  }
  .object-side-date-form input[type='date']::-webkit-date-and-time-value,
  .object-side-adpu-form input[type='date']::-webkit-date-and-time-value{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    height:100%!important;
    min-height:100%!important;
    margin:0!important;
    padding:0!important;
    line-height:40px!important;
    text-align:center!important;
  }
  .object-side-date-form input[type='date']::-webkit-datetime-edit,
  .object-side-adpu-form input[type='date']::-webkit-datetime-edit,
  .object-side-date-form input[type='date']::-webkit-datetime-edit-fields-wrapper,
  .object-side-adpu-form input[type='date']::-webkit-datetime-edit-fields-wrapper{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    height:100%!important;
    min-height:100%!important;
    padding:0!important;
    line-height:40px!important;
    text-align:center!important;
  }

  /* History summary: icon + title + meta as one compact two-line unit. */
  .fold-card-history>summary{
    min-height:70px!important;
    padding:9px 44px 9px 14px!important;
  }
  .fold-card-history>summary .fold-summary-main{
    display:grid!important;
    grid-template-columns:34px minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    column-gap:10px!important;
    row-gap:1px!important;
    align-items:center!important;
    width:100%!important;
  }
  .fold-card-history>summary .fold-icon.object-history-icon{
    grid-column:1!important;
    grid-row:1 / span 2!important;
    align-self:center!important;
  }
  .fold-card-history>summary .fold-title{
    grid-column:2!important;
    grid-row:1!important;
    align-self:end!important;
    line-height:1.15!important;
  }
  .fold-card-history>summary .fold-meta{
    grid-column:2!important;
    grid-row:2!important;
    flex-basis:auto!important;
    width:auto!important;
    padding-left:0!important;
    margin:1px 0 0!important;
    align-self:start!important;
    line-height:1.15!important;
  }
}

@media(max-width:390px){
  .object-side-date-form input[type='date'],
  .object-side-adpu-form input[type='date']{
    width:min(205px,100%)!important;
    max-width:205px!important;
  }
}


/* v5.266 — значения метаданных новых монтажей в одну строку с подписью */
.event-meta>div{
  display:flex!important;
  align-items:center!important;
  gap:6px!important;
  min-width:0!important;
}
.event-meta span{
  display:inline!important;
  flex:0 0 auto!important;
  margin:0!important;
  white-space:nowrap!important;
}
.event-meta b{
  display:inline!important;
  min-width:0!important;
  overflow-wrap:anywhere!important;
  line-height:1.15!important;
}
@media(max-width:760px){
  .event-meta>div{gap:5px!important;}
}

/* v5.269 — document mini-statuses align to the inner edges of stage statuses.
   Execution starts at the left edge of stage 2; KS+RS ends at the right edge of stage 3. */
@media (min-width:761px){
  .dashboard-document-readiness:not(.is-complete){
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    column-gap:0!important;
  }
  .dashboard-document-readiness:not(.is-complete) .dashboard-doc-mini:nth-child(1){
    grid-column:2!important;
    justify-self:start!important;
  }
  .dashboard-document-readiness:not(.is-complete) .dashboard-doc-mini:nth-child(2){
    grid-column:2 / 4!important;
    justify-self:center!important;
  }
  .dashboard-document-readiness:not(.is-complete) .dashboard-doc-mini:nth-child(3){
    grid-column:3!important;
    justify-self:end!important;
  }
}


/* v5.270 — application term on its own line; document indicators stay on one row. */
.tz-brief-app-term{
  padding-left:0;
}
@media (min-width:761px){
  .dashboard-document-readiness:not(.is-complete) .dashboard-doc-mini:nth-child(1),
  .dashboard-document-readiness:not(.is-complete) .dashboard-doc-mini:nth-child(2),
  .dashboard-document-readiness:not(.is-complete) .dashboard-doc-mini:nth-child(3){
    grid-row:1!important;
    align-self:start!important;
  }
}


/* v5.271 — move applicant/address column closer to TZ while keeping TZ dates on one line. */
@media(min-width:1601px){
  .dashboard-table th:nth-child(1),
  .dashboard-table td:nth-child(1){width:205px!important;min-width:205px!important}
  .dashboard-table th:nth-child(2),
  .dashboard-table td:nth-child(2){min-width:315px!important}
}

/* v5.272 — ещё ближе подвигаем колонку заявителя к №ТЗ, сохраняя даты в одну строку. */
@media(min-width:1601px){
  .dashboard-table th:nth-child(1),
  .dashboard-table td:nth-child(1){width:180px!important;min-width:180px!important}
  .dashboard-table th:nth-child(2),
  .dashboard-table td:nth-child(2){min-width:340px!important}
}

/* v5.273 — настоящее горизонтальное центрирование пунктов раскрытого списка статусов. */
.dashboard-table .tz-stage-status-select option,
.tz-stage-status-select option{
  text-align:center!important;
  text-align-last:center!important;
  text-indent:0!important;
  padding-left:0!important;
  padding-right:0!important;
}


/* v5.274 — desktop custom stage dropdown: native Windows option menus do not honor centered text reliably. */
.tz-stage-status{position:relative}
.tz-stage-custom{display:none;min-width:0;width:100%}
@media (min-width:641px){
  .tz-stage-status-select{
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    min-width:0!important;
    opacity:0!important;
    pointer-events:none!important;
    clip:rect(0 0 0 0)!important;
  }
  .tz-stage-custom{display:block}
  .tz-stage-custom-trigger{
    width:100%;height:27px;min-height:27px;padding:0 7px;
    border:1px solid transparent;border-radius:999px;
    background:#fff;color:#222;cursor:pointer;
    display:grid;grid-template-columns:16px minmax(0,1fr) 16px;align-items:center;
    font:inherit;font-size:10.5px;line-height:1;font-weight:800;
  }
  .tz-stage-custom-trigger::before{content:"";grid-column:1}
  .tz-stage-custom-trigger>span{grid-column:2;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .tz-stage-custom-trigger::after{
    content:"";grid-column:3;justify-self:center;width:6px;height:6px;
    border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;
    transform:rotate(45deg) translateY(-1px);transform-origin:center;
  }
  .tz-stage-status.stage-ready .tz-stage-custom-trigger{background:var(--ok);color:var(--oktext);border-color:#ccebd9}
  .tz-stage-status.stage-waiting .tz-stage-custom-trigger{background:var(--wait);color:var(--waittext);border-color:#f1dfae}
  .tz-stage-status.stage-remark .tz-stage-custom-trigger{background:var(--bad);color:var(--badtext);border-color:#f2c8d0}
  .tz-stage-custom-trigger:hover{filter:brightness(.99)}
  .tz-stage-custom-trigger:focus-visible{outline:2px solid rgba(31,111,235,.25);outline-offset:1px}
  .tz-stage-custom-trigger:disabled{cursor:default}
  .tz-stage-status.is-open{z-index:250}
  .tz-stage-custom-menu{
    position:absolute;z-index:260;top:calc(100% + 2px);left:50%;transform:translateX(-50%);
    width:max(100%,150px);padding:0;border:1px solid #8f8f8f;border-radius:0;
    background:#fff;box-shadow:none;overflow:hidden;
  }
  .tz-stage-custom-menu[hidden]{display:none!important}
  .tz-stage-custom-option{
    display:block;width:100%;height:25px;min-height:25px;margin:0;padding:0 5px;
    border:0;border-radius:0;background:#fff;color:#111;
    font:inherit;font-size:10px;font-weight:400;line-height:25px;text-align:center!important;
    white-space:nowrap;cursor:pointer;
  }
  .tz-stage-custom-option:hover,
  .tz-stage-custom-option:focus{background:#e9f1ff;color:#111;outline:none}
  .tz-stage-custom-option[aria-selected="true"]{background:#1f6fd7;color:#fff}
  .dashboard-table .tz-stage-custom-trigger{height:25px;min-height:25px;font-size:10px;font-weight:500}
  .dashboard-table .tz-stage-custom-option{height:25px;min-height:25px;font-size:10px;line-height:25px}
  .object-side-status-list .tz-stage-custom-trigger{height:30px;min-height:30px;font-size:10px}
}

/* v5.275 — реконструкция и номер титула */
.tz-import-key-row{
  grid-template-columns:minmax(150px,.72fr) minmax(165px,.78fr) minmax(190px,1fr) minmax(230px,1.18fr) minmax(160px,.66fr)!important;
  align-items:end;
}
.import-title-field input[readonly]{background:#f8fafc;color:#344054;font-weight:700}
.import-reconstruction-field{min-width:0;align-self:end!important}
.import-checkbox-control,
.source-checkbox-control{
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:8px!important;
  width:100%;
  min-height:40px;
  margin-top:4px;
  padding:0 12px;
  border:1px solid #cbd1d8;
  border-radius:8px;
  background:#fff;
  color:#172033;
  font-size:12px;
  font-weight:700;
  line-height:1;
}
@media(min-width:761px){
  .import-checkbox-control{
    height:var(--ui-control-h);
    min-height:var(--ui-control-h);
    margin-top:0;
    padding:0 8px;
    border-radius:6px;
  }
}
.import-checkbox-control input,
.source-checkbox-control input{
  width:15px!important;
  height:15px!important;
  min-width:15px!important;
  margin:0!important;
  padding:0!important;
  accent-color:#1f6feb;
}
.import-checkbox-control b,
.source-checkbox-control b{font:inherit;font-weight:700;white-space:nowrap}
.source-reconstruction-field>span:first-child{font-size:11px;color:#475467;font-weight:700}
.source-checkbox-control{min-height:34px;margin-top:0;border-radius:7px;padding:0 10px}
.object-hero-title-number{
  margin:-5px 0 8px 31px;
  color:#667085;
  font-size:11px;
  line-height:1.2;
}
.object-hero-title-number b{color:#234b7c;font-weight:750}
.ks-doc-title-number{white-space:nowrap}
@media(max-width:760px){
  .tz-import-key-row{grid-template-columns:1fr!important}
  .object-hero-title-number{margin:-3px 0 8px 0;font-size:11px}
}
.import-reconstruction-spacer{display:none!important}

/* v5.276 — номер титула под №ТЗ в списках */
.dashboard-title-number{margin-top:1px;color:#5f6f82;font-size:10px;line-height:1.15;font-weight:500}


/* v5.277 — маленький переключатель «Реконструкция» в просмотре исходных данных */
.source-reconstruction-inline{
  display:flex;
  align-items:center;
  min-height:24px;
  margin-top:8px;
  padding-top:7px;
  border-top:1px solid #eef1f5;
}
.source-reconstruction-mini{
  display:inline-flex!important;
  flex-direction:row!important;
  align-items:center!important;
  gap:6px!important;
  width:auto!important;
  min-height:22px!important;
  padding:2px 7px!important;
  margin:0!important;
  border:1px solid #d9e1ea;
  border-radius:7px;
  background:#fff;
  color:#46566b;
  font-size:10px!important;
  font-weight:650!important;
  line-height:1!important;
  cursor:pointer;
}
.source-reconstruction-mini:hover{background:#f8fbff;border-color:#bfd0e5}
.source-reconstruction-mini input{
  width:12px!important;
  height:12px!important;
  min-width:12px!important;
  margin:0!important;
  padding:0!important;
  accent-color:#1f6feb;
}
.source-reconstruction-mini i{
  min-width:8px;
  font-size:9px;
  font-style:normal;
  color:#667085;
}
.source-reconstruction-mini i.saved{color:#1b8a4b}
.source-reconstruction-mini i.error{color:#c94155}
.source-reconstruction-mini.readonly{cursor:default;background:#f8fafc}
.source-reconstruction-mini-check{color:#1b8a4b;font-weight:900}
@media(max-width:760px){
  .source-reconstruction-inline{margin-top:10px;padding-top:8px}
  .source-reconstruction-mini{font-size:11px!important;min-height:26px!important;padding:3px 8px!important}
}


/* v5.279 — финальная компоновка ручного редактирования исходных данных */
@media(min-width:1001px){
  .source-edit-grid.source-edit-grid-v279{
    grid-template-columns:repeat(12,minmax(0,1fr));
    align-items:end;
  }
  .source-edit-grid-v279 .source-v279-characteristic{grid-column:span 3}
  .source-edit-grid-v279 .source-v279-object{grid-column:span 4}
  .source-edit-grid-v279 .source-v279-power{grid-column:span 2}
  .source-edit-grid-v279 .source-v279-res{grid-column:span 3}

  .source-edit-grid-v279 .source-v279-app-type{grid-column:span 2}
  .source-edit-grid-v279 .source-v279-reconstruction{grid-column:span 2}
  .source-edit-grid-v279 .source-v279-power-center{grid-column:span 5}
  .source-edit-grid-v279 .source-v279-feeder{grid-column:span 3}

  .source-edit-grid-v279 .source-v279-place{grid-column:span 4}
  .source-edit-grid-v279 .source-v279-meter{grid-column:span 8}
}
.source-edit-grid-v279 .source-v279-reconstruction{align-self:end}
.source-edit-grid-v279 .source-v279-reconstruction .source-checkbox-control{
  height:34px!important;
  min-height:34px!important;
  margin:0!important;
  padding:0 9px!important;
  align-items:center!important;
}
.source-edit-grid-v279 .source-v279-place input,
.source-edit-grid-v279 .source-v279-meter select{
  height:34px;
  min-height:34px;
}
.source-edit-grid-v279 .source-v279-meter select{font-size:11.5px}
@media(max-width:1000px) and (min-width:761px){
  .source-edit-grid.source-edit-grid-v279{grid-template-columns:repeat(2,minmax(0,1fr))}
  .source-edit-grid-v279 .source-v279-characteristic,
  .source-edit-grid-v279 .source-v279-object,
  .source-edit-grid-v279 .source-v279-power,
  .source-edit-grid-v279 .source-v279-res,
  .source-edit-grid-v279 .source-v279-app-type,
  .source-edit-grid-v279 .source-v279-reconstruction,
  .source-edit-grid-v279 .source-v279-power-center,
  .source-edit-grid-v279 .source-v279-feeder,
  .source-edit-grid-v279 .source-v279-place,
  .source-edit-grid-v279 .source-v279-meter{grid-column:auto}
  .source-edit-grid-v279 .source-v279-power-center,
  .source-edit-grid-v279 .source-v279-meter{grid-column:1/-1}
}


/* v5.291 — dashboard first/last page buttons + manual-create moved above filters */
.dashboard-pagination .dashboard-page-edge{
  min-width:32px;
  padding-left:8px;
  padding-right:8px;
  text-align:center;
  font-weight:800;
}
.dashboard-pagination .dashboard-page-edge.disabled{
  opacity:.38;
  cursor:default;
  pointer-events:none;
}
.manual-create{
  margin-top:10px;
  margin-bottom:10px;
  padding-top:12px;
  padding-bottom:12px;
}
.manual-create>summary{font-size:16px}
@media(max-width:640px){
  .dashboard-pagination{gap:6px}
  .dashboard-pagination .dashboard-page-edge{min-width:30px;padding-left:6px;padding-right:6px}
}

/* v5.292: серые пояснения в «Монтажники и СУБ» как в «Выполненные работы». */
#stats-zone-installers .installer-zone-title p{
    font-size:9.5px;
    line-height:1.35;
    color:#7d8797;
}
#stats-zone-installers .installer-kpi>div>small{
    font-size:8.8px;
    line-height:1.2;
    color:#9099a8;
}

/* v5.294 — аналитика: совместимость со старыми/нестандартными данными */
.analytics-heading{align-items:center}
.analytics-private-badge{padding:6px 10px;border:1px solid #cfe0ff;border-radius:999px;background:#eef5ff;color:#2867c7;font-size:10px;font-weight:800;white-space:nowrap}
.analytics-filter-card{margin:0 0 12px;padding:10px 12px}
.analytics-period-form{display:flex;align-items:flex-end;gap:7px;flex-wrap:wrap}
.analytics-period-buttons{display:flex;gap:5px;flex-wrap:wrap;margin-right:auto}
.analytics-period-form label{gap:3px;font-size:9px;color:#667085;font-weight:700}
.analytics-period-form input[type=date]{width:132px;height:31px;min-height:31px;padding:4px 7px;border-radius:7px;font-size:11px}
.analytics-period-form .button,.analytics-period-form button{min-height:31px;padding:6px 10px;font-size:10px;border-radius:7px}
.analytics-compare-note{margin-top:7px}
.analytics-section{margin:12px 0;padding:13px 14px;border:1px solid var(--line);border-radius:11px;background:#fff}
.analytics-section-head{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;margin-bottom:10px}
.analytics-section-head h2{margin:0;font-size:15px}.analytics-section-head p{margin:2px 0 0;color:#7b8798;font-size:10px}.analytics-section-head>span{font-size:10px;color:#667085}
.analytics-flow-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.analytics-kpi{position:relative;min-width:0;padding:11px 12px;border:1px solid #e6ebf1;border-radius:10px;background:#fbfcfe}
.analytics-kpi>span{display:block;color:#667085;font-size:10px;font-weight:700}.analytics-kpi>strong{display:block;margin:4px 0 2px;font-size:24px;line-height:1;color:#285aa8}.analytics-kpi small{font-size:8.5px;color:#8b96a7}.analytics-kpi .delta.up{color:#24804b}.analytics-kpi .delta.down{color:#b14a5b}.analytics-kpi.green>strong{color:#1f9a59}.analytics-kpi.purple>strong{color:#7557d9}.analytics-kpi.teal>strong{color:#168b87}
.analytics-bottleneck-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.analytics-bottleneck{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px 11px;border:1px solid #e7ebf0;border-radius:9px;background:#fbfcfe}.analytics-bottleneck span{font-size:9.5px;color:#667085;font-weight:700}.analytics-bottleneck strong{font-size:18px}.analytics-bottleneck.yellow strong{color:#b17a00}.analytics-bottleneck.red strong{color:#ce5262}.analytics-bottleneck.blue strong{color:#2e72d2}
.analytics-two-col{display:grid;grid-template-columns:1fr 1.15fr;gap:12px;margin-top:12px}.analytics-panel{margin:0;padding:13px 14px}.analytics-panel-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;padding-bottom:8px;border-bottom:1px solid #edf0f4}.analytics-panel-head h2{margin:0;font-size:14px}.analytics-panel-head span{font-size:8.5px;color:#8490a0}
.analytics-timing-row{display:grid;grid-template-columns:minmax(0,1fr) 78px 78px;align-items:center;gap:8px;padding:8px 0;border-bottom:1px solid #f0f2f5}.analytics-timing-row:last-child{border-bottom:0}.analytics-timing-row div{min-width:0}.analytics-timing-row b{display:block;font-size:10px}.analytics-timing-row small{display:block;margin-top:2px;color:#8a95a5;font-size:8px}.analytics-timing-row>strong{font-size:11px;color:#245da9;text-align:right}.analytics-timing-row>span{font-size:10px;color:#667085;text-align:right}
.analytics-attention-list{display:grid}.analytics-attention-row{display:grid;grid-template-columns:105px minmax(0,1fr) 48px;align-items:center;gap:8px;padding:7px 0;border-bottom:1px solid #f0f2f5;color:inherit;text-decoration:none}.analytics-attention-row:last-child{border-bottom:0}.analytics-attention-row>div{min-width:0}.analytics-attention-row b{display:block;font-size:10px;color:#1d4f91}.analytics-attention-row small{display:block;margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#7b8797;font-size:8.5px}.analytics-attention-row>strong{text-align:right;font-size:10px}.attention-kind{display:inline-flex;justify-content:center;padding:4px 6px;border-radius:999px;font-size:8px;font-weight:800;background:#f1f3f6;color:#596579}.attention-kind.warn{background:#fff4d8;color:#956a00}.attention-kind.bad{background:#fdecef;color:#b63c52}.attention-kind.info{background:#edf4ff;color:#3569b8}.analytics-empty{padding:18px 8px;color:#7b8797;font-size:10px;text-align:center}
@media(max-width:900px){.analytics-flow-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.analytics-bottleneck-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.analytics-two-col{grid-template-columns:1fr}}
@media(max-width:640px){.analytics-heading{align-items:flex-start}.analytics-private-badge{font-size:9px}.analytics-period-form{display:grid;grid-template-columns:1fr 1fr}.analytics-period-buttons{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,1fr);width:100%;margin:0}.analytics-period-form label{min-width:0}.analytics-period-form input[type=date]{width:100%;max-width:none}.analytics-period-form button{grid-column:1/-1}.analytics-flow-grid,.analytics-bottleneck-grid{grid-template-columns:1fr 1fr}.analytics-kpi>strong{font-size:21px}.analytics-attention-row{grid-template-columns:92px minmax(0,1fr) 44px}.analytics-timing-row{grid-template-columns:minmax(0,1fr) 70px 70px}}

/* v5.296 — compact analytics dashboard aligned to approved mockup */
.analytics-v296{--a296-blue:#2f6bff;--a296-green:#1fb573;--a296-purple:#7657ff;--a296-orange:#f49a39;--a296-red:#e25768;--a296-yellow:#f0bf45;--a296-border:#e2e8f1;--a296-muted:#7b8799;--a296-text:#142f55;width:100%;max-width:100%;}
.analytics-v296 .analytics-v296-head{margin-bottom:8px;align-items:center}
.analytics-v296 .analytics-v296-head h1{font-size:22px;line-height:1.05;margin:0 0 3px}
.analytics-v296 .analytics-v296-head p{font-size:11px;margin:0}
.analytics-v296 .analytics-private-badge{padding:6px 10px;border-radius:999px;font-size:10px;gap:5px;background:#eef5ff;border:1px solid #d3e3ff;color:#2764c7}
.analytics-v296 .card{border-color:var(--a296-border);box-shadow:0 1px 4px rgba(28,54,94,.025)}

.a296-filter{padding:9px 11px;margin:0 0 10px;border-radius:11px}
.a296-filter-form{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;flex-wrap:wrap}
.a296-periods{display:flex;gap:5px;flex-wrap:wrap}.a296-periods .button{min-height:30px;height:30px;padding:5px 10px;border-radius:7px;font-size:9px}
.a296-dates{display:flex;gap:7px;align-items:flex-end}.a296-dates label{display:grid;gap:2px;font-size:8.5px;color:#66758a;font-weight:700}.a296-dates input[type=date]{width:126px;height:30px;min-height:30px;padding:4px 7px;border-radius:7px;font-size:9px}.a296-dates button{height:30px;min-height:30px;padding:5px 10px;border-radius:7px;font-size:9px}.a296-compare{margin-top:6px;font-size:8px;color:#7e8999}

.a296-section-title{display:flex;align-items:end;justify-content:space-between;margin:0 0 6px}.a296-section-title h2{font-size:13px;margin:0}.a296-section-title p{font-size:8.5px;color:#7d8999;margin:2px 0 0}
.a296-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:10px}
.a296-kpi{min-width:0;display:grid;grid-template-columns:34px minmax(0,1fr) 66px;align-items:center;gap:8px;min-height:84px;padding:9px 10px;border:1px solid var(--a296-border);border-radius:10px;background:#fff}
.a296-kpi-icon{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:#eef4ff;position:relative}.a296-kpi-icon:after{content:"";width:13px;height:13px;border:1.8px solid currentColor;border-radius:5px}.a296-blue{color:var(--a296-blue)}.a296-green{color:var(--a296-green)}.a296-purple{color:var(--a296-purple)}.a296-orange{color:var(--a296-orange)}
.a296-kpi-copy{min-width:0;color:var(--a296-text)}.a296-kpi-copy b{display:block;font-size:9px;color:#53647d;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.a296-kpi-copy strong{display:block;margin:3px 0 1px;font-size:27px;line-height:1;font-weight:800;color:#133a73}.a296-kpi-copy small{display:block;font-size:7.5px;color:#8792a1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.a296-spark{width:66px;height:24px;justify-self:end;opacity:.8}

.a296-grid{display:grid;gap:10px;margin-bottom:10px}.a296-top-grid{grid-template-columns:minmax(0,1.72fr) minmax(280px,.78fr)}.a296-mid-grid{grid-template-columns:minmax(0,1.3fr) minmax(300px,.7fr)}.a296-bottom-grid{grid-template-columns:minmax(0,1fr) minmax(0,1.15fr)}
.a296-card{padding:10px 12px;border-radius:11px;margin:0;min-width:0}.a296-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:9px;margin-bottom:7px}.a296-card-head h2{font-size:12px;line-height:1.1;margin:0;color:#153357}.a296-card-head p{font-size:7.8px;color:#8390a2;margin:2px 0 0}.a296-pill{padding:4px 7px;background:#f3f6fa;border-radius:7px;color:#496383;font-size:7.5px;font-weight:700;white-space:nowrap}.a296-link{font-size:8px;color:#2567cb;text-decoration:none;font-weight:800;white-space:nowrap}

.a296-legend{display:flex;align-items:center;justify-content:flex-end;gap:9px;flex-wrap:wrap}.a296-legend span{display:inline-flex;gap:4px;align-items:center;font-size:7.5px;color:#5d6c81;font-weight:650}.a296-legend i{width:6px;height:6px;border-radius:50%;display:inline-block}
.a296-chart-wrap{display:grid;grid-template-columns:27px minmax(0,1fr);gap:4px;align-items:stretch}.a296-ylabels{display:grid;grid-template-rows:repeat(4,1fr);height:210px;padding-top:0}.a296-ylabels span{font-size:7px;color:#8490a0;align-self:end;padding-bottom:2px}.a296-chart-main{min-width:0}.a296-chart{display:block;width:100%;height:210px}.a296-gridline{stroke:#e9eef5;stroke-width:1}.a296-xlabels{display:grid;gap:1px;margin-top:2px}.a296-xlabels span{text-align:center;font-size:6.8px;color:#7c899b;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:clip}

.a296-change-list{display:grid}.a296-change-row{display:grid;grid-template-columns:24px minmax(0,1fr) 45px 35px;align-items:center;gap:6px;padding:8px 0;border-bottom:1px solid #edf1f5}.a296-change-row:last-child{border-bottom:0}.a296-round{display:grid;place-items:center;width:24px;height:24px;border-radius:8px;font-size:8px;font-weight:800}.a296-round.tone-warn{background:#fff3d6;color:#a97900}.a296-round.tone-bad{background:#fdecef;color:#c2495c}.a296-round.tone-info{background:#ebf3ff;color:#3167bb}.a296-round.tone-soft{background:#f1f4f8;color:#667589}.a296-change-row b{font-size:9px;color:#2a405f}.a296-change-row strong{font-size:19px;line-height:1;color:#1450a5;text-align:right}.a296-change-row em{justify-self:end;padding:3px 5px;border-radius:999px;font-size:7px;font-style:normal;font-weight:800}.a296-change-row em.up{background:#fdecef;color:#c84759}.a296-change-row em.down{background:#e9f8ef;color:#228b55}.a296-change-row em.neutral{background:#f2f4f7;color:#7f8998}

.a296-stage-bar{height:10px;border-radius:999px;overflow:hidden;background:#edf2f7;display:flex;margin:9px 0 8px}.a296-stage-bar i,.a296-docbar i{display:block;height:100%}.tone-yellow{background:#f4c347!important}.tone-orange{background:#f0a058!important}.tone-red{background:#e88c9a!important}.tone-blue{background:#69a0ee!important}.tone-green{background:#5fca98!important}.tone-violet{background:#ad9bff!important}.tone-gray{background:#cfd7e2!important}
.a296-stage-items{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}.a296-stage-items>div{min-width:0}.a296-stage-items span{display:flex;gap:4px;align-items:center;color:#6d7a8e;font-size:7.4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.a296-stage-items span i{width:5px;height:5px;display:inline-block;border-radius:50%;flex:0 0 auto}.a296-stage-items strong{display:block;margin-top:2px;font-size:17px;line-height:1;color:#173d75}

.a296-age{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));height:112px;gap:8px;align-items:end}.a296-age-col{height:100%;display:grid;grid-template-rows:17px minmax(0,1fr) 14px;gap:3px;justify-items:center}.a296-age-col b{font-size:10px;color:#2d68ef}.a296-age-col>div{width:100%;height:100%;display:flex;align-items:flex-end;justify-content:center;border-bottom:1px solid #e7edf4}.a296-age-col>div i{display:block;width:24px;max-height:100%;min-height:2px;border-radius:5px 5px 0 0;background:linear-gradient(180deg,#76adff,#4a88eb)}.a296-age-col span{font-size:6.8px;color:#758398}

.a296-timing-head,.a296-timing-row{display:grid;grid-template-columns:minmax(0,1.35fr) 65px 65px 72px;gap:6px;align-items:center}.a296-timing-head{padding:0 0 5px;border-bottom:1px solid #edf1f5;color:#7a8799;font-size:6.8px;font-weight:750}.a296-timing-row{padding:6px 0;border-bottom:1px solid #edf1f5}.a296-timing-row:last-child{border-bottom:0}.a296-timing-row b{display:block;font-size:8.3px;color:#263e5f}.a296-timing-row small{display:block;margin-top:1px;font-size:6.5px;color:#909aaa}.a296-timing-row strong{font-size:9px;color:#1e59b4;text-align:right}.a296-timing-row>span{font-size:8px;color:#65758b;text-align:right}.a296-timing-row em{text-align:right;font-size:7.5px;font-style:normal;font-weight:800}.a296-timing-row em.up{color:#cc4d5d}.a296-timing-row em.down{color:#218d56}.a296-timing-row em.neutral{color:#8892a0}

.a296-att-head,.a296-att-row{display:grid;grid-template-columns:90px 72px minmax(0,1fr) 55px;gap:6px;align-items:center}.a296-att-head{padding:0 0 5px;border-bottom:1px solid #edf1f5;color:#7a8799;font-size:6.8px;font-weight:750}.a296-att-row{padding:5px 0;border-bottom:1px solid #edf1f5;color:inherit;text-decoration:none}.a296-att-row:last-child{border-bottom:0}.a296-att-row .attention-kind{padding:3px 5px;border-radius:999px;font-size:6.7px;font-weight:800;text-align:center;white-space:nowrap}.a296-att-row b{font-size:7.6px;color:#1d5dbd}.a296-att-row small{font-size:6.8px;color:#738197;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.a296-att-row strong{font-size:8.5px;color:#d14e5f;text-align:right}.attention-kind.warn{background:#fff3d6;color:#946700}.attention-kind.bad{background:#fdecef;color:#b43e51}.attention-kind.info{background:#edf4ff;color:#3367b5}.attention-kind.soft{background:#f1f4f8;color:#65738a}

.a296-docs{margin-top:0}.a296-doc-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.a296-doc-panel{padding:8px;border:1px solid #edf1f5;border-radius:9px;background:#fbfcfe}.a296-doc-head{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-bottom:6px}.a296-doc-head b{font-size:8.5px;color:#233c60}.a296-doc-head span{font-size:7px;color:#78879b}.a296-docbar{height:8px;display:flex;overflow:hidden;border-radius:999px;background:#edf2f6;margin-bottom:6px}.a296-doclegend{display:flex;gap:6px 9px;flex-wrap:wrap}.a296-doclegend span{display:inline-flex;gap:3px;align-items:center;font-size:6.7px;color:#718096}.a296-doclegend span>i{width:5px;height:5px;border-radius:50%;display:inline-block}.a296-doclegend b{font-size:inherit;color:#435774}

@media(max-width:1180px){.a296-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.a296-top-grid,.a296-mid-grid,.a296-bottom-grid{grid-template-columns:1fr}.a296-doc-grid{grid-template-columns:1fr}.a296-chart{height:190px}.a296-ylabels{height:190px}}
@media(max-width:720px){.a296-filter-form{display:grid}.a296-dates{display:grid;grid-template-columns:1fr 1fr auto}.a296-dates input[type=date]{width:100%}.a296-kpis{grid-template-columns:1fr}.a296-kpi{grid-template-columns:34px minmax(0,1fr) 72px}.a296-stage-items{grid-template-columns:repeat(2,minmax(0,1fr))}.a296-chart-wrap{grid-template-columns:22px minmax(0,1fr)}.a296-legend{justify-content:flex-start}.a296-card-head{flex-wrap:wrap}.a296-timing-head,.a296-att-head{display:none}.a296-timing-row{grid-template-columns:1fr 70px}.a296-timing-row>span,.a296-timing-row>em{text-align:right}.a296-att-row{grid-template-columns:90px 70px minmax(0,1fr)}.a296-att-row strong{grid-column:3;text-align:left}.a296-doc-grid{grid-template-columns:1fr}}

/* v5.298 — аналитика: ближе к утверждённому макету + читаемые графики */
.analytics-v296{max-width:1480px;margin:0 auto}
.analytics-v296-head h1{font-size:24px;line-height:1.05;margin-bottom:3px}
.analytics-v296-head p{font-size:11px}
.analytics-v296 .analytics-private-badge{font-size:10px;padding:6px 11px}

.a296-filter{padding:10px 12px;margin-bottom:11px}
.a296-periods .button{font-size:9.5px;height:31px;min-height:31px;padding:5px 11px}
.a296-dates label{font-size:9px}.a296-dates input[type=date]{font-size:9.5px;height:31px;min-height:31px}.a296-dates button{font-size:9.5px;height:31px;min-height:31px}
.a296-compare{font-size:8.5px}

.a296-section-title h2{font-size:14px}.a296-section-title p{font-size:9px}
.a296-kpis{gap:10px;margin-bottom:11px}
.a296-kpi{grid-template-columns:40px minmax(0,1fr) 74px;gap:9px;min-height:88px;padding:10px 12px;border-radius:12px}
.a296-kpi-icon{width:40px;height:40px;border-radius:12px;font-size:17px;font-weight:800;line-height:1;background:#eef4ff;color:currentColor}
.a296-kpi-icon:after{display:none!important}
.a296-green .a296-kpi-icon{background:#eaf9f2}.a296-purple .a296-kpi-icon{background:#f0edff}.a296-orange .a296-kpi-icon{background:#fff3e8}
.a296-kpi-copy b{font-size:10.5px}.a296-kpi-copy strong{font-size:31px;margin:4px 0 2px}.a296-kpi-copy small{font-size:8.5px}.a296-spark{width:74px;height:26px}

.a296-grid{gap:11px;margin-bottom:11px}.a296-top-grid{grid-template-columns:minmax(0,1.78fr) minmax(300px,.72fr)}.a296-mid-grid{grid-template-columns:minmax(0,1.38fr) minmax(310px,.72fr)}.a296-bottom-grid{grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);align-items:start}
.a296-card{padding:12px 14px;border-radius:12px}.a296-card-head{margin-bottom:9px}.a296-card-head h2{font-size:13.5px}.a296-card-head p{font-size:8.8px;line-height:1.3}.a296-pill{font-size:8px;padding:4px 8px}.a296-link{font-size:8.5px}

.a296-legend{gap:11px}.a296-legend span{font-size:8.2px}.a296-legend i{width:7px;height:7px}
.a296-chart-wrap{grid-template-columns:34px minmax(0,1fr);gap:5px}.a296-ylabels{grid-template-rows:repeat(5,1fr);height:222px}.a296-ylabels span{font-size:7.6px;padding-bottom:1px}.a296-chart{height:222px}.a296-gridline{stroke:#e6edf6;stroke-width:1}.a296-xlabels{margin-top:4px}.a296-xlabels span{font-size:7.4px;color:#738298}

.a296-change-row{grid-template-columns:27px minmax(0,1fr) 52px 38px;gap:7px;padding:9px 0}.a296-round{width:27px;height:27px;border-radius:9px;font-size:8.5px}.a296-change-row b{font-size:9.8px}.a296-change-row strong{font-size:21px}.a296-change-row em{font-size:7.5px;padding:3px 6px}

.a296-stage-bar{height:12px;margin:10px 0 10px}.a296-stage-items{gap:8px}.a296-stage-items span{font-size:8.3px}.a296-stage-items span i{width:6px;height:6px}.a296-stage-items strong{font-size:20px;margin-top:3px}

.a296-age{height:126px;gap:10px}.a296-age-col{grid-template-rows:19px minmax(0,1fr) 15px;gap:4px}.a296-age-col b{font-size:11px}.a296-age-col>div i{width:29px;border-radius:6px 6px 0 0}.a296-age-col span{font-size:7.4px}

.a296-timing-head,.a296-timing-row{grid-template-columns:minmax(0,1.35fr) 76px 76px 82px;gap:8px}.a296-timing-head{font-size:7.6px;padding-bottom:6px}.a296-timing-row{padding:8px 0}.a296-timing-row b{font-size:9.4px}.a296-timing-row small{font-size:7.2px;margin-top:2px}.a296-timing-row strong{font-size:10.4px}.a296-timing-row>span{font-size:9.2px}.a296-timing-row em{font-size:8.3px}

.a296-att-head,.a296-att-row{grid-template-columns:98px 80px minmax(0,1fr) 58px;gap:7px}.a296-att-head{font-size:7.5px;padding-bottom:6px}.a296-att-row{padding:6px 0}.a296-att-row .attention-kind{font-size:7.2px;padding:3.5px 6px}.a296-att-row b{font-size:8.3px}.a296-att-row small{font-size:7.4px}.a296-att-row strong{font-size:9px}

.a296-docs{padding-top:12px;padding-bottom:12px}.a296-doc-grid{gap:10px}.a296-doc-panel{padding:10px;border-radius:10px}.a296-doc-head{margin-bottom:7px}.a296-doc-head b{font-size:9.5px}.a296-doc-head span{font-size:7.8px}.a296-docbar{height:9px;margin-bottom:7px}.a296-doclegend{gap:7px 10px}.a296-doclegend span{font-size:7.4px}.a296-doclegend span>i{width:6px;height:6px}

@media(max-width:1360px){
  .analytics-v296{max-width:100%}
  .a296-kpi{grid-template-columns:38px minmax(0,1fr) 66px;padding:9px 10px}.a296-kpi-icon{width:38px;height:38px}.a296-kpi-copy strong{font-size:28px}.a296-spark{width:66px}
}
@media(max-width:1180px){
  .a296-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .a296-top-grid,.a296-mid-grid,.a296-bottom-grid{grid-template-columns:1fr}
  .a296-doc-grid{grid-template-columns:1fr}
  .a296-chart{height:205px}.a296-ylabels{height:205px}
}
/* v5.298 visual tone refinements */
.a296-blue .a296-kpi-copy strong{color:#2f6bff}.a296-green .a296-kpi-copy strong{color:#17885c}.a296-purple .a296-kpi-copy strong{color:#7657ff}.a296-orange .a296-kpi-copy strong{color:#e68222}
.a296-change-row.change-tone-warn strong{color:#bf8307}.a296-change-row.change-tone-bad strong{color:#d54b5d}.a296-change-row.change-tone-info strong{color:#2f6bca}.a296-change-row.change-tone-soft strong{color:#a06f08}
.a296-stage-items .stage-tone-yellow strong{color:#b27800}.a296-stage-items .stage-tone-orange strong{color:#c46f22}.a296-stage-items .stage-tone-blue strong{color:#2d6dc9}.a296-stage-items .stage-tone-green strong{color:#24925b}

/* analytics v5300 — stage distribution + document wait */
.a300-mid-grid{align-items:stretch}
.a300-stage-card,.a300-age-card{min-height:0}
.a300-stage-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:4px}
.a300-stage-mini{min-width:0;padding:10px 11px 9px;border:1px solid #e7edf5;border-radius:11px;background:#fbfcfe;box-shadow:0 1px 3px rgba(21,51,87,.025)}
.a300-stage-mini.is-done{background:#f7fcf9;border-color:#d9f1e4}
.a300-stage-mini-head{display:flex;align-items:center;gap:6px;min-width:0}
.a300-stage-mini-head>span:last-child{font-size:8.8px;font-weight:700;color:#63748d;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.a300-stage-icon{display:block;width:8px;height:8px;border-radius:50%;flex:0 0 auto}
.a300-stage-mini strong{display:block;margin:6px 0 7px;font-size:22px;line-height:1;color:#173d75}
.a300-stage-mini.stage-tone-yellow strong{color:#b27800}.a300-stage-mini.stage-tone-orange strong{color:#c46f22}.a300-stage-mini.stage-tone-blue strong{color:#2d6dc9}.a300-stage-mini.stage-tone-green strong{color:#24925b}
.a300-stage-progress{height:4px;border-radius:999px;overflow:hidden;background:#eef2f7}
.a300-stage-progress i{display:block;height:100%;min-width:3px;border-radius:999px}
.a300-age-head{align-items:center}
.a300-age-alert{display:flex;align-items:center;gap:7px;padding:5px 8px;border-radius:9px;background:#fff3f4;border:1px solid #f6dadd;white-space:nowrap}
.a300-age-alert span{font-size:7.5px;color:#a85a63;font-weight:700}.a300-age-alert strong{font-size:10px;color:#cf4f5e}
.a300-age{height:100px;gap:9px;margin-top:0}
.a300-age-col{grid-template-rows:16px minmax(0,1fr) 15px}
.a300-age-col b{font-size:10px}.a300-age-col>div i{width:25px;background:linear-gradient(180deg,#76adff,#4a88eb)}
.a300-age-col.is-critical b{color:#d95766}.a300-age-col.is-critical>div i{background:linear-gradient(180deg,#f08f99,#d95766)}.a300-age-col.is-critical span{color:#b44d59;font-weight:700}
@media(max-width:1120px){.a300-stage-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:720px){.a300-stage-cards{grid-template-columns:1fr 1fr}.a300-age-head{align-items:flex-start}.a300-age-alert{margin-left:0}}

/* analytics v5301: attention expansion + readable document readiness */
.a301-attention-list.is-expanded{max-height:520px;overflow-y:auto;padding-right:4px;scrollbar-gutter:stable}
.a301-attention-list.is-expanded .a296-att-row{min-height:28px}
.a301-docs{padding-top:12px;padding-bottom:13px}
.a301-doc-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}
.a301-doc-card{min-width:0;padding:12px 13px;border:1px solid #e4eaf2;border-radius:11px;background:#fbfcfe}
.a301-doc-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.a301-doc-title b{font-size:10.5px;color:#18385f}.a301-doc-title span{font-size:7.8px;color:#7c899b}
.a301-doc-main{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin-bottom:8px}
.a301-doc-main>div{display:flex;align-items:baseline;gap:6px;min-width:0}.a301-doc-main strong{font-size:25px;line-height:1;color:#173f78}.a301-doc-main span{font-size:8px;color:#74839a;white-space:nowrap}
.a301-doc-main em{font-style:normal;font-size:15px;font-weight:850;color:#238f5a}
.a301-doc-progress{height:7px;border-radius:999px;overflow:hidden;background:#e8eef5;margin-bottom:9px}.a301-doc-progress i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#45bd7e,#69cf9b)}
.a301-doc-remaining{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 0 7px;border-bottom:1px solid #e9eef4}.a301-doc-remaining span{font-size:8.2px;color:#6d7d94;font-weight:700}.a301-doc-remaining b{font-size:11px;color:#c16e1e}
.a301-doc-statuses{display:grid;gap:5px;padding-top:7px}.a301-doc-status{display:flex;align-items:center;justify-content:space-between;gap:8px}.a301-doc-status>span{display:flex;align-items:center;gap:5px;min-width:0;font-size:7.8px;color:#687991}.a301-doc-status>span i{width:6px;height:6px;border-radius:50%;flex:0 0 auto}.a301-doc-status>b{font-size:8.8px;color:#304a6d}
@media(max-width:1180px){.a301-doc-grid{grid-template-columns:1fr}.a301-doc-main strong{font-size:23px}}
@media(max-width:720px){.a301-attention-list.is-expanded{max-height:440px}.a301-doc-card{padding:11px}.a301-doc-main>div{align-items:flex-end;flex-direction:column;gap:2px}.a301-doc-main span{white-space:normal}}

/* analytics v5302: management balance + document causes */
.a302-balance-card{margin-bottom:11px;padding:10px 14px}
.a302-balance-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:9px}
.a302-balance-head h2{margin:0;font-size:13.5px;color:#18385f}.a302-balance-head p{margin:2px 0 0;font-size:8.8px;color:#7a899e}.a302-balance-head>span{font-size:8px;color:#718198;background:#f3f6fa;border-radius:999px;padding:4px 8px;white-space:nowrap}
.a302-balance-grid{display:grid;grid-template-columns:minmax(95px,1fr) 20px minmax(95px,1fr) 20px minmax(95px,1fr) 20px minmax(105px,1fr) minmax(220px,1.35fr);gap:8px;align-items:center}
.a302-balance-step{padding:8px 10px;border:1px solid #e6ecf3;border-radius:10px;background:#fbfcfe}.a302-balance-step small{display:block;font-size:8px;color:#75849a;font-weight:700}.a302-balance-step strong{display:block;margin-top:3px;font-size:21px;line-height:1;color:#173f78}
.a302-arrow{font-size:15px;color:#9aa8bb;text-align:center;font-weight:800}
.a302-balance-deltas{display:grid;grid-template-columns:1fr 1fr;gap:7px;padding-left:4px}.a302-balance-deltas>div{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 9px;border:1px solid #e7edf4;border-radius:10px;background:#fff}.a302-balance-deltas span{font-size:7.8px;color:#697a91;font-weight:700}.a302-balance-deltas b{font-size:15px}.a302-balance-deltas b.good{color:#1f985e}.a302-balance-deltas b.bad{color:#d45261}.a302-balance-deltas b.neutral{color:#7b899b}
.a302-causes{margin-top:11px;padding-top:10px;border-top:1px solid #e8edf4}.a302-causes-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:8px}.a302-causes h3{margin:0;font-size:10.5px;color:#18385f}.a302-causes p{margin:2px 0 0;font-size:7.8px;color:#7c899b}
.a302-causes-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px 11px}.a302-cause-row{display:grid;grid-template-columns:minmax(0,1fr) 34px;gap:4px 8px;align-items:center;padding:6px 8px;border:1px solid #e9eef4;border-radius:9px;background:#fff}.a302-cause-row>span{font-size:7.9px;color:#64758d;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.a302-cause-row>b{font-size:9px;color:#24466f;text-align:right}.a302-cause-row>div{grid-column:1/-1;height:4px;border-radius:999px;background:#edf2f7;overflow:hidden}.a302-cause-row>div i{display:block;height:100%;border-radius:inherit}
@media(max-width:1250px){.a302-balance-grid{grid-template-columns:repeat(4,minmax(0,1fr));}.a302-arrow{display:none}.a302-balance-deltas{grid-column:1/-1;padding-left:0}.a302-causes-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:720px){.a302-balance-head{flex-direction:column}.a302-balance-grid{grid-template-columns:1fr 1fr}.a302-balance-deltas{grid-template-columns:1fr;grid-column:1/-1}.a302-causes-grid{grid-template-columns:1fr}}

/* v5.303 — terminology for full document set + richer KPI icons */
.a296-kpi-icon svg{width:22px;height:22px;display:block;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.a296-blue .a296-kpi-icon{background:linear-gradient(180deg,#eef4ff,#e7f0ff)}
.a296-green .a296-kpi-icon{background:linear-gradient(180deg,#ebfaf3,#e2f7ed)}
.a296-purple .a296-kpi-icon{background:linear-gradient(180deg,#f2efff,#ebe7ff)}
.a296-orange .a296-kpi-icon{background:linear-gradient(180deg,#fff5ec,#ffede0)}
.a296-kpi-icon{box-shadow:inset 0 0 0 1px rgba(56,86,132,.05)}
.a301-doc-title>div{min-width:0;display:grid;gap:2px}
.a301-doc-title>div small{font-size:7px;color:#8b96a6;font-weight:700}
.a301-doc-title>div b{line-height:1.05}
.a296-orange .a296-kpi-copy b{white-space:normal;line-height:1.12;max-width:160px}

/* v6_1 object card document chips */
.object-hero-chip.object-doc-chip{display:inline-flex;align-items:center;gap:6px}
.object-hero-chip.object-doc-chip::before{content:"";width:7px;height:7px;border-radius:999px;background:currentColor;opacity:.9;flex:0 0 auto}
.object-hero-chip.object-doc-chip.ok{background:#e7f8ef;color:#177548;border-color:#d2f0df}
.object-hero-chip.object-doc-chip.progress{background:#eef4ff;color:#3568c9;border-color:#d7e5ff}
.object-hero-chip.object-doc-chip.wait{background:#fff4d9;color:#9a6200;border-color:#f5e4b5}
.object-hero-chip.object-doc-chip.bad{background:#fdecef;color:#c53f53;border-color:#f8d4da}
@media (max-width: 980px){
  .object-hero-chip.object-doc-chip{font-size:10px}
}

/* v6.2 — ключевые даты: без лишнего разделителя, срок выровнен по полям */
.object-dates-card-v204 .object-side-term{
  border-bottom:0!important;
  padding-top:9px!important;
  padding-bottom:9px!important;
  align-items:center!important;
}
.object-dates-card-v204 .object-side-term>span{
  align-self:center!important;
  text-align:left!important;
}
.object-dates-card-v204 .object-side-term>b{
  justify-self:start!important;
  text-align:left!important;
  align-self:center!important;
}
.object-dates-card-v204 .object-side-adpu-form{
  border-top:0!important;
  margin-top:0!important;
  padding-top:0!important;
}

/* v6.3 — восстановить обычный вид строки "Срок" */
.object-dates-card-v204 .object-side-term{
  border-bottom:1px solid #edf1f5!important;
  padding-top:9px!important;
  padding-bottom:9px!important;
  align-items:center!important;
}
.object-dates-card-v204 .object-side-term>span{
  align-self:center!important;
  text-align:left!important;
}
.object-dates-card-v204 .object-side-term>b{
  justify-self:end!important;
  text-align:right!important;
  align-self:center!important;
}
.object-dates-card-v204 .object-side-adpu-form{
  border-top:0!important;
  margin-top:0!important;
  padding-top:0!important;
}

/* v6.4 — строка "Срок" по одной левой линии с остальными заголовками */
.object-dates-card-v204 .object-side-term{
  padding-left:0!important;
  padding-right:0!important;
}

/* v6.5 — professional analytics semantics */
.a605-results-card .a302-balance-head{margin-bottom:8px}
.a605-results-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr)) minmax(150px,.9fr) minmax(170px,1fr);gap:8px;align-items:stretch}
.a605-results-grid .a302-balance-step{display:flex;flex-direction:column;justify-content:center;min-height:60px;padding:8px 10px}
.a605-results-grid .a302-balance-step small{font-size:7.8px}
.a605-results-grid .a302-balance-step strong{font-size:20px}
.a605-results-grid .a302-balance-step em{margin-top:3px;font-size:6.9px;font-style:normal;color:#8a96a7;font-weight:650}
.a605-results-grid .a302-balance-step.is-current-total{background:#fffaf2;border-color:#f5e4c7}
.a605-results-grid .a302-balance-step.is-current-total strong{color:#d97916}
.a605-queue-card{display:flex;flex-direction:column;justify-content:center;min-height:60px;padding:8px 10px;border:1px solid #e6ecf3;border-radius:10px;background:#fff}
.a605-queue-card>span{font-size:7.6px;color:#718198;font-weight:750}
.a605-queue-card>strong{margin-top:3px;font-size:11.5px;color:#24466f}
.a605-queue-card>em{margin-top:4px;font-size:7.3px;font-style:normal;font-weight:800}
.a605-queue-card>em.good{color:#198653}.a605-queue-card>em.bad{color:#cc4d5d}.a605-queue-card>em.neutral{color:#8692a3}

.a605-timing-head,.a605-timing-row{grid-template-columns:minmax(0,1.25fr) 65px 65px 88px 78px!important}
.a605-target{text-align:right;display:grid;gap:1px;justify-items:end}
.a605-target>b{font-size:8.3px!important;color:#50627a!important}
.a605-target>small{font-size:6.7px!important;font-weight:800}
.a605-target.good>small{color:#178654}.a605-target.bad>small{color:#cf4d5d}.a605-target.neutral>small{color:#8692a3}
.a605-target-note{margin-top:6px;padding-top:6px;border-top:1px dashed #e7edf4;font-size:6.9px;color:#8b96a6}

.a605-att-row .a605-att-copy{min-width:0;display:grid;gap:2px}
.a605-att-row .a605-att-copy small{display:block;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:7.1px;color:#6e7e94}
.a605-att-row .a605-att-copy em{display:block;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:6.5px;font-style:normal;font-weight:700;color:#5272a1}

.a605-causes{margin-top:12px}
.a605-cause-list{display:grid;gap:5px}
.a605-cause-row{display:grid;grid-template-columns:24px minmax(0,1fr) 44px 40px;gap:8px;align-items:center;padding:6px 8px;border:1px solid #e9eef4;border-radius:9px;background:#fff}
.a605-cause-rank{display:grid;place-items:center;width:20px;height:20px;border-radius:7px;background:#f1f5fa;color:#526780;font-size:8px;font-weight:850}
.a605-cause-copy{display:grid;gap:4px;min-width:0}
.a605-cause-copy>b{font-size:7.9px;color:#344d70;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.a605-cause-copy>div{height:4px;border-radius:999px;background:#edf2f7;overflow:hidden}
.a605-cause-copy>div i{display:block;height:100%;border-radius:inherit}
.a605-cause-row>strong{font-size:10px;color:#1f426f;text-align:right}
.a605-cause-row>em{font-size:7.3px;font-style:normal;color:#7a899d;text-align:right}

@media(max-width:1250px){
  .a605-results-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .a605-queue-card{min-height:52px}.a605-queue-card:nth-last-child(-n+2){grid-column:span 2}
}
@media(max-width:900px){
  .a605-results-grid{grid-template-columns:1fr 1fr}
  .a605-queue-card:nth-last-child(-n+2){grid-column:auto}
  .a605-timing-head{display:none!important}
  .a605-timing-row{grid-template-columns:minmax(0,1fr) 72px!important}
  .a605-timing-row .a605-target{grid-column:1/-1;display:flex;justify-content:space-between;align-items:center;padding-top:3px}
}
@media(max-width:640px){.a605-results-grid{grid-template-columns:1fr}.a605-cause-row{grid-template-columns:24px minmax(0,1fr) 38px}.a605-cause-row>em{display:none}}

/* v6.6 — analytics timing header alignment */
.a605-timing-head{
  align-items:end!important;
}
.a605-timing-head > span:first-child{
  text-align:left!important;
}
.a605-timing-head > span:nth-child(n+2){
  text-align:right!important;
  justify-self:end!important;
}
.a605-timing-row > strong,
.a605-timing-row > span,
.a605-timing-row > em{
  justify-self:end!important;
}
.a605-timing-row .a605-target{
  width:100%;
  justify-self:end!important;
}

/* v6.7 — analytics proportions: quieter top, slightly stronger detail block */
/* Верхняя сводная зона: примерно на 6–8% компактнее */
.analytics-v296 .analytics-v296-head{margin-bottom:6px}
.analytics-v296 .analytics-v296-head h1{font-size:22.5px}
.analytics-v296 .analytics-v296-head p{font-size:10px}
.analytics-v296 .a296-filter{padding:8px 10px;margin-bottom:8px}
.analytics-v296 .a296-periods .button{height:29px;min-height:29px;padding:4px 10px;font-size:9px}
.analytics-v296 .a296-dates input[type=date],
.analytics-v296 .a296-dates button{height:29px;min-height:29px;font-size:9px}
.analytics-v296 .a296-section-title{margin-bottom:5px}
.analytics-v296 .a296-section-title h2{font-size:13px}
.analytics-v296 .a296-section-title p{font-size:8.4px}
.analytics-v296 .a296-kpis{gap:8px;margin-bottom:9px}
.analytics-v296 .a296-kpi{grid-template-columns:37px minmax(0,1fr) 68px;gap:8px;min-height:78px;padding:8px 10px}
.analytics-v296 .a296-kpi-icon{width:37px;height:37px;border-radius:11px}
.analytics-v296 .a296-kpi-icon svg{width:20px;height:20px}
.analytics-v296 .a296-kpi-copy b{font-size:9.8px}
.analytics-v296 .a296-kpi-copy strong{font-size:28px;margin:3px 0 1px}
.analytics-v296 .a296-kpi-copy small{font-size:7.8px}
.analytics-v296 .a296-spark{width:68px;height:23px}
.analytics-v296 .a605-results-card{padding:10px 12px}
.analytics-v296 .a605-results-card .a302-balance-head{margin-bottom:6px}
.analytics-v296 .a605-results-grid{gap:7px}
.analytics-v296 .a605-results-grid .a302-balance-step,
.analytics-v296 .a605-queue-card{min-height:54px;padding:7px 9px}
.analytics-v296 .a605-results-grid .a302-balance-step strong{font-size:18px}
.analytics-v296 .a605-results-grid .a302-balance-step small,
.analytics-v296 .a605-queue-card>span{font-size:7.3px}
.analytics-v296 .a605-queue-card>strong{font-size:10.8px}

/* Детальный блок: совсем немного крупнее относительно остальной страницы */
.analytics-v296 .a296-bottom-grid{gap:12px}
.analytics-v296 .a296-bottom-grid>.a296-card{padding:13px 15px}
.analytics-v296 .a296-bottom-grid .a296-card-head{margin-bottom:10px}
.analytics-v296 .a296-bottom-grid .a296-card-head h2{font-size:14px}
.analytics-v296 .a296-bottom-grid .a296-card-head p{font-size:9.1px}
.analytics-v296 .a605-timing-head,
.analytics-v296 .a605-timing-row{grid-template-columns:minmax(0,1.25fr) 69px 69px 92px 82px!important;gap:8px}
.analytics-v296 .a605-timing-head{font-size:8px;padding-bottom:7px}
.analytics-v296 .a605-timing-row{padding:8.5px 0}
.analytics-v296 .a605-timing-row b{font-size:9.8px}
.analytics-v296 .a605-timing-row small{font-size:7.5px}
.analytics-v296 .a605-timing-row strong{font-size:10.8px}
.analytics-v296 .a605-timing-row>span{font-size:9.5px}
.analytics-v296 .a605-target>b{font-size:8.6px!important}
.analytics-v296 .a605-target>small{font-size:7px!important}
.analytics-v296 .a605-timing-row em{font-size:8.6px}
.analytics-v296 .a296-att-head{font-size:7.8px;padding-bottom:7px}
.analytics-v296 .a296-att-row{padding:6.5px 0}
.analytics-v296 .a296-att-row .attention-kind{font-size:7.5px;padding:4px 6px}
.analytics-v296 .a296-att-row b{font-size:8.6px}
.analytics-v296 .a605-att-row .a605-att-copy small{font-size:7.4px}
.analytics-v296 .a605-att-row .a605-att-copy em{font-size:6.8px}
.analytics-v296 .a296-att-row strong{font-size:9.4px}

/* v6.8 — analytics filter compactness and alignment */
.analytics-v296 .a296-filter{
  max-width: 1460px;
  margin: 0 auto 10px;
  padding: 10px 12px;
}
.analytics-v296 .a296-filter-form{
  align-items:center;
  gap:8px 12px;
}
.analytics-v296 .a296-periods{
  gap:6px;
}
.analytics-v296 .a296-periods .button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  line-height:1;
}
.analytics-v296 .a296-dates{
  align-items:flex-start;
  gap:8px;
}
.analytics-v296 .a296-dates label{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:flex-start;
  gap:3px;
}
.analytics-v296 .a296-dates label span{
  display:block;
  text-align:left;
  line-height:1;
  margin-left:1px;
}
.analytics-v296 .a296-dates input[type=date],
.analytics-v296 .a296-dates button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.analytics-v296 .a296-dates button{
  align-self:flex-end;
  text-align:center;
  line-height:1;
}
.analytics-v296 .a296-compare{
  margin-top:5px;
}

/* v6.9 — date labels beside fields */
.analytics-v296 .a296-filter{
  max-width:1380px;
}
.analytics-v296 .a296-dates{
  align-items:center;
  gap:10px;
}
.analytics-v296 .a296-dates label{
  display:flex;
  flex-direction:row;
  align-items:center;
  justify-content:flex-start;
  gap:5px;
}
.analytics-v296 .a296-dates label span{
  display:inline-block;
  flex:0 0 auto;
  margin:0;
  line-height:1;
  text-align:left;
}
.analytics-v296 .a296-dates input[type=date]{
  flex:0 0 auto;
}
.analytics-v296 .a296-dates button{
  align-self:center;
}
@media(max-width:720px){
  .analytics-v296 .a296-dates label{
    display:grid;
    grid-template-columns:auto minmax(0,1fr);
    gap:5px;
  }
}

/* v6.10 — restore filter width to match analytics blocks */
.analytics-v296 .a296-filter{
  max-width:none !important;
  width:100%;
}

/* v6.11 — flow row updated with applications */
.analytics-v296 .a296-kpis{grid-template-columns:repeat(5,minmax(0,1fr));}
.a296-teal{color:#17a48f}
.a296-teal .a296-kpi-copy strong{color:#17a48f}
.a296-teal .a296-kpi-icon{background:linear-gradient(180deg,#e8fbf7,#ddf6f1)}
@media(max-width:1280px){
  .analytics-v296 .a296-kpis{grid-template-columns:repeat(3,minmax(0,1fr));}
}
@media(max-width:980px){
  .analytics-v296 .a296-kpis{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:720px){
  .analytics-v296 .a296-kpis{grid-template-columns:1fr;}
}

/* v6.12 — analytics semantics: TZ vs points, drilldowns and current-status layout */
.analytics-v296 .a605-results-grid.is-current-status{
  grid-template-columns:repeat(6,minmax(0,1fr));
}
.analytics-v296 .a605-results-grid.is-period-results{
  grid-template-columns:repeat(10,minmax(0,1fr));
}
.analytics-v296 .a605-results-grid.is-period-results .a302-balance-step{
  grid-column:span 2;
}
.analytics-v296 .a605-results-grid.is-period-results .a605-queue-card{
  grid-column:span 5;
}
.a296-change-list.is-current .a296-change-row{
  grid-template-columns:24px minmax(0,1fr) 48px;
}
.a300-stage-mini,
.a605-cause-row,
.a300-age-alert{
  text-decoration:none;
  color:inherit;
}
.a300-stage-mini{transition:border-color .15s ease,box-shadow .15s ease,transform .15s ease}
.a300-stage-mini:hover{border-color:#a9c5ef;box-shadow:0 3px 10px rgba(35,79,137,.08);transform:translateY(-1px)}
.a605-cause-row{transition:border-color .15s ease,background .15s ease}
.a605-cause-row:hover{border-color:#b7cbea;background:#f8fbff}
.a300-age-alert{transition:border-color .15s ease,background .15s ease}
.a300-age-alert:hover{border-color:#ef9aa5;background:#fff5f6}
@media(max-width:1280px){
  .analytics-v296 .a605-results-grid.is-current-status{grid-template-columns:repeat(3,minmax(0,1fr))}
  .analytics-v296 .a605-results-grid.is-period-results{grid-template-columns:repeat(6,minmax(0,1fr))}
  .analytics-v296 .a605-results-grid.is-period-results .a302-balance-step{grid-column:span 2}
  .analytics-v296 .a605-results-grid.is-period-results .a605-queue-card{grid-column:span 3}
}
@media(max-width:760px){
  .analytics-v296 .a605-results-grid.is-current-status,
  .analytics-v296 .a605-results-grid.is-period-results{grid-template-columns:1fr 1fr}
  .analytics-v296 .a605-results-grid.is-period-results .a302-balance-step,
  .analytics-v296 .a605-results-grid.is-period-results .a605-queue-card{grid-column:auto}
}

/* v6.13 — analytics drill-down and clickable metrics */
.a613-clickable{text-decoration:none;color:inherit;cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease,transform .15s ease}
.a613-clickable:hover{border-color:#b9cbea!important;box-shadow:0 4px 14px rgba(36,76,132,.08)!important;transform:translateY(-1px)}
.a296-change-row.a613-clickable{color:inherit}
.a296-timing-row.a613-clickable{color:inherit}
.a302-balance-step.a613-clickable,.a605-queue-card.a613-clickable{color:inherit}
.a613-drilldown{margin-top:10px}
.a613-drilldown-table{border:1px solid #e7edf4;border-radius:9px;overflow:hidden}
.a613-drilldown-head,.a613-drilldown-row{display:grid;grid-template-columns:105px minmax(180px,1fr) minmax(180px,1.15fr) 90px;gap:10px;align-items:center}
.a613-drilldown-head{padding:7px 9px;background:#f7f9fc;color:#7d899b;font-size:7.5px;font-weight:800;border-bottom:1px solid #e7edf4}
.a613-drilldown-row{padding:8px 9px;text-decoration:none;color:inherit;border-bottom:1px solid #edf1f5}
.a613-drilldown-row:last-child{border-bottom:0}
.a613-drilldown-row:hover{background:#f8fbff}
.a613-drilldown-row b{font-size:8.8px;color:#1f5ebc}
.a613-drilldown-row span{font-size:8px;color:#52647c;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.a613-drilldown-row em{font-size:7.7px;font-style:normal;color:#526f98;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.a613-drilldown-row strong{font-size:8.2px;color:#334b69;text-align:right}
.a613-drilldown-pages{display:flex;align-items:center;justify-content:center;gap:10px;margin-top:8px}
.a613-drilldown-pages span{font-size:7.8px;color:#768399}
@media(max-width:760px){
  .a613-drilldown-head{display:none}
  .a613-drilldown-row{grid-template-columns:82px minmax(0,1fr);gap:4px 8px}
  .a613-drilldown-row em{grid-column:1/-1;white-space:normal}
  .a613-drilldown-row strong{text-align:left}
}

/* v6.14 — drilldown first/last pagination buttons */
.a613-drilldown-pages{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:10px}
.a613-drilldown-pages .a614-page-side{display:flex;align-items:center;gap:6px}
.a613-drilldown-pages .a614-page-side:first-child{justify-content:flex-end}
.a613-drilldown-pages .a614-page-side:last-child{justify-content:flex-start}
.a613-drilldown-pages .a614-edge-page{min-width:30px;padding-left:7px;padding-right:7px;text-align:center}
@media(max-width:720px){
  .a613-drilldown-pages{grid-template-columns:1fr;justify-items:center}
  .a613-drilldown-pages .a614-page-side:first-child,
  .a613-drilldown-pages .a614-page-side:last-child{justify-content:center}
}

/* v6.15 — secondary unique-TZ totals inside montage / ADPU KPI cards */
.analytics-v296 .a615-kpi-card{
  display:grid!important;
  grid-template-rows:minmax(0,1fr) auto;
  padding:0!important;
  min-height:92px!important;
  overflow:hidden;
}
.analytics-v296 .a615-kpi-main{
  min-width:0;
  display:grid;
  grid-template-columns:37px minmax(0,1fr) 68px;
  align-items:center;
  gap:8px;
  min-height:70px;
  padding:7px 10px;
  color:inherit;
  text-decoration:none;
  transition:background .15s ease;
}
.analytics-v296 .a615-kpi-main:hover{background:rgba(246,249,253,.78)}
.analytics-v296 .a615-kpi-secondary{
  min-width:0;
  min-height:22px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:4px 10px 5px;
  border-top:1px solid #edf1f5;
  background:#fbfcfe;
  color:#6f7f94;
  text-decoration:none;
  font-size:7.4px;
  line-height:1.1;
  white-space:nowrap;
  transition:background .15s ease;
}
.analytics-v296 .a615-kpi-secondary:hover{background:#f5f8fc}
.analytics-v296 .a615-kpi-secondary span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
}
.analytics-v296 .a615-kpi-secondary strong{
  flex:0 0 auto;
  font-size:10.5px;
  line-height:1;
  font-weight:800;
}
.analytics-v296 .a296-teal .a615-kpi-secondary strong{color:#17a48f}
.analytics-v296 .a296-purple .a615-kpi-secondary strong{color:#7657ff}
@media(max-width:720px){
  .analytics-v296 .a615-kpi-main{grid-template-columns:37px minmax(0,1fr) 72px}
}

/* v6.17 — fix unique-TZ footer placement inside KPI cards */
.analytics-v296 .a615-kpi-card{
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:minmax(0,1fr) auto!important;
  min-height:98px!important;
}
.analytics-v296 .a615-kpi-main{
  width:100%;
  grid-column:1!important;
  grid-row:1!important;
  min-height:74px;
}
.analytics-v296 .a615-kpi-secondary{
  width:100%;
  grid-column:1!important;
  grid-row:2!important;
  min-height:24px;
  padding:5px 10px 6px;
  font-size:7.6px;
}
.analytics-v296 .a615-kpi-secondary strong{
  font-size:10.8px;
}

/* v6.18 — KPI highlight aligned to full card bounds */
.analytics-v296 .a615-kpi-card.no-secondary{
  grid-template-rows:minmax(0,1fr)!important;
}
.analytics-v296 .a615-kpi-card.no-secondary .a615-kpi-main{
  min-height:96px;
  height:100%;
  align-self:stretch;
  border-radius:12px;
}
.analytics-v296 .a615-kpi-card.has-secondary .a615-kpi-main{
  border-radius:12px 12px 0 0;
}
.analytics-v296 .a615-kpi-card.has-secondary .a615-kpi-secondary{
  border-radius:0 0 12px 12px;
}
.analytics-v296 .a615-kpi-card.no-secondary .a615-kpi-main:hover{
  background:rgba(246,249,253,.9);
}
.analytics-v296 .a615-kpi-card.has-secondary .a615-kpi-main:hover,
.analytics-v296 .a615-kpi-card.has-secondary .a615-kpi-secondary:hover{
  background:#f6f9fd;
}
.analytics-v296 .a615-kpi-card.has-secondary .a615-kpi-secondary{
  margin-top:0;
}

/* v6.19 — make KPI hover/highlight reach the divider exactly */
.analytics-v296 .a615-kpi-card.has-secondary{
  align-items:stretch!important;
}
.analytics-v296 .a615-kpi-card.has-secondary .a615-kpi-main{
  align-self:stretch!important;
  height:100%!important;
  margin:0!important;
}
.analytics-v296 .a615-kpi-card.has-secondary .a615-kpi-secondary{
  align-self:stretch!important;
  height:100%!important;
  margin:0!important;
}

/* v6.20 — exact KPI highlight-to-divider geometry */
.analytics-v296 .a615-kpi-card.has-secondary{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  justify-content:stretch!important;
  gap:0!important;
}
.analytics-v296 .a615-kpi-card.has-secondary .a615-kpi-main{
  flex:1 1 auto!important;
  height:auto!important;
  min-height:0!important;
  align-self:stretch!important;
  margin:0!important;
  border-radius:12px 12px 0 0!important;
}
.analytics-v296 .a615-kpi-card.has-secondary .a615-kpi-secondary{
  flex:0 0 24px!important;
  height:24px!important;
  min-height:24px!important;
  align-self:stretch!important;
  margin:0!important;
  border-top:1px solid #edf1f5!important;
  border-radius:0 0 12px 12px!important;
}

/* v6.21 — management summary and data-quality control */
.analytics-v296 .a621-period-summary{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  margin-top:8px;padding:7px 9px;border-top:1px solid #edf1f5;
  color:#5e6e83;font-size:7.8px;line-height:1.35;
}
.analytics-v296 .a621-period-summary>span{min-width:0;flex:1}
.analytics-v296 .a621-copy-summary{
  flex:0 0 auto;min-height:25px;padding:4px 8px;border:1px solid #d8e0ea;
  border-radius:7px;background:#fff;color:#2f5f9d;font-size:7.6px;font-weight:800;
}
.analytics-v296 .a621-management-card{margin-bottom:10px;padding:10px 12px}
.analytics-v296 .a621-management-head{margin-bottom:7px}
.analytics-v296 .a621-management-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.analytics-v296 .a621-management-item{
  min-width:0;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 8px;
  align-items:center;padding:8px 10px;border:1px solid #e4eaf2;border-radius:9px;
  background:#fbfcfe;text-decoration:none;color:#314763;transition:border-color .15s ease,background .15s ease;
}
.analytics-v296 .a621-management-item:hover{border-color:#b9cbea;background:#f7faff}
.analytics-v296 .a621-management-item span{font-size:8.3px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.analytics-v296 .a621-management-item strong{grid-row:1/3;grid-column:2;font-size:19px;line-height:1;font-weight:850}
.analytics-v296 .a621-management-item small{font-size:7.2px;color:#8490a0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.analytics-v296 .a621-management-item.tone-green strong{color:#17885c}
.analytics-v296 .a621-management-item.tone-purple strong{color:#7657ff}
.analytics-v296 .a621-management-item.tone-orange strong{color:#e68222}
.analytics-v296 .a621-management-item.tone-red strong{color:#c84b5d}

.analytics-v296 .a621-quality-card{margin-top:10px;padding:10px 12px}
.analytics-v296 .a621-quality-head{align-items:center;margin-bottom:7px}
.analytics-v296 .a621-quality-total{flex:0 0 auto;padding:4px 8px;border-radius:999px;font-size:7.5px;font-weight:850}
.analytics-v296 .a621-quality-total.is-ok{background:#eaf8f0;color:#258358}
.analytics-v296 .a621-quality-total.has-issues{background:#fff2df;color:#9c6718}
.analytics-v296 .a621-quality-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.analytics-v296 .a621-quality-item{
  display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;
  padding:7px 9px;border:1px solid #e5eaf1;border-radius:8px;background:#fbfcfe;
  color:#56667c;text-decoration:none;transition:border-color .15s ease,background .15s ease;
}
.analytics-v296 .a621-quality-item:hover{border-color:#b8c9e3;background:#f7faff}
.analytics-v296 .a621-quality-item span{font-size:7.8px;font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.analytics-v296 .a621-quality-item strong{font-size:12px;line-height:1;font-weight:850;color:#65748a}
.analytics-v296 .a621-quality-item.tone-bad strong{color:#c84b5d}
.analytics-v296 .a621-quality-item.tone-warn strong{color:#d28a1c}
.analytics-v296 .a621-quality-item.tone-info strong{color:#3171bd}
.analytics-v296 .a621-quality-item.tone-ok strong{color:#258358}
.analytics-v296 .a621-quality-note{margin-top:6px;font-size:6.9px;color:#929cab}
@media(max-width:1100px){
  .analytics-v296 .a621-management-grid,.analytics-v296 .a621-quality-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:720px){
  .analytics-v296 .a621-management-grid,.analytics-v296 .a621-quality-grid{grid-template-columns:1fr}
  .analytics-v296 .a621-period-summary{align-items:flex-start;flex-direction:column}
}

/* v6.22 — lighter management metrics */
.analytics-v296 .a621-management-card{
  padding:9px 11px;
}
.analytics-v296 .a621-management-head{
  margin-bottom:6px;
}
.analytics-v296 .a621-management-grid{
  gap:6px;
}
.analytics-v296 .a621-management-item{
  position:relative;
  padding:7px 9px 7px 11px;
  border:1px solid #e3e9f1;
  border-left-width:3px;
  border-radius:8px;
  background:#fff!important;
  box-shadow:none!important;
}
.analytics-v296 .a621-management-item:hover{
  background:#f8fafc!important;
  border-color:#c9d7e8;
}
.analytics-v296 .a621-management-item span{
  font-size:8px;
  color:#53647d;
}
.analytics-v296 .a621-management-item strong{
  font-size:17.5px;
}
.analytics-v296 .a621-management-item small{
  font-size:6.9px;
  color:#9099a6;
}
.analytics-v296 .a621-management-item.tone-green{border-left-color:#62c99a}
.analytics-v296 .a621-management-item.tone-purple{border-left-color:#8b79ff}
.analytics-v296 .a621-management-item.tone-orange{border-left-color:#f0a058}
.analytics-v296 .a621-management-item.tone-red{border-left-color:#e88c9a}
.analytics-v296 .a621-management-item.tone-green strong{color:#288d63}
.analytics-v296 .a621-management-item.tone-purple strong{color:#6e5df2}
.analytics-v296 .a621-management-item.tone-orange strong{color:#d9822b}
.analytics-v296 .a621-management-item.tone-red strong{color:#c95567}

/* v6.33 — five exclusive TZ stages */
.analytics-v296 .a300-stage-cards{grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.analytics-v296 .a300-stage-mini.stage-tone-red strong{color:#cf4657}
@media(max-width:1180px){.analytics-v296 .a300-stage-cards{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){.analytics-v296 .a300-stage-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* v6.36 — production-stage distribution: four exclusive stages + application flag */
.analytics-v296 .a300-stage-cards{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:8px}
.analytics-v296 .a636-stage-head{align-items:center}
.analytics-v296 .a636-stage-extra{
  display:flex;align-items:center;gap:7px;flex:0 0 auto;
  padding:6px 9px;border:1px solid #f0d58a;border-radius:9px;
  background:#fffaf0;color:#8a6500;text-decoration:none;font-size:7.6px;font-weight:700;
}
.analytics-v296 .a636-stage-extra strong{font-size:10px;color:#a87400;white-space:nowrap}
.analytics-v296 .a636-stage-extra:hover{background:#fff5dd;border-color:#e5c25d}
.analytics-v296 .a300-stage-mini{min-height:88px;display:flex;flex-direction:column}
.analytics-v296 .a300-stage-mini-head>span:last-child{white-space:normal;line-height:1.15;min-height:20px}
.analytics-v296 .a300-stage-mini strong{margin:5px 0 2px}
.analytics-v296 .a300-stage-mini strong small{font-size:7px;font-weight:700;color:#8b97a6}
.analytics-v296 .a636-stage-hint{display:block;min-height:15px;font-size:7.1px;line-height:1.15;color:#8a96a5}
.analytics-v296 .a300-stage-progress{margin-top:auto}
.analytics-v296 .a636-stage-note{margin-top:6px;font-size:7.2px;color:#8a96a5}
@media(max-width:1180px){.analytics-v296 .a300-stage-cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:760px){
  .analytics-v296 .a636-stage-head{align-items:flex-start}
  .analytics-v296 .a636-stage-extra{width:100%;justify-content:space-between}
  .analytics-v296 .a300-stage-cards{grid-template-columns:1fr!important}
}

/* v6.38 — fit "Без заявки" as a full card and give stages more room */
.analytics-v296 .a300-mid-grid{
  grid-template-columns:minmax(0,1.65fr) minmax(300px,.55fr)!important;
}
.analytics-v296 .a300-stage-cards{
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:8px;
}
.analytics-v296 .a638-stage-extra-card{
  background:#fffdf7;
  border-color:#f0e3b6;
}
.analytics-v296 .a638-stage-extra-card:hover{
  border-color:#dfc86f;
}
.analytics-v296 .a300-age-card{
  padding-left:10px;
  padding-right:10px;
}
.analytics-v296 .a300-age-card .a296-card-head{
  gap:6px;
}
.analytics-v296 .a300-age-card .a296-card-head h2{font-size:11.5px}
.analytics-v296 .a300-age-card .a296-card-head p{font-size:7.2px}
.analytics-v296 .a300-age-card .a300-age-alert{
  padding:4px 6px;
  font-size:6.8px;
}
.analytics-v296 .a300-age-card .a296-age{
  gap:5px;
}
.analytics-v296 .a300-age-card .a296-age-col>div i{width:22px}
@media(max-width:1180px){
  .analytics-v296 .a300-mid-grid{grid-template-columns:1fr!important}
  .analytics-v296 .a300-stage-cards{grid-template-columns:repeat(3,minmax(0,1fr))!important}
}
@media(max-width:760px){
  .analytics-v296 .a300-stage-cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:520px){
  .analytics-v296 .a300-stage-cards{grid-template-columns:1fr!important}
}

/* v6.42 — compact full-width comment under every documents row */
.ks-doc-stage-table .ks-doc-main-row>td{
  border-bottom-color:#f4f6f9;
}
.ks-doc-stage-table .ks-doc-comment-row{
  height:auto!important;
}
.ks-doc-stage-table .ks-doc-comment-row>td{
  padding:3px 9px 7px!important;
  vertical-align:middle!important;
  background:#fff;
  border-top:0!important;
}
.ks-doc-comment-inline{
  display:grid;
  grid-template-columns:74px minmax(0,1fr) 14px;
  align-items:center;
  gap:7px;
  width:100%;
  min-width:0;
}
.ks-doc-comment-label{
  color:#667085;
  font-size:9px;
  font-weight:700;
  line-height:1;
}
.doc-inline-comment-input{
  width:100%;
  min-width:0;
  height:25px;
  min-height:25px;
  padding:3px 8px;
  border:1px solid #d8dee8;
  border-radius:6px;
  background:#fff;
  color:#344054;
  font-size:10px;
  line-height:1.1;
  box-shadow:none;
}
.doc-inline-comment-input::placeholder{color:#a0a9b6}
.doc-inline-comment-input:hover{border-color:#c8d1de}
.doc-inline-comment-input:focus{
  outline:none;
  border-color:#9bbcf0;
  box-shadow:0 0 0 2px rgba(31,111,235,.08);
}
.ks-doc-comment-inline .doc-inline-field-mark{
  position:static;
  width:14px;
  min-width:14px;
  text-align:center;
}

@media (min-width:821px) and (max-width:1600px){
  .ks-doc-stage-table tbody>tr.ks-doc-main-row{
    border-radius:10px 10px 0 0;
    border-bottom:0;
  }
  .ks-doc-stage-table tbody>tr.ks-doc-comment-row{
    display:block!important;
    width:100%;
    margin-top:-9px;
    border:1px solid var(--line);
    border-top:0;
    border-radius:0 0 10px 10px;
    overflow:hidden;
    background:#fff;
  }
  .ks-doc-stage-table tbody>tr.ks-doc-comment-row>td{
    display:block!important;
    width:100%!important;
    padding:4px 10px 7px!important;
    border:0!important;
    border-radius:0!important;
  }
}

@media (max-width:820px){
  .ks-doc-stage-table tbody>tr.ks-doc-main-row{
    border-radius:10px 10px 0 0;
    border-bottom:0;
  }
  .ks-doc-stage-table tbody>tr.ks-doc-comment-row{
    display:block!important;
    width:100%;
    margin-top:-9px;
    border:1px solid var(--line);
    border-top:0;
    border-radius:0 0 10px 10px;
    overflow:hidden;
    background:#fff;
  }
  .ks-doc-stage-table tbody>tr.ks-doc-comment-row>td{
    display:block!important;
    width:100%!important;
    padding:5px 9px 8px!important;
    border:0!important;
    border-radius:0!important;
  }
  .ks-doc-comment-inline{grid-template-columns:68px minmax(0,1fr) 14px}
  .doc-inline-comment-input{font-size:11px}
}

@media (max-width:480px){
  .ks-doc-comment-inline{grid-template-columns:1fr 14px;gap:5px}
  .ks-doc-comment-label{grid-column:1/-1;margin-bottom:1px}
}

/* v6.87 — prevent the comment field from flashing at full width before JS alignment. */
@media (min-width:821px){
  .ks-doc-comment-inline{visibility:hidden;}
  .ks-doc-comment-inline.is-layout-ready{visibility:visible;}
}

/* v6.45 — document headers centered over the status controls */
.ks-doc-stage-table thead th.ks-doc-stage-head{
  text-align:left!important;
}
.ks-doc-stage-table .doc-stage-head-grid{
  display:grid;
  grid-template-columns:72px 142px 10px;
  gap:3px;
  width:230px;
  max-width:230px;
  margin:0 auto;
  align-items:center;
}
.ks-doc-stage-table .doc-stage-head-grid>b{
  grid-column:2;
  display:block;
  width:142px;
  text-align:center;
  font:inherit;
  color:inherit;
}
@media(max-width:1100px){
  .ks-doc-stage-table .doc-stage-head-grid{
    grid-template-columns:68px 136px 10px;
    width:220px;
    max-width:220px;
  }
  .ks-doc-stage-table .doc-stage-head-grid>b{width:136px}
}


/* v6.48 — keep dashboard stage dropdowns fully visible */
@media (min-width:641px){
  .dashboard-table tr.object-row:has(.tz-stage-status.is-open){
    overflow:visible!important;
    position:relative;
    z-index:380;
  }
  .dashboard-table td.dashboard-workflow-cell:has(.tz-stage-status.is-open){
    position:relative;
    z-index:390;
    overflow:visible!important;
  }
  .dashboard-table .tz-stage-status.is-open{z-index:410}
  .dashboard-table .tz-stage-status.opens-up .tz-stage-custom-menu{
    top:auto!important;
    bottom:calc(100% + 2px)!important;
  }
}

/* v6.50 — compact informational chips + editable completion-letter reference */
.object-hero-title-line{
  gap:6px!important;
  row-gap:5px!important;
}
.object-hero-chip{
  min-height:21px!important;
  padding:2px 6px!important;
  border-radius:6px!important;
  font-size:8.8px!important;
  line-height:1.15!important;
  font-weight:500!important;
  letter-spacing:0!important;
}
.object-hero-chip.object-doc-chip{
  gap:4px!important;
  font-weight:500!important;
}
.object-hero-chip.object-doc-chip::before{
  width:5px!important;
  height:5px!important;
}
.object-letter-chip{
  cursor:default;
  max-width:290px;
  overflow:hidden;
  text-overflow:ellipsis;
}
.object-letter-chip[data-editable="1"]{cursor:text}
.object-letter-chip.is-editing{
  padding:1px 5px!important;
  min-width:245px;
  max-width:340px;
  background:#fff!important;
  border-color:#9dbcf2!important;
  overflow:visible;
}
.object-letter-chip-input{
  width:100%;
  min-width:230px;
  height:17px;
  min-height:17px;
  padding:0 2px;
  border:0!important;
  border-radius:0!important;
  outline:0!important;
  background:transparent!important;
  color:#33445e;
  font-size:8.8px!important;
  font-weight:500!important;
  line-height:17px;
  box-shadow:none!important;
}
.object-letter-chip.is-saving{opacity:.65}
.object-letter-chip.is-saved{border-color:#a8ddc0!important}
.object-letter-chip.is-error{border-color:#ef9aa7!important;background:#fff3f5!important}
@media(max-width:760px){
  .object-hero-chip{font-size:8.4px!important;padding:2px 5px!important}
  .object-letter-chip.is-editing{min-width:190px;max-width:100%}
  .object-letter-chip-input{min-width:175px}
}

/* v6.51 — lighter and smaller hero status indicators */
.object-hero-title-line .object-hero-chip{
  min-height:18px!important;
  padding:1px 5px!important;
  border-radius:5px!important;
  font-size:8px!important;
  line-height:1.05!important;
  font-weight:400!important;
}
.object-hero-title-line .object-hero-chip.object-doc-chip{
  gap:3px!important;
  font-weight:400!important;
}
.object-hero-title-line .object-hero-chip.object-doc-chip::before{
  width:4px!important;
  height:4px!important;
}
.object-hero-title-line .object-letter-chip-input{
  height:15px;
  min-height:15px;
  font-size:8px!important;
  font-weight:400!important;
  line-height:15px;
}
.object-hero-title-line .object-letter-chip.is-editing{
  padding:1px 4px!important;
}
@media(max-width:760px){
  .object-hero-title-line .object-hero-chip{
    min-height:17px!important;
    padding:1px 4px!important;
    font-size:7.8px!important;
  }
}

/* v6.52 — remove dots from document indicators in object card */
.object-hero-title-line .object-hero-chip.object-doc-chip{padding-left:5px!important}
.object-hero-title-line .object-hero-chip.object-doc-chip::before{display:none!important;content:none!important;width:0!important;height:0!important;margin:0!important}

/* v6.53 — align title number with TZ line */
.object-hero-title-number{
  margin-left:0!important;
}


/* v6.55 — keep stage dropdown visible even in filtered single-row list */
@media (min-width:641px){
  .table-wrap.dashboard-stage-menu-open{
    overflow:visible!important;
  }
  .dashboard-table tr.object-row.stage-menu-open{
    overflow:visible!important;
    position:relative;
    z-index:380;
  }
  .dashboard-table td.dashboard-workflow-cell.stage-menu-open{
    position:relative;
    z-index:390;
    overflow:visible!important;
  }
  .dashboard-table .tz-stage-status.is-open{
    z-index:410;
  }
  .dashboard-table .tz-stage-status.opens-up .tz-stage-custom-menu{
    top:auto!important;
    bottom:calc(100% + 2px)!important;
  }
}


/* v6.56 — reliable photo ZIP download + aligned photo action buttons */
.object-photo-actions{
  align-items:center!important;
  gap:8px!important;
}
.object-photo-actions .button{
  height:30px!important;
  min-height:30px!important;
  margin-top:0!important;
  padding:5px 9px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:10px!important;
  line-height:1!important;
}
.object-photo-actions .object-photo-toggle{margin-top:0!important}
.object-photo-actions .btn-icon{width:16px;min-width:16px;height:16px}

/* v6.58 — inspection attachment builder */
.inspection-builder-card{padding:14px}
.inspection-builder-head h2{margin:0 0 3px;font-size:16px}
.inspection-builder-head p{margin:0;font-size:10px}
.inspection-photo-picker{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:10px;margin-top:12px}
.inspection-photo-card{border:1px solid var(--line);border-radius:9px;background:#fbfcfe;padding:7px;min-width:0}
.inspection-photo-card img{display:block;width:100%;height:165px;object-fit:cover;border-radius:7px;background:#eef2f6}
.inspection-photo-choice{display:grid;gap:4px;margin-top:7px}
.inspection-photo-choice label{display:flex;flex-direction:row;align-items:center;gap:6px;font-size:10px;font-weight:600}
.inspection-photo-choice input{width:auto;min-height:0;padding:0}
.inspection-photo-card small{display:block;margin-top:5px;color:#768399;font-size:8.5px}
.inspection-data-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:12px}
.inspection-data-grid .wide{grid-column:1/-1}
.inspection-data-grid label{font-size:10px}
.inspection-data-grid input{min-height:32px;padding:6px 8px;font-size:11px}
.inspection-data-grid small{font-size:8.5px;color:#7c8797;font-weight:400}
.inspection-actions{display:flex;justify-content:flex-end;margin-top:12px}
@media(max-width:760px){.inspection-data-grid{grid-template-columns:1fr}.inspection-data-grid .wide{grid-column:auto}.inspection-photo-picker{grid-template-columns:1fr 1fr}}
@media(max-width:520px){.inspection-photo-picker{grid-template-columns:1fr}}

/* v6.61 — inspection attachment visual layout editor */
.inspection-builder-card{overflow:visible}
.inspection-layout-editor{margin-top:16px;padding-top:14px;border-top:1px solid var(--line)}
.inspection-layout-editor[hidden]{display:none!important}
.inspection-layout-head{margin-bottom:10px}
.inspection-editor-grid{display:grid;grid-template-columns:minmax(0,1.75fr) minmax(260px,.75fr);gap:14px;align-items:start}
.inspection-previews{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;min-width:0}
.inspection-preview-card{min-width:0;border:1px solid var(--line);border-radius:10px;background:#f8fafc;padding:8px}
.inspection-preview-title{display:flex;justify-content:space-between;gap:8px;align-items:center;margin-bottom:6px}
.inspection-preview-title b{font-size:10.5px;color:#253a5b}
.inspection-preview-title span{font-size:8px;color:#8490a0}
.inspection-preview-stage{position:relative;width:100%;height:auto;min-height:0;margin:0 auto;border-radius:8px;overflow:hidden;background:#e9eef5;user-select:none;touch-action:none}
.inspection-preview-stage>img{display:block;width:100%;height:100%;min-height:0;max-height:none;object-fit:fill;background:#dfe6ef}
.inspection-overlay-number,.inspection-overlay-copy{position:absolute;z-index:3;cursor:move;color:#fff;text-shadow:0 1px 3px rgba(0,0,0,.85);background:rgba(0,0,0,.42);border:1px solid rgba(255,255,255,.25);box-shadow:0 2px 10px rgba(0,0,0,.16)}
.inspection-overlay-number{left:3%;top:3%;padding:3px 7px;border-radius:7px;font-size:22px;line-height:1;font-weight:800}
.inspection-overlay-copy{left:4%;top:72%;width:42%;min-width:110px;max-width:88%;padding:6px 8px;border-radius:7px;display:grid;gap:2px;line-height:1.15;overflow:hidden}
#inspection-copy-2{top:78%;width:48%}
.inspection-overlay-copy b{font-size:13px;line-height:1.15;white-space:normal;overflow-wrap:anywhere}
.inspection-overlay-copy span{font-size:10px;line-height:1.2;white-space:normal;overflow-wrap:anywhere}
.inspection-overlay-number.is-dragging,.inspection-overlay-copy.is-dragging{outline:2px solid rgba(55,125,255,.85);outline-offset:1px;cursor:grabbing}
.inspection-edit-panel{position:sticky;top:72px;border:1px solid var(--line);border-radius:10px;background:#fff;padding:11px}
.inspection-edit-panel h3{margin:0 0 8px;font-size:12px}
.inspection-edit-panel .inspection-data-grid{display:grid;grid-template-columns:1fr;gap:8px;margin:0}
.inspection-edit-panel .inspection-data-grid .wide{grid-column:auto}
.inspection-edit-panel .inspection-data-grid input{background:#fff!important;color:#1f2937!important;cursor:text!important}
.inspection-edit-hint{margin-top:8px;padding:7px 8px;border-radius:7px;background:#f6f8fb;color:#69778b;font-size:8.5px;line-height:1.25}
.inspection-edit-panel .inspection-actions{margin-top:10px}
.inspection-edit-panel .inspection-actions .button{width:100%}
.inspection-photo-card:has(input[name="photo1_id"]:checked){border-color:#78a6ef;box-shadow:0 0 0 2px rgba(47,107,255,.08)}
.inspection-photo-card:has(input[name="photo2_id"]:checked){border-color:#6fc7a0;box-shadow:0 0 0 2px rgba(35,166,111,.08)}
@media(max-width:1100px){.inspection-editor-grid{grid-template-columns:1fr}.inspection-edit-panel{position:static}.inspection-previews{grid-template-columns:1fr 1fr}}
@media(max-width:760px){.inspection-previews{grid-template-columns:1fr}.inspection-preview-stage{min-height:0}.inspection-preview-stage>img{min-height:0}}

/* v6.63 — dedicated resize handle for inspection text blocks */
.inspection-overlay-copy{position:absolute!important}
.inspection-resize-handle{
  position:absolute;
  right:0;
  bottom:0;
  width:18px;
  height:18px;
  cursor:ew-resize;
  z-index:8;
  touch-action:none;
}
.inspection-resize-handle::before,
.inspection-resize-handle::after{
  content:"";
  position:absolute;
  right:3px;
  bottom:3px;
  width:10px;
  height:1.5px;
  background:rgba(255,255,255,.9);
  transform-origin:right center;
  transform:rotate(-45deg);
  border-radius:2px;
  box-shadow:0 1px 1px rgba(0,0,0,.35);
}
.inspection-resize-handle::after{
  right:3px;
  bottom:7px;
  width:6px;
}
.inspection-overlay-copy.is-resizing{
  outline:2px solid rgba(55,125,255,.85);
  outline-offset:1px;
  cursor:ew-resize!important;
}
.inspection-overlay-copy.is-resizing *{cursor:ew-resize!important}

/* v6.64 — preview geometry equals the actual photo; overlay width includes padding */
.inspection-overlay-copy{box-sizing:border-box!important}


/* v6.65 — montage submit progress with real upload percent */
.montage-save-overlay{position:fixed;inset:0;z-index:2500;background:rgba(18,28,43,.52);display:grid;place-items:center;padding:18px;backdrop-filter:blur(2px)}
.montage-save-overlay[hidden]{display:none!important}
.montage-save-panel{width:min(430px,100%);background:#fff;border:1px solid #dbe3ee;border-radius:16px;padding:20px;box-shadow:0 20px 60px rgba(16,24,40,.24);text-align:center}
.montage-save-icon{width:42px;height:42px;margin:0 auto 9px;border-radius:12px;display:grid;place-items:center;background:#eaf2ff;color:#1f6feb;font-size:24px;font-weight:800}
.montage-save-panel h2{margin:0 0 5px;font-size:18px}
.montage-save-panel p{margin:0 0 14px;color:#667085;font-size:12px;line-height:1.3}
.montage-save-progress{height:10px;border-radius:999px;background:#edf1f6;overflow:hidden}
.montage-save-progress i{display:block;width:0;height:100%;border-radius:inherit;background:#2d6cdf;transition:width .18s ease}
.montage-save-progress i.is-waiting{animation:montage-progress-pulse 1.15s ease-in-out infinite}
.montage-save-progress i.is-error{background:#d94b61}
.montage-save-meta{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:7px;font-size:10px;color:#667085}
.montage-save-meta b{font-size:13px;color:#1f4f91}
.montage-save-details{margin-top:12px;padding:8px 10px;border-radius:8px;background:#f6f8fb;color:#56657a;font-size:10px}
.montage-save-details .button{min-height:30px;padding:5px 10px;font-size:10px}
.montage-save-panel>small{display:block;margin-top:9px;color:#8a95a5;font-size:9px;line-height:1.3}
body.montage-saving{overflow:hidden}
@keyframes montage-progress-pulse{0%,100%{opacity:1}50%{opacity:.55}}
@media(max-width:600px){.montage-save-panel{padding:17px 15px;border-radius:14px}.montage-save-panel h2{font-size:17px}.montage-save-meta{align-items:flex-start;flex-direction:column}.montage-save-meta b{font-size:15px}}

/* v6.66 — stalled upload/server-save recovery */
.montage-save-progress i.is-warning{background:#e2a62b!important;animation:montage-progress-pulse 1.05s ease-in-out infinite}
.montage-save-panel.has-warning{border-color:#efd58d;box-shadow:0 20px 60px rgba(87,62,9,.18)}
.montage-save-actions{display:flex;justify-content:center;gap:7px;flex-wrap:wrap;margin-top:11px}
.montage-save-actions[hidden]{display:none!important}
.montage-save-actions .button{min-height:31px;padding:5px 10px;font-size:10px}
.montage-save-actions .button.primary{background:var(--accent);color:#fff;border-color:var(--accent)}
@media(max-width:600px){.montage-save-actions{display:grid;grid-template-columns:1fr;width:100%}.montage-save-actions .button{width:100%}}

/* v6.67 — local + server montage draft for Android app; photos intentionally excluded */
.montage-draft-notice{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:10px 0 12px!important;
  padding:9px 11px!important;
  border:1px solid #cfe0ff;
  background:#f3f7ff;
  color:#29476d;
}
.montage-draft-notice[hidden]{display:none!important}
.montage-draft-notice>div{min-width:0;display:flex;flex-direction:column;gap:2px}
.montage-draft-notice b{font-size:11px;line-height:1.15}
.montage-draft-notice span{font-size:9px;line-height:1.2;color:#667a96}
.montage-draft-notice .button{flex:0 0 auto;white-space:nowrap}
@media(max-width:640px){
  .montage-draft-notice{align-items:flex-start;flex-direction:column}
  .montage-draft-notice .button{width:100%}
}

/* v6.76 — clearer filters for TZ and Documents + one-line Excel buttons */
.filter-block-heading{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    margin:0 0 10px;
}
.filter-block-heading>div{display:flex;flex-direction:column;gap:2px;min-width:0}
.filter-block-heading b{font-size:13px;color:#24364f}
.filter-block-heading span{font-size:10px;line-height:1.25;color:#7b8798}
.filter-section-caption{
    display:flex;
    align-items:baseline;
    gap:8px;
    margin:0 0 6px;
    color:#344054;
}
.filter-section-caption b{font-size:11px}
.filter-section-caption span{font-size:9px;color:#8a94a3;font-weight:500}
.excel-export-button{
    display:inline-flex!important;
    align-items:center;
    justify-content:center;
    white-space:nowrap!important;
    min-width:88px!important;
    flex:0 0 auto;
}

/* TZ filter: separate state selection from text search/export. */
.tz-filter-card{padding:10px 12px 9px}
.tz-filter-section{padding:8px 9px;border:1px solid #e0e6ee;border-radius:9px;background:#fbfcfe}
.tz-filter-section+.tz-filter-section{margin-top:8px}
.tz-filter-card .dashboard-filter-pills{margin:0;gap:6px}
.tz-filter-card .ks-filter-pill{min-height:31px;padding:5px 9px}
.tz-filter-search-section{background:#fff}
.tz-filter-search{display:grid;grid-template-columns:minmax(260px,1fr) auto auto auto;max-width:none;width:100%;gap:7px;margin:0}
.tz-filter-search input{min-height:36px;font-size:13px}
.tz-filter-search button,.tz-filter-search .button{min-height:36px;padding:7px 12px}

/* Documents: quick filters stay separate; detailed status selectors are grouped by document. */
.ks-document-quick-filter{margin:0 0 8px;padding:0 2px}
.ks-document-quick-filter .ks-filter-pills{margin:0;gap:6px}
.ks-document-filter-card{padding:10px 12px}
.ks-document-filter-form{display:block;margin:0 0 8px}
.ks-document-main-filters{display:grid;grid-template-columns:minmax(170px,.9fr) minmax(190px,1fr) minmax(280px,1.7fr);gap:9px;align-items:end}
.ks-document-filter-form label{min-width:0;font-size:11px;gap:4px}
.ks-document-filter-form input,.ks-document-filter-form select{min-width:0;max-width:100%;min-height:36px;padding:7px 9px;font-size:12px}
.ks-document-stage-section{margin-top:9px;padding:9px;border:1px solid #d7e1ee;border-radius:9px;background:#f8fbff}
.ks-document-stage-heading{display:flex;align-items:baseline;gap:9px;margin:0 0 7px}
.ks-document-stage-heading b{font-size:11px;color:#2b466b}
.ks-document-stage-heading span{font-size:9px;color:#718198;font-weight:500}
.ks-document-stage-filter-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.ks-document-stage-filter{position:relative;padding:8px;border:1px solid #dce4ef;border-radius:8px;background:#fff;gap:2px}
.ks-document-stage-filter::before{content:"";position:absolute;left:-1px;top:8px;bottom:8px;width:3px;border-radius:0 3px 3px 0;background:#a9b9ce}
.ks-document-stage-filter:nth-child(1)::before{background:#6b9de8}
.ks-document-stage-filter:nth-child(2)::before{background:#8292d8}
.ks-document-stage-filter:nth-child(3)::before{background:#739eaf}
.ks-document-stage-filter-title{font-size:12px;font-weight:900;color:#24364f;padding-left:2px}
.ks-document-stage-filter small{display:block;min-height:13px;font-size:8.5px;line-height:1.2;font-weight:500;color:#8a94a3;padding-left:2px}
.ks-document-stage-filter select{margin-top:4px;background:#fff}
.ks-document-filter-actions{display:grid;grid-template-columns:minmax(140px,1.2fr) minmax(105px,.75fr) minmax(105px,.75fr);gap:8px;margin-top:9px;max-width:620px}
.ks-document-filter-actions button,.ks-document-filter-actions .button{display:inline-flex;align-items:center;justify-content:center;min-height:36px;width:100%;padding:7px 12px;text-align:center;white-space:nowrap}

@media(max-width:900px){
    .tz-filter-search{grid-template-columns:minmax(0,1fr) auto auto}
    .tz-filter-search .button:last-child{grid-column:1/-1;width:100%}
    .ks-document-main-filters{grid-template-columns:repeat(2,minmax(0,1fr))}
    .ks-document-main-filters label:last-child{grid-column:1/-1}
    .ks-document-stage-filter-grid{grid-template-columns:1fr}
}
@media(max-width:600px){
    .filter-block-heading span{font-size:9px}
    .filter-section-caption{align-items:flex-start;flex-direction:column;gap:1px}
    .tz-filter-search{grid-template-columns:1fr}
    .tz-filter-search button,.tz-filter-search .button{width:100%}
    .ks-document-main-filters{grid-template-columns:1fr}
    .ks-document-main-filters label:last-child{grid-column:auto}
    .ks-document-stage-heading{align-items:flex-start;flex-direction:column;gap:2px}
    .ks-document-filter-actions{grid-template-columns:1fr;max-width:none}
}

/* v6.77 — compact, flat filter toolbars for TZ and Documents */
.compact-filter-heading{margin-bottom:7px}
.compact-filter-heading b{font-size:12px}
.compact-filter-heading span{font-size:9px;color:#8a94a3}
.ks-filter-result{margin-top:6px;color:#667085;font-size:10px;line-height:1.2}

/* TZ: no nested cards, two slim toolbar rows. */
.tz-filter-card{padding:9px 12px 8px}
.tz-filter-card .filter-block-heading{margin-bottom:6px}
.tz-filter-row{
    display:grid;
    grid-template-columns:112px minmax(0,1fr);
    gap:9px;
    align-items:center;
    padding:6px 0;
}
.tz-filter-row+.tz-filter-row{border-top:1px solid #edf1f5}
.tz-filter-card .filter-section-caption{
    margin:0;
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:0;
    line-height:1.15;
}
.tz-filter-card .filter-section-caption b{font-size:10px;color:#344054}
.tz-filter-card .filter-section-caption span{font-size:8px;color:#98a2b3}
.tz-filter-card .dashboard-filter-pills{margin:0;gap:5px;min-width:0}
.tz-filter-card .ks-filter-pill{min-height:29px;padding:4px 8px}
.tz-filter-search-section{background:transparent}
.tz-filter-search{display:grid;grid-template-columns:minmax(240px,1fr) auto auto auto;max-width:none;width:100%;gap:6px;margin:0}
.tz-filter-search input{min-height:32px;font-size:12px;padding:6px 9px}
.tz-filter-search button,.tz-filter-search .button{min-height:32px;padding:5px 11px;font-size:11px}

/* v6.78 — Documents: quick pills stay above; exact filters fit in one compact desktop row. */
.ks-document-filter-card{padding:8px 12px 7px}
.ks-document-filter-form{
    display:grid;
    grid-template-columns:minmax(250px,1.6fr) minmax(190px,1fr) minmax(180px,.95fr) minmax(190px,1fr) auto;
    gap:7px;
    align-items:center;
    margin:0;
}
.ks-document-filter-form label{min-width:0;margin:0}
.ks-document-filter-form input,.ks-document-filter-form select{min-width:0;max-width:100%;min-height:32px;padding:6px 8px;font-size:11px}
.ks-document-search-field{display:grid!important;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:6px!important}
.ks-document-search-field>span{font-size:9.5px;font-weight:800;color:#344054;white-space:nowrap}
.ks-document-stage-filter{
    display:grid!important;
    grid-template-columns:auto minmax(0,1fr);
    align-items:center;
    gap:6px!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
}
.ks-document-stage-filter-title{
    display:inline-flex;align-items:center;justify-content:center;
    min-height:24px;padding:3px 7px;border:1px solid #d9e2ec;border-radius:6px;
    background:#f7f9fc;color:#344054;font-size:9.5px;font-weight:800;white-space:nowrap;
}
.ks-document-filter-actions{display:flex;align-items:center;gap:6px;margin:0;white-space:nowrap}
.ks-document-filter-actions button,.ks-document-filter-actions .button{
    min-height:32px;width:auto;min-width:76px;padding:5px 10px;font-size:10.5px;white-space:nowrap
}
.ks-document-filter-actions button.primary{min-width:90px}
.excel-export-button{white-space:nowrap!important}
.ks-filter-result{margin-top:5px}

@media(max-width:1220px){
    .ks-document-filter-form{grid-template-columns:minmax(220px,1.4fr) repeat(3,minmax(165px,1fr));}
    .ks-document-filter-actions{grid-column:1/-1;justify-content:flex-end}
}
@media(max-width:900px){
    .ks-document-filter-form{grid-template-columns:1fr 1fr}
    .ks-document-search-field{grid-column:1/-1}
    .ks-document-filter-actions{grid-column:1/-1;justify-content:flex-start}
}
@media(max-width:680px){
    .ks-document-filter-form{grid-template-columns:1fr}
    .ks-document-search-field,.ks-document-filter-actions{grid-column:auto}
    .ks-document-stage-filter{grid-template-columns:92px minmax(0,1fr)}
    .ks-document-filter-actions{display:grid;grid-template-columns:1fr 1fr 1fr;width:100%}
    .ks-document-filter-actions button,.ks-document-filter-actions .button{width:100%;min-width:0}
}
\n\n/* v6.79 — Documents: unified single-line controls, labels live inside selects. */\n.ks-document-filter-form{\n    display:grid;\n    grid-template-columns:minmax(300px,1.55fr) minmax(210px,1fr) minmax(180px,.9fr) minmax(200px,1fr) auto;\n    gap:7px;\n    align-items:stretch;\n    margin:0;\n}\n.ks-document-filter-control,\n.ks-document-filter-form .ks-document-filter-actions button,\n.ks-document-filter-form .ks-document-filter-actions .button{\n    box-sizing:border-box;\n    height:34px!important;\n    min-height:34px!important;\n    margin:0!important;\n    line-height:1.2;\n}\n.ks-document-filter-control{\n    width:100%;\n    min-width:0;\n    padding:6px 9px!important;\n    font-size:11px!important;\n    font-weight:600;\n}\n.ks-document-filter-search{font-weight:500}\n.ks-document-filter-actions{\n    display:grid;\n    grid-template-columns:94px 82px 82px;\n    align-items:stretch;\n    gap:6px;\n    margin:0!important;\n}\n.ks-document-filter-actions button,\n.ks-document-filter-actions .button{\n    display:flex;\n    align-items:center;\n    justify-content:center;\n    width:100%!important;\n    min-width:0!important;\n    padding:6px 9px!important;\n    font-size:10.5px!important;\n    white-space:nowrap;\n}\n@media(max-width:1280px){\n    .ks-document-filter-form{grid-template-columns:minmax(260px,1.4fr) repeat(3,minmax(170px,1fr));}\n    .ks-document-filter-actions{grid-column:1/-1;justify-self:end;}\n}\n@media(max-width:900px){\n    .ks-document-filter-form{grid-template-columns:1fr 1fr;}\n    .ks-document-filter-search{grid-column:1/-1;}\n    .ks-document-filter-actions{grid-column:1/-1;justify-self:start;}\n}\n@media(max-width:680px){\n    .ks-document-filter-form{grid-template-columns:1fr;}\n    .ks-document-filter-search,.ks-document-filter-actions{grid-column:auto;}\n    .ks-document-filter-actions{width:100%;grid-template-columns:1fr 1fr 1fr;justify-self:stretch;}\n}\n
/* v6.80 — quick filters: lighter labels in TZ and Documents. */
.ks-filter-pill{
    font-weight:400;
}
.ks-filter-pill span{
    font-weight:400;
}
.ks-filter-pill b{
    font-weight:600;
}

/* v6.81 — TZ reset button: center label horizontally and vertically. */
.tz-filter-search > a.button{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
    line-height:1!important;
}


/* v6.82 — narrower filter/search controls in TZ and Documents on wide screens. */
.tz-filter-search{
    grid-template-columns:minmax(260px,560px) auto auto auto;
    justify-content:start;
    width:auto;
}
.ks-document-filter-form{
    grid-template-columns:minmax(220px,360px) minmax(150px,220px) minmax(150px,220px) minmax(150px,220px) auto;
    justify-content:start;
    width:auto;
}
@media(max-width:1280px){
    .ks-document-filter-form{grid-template-columns:minmax(240px,1.2fr) repeat(3,minmax(160px,1fr));width:100%;}
}
@media(max-width:900px){
    .tz-filter-search{grid-template-columns:minmax(0,1fr) auto auto; width:100%;}
    .ks-document-filter-form{width:100%;}
}
@media(max-width:600px){
    .tz-filter-search{grid-template-columns:1fr; width:100%;}
}


/* v6.84 — TZ filter fits in one desktop row: quick states + search/actions. */
.tz-filter-inline-row{
    display:flex;
    align-items:center;
    gap:10px;
    padding:6px 0;
}
.tz-filter-inline-row .dashboard-filter-pills{
    margin:0;
    flex:0 1 auto;
    min-width:0;
}
.tz-filter-search-inline{
    flex:0 1 auto;
    grid-template-columns:minmax(220px,480px) auto auto auto;
    justify-content:start;
    width:auto;
    margin-left:0;
}
@media(max-width:1180px){
    .tz-filter-inline-row{flex-direction:column;align-items:stretch;gap:8px;}
    .tz-filter-search-inline{width:100%;margin-left:0;grid-template-columns:minmax(0,1fr) auto auto auto;}
}
@media(max-width:600px){
    .tz-filter-search-inline{grid-template-columns:1fr;width:100%;}
}

/* v6.83 — polished Excel export button used in TZ and Documents. */
.excel-export-button{
    gap:6px;
    border-color:#b9d9c5!important;
    background:#f7fbf8!important;
    color:#236b45!important;
    font-weight:600!important;
    box-shadow:0 1px 2px rgba(35,107,69,.06);
}
.excel-export-button:hover{
    border-color:#91c5a5!important;
    background:#edf8f1!important;
    color:#185936!important;
}
.excel-export-button:focus-visible{
    outline:2px solid rgba(42,132,82,.22);
    outline-offset:2px;
}
.excel-export-icon{
    width:15px;
    height:15px;
    flex:0 0 15px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.45;
    stroke-linecap:round;
    stroke-linejoin:round;
}
.excel-export-button>span{line-height:1}

/* v6.86 — keep original status indicators; align date controls visually with responsible select. */
.doc-stage-field .doc-inline-field-select,
.doc-stage-field .doc-date-value{
    box-sizing:border-box!important;
    height:26px!important;
    min-height:26px!important;
    font-size:9.5px!important;
    line-height:24px!important;
}
.doc-stage-field .doc-date-value{
    align-items:center!important;
    padding-top:0!important;
    padding-bottom:0!important;
}
.doc-stage-field.doc-inline-dates{
    align-items:center!important;
}
@media(max-width:1100px){
    .doc-stage-field .doc-inline-field-select,
    .doc-stage-field .doc-date-value{
        height:26px!important;
        min-height:26px!important;
        line-height:24px!important;
    }
}

/* v6.89 — restore original status width; align only date text with responsible text. */
.doc-stage-block .doc-inline-status-select{
    margin-left:0!important;
    width:142px!important;
    min-width:142px!important;
    max-width:142px!important;
}
.doc-stage-field .doc-date-value{
    padding-left:11px!important;
}


/* v6.90 — show every non-zero execution remainder without enlarging the document card. */
.doc-flat-grid .doc-summary-execution .doc-summary-statuses{gap:4px 8px;align-content:center;}
.doc-flat-grid .doc-summary-execution .doc-summary-status{font-size:8.4px;}
.doc-flat-grid .doc-summary-execution .doc-summary-status b{font-size:9px;}


/* v6.91 — duplicate TZ during Word import may be a second meter/point. */
.import-duplicate-multipoint{
    border-color:#e8d8a3;
    background:#fffaf0;
}
.import-duplicate-multipoint b{color:#765b12}
.import-duplicate-create{white-space:nowrap}
@media(max-width:680px){
    .import-duplicate-multipoint{align-items:flex-start;flex-direction:column}
    .import-duplicate-create{white-space:normal}
}

/* v6.94 — import reconstruction checkbox: focus follows the checkbox contour only. */
.import-checkbox-control input[type="checkbox"]{
  -webkit-appearance:none;
  appearance:none;
  position:relative;
  width:15px!important;
  height:15px!important;
  min-width:15px!important;
  border:1px solid #98a2b3;
  border-radius:3px;
  background:#fff;
  box-shadow:none;
  cursor:pointer;
}
.import-checkbox-control input[type="checkbox"]:checked{
  border-color:#1f6feb;
  background:#1f6feb;
}
.import-checkbox-control input[type="checkbox"]:checked::after{
  content:"";
  position:absolute;
  left:4px;
  top:1px;
  width:4px;
  height:8px;
  border:solid #fff;
  border-width:0 2px 2px 0;
  transform:rotate(45deg);
}
.import-checkbox-control input[type="checkbox"]:focus,
.import-checkbox-control input[type="checkbox"]:focus-visible{
  outline:none;
  border-color:#1f6feb;
  box-shadow:0 0 0 2px rgba(31,111,235,.18);
}


/* v6.97 — slightly larger interactive chart legend buttons. */
.a296-legend{gap:3px!important}
.a296-legend-toggle{
    appearance:none;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:2.5px;
    height:20px;
    min-height:20px;
    padding:1.5px 5px;
    border:1px solid #e3e8ef;
    border-radius:4px;
    background:#fff;
    color:#52647b;
    font:inherit;
    font-size:7.3px;
    font-weight:600;
    line-height:1;
    white-space:nowrap;
    cursor:pointer;
    box-shadow:none;
    transition:background .12s ease,border-color .12s ease,color .12s ease,opacity .12s ease;
}
.a296-legend-toggle i{width:4.5px;height:4.5px;border-radius:50%;display:inline-block;flex:0 0 4.5px}
.a296-legend-toggle span{display:inline;color:inherit;font-size:inherit;font-weight:inherit;line-height:1}
.a296-legend-toggle:hover{background:#fafbfc;border-color:#d3dbe6}
.a296-legend-toggle:focus-visible{outline:1px solid rgba(47,107,255,.32);outline-offset:1px}
.a296-legend-toggle.is-off{background:#f7f8fa;border-color:#e9edf2;color:#a0a8b3;opacity:.62}
.a296-legend-toggle.is-off i{opacity:.28}
@media(max-width:720px){
    .a296-legend{gap:2px!important}
    .a296-legend-toggle{height:18px;min-height:18px;padding:1px 4px;font-size:7px;gap:2px}
    .a296-legend-toggle i{width:4px;height:4px;flex-basis:4px}
}


/* v6.98 — Telegram bridge status in montage inbox. */
.telegram-bridge-status-row{display:flex;align-items:center;gap:6px;margin:7px 0 0}
.telegram-bridge-status{display:inline-flex;align-items:center;min-height:22px;padding:3px 7px;border:1px solid #dce3ec;border-radius:999px;background:#f7f9fc;color:#667085;font-size:9.5px;font-weight:600}
.telegram-bridge-status.sent{border-color:#bfe5cf;background:#eef9f3;color:#19734a}
.telegram-bridge-status.error{border-color:#f0c5cc;background:#fff2f4;color:#b4233b}
.telegram-bridge-status.sending{border-color:#c9d9f5;background:#f0f5ff;color:#315f9f}
.telegram-bridge-status.pending{border-color:#e2d8b9;background:#fffaf0;color:#8b6a16}
.telegram-retry-button{min-height:22px!important;padding:2px 7px!important;font-size:9px!important}


/* v6.99 — Telegram bridge settings available from the admin UI; no VPS shell needed. */
.telegram-bridge-settings-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(280px,.75fr);gap:14px;align-items:start}
.telegram-bridge-card{padding:18px}
.telegram-bridge-card h2{margin:0 0 7px}
.telegram-bridge-wide{grid-column:1/-1}
.telegram-bridge-field{display:block;margin-top:14px;font-size:12px;color:var(--muted,#667085)}
.telegram-bridge-copy-row{display:flex;align-items:center;gap:7px;margin-top:5px}
.telegram-bridge-copy-row input{flex:1;min-width:0;height:34px;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px}
.telegram-bridge-copy-row .button{flex:0 0 auto;white-space:nowrap}
.telegram-bridge-note{margin:8px 0 0;font-size:11px}
.telegram-bridge-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:13px 0}
.telegram-bridge-stats div{border:1px solid var(--border,#dde4ee);border-radius:9px;padding:9px 11px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.telegram-bridge-stats span{font-size:11px;color:var(--muted,#667085)}
.telegram-bridge-stats strong{font-size:16px}
.telegram-bridge-steps{margin:9px 0 0;padding-left:22px}
.telegram-bridge-steps li{margin:7px 0;line-height:1.45}
@media(max-width:850px){.telegram-bridge-settings-grid{grid-template-columns:1fr}.telegram-bridge-wide{grid-column:auto}.telegram-bridge-copy-row{flex-wrap:wrap}.telegram-bridge-copy-row input{flex-basis:100%}}

/* v7.08 — Telegram action matches the document row geometry but remains visually secondary. */
.dashboard-table .doc-actions .dashboard-survey-tg-pair{
  grid-template-columns:minmax(0,1fr) 36px!important;
  gap:5px!important;
  align-items:stretch!important;
}
.dashboard-tg-mini-form{
  margin:0;padding:0;display:flex;align-items:stretch;justify-content:stretch;
  width:36px;height:32px;
}
.dashboard-tg-mini{
  box-sizing:border-box;
  width:36px!important;height:32px!important;min-width:36px!important;min-height:32px!important;
  display:inline-flex;align-items:center;justify-content:center;
  padding:0!important;border:1px solid #d9e0ea;border-radius:7px;
  background:#fbfcfe;color:#667085;
  font-size:9px;line-height:1;font-weight:650;letter-spacing:.05px;
  text-decoration:none;box-shadow:none;cursor:pointer;
}
button.dashboard-tg-mini:hover{background:#f5f7fa;border-color:#c9d2df;color:#475467}
.dashboard-tg-mini.is-waiting{color:#7a6a32;background:#fffdf6;border-color:#ece4c7;cursor:default}
.dashboard-tg-mini.is-sent{color:#4d7b66;background:#f8fcfa;border-color:#d6e8df;cursor:pointer}
button.dashboard-tg-mini.is-sent:hover{background:#f0f8f4;border-color:#bfdccd;color:#356d55}
.dashboard-tg-mini.is-error{color:#9a5560;background:#fffafb;border-color:#efd9dd}
@media(max-width:760px){
  .dashboard-table .doc-actions .dashboard-survey-tg-pair{grid-template-columns:minmax(0,1fr) 36px!important}
}

/* v7.22 — document priority toggle below the title number; inactive label is quiet. */
.ks-doc-tz-line{
  display:block;
  min-width:0;
}
.ks-doc-urgent-line{
  display:flex;
  justify-content:flex-start;
  margin-top:4px;
}
.ks-doc-urgent-toggle{
  appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:20px;
  min-height:20px;
  padding:1.5px 5px;
  border:1px solid #e6eaf0;
  border-radius:4px;
  background:#fff;
  color:#a4abb4;
  font:inherit;
  font-size:7.3px;
  font-weight:500;
  line-height:1;
  white-space:nowrap;
  cursor:pointer;
  box-shadow:none;
  transition:background .12s ease,border-color .12s ease,color .12s ease,opacity .12s ease;
}
.ks-doc-urgent-toggle span{display:inline;color:inherit;font-size:inherit;font-weight:inherit;line-height:1}
.ks-doc-urgent-toggle:hover{background:#fafbfc;border-color:#d8dee7;color:#8f98a3}
.ks-doc-urgent-toggle:focus-visible{outline:1px solid rgba(201,54,43,.22);outline-offset:1px}
.ks-doc-urgent-toggle.is-active{
  border-color:#efdede;
  background:#fff8f8;
  color:#c78585;
}
.ks-doc-urgent-toggle.is-saving{opacity:.55;cursor:wait}
.ks-doc-stage-table .ks-doc-main-row.is-urgent>td,
.ks-doc-stage-table .ks-doc-comment-row.is-urgent>td{
  background:#fff7f7!important;
}
.ks-doc-stage-table .ks-doc-main-row.is-urgent:hover>td,
.ks-doc-stage-table .ks-doc-comment-row.is-urgent:hover>td{
  background:#fff4f4!important;
}
.ks-doc-stage-table .ks-doc-main-row.is-urgent>td{
  border-top-color:#f1d9d9;
  border-bottom-color:#f5e5e5;
}
.ks-doc-stage-table .ks-doc-main-row.is-urgent>td:first-child{border-left-color:#f1d9d9}
.ks-doc-stage-table .ks-doc-main-row.is-urgent>td:last-child{border-right-color:#f1d9d9}
@media (max-width:1600px){
  .ks-doc-stage-table tbody>tr.ks-doc-comment-row.is-urgent{background:#fff7f7!important;border-color:#f1d9d9}
}



/* v7.25 — PU selector in manual setup opened from a TZ card. */
.setup-object-head{align-items:center}
.setup-head-applicant{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:760px){
  .setup-head-applicant{white-space:normal}
}

/* v7.33 — narrower buttons in the TZ list + attachment action under documents. */
.dashboard-table td.doc-actions .dashboard-attachment-pair{
  grid-template-columns:minmax(0,1fr)!important;
}
.dashboard-table td.doc-actions .dashboard-attachment-btn{
  text-align:center;
}
@media(min-width:1601px){
  .dashboard-table th:nth-child(7),
  .dashboard-table td.doc-actions{
    width:206px!important;
    min-width:206px!important;
  }
}
@media(min-width:641px) and (max-width:1600px){
  .dashboard-table tr.object-row>td.doc-actions .doc-download-pair{
    max-width:205px;
  }
  .dashboard-table tr.object-row>td.doc-actions .dashboard-attachment-pair{
    grid-column:1;
    grid-row:2;
  }
}
@media(max-width:640px){
  .dashboard-table td.doc-actions .dashboard-attachment-pair{
    width:100%;
    max-width:none;
  }
}

/* v7.34 — attachment button occupies exactly the same left column
   as ADPU, completion letter and survey; the PDF/TG column stays empty. */
.dashboard-table td.doc-actions .dashboard-attachment-pair{
  grid-template-columns:minmax(0,1fr) 36px!important;
  gap:5px!important;
}


/* v7.35 — Word TZ import: normal reconstruction checkbox and optional fields. */
.tz-preview-form .import-reconstruction-field{
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  min-width:0;
}
.tz-preview-form .import-reconstruction-field > span:first-child{
  font-size:inherit;
  font-weight:700;
  color:inherit;
  line-height:1.35;
}
.tz-preview-form .import-reconstruction-field .import-checkbox-control{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:9px!important;
  width:100%!important;
  height:var(--ui-control-h, 34px)!important;
  min-height:var(--ui-control-h, 34px)!important;
  margin-top:4px!important;
  padding:0 8px!important;
  border:1px solid #cbd5e1!important;
  border-radius:6px!important;
  background:#fff!important;
  box-sizing:border-box;
  cursor:pointer;
}
.tz-preview-form .import-reconstruction-field input[type="checkbox"]{
  -webkit-appearance:auto!important;
  appearance:auto!important;
  flex:0 0 18px!important;
  display:block!important;
  width:18px!important;
  min-width:18px!important;
  max-width:18px!important;
  height:18px!important;
  min-height:18px!important;
  max-height:18px!important;
  padding:0!important;
  margin:0!important;
  border:initial!important;
  border-radius:initial!important;
  box-shadow:none!important;
  accent-color:#1f6feb;
  cursor:pointer;
}
.tz-preview-form .import-reconstruction-field input[type="checkbox"]::after{
  content:none!important;
}
.tz-preview-form .import-reconstruction-field input[type="checkbox"]:focus-visible{
  outline:2px solid #1f6feb!important;
  outline-offset:2px;
}
.tz-preview-form .import-reconstruction-field .import-checkbox-control b{
  font-size:12px;
  font-weight:500;
}
.tz-preview-form .import-field select:has(option[value=""]:checked){
  color:#8994a6;
  font-weight:500;
}


/* v7.36 — imported TZ: clear square checkbox, meter dropdown and normal-weight cell values. */
.tz-preview-form .import-field input:not([type="checkbox"]),
.tz-preview-form .import-field textarea,
.tz-preview-form .import-field select,
.tz-preview-form .import-field select option,
.tz-preview-form .import-title-field input[readonly]{
  font-weight:400!important;
}
.tz-preview-form .import-field input::placeholder,
.tz-preview-form .import-field textarea::placeholder{font-weight:400!important}
.tz-preview-form .import-reconstruction-field .import-checkbox-control{
  display:flex!important;
  flex-direction:row!important;
  justify-content:flex-start!important;
  align-items:center!important;
  gap:9px!important;
  font-weight:400!important;
}
.tz-preview-form .import-reconstruction-field .import-checkbox-control span{
  font-weight:400!important;
  font-size:12px;
}
.tz-preview-form .import-reconstruction-field input[type="checkbox"]{
  -webkit-appearance:none!important;
  appearance:none!important;
  display:inline-block!important;
  position:relative!important;
  flex:0 0 17px!important;
  width:17px!important;
  min-width:17px!important;
  max-width:17px!important;
  height:17px!important;
  min-height:17px!important;
  max-height:17px!important;
  margin:0!important;
  padding:0!important;
  background:#fff!important;
  border:1.5px solid #7d8a9c!important;
  border-radius:3px!important;
  box-shadow:none!important;
  box-sizing:border-box!important;
  vertical-align:middle;
  cursor:pointer;
}
.tz-preview-form .import-reconstruction-field input[type="checkbox"]:checked{
  background:#1f6feb!important;
  border-color:#1f6feb!important;
}
.tz-preview-form .import-reconstruction-field input[type="checkbox"]:checked::after{
  content:""!important;
  position:absolute;
  left:4px;
  top:1px;
  width:5px;
  height:9px;
  border:solid #fff;
  border-width:0 2px 2px 0;
  transform:rotate(45deg);
}
.tz-preview-form .import-reconstruction-field input[type="checkbox"]:focus-visible{
  outline:2px solid #1f6feb!important;
  outline-offset:2px;
}
.tz-preview-form .import-field.missing-field select{
  border-color:#d9a428;
  background:#fffdf5;
}
.tz-preview-form .import-meter-fullname{
  display:block;
  margin-top:4px;
  font-size:11px;
  line-height:1.4;
  font-weight:400!important;
  color:#667085;
  overflow-wrap:anywhere;
}
.tz-preview-form .import-meter-fullname[hidden]{display:none!important}

/* v7.43: центрирование подписи и значка в кнопках верхних Excel-блоков ТЗ. */
.backup-source-card .source-actions .excel-strip-action{
  display:inline-flex !important;
  flex-direction:row !important;
  align-items:center !important;
  justify-content:center !important;
  vertical-align:middle !important;
  text-align:center !important;
  column-gap:5px !important;
  box-sizing:border-box !important;
  line-height:1 !important;
  min-height:30px !important;
  height:30px !important;
  padding:0 10px !important;
}
.backup-source-card .source-actions .excel-strip-action>span{
  display:block;
  line-height:1.15 !important;
  white-space:nowrap;
  text-align:center !important;
  flex:0 0 auto;
}
.backup-source-card .source-actions .excel-strip-action>.excel-strip-icon{
  display:block;
  width:13px;
  height:13px;
  flex:0 0 13px;
  color:#2766b1;
}


/* v7.44: compact date range below the "Построенные" quick filter. */
.tz-built-period{display:flex;align-items:end;gap:7px;flex-wrap:wrap;margin:5px 0 3px}
.tz-built-period label{display:flex;flex-direction:column;gap:2px;font-size:9px;font-weight:500;color:#607089;margin:0}
.tz-built-period label input{width:148px;min-height:30px;height:30px;font-size:11px;padding:3px 7px;border-radius:6px}
.tz-built-period .button{display:inline-flex;align-items:center;justify-content:center;text-align:center;min-height:30px;height:30px;margin:0;padding:4px 9px;font-size:10.5px;border-radius:6px}
.tz-built-help{font-size:9.5px;line-height:1.3;margin:3px 0 4px}
@media(max-width:520px){.tz-built-period label{flex:1 1 130px}.tz-built-period label input{width:100%}}


/* v7.45 — one-line desktop TZ filters, compact inline period, no giant row gap. */
@media(min-width:1061px){
  .tz-filter-card .tz-filter-inline-row{
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:nowrap !important;
    align-items:center !important;
    gap:7px !important;
    padding:2px 0 !important;
    min-width:0;
  }
  .tz-filter-card .tz-filter-search-inline{
    display:grid;
    flex:0 1 44% !important;
    width:44% !important;
    min-width:0 !important;
    grid-template-columns:minmax(125px,1fr) auto auto auto;
    gap:5px;
  }
  .tz-filter-card .dashboard-filter-pills{
    display:flex !important;
    flex:1 1 0 !important;
    flex-wrap:nowrap !important;
    min-width:0;
    gap:3px !important;
    margin:0 !important;
    overflow-x:auto;
    scrollbar-width:thin;
  }
  .tz-filter-card .dashboard-filter-pills .ks-filter-pill{
    flex:0 0 auto;
    padding:4px 5px !important;
    font-size:9.5px !important;
    gap:4px !important;
    white-space:nowrap;
  }
}
.tz-filter-card .tz-built-period{
  display:flex;
  align-items:center !important;
  flex-wrap:wrap;
  column-gap:8px;
  row-gap:4px;
  margin:2px 0 2px !important;
  padding:0 !important;
}
.tz-filter-card .tz-built-period label{
  display:inline-flex !important;
  flex-direction:row !important;
  align-items:center !important;
  justify-content:flex-start;
  gap:5px !important;
  margin:0 !important;
  min-height:30px;
  width:auto !important;
  flex:0 0 auto;
  font-size:10px;
}
.tz-filter-card .tz-built-period label>span{
  display:inline-block;
  min-width:15px;
  font-size:10px;
}
.tz-filter-card .tz-built-period input[type=date]{
  width:144px !important;
  min-width:0;
  margin:0 !important;
  height:30px;
  flex:none;
}
.tz-filter-card .tz-built-period .button{margin:0 !important}
.tz-filter-card .tz-built-help{margin:2px 0 !important}
.tz-filter-card .ks-filter-result{margin-top:3px !important}
@media(max-width:1060px){
  .tz-filter-card .tz-filter-inline-row{padding:2px 0 !important;gap:5px !important}
  .tz-filter-card .dashboard-filter-pills{flex-wrap:nowrap !important;overflow-x:auto;gap:4px !important;scrollbar-width:thin}
  .tz-filter-card .dashboard-filter-pills .ks-filter-pill{flex:0 0 auto;white-space:nowrap}
}
@media(max-width:520px){
  .tz-filter-card .tz-built-period label{flex:1 1 145px;min-width:0}
  .tz-filter-card .tz-built-period input[type=date]{width:100% !important;flex:1 1 0}
}

/* v7.58 — a small, unobtrusive, row-specific deletion action. */
.object-delete-row-form{margin-top:7px;display:inline-flex}
.object-delete-row-btn{border:1px solid #ead7d7;background:transparent;color:#9b5252;border-radius:6px;padding:5px 9px;font:inherit;font-size:11px;cursor:pointer}
.object-delete-row-btn:hover{background:#fff1f1;color:#a52424;border-color:#e3a8a8}
