
:root{
  --orange:#f36c21;
  --orange-dark:#c94e0d;
  --bg:#f4f6f8;
  --panel:#ffffff;
  --text:#1d2733;
  --muted:#687481;
  --line:#d8dee5;
  --line-soft:#e8edf1;
  --good:#16794f;
  --bad:#b42332;
  --shadow:0 1px 2px rgba(16,24,40,.04);
  --radius:12px;
  --field-h:42px;
}
*{box-sizing:border-box}
html{background:var(--bg)}
body{margin:0;background:var(--bg);color:var(--text);font:14px/1.45 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
button,input,select,textarea{font:inherit}
button{min-height:38px;background:#fff;color:var(--text);border:1px solid #cbd4dc;border-radius:8px;padding:8px 13px;cursor:pointer;white-space:nowrap}
button:hover{background:#f6f8fa;border-color:#aeb9c3}
button.primary{background:var(--orange);border-color:var(--orange);color:#fff;font-weight:750}
button.primary:hover{background:var(--orange-dark)}
button.danger{color:var(--bad);background:#fff5f6;border-color:#e5aeb5}
a{color:#a64008}
h1,h2,h3,p{margin-top:0}
h1{font-size:27px;line-height:1.15}
h2{font-size:17px;line-height:1.25;margin-bottom:7px}
h3{font-size:15px}
small,.subtle{color:var(--muted)}

.login-shell{min-height:100vh;display:grid;place-items:center;padding:24px}
.login-card{width:min(430px,100%);background:#fff;border:1px solid var(--line);border-radius:16px;padding:30px;box-shadow:0 12px 40px rgba(16,24,40,.08)}
.login-logo{display:block;width:100%;max-width:310px;height:auto;margin-bottom:20px}
.login-card p{color:var(--muted)}
.login-card label{display:block;color:var(--muted);font-size:12px;font-weight:650;margin:14px 0}
.login-card input{display:block;width:100%;height:var(--field-h);margin-top:6px;background:#fff;color:var(--text);border:1px solid #cbd4dc;border-radius:8px;padding:0 11px}
.login-card button{width:100%}
.error{color:var(--bad);margin-top:10px}

.app{display:grid;grid-template-columns:242px minmax(0,1fr);min-height:100vh}
aside{position:sticky;top:0;height:100vh;background:#fff;border-right:1px solid var(--line);padding:20px 14px}
.brand-block{padding:2px 7px 18px}
.side-logo{display:block;width:100%;max-width:195px;height:auto}
.app-name{font-weight:800;margin-top:9px}
nav{display:grid;gap:3px}
nav button{width:100%;border:0;background:transparent;text-align:left;color:var(--muted);padding:11px 12px}
nav button.active{background:#fff1e8;color:#9a3412;box-shadow:inset 3px 0 var(--orange)}
.aside-foot{position:absolute;bottom:16px;left:14px;right:14px;display:flex;justify-content:space-between;align-items:center;gap:8px;color:var(--muted);font-size:12px}
.aside-foot button{min-height:32px;padding:5px 8px}

main{min-width:0;padding:24px 28px 70px}
.page-header{position:sticky;top:0;z-index:10;display:flex;justify-content:space-between;align-items:center;gap:18px;margin:-24px -28px 22px;padding:20px 28px 16px;background:rgba(244,246,248,.94);backdrop-filter:blur(8px);border-bottom:1px solid rgba(216,222,229,.7)}
.page-header h1{margin:0}
.page-header p{margin:4px 0 0;color:var(--muted)}
.actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.content-shell{width:100%;max-width:1480px;margin:0 auto}
.view{display:none}
.view.active{display:block}

.panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:18px;margin-bottom:14px;box-shadow:var(--shadow);min-width:0}
.panel-head,.pricing-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:14px}
.panel-head p,.pricing-head p{margin:0;color:var(--muted)}
.panel-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:12px;margin-bottom:14px;box-shadow:var(--shadow)}
.panel-toolbar input,.panel-toolbar select{width:auto;min-width:210px;margin:0}
.panel-toolbar input{flex:1;max-width:420px}
.form-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px;padding-top:14px;border-top:1px solid var(--line-soft)}
.split-actions{justify-content:space-between}

.kpi-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin-bottom:14px}
.kpi{min-height:112px;background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:16px;box-shadow:var(--shadow);display:flex;flex-direction:column;justify-content:space-between}
.kpi span{color:var(--muted);font-size:12px;font-weight:650}
.kpi b{display:block;font-size:24px;line-height:1.1;overflow-wrap:anywhere}
.dashboard-grid{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(320px,.75fr);gap:14px}
.chart-panel svg{display:block;width:100%;height:320px}
.stock-panel{min-width:0}

.route-grid,.summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.form-grid{display:grid;gap:14px 16px;align-items:start}
.form-grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.form-grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.form-grid label{display:block;min-width:0;color:var(--muted);font-size:12px;font-weight:650;margin:0}
.form-grid input,.form-grid select,.form-grid textarea,.rounding-control select,.panel-toolbar input,.panel-toolbar select{
  display:block;width:100%;height:var(--field-h);margin-top:6px;background:#fff;color:var(--text);border:1px solid #cbd4dc;border-radius:8px;padding:0 11px;
}
.form-grid textarea{height:96px;padding:10px 11px;resize:vertical}
.form-grid input:focus,.form-grid select:focus,.panel-toolbar input:focus,.panel-toolbar select:focus,.rounding-control select:focus{
  outline:3px solid rgba(243,108,33,.14);border-color:var(--orange)
}
.rounding-control{display:block;min-width:220px;color:var(--muted);font-size:12px;font-weight:650}
.tariff-note{margin:16px 0 0;background:#f8fafc;border:1px solid var(--line-soft);border-radius:9px;padding:11px;color:var(--muted)}

.table-scroll{width:100%;overflow:auto}
table{width:100%;border-collapse:separate;border-spacing:0}
.data-table{min-width:920px;table-layout:fixed}
th{position:sticky;top:0;z-index:1;background:#fff;color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.035em;text-align:left;border-bottom:1px solid var(--line);padding:10px 9px;white-space:nowrap}
td{padding:11px 9px;border-bottom:1px solid var(--line-soft);vertical-align:middle}
tbody tr:hover td{background:#fbfcfd}
.num{text-align:right;font-variant-numeric:tabular-nums}
.actions-col{width:84px}
.products-table th:nth-child(1){width:28%}
.products-table th:nth-child(2){width:12%}
.products-table th:nth-child(3){width:12%}
.products-table th:nth-child(4){width:12%}
.products-table th:nth-child(5){width:12%}
.products-table th:nth-child(6){width:12%}
.products-table th:nth-child(7){width:8%}
.pill{display:inline-block;border:1px solid var(--line);border-radius:999px;padding:3px 8px;font-size:11px;white-space:nowrap}

.landed-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:14px}
.landed-summary>div{min-height:84px;border:1px solid var(--line-soft);border-radius:10px;padding:12px;background:#fbfcfd}
.landed-summary span{display:block;color:var(--muted);font-size:11px;font-weight:650}
.landed-summary b{display:block;font-size:19px;margin-top:7px;overflow-wrap:anywhere}

.srp-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.srp-card{min-width:0;border:1px solid var(--line);border-radius:12px;padding:18px;background:#fff}
.srp-card .flag{font-size:24px}
.srp-card h3{margin:8px 0 3px}
.srp-card .srp-price{font-size:32px;font-weight:820;line-height:1.1;margin:10px 0;overflow-wrap:anywhere}
.srp-card .dist-price{font-size:19px;font-weight:750;margin:8px 0}
.srp-card label{display:block;color:var(--muted);font-size:12px;font-weight:650;margin-top:11px}
.srp-card input{display:block;width:100%;height:40px;padding:0 9px;border:1px solid var(--line);border-radius:7px;margin-top:5px;background:#fff;color:var(--text)}
.srp-card .meta{font-size:12px;color:var(--muted);margin-top:12px;line-height:1.55}
.empty-result{display:block;color:var(--muted);padding:24px;border:1px dashed #cbd4dc;border-radius:10px}
.history-status{display:inline-block;border-radius:999px;padding:3px 8px;font-size:11px;border:1px solid var(--line)}
.history-status.accepted{background:#ecfdf5;color:#166534;border-color:#a7f3d0}
.history-status.draft{background:#fff7ed;color:#9a3412;border-color:#fed7aa}

.forecast-toolbar select{min-width:190px}
.forecast-help{margin:0 0 12px;color:var(--muted);font-size:12px}
.forecast-wrap{overflow-x:auto;width:100%;border:1px solid var(--line-soft);border-radius:10px}
.forecast-table{min-width:1120px;table-layout:fixed}
.forecast-table th,.forecast-table td{text-align:center;vertical-align:middle;padding:10px 6px}
.forecast-table th:first-child,.forecast-table td:first-child{width:120px;text-align:left;position:sticky;left:0;background:#fff;z-index:3;border-right:1px solid var(--line)}
.forecast-table th:not(:first-child):not(:last-child),.forecast-table td:not(:first-child):not(:last-child){width:74px}
.forecast-table th:last-child,.forecast-table td:last-child{width:90px;font-weight:750}
.forecast-table .monthInput{display:block;width:58px;min-width:58px;height:38px;margin:0 auto;padding:0 5px;text-align:center;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--text);font-variant-numeric:tabular-nums}
.forecast-month-label{display:block;font-weight:750;line-height:1}
.forecast-month-number{display:block;margin-top:4px;font-size:10px;color:var(--muted);font-weight:400}
.forecast-row-label{font-weight:750}

.report-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:14px}
.report-card{min-height:92px;text-align:left;font-weight:750;padding:15px}
.settings-panel{max-width:1120px}
.upload-box{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.upload-box input{max-width:100%}

.modal{position:fixed;inset:0;background:rgba(7,12,17,.68);display:none;place-items:center;padding:18px;z-index:50}
.modal.open{display:grid}
.modal-box{background:#fff;width:min(1080px,97vw);max-height:94vh;overflow:auto;border-radius:15px;padding:22px;box-shadow:0 24px 80px rgba(0,0,0,.25)}
.modal-box.small{width:min(780px,97vw)}
.modal-head{position:sticky;top:-22px;z-index:4;display:flex;justify-content:space-between;align-items:center;margin:-22px -22px 20px;padding:18px 22px;background:#fff;border-bottom:1px solid var(--line-soft)}
.toast{position:fixed;right:20px;bottom:20px;background:#111;color:#fff;padding:11px 15px;border-radius:8px;display:none;z-index:80}
.good{color:var(--good)}
.bad{color:var(--bad)}
hr{border:0;border-top:1px solid var(--line);margin:22px 0}

@media(max-width:1220px){
  .kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .form-grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}
  .srp-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:980px){
  .app{grid-template-columns:82px minmax(0,1fr)}
  .side-logo{display:none}
  .app-name{font-size:0;text-align:center}
  .app-name:after{content:"3LT";font-size:18px;color:#111}
  nav button{font-size:0;text-align:center}
  nav button:before{content:"•";font-size:20px}
  .aside-foot span{display:none}
  main{padding:20px}
  .page-header{margin:-20px -20px 20px;padding:17px 20px}
  .dashboard-grid,.route-grid,.summary-grid{grid-template-columns:1fr}
  .srp-grid{grid-template-columns:1fr}
}
@media(max-width:700px){
  .app{display:block}
  aside{position:static;width:100%;height:auto;border-right:0;border-bottom:1px solid var(--line);padding:10px}
  .brand-block,.aside-foot{display:none}
  nav{display:flex;overflow-x:auto;gap:6px}
  nav button{font-size:12px!important;width:auto;min-width:max-content}
  nav button:before{display:none}
  main{padding:14px}
  .page-header{position:static;margin:-14px -14px 16px;padding:14px;align-items:flex-start}
  .page-header .actions{justify-content:flex-end}
  .kpi-grid{grid-template-columns:1fr 1fr}
  .form-grid-3,.form-grid-2{grid-template-columns:1fr}
  .landed-summary{grid-template-columns:1fr 1fr}
  .report-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:460px){
  .kpi-grid,.report-grid,.landed-summary{grid-template-columns:1fr}
  .page-header{display:block}
  .page-header .actions{margin-top:12px;justify-content:flex-start}
}
@media print{
  aside,.page-header,.panel-toolbar,.report-grid{display:none!important}
  .app{display:block}
  main{padding:0}
  .view{display:none!important}
  #reports.active{display:block!important}
  .panel{border:0;box-shadow:none}
}

/* Forecasting suite */
.pipeline-forecast-table{min-width:1320px;table-layout:fixed}
.pipeline-forecast-table th,.pipeline-forecast-table td{text-align:center;padding:8px 6px;border-bottom:1px solid var(--line-soft)}
.pipeline-forecast-table th:first-child,.pipeline-forecast-table td:first-child{
  width:230px;text-align:left;position:sticky;left:0;background:#fff;z-index:4;border-right:1px solid var(--line)
}
.pipeline-forecast-table th:not(:first-child):not(:last-child),
.pipeline-forecast-table td:not(:first-child):not(:last-child){width:72px}
.pipeline-forecast-table th:last-child,.pipeline-forecast-table td:last-child{width:90px;font-weight:750}
.pipeline-forecast-table input{
  width:58px;height:36px;text-align:center;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--text)
}
.pipeline-product-link{border:0;background:transparent;padding:0;min-height:0;color:#a64008;font-weight:750;text-align:left}
.pipeline-product-meta{display:block;color:var(--muted);font-size:11px;margin-top:2px}
.pipeline-forecast-table tfoot td,.commercial-table tfoot td{font-weight:800;background:#f8fafc;border-top:2px solid var(--line)}
.commercial-table{min-width:1100px}
.commercial-table th:first-child{width:26%}
.cash-table{min-width:1280px;table-layout:fixed}
.cash-table th,.cash-table td{text-align:right;padding:10px 7px;border-bottom:1px solid var(--line-soft)}
.cash-table th:first-child,.cash-table td:first-child{text-align:left;width:220px;position:sticky;left:0;background:#fff;z-index:3;border-right:1px solid var(--line)}
.cash-positive{color:var(--good)}
.cash-negative{color:var(--bad)}
.launch-board{display:grid;grid-template-columns:repeat(7,minmax(220px,1fr));gap:12px;overflow-x:auto;padding-bottom:8px}
.launch-column{background:#eef2f5;border:1px solid var(--line);border-radius:12px;padding:10px;min-height:420px}
.launch-column-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;padding:3px 4px}
.launch-column-head h3{margin:0}
.launch-count{display:inline-grid;place-items:center;min-width:24px;height:24px;border-radius:999px;background:#fff;border:1px solid var(--line);font-size:11px}
.launch-card{background:#fff;border:1px solid var(--line);border-radius:10px;padding:12px;margin-bottom:9px;box-shadow:var(--shadow);cursor:grab}
.launch-card b{display:block}
.launch-card small{display:block;margin-top:4px;color:var(--muted)}
.launch-card .launch-date{margin-top:8px;font-size:11px;color:#9a3412}
.launch-column.drag-over{outline:3px solid rgba(243,108,33,.25);background:#fff7ed}
@media(max-width:1200px){.launch-board{grid-template-columns:repeat(7,220px)}}

.import-steps{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-bottom:20px}
.import-step{display:flex;align-items:center;gap:8px;padding:10px;border:1px solid var(--line);border-radius:9px;color:var(--muted);font-size:12px}
.import-step span{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:#eef2f5;font-weight:800}
.import-step.active{border-color:var(--orange);color:#9a3412;background:#fff7ed}.import-step.active span{background:var(--orange);color:#fff}
.import-wizard-panel.hidden{display:none}
.import-type-grid,.export-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.import-type-card,.export-grid button{min-height:105px;text-align:left;padding:16px;background:#fff}
.import-type-card b,.export-grid b{display:block;font-size:15px;margin-bottom:5px}
.import-type-card span,.export-grid span{display:block;color:var(--muted);white-space:normal}
.import-type-card.selected{border-color:var(--orange);box-shadow:0 0 0 3px rgba(243,108,33,.12)}
.template-box{background:#f8fafc;border:1px solid var(--line);border-radius:10px;padding:15px}.template-box a{display:block;margin:7px 0}
.mapping-table{min-width:760px}.mapping-table select{width:100%;height:38px;border:1px solid var(--line);border-radius:7px;background:#fff}
.remember-mapping{display:flex;align-items:center;gap:8px;margin-top:13px;color:var(--muted)}
.import-summary-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:14px}
.import-summary-card{border:1px solid var(--line);border-radius:10px;padding:13px}.import-summary-card span{display:block;color:var(--muted);font-size:12px}.import-summary-card b{display:block;font-size:24px}
.preview-table{min-width:900px}.preview-status{display:inline-block;padding:3px 8px;border-radius:999px;font-size:11px;border:1px solid var(--line)}
.preview-status.new{background:#ecfdf5;color:#166534}.preview-status.update{background:#eff6ff;color:#1d4ed8}.preview-status.error{background:#fff1f2;color:#9f1239}
.import-complete{padding:26px;border:1px solid #a7f3d0;background:#ecfdf5;border-radius:12px;color:#166534;font-size:16px}
@media(max-width:1000px){.import-type-grid,.export-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:700px){.import-steps,.import-type-grid,.export-grid,.import-summary-grid{grid-template-columns:1fr}}

.app-name small{display:block;margin-top:2px;color:var(--muted);font-size:10px;font-weight:600}

.import-type-card,.export-grid button{cursor:pointer;position:relative}
.import-type-card:hover,.export-grid button:hover{border-color:var(--orange);background:#fffaf7;transform:translateY(-1px)}
.import-type-card:focus-visible,.export-grid button:focus-visible{outline:3px solid rgba(243,108,33,.22);outline-offset:2px}
.import-drop-zone{display:grid;place-items:center;min-height:190px;border:2px dashed #c8d1da;border-radius:12px;background:#fbfcfd;padding:24px;text-align:center;cursor:pointer;transition:.15s ease}
.import-drop-zone:hover,.import-drop-zone.drag-over{border-color:var(--orange);background:#fff7ed}
.import-drop-zone strong{font-size:17px}
.import-drop-zone span{color:var(--muted);margin-top:5px}
.selected-import-file{margin-top:14px;padding:7px 10px;border-radius:8px;background:#fff;border:1px solid var(--line);font-size:12px;color:var(--muted)}
.selected-import-file.has-file{color:#166534;background:#ecfdf5;border-color:#a7f3d0;font-weight:700}

.simple-import-card{grid-column:1/-1;background:#fff7ed!important;border-color:#f36c21!important}
.simple-import-card b{font-size:17px}

.products-toolbar{justify-content:space-between}
.bulk-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-left:auto}
.selection-count{color:var(--muted);font-size:12px;font-weight:700}
.select-col{width:44px!important;text-align:center!important}
.select-col input,.productSelect{width:16px;height:16px;accent-color:var(--orange);cursor:pointer}
.products-table th:nth-child(1){width:44px}
.products-table th:nth-child(2){width:26%}
.products-table th:nth-child(3){width:12%}
.products-table th:nth-child(4){width:12%}
.products-table th:nth-child(5){width:12%}
.products-table th:nth-child(6){width:12%}
.products-table th:nth-child(7){width:12%}
.products-table th:nth-child(8){width:8%}
.selected-row td{background:#fff7ed!important}
@media(max-width:900px){.products-toolbar{align-items:stretch}.bulk-actions{margin-left:0;width:100%}}

.product-commercial-note{display:flex;gap:14px;align-items:flex-start;padding:12px 14px;background:#f8fafc;border:1px solid var(--line);border-radius:10px}
.product-commercial-note b{min-width:130px}
.product-commercial-note span{color:var(--muted)}
.bulk-edit-help{padding:10px 12px;background:#fff7ed;border:1px solid #fed7aa;border-radius:9px;color:#9a3412}
.bulk-edit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.bulk-edit-field{display:grid;grid-template-columns:30px minmax(0,1fr);gap:8px;align-items:start;border:1px solid var(--line);border-radius:10px;padding:12px;background:#fff}
.bulk-edit-field>input[type=checkbox]{width:18px;height:18px;margin-top:25px;accent-color:var(--orange)}
.bulk-edit-field label{display:block;color:var(--muted);font-size:12px;font-weight:650}
.bulk-edit-field select,.bulk-edit-field input[type=text],.bulk-edit-field input[type=number]{display:block;width:100%;height:42px;margin-top:6px;border:1px solid #cbd4dc;border-radius:8px;padding:0 10px;background:#fff;color:var(--text)}
.bulk-edit-field:not(.enabled) select,.bulk-edit-field:not(.enabled) input:not([type=checkbox]){opacity:.45;pointer-events:none}
@media(max-width:760px){.bulk-edit-grid{grid-template-columns:1fr}}

.pricing-bottom-actions{
  position:sticky;
  bottom:14px;
  z-index:8;
  display:flex;
  justify-content:flex-end;
  gap:9px;
  padding:12px;
  margin-top:16px;
  background:rgba(255,255,255,.96);
  border:1px solid var(--line);
  border-radius:12px;
  box-shadow:0 8px 30px rgba(16,24,40,.12);
  backdrop-filter:blur(8px);
}
@media(max-width:700px){
  .pricing-bottom-actions{position:static;flex-wrap:wrap}
  .pricing-bottom-actions button{flex:1}
}

.success-modal-box{text-align:center;max-width:460px}
.success-icon{display:grid;place-items:center;width:62px;height:62px;margin:4px auto 16px;border-radius:50%;background:#ecfdf5;color:#166534;font-size:34px;font-weight:800;border:1px solid #a7f3d0}
.success-modal-box h2{font-size:22px}
.success-modal-box p{color:var(--muted);font-size:15px}
.success-modal-box .form-actions{justify-content:center}

#variantList table{min-width:760px}
#variantList th,#variantList td{white-space:nowrap}

.conversion-preview{margin-top:18px;border:1px solid var(--line);border-radius:10px;padding:14px;background:#f8fafc}
.conversion-preview ul{margin:8px 0 0;padding-left:20px;columns:2}
@media(max-width:700px){.conversion-preview ul{columns:1}}

.channel-split-summary{margin-top:14px;padding:11px 13px;border:1px solid var(--line);border-radius:9px;background:#f8fafc;color:var(--muted)}
.channel-split-summary.good{background:#ecfdf5;border-color:#a7f3d0;color:#166534}
.channel-split-summary.bad{background:#fff1f2;border-color:#fecdd3;color:#9f1239}
