:root {
  --chemma-blue: #123b9b;
  --chemma-blue-dark: #0b255f;
  --chemma-blue-soft: #eaf0ff;
  --chemma-green: #009846;
  --chemma-green-soft: #e7f7ef;
  --chemma-red: #df2337;
  --chemma-red-soft: #fff0f2;
  --chemma-gold: #c89518;
  --chemma-yellow: #f0b429;
  --chemma-yellow-soft: #fff7dc;
  --ink: #14213d;
  --muted: #68738a;
  --line: #e5e9f2;
  --surface: #ffffff;
  --background: #f5f7fb;
  --shadow: 0 14px 40px rgba(18, 42, 89, 0.09);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; overflow-x: hidden; background: var(--background); }
body { min-height: 100vh; margin: 0; overflow-x: hidden; background: var(--background); }
body.is-login-visible { position: fixed; inset: 0; width: 100%; height: 100%; overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(18, 59, 155, .2); outline-offset: 2px; }
.is-hidden { display: none !important; }

.excel-import-panel { max-width: 720px; padding: 28px; display: grid; gap: 18px; }
.excel-import-panel label { display: grid; gap: 6px; }
.excel-import-panel label span { color: var(--muted); font-size: .9rem; }
.excel-import-panel input[type="file"] { width: 100%; padding: 18px; border: 1px dashed var(--line); border-radius: 16px; background: #f8faff; }
.excel-import-panel .primary-button { width: fit-content; }
.import-status { min-height: 1.5em; margin: 0; color: var(--ink); font-weight: 700; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.app-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.login-screen { height: 100vh; height: 100dvh; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(430px, .82fr); background: #fdfefe; }
.login-brand { position: relative; isolation: isolate; overflow: hidden; min-height: 0; height: 100%; padding: clamp(30px, 4.5vh, 54px) clamp(36px, 5vw, 76px); color: #fff; background: linear-gradient(145deg, #061849 0%, #0b2d78 53%, #0a4d76 100%); display: grid; grid-template-rows: auto minmax(100px, 1fr) auto; }
.brand-wash { position: absolute; z-index: -3; inset: -12%; background: radial-gradient(circle at 76% 10%, rgba(75,197,127,.45) 0, transparent 25%), radial-gradient(circle at 17% 90%, rgba(0,152,70,.24) 0, transparent 34%), radial-gradient(circle at 52% 52%, rgba(66,113,217,.32) 0, transparent 42%); animation: brand-wash-drift 13s ease-in-out infinite alternate; }
.login-brand::before { content: ""; position: absolute; z-index: -2; inset: 0; opacity: .22; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 72%, transparent); }
.login-brand::after { content: ""; position: absolute; z-index: -1; width: 560px; height: 560px; border: 1px solid rgba(145,211,255,.18); border-radius: 50%; right: -210px; bottom: -245px; box-shadow: 0 0 0 85px rgba(255,255,255,.025), 0 0 0 170px rgba(255,255,255,.018); }
.login-orbit { position: absolute; z-index: -1; border: 1px solid rgba(132,211,255,.17); border-radius: 50%; pointer-events: none; }
.orbit-one { width: 520px; height: 520px; right: -110px; top: 18%; animation: orbit-drift 16s ease-in-out infinite alternate; }
.orbit-two { width: 690px; height: 300px; left: -230px; top: 35%; transform: rotate(-9deg); animation: orbit-drift 20s ease-in-out -6s infinite alternate-reverse; }
.login-particle { position: absolute; z-index: 0; width: 7px; height: 7px; border-radius: 50%; background: #83e9ad; box-shadow: 0 0 18px 6px rgba(90,220,147,.3); animation: particle-float 7s ease-in-out infinite; }
.particle-one { left: 9%; top: 42%; }
.particle-two { left: 56%; top: 19%; width: 5px; height: 5px; animation-delay: -2.1s; }
.particle-three { right: 12%; top: 58%; width: 9px; height: 9px; animation-delay: -4.4s; }
.particle-four { left: 36%; bottom: 12%; width: 4px; height: 4px; animation-delay: -5.5s; }
.login-logo-shell { position: relative; z-index: 2; width: min(560px, 82%); padding: 8px; border: 1px solid rgba(255,255,255,.25); border-radius: 20px; background: rgba(255,255,255,.11); box-shadow: 0 24px 60px rgba(1,13,45,.3), inset 0 1px rgba(255,255,255,.18); backdrop-filter: blur(12px); }
.login-wide-logo { display: block; width: 100%; height: auto; border-radius: 13px; object-fit: contain; object-position: left center; }
.login-forecast-visual { position: relative; z-index: 2; align-self: center; width: min(760px, 100%); margin: 1vh 0 -1vh; }
.login-forecast-visual svg { display: block; width: 100%; overflow: visible; }
.forecast-grid-line { fill: none; stroke: rgba(177,211,255,.17); stroke-width: 12; stroke-linecap: round; }
.forecast-progress-line { fill: none; stroke: url(#forecast-line-gradient); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; filter: url(#forecast-line-glow); animation: forecast-line-draw 2.4s .35s cubic-bezier(.2,.8,.2,1) forwards; }
.forecast-year { opacity: 0; color: #fff; animation: forecast-node-arrive .55s ease-out forwards; }
.forecast-year circle:first-child { fill: #dbfff0; stroke: #62d590; stroke-width: 4; filter: url(#forecast-line-glow); }
.forecast-year text { fill: #fff; font-size: 14px; font-weight: 850; letter-spacing: .03em; text-anchor: middle; }
.forecast-year .forecast-year-caption { fill: rgba(216,233,255,.68); font-size: 9px; letter-spacing: .13em; }
.forecast-pulse { fill: none; stroke: #82efb0; stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: forecast-pulse 2.8s ease-out infinite; }
.year-2024 { animation-delay: .85s; }
.year-2025 { animation-delay: 1.35s; }
.year-2026 { animation-delay: 1.9s; }
.year-2025 .forecast-pulse { animation-delay: .75s; }
.year-2026 .forecast-pulse { animation-delay: 1.4s; }
.forecast-small-dots { fill: #a4f2c5; opacity: 0; animation: forecast-node-arrive .8s 1.2s ease-out forwards; }
.login-message { position: relative; z-index: 2; max-width: 720px; padding-bottom: clamp(4px, 2vh, 20px); }
.login-message h1 { margin: 11px 0 15px; font-size: clamp(42px, 4.6vw, 72px); line-height: .98; letter-spacing: -.052em; text-wrap: balance; }
.login-message p { max-width: 620px; margin: 0; font-size: clamp(16px, 1.35vw, 21px); line-height: 1.45; color: rgba(228,237,255,.8); }
.login-panel { position: relative; isolation: isolate; display: grid; place-items: center; padding: 40px; background-color: #f9fbff; background-image: radial-gradient(circle at 8% 14%, rgba(194,213,255,.5), transparent 22%), radial-gradient(circle at 88% 86%, rgba(208,241,225,.42), transparent 27%), radial-gradient(rgba(30,69,158,.065) .75px, transparent .75px), linear-gradient(150deg, rgba(255,255,255,.98), rgba(245,248,255,.96)); background-size: auto, auto, 24px 24px, auto; }
.login-panel::before { content: ""; position: absolute; z-index: 0; inset: 0 auto 0 0; width: 1px; background: linear-gradient(to bottom, transparent 5%, rgba(112,151,228,.26) 24%, rgba(99,205,151,.4) 50%, rgba(112,151,228,.24) 76%, transparent 95%); box-shadow: -18px 0 46px rgba(4,25,75,.11), 12px 0 34px rgba(72,111,196,.05); }
.login-card { position: relative; z-index: 1; width: min(480px, 100%); padding: clamp(26px, 3.2vw, 42px); display: grid; gap: 20px; overflow: hidden; border: 1px solid rgba(35,73,156,.12); border-radius: 25px; background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(252,253,255,.88)); box-shadow: 0 34px 90px rgba(17,42,95,.14), 0 7px 22px rgba(17,42,95,.06), inset 0 1px rgba(255,255,255,.98); backdrop-filter: blur(18px); }
.login-card::before { content: ""; position: absolute; top: 0; right: 32px; left: 32px; height: 2px; border-radius: 0 0 99px 99px; background: linear-gradient(90deg, transparent, #4d76e4 32%, #54c98c 68%, transparent); box-shadow: 0 3px 16px rgba(67,120,212,.24); }
.login-card-logo { display: none; width: 270px; max-width: 100%; }
.login-mobile-timeline { display: none; }
.login-card h2 { margin: 7px 0 7px; font-size: clamp(32px, 3vw, 40px); line-height: 1.05; letter-spacing: -.045em; }
.login-card p { margin: 0; color: var(--muted); line-height: 1.55; }
.login-card label, .filter-bar label, .visit-form label, .form-grid label, .inline-fields label { display: grid; gap: 8px; font-weight: 700; color: #35415a; font-size: 13px; }
.login-card input, .filter-bar input, .filter-bar select, .visit-form input, .visit-form textarea, .form-grid input, .form-grid select, .inline-fields input { width: 100%; min-height: 48px; border: 1px solid #d8deea; border-radius: 12px; padding: 11px 13px; color: var(--ink); background: #fff; }
.login-access-field { position: relative; margin-top: -12px; }
.login-access-field .app-icon { position: absolute; z-index: 1; left: 15px; top: 50%; width: 21px; height: 21px; transform: translateY(-50%); color: var(--chemma-blue); pointer-events: none; }
.login-card .login-access-field input { min-height: 58px; padding-left: 50px; border-radius: 15px; background: rgba(255,255,255,.9); transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.login-card .login-access-field input:focus { border-color: #3b62d7; background: #fff; box-shadow: 0 0 0 5px rgba(59,98,215,.1), 0 10px 30px rgba(25,65,151,.08); outline: 0; }
.login-card .login-password-field input { padding-right: 84px; }
.password-visibility-toggle { position: absolute; z-index: 2; right: 10px; top: 50%; min-height: 38px; transform: translateY(-50%); border: 0; border-radius: 9px; padding: 0 10px; color: var(--chemma-blue); background: transparent; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.password-visibility-toggle:hover, .password-visibility-toggle:focus-visible { background: var(--chemma-blue-soft); outline: 0; }
.primary-button, .secondary-button { min-height: 48px; border: 0; border-radius: 12px; padding: 0 18px; font-weight: 800; transition: transform .15s ease, box-shadow .15s ease; }
.primary-button { color: #fff; background: linear-gradient(135deg, var(--chemma-blue), #2055c7); box-shadow: 0 8px 20px rgba(18,59,155,.2); }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 12px 25px rgba(18,59,155,.25); }
.login-submit { position: relative; isolation: isolate; min-height: 58px; overflow: hidden; border-radius: 15px; display: flex; align-items: center; justify-content: center; gap: 12px; background: linear-gradient(120deg, #102a89, #3559d1 68%, #2548c5); box-shadow: 0 17px 35px rgba(33,67,170,.25); }
.login-submit::before { content: ""; position: absolute; z-index: -1; inset: -50% auto -50% -45%; width: 34%; transform: rotate(16deg); background: linear-gradient(90deg, transparent, rgba(255,255,255,.42), transparent); animation: login-button-shine 4.8s 1.8s ease-in-out infinite; }
.login-submit .app-icon { width: 20px; height: 20px; transition: transform .2s ease; }
.login-submit:hover .app-icon { transform: translateX(3px); }
.login-submit:active { transform: translateY(1px) scale(.995); }
.secondary-button { color: var(--chemma-blue); background: var(--chemma-blue-soft); }
.form-error { min-height: 20px; color: var(--chemma-red) !important; font-size: 13px; font-weight: 700; }
.login-trust { min-height: 18px; margin-top: -12px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #7a859c; font-size: 11px; font-weight: 750; letter-spacing: .02em; }
.login-trust > span { width: 7px; height: 7px; border-radius: 50%; background: var(--chemma-green); box-shadow: 0 0 0 4px var(--chemma-green-soft); }
.eyebrow { display: block; color: var(--chemma-blue); font-size: 11px; line-height: 1.2; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow.light { color: #9ce3ba; }

@keyframes brand-wash-drift { to { transform: translate3d(-2%, 2%, 0) scale(1.05); } }
@keyframes orbit-drift { to { transform: translate3d(-18px, 12px, 0) rotate(4deg); } }
@keyframes particle-float { 0%, 100% { transform: translate3d(0, 0, 0); opacity: .35; } 50% { transform: translate3d(12px, -20px, 0); opacity: 1; } }
@keyframes forecast-line-draw { to { stroke-dashoffset: 0; } }
@keyframes forecast-node-arrive { from { opacity: 0; } to { opacity: 1; } }
@keyframes forecast-pulse { 0% { opacity: .75; transform: scale(.8); } 75%, 100% { opacity: 0; transform: scale(2.6); } }
@keyframes login-button-shine { 0%, 70% { left: -45%; } 88%, 100% { left: 125%; } }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; width: 232px; padding: 24px 16px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; text-decoration: none; color: var(--chemma-blue); }
.sidebar-brand img { width: 38px; height: 58px; object-fit: contain; }
.sidebar-brand span { display: grid; }
.sidebar-brand strong { font-size: 21px; letter-spacing: .04em; }
.sidebar-brand small { color: var(--muted); }
.main-nav { display: grid; gap: 7px; }
.nav-button { min-height: 48px; border: 0; border-radius: 12px; padding: 0 14px; background: transparent; color: #536078; display: flex; align-items: center; gap: 13px; font-weight: 750; text-align: left; }
.nav-button span { width: 22px; text-align: center; font-size: 21px; }
.nav-button span, .nav-button .app-icon { flex: 0 0 auto; }
.nav-button:hover { color: var(--chemma-blue); background: #f5f8ff; }
.nav-button.is-active { color: var(--chemma-blue); background: var(--chemma-blue-soft); }
.sidebar-footer { margin-top: auto; display: grid; grid-template-columns: 40px 1fr 38px; align-items: center; gap: 10px; padding: 15px 4px 0; border-top: 1px solid var(--line); }
.sidebar-footer div:nth-child(2) { display: grid; min-width: 0; }
.sidebar-footer small { color: var(--muted); font-size: 11px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--chemma-blue); font-weight: 900; }
.icon-button, .text-button { min-width: 42px; min-height: 42px; border: 0; background: transparent; color: var(--chemma-blue); font-weight: 800; border-radius: 10px; }
.icon-button:hover, .text-button:hover { background: var(--chemma-blue-soft); }
.mobile-logout-button { min-height: 42px; border: 0; border-radius: 11px; padding: 0 11px; display: inline-flex; align-items: center; gap: 7px; color: var(--chemma-blue); background: var(--chemma-blue-soft); font-weight: 800; }
.mobile-logout-button .app-icon { width: 19px; height: 19px; }
.mobile-header, .bottom-nav { display: none; }
.main-content { min-width: 0; margin-left: 232px; padding: 42px clamp(28px, 4vw, 64px) 80px; }
.view { width: 100%; min-width: 0; max-width: 1500px; margin: 0 auto; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.page-heading.compact { margin-bottom: 22px; }
.page-heading h1 { margin: 6px 0 6px; font-size: clamp(30px, 3.2vw, 48px); line-height: 1.08; letter-spacing: -.045em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 16px; }
.source-pill { display: flex; align-items: flex-start; gap: 12px; min-width: 330px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.source-pill > span { width: 9px; height: 9px; border-radius: 50%; background: var(--chemma-green); box-shadow: 0 0 0 5px var(--chemma-green-soft); }
.source-pill div { display: grid; }
.source-pill small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.source-pill small + small { margin-top: 2px; }
.notice-card { display: flex; align-items: flex-start; gap: 12px; padding: 15px 18px; border: 1px solid #cfdcff; background: #f6f8ff; border-radius: 14px; margin-bottom: 20px; color: #31405f; }
.notice-card p { margin: 0; line-height: 1.45; font-size: 14px; }
.notice-icon { flex: 0 0 25px; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--chemma-blue); color: #fff; font-weight: 900; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi-card { min-height: 150px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 8px 25px rgba(28,50,95,.04); display: flex; flex-direction: column; }
.kpi-card span { color: var(--muted); font-size: 13px; font-weight: 750; }
.kpi-card strong { margin: auto 0 2px; font-size: 40px; letter-spacing: -.05em; }
.kpi-card small { color: var(--muted); }
.kpi-card.urgent { border-color: #ffd6dc; background: linear-gradient(145deg, #fff, var(--chemma-red-soft)); }
.kpi-card.urgent strong { color: var(--chemma-red); }
.content-grid { display: grid; gap: 20px; }
.dashboard-grid { grid-template-columns: minmax(0, 1.7fr) minmax(280px, .65fr); }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 8px 28px rgba(28,50,95,.04); }
.priority-panel, .confidence-panel, .overdue-panel, .future-panel { padding: 22px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.panel-heading h2, .confidence-panel h2 { margin: 5px 0 0; font-size: 22px; letter-spacing: -.025em; }
.priority-list { display: grid; }
.priority-row { display: grid; grid-template-columns: 12px minmax(150px, 1.3fr) minmax(150px, 1fr) 115px 100px 42px; align-items: center; gap: 13px; min-height: 72px; border-top: 1px solid var(--line); }
.priority-row:first-child { border-top: 0; }
.status-bar { width: 5px; height: 38px; border-radius: 99px; background: var(--chemma-green); }
.status-bar.urgent { background: var(--chemma-red); }
.status-bar.soon { background: var(--chemma-yellow); }
.priority-row .primary, .priority-row .secondary { min-width: 0; }
.priority-row .primary strong, .priority-row .secondary strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.priority-row small { color: var(--muted); }
.time-label { font-weight: 900; color: var(--chemma-blue); }
.time-label.urgent { color: var(--chemma-red); }
.confidence-panel { align-self: start; }
.legend-item { display: flex; align-items: center; gap: 12px; margin-top: 19px; }
.legend-item div { display: grid; }
.legend-item small { color: var(--muted); }
.confidence-dot { width: 13px; height: 13px; border-radius: 50%; box-shadow: 0 0 0 5px #f0f2f7; }
.confidence-dot.reliable { background: var(--chemma-green); box-shadow: 0 0 0 5px var(--chemma-green-soft); }
.confidence-dot.probable { background: var(--chemma-yellow); box-shadow: 0 0 0 5px var(--chemma-yellow-soft); }
.confidence-dot.indicative { background: #8792a9; }
.legend-note { margin: 23px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); line-height: 1.5; font-size: 13px; }

.filter-bar { display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(150px, .65fr)); gap: 12px; margin-bottom: 16px; padding: 15px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.filter-bar label { color: var(--muted); }
.filter-bar input, .filter-bar select { min-height: 43px; }
.customer-filters { grid-template-columns: minmax(250px, 1.35fr) minmax(140px, .55fr) minmax(170px, .65fr) minmax(220px, .85fr); }
.calendar-toolbar { min-height: 68px; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: #fff; }
.calendar-toolbar > div:nth-child(2) { display: grid; min-width: 210px; text-align: center; }
.calendar-toolbar small { color: var(--muted); }
.event-legend { margin-left: auto; display: flex !important; flex-direction: row !important; gap: 15px; min-width: auto !important; font-size: 12px; color: var(--muted); }
.event-legend span::before { content: ""; display: inline-block; width: 11px; height: 7px; margin-right: 6px; border-radius: 3px; background: var(--chemma-blue); }
.event-legend .forecast-key::before { background: #fff; border: 2px dashed var(--chemma-green); }
.event-legend .planned-key::before { background: #7a4fd0; }
.calendar-color-legend { min-height: 48px; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; border-right: 1px solid var(--line); border-left: 1px solid var(--line); background: #fbfcff; color: var(--muted); font-size: 12px; }
.calendar-color-legend strong { color: var(--ink); font-size: 12px; }
.calendar-color-legend span { display: inline-flex; align-items: center; gap: 7px; font-weight: 750; }
.calendar-color-legend span::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: #8792a9; box-shadow: 0 0 0 3px rgba(135,146,169,.13); }
.calendar-color-legend .reliable-key::before { background: var(--chemma-green); box-shadow: 0 0 0 3px var(--chemma-green-soft); }
.calendar-color-legend .probable-key::before { background: var(--chemma-yellow); box-shadow: 0 0 0 3px var(--chemma-yellow-soft); }
.calendar-color-legend small { margin-left: auto; color: var(--muted); }
.calendar-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); background: #fff; }
.calendar-grid { min-width: 980px; display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); }
.calendar-weekday { height: 38px; display: grid; place-items: center; color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; border-bottom: 1px solid var(--line); background: #f8f9fc; }
.calendar-day { min-height: 145px; padding: 9px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.outside { background: #fafbfe; color: #aab1bf; }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--chemma-blue); }
.day-number { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-bottom: 4px; border-radius: 50%; font-size: 12px; font-weight: 850; }
.today .day-number { background: var(--chemma-blue); color: #fff; }
.calendar-event { width: 100%; margin-top: 5px; padding: 6px 7px; border: 0; border-radius: 8px; color: #fff; background: var(--chemma-blue); text-align: left; font-size: 10px; line-height: 1.25; }
.calendar-event strong, .calendar-event span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event span { opacity: .8; }
.calendar-event.forecast { color: var(--ink); background: #fff; border: 2px dashed #8792a9; }
.calendar-event.forecast.affidabile { border-color: var(--chemma-green); background: var(--chemma-green-soft); }
.calendar-event.forecast.probabile { border-color: var(--chemma-yellow); background: var(--chemma-yellow-soft); }
.calendar-event.planned { background: #7147be; }
.more-events { display: block; margin-top: 5px; color: var(--chemma-blue); font-size: 10px; font-weight: 800; }
.overdue-panel { margin-top: 20px; }
.future-panel { margin-top: 20px; }
.future-panel-heading { align-items: flex-start; }
.future-confidence-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px 12px; max-width: 520px; }
.future-confidence-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 750; }
.future-confidence-legend span::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: #98a0af; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.future-confidence-legend .probabile::before { background: var(--chemma-yellow); }
.future-confidence-legend .affidabile::before { background: var(--chemma-green); }
.future-confidence-legend .programmato::before { background: #7147be; }
.compact-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.compact-item { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 13px 14px; border-radius: 12px; background: var(--chemma-red-soft); }
.compact-item div { min-width: 0; }
.compact-item strong, .compact-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-item small { color: var(--muted); }
.compact-item > strong { color: var(--chemma-red); }
.future-item { background: #f2f3f6; border: 1px solid #d8dce4; }
.future-item > strong { color: #667085; }
.future-item.affidabile { background: var(--chemma-green-soft); border-color: #cdebd7; }
.future-item.affidabile > strong { color: #2f7a49; }
.future-item.probabile { background: var(--chemma-yellow-soft); border-color: #f0dea2; }
.future-item.probabile > strong { color: #8a6a13; }
.future-item.planned { background: #f6f1ff; border-color: #dfd1fa; }
.future-item.planned > strong { color: #6335b0; }

.statistics-page-heading { align-items: center; }
.statistics-coverage { min-width: 285px; padding: 14px 16px; display: flex; align-items: flex-start; gap: 12px; border: 1px solid rgba(18,59,155,.1); border-radius: 15px; background: linear-gradient(145deg, #fff, #f7f9ff); box-shadow: 0 10px 30px rgba(28,50,95,.05); }
.statistics-coverage > span { flex: 0 0 auto; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--chemma-green); box-shadow: 0 0 0 5px var(--chemma-green-soft); }
.statistics-coverage div { display: grid; }
.statistics-coverage small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.statistics-filters { grid-template-columns: repeat(2, minmax(180px, 260px)) auto; justify-content: end; align-items: end; }
.statistics-reset-filter { min-height: 44px; padding: 0 16px; border: 1px solid rgba(18,59,155,.18); border-radius: 11px; background: #eef3ff; color: var(--chemma-blue); font: inherit; font-size: 12px; font-weight: 850; white-space: nowrap; }
.statistics-reset-filter:hover { border-color: rgba(18,59,155,.35); background: #e5edff; }
.statistics-partial-notice { margin-bottom: 16px; padding: 13px 16px; display: flex; align-items: center; gap: 11px; border: 1px solid #eddca7; border-radius: 14px; background: #fffaf0; color: #66521d; }
.statistics-partial-notice > span { flex: 0 0 auto; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--chemma-gold); color: #fff; font-weight: 900; }
.statistics-partial-notice p { margin: 0; font-size: 13px; line-height: 1.4; }
.statistics-kpi-grid { margin-bottom: 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.statistics-kpi { min-width: 0; min-height: 146px; padding: 19px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: 0 10px 30px rgba(28,50,95,.045); }
.statistics-kpi.primary { border-color: rgba(18,59,155,.16); background: linear-gradient(145deg, #fff, #f2f6ff); }
.statistics-kpi > span { color: var(--muted); font-size: 12px; font-weight: 800; }
.statistics-kpi strong { margin: auto 0 3px; color: var(--chemma-blue-dark); font-size: clamp(27px, 2.6vw, 39px); line-height: 1; letter-spacing: -.045em; overflow-wrap: anywhere; }
.statistics-kpi.primary strong { color: var(--chemma-blue); }
.statistics-kpi small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.statistics-attention-panel { margin-bottom: 20px; padding: 22px; overflow: hidden; }
.statistics-attention-period { margin: -8px 0 16px; color: var(--muted); font-size: 11px; }
.statistics-attention-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.statistics-attention-card { min-width: 0; min-height: 154px; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; border: 1px solid var(--line); border-radius: 15px; background: #fbfcff; }
.statistics-attention-card.recover { border-color: #f2d4d8; background: linear-gradient(145deg, #fff, #fff6f7); }
.statistics-attention-card.growth { border-color: #cedcff; background: linear-gradient(145deg, #fff, #f2f6ff); }
.statistics-attention-card.decline { border-color: #ecdcae; background: linear-gradient(145deg, #fff, #fffaf0); }
.statistics-attention-card.increase { border-color: #cce8d7; background: linear-gradient(145deg, #fff, #f1fbf5); }
.statistics-attention-card > div { min-width: 0; display: flex; flex-direction: column; }
.statistics-attention-card span { color: var(--muted); font-size: 11px; font-weight: 850; }
.statistics-attention-card strong { margin: auto 0 4px; color: var(--chemma-blue-dark); font-size: 31px; line-height: 1; }
.statistics-attention-card.recover strong { color: var(--chemma-red); }
.statistics-attention-card.growth strong { color: var(--chemma-blue); }
.statistics-attention-card.decline strong { color: #957111; }
.statistics-attention-card.increase strong { color: #287744; }
.statistics-attention-card small { max-width: 100%; color: var(--muted); font-size: 10px; line-height: 1.35; overflow-wrap: anywhere; }
.statistics-attention-card button { align-self: end; min-height: 38px; padding: 0 12px; border: 1px solid rgba(18,59,155,.15); border-radius: 10px; color: var(--chemma-blue); background: rgba(255,255,255,.72); font: inherit; font-size: 10px; font-weight: 900; white-space: nowrap; }
.statistics-attention-card button:hover:not(:disabled) { border-color: rgba(18,59,155,.32); background: #fff; }
.statistics-attention-card button:disabled { color: #8d96a8; cursor: default; }
.statistics-trend-panel { margin-bottom: 20px; padding: 22px; overflow: hidden; }
.statistics-panel-heading { align-items: flex-start; }
.statistics-panel-heading > small, .statistics-block .panel-heading > small { color: var(--muted); font-size: 11px; }
.statistics-chart-scroll { overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.statistics-month-chart { min-width: max-content; height: 255px; padding: 7px 2px 2px; display: flex; align-items: stretch; gap: 7px; }
.statistics-month-bar { width: 62px; min-width: 62px; padding: 0 3px; display: grid; grid-template-rows: 27px 1fr 22px; justify-items: center; border: 0; border-radius: 11px; background: transparent; color: var(--muted); }
.statistics-month-bar:hover, .statistics-month-bar.is-selected { background: #f1f5ff; color: var(--chemma-blue); }
.statistics-month-bar > strong { width: 100%; overflow: hidden; font-size: 9px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.statistics-month-bar > small { align-self: end; font-size: 9px; font-weight: 800; text-transform: capitalize; }
.statistics-bar-track { position: relative; width: 31px; height: 100%; overflow: hidden; align-self: end; border-radius: 9px 9px 4px 4px; background: #edf0f6; }
.statistics-bar-track i { position: absolute; inset: auto 0 0; height: var(--bar-height); border-radius: inherit; background: linear-gradient(180deg, #4f76df, var(--chemma-blue)); box-shadow: 0 -5px 18px rgba(48,89,203,.2); transition: height .35s ease; }
.statistics-month-bar.is-selected .statistics-bar-track i { background: linear-gradient(180deg, #54c989, var(--chemma-green)); }
.statistics-month-bar.is-partial .statistics-bar-track { background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(200,149,24,.13) 5px 9px); outline: 1px dashed rgba(200,149,24,.55); }
.statistics-month-detail { margin-top: 18px; padding-top: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; border-top: 1px solid var(--line); }
.statistics-detail-card { min-width: 0; min-height: 107px; padding: 14px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 13px; background: #fbfcff; }
.statistics-detail-card.highlight { border-color: #cfdcff; background: #f3f6ff; }
.statistics-detail-card.positive { border-color: #cdebd7; background: var(--chemma-green-soft); }
.statistics-detail-card.negative { border-color: #ffd6dc; background: var(--chemma-red-soft); }
.statistics-detail-card span { color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.statistics-detail-card strong { margin: auto 0 4px; color: var(--chemma-blue-dark); font-size: 18px; line-height: 1.12; overflow-wrap: anywhere; }
.statistics-detail-card small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.statistics-detail-card.positive strong { color: #287744; }
.statistics-detail-card.negative strong { color: var(--chemma-red); }
.statistics-two-column { margin-bottom: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.statistics-block { min-width: 0; padding: 22px; overflow: hidden; }
.statistics-year-list { display: grid; gap: 13px; }
.statistics-year-row { width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.statistics-year-heading { margin-bottom: 7px; display: flex; align-items: baseline; justify-content: space-between; gap: 15px; }
.statistics-year-heading strong { color: var(--chemma-blue-dark); font-size: 21px; }
.statistics-year-heading span { color: var(--muted); font-size: 11px; text-align: right; }
.statistics-year-track { display: block; height: 10px; overflow: hidden; border-radius: 99px; background: #edf0f6; }
.statistics-year-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--chemma-blue), #4f76df); transition: width .3s ease; }
.statistics-year-row:hover .statistics-year-track i { background: linear-gradient(90deg, var(--chemma-green), #57c98b); }
.statistics-portfolio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.statistics-portfolio-card { min-height: 112px; padding: 13px; display: flex; flex-direction: column; border-radius: 13px; background: #f4f6fa; }
.statistics-portfolio-card.recurring { background: var(--chemma-green-soft); }
.statistics-portfolio-card.developing { background: var(--chemma-yellow-soft); }
.statistics-portfolio-card.new { background: #f0f2f6; }
.statistics-portfolio-card span { color: var(--muted); font-size: 10px; font-weight: 850; }
.statistics-portfolio-card strong { margin: auto 0 2px; color: var(--chemma-blue-dark); font-size: 30px; }
.statistics-portfolio-card small { color: var(--muted); font-size: 9px; line-height: 1.3; }
.statistics-definition { margin: 13px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.statistics-context-label { max-width: 210px; padding: 7px 10px; border: 1px solid rgba(18,59,155,.12); border-radius: 999px; color: var(--chemma-blue); background: #f2f6ff; font-size: 10px; font-weight: 850; line-height: 1.2; text-align: center; }
.statistics-ranking { display: grid; }
.statistics-ranking-row { padding: 11px 0; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 9px; border-top: 1px solid var(--line); }
.statistics-ranking-row:first-child { border-top: 0; padding-top: 0; }
.statistics-rank { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; color: var(--chemma-blue); background: var(--chemma-blue-soft); font-size: 10px; font-weight: 900; }
.statistics-ranking-body { min-width: 0; }
.statistics-ranking-body > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.statistics-ranking-body strong { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.statistics-ranking-body > div span { flex: 0 0 auto; color: var(--chemma-blue-dark); font-size: 11px; font-weight: 850; }
.statistics-ranking-body small { color: var(--muted); font-size: 9px; }
.statistics-ranking-track { display: block; height: 5px; margin: 6px 0 4px; overflow: hidden; border-radius: 99px; background: #edf0f6; }
.statistics-ranking-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--chemma-blue), #6484df); }
.statistics-show-all { width: 100%; min-height: 44px; margin-top: 12px; border: 1px solid rgba(18,59,155,.16); border-radius: 12px; background: #f0f4ff; color: var(--chemma-blue); font: inherit; font-size: 12px; font-weight: 900; }
.statistics-show-all:hover { border-color: rgba(18,59,155,.32); background: #e7eeff; }
.statistics-ranking-dialog { width: min(720px, calc(100vw - 32px)); max-width: none; max-height: min(820px, calc(100dvh - 32px)); padding: 0; overflow: hidden; border: 0; border-radius: 22px; color: var(--ink); background: #fff; box-shadow: 0 28px 90px rgba(8,25,67,.3); }
.statistics-ranking-dialog::backdrop { background: rgba(10,24,54,.55); backdrop-filter: blur(5px); }
.statistics-dialog-shell { max-height: min(820px, calc(100dvh - 32px)); padding: 24px; display: flex; flex-direction: column; }
.statistics-dialog-heading { flex: 0 0 auto; margin-bottom: 18px; padding-bottom: 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.statistics-dialog-heading h2 { margin: 5px 0 3px; color: var(--chemma-blue-dark); font-size: 26px; }
.statistics-dialog-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.statistics-dialog-heading button { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; color: var(--chemma-blue-dark); background: #f6f8fc; }
.statistics-dialog-heading button .app-icon { width: 18px; height: 18px; }
.statistics-dialog-ranking { min-height: 0; padding-right: 5px; overflow-y: auto; overscroll-behavior: contain; }
.statistics-attention-dialog-content { min-height: 0; padding: 2px 5px 2px 2px; overflow-y: auto; overscroll-behavior: contain; }
.statistics-attention-dialog-section { --section-color: var(--chemma-blue); --section-soft: #eef3ff; overflow: clip; border: 1px solid color-mix(in srgb, var(--section-color) 20%, #dfe5f2); border-radius: 15px; background: #fff; }
.statistics-attention-dialog-section + .statistics-attention-dialog-section { margin-top: 18px; }
.statistics-attention-dialog-section.red { --section-color: var(--chemma-red); --section-soft: #fff1f3; }
.statistics-attention-dialog-section.green { --section-color: #287744; --section-soft: #edf9f2; }
.statistics-attention-dialog-section.gold { --section-color: #8a6500; --section-soft: #fff8df; }
.statistics-attention-dialog-section h3 { position: sticky; z-index: 2; top: 0; min-height: 47px; margin: 0; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid color-mix(in srgb, var(--section-color) 18%, #dfe5f2); color: var(--section-color); background: color-mix(in srgb, var(--section-soft) 94%, transparent); backdrop-filter: blur(10px); font-size: 13px; }
.statistics-attention-dialog-section h3 span { min-width: 0; }
.statistics-attention-dialog-section h3 strong { flex: 0 0 auto; min-width: 29px; height: 27px; padding: 0 8px; display: grid; place-items: center; border-radius: 99px; color: #fff; background: var(--section-color); font-size: 11px; }
.statistics-attention-detail-row { margin: 0 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.statistics-attention-dialog-section h3 + .statistics-attention-detail-row { border-top: 0; }
.statistics-attention-detail-row > div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.statistics-attention-detail-row strong { min-width: 0; overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.statistics-attention-detail-row span { flex: 0 0 auto; color: var(--chemma-blue-dark); font-size: 11px; font-weight: 850; }
.statistics-attention-detail-row small, .statistics-empty-detail { color: var(--muted); font-size: 10px; line-height: 1.4; }
.statistics-empty-detail { margin: 0; padding: 13px 12px; }
.statistics-concentration { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.statistics-concentration-card { min-height: 108px; padding: 14px; display: flex; flex-direction: column; border: 1px solid #dfe5f2; border-radius: 13px; background: linear-gradient(145deg, #fff, #f7f9fe); }
.statistics-concentration-card span { color: var(--muted); font-size: 10px; font-weight: 850; }
.statistics-concentration-card strong { margin: auto 0 2px; color: var(--chemma-blue); font-size: 27px; }
.statistics-concentration-card small { color: var(--muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.statistics-insight { grid-column: 1 / -1; margin: 2px 0 0; padding: 12px 14px; border-radius: 12px; color: #244569; background: #eff8f4; font-size: 12px; font-weight: 750; line-height: 1.45; }
.statistics-heatmap { display: grid; grid-template-columns: 42px repeat(12, minmax(18px, 1fr)); gap: 5px; align-items: center; }
.statistics-heatmap-month { color: var(--muted); font-size: 8px; font-weight: 800; text-align: center; }
.statistics-heatmap-year { color: var(--chemma-blue-dark); font-size: 11px; }
.statistics-heatmap-cell { min-width: 0; aspect-ratio: 1; border: 0; border-radius: 6px; background: #f5f6f9; }
.statistics-heatmap-cell.has-data { background: color-mix(in srgb, var(--chemma-blue) calc(var(--heat, 0) * 100%), #edf1f8); }
.statistics-heatmap-cell.is-partial { border: 1px dashed var(--chemma-gold); }
.statistics-quality-panel { margin-bottom: 4px; display: grid; grid-template-columns: minmax(210px, .7fr) minmax(0, 2fr); gap: 25px; align-items: center; }
.statistics-quality-panel h2 { margin: 5px 0 0; font-size: 22px; }
.statistics-quality-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.statistics-quality-card { min-height: 95px; padding: 12px; display: flex; flex-direction: column; border-radius: 12px; background: #f6f8fb; }
.statistics-quality-card strong { color: var(--chemma-blue-dark); font-size: 19px; }
.statistics-quality-card span { margin-top: auto; font-size: 10px; font-weight: 850; }
.statistics-quality-card small { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.25; }

.table-panel { overflow: hidden; }
.table-wrap { display: block; width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 1120px; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: #f8f9fc; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
td { font-size: 13px; }
.customer-amount { color: var(--chemma-blue-dark); font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }
td strong, td small { display: block; }
td small { color: var(--muted); }
.row-status { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #a6adbb; }
.row-status.urgent { background: var(--chemma-red); }
.row-status.soon { background: var(--chemma-yellow); }
.row-status.later { background: var(--chemma-green); }
.row-status.dormant { background: #6f7a90; }
.confidence-badge { display: inline-flex; align-items: center; min-height: 27px; padding: 0 9px; border-radius: 99px; color: #59647a; background: #eef0f4; font-size: 11px; font-weight: 800; }
.confidence-badge.affidabile { color: #08763b; background: var(--chemma-green-soft); }
.confidence-badge.probabile { color: #8a6500; background: var(--chemma-yellow-soft); }
.confidence-badge.programmato { color: #6335b0; background: #f0eaff; }

.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.territory-map { position: relative; min-height: 650px; overflow: hidden; border: 1px solid rgba(18,59,155,.1); background: #eaf0f5; box-shadow: 0 20px 55px rgba(18,42,89,.12); }
#territory-map { width: 100%; height: 650px; }
.map-overlay { position: absolute; z-index: 3; top: 18px; left: 18px; display: flex; align-items: center; gap: 14px; padding: 11px 12px 11px 15px; border: 1px solid rgba(255,255,255,.75); border-radius: 16px; background: rgba(255,255,255,.92); box-shadow: 0 10px 30px rgba(20,33,61,.14); backdrop-filter: blur(14px); }
.map-overlay > div { display: grid; min-width: 95px; }
.map-overlay strong { font-size: 23px; line-height: 1.05; color: var(--chemma-blue-dark); }
.map-fit-button { min-height: 38px; padding: 0 12px; border: 0; border-radius: 10px; color: var(--chemma-blue); background: var(--chemma-blue-soft); font-size: 12px; font-weight: 850; }
.map-fit-button:hover { background: #dce7ff; }
.map-legend { position: absolute; z-index: 3; right: 18px; bottom: 22px; left: 18px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; width: fit-content; max-width: calc(100% - 36px); margin: auto; padding: 10px 14px; border: 1px solid rgba(255,255,255,.78); border-radius: 14px; background: rgba(255,255,255,.92); box-shadow: 0 8px 24px rgba(20,33,61,.12); backdrop-filter: blur(12px); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; color: #4f5d75; font-size: 11px; font-weight: 750; }
.map-legend i, .map-product-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #9ba4b5; }
.map-legend .urgent, .map-product-dot.urgent { background: var(--chemma-red); }
.map-legend .soon, .map-product-dot.soon { background: var(--chemma-yellow); }
.map-legend .later, .map-product-dot.later { background: var(--chemma-green); }
.map-legend .dormant, .map-product-dot.dormant { background: #647087; }
.map-legend .insufficient, .map-product-dot.insufficient { background: #aeb6c4; }
.maplibregl-ctrl-group { overflow: hidden; border: 0 !important; border-radius: 12px !important; box-shadow: 0 8px 24px rgba(20,33,61,.16) !important; }
.maplibregl-ctrl-group button { width: 40px; height: 40px; }
.maplibregl-popup-content { padding: 0 !important; overflow: hidden; border-radius: 14px !important; box-shadow: 0 12px 34px rgba(13,30,66,.2) !important; }
.customer-map-popup { min-width: 210px; padding: 15px 16px; display: grid; gap: 4px; }
.customer-map-popup > strong { margin-top: 3px; font-size: 15px; color: var(--chemma-blue-dark); }
.customer-map-popup > small { color: var(--muted); }
.customer-map-popup p { margin: 7px 0 0; padding-top: 8px; border-top: 1px solid var(--line); color: #34425d; font-size: 12px; font-weight: 700; }
.map-popup-status { width: fit-content; padding: 3px 7px; border-radius: 99px; color: #667085; background: #eef0f4; font-size: 9px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.map-popup-status.urgent { color: #b31328; background: var(--chemma-red-soft); }
.map-popup-status.soon { color: #8a6500; background: var(--chemma-yellow-soft); }
.map-popup-status.later { color: #08763b; background: var(--chemma-green-soft); }
.map-fallback { position: absolute; z-index: 5; inset: 0; padding: 30px; display: grid; place-content: center; gap: 5px; text-align: center; background: linear-gradient(145deg, #eef4ff, #f8fbff); }
.map-fallback span { color: var(--muted); }
.map-detail { padding: 24px; align-self: start; position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; }
.map-detail h2 { margin: 7px 0 4px; font-size: 25px; letter-spacing: -.025em; }
.map-detail p { color: var(--muted); line-height: 1.48; }
.map-customer-meta { margin-top: 0; font-size: 12px; }
.map-products-title { margin: 22px 0 10px; font-size: 13px; color: #34415a; }
.map-product-list { display: grid; gap: 7px; }
.map-product-row { display: grid; grid-template-columns: 10px 1fr; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfe; }
.map-product-row div { min-width: 0; display: grid; gap: 2px; }
.map-product-row strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.map-product-row small { color: var(--muted); font-size: 10px; }
.map-detail .primary-button, .map-directions-button { width: 100%; margin-top: 10px; }
.map-directions-button { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.map-accuracy-note { display: block; margin-top: 14px; color: #8791a4; font-size: 10px; line-height: 1.45; }
.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.catalog-card { min-height: 190px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: inherit; text-align: left; display: flex; flex-direction: column; align-items: flex-start; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.catalog-card:hover { transform: translateY(-2px); border-color: #bdccf2; box-shadow: 0 14px 32px rgba(18,42,89,.1); }
.catalog-card h3 { margin: 8px 0; font-size: 18px; color: var(--chemma-blue); }
.catalog-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.category-tag { display: inline-flex; padding: 4px 8px; border-radius: 6px; color: #08763b; background: var(--chemma-green-soft); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.catalog-card-action { margin-top: auto; padding-top: 15px; color: var(--chemma-blue); font-size: 12px; font-weight: 850; }

dialog { max-width: none; max-height: none; padding: 0; border: 0; background: transparent; }
dialog::backdrop { background: rgba(8,20,49,.55); backdrop-filter: blur(3px); }
.customer-dialog { width: min(760px, calc(100vw - 32px)); margin: auto 0 auto auto; height: 100vh; }
.catalog-product-dialog { width: min(900px, calc(100vw - 32px)); margin: auto; max-height: calc(100vh - 42px); }
.catalog-product-dialog .dialog-shell { border-radius: 22px; max-height: calc(100vh - 42px); overflow-y: auto; }
.customer-dialog .dialog-shell { min-height: 100%; border-radius: 24px 0 0 24px; }
.dialog-shell { background: #fff; padding: 28px; box-shadow: var(--shadow); }
.dialog-shell > header { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 18px; }
.dialog-shell header h2 { margin: 6px 0; font-size: 28px; }
.dialog-shell header p { margin: 0; color: var(--muted); }
.dialog-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.dialog-tabs button { min-height: 44px; padding: 0 13px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-weight: 800; white-space: nowrap; }
.dialog-tabs button.is-active { color: var(--chemma-blue); border-bottom-color: var(--chemma-blue); }
.dialog-tabs span { min-width: 22px; display: inline-grid; place-items: center; padding: 2px 6px; border-radius: 99px; background: var(--chemma-blue-soft); }
.customer-products { display: grid; gap: 10px; }
.customer-analytics { display: grid; gap: 13px; margin-bottom: 8px; padding: 16px; border: 1px solid #cfdbfb; border-radius: 16px; background: linear-gradient(145deg, #f9fbff, #eef3ff); }
.customer-analytics > h3 { margin: 0; font-size: 17px; color: var(--chemma-blue-dark); }
.customer-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.customer-stat-card { padding: 11px; border-radius: 11px; background: rgba(255,255,255,.88); border: 1px solid rgba(18,59,155,.09); }
.customer-stat-card span, .customer-stat-card strong { display: block; }
.customer-stat-card span { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.customer-stat-card strong { margin-top: 4px; color: var(--chemma-blue-dark); font-size: 16px; }
.customer-chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.customer-mini-chart { padding: 12px; border-radius: 12px; background: rgba(255,255,255,.82); }
.customer-mini-chart h4 { margin: 0 0 10px; font-size: 12px; }
.mini-bar-row { display: grid; gap: 4px; margin-top: 8px; }
.mini-bar-heading { display: flex; justify-content: space-between; gap: 8px; font-size: 9px; }
.mini-bar-heading span { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.mini-bar-heading strong { flex: 0 0 auto; font-size: 9px; }
.mini-bar-track { height: 6px; overflow: hidden; border-radius: 99px; background: #e5e9f2; }
.mini-bar-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--chemma-blue), #3d72e3); }
.forecast-evidence { display: grid; gap: 16px; }
.evidence-hero { padding: 18px; border: 1px solid #cfdbfb; border-radius: 16px; background: linear-gradient(145deg, #f8faff, var(--chemma-blue-soft)); }
.evidence-hero-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.evidence-hero h3 { margin: 5px 0 4px; font-size: 22px; color: var(--chemma-blue-dark); }
.evidence-hero p { margin: 0; color: var(--muted); line-height: 1.45; }
.evidence-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.evidence-metrics-single { grid-template-columns: minmax(220px, 360px); }
.evidence-metrics-annual { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.evidence-metric { padding: 12px; border-radius: 12px; background: rgba(255,255,255,.82); border: 1px solid rgba(18,59,155,.1); }
.evidence-metric span, .evidence-metric strong { display: block; }
.evidence-metric span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.evidence-metric strong { margin-top: 4px; font-size: 17px; }
.evidence-reason { display: flex; gap: 11px; align-items: flex-start; padding: 14px; border-radius: 13px; background: var(--chemma-yellow-soft); color: #564817; line-height: 1.45; }
.evidence-reason > span { flex: 0 0 24px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--chemma-yellow); font-weight: 900; }
.evidence-reason p { margin: 0; }
.evidence-section { padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
.evidence-section h3 { margin: 0 0 11px; font-size: 16px; }
.interval-list { display: flex; flex-wrap: wrap; gap: 7px; }
.interval-chip { padding: 6px 9px; border-radius: 8px; color: var(--chemma-blue); background: var(--chemma-blue-soft); font-size: 12px; font-weight: 850; }
.evidence-table-wrap { overflow-x: auto; }
.evidence-table { min-width: 650px; }
.evidence-table th, .evidence-table td { padding: 10px 12px; }
.evidence-table tr:last-child td { border-bottom: 0; }
.calculation-line { padding: 12px 14px; border-left: 4px solid var(--chemma-green); border-radius: 8px; background: var(--chemma-green-soft); color: #165936; font-weight: 750; line-height: 1.45; }
.future-evidence-section { border-color: #cad8fb; background: #f8faff; }
.future-evidence-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 8px; }
.future-evidence-card { padding: 12px; border: 1px solid #cdd9f7; border-radius: 11px; background: #fff; }
.future-evidence-card.planned { border-color: #d8c8f7; background: #faf7ff; }
.future-evidence-card span, .future-evidence-card strong, .future-evidence-card small { display: block; }
.future-evidence-card span { color: var(--chemma-blue); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.future-evidence-card strong { margin-top: 4px; color: var(--chemma-blue-dark); }
.future-evidence-card small { margin-top: 2px; color: var(--muted); }
.evidence-section-note { margin: -4px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.future-history-row { color: var(--chemma-blue-dark); background: #f0f4ff; font-weight: 700; }
.future-history-row.planned { color: #6335b0; background: #f6f1ff; }
.skipped-history-row { color: #9a3412; background: #fff4ed; font-weight: 700; }
.skipped-history-row td:nth-child(2)::after { content: " · nessun ordine registrato"; font-weight: 500; }
.customer-product { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; }
.customer-product > div { min-width: 0; }
.customer-product-details { min-height: 38px; padding: 0 13px; }
.customer-product strong, .customer-product small { display: block; }
.customer-product small { color: var(--muted); margin-top: 2px; }
.customer-product .customer-product-spend { margin-top: 7px; color: var(--chemma-blue-dark); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.4; }
.customer-product.stopped { opacity: .62; background: #f5f5f7; }
.no-forecast-reason { padding: 13px 15px; border-left: 4px solid #9ba4b5; border-radius: 9px; background: #f1f3f6; color: #566176; font-weight: 750; line-height: 1.45; }
.catalog-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.catalog-summary-metric { padding: 14px; border-radius: 13px; background: var(--chemma-blue-soft); }
.catalog-summary-metric span, .catalog-summary-metric strong { display: block; }
.catalog-summary-metric span { color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.catalog-summary-metric strong { margin-top: 4px; color: var(--chemma-blue-dark); font-size: 22px; }
.catalog-customer-list { display: grid; gap: 8px; }
.catalog-customer-row { width: 100%; display: grid; grid-template-columns: minmax(220px, 1fr) 120px 120px 28px; align-items: center; gap: 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: inherit; text-align: left; }
.catalog-customer-row:hover { border-color: #bdccf2; background: #f8faff; }
.catalog-customer-row div { min-width: 0; }
.catalog-customer-row strong, .catalog-customer-row small { display: block; }
.catalog-customer-row small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.catalog-customer-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-row-arrow { color: var(--chemma-blue); font-size: 19px; font-weight: 900; }
.timeline { display: grid; gap: 12px; }
.timeline-item { position: relative; padding: 0 0 16px 26px; border-left: 2px solid #dce3ef; }
.timeline-button { width: 100%; border-top: 0; border-right: 0; border-bottom: 0; background: transparent; color: inherit; text-align: left; }
.timeline-button:hover strong { color: var(--chemma-blue); }
.timeline-divider { margin: 4px 0 2px; padding: 8px 10px; border-radius: 9px; color: #5f6b82; background: #eef0f4; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.timeline-divider.future { color: var(--chemma-blue); background: var(--chemma-blue-soft); }
.timeline-item.future-order { border-left-color: #9bb4f0; }
.timeline-item.future-order::before { background: #fff; border-color: var(--chemma-blue); box-shadow: 0 0 0 3px var(--chemma-blue-soft); }
.timeline-item.future-order.planned::before { border-color: #7747bd; box-shadow: 0 0 0 3px #f0eaff; }
.timeline-item::before { content: ""; position: absolute; top: 2px; left: -7px; width: 12px; height: 12px; border-radius: 50%; background: var(--chemma-blue); border: 3px solid #fff; box-shadow: 0 0 0 1px #dce3ef; }
.timeline-item strong, .timeline-item small { display: block; }
.timeline-item p { margin: 6px 0 0; white-space: pre-wrap; line-height: 1.45; }
.timeline-item small { color: var(--muted); }
.visit-form { display: grid; grid-template-columns: 170px 1fr auto; align-items: end; gap: 10px; padding: 14px; margin-bottom: 20px; border-radius: 14px; background: #f7f9fd; }
.visit-form textarea { min-height: 74px; resize: vertical; }
.product-dialog { width: min(680px, calc(100vw - 32px)); max-height: calc(100dvh - 24px); margin: auto; }
.product-dialog .dialog-shell { max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; border-radius: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full-width { grid-column: 1 / -1; }
.form-grid small { color: var(--muted); font-weight: 500; }
.planned-box { margin-top: 18px; padding: 15px; border-radius: 14px; background: var(--chemma-green-soft); }
.planned-box h3 { margin: 0 0 11px; font-size: 15px; }
.inline-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dialog-shell footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 26px; transform: translate(-50%, 30px); padding: 12px 18px; border-radius: 12px; color: #fff; background: var(--chemma-blue-dark); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.empty-state { padding: 28px; text-align: center; color: var(--muted); }

@media (max-width: 1320px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .confidence-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 20px; }
  .confidence-panel > .eyebrow, .confidence-panel > h2, .confidence-panel > .legend-note { grid-column: 1 / -1; }
}

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .catalog-grid { grid-template-columns: repeat(2, 1fr); }
  .customer-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px), (max-width: 1024px) and (max-height: 620px) {
  .login-screen { grid-template-columns: 1fr; background: radial-gradient(circle at 50% -8%, rgba(71,111,211,.22), transparent 42%), linear-gradient(180deg, #eef3ff, #fbfcff); }
  .login-brand { display: none; }
  .login-panel { min-width: 0; min-height: 0; height: 100%; padding: max(20px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
  .login-panel::before { display: none; }
  .login-card { padding: 28px; border-radius: 24px; background: rgba(255,255,255,.88); box-shadow: 0 24px 65px rgba(18,42,89,.14); }
  .login-card-logo { display: block; }
  .login-mobile-timeline { position: relative; margin: -2px 4px 2px; display: flex; justify-content: space-between; color: #53658d; font-size: 10px; font-weight: 850; letter-spacing: .04em; }
  .login-mobile-timeline::before { content: ""; position: absolute; top: 6px; right: 20px; left: 20px; height: 2px; background: linear-gradient(90deg, var(--chemma-green), #6b91e7); }
  .login-mobile-timeline span { position: relative; padding-top: 17px; }
  .login-mobile-timeline span::before { content: ""; position: absolute; z-index: 1; top: 1px; left: 50%; width: 11px; height: 11px; border: 3px solid #fff; border-radius: 50%; transform: translateX(-50%); background: var(--chemma-green); box-shadow: 0 0 0 2px rgba(0,152,70,.15); }
  .login-mobile-timeline span:last-child::before { background: #4068d4; box-shadow: 0 0 0 2px rgba(64,104,212,.16); animation: mobile-year-pulse 2.8s ease-in-out infinite; }
  .sidebar { display: none; }
  .mobile-header { position: sticky; z-index: 15; top: 0; height: 68px; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
  .mobile-header img { width: 175px; height: 48px; object-fit: contain; object-position: left center; }
  .app-shell { width: 100%; max-width: 100%; overflow-x: hidden; }
  .main-content { width: 100%; max-width: 100%; margin-left: 0; padding: 28px 22px 104px; overflow-x: hidden; }
  .bottom-nav { position: fixed; z-index: 20; inset: auto 0 0; min-height: 76px; padding: 5px max(10px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(14px); }
  .bottom-nav .nav-button { min-height: 60px; padding: 4px; gap: 2px; flex-direction: column; justify-content: center; font-size: 10px; }
  .bottom-nav .nav-button span { width: auto; font-size: 19px; }
  .mobile-more-menu { position: fixed; z-index: 30; right: max(10px, env(safe-area-inset-right)); bottom: calc(82px + env(safe-area-inset-bottom)); width: min(310px, calc(100vw - 20px)); padding: 9px; display: grid; gap: 5px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.98); box-shadow: 0 18px 50px rgba(18,42,89,.2); backdrop-filter: blur(16px); }
  .mobile-more-menu .nav-button { min-height: 62px; padding: 9px 11px; display: grid; grid-template-columns: 34px 1fr; gap: 10px; text-align: left; }
  .mobile-more-menu .nav-button > span:first-child { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--chemma-blue-soft); }
  .mobile-more-menu .nav-button > span:last-child { width: auto; display: grid; font-size: 13px; }
  .mobile-more-menu .nav-button small { color: var(--muted); font-size: 10px; font-weight: 600; }
  .statistics-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .statistics-attention-grid { grid-template-columns: 1fr; }
  .statistics-two-column { grid-template-columns: 1fr; }
  .statistics-quality-panel { grid-template-columns: 1fr; }
  .source-pill { min-width: min(330px, 100%); }
  .filter-bar, .customer-filters { grid-template-columns: 2fr 1fr; }
  .map-layout { grid-template-columns: 1fr; }
  .map-detail { position: static; }
  .territory-map, #territory-map { min-height: 520px; height: 520px; }
  .visit-form { grid-template-columns: 1fr; }
  .customer-dialog { width: 100vw; }
  .customer-dialog .dialog-shell { border-radius: 0; }
  .catalog-product-dialog { width: calc(100vw - 24px); }
}

@media (max-width: 620px) {
  .main-content { padding: 22px 14px 98px; }
  .page-heading { display: block; }
  .source-pill { margin-top: 16px; width: 100%; }
  .page-heading h1 { font-size: 32px; }
  .kpi-grid { gap: 10px; }
  .kpi-card { min-height: 128px; padding: 17px; }
  .kpi-card strong { font-size: 33px; }
  .priority-panel, .confidence-panel, .overdue-panel, .future-panel { padding: 16px; }
  .priority-row { grid-template-columns: 8px 1fr 80px 28px; min-height: 76px; }
  .priority-row .secondary, .priority-row .confidence-badge { display: none; }
  .confidence-panel { display: block; }
  .filter-bar, .customer-filters { grid-template-columns: 1fr; }
  .calendar-toolbar { flex-wrap: wrap; }
  .calendar-toolbar > div:nth-child(2) { min-width: 160px; }
  .event-legend { width: 100%; margin: 0; justify-content: center; }
  .calendar-color-legend { align-items: flex-start; gap: 9px 14px; }
  .calendar-color-legend strong, .calendar-color-legend small { width: 100%; margin-left: 0; }
  .statistics-page-heading { display: block; }
  .statistics-coverage { width: 100%; min-width: 0; margin-top: 15px; }
  .statistics-filters { grid-template-columns: 1fr; }
  .statistics-kpi-grid { gap: 9px; }
  .statistics-kpi { min-height: 126px; padding: 15px; }
  .statistics-kpi strong { font-size: 28px; }
  .statistics-trend-panel, .statistics-block, .statistics-attention-panel { padding: 16px; }
  .statistics-attention-card { min-height: 132px; }
  .statistics-panel-heading { display: grid; }
  .statistics-month-detail { grid-template-columns: 1fr 1fr; }
  .statistics-portfolio { grid-template-columns: 1fr 1fr 1fr; }
  .statistics-portfolio-card { min-height: 100px; padding: 10px; }
  .statistics-portfolio-card strong { font-size: 26px; }
  .statistics-concentration { grid-template-columns: 1fr 1fr; }
  .statistics-heatmap { gap: 3px; grid-template-columns: 35px repeat(12, minmax(16px, 1fr)); }
  .statistics-heatmap-month { font-size: 7px; }
  .statistics-quality-grid { grid-template-columns: 1fr 1fr; }
  .future-panel-heading { display: grid; }
  .future-confidence-legend { justify-content: flex-start; max-width: none; }
  .compact-list { grid-template-columns: 1fr; }
  .catalog-grid { grid-template-columns: 1fr; }
  .form-grid, .inline-fields { grid-template-columns: 1fr; }
  .evidence-metrics { grid-template-columns: 1fr; }
  .evidence-hero-header { display: grid; }
  .form-grid .full-width { grid-column: auto; }
  .dialog-shell { padding: 20px 16px; }
  .customer-product { grid-template-columns: 1fr auto auto; }
  .customer-product .confidence-badge { display: none; }
  .customer-stat-grid { grid-template-columns: 1fr 1fr; }
  .customer-chart-grid { grid-template-columns: 1fr; }
  .catalog-summary { grid-template-columns: 1fr 1fr; }
  .catalog-summary-metric:last-child { grid-column: 1 / -1; }
  .catalog-customer-row { grid-template-columns: 1fr auto; }
  .catalog-customer-row > div:nth-child(2) { grid-column: 1; grid-row: 2; }
  .catalog-customer-row > div:nth-child(3) { grid-column: 2; grid-row: 2; }
  .catalog-customer-row > div:nth-child(2), .catalog-customer-row > div:nth-child(3) { padding-top: 7px; border-top: 1px solid var(--line); }
  .catalog-row-arrow { grid-column: 2; grid-row: 1; }
  .territory-map, #territory-map { min-height: 480px; height: 480px; }
  .map-overlay { top: 10px; left: 10px; }
  .map-overlay .eyebrow { font-size: 8px; }
  .map-overlay strong { font-size: 19px; }
  .map-fit-button { min-height: 34px; padding: 0 9px; }
  .map-legend { right: 10px; bottom: 12px; left: 10px; max-width: calc(100% - 20px); gap: 6px 10px; padding: 8px 10px; }
  .map-legend span { font-size: 9px; }
}

@media (max-width: 1024px) and (max-height: 620px) {
  .login-panel { padding-top: 10px; padding-bottom: 10px; }
  .login-card { gap: 11px; padding: 16px 22px; }
  .login-card-logo { width: 180px; max-height: 54px; object-fit: contain; object-position: left center; }
  .login-mobile-timeline { display: none; }
  .login-trust { display: none; }
  .login-card h2 { margin: 2px 0 3px; font-size: 27px; }
  .login-card p { font-size: 14px; line-height: 1.35; }
  .form-error { min-height: 16px; }
}

@keyframes mobile-year-pulse { 50% { box-shadow: 0 0 0 7px rgba(64,104,212,.09); } }

@media (prefers-reduced-motion: reduce) {
  .brand-wash, .login-orbit, .login-particle, .forecast-progress-line, .forecast-year, .forecast-pulse, .forecast-small-dots, .login-submit::before, .login-mobile-timeline span:last-child::before { animation: none !important; }
  .forecast-progress-line { stroke-dashoffset: 0; }
  .forecast-year, .forecast-small-dots { opacity: 1; }
}
