:root {
  color-scheme: dark;
  --bg: #04141c;
  --bg-deep: #020b10;
  --surface: #081d27;
  --surface-2: #0c2632;
  --surface-3: #102f3c;
  --line: rgba(214, 230, 236, .14);
  --line-strong: rgba(214, 230, 236, .23);
  --text: #eaf0f4;
  --white: #ffffff;
  --muted: #91a4ae;
  --acid: #f2ba18;
  --yellow: #f2ba18;
  --red: #d90f24;
  --red-bright: #f21d35;
  --cyan: #54c9df;
  --green: #49d68b;
  --shadow: 0 24px 70px rgba(0, 0, 0, .36);
  --display: "Rajdhani", "Arial Narrow", sans-serif;
  --body: "Manrope", system-ui, sans-serif;
  font-family: var(--body);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg-deep); scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 90% 0, rgba(217, 15, 36, .12), transparent 27rem),
    linear-gradient(180deg, #051922 0, var(--bg-deep) 100%);
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: .035;
  background-image: linear-gradient(rgba(255,255,255,.45) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.45) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button, input, select { -webkit-tap-highlight-color: transparent; }
.is-hidden { display: none !important; }

/* Acceso */
.login-view {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 30px;
  background: var(--bg-deep);
}
.login-view::after {
  position: absolute;
  right: -100px;
  bottom: -120px;
  width: 440px;
  height: 440px;
  border: 44px solid rgba(217, 15, 36, .07);
  border-radius: 50%;
  content: "";
}
.login-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(420px, 1.2fr) minmax(390px, .8fr);
  width: min(1120px, 100%);
  min-height: 720px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 40px 100px rgba(0,0,0,.55);
}
.login-layout::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 3;
  height: 4px;
  content: "";
  background: linear-gradient(90deg, var(--red) 0 52%, var(--yellow) 52% 100%);
}
.login-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 720px;
  padding: 38px 42px 46px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(2,11,16,.22), rgba(2,11,16,.88)),
    linear-gradient(90deg, rgba(2,11,16,.2), transparent),
    url("assets/kart-hero.jpg") center / cover no-repeat;
}
.login-showcase::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(135deg, transparent 62%, rgba(242,186,24,.15) 62.2%, transparent 62.7%);
}
.showcase-logo { position: relative; z-index: 1; width: 160px; height: 88px; object-fit: contain; }
.showcase-copy { position: relative; z-index: 1; max-width: 480px; }
.speed-number {
  display: inline-flex;
  align-items: flex-end;
  gap: 7px;
  margin-bottom: 24px;
  color: var(--yellow);
  font-family: var(--display);
  font-size: 3.6rem;
  font-weight: 700;
  font-style: italic;
  line-height: .72;
}
.speed-number small { color: var(--white); font-size: .72rem; letter-spacing: .1em; }
.showcase-copy p { margin: 0 0 8px; color: var(--red-bright); font-family: var(--display); font-weight: 700; letter-spacing: .2em; }
.showcase-copy h2 { max-width: 450px; margin: 0 0 22px; color: var(--white); font-family: var(--display); font-size: clamp(3rem, 5vw, 5.2rem); font-weight: 700; line-height: .82; text-transform: uppercase; }
.showcase-copy > span:last-child { display: flex; align-items: center; gap: 13px; color: #c9d6dc; font-family: var(--display); font-size: .78rem; font-weight: 700; letter-spacing: .18em; }
.showcase-copy i { width: 35px; height: 4px; background: var(--yellow); transform: skewX(-25deg); }
.login-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 52px 54px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.018) 25%, transparent 25%) 0 0 / 22px 22px,
    var(--surface);
}
.brand { display: inline-flex; align-items: center; gap: 13px; }
.brand img { width: 82px; height: 46px; object-fit: contain; }
.brand strong, .brand small { display: block; font-family: var(--display); }
.brand strong { color: var(--white); font-size: .82rem; font-weight: 700; letter-spacing: .14em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: .56rem; font-weight: 600; letter-spacing: .2em; }
.brand-login { margin-bottom: 48px; }
.brand-login img { width: 108px; height: 58px; }
.overline { margin: 0; color: var(--red-bright); font-family: var(--display); font-size: .72rem; font-weight: 700; letter-spacing: .2em; }
.login-card h1 { margin: 10px 0 12px; color: var(--white); font-family: var(--display); font-size: clamp(2.7rem, 5vw, 4rem); font-weight: 700; line-height: .9; text-transform: uppercase; }
.login-copy { margin: 0 0 26px; color: var(--muted); font-size: .86rem; line-height: 1.65; }
.login-card label { display: block; margin: 17px 0 7px; color: #d9e3e8; font-family: var(--display); font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.login-card input { width: 100%; height: 52px; padding: 0 15px; border: 1px solid var(--line-strong); border-radius: 3px; outline: none; color: var(--white); background: rgba(2, 11, 16, .65); transition: border-color .18s, box-shadow .18s; }
.login-card input:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(242,186,24,.11); }
.password-field { position: relative; }
.password-field input { padding-right: 62px; }
.icon-button { position: absolute; right: 7px; top: 8px; height: 36px; border: 0; color: var(--muted); background: transparent; font-family: var(--display); font-size: .76rem; font-weight: 700; text-transform: uppercase; }
.primary-button, .demo-button { width: 100%; min-height: 50px; border-radius: 3px; font-family: var(--display); font-size: .9rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.primary-button { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; padding: 0 18px; border: 0; color: var(--white); background: linear-gradient(100deg, var(--red), var(--red-bright)); box-shadow: 0 14px 30px rgba(217,15,36,.22); }
.primary-button b { font-size: 1.35rem; }
.primary-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: .65; }
.demo-button { margin-top: 10px; border: 1px solid var(--line-strong); color: var(--text); background: transparent; }
.demo-button:hover { border-color: var(--yellow); color: var(--yellow); }
.form-error { min-height: 17px; margin: 10px 0 -6px; color: #ff7585; font-size: .76rem; }
.security-note { margin: 21px 0 0; color: #617782; font-size: .66rem; text-align: center; }

/* Navegación y cabecera */
.app-shell { width: min(100% - 36px, 1280px); margin: 0 auto; }
.topbar { position: sticky; top: 0; z-index: 8; display: flex; align-items: center; justify-content: space-between; min-height: 82px; border-bottom: 1px solid rgba(217,15,36,.55); background: rgba(4,20,28,.9); backdrop-filter: blur(14px); }
.topbar::before { position: absolute; top: 0; right: 0; left: 0; height: 3px; content: ""; background: linear-gradient(90deg,var(--red) 0 70%,var(--yellow) 70%); }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.refresh-button, .user-menu { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; border: 1px solid var(--line); border-radius: 3px; color: var(--text); background: var(--surface); font-family: var(--display); font-size: .76rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.refresh-button { padding: 0 14px; }
.refresh-icon { color: var(--yellow); font-size: 1.1rem; }
.refresh-button.loading .refresh-icon { animation: spin .8s linear infinite; }
.user-menu { padding: 0 11px; }
.user-menu > span:first-child { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; color: var(--white); background: var(--red); font-weight: 700; }
.dashboard-heading { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 48px 0 26px; }
.dashboard-heading::after { position: absolute; left: 0; bottom: 0; width: 74px; height: 4px; content: ""; background: var(--yellow); transform: skewX(-24deg); }
.dashboard-heading h1 { margin: 7px 0 3px; color: var(--white); font-family: var(--display); font-size: clamp(2.8rem, 6vw, 4.8rem); font-weight: 700; line-height: .88; text-transform: uppercase; }
.dashboard-heading > div > p:last-child { margin: 10px 0 0; color: var(--muted); text-transform: capitalize; }
.heading-controls { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.select-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
select { min-height: 42px; padding: 0 34px 0 13px; border: 1px solid var(--line-strong); border-radius: 3px; outline: none; color: var(--text); background: var(--surface); font-family: var(--display); font-weight: 700; text-transform: uppercase; }
.freshness { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); background: var(--surface); font-family: var(--display); font-size: .67rem; letter-spacing: .06em; }
.freshness > span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(73,214,139,.1); }
.alert-banner { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0; padding: 13px 15px; border-left: 3px solid var(--red); color: #ffc0c7; background: rgba(217,15,36,.1); font-size: .8rem; }
.alert-banner span { display: grid; flex: 0 0 auto; width: 20px; height: 20px; place-items: center; border-radius: 50%; color: var(--white); background: var(--red); font-weight: 900; }
.alert-banner p { margin: 1px 0 0; }

/* Tarjetas */
.kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-top: 18px; }
.kpi-feature { grid-column: span 2; }
.kpi-card, .panel { position: relative; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(12,38,50,.96), rgba(5,22,30,.98)); box-shadow: var(--shadow); }
.kpi-card::before, .panel::before { position: absolute; top: 0; left: 0; width: 54px; height: 3px; content: ""; background: var(--red); }
.kpi-card { min-width: 0; padding: 21px; border-radius: 5px; }
.kpi-card p, .kpi-top p { margin: 0; color: var(--muted); font-family: var(--display); font-size: .66rem; font-weight: 700; letter-spacing: .13em; }
.kpi-card > strong { display: block; margin: 10px 0 6px; color: var(--white); font-family: var(--display); font-size: clamp(1.7rem,3vw,2.35rem); line-height: 1; }
.kpi-card small { display: block; overflow: hidden; color: var(--muted); font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }
.kpi-primary { border-color: rgba(242,186,24,.42); background: linear-gradient(135deg,rgba(242,186,24,.1),rgba(7,28,38,.98) 60%); }
.kpi-primary::before { width: 100%; background: var(--yellow); }
.kpi-primary > strong { color: var(--yellow); font-size: clamp(2rem,4vw,3.1rem); }
.kpi-sales { border-color: rgba(217,15,36,.36); background: linear-gradient(135deg,rgba(217,15,36,.09),rgba(7,28,38,.98) 60%); }
.kpi-sales::before { width: 100%; background: var(--red-bright); }
.kpi-sales > strong { color: var(--white); font-size: clamp(2rem,4vw,3.1rem); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-top span { padding: 4px 7px; border-radius: 2px; color: var(--green); background: rgba(73,214,139,.1); font-size: .64rem; font-weight: 800; }
.main-grid, .finance-grid, .comparison-grid { display: grid; gap: 14px; margin-top: 14px; }
.main-grid { grid-template-columns: minmax(0,2.2fr) minmax(250px,.8fr); }
.finance-grid { grid-template-columns: minmax(0,1.55fr) minmax(300px,.75fr); }
.comparison-grid { grid-template-columns: minmax(0,1.5fr) minmax(320px,.8fr); margin-bottom: 24px; }
.panel { padding: 25px; border-radius: 5px; }
.panel-heading, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-heading h2, .section-heading h2 { margin: 6px 0 0; color: var(--white); font-family: var(--display); font-size: 1.5rem; line-height: 1; text-transform: uppercase; }
.status-pill, .info-chip { padding: 6px 9px; border: 1px solid rgba(73,214,139,.3); border-radius: 2px; color: var(--green); background: rgba(73,214,139,.08); font-family: var(--display); font-size: .64rem; font-weight: 700; letter-spacing: .09em; }
.status-pill.alert { border-color: rgba(217,15,36,.45); color: #ff6a7a; background: rgba(217,15,36,.1); }
.status-pill.ahead { border-color: rgba(84,201,223,.4); color: var(--cyan); background: rgba(84,201,223,.08); }
.race-summary { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin: 24px 0 20px; }
.race-summary > div { padding: 13px; border-left: 2px solid var(--yellow); background: rgba(2,11,16,.48); }
.race-summary span, .pace-difference span, .profit-details span { display: block; color: var(--muted); font-size: .65rem; }
.race-summary strong { display: block; margin-top: 5px; color: var(--white); font-family: var(--display); font-size: 1.45rem; }
.race-track { position: relative; padding: 19px 0 8px; }
.track-markers { display: flex; justify-content: space-between; margin-bottom: 8px; color: #617984; font-family: var(--display); font-size: .58rem; }
.lane { position: relative; height: 17px; margin-bottom: 13px; overflow: visible; border-radius: 2px; background: repeating-linear-gradient(90deg,#173541 0,#173541 18px,#102b36 18px,#102b36 36px); }
.lane > div { height: 100%; border-radius: inherit; transition: width .65s ease; }
.lane-expected > div { width: 0; background: rgba(84,201,223,.42); }
.lane-expected > span { position: absolute; right: 8px; top: 2px; color: #a7ebf7; font-size: .55rem; }
.lane-real > div { width: 0; background: linear-gradient(90deg,#cb8707,var(--yellow)); box-shadow: 0 0 18px rgba(242,186,24,.25); }
.kart { position: absolute; top: -15px; left: 0; font-size: 1.9rem; filter: drop-shadow(0 7px 5px rgba(0,0,0,.5)); transform: translateX(-50%); transition: left .65s ease; }
.finish-line { position: absolute; right: 0; top: 22px; width: 10px; height: 55px; background: repeating-conic-gradient(#fff 0 25%,#101b21 0 50%) 50%/8px 8px; }
.race-message { margin: 15px 0 0; color: #cedbe0; font-size: .82rem; line-height: 1.55; }
.traffic-panel { text-align: center; }
.traffic-panel .panel-heading { text-align: left; }
.traffic-light { display: flex; justify-content: center; gap: 10px; margin: 27px auto 18px; }
.traffic-light span { width: 37px; height: 37px; border: 6px solid #183440; border-radius: 50%; opacity: .17; }
.traffic-light .red { background: var(--red-bright); }
.traffic-light .yellow { background: var(--yellow); }
.traffic-light .green { background: var(--green); }
.traffic-light span.active { opacity: 1; box-shadow: 0 0 25px currentColor; }
.traffic-title { display: block; color: var(--white); font-family: var(--display); font-size: 1.7rem; text-transform: uppercase; }
.traffic-comparison { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin: 17px 0 12px; text-align: left; }
.traffic-comparison > div { min-width: 0; padding: 10px; border-top: 2px solid var(--yellow); background: rgba(2,11,16,.48); }
.traffic-comparison > div:last-child { border-color: var(--red-bright); }
.traffic-comparison span { display: block; overflow: hidden; color: var(--muted); font-size: .58rem; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.traffic-comparison b { color: var(--text); font-weight: 700; }
.traffic-comparison strong { display: block; margin-top: 5px; overflow: hidden; color: var(--white); font-family: var(--display); font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.traffic-panel > p { margin: 0 auto 15px; color: #b7c8d0; font-size: .7rem; line-height: 1.55; text-align: left; }
.pace-difference { padding: 13px; border-left: 2px solid var(--red); text-align: left; background: rgba(2,11,16,.48); }
.pace-difference strong { display: block; margin-top: 5px; font-family: var(--display); font-size: 1.1rem; }
.section-block { padding: 35px 0 3px; }
.section-heading > p { max-width: 300px; margin: 4px 0 0; color: var(--muted); font-size: .73rem; text-align: right; }
.product-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 16px; }
.product-card { position: relative; padding: 19px; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.product-card::after { position: absolute; right: -20px; bottom: -20px; width: 62px; height: 62px; border: 8px solid rgba(217,15,36,.08); border-radius: 50%; content: ""; }
.product-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.product-card h3 { margin: 0; color: var(--white); font-family: var(--display); font-size: 1.05rem; text-transform: uppercase; }
.product-card header span { color: var(--yellow); font-family: var(--display); font-size: .86rem; font-weight: 700; }
.product-numbers { display: flex; align-items: baseline; gap: 5px; margin: 18px 0 9px; }
.product-numbers strong { color: var(--white); font-family: var(--display); font-size: 1.9rem; }
.product-numbers span { color: var(--muted); font-size: .68rem; }
.mini-track { height: 7px; overflow: hidden; border-radius: 1px; background: #173641; }
.mini-track div { height: 100%; background: linear-gradient(90deg,var(--red),var(--yellow)); }
.product-card footer { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: .61rem; }
.info-chip { border-color: rgba(242,186,24,.35); color: var(--yellow); background: rgba(242,186,24,.08); }
.panel-description { margin: 13px 0 22px; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.expense-list { display: grid; gap: 12px; }
.expense-row { display: grid; grid-template-columns: minmax(100px,1.1fr) minmax(120px,1.7fr) 95px; align-items: center; gap: 13px; }
.expense-name strong, .expense-name span { display: block; }
.expense-name strong { color: var(--white); font-family: var(--display); font-size: .86rem; text-transform: uppercase; }
.expense-name span { margin-top: 3px; color: var(--muted); font-size: .6rem; }
.expense-track { height: 10px; overflow: hidden; border-radius: 1px; background: #183642; }
.expense-track div { height: 100%; background: var(--green); }
.expense-track div.covered { background: var(--green); }
.expense-track div.partial { background: var(--red-bright); }
.expense-value { text-align: right; }
.expense-value strong, .expense-value small { display: block; }
.expense-value strong { font-family: var(--display); font-size: .83rem; }
.expense-value small { margin-top: 3px; color: var(--muted); font-size: .58rem; }
.expense-value .expense-status { font-family: var(--display); font-size: .62rem; font-weight: 700; letter-spacing: .04em; }
.expense-value .expense-status.covered { color: var(--green); }
.expense-value .expense-status.partial { color: #ff6879; }
.expense-value .expense-status.pending { color: var(--muted); }
.expense-legend { display: flex; gap: 14px; margin-top: 18px; color: var(--muted); font-size: .6rem; }
.expense-legend span { display: flex; align-items: center; gap: 5px; }
.expense-legend i { display: grid; width: 12px; height: 12px; place-items: center; border-radius: 50%; color: #03120c; background: #264754; font-size: .52rem; font-style: normal; font-weight: 900; }
.expense-legend .covered { background: var(--green); }
.expense-legend .partial { background: var(--red-bright); }
.profitability-panel { display: flex; flex-direction: column; }
.profit-ring { position: relative; display: grid; width: 150px; height: 150px; place-items: center; margin: 25px auto; border-radius: 50%; background: conic-gradient(var(--yellow) 0deg,#193642 0deg); }
.profit-ring::before { position: absolute; width: 112px; height: 112px; border-radius: 50%; content: ""; background: var(--surface); }
.profit-ring > div { position: relative; z-index: 1; text-align: center; }
.profit-ring strong, .profit-ring span { display: block; }
.profit-ring strong { color: var(--white); font-family: var(--display); font-size: 2rem; }
.profit-ring span { color: var(--muted); font-size: .62rem; }
.profit-details { display: grid; gap: 9px; }
.profit-details > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.profit-details strong { font-family: var(--display); font-size: .9rem; }
.profit-details .profit-result strong { color: var(--yellow); }
.theory-note { margin: auto 0 0; padding-top: 15px; color: #617680; font-size: .6rem; line-height: 1.5; }
.chart-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 3px; background: var(--bg-deep); }
.chart-switch button { padding: 6px 9px; border: 0; border-radius: 1px; color: var(--muted); background: transparent; font-family: var(--display); font-size: .67rem; font-weight: 700; text-transform: uppercase; }
.chart-switch button.active { color: var(--bg-deep); background: var(--yellow); }
.chart-wrap { position: relative; height: 290px; margin-top: 18px; }
.chart-fallback { display: grid; height: 100%; place-items: center; color: var(--muted); }
.comment-panel #commentList { display: grid; gap: 10px; margin-top: 18px; }
.comment-item { padding: 14px; border-left: 3px solid var(--cyan); background: rgba(2,11,16,.43); }
.comment-item.alerta { border-color: var(--red-bright); }
.comment-item.meta { border-color: var(--yellow); }
.comment-item header { display: flex; justify-content: space-between; gap: 10px; }
.comment-item strong { color: var(--white); font-family: var(--display); font-size: .88rem; text-transform: uppercase; }
.comment-item span { color: var(--muted); font-size: .58rem; text-transform: uppercase; }
.comment-item p { margin: 7px 0 0; color: #c0cdd3; font-size: .71rem; line-height: 1.5; }
.empty-state { padding: 22px; border: 1px dashed var(--line); color: var(--muted); font-size: .76rem; text-align: center; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 20px 0 30px; border-top: 1px solid rgba(217,15,36,.45); color: #58717c; font-family: var(--display); font-size: .62rem; letter-spacing: .1em; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 10; max-width: 340px; padding: 12px 15px; border: 1px solid var(--line); border-left: 3px solid var(--yellow); border-radius: 3px; color: var(--text); background: var(--surface-2); box-shadow: var(--shadow); font-size: .75rem; opacity: 0; pointer-events: none; transform: translateY(10px); transition: .2s; }
.toast.show { opacity: 1; transform: none; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 940px) {
  .login-layout { grid-template-columns: minmax(330px,.9fr) minmax(380px,1fr); }
  .login-showcase { padding: 32px; }
  .showcase-copy h2 { font-size: 3.5rem; }
  .login-card { padding: 45px 38px; }
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .kpi-feature { grid-column: span 2; }
  .main-grid, .finance-grid, .comparison-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2,1fr); }
  .profitability-panel { min-height: 430px; }
}
@media (max-width: 720px) {
  .login-view { display: block; padding: 0; }
  .login-layout { display: block; min-height: 100vh; border: 0; border-radius: 0; }
  .login-showcase { display: none; }
  .login-card { min-height: 100vh; justify-content: center; padding: 38px 25px; background: linear-gradient(rgba(4,20,28,.94),rgba(2,11,16,.98)), url("assets/kart-hero.jpg") 58% center / cover; }
  .login-card::after { position: absolute; right: -55px; bottom: -55px; width: 180px; height: 180px; border: 18px solid rgba(217,15,36,.09); border-radius: 50%; content: ""; }
  .brand-login { margin-bottom: 46px; }
  .brand-login img { width: 118px; height: 64px; }
  .app-shell { width: min(100% - 22px,1280px); }
  .topbar { min-height: 72px; }
  .topbar .brand img { width: 63px; height: 47px; }
  .refresh-button, .user-menu { width: 40px; padding: 0; }
  .refresh-text, .user-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .dashboard-heading { display: block; padding: 38px 0 24px; }
  .dashboard-heading h1 { font-size: 3.15rem; }
  .heading-controls { display: grid; grid-template-columns: 1fr; margin-top: 24px; }
  .heading-controls select, .freshness { width: 100%; }
  .freshness { justify-content: center; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-card { padding: 16px; }
  .kpi-feature { grid-column: 1 / -1; }
  .main-grid { margin-top: 11px; }
  .panel { padding: 20px; }
  .panel-heading { gap: 10px; }
  .panel-heading h2 { font-size: 1.3rem; }
  .race-summary { margin-top: 18px; }
  .traffic-panel > p { min-height: 0; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 8px; text-align: left; }
  .product-grid { grid-template-columns: 1fr; }
  .expense-row { grid-template-columns: 1fr 72px; }
  .expense-track { grid-column: 1 / -1; grid-row: 2; }
  .expense-value { grid-column: 2; grid-row: 1; }
  .comparison-grid { margin-bottom: 16px; }
  .chart-wrap { height: 250px; }
  .chart-panel .panel-heading { display: block; }
  .chart-switch { width: max-content; margin-top: 12px; }
  footer { display: block; text-align: center; }
  footer span { display: block; margin-top: 6px; }
  .toast { right: 11px; bottom: 11px; left: 11px; max-width: none; }
}
@media (max-width: 420px) {
  .brand span { display: none; }
  .brand-login span { display: block; }
  .login-card h1 { font-size: 3rem; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-feature { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
