:root{
  --navy:#17365d;
  --navy-2:#0f2c4e;
  --blue:#2ea7e8;
  --blue-2:#1687d3;
  --ink:#182230;
  --muted:#7a8798;
  --line:#e8edf3;
  --soft:#f6f8fb;
  --soft-blue:#eef7fd;
  --green:#2ba66a;
  --red:#dd5b5b;
  --amber:#d8942d;
  --white:#fff;
  --shadow:0 12px 38px rgba(26,48,78,.08);
  --shadow-sm:0 8px 24px rgba(26,48,78,.06);
  --radius:20px;
  --radius-sm:14px;
  --sidebar:238px;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:#f8fafc;color:var(--ink);font-family:Poppins,Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
body{overflow-x:hidden}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
a{text-decoration:none;color:inherit}
.app-shell{display:flex;min-height:100vh;background:linear-gradient(180deg,#fbfdff 0,#f7f9fc 100%)}
.sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar);background:#fff;border-right:1px solid var(--line);padding:18px 14px;display:flex;flex-direction:column;z-index:40}
.brand-card{height:100px;border-radius:18px;background:var(--navy);display:flex;align-items:center;justify-content:center;padding:12px;overflow:hidden;box-shadow:0 8px 22px rgba(23,54,93,.16);margin-bottom:18px}
.brand-card img{width:100%;height:100%;object-fit:cover;object-position:center}
.side-nav{display:flex;flex-direction:column;gap:6px;overflow:auto;padding-right:2px}
.nav-button{width:100%;display:flex;align-items:center;gap:12px;padding:11px 12px;border:0;background:transparent;border-radius:12px;color:#566478;font-weight:600;font-size:13px;text-align:left;transition:.18s ease}
.nav-button:hover{background:#f7f9fc;color:var(--navy)}
.nav-button.active{background:var(--soft-blue);color:var(--navy);box-shadow:inset 3px 0 0 var(--blue)}
.nav-button svg{width:19px;height:19px;stroke-width:1.8;flex:0 0 auto}
.sidebar-footer{margin-top:auto;border:1px solid var(--line);border-radius:16px;padding:10px;display:flex;align-items:center;gap:10px;background:#fff}
.mini-avatar{width:34px;height:34px;border-radius:11px;background:linear-gradient(145deg,var(--navy),#244d7c);color:#fff;display:grid;place-items:center;font-size:11px;font-weight:800;letter-spacing:.3px;flex:0 0 auto}
.sidebar-user-copy{min-width:0;flex:1}.sidebar-user-copy strong{display:block;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sidebar-user-copy span{font-size:11px;color:var(--muted)}
.icon-button{border:0;background:transparent;width:38px;height:38px;border-radius:11px;display:grid;place-items:center;color:#617086;position:relative}.icon-button:hover{background:#f1f5f9;color:var(--navy)}
.icon-button svg{width:20px;height:20px}
.main-area{margin-left:var(--sidebar);width:calc(100% - var(--sidebar));min-height:100vh}
.topbar{height:72px;position:sticky;top:0;z-index:30;background:rgba(255,255,255,.92);backdrop-filter:blur(16px);border-bottom:1px solid rgba(232,237,243,.85);display:flex;align-items:center;justify-content:space-between;padding:0 28px}
.topbar-left,.topbar-actions{display:flex;align-items:center;gap:12px}.topbar-left{flex:1}
.global-search-wrap{width:min(520px,48vw);height:42px;border:1px solid var(--line);background:#f8fafc;border-radius:13px;display:flex;align-items:center;padding:0 12px;position:relative}.global-search-wrap input{border:0;outline:0;background:transparent;width:100%;padding:0 10px;color:var(--ink);font-size:13px}.global-search-wrap kbd{font-size:10px;color:#9aa7b6;background:#fff;border:1px solid #e6ebf1;padding:3px 6px;border-radius:6px}.search-icon{display:grid;place-items:center;color:#7d8a9c}.search-icon svg{width:17px;height:17px}.search-results{position:absolute;top:50px;left:0;right:0;background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);padding:8px;display:none;max-height:360px;overflow:auto}.search-results.show{display:block}.search-result{display:flex;align-items:center;gap:10px;padding:10px;border-radius:11px}.search-result:hover{background:#f7f9fc}.search-result-icon{width:34px;height:34px;border-radius:10px;background:var(--soft-blue);color:var(--blue-2);display:grid;place-items:center}.search-result strong{display:block;font-size:12px}.search-result span{font-size:11px;color:var(--muted)}
.quick-new{height:40px;border:0;background:var(--navy);color:#fff;border-radius:12px;padding:0 14px;font-weight:700;font-size:12px;display:flex;align-items:center;gap:8px;box-shadow:0 7px 18px rgba(23,54,93,.14)}.quick-new:hover{transform:translateY(-1px)}.quick-new svg{width:17px;height:17px}
.notification-button{background:#f7f9fc}.notification-badge{position:absolute;right:2px;top:1px;background:var(--blue);color:#fff;font-size:9px;min-width:16px;height:16px;border-radius:99px;display:grid;place-items:center;border:2px solid white}
.top-user{display:flex;align-items:center;gap:9px;padding-left:7px}.top-user strong,.top-user span{display:block}.top-user strong{font-size:12px}.top-user span{font-size:10px;color:var(--muted)}
.mobile-brand{display:none;font-weight:900;color:var(--navy);letter-spacing:1px}
.page{padding:28px;max-width:1600px;margin:0 auto}
.page-head{display:flex;justify-content:space-between;gap:20px;align-items:flex-end;margin-bottom:22px}.page-head h1{font-size:26px;margin:0 0 4px;letter-spacing:-.6px;color:#152337}.page-head p{margin:0;color:var(--muted);font-size:13px}.page-actions{display:flex;gap:9px;flex-wrap:wrap}
.btn{height:42px;border-radius:12px;border:1px solid var(--line);background:#fff;color:#344256;padding:0 14px;font-weight:700;font-size:12px;display:inline-flex;align-items:center;justify-content:center;gap:8px;transition:.16s}.btn:hover{transform:translateY(-1px);box-shadow:var(--shadow-sm)}.btn-primary{background:var(--navy);color:#fff;border-color:var(--navy)}.btn-blue{background:var(--blue);color:#fff;border-color:var(--blue)}.btn-ghost{background:#f7f9fc}.btn-danger{color:#b23b3b;background:#fff8f8;border-color:#f5dada}.btn-success{background:var(--green);color:white;border-color:var(--green)}.btn svg{width:17px;height:17px}
.grid{display:grid;gap:16px}.stats-grid{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:16px}.two-grid{grid-template-columns:1.55fr 1fr}.three-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-sm)}
.stat-card{padding:18px;display:flex;align-items:flex-start;gap:13px;min-height:116px}.stat-icon{width:43px;height:43px;border-radius:13px;background:var(--soft-blue);color:var(--blue-2);display:grid;place-items:center;flex:0 0 auto}.stat-icon svg{width:21px;height:21px}.stat-copy{flex:1}.stat-copy span{display:block;font-size:11px;color:var(--muted);font-weight:700}.stat-copy strong{display:block;font-size:25px;color:#16263a;line-height:1.15;margin:3px 0 4px}.stat-copy small{font-size:10px;color:#93a0af}.stat-trend{font-size:10px;font-weight:800;padding:5px 7px;border-radius:8px;background:#eff8f3;color:var(--green)}
.panel{padding:18px}.panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.panel-head h2{font-size:15px;margin:0;color:#1d2b3e}.panel-head a,.panel-link{font-size:11px;color:var(--blue-2);font-weight:800}.panel-sub{font-size:11px;color:var(--muted)}
.chart-wrap{height:260px;position:relative}.chart-wrap svg{width:100%;height:100%;overflow:visible}.chart-grid-line{stroke:#e9eef4;stroke-width:1}.chart-label{font-size:9px;fill:#93a0b1}.chart-line-income{fill:none;stroke:var(--blue);stroke-width:3;stroke-linecap:round;stroke-linejoin:round}.chart-line-expense{fill:none;stroke:#9aa8ba;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}.chart-area{fill:url(#incomeGradient);opacity:.3}
.activity-list,.job-list,.simple-list{display:flex;flex-direction:column}.activity-row,.job-row,.simple-row{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid #eef2f6}.activity-row:last-child,.job-row:last-child,.simple-row:last-child{border-bottom:0}.activity-dot{width:36px;height:36px;border-radius:11px;background:#f3f7fb;display:grid;place-items:center;color:var(--navy)}.activity-dot svg{width:17px;height:17px}.activity-main{flex:1;min-width:0}.activity-main strong,.job-row strong{display:block;font-size:12px;color:#233247}.activity-main span,.job-row span{font-size:10px;color:var(--muted)}.activity-time{font-size:10px;color:#9aa7b6;white-space:nowrap}.job-time{width:42px;font-size:11px;font-weight:800;color:var(--navy)}
.badge{display:inline-flex;align-items:center;gap:5px;min-height:23px;padding:0 8px;border-radius:8px;font-size:9px;font-weight:800;background:#f3f5f7;color:#687588}.badge.blue{background:#eef7fd;color:#147bc0}.badge.green{background:#ecf8f1;color:#278b5a}.badge.amber{background:#fff6e9;color:#b97817}.badge.red{background:#fff0f0;color:#b94b4b}
.quick-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:9px}.quick-action{border:1px solid var(--line);background:#fff;border-radius:14px;padding:14px 8px;text-align:center;color:#3a485a;font-size:10px;font-weight:800}.quick-action:hover{background:#f8fafc;border-color:#dbe6f0}.quick-action .qa-icon{width:34px;height:34px;border-radius:10px;background:var(--soft-blue);color:var(--blue-2);display:grid;place-items:center;margin:0 auto 8px}.qa-icon svg{width:18px;height:18px}
.toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;margin-bottom:14px}.toolbar-left,.toolbar-right{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.field,.select{height:40px;border:1px solid var(--line);background:#fff;border-radius:11px;padding:0 12px;outline:0;color:#344256;font-size:12px}.field:focus,.select:focus,textarea:focus{border-color:#9acff0;box-shadow:0 0 0 3px rgba(46,167,232,.10)}.search-field{min-width:260px}
.table-card{overflow:hidden}.table-wrap{overflow:auto}.data-table{width:100%;border-collapse:collapse;min-width:760px}.data-table th{text-align:left;padding:12px 16px;font-size:10px;color:#8b98a8;text-transform:uppercase;letter-spacing:.55px;background:#fafbfd;border-bottom:1px solid var(--line)}.data-table td{padding:14px 16px;border-bottom:1px solid #eff2f5;font-size:12px;color:#364459}.data-table tr:last-child td{border-bottom:0}.data-table tbody tr:hover{background:#fbfcfd}.entity-cell{display:flex;align-items:center;gap:10px}.entity-avatar{width:36px;height:36px;border-radius:11px;background:linear-gradient(145deg,#edf6fc,#f5f8fb);display:grid;place-items:center;color:var(--navy);font-weight:800;font-size:11px;border:1px solid #e5ecf3}.entity-cell strong{display:block;font-size:12px;color:#243347}.entity-cell span{font-size:10px;color:#8794a4}.money{font-weight:800;color:#1f3046}.money.positive{color:var(--green)}.money.negative{color:var(--red)}.row-actions{display:flex;gap:4px}.tiny-btn{width:32px;height:32px;border:0;border-radius:9px;background:#f7f9fb;color:#637186;display:grid;place-items:center}.tiny-btn:hover{background:#eef3f7;color:var(--navy)}.tiny-btn svg{width:15px;height:15px}
.customer-cards{display:none}.mobile-entity-card{padding:14px}.mobile-entity-top{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}.mobile-entity-top .entity-cell{flex:1}.mobile-card-metrics{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin-top:12px}.metric-box{background:#f8fafc;border-radius:11px;padding:9px}.metric-box span{display:block;color:var(--muted);font-size:9px}.metric-box strong{font-size:12px;color:#2b394c}
.empty-state{padding:52px 20px;text-align:center}.empty-icon{width:56px;height:56px;border-radius:18px;background:var(--soft-blue);display:grid;place-items:center;color:var(--blue-2);margin:0 auto 12px}.empty-icon svg{width:25px;height:25px}.empty-state h3{font-size:15px;margin:0 0 5px}.empty-state p{font-size:11px;color:var(--muted);max-width:360px;margin:0 auto 14px}
/* modal */
.modal-layer{position:fixed;inset:0;background:rgba(18,35,57,.34);backdrop-filter:blur(5px);z-index:100;display:none;align-items:center;justify-content:center;padding:20px}.modal-layer.open{display:flex}.modal{background:#fff;border-radius:22px;box-shadow:0 24px 70px rgba(20,38,62,.22);width:min(720px,100%);max-height:92vh;overflow:auto;border:1px solid rgba(255,255,255,.8)}.modal.wide{width:min(980px,100%)}.modal.quote-wizard{width:min(860px,100%);overflow:hidden}.modal-head{padding:17px 20px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;background:#fff;z-index:5}.modal-head h2{margin:0;font-size:17px}.modal-head p{margin:2px 0 0;font-size:10px;color:var(--muted)}.modal-body{padding:20px}.modal-foot{padding:14px 20px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;gap:9px;position:sticky;bottom:0;background:#fff;z-index:5}.close-btn{border:0;width:36px;height:36px;border-radius:11px;background:#f5f7fa;color:#667489;display:grid;place-items:center}.close-btn svg{width:17px;height:17px}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}.form-group{display:flex;flex-direction:column;gap:6px}.form-group.full{grid-column:1/-1}.form-group label{font-size:10px;font-weight:800;color:#5d6a7c}.form-group input,.form-group select,.form-group textarea{border:1px solid var(--line);border-radius:11px;padding:11px 12px;outline:0;color:#2d3a4b;background:#fff;font-size:12px}.form-group textarea{min-height:90px;resize:vertical}
/* quote wizard */
.wizard-top{padding:16px 20px 12px;border-bottom:1px solid var(--line);background:#fff}.wizard-title-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.wizard-title-row h2{margin:0;font-size:17px}.wizard-step-label{font-size:10px;font-weight:800;color:var(--blue-2)}.wizard-progress{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-top:12px}.wizard-bar{height:5px;border-radius:99px;background:#eaf0f4}.wizard-bar.active{background:var(--blue)}.wizard-content{padding:20px;max-height:66vh;overflow:auto;background:#fbfcfe}.wizard-foot{display:flex;justify-content:space-between;gap:10px;padding:13px 20px;border-top:1px solid var(--line);background:#fff}.wizard-section-title{font-size:12px;color:#2a384a;margin:0 0 10px}.customer-picker{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.picker-card{border:1px solid var(--line);border-radius:14px;background:#fff;padding:12px;display:flex;align-items:center;gap:10px;cursor:pointer}.picker-card:hover,.picker-card.selected{border-color:#8ac9ed;background:#f5fbff}.picker-card.selected{box-shadow:inset 0 0 0 1px var(--blue)}.picker-card strong{display:block;font-size:11px}.picker-card span{display:block;font-size:9px;color:var(--muted)}
.product-categories{display:flex;gap:7px;overflow:auto;padding-bottom:4px;margin-bottom:12px}.category-chip{height:31px;border:1px solid var(--line);background:#fff;border-radius:10px;padding:0 10px;white-space:nowrap;color:#647185;font-size:10px;font-weight:700}.category-chip.active{background:var(--navy);color:#fff;border-color:var(--navy)}.product-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.product-card{display:flex;align-items:center;gap:10px;background:#fff;border:1px solid var(--line);border-radius:14px;padding:11px}.product-icon{width:39px;height:39px;border-radius:11px;background:#f2f7fb;color:var(--navy);display:grid;place-items:center}.product-card-main{flex:1;min-width:0}.product-card strong{display:block;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.product-card span{display:block;font-size:9px;color:var(--muted);margin-top:2px}.add-product{width:32px;height:32px;border-radius:9px;border:0;background:var(--soft-blue);color:var(--blue-2);font-weight:900}.quote-lines{display:flex;flex-direction:column;gap:8px}.quote-line{display:grid;grid-template-columns:minmax(150px,1fr) 112px 104px 120px 112px 36px;gap:8px;align-items:end;background:#fff;border:1px solid var(--line);border-radius:13px;padding:10px}.quote-line strong{font-size:11px}.quote-line span{font-size:9px;color:var(--muted)}.quote-line label{display:block;font-size:8px;color:var(--muted);margin:0 0 4px}.unit-select{height:36px;border:1px solid var(--line);border-radius:10px;padding:0 8px;width:100%;background:#fff;color:var(--text);font-size:10px}.line-total-col{height:36px;border-radius:10px;background:#f7faff;border:1px solid #e2edf8;padding:4px 8px;display:flex;flex-direction:column;justify-content:center}.line-total-col span{font-size:7px;line-height:1}.line-total-col strong{font-size:10px;color:var(--navy);margin-top:2px;white-space:nowrap}.qty-control{display:flex;align-items:center;border:1px solid var(--line);border-radius:10px;overflow:hidden;height:36px}.qty-control button{width:30px;height:100%;border:0;background:#f8fafc;color:var(--navy)}.qty-control input{width:38px;border:0;text-align:center;outline:0;font-size:11px}.price-input{height:36px;border:1px solid var(--line);border-radius:10px;padding:0 9px;width:100%;font-size:11px}.quote-summary{margin-top:12px;margin-left:auto;width:min(340px,100%);background:#fff;border:1px solid var(--line);border-radius:14px;padding:12px}.summary-row{display:flex;justify-content:space-between;gap:14px;padding:5px 0;font-size:10px;color:#647185}.summary-row.total{font-size:13px;color:#1e2d41;font-weight:900;border-top:1px solid var(--line);margin-top:5px;padding-top:10px}.preview-sheet{background:#fff;border:1px solid #dfe7ee;border-radius:16px;padding:22px;max-width:720px;margin:0 auto;box-shadow:0 14px 30px rgba(20,40,65,.06)}.preview-brand{display:flex;justify-content:space-between;gap:15px;align-items:flex-start;border-bottom:2px solid var(--navy);padding-bottom:13px;margin-bottom:13px}.preview-logo{background:var(--navy);border-radius:10px;width:150px;height:62px;overflow:hidden}.preview-logo img{width:100%;height:100%;object-fit:cover}.preview-offer-meta{text-align:right;font-size:10px;color:#637185}.preview-offer-meta strong{display:block;color:var(--navy);font-size:14px}.preview-customer{display:flex;justify-content:space-between;gap:15px;background:#f8fafc;padding:12px;border-radius:12px;margin-bottom:12px;font-size:10px}.preview-table{width:100%;border-collapse:collapse}.preview-table th,.preview-table td{font-size:9px;text-align:left;padding:8px;border-bottom:1px solid #edf1f5}.preview-table th{color:#8491a0}.preview-table td:last-child,.preview-table th:last-child{text-align:right}
/* finance */
.finance-hero{display:grid;grid-template-columns:1.4fr .8fr .8fr;gap:14px;margin-bottom:16px}.finance-main{padding:20px;background:linear-gradient(145deg,#fff,#fbfdff)}.finance-main span,.finance-mini span{font-size:10px;color:var(--muted);font-weight:700}.finance-main strong{display:block;font-size:30px;color:var(--navy);margin-top:4px}.finance-mini{padding:18px}.finance-mini strong{display:block;font-size:20px;margin-top:5px}.finance-main small,.finance-mini small{color:#8b98a7;font-size:9px}
/* reports */
.report-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.report-card{padding:18px}.report-card h3{font-size:12px;margin:0 0 12px}.bar-list{display:flex;flex-direction:column;gap:10px}.bar-label{display:flex;justify-content:space-between;font-size:10px}.bar-track{height:8px;border-radius:99px;background:#edf1f5;overflow:hidden}.bar-fill{height:100%;background:linear-gradient(90deg,var(--navy),var(--blue));border-radius:99px}
/* settings */
.settings-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}.setting-card{padding:18px}.setting-card h3{margin:0 0 5px;font-size:13px}.setting-card p{font-size:10px;color:var(--muted);margin:0 0 14px}
/* toast */
.toast-layer{position:fixed;right:18px;bottom:18px;z-index:200;display:flex;flex-direction:column;gap:8px}.toast{background:#1c2c40;color:#fff;border-radius:12px;padding:11px 13px;box-shadow:0 16px 35px rgba(10,25,44,.22);font-size:11px;display:flex;align-items:center;gap:8px;animation:toastIn .22s ease}.toast.success{background:#1f6f4c}.toast.error{background:#9d4242}@keyframes toastIn{from{transform:translateY(10px);opacity:0}to{transform:none;opacity:1}}
.drawer-backdrop{display:none}.mobile-bottom-nav{display:none}.mobile-only{display:none}
.print-area{display:none}
@media(max-width:1200px){.stats-grid{grid-template-columns:repeat(2,1fr)}.two-grid{grid-template-columns:1fr}.report-grid{grid-template-columns:repeat(2,1fr)}.finance-hero{grid-template-columns:1fr 1fr}.finance-main{grid-column:1/-1}}
@media(max-width:920px){
  :root{--sidebar:260px}
  .sidebar{transform:translateX(-102%);transition:.22s ease;box-shadow:12px 0 40px rgba(18,34,53,.12)}.sidebar.open{transform:none}.drawer-backdrop{position:fixed;inset:0;background:rgba(26,41,61,.26);z-index:35}.drawer-backdrop.show{display:block}.main-area{margin-left:0;width:100%}.mobile-only{display:grid}.mobile-brand{display:block}.desktop-search,.desktop-only{display:none!important}.topbar{padding:0 14px;height:64px}.page{padding:18px 14px 92px}.mobile-bottom-nav{position:fixed;left:10px;right:10px;bottom:10px;height:64px;background:rgba(255,255,255,.96);border:1px solid var(--line);border-radius:18px;box-shadow:0 12px 36px rgba(24,42,66,.15);z-index:30;display:grid;grid-template-columns:repeat(5,1fr);padding:5px}.mobile-nav-btn{border:0;background:transparent;color:#8a97a7;border-radius:13px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:2px;font-size:8px;font-weight:800}.mobile-nav-btn svg{width:19px;height:19px}.mobile-nav-btn.active{color:var(--blue-2);background:#f0f8fd}.mobile-nav-btn.add{background:var(--navy);color:white;margin:-17px 5px 4px;border-radius:17px;box-shadow:0 8px 18px rgba(23,54,93,.18)}.mobile-nav-btn.add span{display:none}.quick-new{width:40px;padding:0;justify-content:center}.quick-new span{display:none}.page-head{align-items:flex-start}.page-head h1{font-size:22px}.form-grid{grid-template-columns:1fr}.form-group.full{grid-column:auto}.modal-layer{padding:0;align-items:flex-end}.modal{width:100%;max-height:94vh;border-radius:22px 22px 0 0}.modal.quote-wizard{height:100dvh;max-height:100dvh;border-radius:0;width:100%;display:flex;flex-direction:column}.wizard-content{flex:1;max-height:none;padding:15px 13px}.wizard-top{padding:14px 13px 11px}.wizard-foot{padding:10px 13px calc(10px + env(safe-area-inset-bottom));}.customer-picker,.product-list{grid-template-columns:1fr}.quote-line{grid-template-columns:1fr 82px 105px 32px}.toolbar{align-items:stretch}.toolbar-left,.toolbar-right{width:100%}.search-field{min-width:0;flex:1}.toolbar{flex-direction:column}.table-card .table-wrap{display:none}.customer-cards{display:grid;gap:10px}.preview-sheet{padding:14px}.preview-brand{align-items:center}.preview-logo{width:120px;height:50px}.settings-grid{grid-template-columns:1fr}
}
@media(max-width:620px){.stats-grid,.three-grid,.report-grid,.finance-hero{grid-template-columns:1fr}.stat-card{min-height:auto}.page-head{flex-direction:column}.page-actions{width:100%}.page-actions .btn{flex:1}.quick-grid{grid-template-columns:repeat(2,1fr)}.chart-wrap{height:220px}.quote-line{grid-template-columns:1fr 88px;align-items:end}.quote-line .quote-line-name{grid-column:1/2;grid-row:1}.quote-line .qty-col{grid-column:2/3;grid-row:1}.quote-line .unit-col{grid-column:1/2;grid-row:2}.quote-line .price-col{grid-column:2/3;grid-row:2}.quote-line .line-total-col{grid-column:1/2;grid-row:3}.quote-line .remove-col{grid-column:2/3;grid-row:3;align-self:center;justify-self:end}.qty-control button{width:26px}.qty-control input{width:34px}.quote-summary{width:100%}.preview-customer{flex-direction:column}.topbar-actions{gap:4px}.notification-button{display:none}.wizard-title-row h2{font-size:15px}}
@media print{
  body{background:white!important}.app-shell,.modal-layer,.toast-layer{display:none!important}.print-area{display:block!important;padding:0;color:#111;font-family:Arial,sans-serif}.print-doc{max-width:760px;margin:0 auto}.print-head{display:flex;justify-content:space-between;align-items:flex-start;border-bottom:3px solid #17365d;padding-bottom:16px}.print-logo-box{width:190px;height:82px;background:#17365d;border-radius:8px;overflow:hidden}.print-logo-box img{width:100%;height:100%;object-fit:cover}.print-meta{text-align:right;font-size:12px}.print-meta h1{margin:0 0 7px;color:#17365d}.print-customer{margin:18px 0;background:#f6f7f8;padding:14px;border-radius:8px;font-size:12px;display:flex;justify-content:space-between}.print-table{width:100%;border-collapse:collapse}.print-table th,.print-table td{border-bottom:1px solid #ddd;padding:10px;font-size:11px;text-align:left}.print-table th:last-child,.print-table td:last-child{text-align:right}.print-total{margin:16px 0 0 auto;width:310px}.print-total div{display:flex;justify-content:space-between;padding:6px 0;font-size:11px}.print-total .grand{border-top:2px solid #17365d;font-size:15px;font-weight:800;padding-top:10px}.print-notes{margin-top:25px;font-size:10px;color:#555;line-height:1.55}.print-sign{display:flex;justify-content:space-between;margin-top:55px;font-size:11px}.print-sign div{width:220px;text-align:center;border-top:1px solid #777;padding-top:8px}
}


/* Quote V1.2 - product/service search & smart line editor */
.quote-product-search{display:flex;gap:9px;align-items:center;margin-bottom:10px}.search-input-wrap{height:40px;display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:12px;background:#fff;padding:0 11px;flex:1}.search-input-wrap svg{width:17px;height:17px;color:#8795a6}.search-input-wrap input{border:0;outline:0;flex:1;min-width:0;font:inherit;color:var(--text);font-size:11px}.btn-soft{background:#f3f8fc;color:var(--navy);border-color:#dfebf4}.product-view-tabs{display:flex;gap:4px;background:#f5f8fb;border-radius:11px;padding:4px;margin-bottom:10px;width:max-content;max-width:100%;overflow:auto}.product-view-tabs button{border:0;background:transparent;border-radius:8px;height:28px;padding:0 10px;font-size:9px;font-weight:800;color:#7c8998;white-space:nowrap}.product-view-tabs button.active{background:#fff;color:var(--blue-2);box-shadow:0 2px 8px rgba(26,53,82,.07)}
.product-card{cursor:pointer;position:relative}.product-card:hover{border-color:#bdd7eb;box-shadow:0 7px 18px rgba(27,55,86,.06)}.product-card.out-of-stock{background:#fbfcfd}.product-card-main em{display:block;font-style:normal;font-size:8px;color:#8190a2;margin-top:4px}.product-card-main em.stock-zero{color:#d47749;font-weight:800}.favorite-product{width:27px;height:27px;border:0;background:transparent;color:#b4bfcb;font-size:18px;line-height:1;border-radius:8px}.favorite-product.active{color:#f0a62e}.favorite-product:hover{background:#f7f9fb}.custom-add-row{grid-column:1/-1;border:1px dashed #b8d1e5;background:#f8fcff;color:var(--blue-2);border-radius:13px;min-height:44px;font-size:10px;font-weight:800;display:flex;align-items:center;justify-content:center;gap:7px}.custom-add-row svg{width:16px;height:16px}
.no-product-state{grid-column:1/-1;min-height:220px;border:1px dashed #c8d8e5;border-radius:16px;background:#fbfdff;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px}.no-product-icon{width:44px;height:44px;border-radius:13px;background:#eff7fc;color:var(--blue-2);display:grid;place-items:center;margin-bottom:9px}.no-product-icon svg{width:20px;height:20px}.no-product-state strong{font-size:13px}.no-product-state span{font-size:9px;color:var(--muted);max-width:390px;line-height:1.55;margin:5px 0 13px}.selected-lines-mini{margin-top:12px;border:1px solid var(--line);border-radius:13px;background:#fff;display:flex;justify-content:flex-end;gap:28px;padding:10px 12px}.selected-lines-mini div{display:flex;flex-direction:column;align-items:flex-end}.selected-lines-mini span{font-size:8px;color:var(--muted)}.selected-lines-mini strong{font-size:11px;color:var(--navy);margin-top:2px}
.item-sheet-backdrop{position:absolute;inset:0;background:rgba(17,38,61,.30);backdrop-filter:blur(3px);z-index:20;display:flex;align-items:flex-end;justify-content:center}.item-sheet{background:#fff;border-radius:20px 20px 0 0;width:min(680px,100%);max-height:88%;overflow:auto;box-shadow:0 -18px 60px rgba(26,45,70,.18)}.item-sheet-head{position:sticky;top:0;background:#fff;z-index:2;padding:15px 18px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:flex-start}.item-sheet-head span{font-size:8px;color:var(--blue-2);font-weight:900;text-transform:uppercase;letter-spacing:.7px}.item-sheet-head h3{font-size:16px;margin:2px 0 0}.item-sheet-body{padding:16px 18px}.item-sheet-foot{position:sticky;bottom:0;background:#fff;border-top:1px solid var(--line);padding:12px 18px;display:flex;justify-content:flex-end;gap:8px}.item-kind-toggle{display:grid;grid-template-columns:1fr 1fr;background:#f3f6f9;border-radius:11px;padding:4px;margin-bottom:13px}.item-kind-toggle button{height:34px;border:0;background:transparent;border-radius:8px;font-size:10px;font-weight:900;color:#758396}.item-kind-toggle button.active{background:#fff;color:var(--blue-2);box-shadow:0 2px 8px rgba(23,49,77,.08)}.form-grid.compact{margin-bottom:12px}.selected-item-info{display:flex;gap:10px;align-items:center;border:1px solid var(--line);background:#fbfcfe;border-radius:13px;padding:10px;margin-bottom:13px}.selected-item-info>div{width:37px;height:37px;border-radius:10px;background:#eef6fb;color:var(--navy);display:grid;place-items:center}.selected-item-info svg{width:18px;height:18px}.selected-item-info p{margin:0}.selected-item-info strong{display:block;font-size:11px}.selected-item-info span{display:block;font-size:8px;color:var(--muted);margin-top:2px}
.pricing-mode-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}.pricing-mode-grid button{min-height:54px;border:1px solid var(--line);background:#fff;border-radius:11px;padding:7px;text-align:left;color:var(--text)}.pricing-mode-grid button strong{display:block;font-size:9px}.pricing-mode-grid button span{display:block;font-size:7px;color:var(--muted);margin-top:3px}.pricing-mode-grid button.active{border-color:#78bce8;background:#eef8fe;color:var(--blue-2)}.service-help{font-size:8px;color:#65778a;background:#f5f9fc;border:1px solid #e2edf4;border-radius:10px;padding:8px 10px;margin:9px 0 12px;line-height:1.5}.editor-total{height:54px;border-radius:13px;background:var(--navy);color:#fff;padding:9px 12px;display:flex;align-items:center;justify-content:space-between;margin-top:10px}.editor-total span{font-size:9px;color:#cbd9e8}.editor-total strong{font-size:17px}.catalog-save-option{display:flex;gap:9px;align-items:flex-start;border:1px solid var(--line);border-radius:12px;padding:10px;margin-top:10px;cursor:pointer}.catalog-save-option input{margin-top:2px}.catalog-save-option strong{display:block;font-size:9px}.catalog-save-option small{display:block;font-size:8px;color:var(--muted);margin-top:2px}.readonly-unit{height:36px;border:1px solid var(--line);border-radius:10px;background:#f8fafc;display:flex;align-items:center;padding:0 9px;font-size:10px;color:#526174;font-weight:800}.quote-line-name small{display:block;color:#8491a0;font-size:7px;line-height:1.4;margin-top:3px;max-width:390px}.fixed-service-line{grid-template-columns:minmax(190px,1fr) 112px 125px 112px 36px}.service-quantity-line{grid-template-columns:minmax(170px,1fr) 112px 100px 120px 112px 36px}.table-line-scope{display:block;font-weight:400;color:#7d8996;font-size:8px;line-height:1.35;margin-top:3px}


@media(max-width:760px){
  .quote-product-search{align-items:stretch}.quote-product-search .btn{width:42px;padding:0;font-size:0;display:grid;place-items:center}.quote-product-search .btn svg{width:18px;height:18px}.product-view-tabs{width:100%}.product-view-tabs button{flex:1}.product-card{padding:10px}.favorite-product{width:24px}.selected-lines-mini{justify-content:space-between;gap:10px}.selected-lines-mini div:first-child{align-items:flex-start}.pricing-mode-grid{grid-template-columns:repeat(2,1fr)}.pricing-mode-grid button:first-child{grid-column:1/-1}.item-sheet{max-height:91dvh}.item-sheet-body{padding:14px}.item-sheet-head,.item-sheet-foot{padding-left:14px;padding-right:14px}.fixed-service-line,.service-quantity-line{grid-template-columns:1fr 88px}.fixed-service-line .quote-line-name,.service-quantity-line .quote-line-name{grid-column:1/-1;grid-row:1}.fixed-service-line .service-mode-col{grid-column:1/2;grid-row:2}.fixed-service-line .price-col{grid-column:2/3;grid-row:2}.fixed-service-line .line-total-col{grid-column:1/2;grid-row:3}.fixed-service-line .remove-col{grid-column:2/3;grid-row:3;align-self:center;justify-self:end}.service-quantity-line .qty-col{grid-column:1/2;grid-row:2}.service-quantity-line .unit-col{grid-column:2/3;grid-row:2}.service-quantity-line .price-col{grid-column:1/2;grid-row:3}.service-quantity-line .line-total-col{grid-column:2/3;grid-row:3}.service-quantity-line .remove-col{grid-column:2/3;grid-row:4;justify-self:end}
}

/* V1.3 Product / Service catalog */
.catalog-stats{margin-bottom:16px}.danger-btn{color:#b94b4b}.danger-btn:hover{background:#fff2f2;border-color:#f2cece}.catalog-mobile-bottom{display:flex;align-items:center;justify-content:space-between;margin-top:10px;padding-top:9px;border-top:1px solid var(--line);font-size:9px;color:var(--muted)}.catalog-kind-toggle{display:grid;grid-template-columns:1fr 1fr;gap:4px;background:#f3f6f9;padding:4px;border-radius:12px;margin-bottom:14px}.catalog-kind-toggle button{height:38px;border:0;background:transparent;border-radius:9px;font-size:10px;font-weight:900;color:#7a8796}.catalog-kind-toggle button.active{background:#fff;color:var(--blue-2);box-shadow:0 2px 9px rgba(23,49,77,.08)}.catalog-fields-hidden{display:none!important}.catalog-check{display:flex!important;gap:9px;align-items:flex-start;border:1px solid var(--line);border-radius:11px;padding:10px;background:#fbfcfe;cursor:pointer}.catalog-check input{margin-top:2px}.catalog-check strong{display:block;font-size:9px}.catalog-check small{display:block;font-size:8px;color:var(--muted);margin-top:2px;line-height:1.4}
@media(max-width:760px){.catalog-stats{grid-template-columns:1fr 1fr}.catalog-stats .stat-card{min-height:102px}.catalog-mobile-card .mobile-card-metrics{grid-template-columns:1fr 1fr}.toolbar-left #catalogCategory{max-width:100%}}


/* ============================================================
   V1.4 FULL MOBILE / TABLET RESPONSIVE PASS
   ============================================================ */
.sidebar-version{font-size:9px;color:#9aa7b6;text-align:center;padding:6px 0 8px;letter-spacing:.2px}.mobile-search-button{display:none}.mobile-card-sub{font-size:10px;color:#8a97a6;margin-top:3px}.mobile-payment-total{margin-top:10px}.mobile-card-actions{display:flex;justify-content:flex-end;border-top:1px solid var(--line);padding-top:9px;margin-top:10px}.mobile-card-actions .btn{height:36px;font-size:10px;padding:0 12px}.mobile-card-actions .btn svg{width:15px;height:15px}
.mobile-search-overlay{display:none;position:fixed;inset:0;z-index:150;background:rgba(21,38,59,.28);backdrop-filter:blur(5px)}.mobile-search-overlay.show{display:block}.mobile-search-panel{background:#fff;min-height:100dvh;width:100%;padding:calc(12px + env(safe-area-inset-top)) 14px calc(20px + env(safe-area-inset-bottom))}.mobile-search-head{display:flex;gap:8px;align-items:center}.mobile-search-field{height:46px;flex:1;border:1px solid var(--line);background:#f8fafc;border-radius:14px;display:flex;align-items:center;padding:0 12px;gap:8px}.mobile-search-field svg{width:18px;height:18px;color:#7c8b9d}.mobile-search-field input{border:0;background:transparent;outline:0;min-width:0;flex:1;font-size:13px;color:var(--ink)}.mobile-search-results{margin-top:12px;display:flex;flex-direction:column;gap:6px}.mobile-search-result{width:100%;border:0;background:#fff;border-bottom:1px solid var(--line);display:grid;grid-template-columns:40px minmax(0,1fr) 18px;align-items:center;gap:10px;padding:10px 4px;text-align:left;color:var(--ink)}.mobile-search-result strong{font-size:12px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-search-result small{font-size:10px;color:var(--muted);display:block;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-search-result>svg{width:16px;height:16px;color:#9da9b5}.mobile-search-empty{text-align:center;color:var(--muted);font-size:11px;padding:34px 12px}
@media(max-width:1200px){.three-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.calendar-page .three-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:1100px){
  :root{--sidebar:270px}.sidebar{transform:translateX(-102%);transition:.22s ease;box-shadow:12px 0 40px rgba(18,34,53,.12)}.sidebar.open{transform:none}.drawer-backdrop{position:fixed;inset:0;background:rgba(26,41,61,.26);z-index:35}.drawer-backdrop.show{display:block}.main-area{margin-left:0;width:100%}.mobile-only,.mobile-search-button{display:grid}.mobile-brand{display:block}.desktop-search,.desktop-only{display:none!important}.topbar{padding:0 16px;height:64px}.page{padding:20px 16px 94px;max-width:100%}
  .mobile-bottom-nav{position:fixed;left:10px;right:10px;bottom:calc(8px + env(safe-area-inset-bottom));height:64px;background:rgba(255,255,255,.97);backdrop-filter:blur(16px);border:1px solid var(--line);border-radius:18px;box-shadow:0 12px 36px rgba(24,42,66,.15);z-index:30;display:grid;grid-template-columns:repeat(5,1fr);padding:5px}.mobile-nav-btn{border:0;background:transparent;color:#8a97a7;border-radius:13px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:2px;font-size:8px;font-weight:800;min-width:0}.mobile-nav-btn span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.mobile-nav-btn svg{width:19px;height:19px}.mobile-nav-btn.active{color:var(--blue-2);background:#f0f8fd}.mobile-nav-btn.add{background:var(--navy);color:#fff;margin:-17px 5px 4px;border-radius:17px;box-shadow:0 8px 18px rgba(23,54,93,.18)}.mobile-nav-btn.add span{display:none}
  .quick-new{width:40px;padding:0;justify-content:center}.quick-new span{display:none}.page-head{align-items:flex-start}.page-head h1{font-size:23px}.page-head p{line-height:1.5}.form-grid{grid-template-columns:1fr}.form-group.full{grid-column:auto}.modal-layer{padding:0;align-items:flex-end}.modal{width:100%;max-height:94dvh;border-radius:22px 22px 0 0}.modal.quote-wizard{height:100dvh;max-height:100dvh;border-radius:0;width:100%;display:flex;flex-direction:column}.wizard-content{flex:1;max-height:none;padding:15px 13px}.wizard-top{padding:14px 13px 11px}.wizard-foot{padding:10px 13px calc(10px + env(safe-area-inset-bottom))}.customer-picker,.product-list{grid-template-columns:1fr}
  .toolbar{align-items:stretch;flex-direction:column}.toolbar-left,.toolbar-right{width:100%}.toolbar-left{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.toolbar-left .search-field{grid-column:1/-1;width:100%;min-width:0}.toolbar-left select{min-width:0;max-width:100%}.toolbar-right{justify-content:flex-start}.table-card .table-wrap{display:none}.customer-cards{display:grid;gap:10px;padding:10px;background:transparent}.preview-sheet{padding:14px;overflow-x:auto}.preview-table{min-width:600px}.preview-brand{align-items:center}.preview-logo{width:120px;height:50px}.settings-grid{grid-template-columns:1fr}.finance-hero{grid-template-columns:1fr 1fr}.finance-main{grid-column:1/-1}.toast-layer{left:14px;right:14px;bottom:calc(84px + env(safe-area-inset-bottom))}.toast{width:100%;justify-content:center}
}
@media(min-width:921px) and (max-width:1100px){.mobile-bottom-nav{display:grid}.mobile-only,.mobile-search-button{display:grid}.mobile-brand{display:block}}
@media(max-width:760px){
  .page{padding:16px 12px 92px}.topbar{padding:0 10px}.topbar-actions{gap:3px}.mobile-brand{font-size:13px}.page-head{margin-bottom:15px;flex-direction:column}.page-head h1{font-size:21px}.page-head p{font-size:11px}.page-actions{width:100%;display:grid;grid-template-columns:1fr 1fr}.page-actions .btn{width:100%;min-width:0;padding:0 9px}.page-actions .btn:only-child{grid-column:1/-1}
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.stat-card{padding:13px;min-height:100px;gap:9px}.stat-icon{width:37px;height:37px;border-radius:11px}.stat-copy strong{font-size:20px}.stat-copy span{font-size:9px}.stat-copy small{font-size:8px}.two-grid,.three-grid,.report-grid,.finance-hero{grid-template-columns:1fr}.finance-main{grid-column:auto}.finance-main strong{font-size:26px}.panel{padding:14px}.panel-head{margin-bottom:11px}.job-row{grid-template-columns:54px minmax(0,1fr);padding:10px 0}.job-row>div{min-width:0}.job-row strong,.job-row span{white-space:normal;overflow-wrap:anywhere}.job-time{font-size:10px}
  .toolbar-left{grid-template-columns:1fr}.toolbar-left .search-field{grid-column:auto}.toolbar-left select,.select,.field{width:100%;max-width:100%}.mobile-entity-card{padding:13px}.mobile-entity-top{gap:10px}.mobile-card-metrics{grid-template-columns:1fr 1fr;gap:8px}.metric-box{min-width:0}.metric-box strong{overflow-wrap:anywhere;font-size:10px}.customer-cards{padding:8px;gap:8px}.catalog-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.catalog-mobile-card .mobile-card-metrics{grid-template-columns:1fr 1fr}.quick-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.chart-wrap{height:205px;overflow:hidden}.chart-wrap svg{width:100%;min-width:0}.report-card,.setting-card{padding:14px}.modal:not(.quote-wizard){max-height:96dvh;border-radius:20px 20px 0 0}.modal-head,.modal-body,.modal-foot{padding-left:14px;padding-right:14px}.modal-foot{padding-bottom:calc(12px + env(safe-area-inset-bottom));display:grid;grid-template-columns:1fr 1fr}.modal-foot .btn{width:100%}.preview-customer{flex-direction:column}.quote-summary{width:100%}.pricing-mode-grid{grid-template-columns:1fr 1fr}.pricing-mode-grid button:first-child{grid-column:1/-1}
}
@media(max-width:430px){.stats-grid{grid-template-columns:1fr 1fr}.stat-card{display:block}.stat-icon{margin-bottom:8px}.stat-trend{display:inline-block;margin-top:6px}.page-actions{grid-template-columns:1fr}.page-actions .btn{grid-column:auto!important}.mobile-card-metrics{grid-template-columns:1fr}.catalog-mobile-card .mobile-card-metrics{grid-template-columns:1fr 1fr}.mobile-bottom-nav{left:6px;right:6px}.mobile-nav-btn{font-size:7px}.mobile-nav-btn svg{width:18px;height:18px}.preview-logo{width:105px;height:44px}.preview-offer-meta{font-size:8px}.preview-offer-meta strong{font-size:11px}.selected-lines-mini{flex-direction:column;gap:6px}.selected-lines-mini div,.selected-lines-mini div:first-child{align-items:flex-start}}
@media(max-width:350px){.stats-grid,.catalog-stats{grid-template-columns:1fr}.mobile-brand{display:none}.quick-new{display:none}}


/* ================================================================
   V1.5 - PHONE FIT FIX
   Son katman: eski responsive kuralları bilinçli olarak override eder.
   Hedefler: 320 / 360 / 375 / 390 / 412 / 430 px + tablet.
   ================================================================ */

html{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
  -webkit-text-size-adjust:100%;
}
body,.app-shell,.main-area,#page{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
}
body{min-width:0}
img,svg,canvas{max-width:100%}
.grid,.card,.panel,.page,.page-head,.page-actions,.toolbar,.toolbar-left,.toolbar-right,
.customer-cards,.mobile-entity-card,.stat-card,.report-card,.setting-card,.finance-card,
.quote-lines,.quote-line,.picker-card,.product-card,.product-card-main,.entity-cell,
.entity-cell>div,.mobile-entity-top,.mobile-entity-top>div,.activity-row,.job-row{
  min-width:0;
}
button,.btn,.icon-button,.tiny-btn,.mobile-nav-btn{
  -webkit-tap-highlight-color:transparent;
}
input,select,textarea{max-width:100%;min-width:0}

/* Tablet and phone always use full content width. */
@media(max-width:1100px){
  .main-area{margin-left:0!important;width:100%!important}
  .page{width:100%!important;max-width:100%!important;margin:0!important}
}

/* PHONE */
@media(max-width:760px){

  html,body{overflow-x:hidden!important}
  body{padding:0!important}
  .app-shell{min-height:100dvh!important}

  /* top bar */
  .topbar{
    width:100%!important;
    height:58px!important;
    min-height:58px!important;
    padding-left:max(8px,env(safe-area-inset-left))!important;
    padding-right:max(8px,env(safe-area-inset-right))!important;
    gap:4px!important;
  }
  .topbar-left{min-width:0!important;gap:4px!important;overflow:hidden}
  .topbar-actions{flex:0 0 auto!important;gap:2px!important;min-width:0}
  .mobile-brand{
    font-size:12px!important;
    letter-spacing:.4px!important;
    max-width:82px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  .icon-button{
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    padding:0!important;
  }
  .quick-new{
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    padding:0!important;
  }
  .notification-button{display:none!important}

  /* body / page */
  .page{
    padding:14px 10px calc(94px + env(safe-area-inset-bottom))!important;
  }
  .page-head{
    width:100%!important;
    gap:11px!important;
    margin-bottom:14px!important;
    align-items:stretch!important;
  }
  .page-head>div:first-child{min-width:0}
  .page-head h1{
    font-size:20px!important;
    line-height:1.2!important;
    letter-spacing:-.25px!important;
    overflow-wrap:anywhere!important;
  }
  .page-head p{
    font-size:10px!important;
    line-height:1.5!important;
    overflow-wrap:anywhere!important;
  }

  /* All page buttons stay inside viewport */
  .page-actions{
    width:100%!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:7px!important;
  }
  .page-actions .btn,
  .toolbar .btn,
  .modal-foot .btn,
  .wizard-foot .btn,
  .item-sheet-foot .btn{
    max-width:100%!important;
    min-width:0!important;
    min-height:44px!important;
    height:auto!important;
    padding:9px 9px!important;
    white-space:normal!important;
    line-height:1.15!important;
    text-align:center!important;
    overflow-wrap:anywhere!important;
  }
  .btn svg{flex:0 0 auto}

  /* main statistic/dashboard grids */
  .stats-grid{
    width:100%!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
  }
  .stat-card{
    width:100%!important;
    min-height:104px!important;
    padding:11px!important;
    gap:8px!important;
    overflow:hidden!important;
  }
  .stat-copy{min-width:0!important}
  .stat-copy strong{
    font-size:18px!important;
    overflow-wrap:anywhere!important;
  }
  .stat-copy span,.stat-copy small{
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }

  .two-grid,.three-grid,.report-grid,.settings-grid,.finance-hero{
    width:100%!important;
    grid-template-columns:1fr!important;
    gap:10px!important;
  }
  .panel,.report-card,.setting-card{width:100%!important;padding:12px!important}

  /* quick actions */
  .quick-grid{
    width:100%!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:7px!important;
  }
  .quick-action,.quick-tile{
    min-width:0!important;
    width:100%!important;
    overflow:hidden!important;
  }

  /* cards/list */
  .customer-cards{
    width:100%!important;
    padding:0!important;
    gap:8px!important;
  }
  .mobile-entity-card{
    width:100%!important;
    max-width:100%!important;
    padding:11px!important;
    overflow:hidden!important;
  }
  .mobile-entity-top{
    width:100%!important;
    align-items:flex-start!important;
    flex-wrap:wrap!important;
  }
  .entity-cell{min-width:0!important;max-width:100%!important}
  .entity-cell>div:last-child{min-width:0!important}
  .entity-cell strong,.entity-cell span{
    max-width:100%!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
  .mobile-card-metrics,
  .catalog-mobile-card .mobile-card-metrics{
    width:100%!important;
    grid-template-columns:1fr 1fr!important;
    gap:6px!important;
  }
  .metric-box{
    width:100%!important;
    min-width:0!important;
    padding:8px!important;
  }
  .metric-box span,.metric-box strong{
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
  .row-actions{
    display:flex!important;
    flex-wrap:wrap!important;
    justify-content:flex-end!important;
    gap:5px!important;
  }

  /* toolbar */
  .toolbar{
    width:100%!important;
    padding:10px!important;
    gap:8px!important;
  }
  .toolbar-left{
    width:100%!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:7px!important;
  }
  .toolbar-left .search-field,
  .toolbar-left select,
  .toolbar-left .select{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  .toolbar-right{width:100%!important;justify-content:flex-start!important}

  /* calendar / jobs */
  .calendar-page,.calendar-page .grid{width:100%!important;max-width:100%!important}
  .calendar-page .three-grid{grid-template-columns:1fr!important}
  .job-row{
    width:100%!important;
    grid-template-columns:46px minmax(0,1fr)!important;
    gap:8px!important;
  }
  .job-row>*{min-width:0!important}
  .job-row strong,.job-row span{
    display:block!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }

  /* finance / reports / charts */
  .finance-main{grid-column:auto!important}
  .chart-wrap{width:100%!important;max-width:100%!important;overflow:hidden!important}
  .chart-wrap svg,.chart-wrap canvas{width:100%!important;max-width:100%!important}
  .report-grid{grid-template-columns:1fr!important}

  /* modal system */
  .modal-layer{
    width:100vw!important;
    max-width:100vw!important;
    padding:0!important;
    overflow:hidden!important;
  }
  .modal{
    width:100vw!important;
    max-width:100vw!important;
    max-height:96dvh!important;
    margin:0!important;
    border-left:0!important;
    border-right:0!important;
    border-radius:20px 20px 0 0!important;
    overflow-x:hidden!important;
  }
  .modal.wide{width:100vw!important;max-width:100vw!important}
  .modal-head,.modal-body,.modal-foot{
    width:100%!important;
    max-width:100%!important;
    overflow-x:hidden!important;
  }
  .modal-body{padding:13px 10px!important}
  .modal-head{padding:12px 10px!important}
  .modal-foot{
    padding:9px 10px calc(10px + env(safe-area-inset-bottom))!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:7px!important;
  }

  /* quote wizard full viewport */
  .modal.quote-wizard{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    max-width:100vw!important;
    height:100dvh!important;
    max-height:100dvh!important;
    border-radius:0!important;
  }
  .wizard-top{
    flex:0 0 auto!important;
    padding:10px 10px 8px!important;
  }
  .wizard-content{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    flex:1 1 auto!important;
    padding:11px 9px!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }
  .wizard-foot{
    flex:0 0 auto!important;
    width:100%!important;
    padding:8px 9px calc(9px + env(safe-area-inset-bottom))!important;
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:7px!important;
  }
  .wizard-title-row h2{font-size:15px!important}
  .wizard-step-label{font-size:9px!important}
  .wizard-progress{gap:4px!important}

  .customer-picker,.product-list{grid-template-columns:1fr!important;width:100%!important}
  .picker-card,.product-card{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }
  .product-card strong{
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }

  /* product search row */
  .quote-product-search{
    width:100%!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 44px!important;
    gap:6px!important;
  }
  .search-input-wrap{width:100%!important;min-width:0!important}
  .quote-product-search .btn{
    width:44px!important;
    min-width:44px!important;
    max-width:44px!important;
    min-height:40px!important;
    padding:0!important;
  }
  .product-view-tabs{
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
  }
  .product-view-tabs button{
    min-width:max-content!important;
    flex:0 0 auto!important;
  }
  .product-categories{
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
  }

  /* quote line editor */
  .quote-lines{width:100%!important;max-width:100%!important}
  .quote-line,
  .fixed-service-line,
  .service-quantity-line{
    width:100%!important;
    max-width:100%!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 90px!important;
    gap:7px!important;
    padding:9px!important;
    overflow:hidden!important;
  }
  .quote-line-name{
    min-width:0!important;
    grid-column:1/-1!important;
    grid-row:auto!important;
  }
  .quote-line-name strong,.quote-line-name span,.quote-line-name small{
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
  .quote-line .qty-col,
  .service-quantity-line .qty-col{
    grid-column:1/2!important;
    grid-row:auto!important;
  }
  .quote-line .unit-col,
  .service-quantity-line .unit-col{
    grid-column:2/3!important;
    grid-row:auto!important;
  }
  .quote-line .price-col,
  .fixed-service-line .price-col{
    grid-column:1/2!important;
    grid-row:auto!important;
  }
  .fixed-service-line .service-mode-col{
    grid-column:2/3!important;
    grid-row:auto!important;
  }
  .quote-line .line-total-col,
  .fixed-service-line .line-total-col,
  .service-quantity-line .line-total-col{
    grid-column:1/2!important;
    grid-row:auto!important;
  }
  .quote-line .remove-col,
  .fixed-service-line .remove-col,
  .service-quantity-line .remove-col{
    grid-column:2/3!important;
    grid-row:auto!important;
    align-self:center!important;
    justify-self:end!important;
  }
  .unit-select,.price-input,.readonly-unit{width:100%!important;min-width:0!important}
  .qty-control{width:100%!important;min-width:0!important}
  .qty-control button{width:28px!important;min-width:28px!important}
  .qty-control input{width:34px!important;min-width:0!important}
  .quote-summary{width:100%!important;max-width:100%!important}

  /* item add bottom sheet */
  .item-sheet-backdrop{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:100dvh!important;
    z-index:80!important;
  }
  .item-sheet{
    width:100vw!important;
    max-width:100vw!important;
    max-height:94dvh!important;
    border-radius:20px 20px 0 0!important;
    overflow-x:hidden!important;
  }
  .item-sheet-head,.item-sheet-body,.item-sheet-foot{
    width:100%!important;
    max-width:100%!important;
  }
  .item-sheet-head{padding:11px 10px!important}
  .item-sheet-body{padding:11px 10px!important}
  .item-sheet-foot{
    padding:8px 10px calc(9px + env(safe-area-inset-bottom))!important;
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:7px!important;
  }
  .pricing-mode-grid{
    width:100%!important;
    grid-template-columns:1fr 1fr!important;
  }
  .pricing-mode-grid button:first-child{grid-column:1/-1!important}

  /* forms: prevent iOS zoom and clipping */
  .form-grid{grid-template-columns:1fr!important;width:100%!important;gap:10px!important}
  .form-group{width:100%!important;min-width:0!important}
  .form-group input,.form-group select,.form-group textarea,
  .field,.select,.search-field{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    font-size:16px!important;
  }

  /* OFFER PREVIEW: mobile cards instead of 600px table */
  .preview-sheet{
    width:100%!important;
    max-width:100%!important;
    padding:11px!important;
    overflow:hidden!important;
  }
  .preview-brand{
    width:100%!important;
    gap:8px!important;
    align-items:flex-start!important;
  }
  .preview-logo{width:98px!important;height:42px!important;flex:0 0 auto!important}
  .preview-offer-meta{min-width:0!important;font-size:8px!important}
  .preview-customer{
    width:100%!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
  }
  .preview-table{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    border:0!important;
  }
  .preview-table thead{display:none!important}
  .preview-table tbody{
    display:flex!important;
    width:100%!important;
    flex-direction:column!important;
    gap:8px!important;
  }
  .preview-table tr:not(.preview-empty-row){
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    width:100%!important;
    border:1px solid var(--line)!important;
    border-radius:11px!important;
    padding:9px!important;
    background:#fbfcfe!important;
    gap:6px 10px!important;
  }
  .preview-table td{
    display:flex!important;
    min-width:0!important;
    padding:0!important;
    border:0!important;
    flex-direction:column!important;
    align-items:flex-start!important;
    text-align:left!important;
    font-size:9px!important;
    overflow-wrap:anywhere!important;
  }
  .preview-table td:first-child{grid-column:1/-1!important}
  .preview-table td::before{
    content:attr(data-label);
    display:block;
    margin-bottom:2px;
    color:#8794a4;
    font-size:7px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.3px;
  }
  .preview-table td:last-child{
    color:var(--navy)!important;
    font-weight:900!important;
  }
  .preview-empty-row{display:block!important}
  .preview-empty-row td{display:block!important;padding:10px!important}

  /* bottom nav: never outside viewport */
  .mobile-bottom-nav{
    left:max(6px,env(safe-area-inset-left))!important;
    right:max(6px,env(safe-area-inset-right))!important;
    bottom:max(6px,env(safe-area-inset-bottom))!important;
    width:auto!important;
    max-width:none!important;
    height:62px!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:1px!important;
    padding:4px!important;
    border-radius:16px!important;
  }
  .mobile-nav-btn{
    width:100%!important;
    min-width:0!important;
    padding:3px 1px!important;
    font-size:7px!important;
    overflow:hidden!important;
  }
  .mobile-nav-btn span{
    width:100%!important;
    max-width:100%!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  .mobile-nav-btn.add{
    min-width:0!important;
    margin:-14px 2px 3px!important;
  }
}

/* Narrow phones */
@media(max-width:480px){
  .page-actions{grid-template-columns:1fr!important}
  .page-actions .btn{grid-column:auto!important}
  .mobile-brand{max-width:65px!important}
}

/* 390-class phones */
@media(max-width:410px){
  .page{padding-left:8px!important;padding-right:8px!important}
  .stats-grid{gap:7px!important}
  .stat-card{padding:10px!important}
  .stat-icon{width:34px!important;height:34px!important}
  .stat-copy strong{font-size:17px!important}
  .catalog-mobile-card .mobile-card-metrics{grid-template-columns:1fr!important}
  .mobile-card-metrics{grid-template-columns:1fr!important}
  .modal-foot{grid-template-columns:1fr 1fr!important}
}

/* 360 and smaller */
@media(max-width:360px){
  .stats-grid,.catalog-stats{grid-template-columns:1fr!important}
  .mobile-brand{display:none!important}
  .topbar-actions{margin-left:auto!important}
  .quick-new{display:grid!important}
  .quote-line,.fixed-service-line,.service-quantity-line{
    grid-template-columns:minmax(0,1fr) 82px!important;
  }
  .modal-foot{
    grid-template-columns:1fr!important;
    max-height:190px!important;
    overflow-y:auto!important;
  }
  .item-sheet-foot{grid-template-columns:1fr 1fr!important}
}

/* Very narrow Android devices */
@media(max-width:330px){
  .topbar{padding-left:5px!important;padding-right:5px!important}
  .mobile-search-button{display:none!important}
  .stats-grid,.catalog-stats{grid-template-columns:1fr!important}
  .mobile-nav-btn span{font-size:6px!important}
}


/* V1.5.1 - NEVXUP software credit */
.main-area{display:flex;flex-direction:column;min-height:100vh}
.page{flex:1 0 auto;width:100%}
.nevxup-credit{
  flex:0 0 auto;
  width:100%;
  padding:16px 24px 22px;
  text-align:center;
  color:#8b98a8;
  font-size:10px;
  letter-spacing:.15px;
}
.nevxup-credit a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  color:#8b98a8;
  text-decoration:none;
  transition:color .18s ease,transform .18s ease;
}
.nevxup-credit a:hover{color:#17365d;transform:translateY(-1px)}
.nevxup-credit strong{color:#17365d;font-weight:800;letter-spacing:.45px}
@media(max-width:1100px){
  .main-area{min-height:100dvh}
  .nevxup-credit{
    padding:10px 12px calc(88px + env(safe-area-inset-bottom));
    font-size:9px;
  }
}
@media(max-width:430px){
  .nevxup-credit{padding-left:8px;padding-right:8px}
}
@media print{.nevxup-credit{display:none!important}}


/* V1.6 - Automatic category and product/service codes */
.field-note{display:block;margin-top:5px;color:#8a97a6;font-size:8px;line-height:1.4}
.auto-code-box{margin-top:-1px}
.auto-code-preview{height:52px;border:1px solid #dfeaf3;background:#f7fbfe;border-radius:12px;padding:8px 11px;display:flex;flex-direction:column;justify-content:center}
.auto-code-preview span{font-size:15px;font-weight:800;color:var(--navy);letter-spacing:.6px}
.auto-code-preview small{font-size:8px;color:#8392a3;margin-top:2px}
.auto-code-note{border:1px solid #deebf4;background:#f7fbfe;border-radius:10px;padding:9px 10px;font-size:8px;color:#62758a;display:flex;gap:7px;align-items:center;line-height:1.45}
.auto-code-note svg{width:16px;height:16px;color:var(--blue-2);flex:0 0 auto}
.category-create-box{display:grid;grid-template-columns:minmax(0,1fr) 90px auto;gap:8px;align-items:end;margin-bottom:14px;padding:12px;border:1px solid var(--line);border-radius:14px;background:#fbfcfe}
.category-code-live{height:38px;border:1px solid var(--line);border-radius:10px;background:#fff;padding:5px 8px;display:flex;flex-direction:column;justify-content:center}
.category-code-live span{font-size:7px;color:var(--muted);line-height:1}
.category-code-live strong{font-size:11px;color:var(--navy);margin-top:3px}
.category-manager-list{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:13px;overflow:hidden}
.category-manager-row{min-height:48px;padding:9px 11px;display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid var(--line);background:#fff}
.category-manager-row:last-child{border-bottom:0}
.category-manager-row strong{display:block;font-size:10px}
.category-manager-row span{display:block;font-size:8px;color:var(--muted);margin-top:2px}
.category-prefix{min-width:56px;border-radius:9px;background:#edf7fd;color:var(--blue-2);font-size:10px;font-weight:900;text-align:center;padding:7px 8px;letter-spacing:.5px}
@media(max-width:760px){
  .category-create-box{grid-template-columns:minmax(0,1fr) 72px}
  .category-create-box .btn{grid-column:1/-1;width:100%}
}
