:root{--bg:#f4f6f8;--card:#fff;--text:#172033;--muted:#607086;--line:#d7dde6;--accent:#fca5a5;--accent2:#991b1b;--danger:#b42318;--ok:#15803d}
*{box-sizing:border-box}body{margin:0;font-family:Arial,"DejaVu Sans",sans-serif;background:var(--bg);color:var(--text);font-size:15px}.wrap{max-width:1180px;margin:28px auto;padding:0 18px}.top{display:flex;justify-content:space-between;gap:16px;align-items:center;margin-bottom:18px}.brand{display:flex;align-items:center;gap:12px}.brand img{height:54px;max-width:220px;object-fit:contain}.card{background:var(--card);border:1px solid var(--line);border-radius:14px;box-shadow:0 8px 25px rgba(17,24,39,.06);padding:22px;margin-bottom:18px}.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:0;border-radius:10px;padding:10px 14px;background:var(--accent);color:#7f1d1d;text-decoration:none;font-weight:700;cursor:pointer;white-space:nowrap}.btn.secondary{background:#334155}.btn.light{background:#e2e8f0;color:#0f172a}.btn.danger{background:var(--danger)}.btn.small{padding:7px 10px;font-size:13px}h1{margin:0;font-size:25px}h2{margin:0 0 14px;font-size:19px}.muted{color:var(--muted)}.small-text{font-size:13px;margin-top:8px}table{width:100%;border-collapse:collapse}th,td{border:1px solid var(--line);padding:9px;vertical-align:top}th{background:#eef6f5;text-align:left}.actions{display:flex;gap:8px;flex-wrap:wrap}.compact-actions{min-width:260px}.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.grid .wide{grid-column:span 2}.grid .full{grid-column:1/-1}label{display:block;font-weight:700;margin-bottom:5px}input,textarea,select{width:100%;border:1px solid #cbd5e1;border-radius:9px;padding:10px;background:#fff;font:inherit}textarea{min-height:82px;resize:vertical}.item-table input{border:0;border-radius:0;padding:8px}.item-table td{padding:0}.right{text-align:right}.center{text-align:center}.nowrap{white-space:nowrap}.totalbox{max-width:520px;margin-left:auto}.totalbox td:first-child{font-weight:700}.searchbar{display:grid;grid-template-columns:1fr auto auto;gap:10px;align-items:center}.list-table th,.list-table td{font-size:13px}.alert{padding:12px 14px;border-radius:10px;margin-bottom:16px;font-weight:700}.alert.ok{background:#dcfce7;color:#14532d;border:1px solid #86efac}.alert.error{background:#fee2e2;color:#7f1d1d;border:1px solid #fecaca}.header-preview{border:1px dashed #94a3b8;border-radius:12px;padding:12px;background:#fff}.header-preview img{display:block;max-width:100%;max-height:220px;margin:auto;object-fit:contain}.settings-form{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:center}

.print-page{background:#fff;width:210mm;min-height:297mm;margin:20px auto;padding:10mm 11mm;border:1px solid #d7dde6}.document-header{width:100%;margin:0 0 7mm 0}.document-header img{display:block;width:100%;height:26mm;object-fit:cover;object-position:center}.offer-title-row{display:grid;grid-template-columns:1fr 58mm;gap:8mm;align-items:start;margin-bottom:4mm}.offer-title{font-size:21px;font-weight:800;letter-spacing:.25px;margin:0 0 2.5mm}.subject{font-size:14px;margin-bottom:2mm}.validity{font-size:12px}.meta-table td,.compact-client td,.totals-compact td{font-size:11.5px;padding:4px 6px}.meta-table td:first-child{width:25mm;background:#f8fafc}.client-table{margin-bottom:5mm}.compact-client td{width:50%}.offer-table th{background:#e9f1f0}.offer-table td,.offer-table th{font-size:11.2px;padding:4.5px 5px}.w-no{width:8mm}.desc{width:auto}.price-col{width:29mm}.qty-col{width:16mm}.unit-col{width:17mm}.sum-col{width:31mm}.section-row td{background:#f2f5f7;font-weight:800;text-align:center}.totals-compact{margin-top:4mm}.totals-compact td{width:25%;background:#f8fafc}.totals-compact .grand{font-size:12.5px;background:#eef6f5}.signature{margin-top:8mm;display:flex;justify-content:flex-end}.signature div{min-width:60mm;text-align:center;font-size:12px}.note{margin-top:5mm;border-top:1px solid #cbd5e1;padding-top:3mm;font-size:11.3px;line-height:1.35}.screen-only{display:block}.print-only{display:none}
@media(max-width:850px){.grid{grid-template-columns:1fr}.grid .wide{grid-column:auto}.top{display:block}.actions{margin-top:12px}.searchbar,.settings-form{grid-template-columns:1fr}.print-page{width:auto;min-height:auto}.offer-title-row{grid-template-columns:1fr}.document-header img{height:auto}.compact-client td{display:block;width:100%}}
@media print{body{background:#fff}.screen-only{display:none!important}.print-only{display:block}.print-page{border:0;margin:0;padding:0;width:auto;min-height:auto;max-width:none;box-shadow:none}.document-header img{height:25mm}.offer-title{font-size:20px}.subject{font-size:13px}.offer-table td,.offer-table th{font-size:10.6px;padding:3.8px 4.5px}.meta-table td,.compact-client td,.totals-compact td{font-size:10.8px;padding:3.5px 5px}.note{font-size:10.7px}.signature{margin-top:6mm}@page{size:A4;margin:9mm}}

/* v3 corrections */
.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px}.login-card{width:100%;max-width:430px}.login-brand{margin-bottom:18px}.full-btn{width:100%;margin-top:14px}.user-badge{display:inline-flex;align-items:center;background:#e2e8f0;color:#0f172a;border-radius:10px;padding:10px 12px;font-weight:700}.form-button{display:flex;align-items:end}.inline-form{display:flex;gap:8px;align-items:center}.inline-form input{max-width:170px}.offer-heading{text-align:center;margin-bottom:3mm}.offer-title-row{display:block}.meta-one-row{margin:0 0 4mm 0}.meta-one-row td{width:50%;font-size:11.5px;padding:4px 6px;background:#f8fafc}.document-header img{height:auto!important;max-height:35mm;object-fit:contain!important;object-position:center top!important}.brand img{object-fit:contain!important}
@media print{.document-header img{height:auto!important;max-height:32mm;object-fit:contain!important;object-position:center top!important}.offer-heading{text-align:center}.meta-one-row td{font-size:10.8px;padding:3.5px 5px}}

/* v4 print fixes */
.document-header{width:100%;overflow:visible;margin:0 0 6mm 0;padding:0;text-align:left}
.document-header img{display:block;width:100%!important;max-width:100%!important;height:auto!important;max-height:none!important;object-fit:fill!important;object-position:center top!important;margin:0!important}
.offer-heading{text-align:center!important}
.client-table{margin-bottom:4mm}
@media print{
  .document-header{width:100%;margin:0 0 5mm 0;padding:0;overflow:visible;text-align:left}
  .document-header img{display:block;width:100%!important;max-width:100%!important;height:auto!important;max-height:none!important;object-fit:fill!important;object-position:center top!important;margin:0!important}
  .offer-heading{text-align:center!important}
}

/* v5 item modal and long names */
.modal-item-table th:nth-child(1){width:auto}
.modal-item-table th:nth-child(2){width:150px}
.modal-item-table th:nth-child(3){width:90px}
.modal-item-table th:nth-child(4){width:90px}
.modal-item-table th:nth-child(5){width:130px}
.modal-item-table th:nth-child(6){width:150px}
.modal-item-table td{padding:8px;vertical-align:top}
.item-name-cell{min-width:320px}
.item-name-preview{white-space:normal;word-break:break-word;line-height:1.35;max-height:none}
.row-actions{white-space:nowrap;text-align:right}
.row-actions .btn{margin:0 0 4px 4px}
.modal-backdrop{display:none;position:fixed;inset:0;background:rgba(15,23,42,.55);z-index:9999;padding:24px;align-items:center;justify-content:center}
.modal-backdrop.show{display:flex}
.modal-card{background:#fff;border-radius:16px;box-shadow:0 22px 70px rgba(0,0,0,.30);width:min(900px,96vw);max-height:92vh;overflow:auto;padding:22px;border:1px solid var(--line)}
.modal-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}
.modal-head h2{margin:0}
.modal-close{border:0;background:#e2e8f0;border-radius:10px;width:40px;height:40px;font-size:28px;line-height:1;cursor:pointer;color:#0f172a}
.modal-grid{grid-template-columns:repeat(3,1fr)}
.big-textarea{min-height:150px;line-height:1.35;font-size:15px}
.modal-actions{margin-top:16px;justify-content:flex-end}
@media(max-width:850px){.modal-grid{grid-template-columns:1fr}.modal-card{padding:16px}.modal-backdrop{padding:10px}.modal-actions{justify-content:flex-start}.row-actions{white-space:normal}.modal-item-table th:nth-child(6){width:auto}}
@media print{.modal-backdrop{display:none!important}}

.template-row{display:flex;gap:8px;align-items:center}
.template-row select{flex:1}
@media(max-width:700px){.template-row{display:block}.template-row .btn{margin-top:8px;width:100%}}

/* v10 SMTP and password recovery */
.login-links{margin-top:12px;text-align:center}
.login-links a{color:var(--accent2);font-weight:700;text-decoration:none}
.user-edit-form{display:grid;gap:6px;min-width:220px}
.user-edit-form label{font-size:12px;margin:0;color:var(--muted)}
.user-edit-form input{padding:7px}
.user-edit-form .btn{margin-top:3px}
.card input[type="checkbox"]{accent-color:var(--accent)}

/* v12 buttons, favicon support and print footer */
.print-ad-footer{
    margin-top:7mm;
    border-top:1px solid #cbd5e1;
    padding-top:3mm;
    text-align:center;
    font-size:11px;
    line-height:1.35;
    color:#334155;
    font-weight:700;
}
@media print{
    .print-ad-footer{
        margin-top:6mm;
        font-size:10.5px;
        page-break-inside:avoid;
    }
}

/* v13 currency print support */
.secondary-currency{display:inline-block;margin-top:1px;color:#64748b;font-size:10px;font-weight:700;line-height:1.15}
@media print{.secondary-currency{font-size:9.5px;color:#475569}}

/* v14 unified button style - all buttons match the Exit button */
.btn,
.btn.secondary,
.btn.light,
.btn.danger,
button.btn,
a.btn,
input.btn {
    background:#e2e8f0 !important;
    color:#0f172a !important;
    border:0 !important;
}
.btn:hover,
.btn.secondary:hover,
.btn.light:hover,
.btn.danger:hover,
button.btn:hover,
a.btn:hover,
input.btn:hover {
    background:#cbd5e1 !important;
    color:#0f172a !important;
    text-decoration:none !important;
}
.btn:focus,
.btn.secondary:focus,
.btn.light:focus,
.btn.danger:focus,
button.btn:focus,
a.btn:focus,
input.btn:focus {
    outline:2px solid #94a3b8;
    outline-offset:2px;
}
.modal-close {
    background:#e2e8f0 !important;
    color:#0f172a !important;
}
.modal-close:hover {
    background:#cbd5e1 !important;
}
.filter-form{display:grid;grid-template-columns:repeat(6,1fr);gap:12px;align-items:end}.filter-form .filter-wide{grid-column:span 2}.filter-actions{display:flex;gap:8px;align-items:center}.subject-cell{min-width:220px;max-width:360px;line-height:1.25}.list-table th:nth-child(3),.list-table td:nth-child(3){width:27%}
@media(max-width:1050px){.filter-form{grid-template-columns:repeat(2,1fr)}.filter-form .filter-wide{grid-column:span 2}.subject-cell{max-width:none}}
@media(max-width:650px){.filter-form{grid-template-columns:1fr}.filter-form .filter-wide{grid-column:auto}.filter-actions{display:block}.filter-actions .btn{width:100%;margin-top:8px}}


/* v18 readable offer list and outgoing print number */
.list-table{table-layout:fixed;width:100%;}
.list-table th,.list-table td{white-space:normal!important;overflow-wrap:anywhere;word-break:break-word;line-height:1.28;vertical-align:top;padding:8px 7px;}
.list-table th:nth-child(1),.list-table td:nth-child(1){width:12%;}
.list-table th:nth-child(2),.list-table td:nth-child(2){width:9%;}
.list-table th:nth-child(3),.list-table td:nth-child(3){width:19%;}
.list-table th:nth-child(4),.list-table td:nth-child(4){width:13%;}
.list-table th:nth-child(5),.list-table td:nth-child(5){width:10%;}
.list-table th:nth-child(6),.list-table td:nth-child(6){width:15%;}
.list-table th:nth-child(7),.list-table td:nth-child(7){width:10%;}
.list-table th:nth-child(8),.list-table td:nth-child(8){width:10%;}
.list-table th:nth-child(9),.list-table td:nth-child(9){width:15%;}
.compact-actions{min-width:0!important;display:flex;flex-wrap:wrap;gap:5px;}
.compact-actions .btn{white-space:normal!important;padding:6px 8px;line-height:1.15;}
.subject-cell{min-width:0!important;max-width:none!important;}
.offer-no-cell,.date-cell,.phone-cell,.amount-cell{white-space:normal!important;}
.outgoing-number{text-align:right;font-size:11.5px;font-weight:700;margin:-2mm 0 2mm 0;}
@media(max-width:1100px){.list-table{display:block;overflow-x:auto;table-layout:auto;}.list-table th,.list-table td{min-width:110px;}.list-table th:nth-child(3),.list-table td:nth-child(3){min-width:220px;}.list-table th:nth-child(9),.list-table td:nth-child(9){min-width:180px;}}
@media print{.outgoing-number{font-size:10.8px;margin:-1mm 0 2mm 0;}}

/* v19: action buttons in offer list stay on one horizontal line */
.list-table th:last-child,
.list-table td:last-child{
    min-width: 300px;
    width: 300px;
}
.list-table td:last-child .compact-actions{
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 5px !important;
    min-width: 0 !important;
    white-space: nowrap !important;
}
.list-table td:last-child .compact-actions .btn{
    white-space: nowrap !important;
    flex: 0 0 auto !important;
    padding: 6px 7px !important;
    line-height: 1.1 !important;
    font-size: 12px !important;
}
@media(max-width:850px){
    .list-table th:last-child,
    .list-table td:last-child{
        min-width: 280px;
        width: 280px;
    }
    .list-table td:last-child .compact-actions{
        flex-wrap: nowrap !important;
    }
}


/* v20: readable wide offers table - no column squeezing */
.offers-table-wrap{
    width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    padding-bottom:8px;
}
.offers-table-wrap .list-table{
    table-layout:auto !important;
    width:max-content !important;
    min-width:1680px !important;
    border-collapse:collapse;
}
.offers-table-wrap .list-table th,
.offers-table-wrap .list-table td{
    white-space:normal !important;
    overflow-wrap:break-word !important;
    word-break:normal !important;
    line-height:1.35 !important;
    vertical-align:top !important;
}
.offers-table-wrap .list-table th:nth-child(1),
.offers-table-wrap .list-table td:nth-child(1){width:150px !important;min-width:150px !important;max-width:150px !important;}
.offers-table-wrap .list-table th:nth-child(2),
.offers-table-wrap .list-table td:nth-child(2){width:105px !important;min-width:105px !important;max-width:105px !important;}
.offers-table-wrap .list-table th:nth-child(3),
.offers-table-wrap .list-table td:nth-child(3){width:330px !important;min-width:330px !important;max-width:330px !important;}
.offers-table-wrap .list-table th:nth-child(4),
.offers-table-wrap .list-table td:nth-child(4){width:220px !important;min-width:220px !important;max-width:220px !important;}
.offers-table-wrap .list-table th:nth-child(5),
.offers-table-wrap .list-table td:nth-child(5){width:150px !important;min-width:150px !important;max-width:150px !important;}
.offers-table-wrap .list-table th:nth-child(6),
.offers-table-wrap .list-table td:nth-child(6){width:290px !important;min-width:290px !important;max-width:290px !important;}
.offers-table-wrap .list-table th:nth-child(7),
.offers-table-wrap .list-table td:nth-child(7){width:145px !important;min-width:145px !important;max-width:145px !important;}
.offers-table-wrap .list-table th:nth-child(8),
.offers-table-wrap .list-table td:nth-child(8){width:190px !important;min-width:190px !important;max-width:190px !important;}
.offers-table-wrap .list-table th:nth-child(9),
.offers-table-wrap .list-table td:nth-child(9){width:300px !important;min-width:300px !important;max-width:300px !important;}
.offers-table-wrap .compact-actions{
    display:flex !important;
    flex-wrap:nowrap !important;
    gap:5px !important;
    align-items:center !important;
    min-width:0 !important;
}
.offers-table-wrap .compact-actions .btn{
    white-space:nowrap !important;
    flex:0 0 auto !important;
    padding:6px 7px !important;
    font-size:12px !important;
    line-height:1.1 !important;
}
@media(max-width:1200px){
    .offers-table-wrap{border:1px solid var(--line);border-radius:10px;}
}

/* v21: no horizontal scroll on offers list */
.offers-table-wrap{
    width:100% !important;
    overflow-x:visible !important;
    overflow-y:visible !important;
    border:0 !important;
}
.offers-table-wrap .list-table{
    width:100% !important;
    min-width:0 !important;
    table-layout:fixed !important;
    border-collapse:collapse !important;
}
.offers-table-wrap .list-table th,
.offers-table-wrap .list-table td{
    min-width:0 !important;
    max-width:none !important;
    white-space:normal !important;
    overflow-wrap:anywhere !important;
    word-break:break-word !important;
    hyphens:auto;
    padding:7px 6px !important;
    font-size:12.5px !important;
    line-height:1.25 !important;
}
.offers-table-wrap .list-table th:nth-child(1),
.offers-table-wrap .list-table td:nth-child(1){width:10% !important;}
.offers-table-wrap .list-table th:nth-child(2),
.offers-table-wrap .list-table td:nth-child(2){width:8% !important;}
.offers-table-wrap .list-table th:nth-child(3),
.offers-table-wrap .list-table td:nth-child(3){width:18% !important;}
.offers-table-wrap .list-table th:nth-child(4),
.offers-table-wrap .list-table td:nth-child(4){width:12% !important;}
.offers-table-wrap .list-table th:nth-child(5),
.offers-table-wrap .list-table td:nth-child(5){width:9% !important;}
.offers-table-wrap .list-table th:nth-child(6),
.offers-table-wrap .list-table td:nth-child(6){width:14% !important;}
.offers-table-wrap .list-table th:nth-child(7),
.offers-table-wrap .list-table td:nth-child(7){width:9% !important;}
.offers-table-wrap .list-table th:nth-child(8),
.offers-table-wrap .list-table td:nth-child(8){width:8% !important;}
.offers-table-wrap .list-table th:nth-child(9),
.offers-table-wrap .list-table td:nth-child(9){width:12% !important;}
.offers-table-wrap .compact-actions{
    display:flex !important;
    flex-wrap:wrap !important;
    gap:4px !important;
    min-width:0 !important;
    align-items:flex-start !important;
}
.offers-table-wrap .compact-actions .btn{
    padding:5px 6px !important;
    font-size:11.5px !important;
    line-height:1.1 !important;
    white-space:normal !important;
    min-width:0 !important;
}
.offers-table-wrap .amount-cell{
    white-space:normal !important;
    text-align:right !important;
}
.offers-table-wrap .offer-no-cell,
.offers-table-wrap .date-cell,
.offers-table-wrap .phone-cell{
    overflow-wrap:anywhere !important;
}
@media(max-width:900px){
    .offers-table-wrap .list-table,
    .offers-table-wrap .list-table thead,
    .offers-table-wrap .list-table tbody,
    .offers-table-wrap .list-table th,
    .offers-table-wrap .list-table td,
    .offers-table-wrap .list-table tr{
        display:block !important;
        width:100% !important;
    }
    .offers-table-wrap .list-table thead{display:none !important;}
    .offers-table-wrap .list-table tr{
        border:1px solid var(--line);
        border-radius:12px;
        margin-bottom:12px;
        padding:8px;
        background:#fff;
    }
    .offers-table-wrap .list-table td{
        border:0 !important;
        border-bottom:1px solid #eef2f7 !important;
        padding:8px 0 !important;
    }
    .offers-table-wrap .list-table td:last-child{border-bottom:0 !important;}
    .offers-table-wrap .list-table td::before{
        display:block;
        font-weight:800;
        color:#475569;
        margin-bottom:3px;
    }
    .offers-table-wrap .list-table td:nth-child(1)::before{content:'№';}
    .offers-table-wrap .list-table td:nth-child(2)::before{content:'Дата';}
    .offers-table-wrap .list-table td:nth-child(3)::before{content:'Предмет';}
    .offers-table-wrap .list-table td:nth-child(4)::before{content:'Клиент';}
    .offers-table-wrap .list-table td:nth-child(5)::before{content:'Телефон';}
    .offers-table-wrap .list-table td:nth-child(6)::before{content:'Адрес';}
    .offers-table-wrap .list-table td:nth-child(7)::before{content:'Стойност с ДДС';}
    .offers-table-wrap .list-table td:nth-child(8)::before{content:'Създал';}
    .offers-table-wrap .list-table td:nth-child(9)::before{content:'Действия';}
    .offers-table-wrap .compact-actions .btn{font-size:12px !important;padding:7px 8px !important;}
}

/* v22: keep action buttons inside the table without horizontal scroll */
.offers-table-wrap .list-table th:nth-child(1),
.offers-table-wrap .list-table td:nth-child(1){width:9% !important;}
.offers-table-wrap .list-table th:nth-child(2),
.offers-table-wrap .list-table td:nth-child(2){width:8% !important;}
.offers-table-wrap .list-table th:nth-child(3),
.offers-table-wrap .list-table td:nth-child(3){width:17% !important;}
.offers-table-wrap .list-table th:nth-child(4),
.offers-table-wrap .list-table td:nth-child(4){width:11% !important;}
.offers-table-wrap .list-table th:nth-child(5),
.offers-table-wrap .list-table td:nth-child(5){width:8% !important;}
.offers-table-wrap .list-table th:nth-child(6),
.offers-table-wrap .list-table td:nth-child(6){width:13% !important;}
.offers-table-wrap .list-table th:nth-child(7),
.offers-table-wrap .list-table td:nth-child(7){width:8% !important;}
.offers-table-wrap .list-table th:nth-child(8),
.offers-table-wrap .list-table td:nth-child(8){width:8% !important;}
.offers-table-wrap .list-table th:nth-child(9),
.offers-table-wrap .list-table td:nth-child(9){width:18% !important;overflow:hidden !important;}
.offers-table-wrap .compact-actions{
    display:grid !important;
    grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
    gap:4px !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    white-space:normal !important;
}
.offers-table-wrap .compact-actions .btn{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    padding:5px 4px !important;
    font-size:11px !important;
    line-height:1.05 !important;
    white-space:normal !important;
    overflow-wrap:anywhere !important;
    word-break:break-word !important;
    text-align:center !important;
}
@media(max-width:900px){
    .offers-table-wrap .compact-actions{
        grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
    }
    .offers-table-wrap .compact-actions .btn{
        font-size:12px !important;
        padding:7px 8px !important;
    }
}


/* v24: filter POST forms and delete button restored inside action grid */
.inline-delete-form{margin:0!important;padding:0!important;display:contents!important;}
.inline-delete-form .btn{font-family:inherit;}


/* v25: completed offer status and delete only in edit page */
.status-badge{display:inline-flex;align-items:center;gap:4px;margin-top:5px;padding:3px 7px;border-radius:999px;font-size:11px;font-weight:800;line-height:1.1;white-space:normal;}
.status-badge.completed{background:#dcfce7;color:#166534;border:1px solid #86efac;}
.checkline{display:flex;align-items:center;gap:8px;font-weight:700;margin:0;padding:10px;border:1px solid var(--line);border-radius:10px;background:#fff;}
.checkline input{width:auto;min-width:18px;height:18px;margin:0;}
.danger-zone{border-color:#fecaca;background:#fff7f7;}
.print-status{text-align:center;font-size:12px;font-weight:800;color:#166534;border:1px solid #86efac;background:#dcfce7;border-radius:8px;padding:4px 8px;margin:0 0 2mm auto;width:max-content;max-width:100%;}
@media print{.status-badge{font-size:10px;padding:2px 5px}.print-status{font-size:10.5px;padding:3px 6px;}}


/* v26: completed status moved to separate column, not under offer number */
.status-cell{text-align:center;vertical-align:middle;}
.status-empty{color:#9ca3af;font-weight:700;}
.completed-row{background:#f8fff9;}
.offers-table-wrap .status-badge{margin-top:0;white-space:nowrap;}
@media(max-width:900px){.status-cell{text-align:left;}}


/* v28: compact completed status in offers list */
.status-cell{width:34px!important;min-width:34px!important;max-width:34px!important;text-align:center!important;vertical-align:middle!important;padding-left:4px!important;padding-right:4px!important;}
.status-dot{display:inline-block;width:11px;height:11px;border-radius:999px;vertical-align:middle;}
.status-dot.completed{background:#16a34a;box-shadow:0 0 0 2px #dcfce7;}
.status-empty{font-size:10px;color:#c4c4c4;font-weight:700;}
.offers-table-wrap .list-table th:nth-child(9){width:34px!important;min-width:34px!important;max-width:34px!important;text-align:center!important;padding-left:4px!important;padding-right:4px!important;}
.offers-table-wrap .list-table th:nth-child(10),
.offers-table-wrap .list-table td:nth-child(10){width:150px!important;min-width:150px!important;}
.actions.compact-actions{display:flex!important;flex-wrap:wrap!important;gap:4px!important;align-items:center!important;justify-content:flex-start!important;max-width:150px!important;}
.actions.compact-actions .btn.small{font-size:11px!important;padding:5px 7px!important;line-height:1.05!important;white-space:nowrap!important;}
@media(max-width:900px){.status-cell{width:auto!important;max-width:none!important;text-align:left!important}.status-dot{margin-left:4px}.actions.compact-actions{max-width:none!important}}

/* v29: в началния списък в действия остава само бутон Преглед */
.list-table th:nth-child(10),
.list-table td:nth-child(10) {
    width: 78px;
    min-width: 78px;
    max-width: 86px;
    text-align: center;
}
.single-view-action {
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0;
}
.single-view-action .btn.small {
    white-space: nowrap;
    padding-left: 8px;
    padding-right: 8px;
}

/* v30: cleaner users.php layout */
.users-page .card-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
.users-add-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;align-items:end}
.users-add-grid .users-add-button{grid-column:1/-1;display:flex;justify-content:flex-end}
.users-add-grid .users-add-button .btn{min-width:190px}
.users-list{display:grid;gap:14px}
.user-card{border:1px solid var(--line);border-radius:14px;background:#fff;padding:15px;box-shadow:0 4px 16px rgba(17,24,39,.04)}
.user-main{display:flex;gap:12px;align-items:center;padding-bottom:12px;margin-bottom:12px;border-bottom:1px solid var(--line)}
.user-avatar{width:44px;height:44px;border-radius:50%;background:var(--accent);color:#7f1d1d;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:20px;flex:0 0 44px}
.user-id-block{min-width:0}
.user-name{font-weight:800;font-size:17px;line-height:1.25;overflow-wrap:anywhere}
.user-meta,.user-email{font-size:13px;color:var(--muted);line-height:1.35;overflow-wrap:anywhere}
.user-panels{display:grid;grid-template-columns:1.25fr .8fr .8fr;gap:12px;align-items:start}
.user-panel{background:#f8fafc;border:1px solid var(--line);border-radius:12px;padding:12px;display:grid;gap:8px;min-width:0}
.user-panel label{font-size:12px;margin-bottom:-3px;color:#334155}
.user-panel input{padding:8px;border-radius:8px;min-width:0}
.user-panel .btn{width:max-content;max-width:100%;white-space:normal;text-align:center}
.panel-title{font-weight:800;color:#0f172a;margin-bottom:2px}
.user-actions-panel form{margin:0}
.user-actions-panel .btn{width:100%}
@media(max-width:1000px){.user-panels{grid-template-columns:1fr 1fr}.user-edit-panel{grid-column:1/-1}}
@media(max-width:720px){.users-add-grid{grid-template-columns:1fr}.users-add-grid .users-add-button{justify-content:stretch}.users-add-grid .users-add-button .btn{width:100%}.user-panels{grid-template-columns:1fr}.user-main{align-items:flex-start}.user-panel .btn{width:100%}}

/* v31: cleaner change_password.php layout */
.password-page .top{align-items:flex-start}
.password-layout{display:grid;grid-template-columns:330px 1fr;gap:18px;align-items:start}
.password-profile-card{padding:18px}
.password-profile-main{display:flex;gap:14px;align-items:center}
.password-avatar{width:58px;height:58px;font-size:24px;flex:0 0 58px}
.password-profile-card h2{margin:0 0 6px;font-size:20px;line-height:1.2}
.password-form-card{padding:20px}
.password-form{display:grid;gap:15px}
.password-two-cols{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.password-note{background:#f8fafc;border:1px solid var(--line);border-radius:12px;padding:11px 13px;color:var(--muted);font-size:13px;line-height:1.35}
.password-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:15px;margin-top:2px}
.password-actions .btn{min-width:145px}
.password-form input{height:43px}
@media(max-width:850px){.password-layout{grid-template-columns:1fr}.password-two-cols{grid-template-columns:1fr}.password-actions{justify-content:stretch}.password-actions .btn{width:100%}.password-profile-main{align-items:flex-start}}

/* v36: invoice-like print/client block layout */
.invoice-meta-block{
    margin:0 0 4mm 0;
}
.attention-line{
    display:block;
    width:100%;
    box-sizing:border-box;
    background:#f8fafc;
    border:1px solid #cbd5e1;
    border-bottom:0;
    padding:4px 6px;
    font-size:11.5px;
    line-height:1.25;
    overflow-wrap:anywhere;
}
.invoice-meta-block .meta-one-row{
    margin:0;
}
.invoice-meta-block .meta-one-row td{
    border:1px solid #cbd5e1;
}
.invoice-parties{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:6mm;
    align-items:start;
    margin:0 0 5mm 0;
}
.party-table{
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
    background:#fff;
}
.party-table th{
    background:#e9f1f0;
    border:1px solid #cbd5e1;
    padding:4px 6px;
    font-size:11.5px;
    text-align:left;
    text-transform:uppercase;
    letter-spacing:.2px;
}
.party-table td{
    border:1px solid #cbd5e1;
    padding:4px 6px;
    font-size:11.5px;
    line-height:1.25;
    vertical-align:top;
    overflow-wrap:anywhere;
    word-break:normal;
}
@media print{
    .attention-line{font-size:10.8px;padding:3.5px 5px;}
    .invoice-parties{gap:5mm;margin-bottom:4mm;}
    .party-table th,.party-table td{font-size:10.8px;padding:3.5px 5px;}
}
@media screen and (max-width:760px){
    .invoice-parties{grid-template-columns:1fr;gap:10px;}
}

/* v38: cleaner browser PDF export - suppress printable page margins/header space */
@media print{
    @page{size:A4;margin:0!important;}
    html,body{margin:0!important;padding:0!important;background:#fff!important;width:210mm!important;min-height:297mm!important;}
    body{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;}
    .print-page{
        width:210mm!important;
        min-height:297mm!important;
        margin:0!important;
        padding:7mm 9mm 6mm 9mm!important;
        border:0!important;
        box-shadow:none!important;
        overflow:visible!important;
    }
    .document-header{margin-top:0!important;}
}

/* v39: force client/object blocks to stay side-by-side in print/PDF */
.invoice-parties{display:none!important;}
.invoice-parties-table{
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
    margin:0 0 4mm 0;
}
.invoice-parties-table .party-cell{
    width:48%;
    vertical-align:top;
    padding:0;
}
.invoice-parties-table .party-gap-cell{
    width:4%;
    padding:0;
}
.invoice-parties-table .party-table{
    margin:0;
}
@media print{
    .invoice-parties-table{display:table!important;margin-bottom:3mm!important;}
    .invoice-parties-table .party-cell{width:48%!important;vertical-align:top!important;}
    .invoice-parties-table .party-gap-cell{width:4%!important;}
}
@media screen and (max-width:760px){
    .invoice-parties-table,.invoice-parties-table tbody,.invoice-parties-table tr,.invoice-parties-table td{display:block;width:100%!important;}
    .invoice-parties-table .party-gap-cell{height:10px;}
}

/* v40: keep client/object table side-by-side in browser print/PDF */
@media print{
    .invoice-parties-table{
        display:table!important;
        width:100%!important;
        table-layout:fixed!important;
        border-collapse:collapse!important;
    }
    .invoice-parties-table tbody{display:table-row-group!important;}
    .invoice-parties-table tr{display:table-row!important;}
    .invoice-parties-table td{display:table-cell!important;}
    .invoice-parties-table .party-cell{width:48%!important;vertical-align:top!important;padding:0!important;}
    .invoice-parties-table .party-gap-cell{width:4%!important;height:auto!important;padding:0!important;}
}

/* v41: print_offer buttons side by side */
.print-page-actions{
    display:flex!important;
    flex-direction:row!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    justify-content:flex-end!important;
    gap:8px!important;
    white-space:nowrap!important;
}
.print-page-actions .btn{
    display:inline-flex!important;
    width:auto!important;
    min-width:110px!important;
    white-space:nowrap!important;
    flex:0 0 auto!important;
}
@media(max-width:850px){
    .top .print-page-actions{
        display:flex!important;
        flex-direction:row!important;
        flex-wrap:nowrap!important;
        justify-content:flex-start!important;
    }
    .top .print-page-actions .btn{width:auto!important;}
}

/* v47: броячи на началната страница */
.offer-stats{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
    margin-top:14px;
}
.stat-box{
    border:1px solid #f3c5c5;
    background:#fff7f7;
    border-radius:12px;
    padding:10px 12px;
    min-height:58px;
}
.stat-box span{
    display:block;
    font-size:12px;
    color:#7f1d1d;
    margin-bottom:4px;
}
.stat-box strong{
    display:block;
    font-size:22px;
    line-height:1.1;
    color:#450a0a;
}
@media (max-width: 700px){
    .offer-stats{grid-template-columns:1fr;}
}

/* v48: странициране на началния списък с оферти */
.pagination-bar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    margin-top:14px;
    padding-top:12px;
    border-top:1px solid var(--line);
    flex-wrap:wrap;
}
.pagination-info{
    color:var(--muted);
    font-size:13px;
    font-weight:700;
}
.pagination-actions{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:6px;
    flex-wrap:wrap;
}
.pagination-actions form{
    margin:0;
    display:inline-flex;
    align-items:center;
    gap:6px;
}
.pagination-actions .btn[disabled]{
    opacity:.45;
    cursor:not-allowed;
}
.page-jump-form{
    background:#fff7f7;
    border:1px solid #f3c5c5;
    border-radius:10px;
    padding:5px 6px;
}
.page-jump-form label{
    margin:0;
    font-size:12px;
    color:#7f1d1d;
}
.page-jump-form input{
    width:64px;
    padding:6px 8px;
    border-radius:8px;
    text-align:center;
}
@media(max-width:760px){
    .pagination-bar{align-items:stretch;}
    .pagination-actions{justify-content:flex-start;}
    .pagination-actions .btn.small{padding:7px 8px;}
}

/* v51: центриране само на заглавията на таблицата със запазени оферти */
.list-table thead th{
    text-align:center !important;
    vertical-align:middle !important;
}

/* v53: footer на началната страница */
.system-footer{
    margin:24px auto 8px;
    padding:0;
    border:0;
    background:transparent;
    text-align:center;
}
.system-footer-inner{
    max-width:980px;
    margin:0 auto;
    padding:20px 24px 18px;
    border:1px solid #f1c7c7;
    border-radius:20px;
    background:linear-gradient(180deg,#fffafa 0%,#fff3f3 100%);
    color:#7f1d1d;
    box-shadow:0 10px 28px rgba(127,29,29,.07);
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
}
.system-footer-badge{
    width:42px;
    height:42px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    margin:0 auto 9px;
    background:#fde2e2;
    border:1px solid #efb4b4;
    color:#7f1d1d;
    font-size:12px;
    font-weight:900;
    letter-spacing:.6px;
}
.system-footer-title{
    width:100%;
    text-align:center;
    color:#450a0a;
    font-size:17px;
    font-weight:900;
    line-height:1.25;
}
.system-footer-line{
    width:72px;
    height:2px;
    border-radius:99px;
    background:#e9a9a9;
    margin:9px auto 8px;
}
.system-footer-name{
    width:100%;
    text-align:center;
    color:#991b1b;
    font-size:14px;
    font-weight:900;
    letter-spacing:.2px;
    line-height:1.3;
}
.system-footer-sub{
    width:100%;
    max-width:760px;
    margin:9px auto 0;
    text-align:center;
    font-size:13px;
    line-height:1.5;
    color:#7f1d1d;
}
.system-footer-meta{
    width:100%;
    margin-top:10px;
    padding-top:10px;
    border-top:1px solid #f3c5c5;
    text-align:center;
    font-size:12px;
    line-height:1.35;
    color:#9f6b6b;
}
@media(max-width:700px){
    .system-footer{ margin-top:16px; }
    .system-footer-inner{ padding:17px 14px 15px; border-radius:16px; }
    .system-footer-title{ font-size:16px; }
    .system-footer-sub{ font-size:12px; }
}
@media print{
    .system-footer{ display:none !important; }
}

/* v54: общ footer във всички страници, със същата ширина като основните карти */
.system-footer{
    width:100%;
    max-width:1180px;
    margin:24px auto 8px;
    padding:0;
    border:0;
    background:transparent;
    text-align:center;
}
.wrap > .system-footer{
    max-width:none;
    margin:24px 0 8px;
}
.system-footer-inner{
    width:100%;
    max-width:none;
    margin:0;
    padding:20px 24px 18px;
}
.login-wrap{
    flex-direction:column;
    gap:18px;
}
.login-wrap .system-footer{
    width:min(1180px, calc(100vw - 36px));
    margin:0 auto;
}
@media print{
    .system-footer{display:none!important;}
}

/* v57: footer under offer on view/print pages */
.footer-after-offer{
    margin-top:0 !important;
    padding-top:0 !important;
}
.footer-after-offer .system-footer{
    margin-top:10px !important;
}
@media print{
    .footer-after-offer{display:none!important;}
}


/* v37 product catalog picker */
.product-search-row{display:flex;gap:8px;align-items:center}
.product-search-row input{flex:1}
.product-suggestions{margin-top:8px;max-height:230px;overflow:auto;border:1px solid var(--line);border-radius:12px;background:#fff}
.product-suggestions:empty{display:none}
.product-suggestion{width:100%;display:flex;justify-content:space-between;gap:12px;align-items:flex-start;text-align:left;border:0;border-bottom:1px solid var(--line);background:#fff;padding:10px 12px;cursor:pointer;color:#0f172a}
.product-suggestion:last-child{border-bottom:0}
.product-suggestion:hover{background:#f8fafc}
.product-suggestion span{display:block;line-height:1.25}
.product-suggestion em{font-style:normal;color:#64748b;font-weight:700}
.product-suggestion small{display:block;color:#64748b;margin-top:3px}
.product-suggestion strong{white-space:nowrap;color:#0f172a}
.product-empty{padding:10px 12px;color:#64748b;font-size:13px}
.products-toolbar{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:12px}
.products-toolbar input{max-width:360px}
.products-table td,.products-table th{vertical-align:top}
.product-code-cell{white-space:nowrap;color:#475569;font-weight:700}
@media(max-width:760px){.product-search-row{display:block}.product-search-row .btn{margin-top:8px;width:100%}.product-suggestion{display:block}.product-suggestion strong{display:block;margin-top:6px}}


/* product catalog action icons */
.products-table .product-row-actions{
    justify-content:center !important;
    gap:6px !important;
    min-width:0 !important;
}
.products-table .inline-action-form{
    display:inline-flex;
    margin:0;
}
.products-table .icon-btn{
    width:34px !important;
    height:32px !important;
    min-width:34px !important;
    padding:0 !important;
    font-size:16px !important;
    line-height:1 !important;
}
.products-table th:last-child,
.products-table td:last-child{
    width:90px !important;
    min-width:90px !important;
    max-width:90px !important;
}

/* v39 smaller product action icons + global active field highlight */
.products-table .icon-btn{
    width:26px !important;
    height:24px !important;
    min-width:26px !important;
    padding:0 !important;
    font-size:12px !important;
    line-height:1 !important;
    border-radius:7px !important;
    gap:0 !important;
}
.products-table .product-row-actions{
    gap:4px !important;
}
.products-table th:last-child,
.products-table td:last-child{
    width:72px !important;
    min-width:72px !important;
    max-width:72px !important;
    text-align:center;
}

input:not([type="checkbox"]):not([type="radio"]):not(.btn):focus,
textarea:focus,
select:focus{
    background:#eaffea !important;
    border-color:#63c174 !important;
    box-shadow:0 0 0 3px rgba(34,197,94,.18) !important;
    outline:none !important;
}
.item-table input:focus,
.item-table textarea:focus,
.item-table select:focus{
    background:#eaffea !important;
    box-shadow:inset 0 0 0 2px rgba(34,197,94,.28) !important;
}


/* v40: product action icons fixed inside design + pale yellow active fields */
.products-table th:last-child,
.products-table td:last-child{
    width:58px !important;
    min-width:58px !important;
    max-width:58px !important;
    padding-left:4px !important;
    padding-right:4px !important;
    text-align:center !important;
    overflow:hidden !important;
}
.products-table .product-row-actions{
    display:inline-flex !important;
    flex-wrap:nowrap !important;
    align-items:center !important;
    justify-content:center !important;
    gap:3px !important;
    width:50px !important;
    max-width:50px !important;
    min-width:0 !important;
    margin:0 auto !important;
}
.products-table .inline-action-form{
    display:inline-flex !important;
    width:22px !important;
    height:22px !important;
    margin:0 !important;
    padding:0 !important;
}
.products-table .icon-btn,
.products-table a.icon-btn,
.products-table button.icon-btn{
    width:22px !important;
    height:22px !important;
    min-width:22px !important;
    max-width:22px !important;
    padding:0 !important;
    margin:0 !important;
    border-radius:6px !important;
    font-size:12px !important;
    line-height:1 !important;
    gap:0 !important;
    overflow:hidden !important;
    flex:0 0 22px !important;
}
.products-table .icon-btn span{
    display:block !important;
    width:22px !important;
    height:22px !important;
    line-height:22px !important;
    text-align:center !important;
    font-size:12px !important;
}

input:not([type="checkbox"]):not([type="radio"]):not(.btn):focus,
textarea:focus,
select:focus{
    background:#fff9d6 !important;
    border-color:#e6c84f !important;
    box-shadow:0 0 0 3px rgba(234,179,8,.20) !important;
    outline:none !important;
}
.item-table input:focus,
.item-table textarea:focus,
.item-table select:focus{
    background:#fff9d6 !important;
    box-shadow:inset 0 0 0 2px rgba(234,179,8,.28) !important;
}


/* v41: compact product text columns + extra pale yellow focus */
.products-table{
    table-layout:fixed !important;
    width:100% !important;
}
.products-table th:nth-child(1),
.products-table td:nth-child(1){
    width:120px !important;
    max-width:120px !important;
}
.products-table th:nth-child(2),
.products-table td:nth-child(2){
    width:auto !important;
    max-width:420px !important;
}
.products-table th:nth-child(3),
.products-table td:nth-child(3){
    width:170px !important;
    max-width:170px !important;
}
.products-table th:nth-child(4),
.products-table td:nth-child(4){
    width:115px !important;
    max-width:115px !important;
}
.products-table th:nth-child(5),
.products-table td:nth-child(5){
    width:70px !important;
    max-width:70px !important;
}
.products-table th:nth-child(6),
.products-table td:nth-child(6){
    width:78px !important;
    max-width:78px !important;
}
.product-code-cell,
.product-name-cell,
.product-category-cell{
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    overflow-wrap:anywhere !important;
    word-break:break-word !important;
    line-height:1.25 !important;
}
.product-code-cell,
.product-category-cell{
    white-space:normal !important;
}
.product-name-cell{
    display:-webkit-box !important;
    -webkit-line-clamp:3 !important;
    -webkit-box-orient:vertical !important;
    max-height:4.1em !important;
}
.product-category-cell{
    max-height:3.2em !important;
}

input:not([type="checkbox"]):not([type="radio"]):not(.btn):focus,
textarea:focus,
select:focus{
    background:#fffdf0 !important;
    border-color:#efdca3 !important;
    box-shadow:0 0 0 3px rgba(239,220,163,.30) !important;
    outline:none !important;
}
.item-table input:focus,
.item-table textarea:focus,
.item-table select:focus{
    background:#fffdf0 !important;
    box-shadow:inset 0 0 0 2px rgba(239,220,163,.32) !important;
}

@media(max-width:760px){
    .products-table{table-layout:auto !important;}
    .products-table th:nth-child(n),
    .products-table td:nth-child(n){width:auto !important;max-width:none !important;}
    .product-name-cell{display:block !important;max-height:none !important;}
}

/* v42: четими колони в списъка с артикули + още по-бледо жълто активно поле */
.products-table{
    table-layout:fixed !important;
    width:100% !important;
}
.products-table th,
.products-table td{
    vertical-align:top !important;
    line-height:1.35 !important;
}
.products-table th:nth-child(1),
.products-table td:nth-child(1){
    width:14% !important;
    max-width:none !important;
}
.products-table th:nth-child(2),
.products-table td:nth-child(2){
    width:36% !important;
    max-width:none !important;
}
.products-table th:nth-child(3),
.products-table td:nth-child(3){
    width:18% !important;
    max-width:none !important;
}
.products-table th:nth-child(4),
.products-table td:nth-child(4){
    width:110px !important;
    max-width:110px !important;
}
.products-table th:nth-child(5),
.products-table td:nth-child(5){
    width:70px !important;
    max-width:70px !important;
}
.products-table th:nth-child(6),
.products-table td:nth-child(6){
    width:76px !important;
    max-width:76px !important;
}
.products-table th:nth-child(7),
.products-table td:nth-child(7){
    width:58px !important;
    max-width:58px !important;
}
.product-code-cell,
.product-name-cell,
.product-category-cell{
    display:table-cell !important;
    white-space:normal !important;
    overflow:visible !important;
    text-overflow:clip !important;
    overflow-wrap:anywhere !important;
    word-break:normal !important;
    max-height:none !important;
    -webkit-line-clamp:unset !important;
    -webkit-box-orient:initial !important;
}
.product-name-cell{
    font-size:14px !important;
}
.product-code-cell,
.product-category-cell{
    font-size:13px !important;
}
input:not([type="checkbox"]):not([type="radio"]):not(.btn):focus,
textarea:focus,
select:focus{
    background:#fffef7 !important;
    border-color:#eee2b8 !important;
    box-shadow:0 0 0 3px rgba(238,226,184,.22) !important;
    outline:none !important;
}
.item-table input:focus,
.item-table textarea:focus,
.item-table select:focus{
    background:#fffef7 !important;
    box-shadow:inset 0 0 0 2px rgba(238,226,184,.24) !important;
}
@media(max-width:760px){
    .products-table{table-layout:auto !important;}
    .products-table th:nth-child(n),
    .products-table td:nth-child(n){width:auto !important;max-width:none !important;}
}


/* v43: нормално автоматично оразмеряване на таблицата с артикули */
.products-table-wrap{
    width:100% !important;
    overflow-x:visible !important;
    overflow-y:visible !important;
}
.products-table-wrap .products-table{
    width:100% !important;
    table-layout:auto !important;
    border-collapse:collapse !important;
}
.products-table-wrap .products-table th,
.products-table-wrap .products-table td{
    min-width:0 !important;
    max-width:none !important;
    vertical-align:middle !important;
    white-space:normal !important;
    overflow:visible !important;
    text-overflow:clip !important;
    overflow-wrap:break-word !important;
    word-break:normal !important;
    hyphens:auto !important;
    line-height:1.34 !important;
    padding:8px 8px !important;
    font-size:13px !important;
}
.products-table-wrap .products-table thead th{
    white-space:normal !important;
    text-align:center !important;
    vertical-align:middle !important;
}
.products-table-wrap .products-table th:nth-child(1),
.products-table-wrap .products-table td:nth-child(1){
    width:1% !important;
    min-width:105px !important;
    max-width:160px !important;
}
.products-table-wrap .products-table th:nth-child(2),
.products-table-wrap .products-table td:nth-child(2){
    width:auto !important;
    min-width:260px !important;
}
.products-table-wrap .products-table th:nth-child(3),
.products-table-wrap .products-table td:nth-child(3){
    width:18% !important;
    min-width:150px !important;
    max-width:240px !important;
}
.products-table-wrap .products-table th:nth-child(4),
.products-table-wrap .products-table td:nth-child(4){
    width:1% !important;
    min-width:118px !important;
    max-width:138px !important;
    white-space:normal !important;
}
.products-table-wrap .products-table th:nth-child(5),
.products-table-wrap .products-table td:nth-child(5){
    width:1% !important;
    min-width:62px !important;
    max-width:76px !important;
    text-align:center !important;
}
.products-table-wrap .products-table th:nth-child(6),
.products-table-wrap .products-table td:nth-child(6){
    width:1% !important;
    min-width:78px !important;
    max-width:95px !important;
    text-align:center !important;
}
.products-table-wrap .products-table th:nth-child(7),
.products-table-wrap .products-table td:nth-child(7){
    width:1% !important;
    min-width:58px !important;
    max-width:64px !important;
    text-align:center !important;
    padding-left:4px !important;
    padding-right:4px !important;
}
.products-table-wrap .product-code-cell,
.products-table-wrap .product-name-cell,
.products-table-wrap .product-category-cell{
    display:table-cell !important;
    max-height:none !important;
    -webkit-line-clamp:unset !important;
    -webkit-box-orient:initial !important;
}
.products-table-wrap .product-code-cell{
    font-weight:700 !important;
    color:#475569 !important;
}
.products-table-wrap .product-name-cell{
    font-size:13.5px !important;
}
.products-table-wrap .product-category-cell{
    font-size:13px !important;
    color:#334155 !important;
}
.products-table-wrap .product-row-actions{
    display:inline-flex !important;
    flex-wrap:nowrap !important;
    gap:3px !important;
    justify-content:center !important;
    align-items:center !important;
    width:auto !important;
    max-width:none !important;
    margin:0 auto !important;
}
.products-table-wrap .inline-action-form{
    display:inline-flex !important;
    width:auto !important;
    height:auto !important;
    margin:0 !important;
}
.products-table-wrap .icon-btn,
.products-table-wrap a.icon-btn,
.products-table-wrap button.icon-btn{
    width:22px !important;
    height:22px !important;
    min-width:22px !important;
    max-width:22px !important;
    padding:0 !important;
    border-radius:6px !important;
    font-size:11px !important;
    line-height:1 !important;
    flex:0 0 22px !important;
}
.products-table-wrap .icon-btn span{
    display:block !important;
    width:22px !important;
    height:22px !important;
    line-height:22px !important;
    text-align:center !important;
    font-size:11px !important;
}

@media(max-width:900px){
    .products-table-wrap{overflow-x:auto !important;-webkit-overflow-scrolling:touch !important;}
    .products-table-wrap .products-table{min-width:820px !important;}
}

/* v43: още по-леко бледожълто активно поле */
input:not([type="checkbox"]):not([type="radio"]):not(.btn):focus,
textarea:focus,
select:focus{
    background:#fffefb !important;
    border-color:#efe7c7 !important;
    box-shadow:0 0 0 3px rgba(239,231,199,.16) !important;
    outline:none !important;
}
.item-table input:focus,
.item-table textarea:focus,
.item-table select:focus{
    background:#fffefb !important;
    box-shadow:inset 0 0 0 2px rgba(239,231,199,.18) !important;
}

/* v44: всички колони в списъка с артикули са с автоматична широчина според съдържанието */
.products-table-wrap{
    width:100% !important;
    overflow-x:auto !important;
    overflow-y:visible !important;
    -webkit-overflow-scrolling:touch !important;
}
.products-table-wrap .products-table,
table.products-table{
    width:100% !important;
    min-width:0 !important;
    table-layout:auto !important;
}
.products-table-wrap .products-table th,
.products-table-wrap .products-table td,
table.products-table th,
table.products-table td,
.products-table-wrap .products-table th:nth-child(n),
.products-table-wrap .products-table td:nth-child(n),
table.products-table th:nth-child(n),
table.products-table td:nth-child(n){
    width:auto !important;
    min-width:0 !important;
    max-width:none !important;
    white-space:normal !important;
    overflow:visible !important;
    text-overflow:clip !important;
    overflow-wrap:anywhere !important;
    word-break:normal !important;
    vertical-align:middle !important;
}
.products-table-wrap .products-table th:nth-child(4),
.products-table-wrap .products-table td:nth-child(4),
.products-table-wrap .products-table th:nth-child(5),
.products-table-wrap .products-table td:nth-child(5),
.products-table-wrap .products-table th:nth-child(6),
.products-table-wrap .products-table td:nth-child(6),
.products-table-wrap .products-table th:nth-child(7),
.products-table-wrap .products-table td:nth-child(7){
    white-space:nowrap !important;
    overflow-wrap:normal !important;
}
.products-table-wrap .product-code-cell,
.products-table-wrap .product-name-cell,
.products-table-wrap .product-category-cell{
    max-width:none !important;
    display:table-cell !important;
    -webkit-line-clamp:unset !important;
}
.products-table-wrap .product-row-actions{
    width:max-content !important;
    min-width:0 !important;
}
@media(max-width:900px){
    .products-table-wrap .products-table{min-width:0 !important;}
}

/* v61: print totals auto width - keep labels like "Отстъпка техника" and "Сума" readable */
.totals-compact{
    width:auto!important;
    max-width:100%!important;
    margin-top:4mm!important;
    margin-left:auto!important;
    table-layout:auto!important;
    border-collapse:collapse!important;
}
.totals-compact td{
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    white-space:nowrap!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    vertical-align:middle!important;
}
.totals-compact b{
    white-space:nowrap!important;
}
@media print{
    .totals-compact{
        width:auto!important;
        max-width:100%!important;
        margin-left:auto!important;
        table-layout:auto!important;
    }
    .totals-compact td{
        width:auto!important;
        white-space:nowrap!important;
        padding:3.2px 5px!important;
        font-size:10.2px!important;
        line-height:1.2!important;
    }
    .totals-compact .grand{
        font-size:10.8px!important;
    }
}

/* v62: print totals aligned with the main offer table */
.totals-compact{
    width:100%!important;
    max-width:100%!important;
    margin-left:0!important;
    margin-right:0!important;
    table-layout:fixed!important;
}
.totals-compact td{
    vertical-align:middle!important;
    white-space:normal!important;
    word-break:normal!important;
    overflow-wrap:break-word!important;
    line-height:1.25!important;
}
.totals-compact td:nth-child(1){width:34%!important;}
.totals-compact td:nth-child(2){width:22%!important;}
.totals-compact td:nth-child(3){width:22%!important;}
.totals-compact td:nth-child(4){width:22%!important;}
.totals-compact b{
    white-space:nowrap!important;
    display:inline-block!important;
    margin-right:3px!important;
}
@media print{
    .totals-compact{
        width:100%!important;
        max-width:100%!important;
        margin-left:0!important;
        table-layout:fixed!important;
    }
    .totals-compact td{
        padding:3.8px 5px!important;
        font-size:10.6px!important;
        line-height:1.25!important;
        white-space:normal!important;
        overflow-wrap:break-word!important;
    }
    .totals-compact td:nth-child(1){width:34%!important;}
    .totals-compact td:nth-child(2),
    .totals-compact td:nth-child(3),
    .totals-compact td:nth-child(4){width:22%!important;}
    .totals-compact .grand{font-size:10.9px!important;}
}

/* v86: phone full width under contact person in print/view client block */
.invoice-parties-table .party-phone-full-cell{
    padding:2mm 0 0 0;
    vertical-align:top;
}
.invoice-parties-table .party-phone-full{
    width:100%;
    margin:0;
    table-layout:fixed;
}
.invoice-parties-table .party-phone-full td{
    width:100%;
    box-sizing:border-box;
}
@media print{
    .invoice-parties-table .party-phone-full-cell{
        padding-top:1.5mm!important;
    }
    .invoice-parties-table .party-phone-full{
        width:100%!important;
        table-layout:fixed!important;
    }
}

/* v87: cleaner client/contact block - phone stays naturally under contact, object in right block */
.invoice-parties-table{
    border-collapse:separate!important;
    border-spacing:0!important;
}
.invoice-parties-table .party-table th{
    background:#eef4f7!important;
    color:#0f172a!important;
    font-weight:800!important;
    text-transform:none!important;
    letter-spacing:.1px!important;
}
.invoice-parties-table .party-table td{
    line-height:1.32!important;
    overflow-wrap:break-word!important;
    word-break:normal!important;
}
.invoice-parties-table .party-label{
    display:inline-block!important;
    min-width:27mm!important;
    font-weight:800!important;
    color:#334155!important;
    vertical-align:top!important;
}
.invoice-parties-table .party-value{
    color:#111827!important;
}
.invoice-parties-table.single-left-party .party-cell-left{
    width:100%!important;
}
.invoice-parties-table.has-right-party .party-cell-left{
    width:62%!important;
}
.invoice-parties-table.has-right-party .party-gap-cell{
    width:4%!important;
}
.invoice-parties-table.has-right-party .party-cell-right{
    width:34%!important;
}
.invoice-parties-table .party-right .party-label{
    min-width:17mm!important;
}
@media print{
    .invoice-parties-table.has-right-party .party-cell-left{width:62%!important;}
    .invoice-parties-table.has-right-party .party-gap-cell{width:4%!important;}
    .invoice-parties-table.has-right-party .party-cell-right{width:34%!important;}
    .invoice-parties-table.single-left-party .party-cell-left{width:100%!important;}
    .invoice-parties-table .party-label{min-width:25mm!important;}
    .invoice-parties-table .party-right .party-label{min-width:15mm!important;}
}
@media screen and (max-width:760px){
    .invoice-parties-table .party-label{
        min-width:0!important;
        display:inline!important;
    }
}

/* v88: clean contact rows - stable label/value columns for client block */
.invoice-parties-table .party-table{
    table-layout:fixed!important;
}
.invoice-parties-table .party-table tbody tr.party-field-row td{
    border:1px solid #cbd5e1!important;
    vertical-align:top!important;
}
.invoice-parties-table .party-table .party-label-cell{
    width:31mm!important;
    min-width:31mm!important;
    max-width:31mm!important;
    white-space:nowrap!important;
    font-weight:800!important;
    color:#334155!important;
    background:#f8fafc!important;
    padding:4px 6px!important;
}
.invoice-parties-table .party-table .party-value-cell{
    width:auto!important;
    color:#111827!important;
    padding:4px 6px!important;
    overflow-wrap:break-word!important;
    word-break:normal!important;
}
.invoice-parties-table .party-right .party-label-cell{
    width:18mm!important;
    min-width:18mm!important;
    max-width:18mm!important;
}
@media print{
    .invoice-parties-table .party-table .party-label-cell,
    .invoice-parties-table .party-table .party-value-cell{
        font-size:10.8px!important;
        padding:3.5px 5px!important;
        line-height:1.25!important;
    }
    .invoice-parties-table .party-table .party-label-cell{
        width:29mm!important;
        min-width:29mm!important;
        max-width:29mm!important;
    }
    .invoice-parties-table .party-right .party-label-cell{
        width:16mm!important;
        min-width:16mm!important;
        max-width:16mm!important;
    }
}
@media screen and (max-width:760px){
    .invoice-parties-table .party-table .party-label-cell,
    .invoice-parties-table .party-table .party-value-cell{
        display:block!important;
        width:100%!important;
        min-width:0!important;
        max-width:none!important;
    }
    .invoice-parties-table .party-table .party-label-cell{
        border-bottom:0!important;
    }
}

/* v89: symmetrical client/contact/object block - one aligned table */
.offer-info-table{
    width:100%!important;
    border-collapse:collapse!important;
    table-layout:fixed!important;
    margin:0 0 4mm 0!important;
    background:#fff!important;
}
.offer-info-table th{
    background:#eef4f7!important;
    border:1px solid #cbd5e1!important;
    color:#0f172a!important;
    font-weight:800!important;
    text-align:left!important;
    padding:4px 6px!important;
    font-size:11.5px!important;
    line-height:1.25!important;
}
.offer-info-table td{
    border:1px solid #cbd5e1!important;
    padding:4px 6px!important;
    font-size:11.5px!important;
    line-height:1.28!important;
    vertical-align:top!important;
    background:#fff!important;
    overflow-wrap:break-word!important;
    word-break:normal!important;
}
.offer-info-table .info-label-cell{
    width:31mm!important;
    background:#f8fafc!important;
    color:#334155!important;
    font-weight:800!important;
    white-space:nowrap!important;
}
.offer-info-table .info-value-cell{
    color:#111827!important;
}
.offer-info-table.with-object .info-object-label{
    width:18mm!important;
}
.offer-info-table.with-object col,
.offer-info-table.with-object td,
.offer-info-table.with-object th{
    box-sizing:border-box!important;
}
.offer-info-table.with-object .info-empty-cell{
    background:#fcfdff!important;
    color:transparent!important;
}
.offer-info-table.with-object td:nth-child(1){width:31mm!important;}
.offer-info-table.with-object td:nth-child(2){width:auto!important;}
.offer-info-table.with-object td:nth-child(3){width:18mm!important;}
.offer-info-table.with-object td:nth-child(4){width:45mm!important;}
.offer-info-table.without-object .info-label-cell{width:31mm!important;}
@media print{
    .offer-info-table{
        display:table!important;
        width:100%!important;
        margin-bottom:3mm!important;
        table-layout:fixed!important;
        page-break-inside:avoid!important;
    }
    .offer-info-table th,
    .offer-info-table td{
        font-size:10.8px!important;
        padding:3.5px 5px!important;
        line-height:1.24!important;
    }
    .offer-info-table .info-label-cell{
        width:29mm!important;
    }
    .offer-info-table.with-object td:nth-child(1){width:29mm!important;}
    .offer-info-table.with-object td:nth-child(3){width:16mm!important;}
    .offer-info-table.with-object td:nth-child(4){width:43mm!important;}
}
@media screen and (max-width:760px){
    .offer-info-table,
    .offer-info-table thead,
    .offer-info-table tbody,
    .offer-info-table tr,
    .offer-info-table th,
    .offer-info-table td{
        display:block!important;
        width:100%!important;
    }
    .offer-info-table th[colspan]{box-sizing:border-box!important;}
    .offer-info-table .info-label-cell{
        border-bottom:0!important;
        width:100%!important;
        white-space:normal!important;
    }
    .offer-info-table .info-empty-cell{display:none!important;}
}

/* v90: clean professional client/contact block - no nested visual clutter */
.quote-info-clean{
    display:grid!important;
    grid-template-columns:minmax(0, 1.55fr) minmax(42mm, .95fr)!important;
    gap:5mm!important;
    align-items:start!important;
    margin:0 0 5mm 0!important;
}
.quote-info-clean.no-object{
    grid-template-columns:1fr!important;
}
.quote-info-card{
    border:1px solid #cbd5e1!important;
    background:#ffffff!important;
    box-sizing:border-box!important;
    min-width:0!important;
}
.quote-info-title{
    background:#eef3f2!important;
    border-bottom:1px solid #cbd5e1!important;
    padding:4px 6px!important;
    font-size:11.3px!important;
    font-weight:800!important;
    text-transform:uppercase!important;
    letter-spacing:.15px!important;
    line-height:1.2!important;
}
.quote-info-row{
    display:grid!important;
    grid-template-columns:30mm minmax(0, 1fr)!important;
    column-gap:4mm!important;
    padding:3.5px 6px!important;
    border-top:1px solid #edf2f7!important;
    font-size:11.3px!important;
    line-height:1.28!important;
    align-items:start!important;
}
.quote-info-row:first-of-type{
    border-top:0!important;
}
.quote-info-label{
    font-weight:700!important;
    color:#334155!important;
    white-space:nowrap!important;
}
.quote-info-value{
    color:#111827!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
    min-width:0!important;
}
.object-card .quote-info-row{
    grid-template-columns:18mm minmax(0, 1fr)!important;
}
@media print{
    .quote-info-clean{
        display:grid!important;
        grid-template-columns:minmax(0, 1.55fr) minmax(42mm, .95fr)!important;
        gap:4mm!important;
        margin-bottom:4mm!important;
        break-inside:avoid!important;
        page-break-inside:avoid!important;
    }
    .quote-info-clean.no-object{
        grid-template-columns:1fr!important;
    }
    .quote-info-title{
        font-size:10.7px!important;
        padding:3.5px 5px!important;
    }
    .quote-info-row{
        grid-template-columns:28mm minmax(0, 1fr)!important;
        column-gap:3mm!important;
        padding:3.2px 5px!important;
        font-size:10.7px!important;
        line-height:1.23!important;
    }
    .object-card .quote-info-row{
        grid-template-columns:16mm minmax(0, 1fr)!important;
    }
}
@media screen and (max-width:760px){
    .quote-info-clean{
        grid-template-columns:1fr!important;
        gap:10px!important;
    }
}

/* v91: tighter client/object label columns - more room for entered information */
.quote-info-row{
    grid-template-columns:22mm minmax(0, 1fr)!important;
    column-gap:2mm!important;
}
.object-card .quote-info-row{
    grid-template-columns:14mm minmax(0, 1fr)!important;
    column-gap:2mm!important;
}
@media print{
    .quote-info-row{
        grid-template-columns:21mm minmax(0, 1fr)!important;
        column-gap:1.8mm!important;
    }
    .object-card .quote-info-row{
        grid-template-columns:13mm minmax(0, 1fr)!important;
        column-gap:1.8mm!important;
    }
}

/* v92: even tighter client/object labels - value starts closer to label */
.quote-info-row{
    grid-template-columns:18mm minmax(0, 1fr)!important;
    column-gap:1.2mm!important;
}
.object-card .quote-info-row{
    grid-template-columns:11mm minmax(0, 1fr)!important;
    column-gap:1.2mm!important;
}
@media print{
    .quote-info-row{
        grid-template-columns:17mm minmax(0, 1fr)!important;
        column-gap:1mm!important;
    }
    .object-card .quote-info-row{
        grid-template-columns:10mm minmax(0, 1fr)!important;
        column-gap:1mm!important;
    }
}

/* v52: показване на брой дни валидност до крайната дата */
.validity-days{font-weight:600;color:#444;white-space:nowrap;}
@media print{.validity-days{color:#333;}}

/* v94: fix contact-person overlap after tighter label spacing */
.quote-info-row{
    grid-template-columns:max-content minmax(0, 1fr)!important;
    column-gap:2mm!important;
}
.quote-info-label{
    min-width:max-content!important;
    white-space:nowrap!important;
}
.object-card .quote-info-row{
    grid-template-columns:max-content minmax(0, 1fr)!important;
    column-gap:2mm!important;
}
@media print{
    .quote-info-row,
    .object-card .quote-info-row{
        grid-template-columns:max-content minmax(0, 1fr)!important;
        column-gap:1.8mm!important;
    }
}


/* v37: Допълнителен модален изборник на артикули от каталог */
.picker-modal{z-index:10020}
.product-picker-card{width:min(1100px,96vw)}
.product-picker-tools{display:grid;grid-template-columns:1fr 260px auto;gap:8px;align-items:center;margin-bottom:8px}
.product-picker-tools input,.product-picker-tools select{width:100%}
.product-picker-list{margin-top:10px;max-height:58vh;overflow:auto;border:1px solid var(--line);border-radius:14px;background:#fff}
.product-picker-category{position:sticky;top:0;background:#f8fafc;border-bottom:1px solid var(--line);padding:9px 12px;font-weight:800;color:#0f172a;z-index:1}
.product-picker-row{width:100%;display:grid;grid-template-columns:1fr 190px;gap:14px;align-items:center;text-align:left;border:0;border-bottom:1px solid var(--line);background:#fff;padding:11px 12px;cursor:pointer;color:#0f172a}
.product-picker-row:hover{background:#fff7ed}
.product-picker-row:last-child{border-bottom:0}
.product-picker-main b{display:block;line-height:1.25}
.product-picker-main em{display:block;margin-top:3px;font-style:normal;color:#64748b;font-size:12px;font-weight:700}
.product-picker-price{text-align:right;white-space:nowrap;font-weight:800;color:#0f172a}
@media(max-width:760px){.product-picker-tools{grid-template-columns:1fr}.product-picker-row{grid-template-columns:1fr}.product-picker-price{text-align:left}.product-picker-list{max-height:52vh}}
@media print{.picker-modal{display:none!important}}


/* v39: empty product search messages without bordered container */
.product-suggestions.empty-message-only,
.product-picker-list.empty-message-only{
    border:0 !important;
    background:transparent !important;
    border-radius:0 !important;
    box-shadow:none !important;
}
.product-suggestions.empty-message-only .product-empty,
.product-picker-list.empty-message-only .product-empty{
    padding:8px 2px !important;
}


/* v62: admin controlled active field highlight */
body:not(.active-field-highlight-disabled) input:not([type="checkbox"]):not([type="radio"]):not(.btn):focus,
body:not(.active-field-highlight-disabled) textarea:focus,
body:not(.active-field-highlight-disabled) select:focus{
    background:var(--active-field-bg,#fffefb) !important;
    border-color:var(--active-field-border,#efe7c7) !important;
    box-shadow:0 0 0 3px var(--active-field-shadow,rgba(239,231,199,.16)) !important;
    outline:none !important;
}
body:not(.active-field-highlight-disabled) .item-table input:focus,
body:not(.active-field-highlight-disabled) .item-table textarea:focus,
body:not(.active-field-highlight-disabled) .item-table select:focus{
    background:var(--active-field-bg,#fffefb) !important;
    box-shadow:inset 0 0 0 2px var(--active-field-shadow-strong,rgba(239,231,199,.18)) !important;
}
body.active-field-highlight-disabled input:not([type="checkbox"]):not([type="radio"]):not(.btn):focus,
body.active-field-highlight-disabled textarea:focus,
body.active-field-highlight-disabled select:focus,
body.active-field-highlight-disabled .item-table input:focus,
body.active-field-highlight-disabled .item-table textarea:focus,
body.active-field-highlight-disabled .item-table select:focus{
    background:#fff !important;
    border-color:#94a3b8 !important;
    box-shadow:none !important;
    outline:none !important;
}


/* v64: admin focus color - thinner active field border */
body.active-field-highlight-enabled input:not([type="checkbox"]):not([type="radio"]):not(.btn):focus,
body.active-field-highlight-enabled textarea:focus,
body.active-field-highlight-enabled select:focus{
    background:var(--active-field-bg,#fffefb) !important;
    border-color:var(--active-field-border,#efe7c7) !important;
    outline:1px solid var(--active-field-border,#efe7c7) !important;
    outline-offset:0 !important;
    box-shadow:0 0 0 2px var(--active-field-shadow,rgba(239,231,199,.28)) !important;
}
body.active-field-highlight-enabled .item-table input:focus,
body.active-field-highlight-enabled .item-table textarea:focus,
body.active-field-highlight-enabled .item-table select:focus{
    background:var(--active-field-bg,#fffefb) !important;
    border-color:var(--active-field-border,#efe7c7) !important;
    outline:1px solid var(--active-field-border,#efe7c7) !important;
    outline-offset:-1px !important;
    box-shadow:inset 0 0 0 1px var(--active-field-border,#efe7c7), 0 0 0 1px var(--active-field-shadow-strong,rgba(239,231,199,.36)) !important;
}
body.active-field-highlight-disabled input:not([type="checkbox"]):not([type="radio"]):not(.btn):focus,
body.active-field-highlight-disabled textarea:focus,
body.active-field-highlight-disabled select:focus,
body.active-field-highlight-disabled .item-table input:focus,
body.active-field-highlight-disabled .item-table textarea:focus,
body.active-field-highlight-disabled .item-table select:focus{
    background:#fff !important;
    border-color:#cbd5e1 !important;
    outline:none !important;
    box-shadow:none !important;
}

/* v65: active field highlight uses background only; borders stay standard */
body.active-field-highlight-enabled input:not([type="checkbox"]):not([type="radio"]):not(.btn):focus,
body.active-field-highlight-enabled textarea:focus,
body.active-field-highlight-enabled select:focus{
    background:var(--active-field-bg,#fffefb) !important;
    border:1px solid #cbd5e1 !important;
    outline:none !important;
    box-shadow:none !important;
}
body.active-field-highlight-enabled .item-table input:focus,
body.active-field-highlight-enabled .item-table textarea:focus,
body.active-field-highlight-enabled .item-table select:focus{
    background:var(--active-field-bg,#fffefb) !important;
    border:0 !important;
    outline:none !important;
    box-shadow:none !important;
}
body.active-field-highlight-disabled input:not([type="checkbox"]):not([type="radio"]):not(.btn):focus,
body.active-field-highlight-disabled textarea:focus,
body.active-field-highlight-disabled select:focus{
    background:#fff !important;
    border:1px solid #cbd5e1 !important;
    outline:none !important;
    box-shadow:none !important;
}
body.active-field-highlight-disabled .item-table input:focus,
body.active-field-highlight-disabled .item-table textarea:focus,
body.active-field-highlight-disabled .item-table select:focus{
    background:#fff !important;
    border:0 !important;
    outline:none !important;
    box-shadow:none !important;
}

/* v66: live search and pagination for product list */
.product-live-toolbar{
    align-items:center;
}
.product-live-toolbar .btn{
    white-space:nowrap;
}
.product-name-cell.js-product-highlight{
    white-space:pre-line;
}
.product-search-mark{
    color:inherit;
    border-radius:4px;
    padding:0 2px;
    font-weight:800;
}
.product-pagination{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    justify-content:flex-end;
    align-items:center;
    margin-top:12px;
}
.product-page-btn.active{
    background:#111827;
    color:#fff;
    border-color:#111827;
}
.product-page-btn:disabled{
    opacity:.45;
    cursor:not-allowed;
}
.product-page-dots{
    padding:5px 3px;
    color:#64748b;
    font-weight:800;
}
@media(max-width:720px){
    .product-pagination{justify-content:flex-start;}
}

/* v68: mobile orientation blocker after login */
.mobile-orientation-blocker{
    display:none;
}
@media screen and (orientation: portrait) and (hover: none) and (pointer: coarse){
    body.is-mobile-device .mobile-orientation-blocker{
        position:fixed;
        inset:0;
        z-index:999999;
        display:flex;
        align-items:center;
        justify-content:center;
        background:rgba(15,23,42,.94);
        padding:22px;
        box-sizing:border-box;
    }
    body.is-mobile-device .mobile-orientation-card{
        width:min(420px,100%);
        background:#fff;
        color:#111827;
        border-radius:22px;
        padding:28px 24px;
        text-align:center;
        box-shadow:0 20px 60px rgba(0,0,0,.35);
    }
    body.is-mobile-device .mobile-orientation-icon{
        width:70px;
        height:70px;
        line-height:70px;
        margin:0 auto 14px;
        border-radius:999px;
        background:#fef2f2;
        color:#991b1b;
        font-size:42px;
        font-weight:900;
    }
    body.is-mobile-device .mobile-orientation-title{
        font-size:22px;
        line-height:1.2;
        font-weight:900;
        margin-bottom:10px;
    }
    body.is-mobile-device .mobile-orientation-text{
        font-size:16px;
        line-height:1.45;
        color:#374151;
        font-weight:700;
    }
}
@media screen and (orientation: landscape){
    .mobile-orientation-blocker{display:none!important;}
}
@media print{
    .mobile-orientation-blocker{display:none!important;}
}

/* v69: по-чист хоризонтален изглед на "Запазени оферти" за мобилни устройства */
@media screen and (orientation: landscape) and (hover: none) and (pointer: coarse){
    body.is-mobile-device{
        font-size:13px;
    }
    body.is-mobile-device .wrap{
        max-width:none;
        width:100%;
        margin:8px auto;
        padding:0 8px;
    }
    body.is-mobile-device .top{
        display:flex;
        align-items:flex-start;
        gap:8px;
        margin-bottom:8px;
    }
    body.is-mobile-device .brand{
        gap:8px;
        min-width:230px;
    }
    body.is-mobile-device .brand img{
        height:34px;
        max-width:145px;
    }
    body.is-mobile-device h1{
        font-size:17px;
        line-height:1.1;
    }
    body.is-mobile-device .brand .muted{
        display:none;
    }
    body.is-mobile-device .actions{
        justify-content:flex-end;
        gap:5px;
        margin-top:0;
        flex:1;
    }
    body.is-mobile-device .actions .btn,
    body.is-mobile-device .user-badge{
        padding:6px 8px!important;
        font-size:11px!important;
        border-radius:8px!important;
        line-height:1.15!important;
    }
    body.is-mobile-device .card{
        padding:10px;
        margin-bottom:8px;
        border-radius:12px;
    }
    body.is-mobile-device .card h2{
        font-size:16px;
        margin-bottom:8px;
    }
    body.is-mobile-device .filter-form{
        grid-template-columns:1.4fr 1.4fr .75fr .75fr .85fr .75fr auto;
        gap:7px;
        align-items:end;
    }
    body.is-mobile-device .filter-form .filter-wide{
        grid-column:auto;
    }
    body.is-mobile-device .filter-form label{
        font-size:11px;
        margin-bottom:3px;
    }
    body.is-mobile-device .filter-form input,
    body.is-mobile-device .filter-form select{
        padding:6px 7px;
        font-size:12px;
        border-radius:8px;
        min-height:32px;
    }
    body.is-mobile-device .filter-actions{
        display:flex;
        gap:5px;
        align-items:end;
        white-space:nowrap;
    }
    body.is-mobile-device .filter-actions .btn{
        padding:7px 8px!important;
        font-size:11px!important;
    }
    body.is-mobile-device .offer-stats{
        grid-template-columns:repeat(3, minmax(0,1fr));
        gap:7px;
        margin-top:8px;
    }
    body.is-mobile-device .stat-box{
        padding:7px 8px;
        border-radius:10px;
    }
    body.is-mobile-device .stat-box span{
        font-size:11px;
    }
    body.is-mobile-device .stat-box strong{
        font-size:17px;
    }

    /* В хоризонтален мобилен режим таблицата не става на големи карти. */
    body.is-mobile-device .offers-table-wrap{
        overflow-x:visible!important;
        overflow-y:visible!important;
        padding-bottom:0!important;
        border:0!important;
    }
    body.is-mobile-device .offers-table-wrap .list-table,
    body.is-mobile-device .offers-table-wrap .list-table thead,
    body.is-mobile-device .offers-table-wrap .list-table tbody,
    body.is-mobile-device .offers-table-wrap .list-table tr{
        display:table!important;
        width:100%!important;
    }
    body.is-mobile-device .offers-table-wrap .list-table thead{
        display:table-header-group!important;
    }
    body.is-mobile-device .offers-table-wrap .list-table tbody{
        display:table-row-group!important;
    }
    body.is-mobile-device .offers-table-wrap .list-table tr{
        display:table-row!important;
        border:0!important;
        border-radius:0!important;
        margin:0!important;
        padding:0!important;
        background:transparent;
    }
    body.is-mobile-device .offers-table-wrap .list-table th,
    body.is-mobile-device .offers-table-wrap .list-table td{
        display:table-cell!important;
        width:auto!important;
        min-width:0!important;
        max-width:none!important;
        padding:5px 4px!important;
        font-size:10.8px!important;
        line-height:1.18!important;
        vertical-align:middle!important;
        border:1px solid var(--line)!important;
        overflow-wrap:anywhere!important;
        word-break:break-word!important;
    }
    body.is-mobile-device .offers-table-wrap .list-table td::before{
        content:none!important;
        display:none!important;
    }

    /* Скриваме второстепенните колони само за мобилен хоризонтален изглед. */
    body.is-mobile-device .offers-table-wrap .list-table th:nth-child(5),
    body.is-mobile-device .offers-table-wrap .list-table td:nth-child(5),
    body.is-mobile-device .offers-table-wrap .list-table th:nth-child(6),
    body.is-mobile-device .offers-table-wrap .list-table td:nth-child(6),
    body.is-mobile-device .offers-table-wrap .list-table th:nth-child(8),
    body.is-mobile-device .offers-table-wrap .list-table td:nth-child(8){
        display:none!important;
    }
    body.is-mobile-device .offers-table-wrap .list-table th:nth-child(1),
    body.is-mobile-device .offers-table-wrap .list-table td:nth-child(1){width:15%!important;}
    body.is-mobile-device .offers-table-wrap .list-table th:nth-child(2),
    body.is-mobile-device .offers-table-wrap .list-table td:nth-child(2){width:10%!important;}
    body.is-mobile-device .offers-table-wrap .list-table th:nth-child(3),
    body.is-mobile-device .offers-table-wrap .list-table td:nth-child(3){width:33%!important;}
    body.is-mobile-device .offers-table-wrap .list-table th:nth-child(4),
    body.is-mobile-device .offers-table-wrap .list-table td:nth-child(4){width:19%!important;}
    body.is-mobile-device .offers-table-wrap .list-table th:nth-child(7),
    body.is-mobile-device .offers-table-wrap .list-table td:nth-child(7){width:11%!important;text-align:right!important;white-space:nowrap!important;}
    body.is-mobile-device .offers-table-wrap .list-table th:nth-child(9),
    body.is-mobile-device .offers-table-wrap .list-table td:nth-child(9){width:4%!important;text-align:center!important;padding-left:2px!important;padding-right:2px!important;}
    body.is-mobile-device .offers-table-wrap .list-table th:nth-child(10),
    body.is-mobile-device .offers-table-wrap .list-table td:nth-child(10){width:8%!important;text-align:center!important;}
    body.is-mobile-device .actions.compact-actions,
    body.is-mobile-device .single-view-action{
        max-width:none!important;
        width:100%!important;
        justify-content:center!important;
        margin-top:0!important;
    }
    body.is-mobile-device .single-view-action .btn.small{
        width:100%!important;
        padding:5px 6px!important;
        font-size:10.5px!important;
        border-radius:7px!important;
    }
    body.is-mobile-device .status-dot{
        width:9px;
        height:9px;
    }
    body.is-mobile-device .pagination-bar{
        margin-top:8px;
        padding-top:8px;
        gap:8px;
    }
    body.is-mobile-device .pagination-info{
        font-size:11.5px;
    }
    body.is-mobile-device .pagination-actions .btn.small{
        padding:6px 8px!important;
        font-size:11px!important;
    }
}

/* v71: compact client/contact/object block only on mobile landscape */
@media screen and (orientation: landscape) and (hover: none) and (pointer: coarse){
    body.is-mobile-device .print-page .quote-info-clean{
        display:grid!important;
        grid-template-columns:minmax(0, 1.45fr) minmax(130px, .9fr)!important;
        gap:7px!important;
        margin:0 0 8px 0!important;
    }
    body.is-mobile-device .print-page .quote-info-clean.no-object{
        grid-template-columns:1fr!important;
    }
    body.is-mobile-device .print-page .quote-info-card{
        border-radius:8px!important;
        overflow:hidden!important;
    }
    body.is-mobile-device .print-page .quote-info-title{
        padding:4px 6px!important;
        font-size:10px!important;
        line-height:1.05!important;
        letter-spacing:0!important;
    }
    body.is-mobile-device .print-page .quote-info-row,
    body.is-mobile-device .print-page .object-card .quote-info-row{
        display:grid!important;
        grid-template-columns:max-content minmax(0, 1fr)!important;
        column-gap:6px!important;
        padding:3px 6px!important;
        font-size:10.2px!important;
        line-height:1.12!important;
        min-height:0!important;
    }
    body.is-mobile-device .print-page .quote-info-label{
        font-size:10.2px!important;
        line-height:1.12!important;
        min-width:0!important;
    }
    body.is-mobile-device .print-page .quote-info-value{
        font-size:10.2px!important;
        line-height:1.12!important;
        overflow-wrap:anywhere!important;
    }
}

/* v72: equal mobile landscape size for attention line and offer/date meta */
@media screen and (orientation: landscape) and (hover: none) and (pointer: coarse){
    body.is-mobile-device .print-page .invoice-meta-block{
        margin:0 0 7px 0!important;
    }
    body.is-mobile-device .print-page .attention-line{
        display:block!important;
        width:100%!important;
        box-sizing:border-box!important;
        padding:3px 6px!important;
        font-size:10.2px!important;
        line-height:1.12!important;
        font-weight:400!important;
        border:1px solid #cbd5e1!important;
        border-bottom:0!important;
        background:#f8fafc!important;
        overflow-wrap:anywhere!important;
        word-break:normal!important;
    }
    body.is-mobile-device .print-page .attention-line b,
    body.is-mobile-device .print-page .attention-line strong{
        font-size:10.2px!important;
        line-height:1.12!important;
        font-weight:700!important;
    }
    body.is-mobile-device .print-page .invoice-meta-block .meta-one-row{
        width:100%!important;
        margin:0!important;
        table-layout:fixed!important;
        border-collapse:collapse!important;
    }
    body.is-mobile-device .print-page .invoice-meta-block .meta-one-row td{
        padding:3px 6px!important;
        font-size:10.2px!important;
        line-height:1.12!important;
        font-weight:400!important;
        vertical-align:top!important;
        border:1px solid #cbd5e1!important;
    }
    body.is-mobile-device .print-page .invoice-meta-block .meta-one-row b,
    body.is-mobile-device .print-page .invoice-meta-block .meta-one-row strong{
        font-size:10.2px!important;
        line-height:1.12!important;
        font-weight:700!important;
    }
}

/* v73: final mobile landscape normalization for offer preview attention and note blocks */
@media screen and (orientation: landscape) and (max-width: 950px){
    body .print-page .attention-line,
    body.is-mobile-device .print-page .attention-line,
    body .print-page .attention-line *,
    body.is-mobile-device .print-page .attention-line *,
    body .print-page .note,
    body.is-mobile-device .print-page .note,
    body .print-page .note *,
    body.is-mobile-device .print-page .note *{
        font-size:10.2px!important;
        line-height:1.12!important;
    }

    body .print-page .attention-line,
    body.is-mobile-device .print-page .attention-line{
        padding:3px 6px!important;
        margin:0!important;
        font-weight:400!important;
    }

    body .print-page .note,
    body.is-mobile-device .print-page .note{
        margin-top:7px!important;
        padding-top:5px!important;
        font-weight:400!important;
    }

    body .print-page .attention-line b,
    body.is-mobile-device .print-page .attention-line b,
    body .print-page .attention-line strong,
    body.is-mobile-device .print-page .attention-line strong,
    body .print-page .note b,
    body.is-mobile-device .print-page .note b,
    body .print-page .note strong,
    body.is-mobile-device .print-page .note strong{
        font-size:10.2px!important;
        line-height:1.12!important;
        font-weight:700!important;
    }

    body .print-page .quote-info-title,
    body.is-mobile-device .print-page .quote-info-title,
    body .print-page .quote-info-row,
    body.is-mobile-device .print-page .quote-info-row,
    body .print-page .quote-info-label,
    body.is-mobile-device .print-page .quote-info-label,
    body .print-page .quote-info-value,
    body.is-mobile-device .print-page .quote-info-value{
        font-size:10.2px!important;
        line-height:1.12!important;
    }
}

/* v74: mobile landscape - normalize OBJECT block title and content in offer preview */
@media screen and (orientation: landscape) and (max-width: 950px){
    body .print-page .object-card,
    body.is-mobile-device .print-page .object-card{
        font-size:10.2px!important;
        line-height:1.12!important;
    }

    body .print-page .object-card .quote-info-title,
    body.is-mobile-device .print-page .object-card .quote-info-title,
    body .print-page .object-card .quote-info-title *,
    body.is-mobile-device .print-page .object-card .quote-info-title *{
        font-size:10.2px!important;
        line-height:1.12!important;
        padding-top:3px!important;
        padding-bottom:3px!important;
        font-weight:700!important;
        letter-spacing:0!important;
    }

    body .print-page .object-card .quote-info-row,
    body.is-mobile-device .print-page .object-card .quote-info-row,
    body .print-page .object-card .quote-info-label,
    body.is-mobile-device .print-page .object-card .quote-info-label,
    body .print-page .object-card .quote-info-value,
    body.is-mobile-device .print-page .object-card .quote-info-value,
    body .print-page .object-card .quote-info-row *,
    body.is-mobile-device .print-page .object-card .quote-info-row *{
        font-size:10.2px!important;
        line-height:1.12!important;
    }
}

/* v75: final mobile offer preview typography + print/export blank-page fix */
@media screen and (orientation: landscape) and (max-width: 950px){
    body .print-page .invoice-meta-block,
    body .print-page .attention-line,
    body .print-page .attention-line *,
    body .print-page .meta-one-row,
    body .print-page .meta-one-row *,
    body .print-page .quote-info-clean,
    body .print-page .quote-info-card,
    body .print-page .quote-info-card *,
    body .print-page .client-card,
    body .print-page .client-card *,
    body .print-page .object-card,
    body .print-page .object-card *,
    body .print-page .note,
    body .print-page .note *{
        font-size:10.2px!important;
        line-height:1.14!important;
        letter-spacing:0!important;
    }

    body .print-page .quote-info-title,
    body .print-page .quote-info-title *,
    body .print-page .client-card .quote-info-title,
    body .print-page .client-card .quote-info-title *,
    body .print-page .object-card .quote-info-title,
    body .print-page .object-card .quote-info-title *{
        font-size:10px!important;
        line-height:1.12!important;
        font-weight:700!important;
        padding-top:3px!important;
        padding-bottom:3px!important;
        text-transform:none!important;
    }

    body .print-page .attention-line,
    body .print-page .meta-one-row td,
    body .print-page .quote-info-row,
    body .print-page .note{
        font-weight:400!important;
    }

    body .print-page .attention-line b,
    body .print-page .attention-line strong,
    body .print-page .meta-one-row b,
    body .print-page .meta-one-row strong,
    body .print-page .quote-info-label,
    body .print-page .note b,
    body .print-page .note strong{
        font-size:10.2px!important;
        line-height:1.14!important;
        font-weight:700!important;
    }

    body .print-page .attention-line{
        padding:3px 6px!important;
        margin:0!important;
    }

    body .print-page .meta-one-row{
        margin:0!important;
    }

    body .print-page .meta-one-row td{
        padding:3px 6px!important;
    }

    body .print-page .quote-info-clean{
        gap:7px!important;
        margin:0 0 7px 0!important;
    }

    body .print-page .quote-info-card{
        border-radius:8px!important;
    }

    body .print-page .quote-info-row{
        padding:3px 6px!important;
        min-height:0!important;
        column-gap:6px!important;
    }

    body .print-page .note{
        margin-top:6px!important;
        padding-top:4px!important;
        border-top-width:1px!important;
    }
}

@media print{
    html,
    body{
        height:auto!important;
        min-height:0!important;
        margin:0!important;
        padding:0!important;
        overflow:visible!important;
        background:#fff!important;
    }

    body > .screen-only,
    .screen-only,
    .mobile-orientation-blocker{
        display:none!important;
        height:0!important;
        min-height:0!important;
        margin:0!important;
        padding:0!important;
        overflow:hidden!important;
    }

    .print-page{
        display:block!important;
        position:relative!important;
        width:100%!important;
        max-width:100%!important;
        min-height:0!important;
        height:auto!important;
        margin:0!important;
        padding:0!important;
        border:0!important;
        box-shadow:none!important;
        overflow:visible!important;
        page-break-before:auto!important;
        page-break-after:auto!important;
        break-before:auto!important;
        break-after:auto!important;
    }

    .print-page::before,
    .print-page::after{
        content:none!important;
        display:none!important;
    }

    .document-header{
        margin-bottom:4mm!important;
    }

    .offer-heading{
        margin-bottom:2.5mm!important;
    }

    .invoice-meta-block,
    .quote-info-clean,
    .totals-compact,
    .signature,
    .note,
    .print-ad-footer{
        page-break-inside:avoid!important;
        break-inside:avoid!important;
    }

    .signature{
        margin-top:4mm!important;
    }

    .note{
        margin-top:3.5mm!important;
        padding-top:2mm!important;
        font-size:10.4px!important;
        line-height:1.28!important;
    }

    .note *,
    .note b,
    .note strong{
        font-size:10.4px!important;
        line-height:1.28!important;
    }

    .print-ad-footer{
        margin-top:3.5mm!important;
        padding-top:2mm!important;
    }

    @page{
        size:A4;
        margin:8mm;
    }
}

/* Подреждане на полето за аванс в един ред с отметката */
.advance-inline-row{
    display:flex;
    align-items:center;
    gap:10px;
    width:100%;
}
.advance-percent-input{
    width:96px !important;
    min-width:96px;
    flex:0 0 96px;
    text-align:right;
}
.advance-show-check{
    flex:1 1 auto;
    min-height:40px;
    margin:0 !important;
    padding:8px 10px !important;
    white-space:normal;
}
@media(max-width:850px){
    .advance-inline-row{
        align-items:stretch;
    }
    .advance-percent-input{
        width:88px !important;
        min-width:88px;
        flex-basis:88px;
    }
    .advance-show-check{
        font-size:12px;
    }
}


/* clean edit offer URL: inline POST edit button */
.inline-action-form{display:inline-flex;margin:0;padding:0;align-items:center}
.actions .inline-action-form{display:inline-flex}
.inline-action-form .btn{margin:0}

/* v68: A4 print/export width fix - prevent horizontal cut and empty second page */
@media print{
    @page{
        size:A4 portrait!important;
        margin:9mm!important;
    }

    html,
    body{
        width:auto!important;
        min-width:0!important;
        min-height:0!important;
        height:auto!important;
        margin:0!important;
        padding:0!important;
        overflow:visible!important;
        background:#fff!important;
    }

    body{
        -webkit-print-color-adjust:exact!important;
        print-color-adjust:exact!important;
    }

    .wrap.screen-only,
    .screen-only,
    .footer-after-offer,
    .system-footer{
        display:none!important;
    }

    .print-page{
        box-sizing:border-box!important;
        width:100%!important;
        max-width:192mm!important;
        min-width:0!important;
        min-height:0!important;
        height:auto!important;
        margin:0 auto!important;
        padding:0!important;
        border:0!important;
        box-shadow:none!important;
        overflow:visible!important;
        page-break-before:auto!important;
        page-break-after:auto!important;
        break-before:auto!important;
        break-after:auto!important;
    }

    .print-page::before,
    .print-page::after{
        content:none!important;
        display:none!important;
    }

    .document-header,
    .offer-heading,
    .invoice-meta-block,
    .quote-info-clean,
    .invoice-parties-table,
    .offer-table,
    .totals-compact,
    .signature,
    .note,
    .print-ad-footer{
        max-width:100%!important;
        box-sizing:border-box!important;
    }

    .document-header img{
        max-width:100%!important;
        width:100%!important;
        height:auto!important;
    }

    table{
        width:100%!important;
        max-width:100%!important;
    }

    .offer-table{
        table-layout:fixed!important;
    }

    .offer-table th,
    .offer-table td,
    .meta-one-row td,
    .totals-compact td,
    .quote-info-card,
    .quote-info-row,
    .quote-info-value{
        overflow-wrap:anywhere!important;
        word-break:normal!important;
    }

    tr,
    td,
    th{
        page-break-inside:avoid!important;
        break-inside:avoid!important;
    }

    .signature,
    .note,
    .print-ad-footer{
        page-break-inside:avoid!important;
        break-inside:avoid!important;
    }
}


/* v74: PDF filename title and browser print header/footer suppression attempt */
@media print{
    @page{
        size:A4;
        margin:0!important;
    }
    html,
    body{
        margin:0!important;
        padding:0!important;
        background:#fff!important;
    }
    .print-page{
        margin:0 auto!important;
        border:0!important;
        box-shadow:none!important;
    }
}


/* v30: modal за маркиране на оферта като изпълнена от списъка */
.status-empty.status-complete-trigger{
    border:0;
    background:transparent;
    color:#9ca3af;
    font-weight:800;
    cursor:pointer;
    padding:0 4px;
    line-height:1;
    font-size:14px;
}
.status-empty.status-complete-trigger:hover{color:#16a34a;transform:scale(1.15);}
.complete-modal-backdrop{
    position:fixed;
    inset:0;
    z-index:10000;
    display:none;
    align-items:center;
    justify-content:center;
    background:rgba(15,23,42,.45);
    padding:20px;
}
.complete-modal-backdrop.is-open{display:flex;}
.complete-modal{
    width:min(420px,100%);
    background:#fff;
    border-radius:18px;
    border:1px solid #e5e7eb;
    box-shadow:0 24px 70px rgba(15,23,42,.24);
    padding:22px;
}
.complete-modal h3{margin:0 0 10px;font-size:20px;color:#111827;}
.complete-modal p{margin:0 0 18px;color:#334155;font-size:15px;}
.complete-modal-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;}
.mobile-complete-btn{
    border:1px solid #bbf7d0;
    background:#f0fdf4;
    color:#166534;
    border-radius:999px;
    padding:5px 9px;
    font-weight:800;
    font-size:12px;
    cursor:pointer;
}
.mobile-complete-btn:hover{background:#dcfce7;}
