:root{--navy:#203b78;--teal:#168c99;--soft:#f1f7f8;--bg:#f3f5f8;--ink:#1b2c49;--muted:#68758b;--line:#e3e8ef;--danger:#b03239;font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;color:var(--ink);background:var(--bg);font-size:14px}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit;color:inherit}button,a{touch-action:manipulation}button,.button{min-height:42px;padding:10px 16px;border:1px solid var(--line);background:#fff;border-radius:11px;font-weight:650;cursor:pointer;display:inline-flex;justify-content:center;align-items:center;gap:8px;text-decoration:none}button:hover,.button:hover{background:#edf2f8}button:disabled{opacity:.55;cursor:wait}.primary{background:var(--navy);color:#fff;border-color:var(--navy)}.primary:hover{background:#152c62}.danger{color:var(--danger);border-color:#e9c4c7}.quiet{border:0;background:transparent;padding:7px 10px;min-height:32px}input,select,textarea{width:100%;padding:11px 12px;border:1px solid #d9e0e9;background:#f9fafc;border-radius:10px;min-height:43px}textarea{resize:vertical;line-height:1.5}label{display:grid;gap:7px;font-weight:650;font-size:12px}label small{font-weight:400;color:var(--muted)}input[type=checkbox]{width:18px;min-height:18px}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #4bb3be;outline-offset:3px}h1,h2,h3,p{margin-top:0}h2{font-size:19px;letter-spacing:-.3px}h3{font-size:15px}p{line-height:1.65}.muted,small{color:var(--muted)}.eyebrow{font-size:10px;font-weight:800;letter-spacing:.14em;color:var(--teal)}[hidden]{display:none!important}.auth{min-height:100vh;display:grid;grid-template-columns:1fr 1fr;background:#fff}.auth-brand{background:var(--navy);color:#fff;padding:9vh max(35px,7vw);display:flex;flex-direction:column;justify-content:center}.auth-brand img{width:150px;border-radius:16px;margin-bottom:40px}.auth-brand>span{font-size:11px;letter-spacing:.15em;color:#b8dae6;font-weight:700}.auth-brand h1{font-size:clamp(34px,4vw,58px);line-height:1.12;letter-spacing:-2px;margin:20px 0}.auth-brand p{color:#c2d1e8;max-width:360px}.auth-points{display:grid;gap:15px;margin-top:30px;font-size:13px}.auth-points span:before{content:'✓';color:#8ce0db;margin-right:12px}.auth-form{max-width:520px;width:100%;padding:40px;align-self:center;justify-self:center}.auth-form h2{font-size:28px}.auth-form form{display:grid;gap:18px}.auth-form .primary{width:100%;margin-top:8px}#authError,#dialogError{color:var(--danger);line-height:1.6}#app{display:grid;grid-template-columns:226px minmax(0,1fr);min-height:100vh}.sidebar{height:100vh;position:sticky;top:0;background:#fff;border-right:1px solid var(--line);padding:24px 15px;display:flex;flex-direction:column;gap:25px}.brand{padding:0 10px 22px;border-bottom:1px solid var(--line)}.brand img{width:145px;height:73px;object-fit:contain}.brand span{display:block;font-size:10px;letter-spacing:.15em;color:var(--muted);font-weight:700;margin:7px 0 0 6px}nav{display:grid;gap:5px}nav button{justify-content:flex-start;border:0;border-radius:12px;color:var(--muted);min-height:46px;padding:11px 14px;font-weight:600}nav button.active{background:#eaf0f9;color:var(--navy);box-shadow:inset 3px 0 var(--teal)}nav svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.user-card{margin-top:auto;border-top:1px solid var(--line);padding:18px 10px 0;display:grid;gap:6px}.user-card>div{font-weight:700}.user-card button{justify-self:start;margin-left:-10px;color:var(--muted)}main{min-width:0;padding:30px 34px 18px;max-width:1700px;width:100%;margin:0 auto}.topbar{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:26px}.topbar h1{font-size:29px;letter-spacing:-.7px;margin:8px 0}.topbar p{color:var(--muted);font-size:13px;margin:0}.sync{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:11px;white-space:nowrap}.dot{width:7px;height:7px;background:var(--teal);border-radius:50%}#message{border-radius:12px;padding:13px 18px;background:#e0f2ec;color:#1e6650;margin-bottom:18px;line-height:1.5}#message.error{background:#fbe9e9;color:var(--danger)}#content{display:grid;gap:20px}.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.metric{background:#fff;border-radius:18px;padding:22px;box-shadow:0 6px 24px #1b2c4905}.metric>span{font-size:12px;color:var(--muted)}.metric strong{display:block;font-size:32px;letter-spacing:-1px;margin:13px 0 6px;color:var(--navy)}.metric small{font-size:11px}.metric.accent{background:var(--navy)}.metric.accent strong,.metric.accent>span{color:#fff}.metric.accent small{color:#cad8eb}.panel{background:#fff;border-radius:19px;box-shadow:0 6px 24px #1b2c4905;overflow:hidden}.panel-head{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:21px 23px;border-bottom:1px solid var(--line);flex-wrap:wrap}.panel-head h2{margin:0;font-size:16px}.panel-head p{margin:5px 0 0;font-size:12px;color:var(--muted)}.panel-body{padding:23px}.columns{display:grid;grid-template-columns:1fr 1fr;gap:20px}.actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.toolbar{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap}.toolbar input{max-width:390px;background:#fff}.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%;text-align:left}th{background:#f9fafc;font-size:11px;color:var(--muted);padding:13px 18px;font-weight:650;white-space:nowrap}td{padding:16px 18px;border-bottom:1px solid #edf0f4;font-size:13px;vertical-align:middle;line-height:1.4}tr:last-child td{border:0}td small{display:block;margin-top:4px;font-size:11px}td strong{font-weight:650}.row-actions{display:flex;gap:7px}.row-actions button{font-size:12px;padding:7px 10px;min-height:34px}.tag{display:inline-flex;padding:5px 9px;border-radius:7px;background:#edf1f7;color:#52627b;font-size:11px;line-height:1.4;font-weight:700;white-space:nowrap}.tag.good{background:#e2f3ec;color:#19735a}.tag.warn{background:#fff2df;color:#966014}.tag.bad{background:#fbe8e8;color:#b03239}.tag.blue{background:#e8eefb;color:var(--navy)}.empty{text-align:center;padding:44px 24px;color:var(--muted);font-size:13px;line-height:1.8}.empty strong{display:block;color:var(--ink);font-size:16px;margin-bottom:8px}.empty button{margin-top:15px}.timeline{display:grid;gap:0}.event{padding:17px 0;border-bottom:1px solid var(--line)}.event:first-child{padding-top:0}.event:last-child{border-bottom:0}.event p{margin:8px 0 0;white-space:pre-wrap;font-size:13px}.event small{font-size:11px}.event-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.event-head strong{font-size:13px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.form-grid .full{grid-column:1/-1}.form-actions{display:flex;justify-content:flex-end;gap:10px;padding-top:20px;margin-top:20px;border-top:1px solid var(--line)}.helper{padding:12px 15px;border-radius:10px;background:#eef5f7;color:#506778;line-height:1.65;font-size:12px;margin:12px 0}.detail-title{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}.detail-title h2{font-size:25px;margin-bottom:6px}.detail-title p{margin:0;color:var(--muted);font-size:13px}.numbers{display:flex;gap:22px;flex-wrap:wrap;margin:20px 0}.numbers span{display:grid;gap:6px;color:var(--muted);font-size:12px}.numbers strong{color:var(--navy);font-size:22px}.inline-list{display:grid;gap:12px}.inline-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:13px 0;border-bottom:1px solid var(--line)}.inline-row strong{display:block;font-size:13px}.inline-row small{font-size:11px}.online-note{font-size:12px;line-height:1.6;color:var(--muted)}dialog{border:0;border-radius:21px;width:min(850px,calc(100% - 28px));padding:0;box-shadow:0 24px 100px #14224a44;color:var(--ink);max-height:92dvh}dialog::backdrop{background:#14224a66;backdrop-filter:blur(3px)}.dialog-head{position:sticky;top:0;background:#fff;z-index:1;display:flex;align-items:center;justify-content:space-between;padding:20px 24px;border-bottom:1px solid var(--line)}.dialog-head h2{margin:0;font-size:18px}.dialog-head button{font-size:23px}#dialogContent{padding:24px}#dialogError{padding:0 24px 20px;margin:0}.offer-lines{margin:20px 0}.offer-lines td{padding:10px 5px}.offer-lines input{min-width:74px}.offer-lines .name-input{min-width:200px}.totals{text-align:right;color:var(--navy);font-size:17px;font-weight:700;line-height:1.8}.catalog-list{max-height:380px;overflow:auto;margin-top:15px}.catalog-list .inline-row{padding-inline:4px}.catalog-list .inline-row>div{min-width:0;overflow-wrap:anywhere}.catalog-list .inline-row button{flex-shrink:0}.price-frame{width:100%;height:calc(100dvh - 190px);min-height:650px;border:0;border-radius:18px}.mono{font-variant-numeric:tabular-nums}.integration{padding:18px;border:1px solid var(--line);border-radius:13px}.integration strong{display:block;margin-bottom:9px}.integration p{font-size:12px;color:var(--muted);margin:10px 0 0}footer{color:#8490a3;font-size:10px;padding:24px 0 8px;display:flex;justify-content:space-between;gap:10px}.link{background:none;border:0;color:var(--navy);text-decoration:underline;padding:0;min-height:0;display:inline;font:inherit}.stock-alert{color:#a46616;font-weight:700}
@media(max-width:1100px){main{padding:25px 22px}.metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.columns{grid-template-columns:1fr}#app{grid-template-columns:200px minmax(0,1fr)}.sidebar{padding:20px 10px}.topbar{align-items:flex-start}.sync{padding-top:6px}}
@media(max-width:760px){#app{display:block}.sidebar{position:relative;height:auto;padding:12px 14px;gap:12px;border:0;border-radius:0 0 20px 20px}.brand{padding:0;border:0;display:flex;align-items:center;justify-content:space-between}.brand img{width:98px;height:43px}.brand span{font-size:9px;margin:0}.sidebar nav{display:flex;overflow:auto;gap:5px;padding-bottom:3px}.sidebar nav button{min-width:max-content;padding:10px 12px;font-size:12px;min-height:40px;gap:6px}.sidebar nav svg{width:17px;height:17px}.user-card{display:none}main{padding:22px 14px 12px}.topbar{margin-bottom:22px}.topbar h1{font-size:26px}.topbar p{font-size:12px}.sync{font-size:10px;gap:5px}.sync #syncLabel{max-width:90px;white-space:normal}.metrics{gap:11px}.metric{padding:17px;border-radius:15px}.metric strong{font-size:27px}.metric>span{font-size:11px}.panel-head,.panel-body{padding:18px}.toolbar{align-items:stretch}.toolbar input{max-width:none}.toolbar .actions{width:100%}.toolbar .primary{flex:1}.table-wrap table{min-width:660px}.table-wrap.compact table{min-width:440px}.form-grid{grid-template-columns:1fr}.form-grid .full{grid-column:auto}.detail-title{flex-direction:column;gap:15px}.auth{display:block}.auth-brand{padding:30px 25px}.auth-brand img{width:100px;margin:0 0 20px}.auth-brand h1{font-size:32px;letter-spacing:-1px}.auth-brand p,.auth-points{display:none}.auth-form{padding:30px 25px}.auth-form h2{font-size:23px}dialog{max-height:95dvh}.dialog-head,#dialogContent{padding:18px}.row-actions{flex-wrap:wrap}.price-frame{min-height:620px}.event-head{align-items:flex-start;flex-wrap:wrap}.form-actions{flex-wrap:wrap}.form-actions button{flex:1}.numbers{gap:18px}footer{flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
dialog.wide{width:min(1250px,calc(100% - 28px))}.check-row{display:flex;align-items:center;gap:10px;margin-top:16px;line-height:1.5}.check-row input{flex:0 0 18px}#supplierPreview table{min-width:850px}#supplierPreview .table-wrap{max-height:480px;margin:18px 0}#supplierPreview th{position:sticky;top:0}#priceSearch{max-width:370px}.sidebar{overflow-y:auto}
.customer-period{display:flex;align-items:end;gap:12px;flex-wrap:wrap}.customer-period label{min-width:150px}#customerPeriodError{color:var(--danger)}.customer-chart{display:flex;gap:12px;overflow-x:auto;padding:10px 0;align-items:stretch}.chart-column{display:flex;flex:1 0 74px;flex-direction:column;gap:10px;border:0;background:transparent;padding:8px 2px;font-size:11px;font-weight:500}.chart-value{white-space:nowrap;font-variant-numeric:tabular-nums}.chart-track{display:flex;align-items:end;width:34px;height:160px;background:#edf2f7;border-radius:6px;overflow:hidden}.chart-fill{display:block;width:100%;background:var(--teal);border-radius:6px 6px 0 0}#customerMetrics strong{font-size:26px}.timeline h3{margin:8px 0}.timeline .event p{overflow-wrap:anywhere}

.unread-badge{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0 6px;border-radius:999px;background:#147b43;color:#fff;font-size:12px;font-weight:800;vertical-align:middle;flex-shrink:0}.sidebar nav .unread-badge{margin-left:auto;background:#28d977;color:#123b24}.communication-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px;border-bottom:1px solid #e4e9f1;overflow-wrap:anywhere}.communication-row>div:first-child{min-width:0}.communication-row p{margin:7px 0}.communication-row.is-unread{background:#effaf3;border-left:4px solid #147b43}.communication-row .row-actions{flex-wrap:wrap}.communication-list{max-height:480px;overflow:auto}.communication-row small{color:#536178}@media(max-width:650px){.communication-row{align-items:flex-start;flex-direction:column}.communication-row>.row-actions{width:100%}}

.customer-history{align-self:start}.customer-history summary{cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:22px;list-style:none}.customer-history summary::-webkit-details-marker{display:none}.customer-history summary strong{font-size:19px}.customer-history summary small{display:block;margin-top:7px}.customer-history summary:focus-visible{outline:3px solid #4bb3be;outline-offset:-3px}.customer-history .history-expand,.customer-history .history-collapse{font-weight:650;color:var(--navy)}.customer-history .history-collapse{display:none}.customer-history[open] .history-expand{display:none}.customer-history[open] .history-collapse{display:inline}.customer-history .timeline{max-height:420px;overflow:auto;border-top:1px solid var(--line)}

.customer-name{font-weight:700;text-align:left;min-height:36px}.customer-name:hover{color:var(--teal)}#interfaces{margin-bottom:24px}

.channel-icon{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;flex:0 0 28px;border-radius:8px;background:#eef1f6;color:#536178;vertical-align:middle}.channel-icon svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.channel-whatsapp{background:#e4f6e9;color:#128c46}.channel-email{background:#e8efff;color:#254a94}.channel-phone{background:#e2f3f4;color:#167c85}
.customer-overview{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:24px;align-items:start;margin:20px 0}.customer-overview>.panel{margin:0}.customer-values{min-width:0;background:#edf2f8;border-radius:20px;padding:20px}.values-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.values-heading h2{margin:0}.customer-values .customer-period{gap:8px;margin-bottom:16px}.customer-values .customer-period label{min-width:120px;flex:1}.customer-values #customerMetrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.customer-values .metric{padding:15px}.customer-values .metric strong{font-size:23px!important}.customer-values .panel{margin-bottom:0}.customer-values .chart-track{height:100px}.customer-values .panel-body{padding:16px}.customer-sections{display:flex;flex-wrap:wrap;gap:16px;margin-top:24px;border-top:1px solid var(--line);padding-top:18px}.customer-sections button{border:0;padding:8px 0;color:var(--navy);border-radius:0;text-decoration:underline;text-underline-offset:5px}.customer-portrait{width:110px;height:110px;border:1px solid var(--line);padding:8px;margin-bottom:6px;background:#f5f8fc}.customer-portrait img{width:100%;height:100%;object-fit:contain}.customer-portrait span{font-size:30px;color:var(--navy)}.portrait-hint{display:block;margin-bottom:20px}.customer-image-preview{display:block;max-width:100%;max-height:260px;margin:20px auto}.customer-overview h2{overflow-wrap:anywhere}@media(max-width:1000px){.customer-overview{grid-template-columns:1fr}.customer-overview>.panel{grid-row:1}.customer-values{padding:15px}}
.customer-values .customer-chart{gap:3px}.customer-values .chart-column{flex:1 0 32px;font-size:9px;padding:8px 0}.customer-values .chart-value{font-size:8px}.customer-values .chart-track{width:22px}

.customer-right{display:grid;gap:20px;min-width:0}.customer-right>.panel{margin:0}@media(max-width:1000px){.customer-overview>.customer-right{grid-row:1}}
/* Customer-card grid: shared spacing, aligned edges and golden-ratio desktop columns. */
.customer-overview{--card-gap:24px;--card-radius:20px;grid-template-columns:minmax(0,1.618fr) minmax(360px,1fr);gap:var(--card-gap);align-items:stretch;margin:24px 0}
.customer-values{display:flex;flex-direction:column;gap:20px;background:#fff;padding:24px;border-radius:var(--card-radius)}
.values-heading{margin:0;min-height:44px}.values-heading h2{font-size:19px}.values-heading button{width:44px;padding:9px;flex-shrink:0}
.customer-values .customer-period{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin:0;align-items:end}
.customer-values .customer-period label{grid-column:span 3;min-width:0}.customer-values .customer-period input{min-width:0;width:100%;max-width:100%}
.customer-values .customer-period>button{grid-column:span 2;min-width:0;white-space:normal;padding:10px 8px;font-size:12px;height:100%}.customer-values #customerPeriodError{grid-column:1/-1}.customer-values #customerPeriodError:empty{display:none}
.customer-values #customerMetrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:0}
.customer-values .metric{display:flex;flex-direction:column;gap:10px;padding:20px;border-radius:14px;min-height:132px;background:#f3f6fa;box-shadow:none}.customer-values .metric.accent{background:var(--navy)}
.customer-values .metric>span{min-height:18px;margin:0}.customer-values .metric strong{font-size:26px!important;line-height:1.2;margin:0}.customer-values .metric small{margin-top:auto;font-size:11px;line-height:1.5}
.customer-values>.panel{display:flex;flex-direction:column;flex:1;margin:0;border-radius:0;border-top:1px solid var(--line);box-shadow:none;overflow:visible}.customer-values>.panel .panel-head{padding:20px 0 0;border:0}.customer-values>.panel .panel-body{padding:12px 0 0;display:flex;flex-direction:column;flex:1}.customer-values>.panel .panel-body>.muted{font-size:12px;margin-bottom:16px}.customer-values .customer-chart{gap:6px;margin-top:auto;padding:8px 0 0}.customer-values .chart-column{flex:1 0 34px;gap:10px;font-size:10px}.customer-values .chart-value{font-size:9px}.customer-values .chart-track{height:120px;width:26px}
.customer-right{gap:24px;grid-template-rows:1fr auto;align-content:stretch}.customer-right>.panel{border-radius:20px}.customer-right>.panel:first-child>.panel-body{height:100%;display:flex;flex-direction:column;padding:24px}.customer-right .detail-title{gap:12px;align-items:flex-start}.customer-right .detail-title>div{min-width:0}.customer-right .detail-title>button{padding:10px 12px;flex-shrink:0}.customer-right .detail-title h2{font-size:22px;line-height:1.3;margin-bottom:12px}.customer-right p{overflow-wrap:anywhere}.customer-right .actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.customer-right .actions button{padding:10px 8px;font-size:12px}.customer-right .customer-sections{gap:16px;margin-top:auto;padding-top:20px}.customer-right .actions+.customer-sections{margin-top:24px}.customer-right .customer-sections button{font-size:12px}.customer-right .panel-head,.customer-right .panel-body{padding:20px 24px}.customer-right .inline-row{gap:12px}.customer-right .inline-row>div{min-width:0;overflow-wrap:anywhere}
.customer-portrait{width:88px;height:88px}.portrait-hint{font-size:10px;margin-bottom:20px}.customer-history summary{padding:24px}
@media(max-width:1200px){.customer-overview{grid-template-columns:minmax(0,1.2fr) minmax(330px,1fr)}}
@media(max-width:1000px){.customer-overview{grid-template-columns:minmax(0,1fr)}.customer-overview>.customer-right{grid-row:1}.customer-right{grid-template-rows:auto auto}.customer-values{padding:24px}}
@media(max-width:480px){.customer-overview{gap:16px;margin:16px 0}.customer-right{gap:16px}.customer-values,.customer-right>.panel:first-child>.panel-body{padding:18px}.customer-values #customerMetrics{gap:12px}.customer-values .metric{padding:14px;min-height:140px}.customer-values .metric strong{font-size:23px!important}.customer-right .panel-head,.customer-right .panel-body,.customer-history summary{padding:18px}.customer-right .detail-title{flex-direction:row}.customer-right .detail-title>button{font-size:12px}.customer-values .customer-period>button{font-size:11px}.customer-right .customer-sections{gap:12px}}

.customer-values .metric-link{align-items:flex-start;justify-content:flex-start;text-align:left;width:100%;border:1px solid transparent;font-weight:400;cursor:pointer}.customer-values .metric-link:hover{background:#e8eff9;border-color:#9cb4d5}.customer-values .metric-link:focus-visible{outline:3px solid var(--teal);outline-offset:3px}.metric-link>span:after{content:" ↗";color:var(--teal)}
