:root {
  color-scheme: light;
  --bg: #f5f6f4;
  --panel: #ffffff;
  --text: #1f2528;
  --muted: #667174;
  --line: #dce1dd;
  --accent: #0d766e;
  --accent-dark: #095c56;
  --bad: #b42318;
  --ok: #ad6500;
  --good: #087443;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Plus Jakarta Sans", "Segoe UI", Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(13, 118, 110, 0.08), transparent 32%),
    linear-gradient(180deg, #f7f9f8 0%, var(--bg) 100%);
  color: var(--text);
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(13, 118, 110, 0.08), transparent 34%),
    #fbfcfb;
  color: var(--text);
}

.login-hero {
  display: none;
}

.login-panel {
  display: grid;
  width: min(100%, 420px);
  align-content: start;
  padding: 34px;
  background: #ffffff;
  border: 1px solid rgba(25, 31, 29, 0.08);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(31, 37, 40, 0.08);
  color: var(--text);
}

.login-brand {
  display: grid;
  justify-items: center;
  gap: 9px;
  margin-bottom: 28px;
  text-align: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  box-shadow: 0 16px 36px rgba(13, 118, 110, 0.22);
}

.brand-mark img {
  width: 58px;
  height: 58px;
  border-radius: 16px;
}

.login-brand strong {
  font-size: 24px;
  letter-spacing: 0;
}

.login-brand p {
  max-width: 300px;
  color: #667174;
  font-size: 14px;
  line-height: 1.45;
}

.login-panel h2 {
  font-size: 18px;
  margin-bottom: 18px;
  text-align: center;
}

.auth-tabs {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  margin-bottom: 18px;
  background: #e9efec;
  border-radius: 8px;
}

.auth-tab {
  background: transparent;
  color: #465350;
  padding: 10px 12px;
}

.auth-tab:hover {
  background: #dce5e1;
}

.auth-tab.active {
  background: #ffffff;
  color: var(--accent-dark);
  box-shadow: 0 1px 5px rgba(20, 31, 28, 0.12);
}

.login-form {
  display: grid;
  gap: 13px;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  color: #667174;
  transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: #eef4f1;
  color: var(--accent-dark);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-form button[type="submit"] {
  margin-top: 4px;
  background: #111816;
  border-radius: 10px;
  padding: 12px 14px;
}

.login-form button[type="submit"]:hover {
  background: #263230;
}

.forgot-password-link,
.form-back-button {
  width: fit-content;
  justify-self: center;
  padding: 0;
  background: transparent;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.forgot-password-link:hover,
.form-back-button:hover {
  background: transparent;
  color: var(--accent-dark);
}

.form-back-button {
  justify-self: center;
  margin-top: 2px;
}

.dev-reset-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent-dark);
  font-weight: 800;
}

.google-auth-button {
  display: grid;
  place-items: center;
  margin-top: 10px;
  min-height: 44px;
  border: 1px solid rgba(17, 24, 22, 0.12);
  border-radius: 10px;
  background: #ffffff;
  color: #1f2528;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(31, 37, 40, 0.05);
}

.google-auth-button:hover {
  border-color: rgba(13, 118, 110, 0.28);
  color: var(--accent-dark);
}

.auth-switch {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  color: #667174;
  font-size: 13px;
}

.auth-link {
  background: transparent;
  color: #111816;
  padding: 0;
  font-weight: 800;
}

.auth-link:hover {
  background: transparent;
  color: var(--accent-dark);
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 24px auto 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 4px 0 20px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-brand > img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(13, 118, 110, 0.16);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
  margin-bottom: 14px;
}

p,
.status,
.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.4fr);
  gap: 16px;
}

.panel,
.results {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(31, 37, 40, 0.05);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.panel:hover,
.summary-card:hover,
.calc-kpi:hover,
.monthly-grid div:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(31, 37, 40, 0.09);
}

label {
  display: grid;
  gap: 6px;
  color: #354044;
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #cbd3ce;
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--text);
  font: inherit;
  background: #fff;
}

input[readonly] {
  background: #eef2ef;
  color: #52605d;
  cursor: default;
}

textarea {
  resize: vertical;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 11px 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

.icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 22px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.secondary-button {
  background: #e9efec;
  color: #34413f;
}

.secondary-button:hover {
  background: #dce5e1;
}

.main-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px;
  border: 1px solid rgba(13, 118, 110, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 14px 34px rgba(31, 37, 40, 0.06);
}

.nav-button {
  min-height: 44px;
  border-radius: 10px;
  background: transparent;
  color: #43504d;
  font-size: 13px;
}

.nav-button:hover,
.nav-button.active {
  background: #0d766e;
  color: #ffffff;
}

.module {
  display: none;
}

.module.active {
  display: block;
}

.module-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid rgba(13, 118, 110, 0.12);
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff, #f1fbf6);
}

.module-head h2 {
  margin-bottom: 5px;
  font-size: 22px;
}

.module-head p {
  max-width: 680px;
  line-height: 1.45;
}

.filters-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.filters-bar label {
  width: min(100%, 280px);
}

.products-list,
.ranking-list {
  display: grid;
  gap: 12px;
}

.product-card,
.ranking-card,
.ml-placeholder,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 38px rgba(31, 37, 40, 0.07);
}

.product-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(320px, 1.2fr);
  gap: 14px;
  padding: 16px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.product-card:hover,
.ranking-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 44px rgba(31, 37, 40, 0.11);
}

.product-card.good { border-color: #a8e4c4; }
.product-card.warn { border-color: #efd28c; }
.product-card.bad { border-color: #efb9b4; }

.product-card-main {
  display: grid;
  align-content: start;
  gap: 7px;
}

.product-ribbon {
  width: fit-content;
  border-radius: 999px;
  padding: 6px 9px;
  background: #eef8f5;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.product-card.good .product-ribbon {
  background: #dff7ea;
  color: var(--good);
}

.product-card.bad .product-ribbon {
  background: #ffe6e3;
  color: var(--bad);
}

.product-card h3,
.ranking-card h3 {
  margin: 0;
  font-size: 18px;
}

.product-card p,
.ranking-card p {
  line-height: 1.4;
}

.product-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.product-metrics div {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(13, 118, 110, 0.1);
  border-radius: 12px;
  padding: 10px;
  background: #fbfdfb;
}

.product-metrics span,
.product-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.product-metrics strong {
  font-size: 16px;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  grid-column: 1 / -1;
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  grid-column: 1 / -1;
}

.product-actions button {
  padding: 8px 10px;
  background: #edf3f2;
  color: #263230;
}

.product-actions button:hover {
  background: #dcebe9;
}

.ranking-card {
  display: grid;
  grid-template-columns: 92px minmax(180px, 1fr) minmax(260px, 1.2fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
}

.ranking-card.podium {
  border-color: #a8e4c4;
  background: linear-gradient(135deg, #ffffff, #effbf4);
}

.ranking-position {
  display: grid;
  justify-items: center;
  gap: 4px;
  border-radius: 14px;
  padding: 12px;
  background: #102b2e;
  color: #ffffff;
}

.ranking-position strong {
  font-size: 22px;
}

.ranking-position span {
  font-size: 12px;
  font-weight: 800;
}

.ranking-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ranking-metrics span {
  display: grid;
  gap: 5px;
  border-radius: 12px;
  padding: 10px;
  background: #f5f8f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ranking-metrics strong {
  color: var(--text);
  font-size: 15px;
}

.empty-state,
.ml-placeholder {
  display: grid;
  gap: 10px;
  padding: 28px;
}

.empty-state strong,
.ml-placeholder strong {
  font-size: 20px;
}

.placeholder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.placeholder-grid span {
  border: 1px solid rgba(13, 118, 110, 0.14);
  border-radius: 12px;
  padding: 12px;
  background: #fbfdfb;
  font-weight: 800;
}

.save-product-button {
  order: 0;
  width: 100%;
  background: #111816;
  border-radius: 12px;
}

.save-product-button:hover {
  background: #263230;
}

.save-product-status {
  order: 0;
  min-height: 18px;
  font-size: 13px;
  font-weight: 800;
}

.fields {
  display: grid;
  grid-template-columns: 1.1fr repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.fields.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fields.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fields.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.fields.five {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}


.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-weight: 700;
}

.check-row input {
  width: 17px;
  height: 17px;
}

.platform-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  margin-bottom: 12px;
  background: #e9efec;
  border-radius: 8px;
}

.material-choice {
  display: grid;
  gap: 8px;
}

.material-choice > span {
  color: #354044;
  font-size: 13px;
  font-weight: 700;
}

.material-picker-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #cbd3ce;
  background: #ffffff;
  color: #1f2528;
  padding: 10px 11px;
}

.material-picker-button::after {
  content: "▾";
  color: #667174;
}

.material-picker-button:hover {
  background: #f8faf8;
}

.material-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  background: #e9efec;
  border-radius: 8px;
}

.material-tab {
  background: transparent;
  color: #465350;
  padding: 10px 8px;
}

.material-tab:hover {
  background: #dce5e1;
}

.material-tab.active {
  background: #ffffff;
  color: var(--accent-dark);
  box-shadow: 0 1px 5px rgba(20, 31, 28, 0.12);
}

.platform-tab {
  background: transparent;
  color: #465350;
  padding: 10px 12px;
}

.platform-tab:hover {
  background: #dce5e1;
}

.platform-tab.active {
  background: #ffffff;
  color: var(--accent-dark);
  box-shadow: 0 1px 5px rgba(20, 31, 28, 0.12);
}

.margin-box {
  display: grid;
  gap: 10px;
}

.production-cost-card {
  display: none !important;
}

.production-cost-card,
.margin-selector {
  background: #141721;
  border: 1px solid #272b38;
  color: #f6f7fb;
  border-radius: 8px;
  padding: 12px;
}

.production-cost-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.production-cost-card span {
  display: block;
  color: #9ea5b3;
  font-size: 13px;
  margin-bottom: 6px;
}

.production-cost-card strong {
  color: #37d46f;
  font-size: 20px;
}

.production-cost-card button {
  background: transparent;
  color: #f7941d;
  padding: 8px 0;
}

.production-cost-card button:hover {
  background: transparent;
  color: #ffad45;
}

.margin-selector {
  display: grid;
  gap: 10px;
}

.margin-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.margin-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(247, 148, 29, 0.18);
  color: #f7941d;
  font-weight: 800;
}

.margin-head h2 {
  margin: 0;
  color: #ffffff;
  font-size: 17px;
}

.margin-head p {
  margin-top: 4px;
  color: #9ea5b3;
  font-size: 12px;
}

.margin-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.margin-option {
  border: 1px solid rgba(247, 148, 29, 0.45);
  background: transparent;
  color: #f7941d;
  min-height: 34px;
  padding: 8px;
}

.margin-option:hover,
.margin-option.active {
  background: #f7941d;
  color: #141721;
}

.calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 16px;
  align-items: start;
}

.calc-layout.results-mode {
  grid-template-columns: minmax(0, 980px);
  justify-content: center;
}

.calc-layout.results-mode .calc-form,
.calc-layout.results-mode .calc-note,
.calc-layout.results-mode .price-breakdown {
  display: none;
}

.calc-layout.results-mode .calc-summary {
  position: static;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 16px;
}

.calc-form {
  display: grid;
  gap: 14px;
}

.guided-flow {
  gap: 12px;
}

.calc-step {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(220, 225, 221, 0.92);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(31, 37, 40, 0.05);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.calc-step:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(31, 37, 40, 0.09);
}

.calc-step.locked {
  display: none;
}

.step-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.step-top span {
  color: #7a5ce1;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.step-top h2 {
  margin: 3px 0 0;
  font-size: 20px;
}

.step-top p {
  margin-top: 4px;
  color: #667174;
  font-size: 13px;
}

.step-body {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.calc-step.done:not(.active) .step-body {
  display: none;
}

.step-summary {
  display: grid;
  gap: 3px;
  margin-top: 12px;
  border: 1px solid #cfe8dc;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f0fbf5;
}

.step-summary strong {
  color: var(--good);
  font-size: 14px;
}

.step-summary span {
  color: #52605d;
  font-size: 13px;
}

.step-next,
.step-edit {
  width: fit-content;
  justify-self: end;
  background: #101828;
  color: #ffffff;
  padding: 10px 13px;
}

.step-edit {
  background: #eef3f8;
  color: #43546a;
  padding: 8px 10px;
  font-size: 13px;
}

.step-next:hover {
  background: #263449;
}

.step-edit:hover {
  background: #e1e9f3;
}

.internal-defaults {
  display: none !important;
}

.step-inline-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #d7e5e1;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8fbfa;
}

.step-inline-result span {
  color: #667174;
  font-size: 13px;
  font-weight: 800;
}

.step-inline-result strong {
  color: var(--good);
  font-size: 18px;
}

.calc-summary {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(220, 225, 221, 0.88);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 18px 48px rgba(31, 37, 40, 0.08);
  backdrop-filter: blur(10px);
}

.calc-waiting-state {
  display: grid;
  gap: 6px;
  border: 1px dashed #cfd8d4;
  border-radius: 14px;
  padding: 18px;
  background: #f8faf9;
}

.calc-waiting-state strong {
  color: #263230;
  font-size: 18px;
}

.calc-waiting-state p {
  color: #667174;
  line-height: 1.45;
}

.calc-summary.results-hidden > :not(.calc-waiting-state) {
  display: none;
}

.calc-summary:not(.results-hidden) .calc-waiting-state {
  display: none;
}

.edit-calculation {
  order: 99;
  width: fit-content;
  justify-self: end;
  background: #eef3f8;
  color: #43546a;
  padding: 9px 12px;
  font-size: 13px;
}

.edit-calculation:hover {
  background: #e1e9f3;
}

.summary-card {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8faf8;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.summary-card span {
  color: var(--muted);
  font-size: 13px;
}

.summary-card strong {
  font-size: 22px;
}

.summary-card.primary {
  order: 0;
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(145deg, #ffffff 0%, #e8f8ef 100%);
  border-color: #a8e4c4;
  box-shadow: 0 18px 42px rgba(23, 42, 36, 0.12);
}

.summary-card.primary strong {
  color: var(--good);
  font-size: 42px;
  line-height: 1;
}

.summary-card.primary em {
  width: fit-content;
  margin-top: 8px;
  border-radius: 999px;
  padding: 7px 10px;
  background: #d9f4e5;
  color: var(--good);
  font-style: normal;
  font-weight: 800;
  font-size: 14px;
}

.summary-card.primary span {
  color: #52605d;
  font-weight: 800;
}

.price-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 4px;
}

.price-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #0d766e;
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
}

.price-title-row p {
  max-width: 360px;
  margin-top: 4px;
  color: #52605d;
  line-height: 1.4;
  font-size: 13px;
}

.calc-kpi-grid {
  order: 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.calc-kpi {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(13, 118, 110, 0.12);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.82);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.calc-kpi span {
  color: #64706d;
  font-size: 12px;
  font-weight: 800;
}

.calc-kpi strong {
  color: #263230;
  font-size: 19px;
}

.sell-decision-card {
  order: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid #f0d18b;
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #fffaf0, #fff2cf);
  box-shadow: 0 16px 34px rgba(31, 37, 40, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.sell-decision-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 42px rgba(31, 37, 40, 0.12);
}

.sell-decision-card.good {
  border-color: #9ddfbf;
  background: linear-gradient(135deg, #effbf4, #dff7ea);
}

.sell-decision-card.bad {
  border-color: #efb9b4;
  background: linear-gradient(135deg, #fff5f4, #ffe6e3);
}

.sell-decision-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--ok);
  color: #ffffff;
  font-weight: 900;
  font-size: 18px;
}

.sell-decision-card.good .sell-decision-icon {
  background: var(--good);
}

.sell-decision-card.bad .sell-decision-icon {
  background: var(--bad);
}

.sell-decision-card strong {
  display: block;
  color: var(--ok);
  font-size: 20px;
  line-height: 1.15;
}

.sell-decision-card.good strong {
  color: var(--good);
}

.sell-decision-card.bad strong {
  color: var(--bad);
}

.sell-decision-card p {
  margin-top: 5px;
  color: #465350;
  line-height: 1.4;
  font-size: 13px;
}

.calc-note {
  order: 4;
  line-height: 1.45;
  font-size: 13px;
}

.price-breakdown {
  order: 5;
  display: grid;
  gap: 6px;
  margin-top: 4px;
  border-top: 2px solid #00b894;
  border-radius: 8px;
  padding: 12px;
  background: #12131c;
  color: #f6f7fb;
}

.breakdown-example {
  color: #6f7390;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.breakdown-sale,
.breakdown-line,
.breakdown-profit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.breakdown-sale {
  border: 1px solid #2b2e3f;
  border-radius: 8px;
  padding: 10px;
}

.breakdown-sale span,
.breakdown-profit span {
  font-weight: 800;
}

.breakdown-sale strong {
  font-size: 18px;
}

.breakdown-line {
  border-bottom: 1px solid #272a38;
  padding: 6px 4px;
  color: #c9d0ea;
  font-size: 13px;
}

.breakdown-line strong {
  color: #ff3d64;
  font-family: Consolas, Monaco, monospace;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 8px;
}

.dot.yellow { background: #ffbe2e; }
.dot.purple { background: #9b7cff; }
.dot.blue { background: #498cff; }
.dot.red { background: #ff5a68; }
.dot.cyan { background: #46c2ff; }
.dot.pink { background: #ff8fbd; }
.dot.gray { background: #9aa0af; }

.breakdown-profit {
  margin-top: 4px;
  border: 1px solid #007f68;
  border-radius: 8px;
  padding: 11px;
  background: #102b2e;
}

.breakdown-profit strong {
  color: #00f0a0;
  font-size: 22px;
}

.monthly-inputs {
  border-color: #cbe6dc;
  background: #fbfdfb;
}

.advanced-toggle {
  width: fit-content;
  margin-top: 10px;
  background: #eef3f8;
  color: #43546a;
  padding: 8px 10px;
  font-size: 13px;
}

.advanced-toggle:hover {
  background: #e1e9f3;
}

.advanced-fields {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.production-base-note {
  margin-top: 10px;
  color: #6b7774;
  font-size: 12px;
  line-height: 1.4;
}

.monthly-potential {
  order: 2;
  display: grid;
  gap: 14px;
  border: 1px solid rgba(10, 118, 110, 0.18);
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(145deg, #ffffff 0%, #f0faf5 100%);
  box-shadow: 0 18px 42px rgba(23, 42, 36, 0.12);
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.calc-layout.results-mode .sell-decision-card {
  order: 1;
}

.calc-layout.results-mode .monthly-potential {
  order: 2;
}

.calc-layout.results-mode .calc-kpi-grid {
  order: 2;
}

.calc-layout.results-mode .summary-card.primary {
  order: 0;
}

.calc-layout.results-mode .calc-kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.calc-layout.results-mode .monthly-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.monthly-potential:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 54px rgba(23, 42, 36, 0.16);
}

.monthly-potential.good {
  border-color: #a8e4c4;
  background: linear-gradient(145deg, #ffffff 0%, #e8f8ef 100%);
}

.monthly-potential.warn {
  border-color: #f0d18b;
  background: linear-gradient(145deg, #ffffff 0%, #fff5dd 100%);
}

.monthly-potential.bad {
  border-color: #efb9b4;
  background: linear-gradient(145deg, #ffffff 0%, #fff0ef 100%);
}

.monthly-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.monthly-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.monthly-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #0d766e;
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
}

.monthly-head h2 {
  margin: 0;
  font-size: 20px;
}

.monthly-head p {
  max-width: 330px;
  margin-top: 4px;
  color: #52605d;
  line-height: 1.4;
  font-size: 13px;
}

.monthly-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 10px;
  background: #ffe9e7;
  color: var(--bad);
  font-weight: 800;
  font-size: 12px;
}

.monthly-badge.good {
  background: #d9f4e5;
  color: var(--good);
}

.monthly-badge.warn {
  background: #fff0c8;
  color: var(--ok);
}

.monthly-main {
  display: grid;
  gap: 5px;
}

.monthly-main span {
  color: #52605d;
  font-size: 13px;
  font-weight: 800;
}

.monthly-main strong {
  color: var(--good);
  font-size: 42px;
  line-height: 1;
}

.monthly-potential.warn .monthly-main strong {
  color: var(--ok);
}

.monthly-potential.bad .monthly-main strong {
  color: var(--bad);
}

.monthly-main p {
  color: #34413f;
  line-height: 1.45;
}

.monthly-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.monthly-grid div {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(13, 118, 110, 0.12);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.monthly-grid span {
  color: #64706d;
  font-size: 12px;
  font-weight: 700;
}

.monthly-grid strong {
  font-size: 18px;
}

.monthly-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(13, 118, 110, 0.16);
  padding-top: 12px;
}

.monthly-total-row span {
  color: #52605d;
  font-size: 13px;
}

.monthly-total-row > strong {
  color: var(--good);
  font-size: 20px;
}

.potential-thermometer {
  display: grid;
  gap: 8px;
}

.thermo-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.thermo-head span {
  color: #52605d;
  font-size: 13px;
  font-weight: 800;
}

.thermo-head strong {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 9px;
  background: #ffe9e7;
  color: var(--bad);
  font-size: 12px;
}

.thermo-head strong.warn {
  background: #fff0c8;
  color: var(--ok);
}

.thermo-head strong.good {
  background: #d9f4e5;
  color: var(--good);
}

.thermo-track {
  position: relative;
  height: 15px;
  border-radius: 999px;
  background: linear-gradient(90deg, #b42318 0 25%, #d99a16 25% 75%, #087443 75% 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
}

.thermo-track i {
  position: absolute;
  top: 50%;
  left: 0;
  width: 18px;
  height: 18px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #18231f;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
  transform: translate(-50%, -50%);
  transition: left 180ms ease;
}

.thermo-scale {
  display: flex;
  justify-content: space-between;
  color: #697572;
  font-size: 11px;
  font-weight: 700;
}

.status {
  min-height: 20px;
  font-size: 13px;
}

.results {
  margin-top: 16px;
}

.results-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.result-card {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.result-card:first-child {
  border-top: 0;
}

.result-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 8px;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: #485256;
  font-size: 12px;
}

.line {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.numbers {
  border-left: 1px solid var(--line);
  padding-left: 14px;
  display: grid;
  align-content: start;
  gap: 7px;
}

.number-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.number-row strong {
  font-size: 15px;
}

.decision {
  display: inline-flex;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 13px;
}

.decision.good {
  color: var(--good);
  background: #e8f6ef;
}

.decision.tight {
  color: var(--ok);
  background: #fff3dc;
}

.decision.bad {
  color: var(--bad);
  background: #ffe9e7;
}

@media (max-width: 820px) {
  .login-shell {
    grid-template-columns: 1fr;
    align-content: center;
  }

  .login-hero {
    min-height: auto;
  }

  .login-panel {
    min-height: auto;
    padding: 26px;
  }

  .grid,
  .fields,
  .fields.two,
  .fields.three,
  .fields.four,
  .fields.five,
  .calc-layout,
  .main-nav,
  .product-card,
  .product-metrics,
  .ranking-card,
  .ranking-metrics,
  .placeholder-grid {
    grid-template-columns: 1fr;
  }

  .module-head,
  .filters-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .filters-bar label {
    width: 100%;
  }

  .product-actions {
    justify-content: stretch;
  }

  .product-actions button {
    flex: 1;
  }

  .calc-summary {
    position: static;
  }

  .monthly-head,
  .monthly-total-row {
    align-items: stretch;
    flex-direction: column;
  }

  .monthly-main strong {
    font-size: 34px;
  }

  .calc-kpi-grid,
  .monthly-grid,
  .material-tabs {
    grid-template-columns: 1fr;
  }

  .numbers {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 12px;
  }
}
