:root{
    --bg:#f5f7fa;
    --panel:#ffffff;
    --panel-soft:#f8fafc;
    --text:#17202a;
    --muted:#657080;
    --line:#dfe5ec;
    --line-soft:#edf1f5;
    --accent:#0f766e;
    --accent-soft:#e8f7f4;
    --danger:#dc2626;
    --warn:#b45309;
}
*{box-sizing:border-box;min-width:0}
html,body{margin:0;width:100%;max-width:100%;overflow-x:hidden;background:var(--bg);color:var(--text);font-family:"Noto Sans","Segoe UI","DejaVu Sans","Liberation Sans",Arial,sans-serif;font-size:14px}
a{text-decoration:none;color:inherit}
button,input,select,textarea{font:inherit}
img,svg,video,canvas{max-width:100%;height:auto}
*,*:before,*:after{box-shadow:none!important;text-shadow:none!important;filter:none!important}

/* Auth */
.auth-body{min-height:100vh;display:grid;place-items:center;background:#f5f7fa;padding:18px}
.auth-shell{width:min(420px,92vw)}
.auth-card{background:#fff;border:1px solid var(--line);border-radius:22px;padding:28px}
.brand-mark{width:52px;height:52px;border-radius:16px;background:#eef2f6;border:1px solid var(--line);display:grid;place-items:center;font-size:26px;margin-bottom:16px}
.auth-card h1{font-size:26px;margin:0 0 6px}
.muted{color:var(--muted);margin:0 0 22px}

/* Compact top navigation */
.app-shell.no-sidebar{min-height:100vh;display:block;width:100%;max-width:100%}
.app-topnav{position:sticky;top:0;z-index:30;width:100%;background:#fff;border-bottom:1px solid var(--line);display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:8px 14px}
.brand{display:flex;align-items:center;gap:8px}
.top-brand{min-width:132px;flex:0 0 auto}
.brand-icon{width:34px;height:34px;border-radius:11px;background:#f3f6f9;border:1px solid var(--line);display:grid;place-items:center;font-size:17px;flex:0 0 auto}
.brand b{display:block;font-size:15px;line-height:1.1;font-weight:900;white-space:nowrap}
.brand span{display:none}
.top-nav{display:flex;align-items:center;gap:4px;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;padding:1px 0;max-width:100%;white-space:nowrap}
.top-nav a{display:inline-flex;align-items:center;gap:6px;padding:7px 9px;border-radius:11px;border:1px solid transparent;color:#344054;background:transparent;transition:background .12s,border-color .12s,color .12s;flex:0 0 auto;font-size:13px;font-weight:800;line-height:1}
.top-nav a i{width:22px;height:22px;border-radius:8px;display:grid;place-items:center;background:transparent;border:0;font-style:normal;flex:0 0 auto;font-size:14px}
.top-nav a.active,.top-nav a:hover{background:#f1f7f6;border-color:#c6ece5;color:#075f55}
.top-nav a.active i,.top-nav a:hover i{background:#e8f7f4;border:1px solid #c6ece5}
.top-actions{display:flex;align-items:center;gap:7px;justify-content:flex-end;min-width:0}
.logout{padding:8px 10px;border-radius:11px;background:#f7f9fb;border:1px solid var(--line);color:#475467;font-weight:800;white-space:nowrap;font-size:13px;line-height:1}
.user-pill{display:flex;align-items:center;background:#fff;border:1px solid var(--line);border-radius:999px;padding:7px 10px;white-space:nowrap;max-width:190px;font-weight:800;color:#344054;font-size:13px;line-height:1}
.user-pill span{overflow:hidden;text-overflow:ellipsis}
.user-pill b{display:none}
.main{width:100%;max-width:100%;padding:14px}
.page-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px}
.page-head h1,.topbar h1{margin:0;font-size:22px;line-height:1.18;font-weight:900}
.topbar{display:none}

/* Layout blocks */
.grid{display:grid;gap:12px;max-width:100%}
.kpi-grid{grid-template-columns:repeat(auto-fit,minmax(145px,1fr));margin-bottom:16px}
.kpi{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:14px;display:grid;gap:7px}
.kpi i{width:32px;height:32px;border-radius:11px;background:#f1f4f7;border:1px solid var(--line-soft);display:grid;place-items:center;font-style:normal}
.kpi span{color:var(--muted);font-size:13px}
.kpi b{font-size:20px}
.kpi.warn b{color:var(--warn)}
.panel{background:var(--panel);border:1px solid var(--line);border-radius:18px;padding:14px;margin-bottom:14px;width:100%;max-width:100%}
.panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;flex-wrap:wrap}
.panel-head h2{font-size:18px;margin:0}
.split{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(280px,.9fr);gap:14px;max-width:100%}

/* Tables stay inside their own scroll area, never the page */
.table-wrap{width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;border:1px solid var(--line);border-radius:14px;background:#fff}
table{width:100%;border-collapse:separate;border-spacing:0;min-width:940px}
th,td{padding:10px 11px;border-bottom:1px solid var(--line-soft);text-align:left;vertical-align:middle;white-space:nowrap}
th{background:#f8fafc;color:#4b5563;font-size:12px;text-transform:uppercase;letter-spacing:.035em}
tr:last-child td{border-bottom:0}
.badge{display:inline-flex;align-items:center;border:1px solid #c6ece5;background:var(--accent-soft);color:#0f766e;border-radius:999px;padding:5px 9px;font-size:12px;font-weight:800;white-space:nowrap}
.live-dot{display:inline-flex;align-items:center;gap:7px;color:var(--accent);font-weight:800;font-size:12px;white-space:nowrap}
.live-dot:before{content:'';width:8px;height:8px;border-radius:50%;background:#10b981}
.activity-list{display:grid;gap:10px;max-height:420px;overflow:auto}
.activity-item{border:1px solid var(--line);border-radius:14px;padding:12px;background:#fbfcfe}
.activity-item b{display:block;margin-bottom:4px}
.activity-item span{color:var(--muted);font-size:12px}

/* Forms */
.filterbar{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:12px;max-width:100%}
.filterbar > *{min-width:180px;flex:1 1 180px}
input,select,textarea{width:100%;max-width:100%;border:1px solid #d8dee8;border-radius:12px;padding:10px 11px;background:#fff;outline:none;color:var(--text)}
textarea{min-height:88px;resize:vertical}
input:focus,select:focus,textarea:focus{border-color:#74c7bd;background:#fff}
.form-stack{display:grid;gap:12px;max-width:100%}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-width:100%}
.form-grid .full{grid-column:1/-1}
label span{display:block;margin:0 0 6px;color:#4b5563;font-weight:800;font-size:12px}

/* Buttons - flat metallic, no shadows */
.metal-btn,.soft-btn,.icon-btn{cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:12px;border:1px solid #c8d1dc;font-weight:800}
.metal-btn{padding:10px 15px;color:#111827;background:linear-gradient(180deg,#ffffff 0%,#eef2f6 48%,#d9e0e8 100%)}
.metal-btn:hover{background:linear-gradient(180deg,#ffffff 0%,#e7edf3 100%)}
.soft-btn{padding:10px 14px;background:var(--accent-soft);color:#0f766e;border-color:#c6ece5}
.full{width:100%}
.soft-link{color:var(--accent);font-weight:800}
.icon-btn{width:34px;height:34px;background:linear-gradient(180deg,#fff,#eef2f6);color:#1f2937;padding:0;flex:0 0 auto}
.icon-btn.danger{color:var(--danger)}
.row-actions{display:flex;align-items:center;gap:8px;flex-wrap:nowrap}
.row-actions form{margin:0}
.pagination{display:flex;gap:7px;flex-wrap:wrap;margin-top:13px}
.pagination a,.pagination span{min-width:34px;height:34px;border-radius:12px;display:grid;place-items:center;background:#f8fafc;border:1px solid var(--line);color:#4b5563}
.pagination a.active{background:#0f766e;color:#fff;border-color:#0f766e}

/* Modal / toast */
.modal{position:fixed;inset:0;display:none;place-items:center;background:rgba(15,23,42,.34);z-index:50;padding:18px}
.modal.open{display:grid}
.modal-card{width:min(560px,96vw);max-width:96vw;max-height:92vh;overflow:auto;background:#fff;border:1px solid var(--line);border-radius:20px;padding:20px;position:relative}
.modal-card.wide{width:min(920px,96vw)}
.modal-card h3{margin:0 0 16px;font-size:20px}
.modal-close{position:absolute;right:14px;top:12px;width:34px;height:34px;border-radius:12px;border:1px solid var(--line);background:#f3f4f6;font-size:20px;cursor:pointer}
.toast-root{position:fixed;top:62px;left:50%;transform:translateX(-50%);z-index:99;display:grid;gap:8px;max-width:calc(100vw - 24px)}
.toast{background:#0f172a;color:#fff;padding:11px 15px;border-radius:14px;border:1px solid rgba(255,255,255,.16)}
.toast.success{background:#0f766e}.toast.error{background:#b91c1c}
.toast.confirm{min-width:min(360px,calc(100vw - 24px));display:grid;gap:10px;background:#111827}
.toast-actions{display:flex;justify-content:flex-end;gap:8px}
.toast-actions button{border:1px solid rgba(255,255,255,.22);border-radius:10px;padding:7px 11px;font-weight:800;cursor:pointer;background:rgba(255,255,255,.08);color:#fff}
.toast-actions .toast-submit{background:#dc2626;border-color:#ef4444}
.toast-actions .toast-cancel{background:transparent}

/* Calculator */
.calc-page{display:grid;gap:14px;width:100%;max-width:100%}
.calc-workbench{padding:0;overflow:hidden;background:#fff;border-color:#dfe5ec}
.calc-toolbar{display:grid;grid-template-columns:minmax(0,1fr) minmax(340px,.55fr);gap:14px;align-items:end;padding:15px;border-bottom:1px solid var(--line-soft);background:#fff}
.calc-toolbar h2,.calc-table-head h2{margin:0;font-size:20px;line-height:1.16;font-weight:900}
.calc-toolbar p{margin:6px 0 0;color:var(--muted);max-width:680px}
.calc-select-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:end;background:#f8fafc;border:1px solid var(--line);border-radius:15px;padding:9px}
.calc-select-form label span{margin-bottom:6px}
.calc-select-form .metal-btn{height:42px;white-space:nowrap}
.calc-selected-card{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1.4fr);gap:14px;align-items:center;padding:15px;border-bottom:1px solid var(--line-soft);background:#fbfcfe}
.calc-route-block{display:flex;align-items:center;gap:12px;min-width:0}
.calc-icon{width:42px;height:42px;border-radius:13px;background:#eef2f6;border:1px solid var(--line);display:grid;place-items:center;font-size:20px;flex:0 0 auto}
.calc-route-block h3{margin:0 0 5px;font-size:18px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.calc-route-block p{margin:0;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.calc-meta-line{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.calc-meta-line span{display:grid;gap:3px;border:1px solid var(--line-soft);background:#fff;border-radius:13px;padding:10px;min-width:0;color:#293241;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.calc-meta-line b{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:800;overflow:hidden;text-overflow:ellipsis}
.calc-price-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;padding:15px;background:#fff}
.calc-price-card{border:1px solid var(--line);background:#fff;border-radius:14px;padding:12px;display:grid;gap:5px;min-height:102px;align-content:start}
.calc-price-card span{font-size:12px;color:var(--muted);font-weight:800;text-transform:uppercase;letter-spacing:.035em}
.calc-price-card b{font-size:20px;line-height:1.15;color:#17202a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.calc-price-card small{color:var(--muted);line-height:1.28}
.calc-price-card.primary{background:#f8fafc;border-color:#cfd8e3}
.calc-price-card.success{background:#e8f7f4;border-color:#c6ece5}
.premium-calc-table{padding:0;overflow:hidden;background:#fff}
.calc-table-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 15px;border-bottom:1px solid var(--line-soft);flex-wrap:wrap;background:#fff}
.calc-legend{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.calc-legend span{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--line);background:#f8fafc;border-radius:999px;padding:7px 10px;font-size:12px;font-weight:800;color:#475467}
.calc-legend i{width:8px;height:8px;border-radius:50%;background:#0f766e;display:block}
.calc-legend span:last-child i{background:#64748b}
.calc-table-wrap{border:0;border-radius:0;max-height:none}
.calc-table{min-width:920px;border-collapse:separate;border-spacing:0;width:100%}
.calc-table th{background:#f8fafc;border-bottom:1px solid var(--line);padding:12px 14px}
.calc-table td{padding:12px 14px;border-bottom:1px solid var(--line-soft)}
.calc-table tbody tr.free-row{background:#fbfffe}
.calc-table tbody tr:hover{background:#f8fafc}
.month-pill{display:inline-flex;align-items:center;justify-content:center;min-width:62px;border:1px solid #d8dee8;background:#fff;border-radius:999px;padding:6px 10px;font-weight:900;color:#17202a}
.status-pill{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:999px;padding:6px 10px;font-size:12px;font-weight:900;white-space:nowrap;background:#fff;color:#475467}
.status-pill.ok{border-color:#c6ece5;background:#e8f7f4;color:#0f766e}
.status-pill.plain{border-color:#e2e8f0;background:#f8fafc;color:#475467}
.monthly-price{display:inline-flex;align-items:center;border:1px solid #cfd8e3;background:#f8fafc;border-radius:12px;padding:7px 11px;font-weight:900;color:#111827;white-space:nowrap}
.calc-message-panel{padding:0;overflow:hidden}
.calc-message-panel textarea{border:0;border-radius:0;min-height:130px;background:#fbfcfe;padding:16px 18px;resize:vertical}
.calc-message-panel .soft-btn{white-space:nowrap}

/* Legacy calculator classes */
.calc-layout{display:grid;grid-template-columns:1fr;gap:14px;width:100%;max-width:100%}
.calc-input{margin-bottom:0}
.calc-top-grid{display:grid;grid-template-columns:minmax(260px,.9fr) minmax(320px,1.1fr) minmax(280px,.9fr);gap:14px;align-items:start}
.tour-card{border:1px solid var(--line);border-radius:16px;padding:14px;background:#fbfcfe;margin:0}
.tour-card h3{margin:0 0 6px;font-size:17px}
.tour-card p{margin:0 0 12px;color:var(--muted)}
.mini-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 12px}
.mini-grid span{display:flex;justify-content:space-between;gap:12px;border-bottom:1px dashed #e5e7eb;padding-bottom:6px;color:var(--muted)}
.mini-grid b{color:var(--text);text-align:right;overflow:hidden;text-overflow:ellipsis}
.calc-total{border-radius:16px;background:var(--accent-soft);border:1px solid #c6ece5;padding:14px;display:grid;grid-template-columns:1fr auto;gap:8px;margin:0}
.calc-total span{color:#0f766e}
.whatsapp-box{display:grid;gap:8px;margin:0}
.whatsapp-box textarea{min-height:126px;background:#f8fafc}
.calc-table-panel{width:100%;max-width:100%}
.calc-table-panel .table-wrap{border-radius:14px}
.calc-table-panel table{min-width:820px}

@media (max-width:1240px){
    .app-topnav{grid-template-columns:auto minmax(0,1fr);grid-template-areas:"brand actions" "nav nav";gap:8px;padding:8px 12px}
    .top-brand{grid-area:brand}.top-actions{grid-area:actions}.top-nav{grid-area:nav}
    .kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
    .split{grid-template-columns:1fr}
    .calc-top-grid{grid-template-columns:1fr 1fr}
    .whatsapp-box{grid-column:1/-1}
    .calc-price-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
    .calc-selected-card{grid-template-columns:1fr}
    .calc-meta-line{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:860px){
    .calc-toolbar{grid-template-columns:1fr;padding:14px}
    .calc-select-form{grid-template-columns:1fr}
    .calc-select-form .metal-btn{width:100%}
    .calc-selected-card{padding:14px}
    .calc-price-grid{grid-template-columns:1fr 1fr;padding:14px}
    .calc-table-head{padding:14px}
    .calc-toolbar h2,.calc-table-head h2{font-size:19px}
}
@media (max-width:760px){
    .app-topnav{display:block;padding:8px 10px}
    .top-brand{margin-bottom:8px;width:max-content;min-width:0}
    .top-actions{position:absolute;right:10px;top:8px;max-width:calc(100vw - 160px)}
    .top-nav{margin-top:8px;padding-bottom:4px}
    .top-nav a{padding:7px 8px}
    .top-nav a span{font-size:12px}
    .user-pill{max-width:calc(100vw - 235px);padding:7px 9px}
    .logout{padding:8px 9px}
    .main{padding:12px}
    .page-head{margin-bottom:12px}
    .page-head h1{font-size:20px}
    .kpi-grid{grid-template-columns:1fr 1fr;gap:10px}
    .kpi,.panel{border-radius:16px;padding:13px}
    .form-grid,.calc-top-grid,.mini-grid{grid-template-columns:1fr}
    .filterbar{display:grid;grid-template-columns:1fr}
    .filterbar > *{min-width:0;flex:auto}
    .modal{align-items:start;padding:12px}
    .modal-card{border-radius:18px;padding:18px 14px}
    table{min-width:760px}
}
@media (max-width:540px){
    .calc-price-grid,.calc-meta-line{grid-template-columns:1fr}
    .calc-route-block h3,.calc-route-block p{white-space:normal}
    .calc-table{min-width:820px}
}
@media (max-width:460px){
    .brand-text b{font-size:14px}
    .brand-icon{width:32px;height:32px}
    .top-actions{gap:5px;max-width:calc(100vw - 145px)}
    .user-pill{display:none}
    .top-nav a i{width:22px;height:22px}
    .kpi-grid{grid-template-columns:1fr}
}


/* Common action alignment */
.head-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.filterbar button[type="submit"]{display:none!important}

/* Calculator icon/menu cleanup */
.top-nav a[href$="/calculator"] i{font-size:16px}

/* Integrated credit calculator */
.credit-calc-panel{padding:0;overflow:hidden}
.credit-calc-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 15px;border-bottom:1px solid var(--line-soft);background:#fff;flex-wrap:wrap}
.credit-calc-head h2{margin:0;font-size:20px;line-height:1.15;font-weight:900}
.credit-mode-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:14px 15px;border-bottom:1px solid var(--line-soft);background:#fbfcfe}
.credit-mode-btn{border:1px solid var(--line);background:#fff;border-radius:14px;padding:12px;display:grid;grid-template-columns:auto 1fr;grid-template-areas:"icon title" "icon sub";gap:3px 10px;text-align:left;cursor:pointer;color:#17202a}
.credit-mode-btn span{grid-area:icon;width:34px;height:34px;border:1px solid var(--line-soft);border-radius:11px;background:#f8fafc;display:grid;place-items:center}
.credit-mode-btn b{grid-area:title;font-size:14px}
.credit-mode-btn small{grid-area:sub;color:var(--muted);font-weight:700}
.credit-mode-btn.active{border-color:#0f766e;background:#e8f7f4}
.credit-calc-grid{display:grid;grid-template-columns:minmax(260px,.75fr) minmax(340px,1fr) minmax(300px,.9fr);gap:14px;padding:15px;background:#fff}
.credit-input-card,.credit-month-card,.credit-result-card{border:1px solid var(--line);border-radius:16px;background:#fff;padding:14px;min-width:0}
.credit-input-card{display:grid;gap:12px;align-content:start}
.credit-input-card label{display:grid;gap:7px}
.credit-input-card label span,.credit-card-title{color:#4b5563;font-weight:900;font-size:12px;text-transform:uppercase;letter-spacing:.035em}
.credit-finance-row{display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px solid var(--line-soft);border-radius:13px;background:#f8fafc;padding:12px;margin-top:2px}
.credit-finance-row span{color:var(--muted);font-weight:800}
.credit-finance-row b{font-size:16px}
.credit-month-card{display:grid;gap:11px}
.credit-month-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
.credit-month-btn{border:1px solid var(--line);background:#fff;border-radius:12px;padding:9px 4px;display:grid;place-items:center;gap:2px;cursor:pointer;color:#17202a}
.credit-month-btn b{font-size:16px;line-height:1}
.credit-month-btn span{font-size:10px;color:var(--muted);font-weight:800}
.credit-month-btn small{font-size:10px;color:#667085;font-weight:800}
.credit-month-btn.active{background:#e8f7f4;border-color:#0f766e;color:#0f766e}
.credit-result-card{display:grid;gap:14px;align-content:start;background:#fbfcfe}
.credit-result-main{border:1px solid #c6ece5;background:#e8f7f4;border-radius:15px;padding:14px;display:grid;gap:5px}
.credit-result-main span{font-size:12px;color:#0f766e;font-weight:900;text-transform:uppercase;letter-spacing:.035em}
.credit-result-main b{font-size:28px;line-height:1.1}
.credit-result-main small{color:#0f766e;font-weight:800}
.credit-stats-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.credit-stats-grid div{border:1px solid var(--line);background:#fff;border-radius:13px;padding:10px;display:grid;gap:4px}
.credit-stats-grid span{font-size:11px;color:var(--muted);font-weight:900;text-transform:uppercase;letter-spacing:.03em}
.credit-stats-grid b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.credit-schedule{padding:0 15px 15px;background:#fff}
.credit-schedule .credit-card-title{margin-bottom:9px}
.credit-schedule-table table{min-width:360px}
.credit-schedule-table th,.credit-schedule-table td{padding:9px 12px}

/* Tour calculator refinements */
.calc-meta-line{grid-template-columns:minmax(240px,1.8fr) repeat(3,minmax(120px,.9fr))}
.calc-meta-line .hotel-wide{min-width:240px}
.calc-select-form{grid-template-columns:minmax(0,1fr)}
.calc-select-form button{display:none!important}
.calc-table-head .head-actions{gap:9px}
.calc-price-card small{display:none}

@media (max-width:1240px){
    .credit-calc-grid{grid-template-columns:1fr 1fr}
    .credit-result-card{grid-column:1/-1}
    .credit-month-grid{grid-template-columns:repeat(6,minmax(0,1fr))}
}
@media (max-width:860px){
    .credit-calc-grid{grid-template-columns:1fr}
    .credit-mode-row{grid-template-columns:1fr}
    .credit-month-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media (max-width:540px){
    .head-actions{width:100%;justify-content:flex-start}
    .credit-month-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
    .credit-result-main b{font-size:24px}
    .credit-stats-grid{grid-template-columns:1fr}
}

/* Pro workflow additions */
.modal-card.xl{width:min(1180px,96vw)}
.form-section{border:1px solid var(--line);background:#fbfcfe;border-radius:16px;padding:14px;display:grid;gap:12px}
.form-section>b{font-size:15px}
.compact-inner{margin-top:4px}
.checkline{display:flex!important;align-items:center;gap:8px;font-weight:800;color:#344054;margin:0}
.checkline input{width:auto;min-width:16px;height:16px}
.permissions-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.permission-card{border:1px solid var(--line);border-radius:14px;padding:12px;background:#fbfcfe;display:grid;gap:10px}
.permission-card>b{font-size:13px;color:#17202a}
.permission-list{display:grid;gap:8px}
.hotel-badge{display:inline-flex;min-width:240px;max-width:360px;white-space:normal;line-height:1.25;border:1px solid var(--line);border-radius:999px;background:#f8fafc;padding:7px 11px;font-weight:800;color:#344054}
.row-actions{display:flex;align-items:center;gap:6px;white-space:nowrap}
.row-actions form{display:inline-flex;margin:0}
.icon-btn.danger,.danger{color:#b42318;border-color:#f3c9c5;background:#fff5f5}
.toast.error{border-color:#f3c9c5;background:#fff5f5;color:#b42318}
.toast.success{border-color:#c6ece5;background:#e8f7f4;color:#075f55}
.toast.confirm{min-width:min(420px,92vw)}
.toast-actions{display:flex;gap:8px;margin-top:8px;justify-content:flex-end}
.toast-actions button{border:1px solid var(--line);background:#fff;border-radius:10px;padding:8px 10px;font-weight:900;cursor:pointer}
.toast-submit{color:#b42318;border-color:#f3c9c5!important;background:#fff5f5!important}
@media (max-width:1080px){.permissions-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.hotel-badge{min-width:180px;max-width:280px}}
@media (max-width:620px){.permissions-grid{grid-template-columns:1fr}.hotel-badge{min-width:0;max-width:240px}.modal-card.xl{width:96vw}}

.seller-toolbar .filterbar{grid-template-columns:minmax(260px, 420px) minmax(220px, 1fr)}
.seller-focus-card{display:grid;gap:14px}
.seller-focus-main{display:flex;gap:12px;align-items:center}
.seller-focus-main h2{margin:0;font-size:20px}
.seller-focus-main p{margin:4px 0 0;color:var(--muted);font-size:13px}
.seller-price-grid{grid-template-columns:repeat(4,minmax(160px,1fr))}
.seller-table td:nth-child(4){min-width:220px;white-space:normal}
.compact-report table td:first-child{color:var(--muted)}
.compact-report table td:last-child{text-align:right}
@media (max-width:900px){.seller-toolbar .filterbar,.seller-price-grid{grid-template-columns:1fr}.seller-focus-main{align-items:flex-start}}

.danger-badge{border-color:#fecaca!important;background:#fff1f2!important;color:#be123c!important}

/* Sales ERP modules */
.profile-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
.profile-grid>div{border:1px solid var(--line);background:#fbfcfe;border-radius:14px;padding:12px;display:grid;gap:4px;min-width:0}
.profile-grid span{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:800}
.profile-grid b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.module-toolbar{grid-template-columns:repeat(4,minmax(0,1fr)) auto;align-items:end;margin:0}
.activity-item p{margin:6px 0 0;color:#475467;line-height:1.45}
.muted{color:var(--muted)}
@media(max-width:1100px){.profile-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.module-toolbar{grid-template-columns:1fr 1fr}}
@media(max-width:640px){.profile-grid,.module-toolbar{grid-template-columns:1fr}}

/* Final top menu layout: 2 rows, no horizontal scroll */
.app-topnav{
    display:grid!important;
    grid-template-columns:auto minmax(0,1fr) auto!important;
    grid-template-areas:"brand spacer actions" "nav nav nav"!important;
    align-items:start!important;
    gap:8px 12px!important;
    padding:8px 14px 10px!important;
}
.top-brand{grid-area:brand!important;min-width:132px!important;margin:0!important;width:auto!important}
.top-actions{grid-area:actions!important;position:static!important;right:auto!important;top:auto!important;max-width:none!important}
.top-nav{
    grid-area:nav!important;
    display:grid!important;
    grid-template-columns:repeat(9,minmax(0,1fr))!important;
    gap:6px!important;
    overflow:visible!important;
    overflow-x:visible!important;
    overflow-y:visible!important;
    scrollbar-width:none!important;
    white-space:normal!important;
    padding:0!important;
    margin:0!important;
}
.top-nav::-webkit-scrollbar{display:none!important}
.top-nav a{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:5px!important;
    min-width:0!important;
    min-height:37px!important;
    padding:7px 7px!important;
    text-align:center!important;
    font-size:12.5px!important;
}
.top-nav a i{width:21px!important;height:21px!important;font-size:14px!important;flex:0 0 auto!important}
.top-nav a span{display:block!important;min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
@media (max-width:1240px){
    .top-nav{grid-template-columns:repeat(9,minmax(0,1fr))!important;gap:5px!important}
    .top-nav a{font-size:12px!important;padding:7px 5px!important}
}
@media (max-width:760px){
    .app-topnav{grid-template-columns:auto minmax(0,1fr) auto!important;grid-template-areas:"brand spacer actions" "nav nav nav"!important;padding:8px 10px 10px!important;gap:8px!important}
    .top-brand{min-width:0!important;width:max-content!important}
    .top-nav{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:5px!important}
    .top-nav a{min-height:36px!important;padding:7px 6px!important;font-size:11.5px!important}
}
@media (max-width:460px){
    .top-nav{grid-template-columns:repeat(3,minmax(0,1fr))!important}
}

/* Header cleanup + faster menu feel */
.app-topnav.compact-only-menu{
    display:block!important;
    position:sticky!important;
    top:0!important;
    z-index:30!important;
    width:100%!important;
    background:#fff!important;
    border-bottom:1px solid var(--line)!important;
    padding:8px 14px!important;
}
.app-topnav.compact-only-menu .top-nav{
    display:grid!important;
    grid-template-columns:repeat(9,minmax(0,1fr))!important;
    gap:6px!important;
    width:100%!important;
    max-width:100%!important;
    overflow:visible!important;
    white-space:normal!important;
    padding:0!important;
    margin:0!important;
}
.app-topnav.compact-only-menu .top-nav a{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-height:34px!important;
    padding:6px 6px!important;
    border:1px solid transparent!important;
    border-radius:10px!important;
    background:#fff!important;
    color:#344054!important;
    font-size:12px!important;
    font-weight:850!important;
    line-height:1!important;
    gap:5px!important;
    transition:none!important;
}
.app-topnav.compact-only-menu .top-nav a i{
    width:19px!important;
    height:19px!important;
    font-size:13px!important;
    border:0!important;
    background:transparent!important;
    display:grid!important;
    place-items:center!important;
    font-style:normal!important;
    flex:0 0 auto!important;
}
.app-topnav.compact-only-menu .top-nav a span{
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
}
.app-topnav.compact-only-menu .top-nav a.active,
.app-topnav.compact-only-menu .top-nav a:hover{
    background:#f1f7f6!important;
    border-color:#c6ece5!important;
    color:#075f55!important;
}
.app-topnav.compact-only-menu .top-nav a.nav-logout{
    background:#fff7f7!important;
    border-color:#f3d1d1!important;
    color:#9f1d1d!important;
}
.user-context-strip{
    display:flex;
    justify-content:flex-end;
    align-items:center;
    width:100%;
    margin:0 0 10px;
}
.user-type-badge{
    display:inline-flex;
    align-items:center;
    min-height:28px;
    padding:6px 11px;
    border:1px solid #dfe5ec;
    border-radius:999px;
    background:#fff;
    color:#344054;
    font-size:12px;
    font-weight:900;
    line-height:1;
}
.app-footer{
    margin:24px 0 2px;
    padding:12px 10px 0;
    border-top:1px solid var(--line);
    text-align:center;
    color:#667085;
    font-size:12px;
    font-weight:700;
}
.main{padding-top:10px!important}
.brand,.top-brand,.top-actions,.logout{display:none!important}

@media (max-width:1240px){
    .app-topnav.compact-only-menu .top-nav{grid-template-columns:repeat(9,minmax(0,1fr))!important;gap:5px!important}
    .app-topnav.compact-only-menu .top-nav a{font-size:11.5px!important;padding:6px 4px!important}
}
@media (max-width:900px){
    .app-topnav.compact-only-menu .top-nav{grid-template-columns:repeat(6,minmax(0,1fr))!important}
}
@media (max-width:640px){
    .app-topnav.compact-only-menu{padding:8px 10px!important}
    .app-topnav.compact-only-menu .top-nav{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:5px!important}
    .app-topnav.compact-only-menu .top-nav a{min-height:35px!important;font-size:11px!important}
    .user-context-strip{justify-content:flex-start}
}
@media (max-width:420px){
    .app-topnav.compact-only-menu .top-nav{grid-template-columns:repeat(3,minmax(0,1fr))!important}
}


/* Smart mobile menu + friendly UI refresh */
.app-topnav.compact-only-menu{
    padding:8px 10px!important;
    background:#ffffff!important;
    border-bottom:1px solid #e3e8ef!important;
}
.app-topnav.compact-only-menu .smart-nav{
    display:grid!important;
    grid-template-columns:42px repeat(6,minmax(0,1fr)) minmax(82px,.8fr)!important;
    gap:6px!important;
    align-items:stretch!important;
    overflow:visible!important;
    width:100%!important;
}
.nav-plane-logo{
    display:grid!important;
    place-items:center!important;
    min-height:38px!important;
    border:1px solid #c6ece5!important;
    border-radius:13px!important;
    background:#e8f7f4!important;
    color:#075f55!important;
    font-size:19px!important;
    font-weight:900!important;
}
.app-topnav.compact-only-menu .smart-nav>a,
.more-menu>summary{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:5px!important;
    min-height:38px!important;
    padding:7px 8px!important;
    border:1px solid #e2e8f0!important;
    border-radius:13px!important;
    background:#fff!important;
    color:#334155!important;
    font-size:12px!important;
    font-weight:900!important;
    line-height:1!important;
    cursor:pointer!important;
    user-select:none!important;
}
.app-topnav.compact-only-menu .smart-nav>a i,
.more-menu>summary i{
    width:18px!important;
    height:18px!important;
    display:grid!important;
    place-items:center!important;
    font-style:normal!important;
    flex:0 0 auto!important;
    background:transparent!important;
    border:0!important;
}
.app-topnav.compact-only-menu .smart-nav>a span,
.more-menu>summary span{
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
}
.app-topnav.compact-only-menu .smart-nav>a.active,
.app-topnav.compact-only-menu .smart-nav>a:hover,
.more-menu.active>summary,
.more-menu[open]>summary,
.more-menu>summary:hover{
    background:#f1f7f6!important;
    border-color:#c6ece5!important;
    color:#075f55!important;
}
.more-menu{
    position:relative!important;
    display:block!important;
    min-width:0!important;
}
.more-menu>summary{
    list-style:none!important;
}
.more-menu>summary::-webkit-details-marker{display:none!important}
.more-panel{
    position:absolute!important;
    right:0!important;
    top:calc(100% + 7px)!important;
    z-index:60!important;
    width:min(280px,calc(100vw - 18px))!important;
    max-height:70vh!important;
    overflow:auto!important;
    display:grid!important;
    gap:5px!important;
    padding:8px!important;
    border:1px solid #dfe5ec!important;
    border-radius:16px!important;
    background:#fff!important;
}
.more-panel a{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:8px!important;
    min-height:38px!important;
    padding:9px 10px!important;
    border:1px solid transparent!important;
    border-radius:12px!important;
    background:#fff!important;
    color:#344054!important;
    font-size:13px!important;
    font-weight:850!important;
}
.more-panel a i{
    width:24px!important;
    height:24px!important;
    display:grid!important;
    place-items:center!important;
    border-radius:9px!important;
    background:#f8fafc!important;
    font-style:normal!important;
}
.more-panel a.active,
.more-panel a:hover{
    background:#f1f7f6!important;
    border-color:#c6ece5!important;
    color:#075f55!important;
}
.more-panel a.nav-logout{
    background:#fff7f7!important;
    border-color:#f3d1d1!important;
    color:#9f1d1d!important;
}
@media (max-width:980px){
    .app-topnav.compact-only-menu .smart-nav{
        grid-template-columns:40px repeat(3,minmax(0,1fr))!important;
    }
    .more-menu{grid-column:auto!important}
}
@media (max-width:520px){
    .app-topnav.compact-only-menu{padding:7px 8px!important}
    .app-topnav.compact-only-menu .smart-nav{
        grid-template-columns:38px repeat(2,minmax(0,1fr)) minmax(76px,.8fr)!important;
        gap:5px!important;
    }
    .app-topnav.compact-only-menu .smart-nav>a,
    .more-menu>summary{
        min-height:36px!important;
        padding:6px 6px!important;
        border-radius:12px!important;
        font-size:11px!important;
    }
    .nav-plane-logo{min-height:36px!important;border-radius:12px!important}
    .more-panel{right:0!important;width:min(270px,calc(100vw - 16px))!important}
}

/* Easier daily use */
.main{
    padding:13px!important;
}
.user-context-strip{
    margin:4px 0 12px!important;
}
.user-type-badge{
    background:#f8fafc!important;
    border-color:#dfe5ec!important;
}
.page-head{
    margin-bottom:14px!important;
}
.page-head h1{
    font-size:21px!important;
    letter-spacing:-.02em!important;
}
.panel{
    border-radius:17px!important;
    padding:15px!important;
}
.panel-head h2{
    font-size:18px!important;
}
.table-wrap{
    border-radius:15px!important;
}
tbody tr:hover td{
    background:#f8fbfc!important;
}
th{
    position:sticky;
    top:0;
    z-index:1;
}
input,select,textarea{
    min-height:42px;
    border-radius:13px!important;
}
textarea{
    line-height:1.45;
    resize:vertical;
}
input:focus,select:focus,textarea:focus{
    border-color:#0f766e!important;
    outline:3px solid #dff5ef!important;
}
.metal-btn,.soft-btn,.icon-btn{
    min-height:38px;
    border-radius:13px!important;
}
.form-grid label span{
    display:block;
    margin-bottom:6px;
    color:#475467;
    font-size:12px;
    font-weight:900;
}
.modal-card{
    border-radius:22px!important;
}
.modal-card h3{
    padding-right:42px;
    letter-spacing:-.015em;
}
.review-section{
    background:#fff!important;
}
.review-grid{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(155px,.28fr);
    gap:12px;
    align-items:start;
}
.review-grid textarea{
    min-height:82px;
}
@media(max-width:760px){
    .main{padding:11px!important}
    .panel{padding:13px!important}
    .review-grid{grid-template-columns:1fr}
    .page-head h1{font-size:19px!important}
    .head-actions{width:100%;justify-content:flex-start}
}

/* Keep old wide-menu rules from taking over */
.app-topnav.compact-only-menu .top-nav{
    white-space:normal!important;
    overflow:visible!important;
}
.brand,.top-brand,.top-actions,.logout{display:none!important}

/* Polished dropdown + comfortable modal forms */
.more-menu>summary{
    position:relative!important;
    padding-right:10px!important;
}
.more-menu>summary::after{
    content:'▾';
    font-size:10px;
    color:#64748b;
    margin-left:2px;
    transform:translateY(-1px);
}
.more-menu[open]>summary::after{content:'▴';color:#075f55}
.more-panel{
    width:min(430px,calc(100vw - 22px))!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:7px!important;
    padding:10px!important;
    border-radius:18px!important;
    background:#ffffff!important;
    border:1px solid #d7e0ea!important;
}
.more-panel::before{
    content:'Digər bölmələr';
    grid-column:1/-1;
    display:flex;
    align-items:center;
    min-height:24px;
    padding:1px 3px 6px;
    color:#64748b;
    font-size:11px;
    font-weight:900;
    letter-spacing:.04em;
    text-transform:uppercase;
    border-bottom:1px solid #eef2f6;
    margin-bottom:2px;
}
.more-panel a{
    min-height:44px!important;
    padding:9px 10px!important;
    border-radius:14px!important;
    border-color:#edf1f5!important;
    background:#fbfcfe!important;
    gap:9px!important;
    font-size:12.5px!important;
    line-height:1.15!important;
}
.more-panel a i{
    width:28px!important;
    height:28px!important;
    border-radius:10px!important;
    background:#eef6f5!important;
    color:#075f55!important;
    border:1px solid #d7efeb!important;
    flex:0 0 auto!important;
}
.more-panel a span{
    min-width:0!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
}
.more-panel a.active,
.more-panel a:hover{
    background:#edf8f6!important;
    border-color:#bfe7df!important;
    color:#075f55!important;
}
.more-panel a.nav-logout{
    grid-column:1/-1;
    background:#fff8f8!important;
    border-color:#f1d7d7!important;
    color:#9f1d1d!important;
}
.more-panel a.nav-logout i{
    background:#fff1f1!important;
    border-color:#f3d1d1!important;
    color:#9f1d1d!important;
}

/* Modal comfort refresh */
body.modal-open{overflow:hidden!important}
.modal{
    background:rgba(15,23,42,.42)!important;
    padding:22px!important;
    align-items:center!important;
}
.modal-card{
    padding:0!important;
    border-radius:24px!important;
    border:1px solid #d7e0ea!important;
    overflow:hidden!important;
    background:#ffffff!important;
}
.modal-card::before{
    content:'';
    display:block;
    height:4px;
    background:#0f766e;
}
.modal-card h3{
    margin:0!important;
    min-height:58px;
    display:flex;
    align-items:center;
    padding:16px 58px 14px 20px!important;
    border-bottom:1px solid #edf1f5;
    background:#fbfcfe;
    font-size:18px!important;
    line-height:1.15!important;
}
.modal-close{
    right:14px!important;
    top:12px!important;
    width:36px!important;
    height:36px!important;
    border-radius:13px!important;
    background:#ffffff!important;
    border:1px solid #d7e0ea!important;
    color:#64748b!important;
    display:grid!important;
    place-items:center!important;
    line-height:1!important;
}
.modal-close:hover{background:#fff1f1!important;border-color:#f3d1d1!important;color:#b91c1c!important}
.modal-card form.form-grid,
.modal-card form.form-stack{
    padding:18px!important;
    gap:12px!important;
    background:#ffffff!important;
}
.modal-card form.form-grid{
    grid-template-columns:repeat(2,minmax(230px,1fr))!important;
}
.modal-card .form-grid.compact-inner{
    grid-template-columns:repeat(2,minmax(190px,1fr))!important;
    padding:0!important;
    gap:10px!important;
}
.modal-card label:not(.checkline){
    display:grid!important;
    gap:7px!important;
    background:#fbfcfe!important;
    border:1px solid #edf1f5!important;
    border-radius:15px!important;
    padding:11px!important;
}
.modal-card label span{
    margin:0!important;
    color:#536172!important;
    font-size:11.5px!important;
    font-weight:900!important;
    letter-spacing:.01em!important;
}
.modal-card input,
.modal-card select,
.modal-card textarea{
    min-height:44px!important;
    border-radius:12px!important;
    background:#ffffff!important;
    border:1px solid #d7e0ea!important;
    padding:10px 11px!important;
}
.modal-card textarea{
    min-height:96px!important;
}
.modal-card input:focus,
.modal-card select:focus,
.modal-card textarea:focus{
    border-color:#0f766e!important;
    outline:3px solid #e2f6f1!important;
    background:#ffffff!important;
}
.modal-card .form-section{
    background:#f8fafc!important;
    border:1px solid #e3e8ef!important;
    border-radius:18px!important;
    padding:14px!important;
    display:grid!important;
    gap:12px!important;
}
.modal-card .form-section>b{
    color:#17202a!important;
    font-size:14px!important;
    line-height:1.2!important;
}
.review-grid{
    grid-template-columns:minmax(0,1fr) minmax(140px,.25fr)!important;
    gap:10px!important;
}
.review-grid label:not(.checkline){
    background:#ffffff!important;
}
.modal-card .checkline{
    display:flex!important;
    align-items:center!important;
    gap:9px!important;
    padding:10px 12px!important;
    background:#fff!important;
    border:1px solid #d7e0ea!important;
    border-radius:14px!important;
    font-weight:850!important;
}
.modal-card .checkline input{
    width:auto!important;
    min-height:auto!important;
}
.modal-card .metal-btn.full,
.modal-card .soft-btn.full,
.modal-card button.full{
    grid-column:1/-1!important;
    min-height:46px!important;
    border-radius:15px!important;
    justify-self:stretch!important;
    margin-top:2px!important;
}
.modal-card.xl,
.modal-card.wide{
    width:min(1040px,96vw)!important;
}
@media(max-width:760px){
    .more-panel{
        grid-template-columns:1fr!important;
        width:min(320px,calc(100vw - 16px))!important;
        right:0!important;
    }
    .modal{
        padding:10px!important;
        align-items:start!important;
    }
    .modal-card{
        width:100%!important;
        max-width:100%!important;
        max-height:calc(100vh - 20px)!important;
        border-radius:20px!important;
    }
    .modal-card h3{
        min-height:54px;
        padding:14px 52px 13px 16px!important;
        font-size:17px!important;
    }
    .modal-card form.form-grid,
    .modal-card .form-grid.compact-inner{
        grid-template-columns:1fr!important;
        padding:14px!important;
        gap:10px!important;
    }
    .review-grid{grid-template-columns:1fr!important}
}

/* Modal scroll fix: long forms must stay reachable on desktop and mobile */
.modal.open{
    align-items:center!important;
}
.modal-card{
    max-height:calc(100dvh - 44px)!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
    scrollbar-gutter:stable!important;
}
.modal-card::-webkit-scrollbar{width:8px}
.modal-card::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:999px;border:2px solid #fff}
.modal-card::-webkit-scrollbar-track{background:#f8fafc;border-radius:999px}
.modal-card form.form-grid,
.modal-card form.form-stack{
    padding-bottom:max(24px,calc(env(safe-area-inset-bottom) + 24px))!important;
}
.modal-card .modal-close{
    position:sticky!important;
    float:right!important;
    top:12px!important;
    z-index:5!important;
    margin-bottom:-36px!important;
}
@media(max-width:760px){
    .modal.open{align-items:start!important}
    .modal-card{
        max-height:calc(100dvh - 20px)!important;
    }
}

/* Final navigation rebuild: compact, no horizontal scroll, clean grouped menu */
.app-topnav.redesigned-nav{
    position:sticky!important;
    top:0!important;
    z-index:50!important;
    width:100%!important;
    background:#ffffff!important;
    border-bottom:1px solid #e3e8ef!important;
    padding:10px 14px!important;
    display:block!important;
}
.nav-frame{
    width:min(1380px,100%)!important;
    margin:0 auto!important;
    display:grid!important;
    grid-template-columns:42px minmax(0,1fr)!important;
    align-items:center!important;
    gap:10px!important;
}
.nav-logo{
    width:40px!important;
    height:40px!important;
    border-radius:14px!important;
    display:grid!important;
    place-items:center!important;
    background:#f7fafc!important;
    border:1px solid #dfe7ee!important;
    color:#0f766e!important;
    flex:0 0 auto!important;
}
.plane-svg{width:22px;height:22px;fill:currentColor;stroke:none}
.primary-nav{
    position:relative!important;
    display:grid!important;
    grid-template-columns:repeat(7,minmax(86px,1fr))!important;
    align-items:center!important;
    gap:7px!important;
    width:100%!important;
    max-width:100%!important;
    overflow:visible!important;
    white-space:normal!important;
    padding:0!important;
}
.primary-nav .nav-item,
.primary-nav>a,
.primary-nav summary.nav-item{
    min-height:40px!important;
    width:100%!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:7px!important;
    padding:8px 9px!important;
    border-radius:14px!important;
    border:1px solid #dfe7ee!important;
    background:#f8fafc!important;
    color:#263548!important;
    font-size:12.5px!important;
    font-weight:900!important;
    letter-spacing:0!important;
    line-height:1!important;
    cursor:pointer!important;
    transition:none!important;
}
.primary-nav .nav-item:hover,
.primary-nav .nav-item.active,
.primary-nav>a:hover,
.primary-nav>a.active,
.more-menu.active>summary.nav-item{
    background:#e9f7f4!important;
    border-color:#bce8df!important;
    color:#075f55!important;
}
.primary-nav .nav-item i,
.primary-nav>a i,
.primary-nav summary.nav-item i,
.more-link i{
    width:22px!important;
    height:22px!important;
    display:grid!important;
    place-items:center!important;
    border-radius:8px!important;
    background:#ffffff!important;
    border:1px solid #e4ebf2!important;
    font-style:normal!important;
    flex:0 0 auto!important;
    color:inherit!important;
}
.nav-text-icon{font-size:14px;line-height:1}
.nav-svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.more-menu{position:relative!important;display:block!important;margin:0!important;padding:0!important}
.more-menu>summary{list-style:none!important}
.more-menu>summary::-webkit-details-marker{display:none!important}
.pro-more-panel{
    position:absolute!important;
    top:calc(100% + 10px)!important;
    right:0!important;
    width:min(620px,calc(100vw - 28px))!important;
    background:#ffffff!important;
    border:1px solid #dbe3ec!important;
    border-radius:20px!important;
    padding:12px!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:12px!important;
    z-index:100!important;
}
.more-group{
    background:#f8fafc!important;
    border:1px solid #e7edf4!important;
    border-radius:17px!important;
    padding:10px!important;
    display:grid!important;
    gap:7px!important;
}
.more-group>b{
    display:block!important;
    color:#6b7788!important;
    font-size:11px!important;
    font-weight:950!important;
    text-transform:uppercase!important;
    letter-spacing:.06em!important;
    padding:0 2px 3px!important;
}
.more-link{
    display:flex!important;
    align-items:center!important;
    gap:9px!important;
    min-height:38px!important;
    padding:8px 9px!important;
    border-radius:13px!important;
    border:1px solid transparent!important;
    background:#ffffff!important;
    color:#253447!important;
    font-size:13px!important;
    font-weight:850!important;
    line-height:1!important;
}
.more-link:hover,.more-link.active{
    background:#edf8f5!important;
    border-color:#c5ebe3!important;
    color:#075f55!important;
}
.more-system{grid-column:1/-1!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;align-items:start!important}
.more-system>b{grid-column:1/-1!important}
.user-context-strip{width:min(1380px,100%)!important;margin:12px auto 8px!important;display:flex!important;justify-content:flex-end!important}
.user-type-badge{
    display:inline-flex!important;
    align-items:center!important;
    gap:7px!important;
    min-height:32px!important;
    padding:7px 12px!important;
    border-radius:999px!important;
    background:#ffffff!important;
    border:1px solid #dfe7ee!important;
    color:#344054!important;
    font-weight:900!important;
    font-size:12.5px!important;
}
.main{padding:0 14px 14px!important;width:100%!important;max-width:100%!important}
.page-head{width:min(1380px,100%)!important;margin:0 auto 12px!important}
.main>.panel,.main>.grid,.main>.table-wrap,.main>.calc-shell,.main>.pagination,.main>section:not(.page-head){width:min(1380px,100%)!important;margin-left:auto!important;margin-right:auto!important}
.app-footer{width:min(1380px,100%)!important;margin:18px auto 0!important;padding:14px!important;text-align:center!important;color:#667085!important;border-top:1px solid #e5ebf2!important;font-size:12px!important;font-weight:800!important}
@media(max-width:980px){
    .app-topnav.redesigned-nav{padding:8px 10px!important}
    .nav-frame{grid-template-columns:38px minmax(0,1fr)!important;gap:8px!important}
    .nav-logo{width:38px!important;height:38px!important;border-radius:13px!important}
    .primary-nav{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important}
    .primary-nav .nav-item,.primary-nav>a,.primary-nav summary.nav-item{min-height:38px!important;padding:7px 6px!important;font-size:11.5px!important;border-radius:12px!important}
    .primary-nav .nav-item i,.primary-nav>a i,.primary-nav summary.nav-item i{width:20px!important;height:20px!important}
    .pro-more-panel{right:0!important;width:min(520px,calc(100vw - 20px))!important;grid-template-columns:1fr!important;border-radius:18px!important}
    .more-system{grid-template-columns:1fr!important}
}
@media(max-width:560px){
    .nav-frame{grid-template-columns:34px minmax(0,1fr)!important;align-items:start!important}
    .nav-logo{width:34px!important;height:34px!important;position:sticky!important;top:8px!important}
    .plane-svg{width:19px!important;height:19px!important}
    .primary-nav{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}
    .primary-nav .nav-item,.primary-nav>a,.primary-nav summary.nav-item{justify-content:flex-start!important;min-height:38px!important;padding:8px!important;font-size:12px!important}
    .pro-more-panel{position:fixed!important;top:86px!important;left:10px!important;right:10px!important;width:auto!important;max-height:calc(100dvh - 104px)!important;overflow-y:auto!important}
    .user-context-strip{justify-content:flex-start!important;margin:10px auto 8px!important}
    .main{padding-left:10px!important;padding-right:10px!important}
}

/* Sticky mobile hamburger menu */
.app-topnav.redesigned-nav{
    position:sticky!important;
    top:0!important;
    z-index:1000!important;
    box-shadow:none!important;
}
.mobile-nav-toggle{
    display:none!important;
    width:40px!important;
    height:40px!important;
    border-radius:14px!important;
    border:1px solid #dfe7ee!important;
    background:#f8fafc!important;
    color:#243447!important;
    align-items:center!important;
    justify-content:center!important;
    flex-direction:column!important;
    gap:5px!important;
    padding:0!important;
    cursor:pointer!important;
    -webkit-tap-highlight-color:transparent!important;
}
.mobile-nav-toggle span{
    width:18px!important;
    height:2px!important;
    border-radius:8px!important;
    background:currentColor!important;
    display:block!important;
    transition:transform .16s ease, opacity .16s ease!important;
}
body.mobile-menu-open .mobile-nav-toggle span:nth-child(1){transform:translateY(7px) rotate(45deg)!important}
body.mobile-menu-open .mobile-nav-toggle span:nth-child(2){opacity:0!important}
body.mobile-menu-open .mobile-nav-toggle span:nth-child(3){transform:translateY(-7px) rotate(-45deg)!important}
@media(max-width:760px){
    .app-topnav.redesigned-nav{
        padding:8px 10px!important;
    }
    .nav-frame{
        grid-template-columns:40px minmax(0,1fr) 40px!important;
        grid-template-areas:"logo spacer burger" "nav nav nav"!important;
        align-items:center!important;
        gap:8px!important;
    }
    .nav-logo{
        grid-area:logo!important;
        width:40px!important;
        height:40px!important;
        position:static!important;
        top:auto!important;
    }
    .mobile-nav-toggle{
        display:flex!important;
        grid-area:burger!important;
        justify-self:end!important;
    }
    .primary-nav{
        grid-area:nav!important;
        display:none!important;
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:7px!important;
        padding-top:8px!important;
        animation:mobileMenuIn .14s ease both!important;
    }
    body.mobile-menu-open .primary-nav{
        display:grid!important;
    }
    .primary-nav .nav-item,
    .primary-nav>a,
    .primary-nav summary.nav-item{
        min-height:42px!important;
        justify-content:flex-start!important;
        padding:9px 10px!important;
        border-radius:14px!important;
        font-size:12.5px!important;
    }
    .primary-nav .nav-item i,
    .primary-nav>a i,
    .primary-nav summary.nav-item i{
        width:22px!important;
        height:22px!important;
    }
    .more-menu{
        grid-column:1/-1!important;
    }
    .more-menu>summary.nav-item{
        width:100%!important;
    }
    .pro-more-panel{
        position:static!important;
        width:100%!important;
        max-height:none!important;
        overflow:visible!important;
        margin-top:7px!important;
        border-radius:16px!important;
        padding:9px!important;
        grid-template-columns:1fr!important;
    }
    .more-system{grid-template-columns:1fr!important}
    .user-context-strip{
        margin-top:8px!important;
    }
}
@media(max-width:390px){
    .primary-nav{grid-template-columns:1fr!important}
}
@keyframes mobileMenuIn{
    from{opacity:0;transform:translateY(-6px)}
    to{opacity:1;transform:translateY(0)}
}

/* CRM Excel-flow layout */
.crm-excel-wrap table{min-width:1120px;width:100%;table-layout:fixed}
.crm-excel-table th,.crm-excel-table td{vertical-align:top}
.crm-excel-table th:nth-child(1),.crm-excel-table td:nth-child(1){width:92px}
.crm-excel-table th:nth-child(2),.crm-excel-table td:nth-child(2){width:145px}
.crm-excel-table th:nth-child(3),.crm-excel-table td:nth-child(3){width:135px}
.crm-excel-table th:nth-child(4),.crm-excel-table td:nth-child(4){width:112px}
.crm-excel-table th:nth-child(5),.crm-excel-table td:nth-child(5){width:255px}
.crm-excel-table th:nth-child(6),.crm-excel-table td:nth-child(6){width:145px}
.crm-excel-table th:nth-child(7),.crm-excel-table td:nth-child(7){width:218px}
.crm-excel-table th:nth-child(8),.crm-excel-table td:nth-child(8){width:172px}
.crm-excel-table .summary-cell{white-space:normal;min-width:0;max-width:none;overflow-wrap:anywhere}
.crm-excel-table .questions-cell{min-width:230px}
.crm-excel-table .call-history-cell{min-width:0;max-width:165px;font-size:12px}
.crm-excel-table .reviews-cell{min-width:0;max-width:245px;font-size:12px}
.crm-excel-table .call-history-cell .mini-stack,.crm-excel-table .reviews-cell .mini-stack{gap:4px}
.crm-excel-table .call-history-cell .mini-stack b,.crm-excel-table .reviews-cell .mini-stack b{font-size:10px}
.crm-excel-table .call-history-cell .mini-stack span,.crm-excel-table .reviews-cell .mini-stack span{font-size:11.5px}
.crm-excel-table .seller-cell{min-width:210px;white-space:normal}
.crm-excel-table .operation-cell{min-width:165px;max-width:175px;white-space:normal}
.crm-excel-table .action-buttons{min-width:330px;align-items:flex-start;flex-wrap:wrap}
.mini-stack{display:grid;gap:6px;line-height:1.25}
.mini-stack div{display:grid;gap:2px;border-bottom:1px dashed #e7ebf0;padding-bottom:5px}
.mini-stack div:last-child{border-bottom:0;padding-bottom:0}
.mini-stack b{font-size:11px;color:#657080;font-weight:900;line-height:1.25}
.mini-stack span{font-size:13px;color:#17202a;white-space:normal;overflow-wrap:anywhere}
.empty-dash,.empty-row{color:#657080;font-weight:800}
.empty-row{text-align:center;padding:18px!important}
.soft-btn.small{padding:7px 9px;border-radius:10px;font-size:12px;line-height:1;white-space:nowrap}
.inline-assign{margin:0;min-width:190px}
.inline-assign select{height:38px;padding:8px 10px;border-radius:11px;background:#fff}

.seller-action-stack{display:grid;gap:9px;align-items:start}
.seller-action-select{width:100%}
.seller-action-select .inline-assign{width:100%;min-width:0}
.seller-action-select select{width:92%;max-width:150px;min-width:118px}
.seller-name-badge{display:block;width:100%;padding:9px 10px;border:1px solid var(--line-soft);border-radius:11px;background:#fbfcfe;color:#344054;font-weight:900;font-size:12.5px;line-height:1.25}
.seller-action-buttons{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.seller-action-buttons form{display:inline-flex;margin:0}
.seller-action-buttons .icon-btn{width:32px;height:32px;flex:0 0 auto}
.crm-action-icon svg{width:17px;height:17px;fill:currentColor;display:block}
.crm-action-icon{background:linear-gradient(180deg,#ffffff,#eef7f5);border-color:#c6ece5;color:#0f766e}
.leads-live-table{min-width:1130px}
.leads-live-table .seller-cell{min-width:210px}
.leads-live-table .tour-cell{white-space:normal;min-width:240px}
.call-history-form{display:grid;gap:14px}
.call-history-list{display:grid;gap:10px}
.call-row{display:grid;grid-template-columns:minmax(150px,.55fr) minmax(220px,1fr) 38px;gap:10px;align-items:end;border:1px solid var(--line-soft);background:#fbfcfe;border-radius:14px;padding:10px}
.call-row .icon-btn{height:38px;width:38px}
.modal-actions-line{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap}
.review-edit-grid textarea{min-height:76px}
.form-section{border:1px solid var(--line-soft);background:#fbfcfe;border-radius:14px;padding:12px}
.review-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(150px,.45fr);gap:10px;margin-top:10px}
.checkline{display:flex;align-items:center;gap:8px;font-weight:800;color:#344054;margin:8px 0 10px}
.checkline input{width:auto}
.compact-inner{margin-top:10px}
@media (max-width:760px){
    .call-row{grid-template-columns:1fr;align-items:stretch}
    .call-row .icon-btn{width:100%}
    .modal-actions-line{display:grid;grid-template-columns:1fr}
    .review-grid{grid-template-columns:1fr}
    .crm-excel-wrap table{min-width:960px}
    .crm-excel-table .operation-cell{min-width:160px;max-width:175px}
}
.call-row{grid-template-columns:minmax(0,1fr) 38px;align-items:center}
.call-row label{grid-column:1}
.call-row .icon-btn{grid-column:2;grid-row:1 / span 2;align-self:center}
@media (max-width:760px){.call-row{grid-template-columns:1fr}.call-row label,.call-row .icon-btn{grid-column:auto;grid-row:auto}}

/* v8: sticky navigation + modal layer fix */
.app-topnav.redesigned-nav{
    position:sticky!important;
    position:-webkit-sticky!important;
    top:0!important;
    left:0!important;
    right:0!important;
    z-index:2200!important;
    isolation:isolate!important;
}
.modal{
    z-index:6000!important;
    isolation:isolate!important;
}
.modal.open{
    display:grid!important;
    place-items:center!important;
    align-items:center!important;
}
.modal-card{
    position:relative!important;
    z-index:6001!important;
}
.more-panel,
.pro-more-panel{
    z-index:2300!important;
}
@media(max-width:760px){
    .modal.open{
        align-items:start!important;
        padding-top:14px!important;
    }
    .modal-card{
        max-height:calc(100dvh - 28px)!important;
    }
}


/* v9: always-visible nav, balanced modal scrollbars, live CRM status tones */
:root{--topnav-height:82px}
.app-topnav.redesigned-nav{
    position:fixed!important;
    top:0!important;
    left:0!important;
    right:0!important;
    width:100%!important;
    z-index:8000!important;
    background:rgba(255,255,255,.96)!important;
    backdrop-filter:blur(14px)!important;
    -webkit-backdrop-filter:blur(14px)!important;
    border-bottom:1px solid rgba(226,232,240,.9)!important;
    box-shadow:0 10px 26px rgba(15,23,42,.08)!important;
}
.main{padding-top:calc(var(--topnav-height) + 14px)!important}
.modal{z-index:12000!important;padding:22px!important}
.modal.open{place-items:center!important;align-items:center!important}
.modal-card{
    overflow:auto!important;
    scrollbar-gutter:stable both-edges!important;
    padding-right:18px!important;
    background:linear-gradient(#fff,#fff) padding-box!important;
    box-shadow:0 28px 80px rgba(15,23,42,.18)!important;
}
.modal-card::-webkit-scrollbar{width:10px!important;height:10px!important}
.modal-card::-webkit-scrollbar-track{background:#eef4f7!important;border-radius:999px!important;margin:18px 0!important}
.modal-card::-webkit-scrollbar-thumb{background:linear-gradient(180deg,#94a3b8,#64748b)!important;border-radius:999px!important;border:3px solid #eef4f7!important}
.modal-card::-webkit-scrollbar-thumb:hover{background:linear-gradient(180deg,#64748b,#475569)!important}
.modal-card{scrollbar-width:thin!important;scrollbar-color:#94a3b8 #eef4f7!important}
.crm-excel-table tbody tr.crm-row-success-green td{background:#eafff4!important;border-top-color:#bbf7d0!important;border-bottom-color:#bbf7d0!important}
.crm-excel-table tbody tr.crm-row-wait-yellow td{background:#fffbe6!important;border-top-color:#fde68a!important;border-bottom-color:#fde68a!important}
.crm-excel-table tbody tr.crm-row-risk-red td{background:#fff1f2!important;border-top-color:#fecdd3!important;border-bottom-color:#fecdd3!important}
.crm-excel-table tbody tr.crm-row-success-green:hover td{background:#dcfce7!important}
.crm-excel-table tbody tr.crm-row-wait-yellow:hover td{background:#fef3c7!important}
.crm-excel-table tbody tr.crm-row-risk-red:hover td{background:#ffe4e6!important}
.crm-excel-table tbody tr[class*="crm-row-"] .mini-stack div{border-bottom-color:rgba(100,116,139,.25)!important}
@media(max-width:760px){
    :root{--topnav-height:64px}
    .main{padding-top:calc(var(--topnav-height) + 10px)!important}
    .modal{padding:14px!important;padding-top:calc(var(--topnav-height) + 12px)!important}
    .modal.open{align-items:start!important;place-items:center!important}
    .modal-card{max-height:calc(100dvh - var(--topnav-height) - 26px)!important;padding-right:14px!important}
}

/* v10: CRM summary shows only latest item + compact history button */
.crm-excel-table .latest-only-cell{position:relative!important}
.latest-cell-line{display:grid;grid-template-columns:minmax(0,1fr) 30px;align-items:start;gap:7px}
.latest-stack{min-width:0}
.latest-stack div{border-bottom:0!important;padding-bottom:0!important}
.latest-stack b{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.latest-stack span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:28px}
.cell-history-btn{width:28px;height:28px;border:1px solid rgba(100,116,139,.25);border-radius:10px;background:rgba(255,255,255,.74);display:inline-grid;place-items:center;cursor:pointer;box-shadow:0 6px 14px rgba(15,23,42,.08);transition:.18s ease}
.cell-history-btn:hover{transform:translateY(-1px);background:#fff;border-color:#8fb4ff;box-shadow:0 8px 18px rgba(37,99,235,.12)}
.cell-history-btn svg{width:15px;height:15px;fill:#475569}
.history-modal-card{width:min(680px,96vw)!important}
.history-modal-body{padding-top:4px}
.history-list{display:grid;gap:8px}
.history-item{display:grid;gap:5px;border:1px solid #e7edf5;background:#f8fafc;border-radius:14px;padding:10px 12px}
.history-item b{font-size:12px;font-weight:900;color:#334155}
.history-item span{font-size:13px;line-height:1.45;color:#111827;white-space:pre-wrap;overflow-wrap:anywhere}
.history-item.empty{place-items:center;min-height:56px;color:#64748b;background:#fff}
.crm-excel-table .questions-cell{min-width:190px!important}
.crm-excel-table .call-history-cell{max-width:138px!important}
.crm-excel-table .reviews-cell{max-width:260px!important}
@media (max-width:760px){
    .latest-cell-line{grid-template-columns:minmax(0,1fr) 28px;gap:6px}
    .cell-history-btn{width:27px;height:27px}
}

/* v11: compact CRM actions + flat aesthetic modal system */
.crm-excel-table th:nth-child(8),
.crm-excel-table td:nth-child(8),
.crm-excel-table .operation-cell{
    width:150px!important;
    min-width:150px!important;
    max-width:150px!important;
}
.seller-action-stack{
    gap:7px!important;
    align-items:start!important;
}
.seller-action-select select,
.seller-action-select .inline-assign select{
    width:100%!important;
    max-width:126px!important;
    min-width:0!important;
    height:32px!important;
    min-height:32px!important;
    padding:6px 24px 6px 8px!important;
    border-radius:10px!important;
    font-size:11.5px!important;
    line-height:1.1!important;
}
.seller-name-badge{
    max-width:126px!important;
    min-height:32px!important;
    padding:7px 8px!important;
    border-radius:10px!important;
    font-size:11.5px!important;
}
.seller-action-buttons{
    display:flex!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    gap:4px!important;
    min-width:0!important;
    white-space:nowrap!important;
}
.seller-action-buttons form{
    display:inline-flex!important;
    flex:0 0 auto!important;
    margin:0!important;
    padding:0!important;
}
.seller-action-buttons .icon-btn,
.seller-action-buttons button.icon-btn{
    width:28px!important;
    height:28px!important;
    min-width:28px!important;
    min-height:28px!important;
    padding:0!important;
    border-radius:9px!important;
    font-size:14px!important;
    line-height:1!important;
    flex:0 0 28px!important;
    box-shadow:0 4px 10px rgba(15,23,42,.06)!important;
}
.seller-action-buttons .icon-btn:hover{
    transform:translateY(-1px)!important;
}
.seller-action-buttons .crm-action-icon svg{
    width:14.5px!important;
    height:14.5px!important;
}
.cell-history-btn{
    width:24px!important;
    height:24px!important;
    min-width:24px!important;
    min-height:24px!important;
    border-radius:8px!important;
    box-shadow:0 3px 9px rgba(15,23,42,.06)!important;
}
.cell-history-btn svg{
    width:12.5px!important;
    height:12.5px!important;
}
.latest-cell-line{
    grid-template-columns:minmax(0,1fr) 24px!important;
    gap:5px!important;
}

/* Modal: clean flat UI, stable close button, balanced scroll */
body.modal-open{
    overflow:hidden!important;
}
.modal{
    position:fixed!important;
    inset:0!important;
    z-index:14000!important;
    display:none!important;
    padding:24px!important;
    background:rgba(15,23,42,.38)!important;
    backdrop-filter:blur(8px)!important;
    -webkit-backdrop-filter:blur(8px)!important;
    overflow:auto!important;
}
.modal.open{
    display:grid!important;
    place-items:center!important;
    align-items:center!important;
}
.modal-card,
.modal-card.wide,
.modal-card.xl{
    position:relative!important;
    width:min(920px,96vw)!important;
    max-width:96vw!important;
    max-height:calc(100dvh - 48px)!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
    scrollbar-gutter:stable!important;
    padding:0!important;
    border:1px solid #e4eaf2!important;
    border-radius:22px!important;
    background:#ffffff!important;
    box-shadow:0 26px 70px rgba(15,23,42,.18)!important;
}
.modal-card.xl{width:min(1080px,96vw)!important}
.modal-card.wide.history-modal-card{width:min(650px,96vw)!important}
.modal-card::before{
    display:none!important;
    content:none!important;
}
.modal-card .modal-close,
.modal-close{
    position:sticky!important;
    top:14px!important;
    left:100%!important;
    z-index:35!important;
    width:34px!important;
    height:34px!important;
    min-width:34px!important;
    min-height:34px!important;
    margin:14px 14px -48px auto!important;
    padding:0!important;
    float:none!important;
    display:grid!important;
    place-items:center!important;
    border:1px solid #dde5ee!important;
    border-radius:12px!important;
    background:#ffffff!important;
    color:#64748b!important;
    font-size:20px!important;
    line-height:1!important;
    box-shadow:0 8px 18px rgba(15,23,42,.08)!important;
    cursor:pointer!important;
}
.modal-card .modal-close:hover,
.modal-close:hover{
    background:#fff4f4!important;
    border-color:#f1caca!important;
    color:#b42318!important;
}
.modal-card h3{
    position:sticky!important;
    top:0!important;
    z-index:20!important;
    min-height:62px!important;
    margin:0!important;
    padding:18px 68px 16px 22px!important;
    display:flex!important;
    align-items:center!important;
    border-bottom:1px solid #edf2f7!important;
    background:#ffffff!important;
    color:#111827!important;
    font-size:18px!important;
    font-weight:900!important;
    letter-spacing:-.02em!important;
    box-shadow:0 1px 0 rgba(226,232,240,.9)!important;
}
.modal-card > p,
.modal-card > .history-modal-body,
.modal-card > .call-history-form,
.modal-card > .form-grid,
.modal-card > .form-stack,
.modal-card > form:not(.inline-assign){
    margin:0!important;
    padding:18px 20px 22px!important;
}
.modal-card form.form-grid,
.modal-card form.form-stack,
.modal-card .call-history-form{
    background:#fff!important;
    gap:12px!important;
}
.modal-card form.form-grid{
    grid-template-columns:repeat(2,minmax(220px,1fr))!important;
}
.modal-card label:not(.checkline){
    display:grid!important;
    gap:7px!important;
    padding:11px!important;
    border:1px solid #e8eef5!important;
    border-radius:14px!important;
    background:#fbfcfe!important;
}
.modal-card label span{
    margin:0!important;
    color:#5f6b7a!important;
    font-size:11.5px!important;
    font-weight:900!important;
    line-height:1.2!important;
}
.modal-card input,
.modal-card select,
.modal-card textarea{
    width:100%!important;
    min-height:42px!important;
    padding:9px 10px!important;
    border:1px solid #dce4ee!important;
    border-radius:11px!important;
    background:#fff!important;
    color:#111827!important;
    box-shadow:none!important;
}
.modal-card textarea{
    min-height:88px!important;
    resize:vertical!important;
}
.modal-card input:focus,
.modal-card select:focus,
.modal-card textarea:focus{
    border-color:#0f766e!important;
    outline:3px solid #def7f1!important;
}
.modal-card .form-section,
.call-row,
.history-item{
    border:1px solid #e8eef5!important;
    border-radius:16px!important;
    background:#fbfcfe!important;
    box-shadow:none!important;
}
.modal-card .form-section{
    padding:14px!important;
    display:grid!important;
    gap:12px!important;
}
.call-history-list{
    gap:10px!important;
}
.call-row{
    padding:11px!important;
    grid-template-columns:minmax(0,1fr) 32px!important;
    gap:9px!important;
}
.call-row .icon-btn{
    width:32px!important;
    height:32px!important;
    min-height:32px!important;
    border-radius:10px!important;
}
.modal-actions-line{
    padding-top:2px!important;
    align-items:center!important;
}
.modal-card .metal-btn.full,
.modal-card .soft-btn.full,
.modal-card button.full{
    min-height:44px!important;
    border-radius:13px!important;
}
.history-modal-body{
    max-height:none!important;
}
.history-list{
    gap:9px!important;
}
.history-item{
    padding:11px 12px!important;
}
.modal-card::-webkit-scrollbar{
    width:9px!important;
    height:9px!important;
}
.modal-card::-webkit-scrollbar-track{
    background:#f3f6f9!important;
    border-radius:999px!important;
    margin:62px 0 14px!important;
}
.modal-card::-webkit-scrollbar-thumb{
    background:#c6d1dd!important;
    border:2px solid #f3f6f9!important;
    border-radius:999px!important;
}
.modal-card::-webkit-scrollbar-thumb:hover{
    background:#98a6b8!important;
}
.modal-card{
    scrollbar-width:thin!important;
    scrollbar-color:#c6d1dd #f3f6f9!important;
}
@media(max-width:760px){
    .modal{
        padding:12px!important;
        padding-top:calc(var(--topnav-height) + 12px)!important;
    }
    .modal.open{
        align-items:start!important;
        place-items:center!important;
    }
    .modal-card,
    .modal-card.wide,
    .modal-card.xl{
        width:100%!important;
        max-width:100%!important;
        max-height:calc(100dvh - var(--topnav-height) - 24px)!important;
        border-radius:18px!important;
    }
    .modal-card .modal-close,
    .modal-close{
        top:10px!important;
        width:32px!important;
        height:32px!important;
        min-width:32px!important;
        min-height:32px!important;
        margin:10px 10px -44px auto!important;
    }
    .modal-card h3{
        min-height:56px!important;
        padding:15px 58px 14px 16px!important;
        font-size:17px!important;
    }
    .modal-card > p,
    .modal-card > .history-modal-body,
    .modal-card > .call-history-form,
    .modal-card > .form-grid,
    .modal-card > .form-stack,
    .modal-card > form:not(.inline-assign){
        padding:14px!important;
    }
    .modal-card form.form-grid,
    .modal-card .form-grid.compact-inner,
    .review-grid,
    .call-row{
        grid-template-columns:1fr!important;
    }
    .call-row .icon-btn{
        width:100%!important;
    }
    .seller-action-buttons .icon-btn,
    .seller-action-buttons button.icon-btn{
        width:27px!important;
        height:27px!important;
        min-width:27px!important;
        min-height:27px!important;
        flex-basis:27px!important;
    }
}

/* v12: tighter CRM operation buttons + inner modal scroll alignment */
.crm-excel-table th:nth-child(8),
.crm-excel-table td:nth-child(8),
.crm-excel-table .operation-cell{
    width:146px!important;
    min-width:146px!important;
    max-width:146px!important;
}
.seller-action-stack{
    gap:5px!important;
}
.seller-action-select select,
.seller-action-select .inline-assign select,
.seller-name-badge{
    max-width:116px!important;
}
.seller-action-buttons{
    gap:2px!important;
    column-gap:2px!important;
    row-gap:2px!important;
    justify-content:flex-start!important;
}
.seller-action-buttons .icon-btn,
.seller-action-buttons button.icon-btn{
    width:26px!important;
    height:26px!important;
    min-width:26px!important;
    min-height:26px!important;
    flex:0 0 26px!important;
    border-radius:8px!important;
    box-shadow:0 3px 8px rgba(15,23,42,.055)!important;
}
.seller-action-buttons .crm-action-icon svg{
    width:13.5px!important;
    height:13.5px!important;
}
.cell-history-btn{
    width:23px!important;
    height:23px!important;
    min-width:23px!important;
    min-height:23px!important;
    border-radius:7px!important;
}
.cell-history-btn svg{
    width:12px!important;
    height:12px!important;
}
.latest-cell-line{
    grid-template-columns:minmax(0,1fr) 23px!important;
    gap:4px!important;
}

/* Keep scrollbars inside modal body, not on the outer rounded frame */
.modal-card,
.modal-card.wide,
.modal-card.xl{
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
    padding:0!important;
    box-sizing:border-box!important;
}
.modal-card .modal-close,
.modal-close{
    position:absolute!important;
    top:14px!important;
    right:14px!important;
    left:auto!important;
    margin:0!important;
    z-index:45!important;
}
.modal-card h3{
    position:relative!important;
    top:auto!important;
    flex:0 0 auto!important;
    z-index:25!important;
}
.modal-card > p,
.modal-card > .history-modal-body,
.modal-card > .call-history-form,
.modal-card > .form-grid,
.modal-card > .form-stack,
.modal-card > form:not(.inline-assign){
    flex:1 1 auto!important;
    min-height:0!important;
    max-height:calc(100dvh - 132px)!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    box-sizing:border-box!important;
    scrollbar-gutter:stable!important;
}
.modal-card > p::-webkit-scrollbar,
.modal-card > .history-modal-body::-webkit-scrollbar,
.modal-card > .call-history-form::-webkit-scrollbar,
.modal-card > .form-grid::-webkit-scrollbar,
.modal-card > .form-stack::-webkit-scrollbar,
.modal-card > form:not(.inline-assign)::-webkit-scrollbar{
    width:8px!important;
}
.modal-card > p::-webkit-scrollbar-track,
.modal-card > .history-modal-body::-webkit-scrollbar-track,
.modal-card > .call-history-form::-webkit-scrollbar-track,
.modal-card > .form-grid::-webkit-scrollbar-track,
.modal-card > .form-stack::-webkit-scrollbar-track,
.modal-card > form:not(.inline-assign)::-webkit-scrollbar-track{
    background:#f4f7fa!important;
    border-radius:999px!important;
    margin:8px 0!important;
}
.modal-card > p::-webkit-scrollbar-thumb,
.modal-card > .history-modal-body::-webkit-scrollbar-thumb,
.modal-card > .call-history-form::-webkit-scrollbar-thumb,
.modal-card > .form-grid::-webkit-scrollbar-thumb,
.modal-card > .form-stack::-webkit-scrollbar-thumb,
.modal-card > form:not(.inline-assign)::-webkit-scrollbar-thumb{
    background:#c8d3df!important;
    border:2px solid #f4f7fa!important;
    border-radius:999px!important;
}
.modal-card > p,
.modal-card > .history-modal-body,
.modal-card > .call-history-form,
.modal-card > .form-grid,
.modal-card > .form-stack,
.modal-card > form:not(.inline-assign){
    scrollbar-width:thin!important;
    scrollbar-color:#c8d3df #f4f7fa!important;
}
.modal-card::-webkit-scrollbar{
    width:0!important;
    height:0!important;
}
@media(max-width:760px){
    .seller-action-buttons{
        gap:2px!important;
    }
    .seller-action-buttons .icon-btn,
    .seller-action-buttons button.icon-btn{
        width:25px!important;
        height:25px!important;
        min-width:25px!important;
        min-height:25px!important;
        flex-basis:25px!important;
    }
    .modal-card .modal-close,
    .modal-close{
        top:10px!important;
        right:10px!important;
    }
    .modal-card > p,
    .modal-card > .history-modal-body,
    .modal-card > .call-history-form,
    .modal-card > .form-grid,
    .modal-card > .form-stack,
    .modal-card > form:not(.inline-assign){
        max-height:calc(100dvh - var(--topnav-height) - 92px)!important;
    }
}

.leads-live-table .lead-date-cell{width:128px;min-width:128px;white-space:nowrap;color:#475569;font-weight:650}
.leads-live-table tbody .lead-date-cell{font-size:12px;color:#64748b;font-weight:600}
