: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;
}

.subscription-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 18% 18%, rgba(13, 118, 110, 0.12), transparent 28%),
    radial-gradient(circle at 84% 8%, rgba(38, 91, 215, 0.08), transparent 26%),
    #f7f9f8;
}

.subscription-panel {
  width: min(100%, 980px);
  padding: 34px;
  border: 1px solid rgba(13, 118, 110, 0.14);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 28px 90px rgba(28, 38, 34, 0.12);
}

.subscription-head {
  display: grid;
  justify-items: center;
  gap: 10px;
  max-width: 620px;
  margin: 0 auto 26px;
  text-align: center;
}

.brand-mark.small,
.brand-mark.small img {
  width: 46px;
  height: 46px;
  border-radius: 14px;
}

.subscription-head span {
  color: var(--accent-dark);
  font-weight: 900;
}

.subscription-head h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.04;
  letter-spacing: 0;
}

.subscription-head p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.subscription-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  align-items: stretch;
}

.subscription-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 20px;
  min-height: 100%;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #ffffff;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.subscription-card:hover {
  transform: translateY(-3px);
  border-color: rgba(13, 118, 110, 0.32);
  box-shadow: 0 22px 50px rgba(24, 37, 32, 0.11);
}

.subscription-card.featured {
  border-color: rgba(8, 116, 67, 0.3);
  background:
    linear-gradient(145deg, rgba(232, 249, 240, 0.86), rgba(255, 255, 255, 0.98) 52%),
    #ffffff;
}

.plan-badge {
  width: max-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: #0d766e;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.plan-label {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.subscription-card h2 {
  margin: 0;
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1;
}

.subscription-card h2 small {
  color: var(--muted);
  font-size: 16px;
}

.subscription-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.subscription-card ul {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.subscription-card li {
  position: relative;
  padding-left: 24px;
  color: #3d4947;
  font-weight: 700;
}

.subscription-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #d9f7e8;
}

.subscription-card li::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  width: 5px;
  height: 3px;
  border-left: 2px solid #087443;
  border-bottom: 2px solid #087443;
  transform: rotate(-45deg);
}

.subscription-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 16px;
  border-radius: 12px;
  font-weight: 900;
  text-decoration: none;
}

.subscription-action.primary {
  background: #0d766e;
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(13, 118, 110, 0.24);
}

.subscription-action.secondary {
  border: 1px solid var(--line);
  background: #ffffff;
  color: #17211f;
}

.subscription-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 20px;
  padding: 16px;
  border-radius: 16px;
  background: #f2f6f4;
}

.subscription-footer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.subscription-footer > div {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.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;
}

.auth-message-screen {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.auth-message-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: #e7f7f0;
  color: #087a58;
}

.auth-message-icon::before {
  content: "";
  width: 23px;
  height: 13px;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: translateY(-2px) rotate(-45deg);
}

.auth-message-screen.pending .auth-message-icon {
  background: #eaf3ff;
  color: #245bd7;
}

.auth-message-screen.pending .auth-message-icon::before {
  width: 24px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 3px;
  transform: none;
}

.auth-message-screen.pending .auth-message-icon::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-4px) rotate(-45deg);
}

.auth-message-screen h2 {
  margin: 0;
  font-size: 21px;
}

.auth-message-screen p {
  margin: 0;
  color: #667174;
  line-height: 1.55;
}

.confirmation-email {
  color: #1f2926 !important;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.auth-message-primary {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #111816;
}

.auth-message-primary:hover {
  background: #263230;
}

.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;
}

.forgot-register {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  color: #667174;
  font-size: 13px;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #667174;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.consent-row input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.consent-row a,
.auth-legal-links a {
  color: var(--accent-dark);
  font-weight: 800;
}

.auth-legal-links {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
  color: #667174;
  font-size: 12px;
}

.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);
}

.google-consent {
  margin-top: 8px;
  color: #667174;
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.google-consent a {
  color: var(--accent-dark);
  font-weight: 800;
}

.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: calc(100vw - 32px);
  max-width: none;
  margin: 18px 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;
}

.danger-button {
  background: #fff0ee;
  color: #b42318;
}

.danger-button:hover {
  background: #ffdeda;
}

.product-photo-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed rgba(13, 118, 110, 0.28);
  border-radius: 12px;
  background: linear-gradient(135deg, #f7fcf9, #ffffff);
}

.product-photo-field span {
  display: block;
  color: #263230;
  font-size: 13px;
  font-weight: 900;
}

.product-photo-field small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.photo-upload-box {
  position: relative;
  display: grid;
  place-items: center;
  width: 150px;
  aspect-ratio: 1;
  border: 1px solid rgba(13, 118, 110, 0.18);
  border-radius: 12px;
  overflow: hidden;
  padding: 8px;
  background: #ffffff;
  cursor: pointer;
}

.photo-upload-box input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.photo-upload-box span {
  color: var(--accent-dark);
  font-size: 12px;
  text-align: center;
}

.photo-upload-box img {
  display: block;
  width: auto;
  height: auto;
  max-width: 78%;
  max-height: 78%;
  object-fit: contain;
  object-position: center;
  background: #ffffff;
}

.field-error {
  display: block;
  margin-top: 5px;
  color: var(--bad);
  font-size: 12px;
  font-weight: 800;
}

input.field-invalid {
  border-color: var(--bad);
  box-shadow: 0 0 0 3px rgba(190, 42, 42, 0.1);
}

.account-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 20, 0.46);
  backdrop-filter: blur(5px);
}

.account-panel {
  display: grid;
  gap: 16px;
  width: min(100%, 520px);
  border: 1px solid rgba(220, 225, 221, 0.92);
  border-radius: 14px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(20, 28, 25, 0.24);
}

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

.account-head span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.account-head h2 {
  margin: 4px 0 0;
  font-size: 24px;
}

.modal-close {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  background: #eef3f1;
  color: #34413f;
  font-size: 22px;
}

.modal-close:hover {
  background: #dce8e4;
}

.account-info {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px;
  background: #f8faf8;
}

.account-info span,
.danger-zone p {
  color: var(--muted);
  font-size: 13px;
}

.account-info strong {
  overflow-wrap: anywhere;
}

.account-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.account-links a {
  border: 1px solid rgba(13, 118, 110, 0.16);
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--accent-dark);
  background: #f4fbf7;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.danger-zone {
  display: grid;
  gap: 12px;
  border: 1px solid #f1b6b0;
  border-radius: 12px;
  padding: 14px;
  background: #fff7f6;
}

.danger-zone p {
  margin-top: 4px;
  line-height: 1.45;
}

.main-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 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);
}

.extension-dashboard {
  display: grid;
  gap: 16px;
}

.extension-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  gap: 22px;
  align-items: center;
  border: 1px solid #b9dfcd;
  border-radius: 18px;
  padding: 24px;
  background:
    radial-gradient(circle at 88% 10%, rgba(168, 234, 108, 0.28), transparent 32%),
    linear-gradient(135deg, #f1fbf5, #ffffff);
  box-shadow: 0 22px 54px rgba(31, 37, 40, 0.08);
}

.panel-badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--accent-dark);
  background: #dff6e9;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.extension-hero-panel h3 {
  max-width: 620px;
  margin: 16px 0 10px;
  color: var(--text);
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.08;
}

.extension-hero-panel p {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.extension-benefits-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.extension-benefits-list li {
  position: relative;
  padding-left: 22px;
  color: #33413d;
  font-size: 13px;
  font-weight: 800;
}

.extension-benefits-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 950;
}

.extension-mini-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d3e4dc;
  border-radius: 16px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.extension-mini-flow span {
  border-radius: 999px;
  padding: 10px 12px;
  color: var(--accent-dark);
  background: #e8f7ef;
  font-size: 13px;
  font-weight: 900;
}

.extension-mini-flow b {
  color: var(--accent);
  font-size: 18px;
}

.extension-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.extension-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
  cursor: pointer;
}

.extension-download:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(31, 37, 40, 0.1);
}

.extension-download:disabled {
  cursor: not-allowed;
  opacity: 0.78;
}

.extension-download.primary {
  color: #ffffff;
  background: var(--accent);
}

.extension-download.secondary {
  border: 1px solid #cfe0d8;
  color: var(--accent-dark);
  background: #ffffff;
}

.extension-availability {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 800;
}

.extension-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.extension-steps-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.extension-info-card {
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(31, 37, 40, 0.06);
}

.extension-info-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: var(--accent);
  background: #e8f7ef;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(13, 118, 110, 0.18);
}

.extension-steps-grid .extension-info-icon {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(13, 118, 110, 0.18);
}

.extension-info-card h3 {
  margin: 0;
  font-size: 17px;
}

.extension-info-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.product-card {
  display: grid;
  grid-template-columns: 96px minmax(200px, 0.9fr) 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-photo {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border: 1px solid rgba(13, 118, 110, 0.14);
  border-radius: 14px;
  overflow: hidden;
  background: #eef8f4;
}

.product-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
}

.product-card-photo.empty span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: var(--accent-dark);
  background: #dff7ea;
  font-size: 20px;
  font-weight: 900;
}

.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(5, 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-metrics .product-cost-metric {
  border-color: rgba(13, 118, 110, 0.22);
  background: #f0faf6;
}

.product-metrics .product-cost-metric strong {
  color: var(--good);
}

.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;
}

.finance-head,
.finance-panel-head,
.finance-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.finance-workspace-head {
  margin-bottom: 12px;
}

.finance-workspace-head h2 {
  margin: 9px 0 5px;
  font-size: 28px;
}

.finance-workspace-head p {
  color: var(--muted);
}

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

.finance-nav {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 16px 36px rgba(31, 37, 40, 0.06);
}

.finance-content {
  min-width: 0;
}

.finance-nav-button {
  border: 0;
  border-radius: 12px;
  padding: 14px 16px;
  color: #64716e;
  background: transparent;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  text-align: left;
}

.finance-nav-button.active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 7px 16px rgba(13, 118, 110, 0.18);
}

.finance-page {
  display: none;
}

.finance-page.active {
  display: block;
}

.dre-manual-panel {
  display: grid;
  gap: 16px;
}

.dre-period-card {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: end;
  gap: 14px;
  border: 1px solid rgba(13, 118, 110, 0.12);
  border-radius: 14px;
  padding: 14px;
  background: #f8fffd;
}

.dre-period-card label,
.dre-input-card label {
  display: grid;
  gap: 6px;
  color: #42534e;
  font-size: 12px;
  font-weight: 850;
}

.dre-period-card input,
.dre-input-card input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 800;
}

.dre-input-card input[readonly] {
  color: #52625e;
  background: #f2f7f5;
  cursor: not-allowed;
}

.dre-source-badge {
  justify-self: start;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.dre-source-badge.automatic {
  color: #075985;
  background: #e0f2fe;
}

.dre-source-badge.manual {
  color: #7c2d12;
  background: #ffedd5;
}

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

.dre-section-head > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: #087548;
  background: #dff7ea;
  font-weight: 950;
}

.dre-section-head h4 {
  margin: 0 0 3px;
  color: var(--ink);
  font-size: 15px;
}

.dre-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.dre-placeholder-section {
  border: 1px dashed rgba(13, 118, 110, 0.24);
  border-radius: 14px;
  padding: 16px;
  background: #fbfffd;
}

.dre-marketplace-section {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(13, 118, 110, 0.16);
  border-radius: 14px;
  padding: 16px;
  background: #fbfffd;
}

.dre-marketplace-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dre-marketplace-card {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(13, 118, 110, 0.16);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.dre-marketplace-card.consolidated {
  background: linear-gradient(135deg, #f4fffb, #ffffff);
}

.dre-marketplace-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dre-marketplace-title img {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: contain;
  background: #ffe600;
}

.dre-marketplace-card h5 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.dre-marketplace-title span,
.dre-marketplace-card p,
.dre-marketplace-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.dre-marketplace-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.dre-marketplace-card dl div {
  border-radius: 10px;
  padding: 10px;
  background: #f7fbfa;
}

.dre-marketplace-card dl div.result {
  background: #f0fbf7;
}

.dre-marketplace-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.dre-marketplace-card dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
}

.dre-marketplace-card .positive {
  color: #047857;
}

.dre-marketplace-card .negative {
  color: #bd3342;
}

.dre-charts-section {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(13, 118, 110, 0.16);
  border-radius: 14px;
  padding: 16px;
  background: #fbfffd;
}

.dre-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dre-chart-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(13, 118, 110, 0.14);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.dre-chart-card.wide {
  min-height: 310px;
}

.dre-chart-card h5 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 15px;
}

.dre-chart-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.dre-chart-canvas {
  min-height: 230px;
}

.dre-chart-canvas svg {
  width: 100%;
  height: 230px;
}

.dre-zero-line {
  stroke: rgba(15, 23, 42, 0.15);
  stroke-dasharray: 4 4;
}

.dre-profit-line {
  fill: none;
  stroke: #0f766e;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dre-chart-canvas circle.positive {
  fill: #10b981;
}

.dre-chart-canvas circle.negative {
  fill: #e11d48;
}

.dre-chart-canvas text {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dre-bar-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.dre-bar-legend span,
.dre-donut-list .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.dre-bar-legend .revenue {
  background: #3b82f6;
}

.dre-bar-legend .profit {
  background: #10b981;
}

.dre-bar-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  min-height: 195px;
}

.dre-bar-group {
  display: grid;
  gap: 7px;
  align-items: end;
  height: 195px;
}

.dre-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  height: 160px;
}

.dre-bars span {
  width: 10px;
  border-radius: 999px 999px 4px 4px;
}

.dre-bars .revenue {
  background: #3b82f6;
}

.dre-bars .profit {
  background: #10b981;
}

.dre-bars .profit.negative {
  background: #e11d48;
}

.dre-bar-group small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}

.dre-donut-chart,
.dre-expense-chart {
  display: grid;
  align-content: center;
  gap: 12px;
  min-height: 230px;
}

.dre-donut {
  display: grid;
  place-items: center;
  justify-self: center;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: conic-gradient(#ffe600 0 var(--slice), #e8f0ee var(--slice) 100%);
  position: relative;
}

.dre-donut::after {
  content: "";
  position: absolute;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #fff;
}

.dre-donut strong,
.dre-donut span {
  position: relative;
  z-index: 1;
}

.dre-donut strong {
  color: var(--ink);
  font-size: 24px;
}

.dre-donut span {
  margin-top: 34px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

.dre-donut-list p {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.dre-donut-list .ml {
  background: #ffe600;
}

.dre-expense-bars {
  display: grid;
  gap: 10px;
}

.dre-expense-row {
  display: grid;
  gap: 5px;
}

.dre-expense-row div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.dre-expense-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.dre-expense-row i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f766e, #10b981);
}

.dre-chart-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 1px dashed rgba(13, 118, 110, 0.2);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 850;
  padding: 14px;
}

.dre-comparison-section {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(13, 118, 110, 0.16);
  border-radius: 14px;
  padding: 16px;
  background: #fbfffd;
}

.dre-monthly-comparison {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.dre-comparison-card {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(13, 118, 110, 0.14);
  border-top: 4px solid rgba(13, 118, 110, 0.25);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.dre-comparison-card.positive {
  border-top-color: #10b981;
  background: linear-gradient(135deg, #ffffff, #ecfdf5);
}

.dre-comparison-card.negative {
  border-top-color: #e11d48;
  background: linear-gradient(135deg, #ffffff, #fff1f2);
}

.dre-comparison-card.neutral {
  border-top-color: #94a3b8;
}

.dre-comparison-card span,
.dre-comparison-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.dre-comparison-card strong {
  color: var(--ink);
  font-size: 21px;
}

.dre-comparison-card em {
  width: max-content;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  background: #eef5f3;
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
}

.dre-comparison-card.positive em {
  color: #047857;
  background: #dff7ea;
}

.dre-comparison-card.negative em {
  color: #bd3342;
  background: #ffe4e6;
}

.dre-comparison-empty {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px dashed rgba(13, 118, 110, 0.2);
  border-radius: 12px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 850;
}

.dre-history-section {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(13, 118, 110, 0.16);
  border-radius: 14px;
  padding: 16px;
  background: #fbfffd;
}

.dre-closing-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.dre-closing-panel label {
  display: grid;
  gap: 6px;
  color: #42534e;
  font-size: 12px;
  font-weight: 850;
}

.dre-closing-panel textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 750;
}

.dre-closing-panel textarea:disabled,
.dre-input-card input:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.dre-closing-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dre-closing-status {
  align-self: center;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 950;
}

.dre-closing-status.editing {
  color: #92400e;
  background: #fef3c7;
}

.dre-closing-status.closed {
  color: #047857;
  background: #dff7ea;
}

.dre-history-list {
  display: grid;
  gap: 10px;
}

.dre-history-item {
  display: grid;
  grid-template-columns: 1.1fr repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(13, 118, 110, 0.14);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.dre-history-item.closed {
  border-left: 4px solid #10b981;
}

.dre-history-item.editing {
  border-left: 4px solid #f59e0b;
}

.dre-history-item strong,
.dre-history-item b {
  color: var(--ink);
  font-size: 14px;
}

.dre-history-item span,
.dre-history-item small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.dre-history-item .positive {
  color: #047857;
}

.dre-history-item .negative {
  color: #bd3342;
}

.dre-manual-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dre-calculation-grid {
  align-items: start;
}

.dre-input-card {
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fff;
}

.dre-input-card h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.dre-total-row {
  display: grid;
  gap: 4px;
  margin-top: 4px;
  border: 1px solid rgba(13, 118, 110, 0.16);
  border-radius: 12px;
  padding: 12px;
  background: #f4fffb;
}

.dre-total-row.final {
  background: linear-gradient(135deg, #f5fffb, #ffffff);
}

.dre-total-row span,
.dre-total-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.dre-total-row strong {
  color: var(--ink);
  font-size: 20px;
}

.dre-total-row .negative,
.dre-total-row strong.negative,
.dre-total-row small.negative {
  color: #bd3342;
}

.dre-result-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dre-result-panel article {
  border: 1px solid rgba(13, 118, 110, 0.14);
  border-radius: 14px;
  padding: 16px;
  background: linear-gradient(135deg, #ffffff, #f0fbf7);
}

.dre-result-panel .dre-kpi-card {
  border-top: 4px solid rgba(13, 118, 110, 0.28);
}

.dre-result-panel .dre-kpi-card.revenue {
  border-color: rgba(37, 99, 235, 0.26);
  border-top-color: #3b82f6;
  background: linear-gradient(135deg, #ffffff, #eff6ff);
}

.dre-result-panel .dre-kpi-card.costs {
  border-color: rgba(217, 119, 6, 0.24);
  border-top-color: #f59e0b;
  background: linear-gradient(135deg, #ffffff, #fff7ed);
}

.dre-result-panel .dre-kpi-card.expenses {
  border-color: rgba(225, 29, 72, 0.18);
  border-top-color: #fb7185;
  background: linear-gradient(135deg, #ffffff, #fff1f2);
}

.dre-result-panel .dre-kpi-card.profit.positive {
  border-color: rgba(5, 150, 105, 0.24);
  border-top-color: #10b981;
  background: linear-gradient(135deg, #ffffff, #ecfdf5);
}

.dre-result-panel .dre-kpi-card.profit.negative {
  border-color: rgba(225, 29, 72, 0.22);
  border-top-color: #e11d48;
  background: linear-gradient(135deg, #ffffff, #fff1f2);
}

.dre-result-panel span,
.dre-result-panel small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.dre-result-panel strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--ink);
  font-size: 24px;
}

.dre-result-panel .negative {
  color: #bd3342;
}

.dre-result-panel .positive {
  color: #047857;
}

.dre-comparison.neutral {
  color: var(--muted);
}

.finance-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.finance-overview-grid article {
  display: grid;
  gap: 8px;
  min-height: 130px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 17px;
  background: #fff;
}

.finance-overview-grid span,
.finance-overview-grid small {
  color: var(--muted);
  font-size: 12px;
}

.finance-overview-grid strong {
  font-size: 21px;
}

.finance-overview-grid .waiting strong {
  color: #8a6d2f;
  font-size: 15px;
}

.finance-overview-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.finance-overview-actions button {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 18px;
  text-align: left;
  color: var(--text);
  background: #fff;
  cursor: pointer;
}

.finance-overview-actions button:hover {
  border-color: rgba(13, 118, 110, 0.4);
  transform: translateY(-1px);
}

.finance-overview-actions span {
  color: var(--muted);
  font-size: 12px;
}

.finance-overview-marketplace {
  margin: 12px 0;
}

.finance-overview-marketplace .marketplace-sales-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.finance-overview-marketplace strong.negative {
  color: #dc2626;
}

.finance-calendar-panel,
.finance-dre-panel {
  margin: 12px 0;
}

.finance-period-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.finance-period {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--muted);
  background: #fff;
  font-weight: 850;
  cursor: pointer;
}

.finance-period.active {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.finance-period-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.finance-period-fields label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.finance-period-fields input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
}

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

.finance-dre-grid article {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.finance-dre-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.finance-dre-grid strong.negative {
  color: #dc2626;
}

.finance-dre-grid .dre-final {
  grid-column: span 2;
  border-color: rgba(13, 118, 110, 0.24);
  background: #f0fdfa;
}

.finance-dre-grid .dre-final strong {
  font-size: 24px;
}

.finance-section-intro {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border: 1px solid rgba(13, 118, 110, 0.16);
  border-radius: 12px;
  padding: 22px;
  background: linear-gradient(135deg, #fff, #f0f9f5);
}

.finance-section-intro > div {
  display: flex;
  gap: 14px;
  align-items: center;
}

.finance-section-intro h2 {
  margin: 8px 0 4px;
  font-size: 25px;
}

.finance-section-intro p {
  color: var(--muted);
}

.finance-section-icon,
.integration-brand {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 66px;
  height: 54px;
  border-radius: 14px;
  color: #fff;
  background: var(--accent);
  font-weight: 950;
  font-size: 13px;
  letter-spacing: -0.02em;
}

.finance-section-icon.marketplace,
.integration-brand.ml {
  width: 86px;
  color: #2c3b50;
  background: #ffe600;
  overflow: hidden;
}

.integration-brand.ml img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.finance-section-icon.costs {
  background: #486f9c;
}

.finance-section-icon.integration {
  background: #7354a7;
}

.marketplace-sales-panel {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  background: #fff;
}

.marketplace-period-label {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.marketplace-sales-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.marketplace-sales-head h3 {
  margin: 0 0 4px;
}

.marketplace-sales-head p {
  margin: 0;
  color: var(--muted);
}

.auto-sync-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 12px 14px;
  color: #166534;
  background: #f0fdf4;
  font-size: 13px;
}

.auto-sync-indicator strong {
  font-weight: 950;
}

.auto-sync-indicator span {
  color: #15803d;
}

.integration-auto-sync {
  grid-column: 2 / -1;
}

.marketplace-sales-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.marketplace-sales-kpis article {
  border: 1px solid rgba(13, 118, 110, 0.14);
  border-radius: 12px;
  padding: 14px;
  background: #f8fffd;
}

.marketplace-sales-kpis span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}

.marketplace-sales-kpis strong {
  font-size: 20px;
  color: var(--ink);
}

.missing-cost-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #fecdd3;
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff1f2;
  color: #9f1239;
}

.missing-cost-alert strong {
  display: block;
  margin-bottom: 4px;
}

.missing-cost-alert p {
  margin: 0;
  color: #be123c;
  font-size: 13px;
}

.marketplace-orders-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid #edf0ef;
  border-radius: 12px;
  background: #fff;
}

.marketplace-orders-table {
  min-width: 1150px;
  table-layout: fixed;
}

.marketplace-orders-table th,
.marketplace-orders-table td {
  padding: 12px 14px;
  vertical-align: top;
}

.marketplace-orders-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fffd;
}

.marketplace-orders-table .sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
  box-shadow: 8px 0 14px rgba(8, 61, 52, 0.07);
}

.marketplace-orders-table thead .sticky-col {
  z-index: 4;
  background: #f8fffd;
}

.marketplace-orders-table .order-col {
  width: 150px;
  min-width: 150px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.marketplace-orders-table .date-col {
  width: 96px;
  min-width: 96px;
}

.marketplace-orders-table .sku-col {
  width: 230px;
  min-width: 230px;
  white-space: normal;
}

.marketplace-orders-table .money-col {
  width: 110px;
  min-width: 110px;
  text-align: right;
}

.marketplace-orders-table .margin-percent-col {
  width: 96px;
  min-width: 96px;
}

.marketplace-orders-table .fee-cell {
  color: #c26a00;
}

.marketplace-orders-table .cost-cell {
  color: #bd3342;
}

.marketplace-orders-table .profit-cell {
  color: #087548;
}

.marketplace-orders-table .margin-cell small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 950;
}

.marketplace-orders-table .margin-cell.danger {
  color: #bd3342;
}

.marketplace-orders-table .margin-cell.warning {
  color: #b7791f;
}

.marketplace-orders-table .margin-cell.success {
  color: #087548;
}

.stock-table {
  width: 100%;
  min-width: 1280px;
  table-layout: fixed;
}

.stock-panel .marketplace-orders-wrap {
  max-height: min(640px, calc(100vh - 360px));
  min-height: 430px;
  border-color: #dce9e6;
}

.stock-panel .finance-table th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.stock-table th:nth-child(1),
.stock-table td:nth-child(1) {
  width: 29%;
}

.stock-table th:nth-child(2),
.stock-table td:nth-child(2) {
  width: 12%;
}

.stock-table th:nth-child(3),
.stock-table td:nth-child(3),
.stock-table th:nth-child(4),
.stock-table td:nth-child(4),
.stock-table th:nth-child(5),
.stock-table td:nth-child(5) {
  width: 8%;
}

.stock-table th:nth-child(6),
.stock-table td:nth-child(6),
.stock-table th:nth-child(7),
.stock-table td:nth-child(7),
.stock-table th:nth-child(8),
.stock-table td:nth-child(8) {
  width: 9%;
}

.stock-table th:nth-child(9),
.stock-table td:nth-child(9) {
  width: 8%;
}

.stock-table th:nth-child(10),
.stock-table td:nth-child(10) {
  width: 9%;
}

.stock-controls {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(190px, 240px) minmax(190px, 240px);
  align-items: end;
  gap: 14px;
  margin: 14px 0 16px;
  border: 1px solid rgba(13, 118, 110, 0.12);
  border-radius: 14px;
  padding: 14px;
  background: #f8fffd;
}

.stock-controls label {
  display: grid;
  gap: 6px;
  color: #42534e;
  font-size: 12px;
  font-weight: 850;
}

.stock-controls input,
.stock-controls select,
.stock-goal-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 800;
}

.stock-controls input,
.stock-controls select {
  min-height: 42px;
  box-shadow: 0 6px 14px rgba(31, 37, 40, 0.04);
}

.stock-filter-card {
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.stock-filter-card:hover,
.stock-filter-card.active {
  border-color: rgba(8, 128, 116, 0.38);
  box-shadow: 0 10px 24px rgba(8, 128, 116, 0.12);
  transform: translateY(-1px);
}

.stock-table tbody tr.stock-row-healthy {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.08), rgba(255, 255, 255, 0));
}

.stock-table tbody tr.stock-row-warning {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.11), rgba(255, 255, 255, 0));
}

.stock-table tbody tr.stock-row-low {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.12), rgba(255, 255, 255, 0));
}

.stock-product-cell {
  min-width: 330px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stock-product-cell img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid #dbe8e5;
  object-fit: cover;
  background: #f7fbfa;
}

.stock-product-cell span,
.stock-product-cell strong,
.stock-product-cell small {
  display: block;
}

.stock-product-cell span {
  min-width: 0;
}

.stock-product-cell small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.stock-champion {
  display: inline-flex;
  margin-left: 6px;
  border-radius: 999px;
  padding: 2px 6px;
  color: #92400e;
  background: #fef3c7;
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
}

.stock-muted {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.stock-goal-cell {
  min-width: 120px;
}

.stock-goal-cell small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.stock-logistic {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  color: #596763;
  background: #eef3f1;
  font-size: 12px;
  font-weight: 850;
}

.stock-logistic.full {
  color: #075985;
  background: #e0f2fe;
}

@media (max-width: 900px) {
  .stock-controls {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .stock-panel .marketplace-orders-wrap {
    max-height: 70vh;
    min-height: 360px;
  }

  .stock-table {
    min-width: 1180px;
  }
}

.missing-cost-cell {
  display: block;
  width: 100%;
  min-height: 36px;
  border: 1px solid #dc2626;
  border-radius: 9px;
  padding: 8px 10px;
  color: #991b1b;
  background: #fee2e2;
  font-size: 11px;
  font-weight: 950;
  line-height: 1.2;
  white-space: normal;
  cursor: pointer;
}

.missing-cost-cell:hover {
  background: #fecaca;
}

.missing-cost-cell.compact {
  color: #7f1d1d;
  background: #fff1f2;
}

.warning-text {
  color: #b45309;
  font-weight: 800;
}

.sku-cost-panel {
  margin-top: 12px;
}

.sku-cost-form {
  grid-template-columns: 1.1fr 1.4fr 0.8fr 0.7fr auto;
  align-items: end;
}

.sku-cost-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.ranking-keyword-form {
  grid-template-columns: minmax(0, 1fr) 160px auto;
  align-items: end;
}

.ranking-keywords-list,
.ranking-history-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.ranking-keyword-card,
.ranking-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  background: #fff;
}

.ranking-keyword-card small,
.ranking-history-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.ranking-position {
  display: grid;
  min-width: 150px;
  justify-items: end;
  font-weight: 950;
}

.ranking-position.found,
.ranking-history-item.found > span {
  color: #087548;
}

.ranking-position.not_found,
.ranking-history-item.not_found > span {
  color: #b7791f;
}

.ranking-position.missing_item,
.ranking-history-item.missing_item > span {
  color: #bd3342;
}

.ranking-position.search_error,
.ranking-history-item.search_error > span {
  color: #bd3342;
}

.ranking-message {
  grid-column: 1 / -1;
  color: #bd3342;
  font-weight: 850;
}

.ranking-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 700px) {
  .ranking-keyword-card,
  .ranking-history-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .ranking-position {
    min-width: 0;
    justify-items: start;
    border-radius: 10px;
    padding: 10px;
    background: #f4f8f7;
  }

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

  .ranking-actions button {
    flex: 1;
  }
}

.ranking-history-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.ranking-history-item > span {
  font-weight: 950;
}

.ranking-result-list {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
  margin-top: 4px;
}

.ranking-result-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #e7ece9;
  border-radius: 10px;
  padding: 8px;
  color: var(--text);
  text-decoration: none;
  background: #fbfdfc;
}

.ranking-result-card.mine {
  border-color: #86efac;
  background: #f0fdf4;
}

.ranking-result-card img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  background: #f2f5f4;
}

.ranking-result-card span {
  font-weight: 950;
  white-space: nowrap;
}

.icon-action {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #0f615a;
  background: #fff;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}

.icon-action:hover {
  border-color: rgba(13, 118, 110, 0.35);
  background: #f0fdfa;
}

.icon-action.danger {
  color: #b42318;
}

.icon-action.danger:hover {
  border-color: rgba(180, 35, 24, 0.25);
  background: #fff1f2;
}

.cost-foundation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.cost-foundation-grid article {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 18px;
  background: #fff;
}

.cost-foundation-grid article > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #fff;
  background: var(--accent);
  font-weight: 900;
}

.cost-foundation-grid h3 {
  margin: 14px 0 7px;
}

.cost-foundation-grid p,
.costs-roadmap p {
  color: var(--muted);
  line-height: 1.5;
}

.costs-roadmap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 10px;
}

.integration-cards {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.integration-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 17px;
  background: #fff;
}

.integration-card p {
  margin-top: 5px;
  color: var(--muted);
}

.integration-card.future {
  opacity: 0.72;
}

.integration-brand.sh {
  color: #fff;
  background: #ee4d2d;
  font-size: 12px;
}

.integration-brand.amazon {
  position: relative;
  color: #111827;
  background: #fff;
  border: 1px solid #e5e7eb;
  font-family: Arial, sans-serif;
  font-size: 12px;
}

.integration-brand.amazon::after {
  content: "";
  position: absolute;
  right: 13px;
  bottom: 11px;
  width: 30px;
  height: 9px;
  border-bottom: 3px solid #ff9900;
  border-radius: 0 0 50% 50%;
  transform: rotate(-8deg);
}

.integration-status {
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.integration-status.disconnected {
  color: #a22d3a;
  background: #fde9ec;
}

.integration-status.planned {
  color: #7a5a19;
  background: #fff1c7;
}

.integration-status.connected {
  color: #087443;
  background: #dcfce7;
}

.integration-status-panel {
  margin-top: 10px;
  border: 1px solid rgba(115, 84, 167, 0.18);
  border-radius: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #ffffff, #fbf8ff);
}

.integration-status-panel strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.integration-status-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.integration-checklist > div {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(115, 84, 167, 0.16);
  border-radius: 10px;
  padding: 16px;
  background: #faf8fd;
}

.integration-checklist span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #fff;
  background: #7354a7;
  font-weight: 900;
}

.integration-checklist small {
  color: var(--muted);
  line-height: 1.4;
}

.finance-head {
  margin-bottom: 14px;
  padding: 22px;
  border: 1px solid rgba(13, 118, 110, 0.16);
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff 30%, #edf9f4);
}

.finance-head h2 {
  margin: 9px 0 5px;
  font-size: 27px;
}

.finance-head p,
.finance-panel-head p {
  color: var(--muted);
  line-height: 1.45;
}

.finance-head-actions,
.finance-filters,
.finance-form-actions,
.finance-row-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.finance-head-actions label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.primary-action {
  border: 0;
  border-radius: 9px;
  padding: 12px 16px;
  color: #fff;
  background: var(--accent);
  font-weight: 850;
  cursor: pointer;
}

.primary-action:hover {
  background: var(--accent-dark);
}

.finance-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.finance-cash-position {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 10px;
  border-radius: 12px;
  padding: 20px 22px;
  color: #fff;
  background: linear-gradient(125deg, #123f3b, #0d766e);
  box-shadow: 0 16px 36px rgba(13, 118, 110, 0.2);
}

.finance-cash-position > div:first-child {
  display: grid;
  gap: 6px;
}

.finance-cash-position span,
.finance-cash-position small {
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  font-weight: 750;
}

.finance-cash-position > div:first-child > strong {
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.04em;
}

.finance-cash-position strong.negative {
  color: #ffb4bc;
}

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

.finance-account-balances span {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.finance-account-balances strong {
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 15px;
}

.finance-kpi {
  display: grid;
  gap: 8px;
  min-height: 142px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(31, 37, 40, 0.05);
}

.finance-kpi::before {
  content: "";
  width: 34px;
  height: 5px;
  border-radius: 999px;
  background: #cbd5d1;
}

.finance-kpi.income::before { background: #16a36a; }
.finance-kpi.expense::before { background: #e35d6a; }
.finance-kpi.result::before { background: #0d766e; }
.finance-kpi.projection::before { background: #e5a72d; }

.finance-kpi span,
.finance-kpi small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.finance-kpi strong {
  font-size: clamp(22px, 2.3vw, 30px);
  letter-spacing: -0.03em;
}

.finance-kpi strong.negative {
  color: #bd3342;
}

.finance-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(380px, 0.75fr);
  gap: 10px;
  margin-bottom: 10px;
}

.finance-main-grid:has(.finance-form-panel.hidden) {
  grid-template-columns: 1fr;
}

.finance-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(31, 37, 40, 0.05);
}

.finance-panel-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.finance-category-chart {
  display: grid;
  gap: 12px;
  min-height: 250px;
  align-content: center;
  margin-top: 20px;
}

.finance-category-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(130px, 1.3fr) 100px;
  gap: 12px;
  align-items: center;
}

.finance-category-row > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.finance-category-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.finance-category-row b {
  text-align: right;
  font-size: 13px;
}

.finance-category-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.finance-category-dot.income,
.finance-category-bar i.income { background: #16a36a; }
.finance-category-dot.expense,
.finance-category-bar i.expense { background: #e35d6a; }

.finance-category-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1ef;
}

.finance-category-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.finance-chart-empty {
  text-align: center;
  color: var(--muted);
}

.finance-chart-empty strong {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
}

.icon-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: #f0f3f2;
  font-size: 20px;
  cursor: pointer;
}

.finance-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.finance-form label {
  display: grid;
  gap: 6px;
  color: #4d5b58;
  font-size: 12px;
  font-weight: 850;
}

.finance-wide,
.finance-type-tabs {
  grid-column: 1 / -1;
}

.finance-type-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 5px;
  border-radius: 10px;
  background: #f0f3f2;
}

.finance-type {
  border: 0;
  border-radius: 7px;
  padding: 10px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
  cursor: pointer;
}

.finance-type.active[data-finance-type="income"] {
  color: #087548;
  background: #dff7ea;
}

.finance-type.active[data-finance-type="expense"] {
  color: #a72d3b;
  background: #fde9ec;
}

.finance-form-actions {
  justify-content: flex-end;
}

.finance-recurring-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid rgba(13, 118, 110, 0.18);
  border-radius: 12px;
  padding: 12px;
  background: #f4fbf8;
  cursor: pointer;
}

.finance-recurring-toggle input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--brand);
}

.finance-recurring-toggle span {
  display: grid;
  gap: 4px;
}

.finance-recurring-toggle strong {
  color: var(--ink);
}

.finance-recurring-toggle small {
  color: var(--muted);
  line-height: 1.35;
}

.finance-table-panel {
  padding: 0;
  overflow: hidden;
}

.finance-table-head {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.finance-table-wrap {
  overflow-x: auto;
}

.finance-table {
  width: 100%;
  border-collapse: collapse;
}

.finance-table th,
.finance-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #edf0ef;
  text-align: left;
  white-space: nowrap;
}

.finance-table th {
  color: var(--muted);
  background: #fafcfb;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.finance-description {
  display: flex;
  align-items: center;
  gap: 10px;
}

.finance-description div {
  display: grid;
  gap: 3px;
}

.finance-description small {
  color: var(--muted);
}

.finance-entry-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-weight: 950;
}

.finance-entry-icon.income {
  color: #087548;
  background: #dff7ea;
}

.finance-entry-icon.expense {
  color: #a72d3b;
  background: #fde9ec;
}

.finance-status {
  display: inline-flex;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 850;
}

.finance-status.paid { color: #087548; background: #dff7ea; }
.finance-status.pending { color: #8a5b00; background: #fff3cd; }
.finance-status.overdue { color: #a72d3b; background: #fde9ec; }

.finance-value {
  font-weight: 900;
}

.finance-value.income { color: #087548; }
.finance-value.expense { color: #bd3342; }

.finance-row-actions button {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
  color: var(--muted);
  background: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.finance-row-actions .finance-pay-button {
  border-color: rgba(13, 118, 110, 0.2);
  color: #087548;
  background: #dff7ea;
}

.finance-table-panel .empty-state {
  text-align: center;
}

.finance-structure {
  margin-top: 10px;
  border: 1px solid rgba(13, 118, 110, 0.16);
  border-radius: 12px;
  padding: 20px;
  background: #f7fbf9;
}

.finance-structure-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
}

.finance-structure-head h3 {
  margin: 9px 0 5px;
  font-size: 22px;
}

.finance-structure-head p {
  color: var(--muted);
}

.finance-structure-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.finance-compact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.finance-compact-form label {
  display: grid;
  gap: 6px;
  color: #4d5b58;
  font-size: 12px;
  font-weight: 850;
}

.finance-compact-submit,
.finance-compact-form .form-status {
  align-self: end;
}

.finance-settings-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.finance-setting-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px;
  background: #fff;
}

.finance-setting-item > div {
  display: grid;
  gap: 3px;
}

.finance-setting-item small {
  color: var(--muted);
}

.finance-setting-item button {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
  color: var(--muted);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.finance-setting-item.inactive {
  opacity: 0.55;
}

.finance-setting-empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1050px) {
  .finance-layout {
    grid-template-columns: 1fr;
  }

  .finance-nav {
    position: static;
    display: flex;
    overflow-x: auto;
  }

  .finance-nav-button {
    flex: 1 0 auto;
    text-align: center;
  }

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

  .finance-main-grid {
    grid-template-columns: 1fr;
  }

  .finance-structure-grid {
    grid-template-columns: 1fr;
  }

  .finance-overview-grid,
  .finance-dre-grid,
  .dre-closing-panel,
  .dre-manual-grid,
  .dre-result-panel,
  .dre-marketplace-results,
  .dre-charts-grid,
  .dre-monthly-comparison,
  .cost-foundation-grid,
  .integration-checklist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .finance-head,
  .finance-panel-head,
  .finance-table-head,
  .finance-head-actions,
  .finance-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-period-tabs,
  .finance-period-fields,
  .finance-dre-grid,
  .dre-closing-panel,
  .dre-history-item,
  .dre-period-card,
  .dre-manual-grid,
  .dre-result-panel,
  .dre-marketplace-results,
  .dre-marketplace-card dl,
  .dre-charts-grid,
  .dre-bar-chart,
  .dre-monthly-comparison,
  .finance-overview-grid,
  .finance-overview-actions,
  .cost-foundation-grid,
  .integration-checklist {
    grid-template-columns: 1fr;
  }

  .finance-section-intro,
  .costs-roadmap {
    align-items: stretch;
    flex-direction: column;
  }

  .integration-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .integration-card .integration-status,
  .integration-card button {
    grid-column: 1 / -1;
  }

  .finance-head-actions label,
  .finance-head-actions input,
  .finance-head-actions button,
  .finance-filters select {
    width: 100%;
  }

  .finance-kpis,
  .finance-form,
  .finance-compact-form {
    grid-template-columns: 1fr;
  }

  .finance-cash-position {
    grid-template-columns: 1fr;
  }

  .finance-dre-grid .dre-final {
    grid-column: auto;
  }

  .finance-account-balances {
    grid-template-columns: 1fr;
  }

  .finance-structure-head {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-wide,
  .finance-type-tabs {
    grid-column: auto;
  }

  .finance-category-row {
    grid-template-columns: minmax(100px, 1fr) 1.2fr;
  }

  .finance-category-row b {
    grid-column: 1 / -1;
    text-align: left;
    padding-left: 17px;
  }
}

.admin-dashboard-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border: 1px solid rgba(13, 118, 110, 0.18);
  border-radius: 8px;
  padding: 22px;
  background: linear-gradient(135deg, #ffffff, #eef9f4);
  box-shadow: 0 16px 38px rgba(31, 37, 40, 0.07);
}

.admin-dashboard-head h2 {
  margin: 11px 0 5px;
  font-size: 25px;
}

.admin-dashboard-head p,
.admin-users-head p {
  color: var(--muted);
  line-height: 1.45;
}

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

.admin-metric-card {
  display: grid;
  gap: 6px;
  min-height: 132px;
  align-content: center;
  border: 1px solid #dfe6e3;
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(31, 37, 40, 0.05);
}

.admin-metric-card span,
.admin-insight-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.admin-metric-card strong {
  color: #24302d;
  font-size: 30px;
  line-height: 1;
}

.admin-metric-card small,
.admin-insight-card p {
  color: #7b8582;
  font-size: 11px;
}

.admin-metric-card.primary {
  border-color: #b9d9ee;
  background: #f2f8fc;
}

.admin-metric-card.primary strong {
  color: #245f87;
}

.admin-metric-card.success {
  border-color: #a8e4c4;
  background: #effaf4;
}

.admin-metric-card.success strong {
  color: var(--good);
}

.admin-metric-card.warning {
  border-color: #efd28c;
  background: #fffaf0;
}

.admin-metric-card.warning strong {
  color: #9a6500;
}

.admin-metric-card.danger {
  border-color: #efb9b4;
  background: #fff5f4;
}

.admin-metric-card.danger strong {
  color: var(--bad);
}

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

.admin-insight-card {
  display: grid;
  gap: 5px;
  border: 1px solid #e0e6e3;
  border-radius: 8px;
  padding: 15px;
  background: #fafcfb;
}

.admin-insight-card strong {
  color: var(--accent-dark);
  font-size: 22px;
}

.admin-insight-card p {
  margin: 0;
}

.admin-users-card {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(31, 37, 40, 0.06);
}

.admin-users-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.admin-users-head h3 {
  margin: 0 0 4px;
  font-size: 19px;
}

.admin-users-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px;
  gap: 8px;
}

.admin-users-table-wrap {
  overflow-x: auto;
  border: 1px solid #e1e6e4;
  border-radius: 8px;
}

.admin-users-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  text-align: left;
}

.admin-users-table th {
  padding: 11px 12px;
  color: #66716e;
  background: #f3f6f5;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-users-table td {
  border-top: 1px solid #e6ebe8;
  padding: 12px;
  color: #37433f;
  font-size: 12px;
  vertical-align: middle;
}

.admin-users-table tbody tr:hover {
  background: #f8fbf9;
}

.admin-user-identity {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 250px;
}

.admin-user-identity > span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 900;
}

.admin-user-identity > div {
  display: grid;
  gap: 2px;
}

.admin-user-identity strong {
  font-size: 13px;
}

.admin-user-identity small,
.admin-user-identity em,
.admin-table-secondary {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.admin-plan-status {
  display: inline-flex;
  border-radius: 999px;
  padding: 6px 9px;
  color: #805400;
  background: #fff0c7;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.admin-plan-status.active {
  color: var(--good);
  background: #dff7ea;
}

.admin-plan-status.expired {
  color: var(--bad);
  background: #ffe6e3;
}

.admin-dashboard-status {
  min-height: 17px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.admin-dashboard-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border: 1px solid rgba(13, 118, 110, 0.18);
  border-radius: 8px;
  padding: 22px;
  background: linear-gradient(135deg, #ffffff, #eef9f4);
  box-shadow: 0 16px 38px rgba(31, 37, 40, 0.07);
}

.admin-dashboard-head h2 {
  margin: 11px 0 5px;
  font-size: 25px;
}

.admin-dashboard-head p,
.admin-users-head p {
  color: var(--muted);
  line-height: 1.45;
}

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

.admin-metric-card {
  display: grid;
  gap: 6px;
  min-height: 132px;
  align-content: center;
  border: 1px solid #dfe6e3;
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(31, 37, 40, 0.05);
}

.admin-metric-card span,
.admin-insight-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.admin-metric-card strong {
  color: #24302d;
  font-size: 30px;
  line-height: 1;
}

.admin-metric-card small,
.admin-insight-card p {
  color: #7b8582;
  font-size: 11px;
}

.admin-metric-card.primary {
  border-color: #b9d9ee;
  background: #f2f8fc;
}

.admin-metric-card.primary strong {
  color: #245f87;
}

.admin-metric-card.success {
  border-color: #a8e4c4;
  background: #effaf4;
}

.admin-metric-card.success strong {
  color: var(--good);
}

.admin-metric-card.warning {
  border-color: #efd28c;
  background: #fffaf0;
}

.admin-metric-card.warning strong {
  color: #9a6500;
}

.admin-metric-card.danger {
  border-color: #efb9b4;
  background: #fff5f4;
}

.admin-metric-card.danger strong {
  color: var(--bad);
}

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

.admin-insight-card {
  display: grid;
  gap: 5px;
  border: 1px solid #e0e6e3;
  border-radius: 8px;
  padding: 15px;
  background: #fafcfb;
}

.admin-insight-card strong {
  color: var(--accent-dark);
  font-size: 22px;
}

.admin-insight-card p {
  margin: 0;
}

.admin-users-card {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(31, 37, 40, 0.06);
}

.admin-users-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.admin-users-head h3 {
  margin: 0 0 4px;
  font-size: 19px;
}

.admin-users-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px;
  gap: 8px;
}

.admin-users-table-wrap {
  overflow-x: auto;
  border: 1px solid #e1e6e4;
  border-radius: 8px;
}

.admin-users-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  text-align: left;
}

.admin-users-table th {
  padding: 11px 12px;
  color: #66716e;
  background: #f3f6f5;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-users-table td {
  border-top: 1px solid #e6ebe8;
  padding: 12px;
  color: #37433f;
  font-size: 12px;
  vertical-align: middle;
}

.admin-users-table tbody tr:hover {
  background: #f8fbf9;
}

.admin-user-identity {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 250px;
}

.admin-user-identity > span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 900;
}

.admin-user-identity > div {
  display: grid;
  gap: 2px;
}

.admin-user-identity strong {
  font-size: 13px;
}

.admin-user-identity small,
.admin-user-identity em,
.admin-table-secondary {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.admin-plan-status {
  display: inline-flex;
  border-radius: 999px;
  padding: 6px 9px;
  color: #805400;
  background: #fff0c7;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.admin-plan-status.active {
  color: var(--good);
  background: #dff7ea;
}

.admin-plan-status.expired {
  color: var(--bad);
  background: #ffe6e3;
}

.admin-dashboard-status {
  min-height: 17px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.support-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 20px;
  align-items: center;
  border: 1px solid rgba(13, 118, 110, 0.2);
  border-radius: 8px;
  padding: 24px;
  background: linear-gradient(135deg, #ffffff, #edf9f4);
  box-shadow: 0 16px 40px rgba(31, 37, 40, 0.07);
}

.support-hero h2 {
  margin: 12px 0 6px;
  font-size: 28px;
}

.support-hero p,
.support-section-title p,
.support-history-head p {
  color: var(--muted);
  line-height: 1.45;
}

.support-hero-status {
  display: grid;
  gap: 4px;
  border-left: 1px solid rgba(13, 118, 110, 0.18);
  padding-left: 20px;
}

.support-hero-status span,
.support-hero-status small {
  color: var(--muted);
  font-size: 12px;
}

.support-hero-status strong {
  color: var(--good);
  font-size: 20px;
}

.support-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 14px;
  margin-top: 14px;
}

.support-faq-card,
.support-ticket-card,
.support-history-card,
.support-admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(31, 37, 40, 0.06);
}

.support-section-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.support-section-title > span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 950;
}

.support-section-title h3,
.support-history-head h3 {
  margin: 0 0 4px;
  font-size: 19px;
}

.support-faq-list {
  display: grid;
  gap: 8px;
}

.support-faq-list details {
  border: 1px solid #e1e7e4;
  border-radius: 8px;
  background: #f9fbfa;
}

.support-faq-list summary {
  position: relative;
  padding: 14px 38px 14px 14px;
  cursor: pointer;
  list-style: none;
  color: #293532;
  font-size: 13px;
  font-weight: 850;
}

.support-faq-list summary::-webkit-details-marker {
  display: none;
}

.support-faq-list summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 14px;
  color: var(--accent);
  font-size: 18px;
  transform: translateY(-50%);
}

.support-faq-list details[open] summary::after {
  content: "−";
}

.support-faq-list details p {
  border-top: 1px solid #e1e7e4;
  margin: 0;
  padding: 12px 14px 14px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.support-ticket-form {
  display: grid;
  gap: 12px;
}

.support-ticket-form label {
  display: grid;
  gap: 6px;
}

.support-ticket-form textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border: 1px solid #cfd8d4;
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
}

.support-ticket-form textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 118, 110, 0.1);
}

.support-ticket-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.support-ticket-status.success {
  color: var(--good);
}

.support-ticket-status.error {
  color: var(--bad);
}

.support-history-card {
  margin-top: 14px;
}

.support-admin-card {
  margin-top: 14px;
  border-color: rgba(13, 118, 110, 0.26);
  background: linear-gradient(145deg, #ffffff, #f2faf6);
}

.support-admin-label {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.support-history-head,
.support-ticket-item-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.support-tickets-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.support-ticket-item {
  display: grid;
  gap: 10px;
  border: 1px solid #dfe6e3;
  border-radius: 8px;
  padding: 16px;
  background: #fafcfb;
}

.support-ticket-item-head span,
.support-ticket-item > small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.support-ticket-item h4 {
  margin: 4px 0 0;
  font-size: 15px;
}

.support-ticket-item > p,
.support-response p {
  margin: 0;
  color: #4e5b57;
  line-height: 1.5;
  white-space: pre-wrap;
}

.support-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 9px;
  color: #805400;
  background: #fff0c7;
  font-size: 10px;
}

.support-status.in_progress {
  color: #315d98;
  background: #e6effc;
}

.support-status.answered,
.support-status.closed {
  color: var(--good);
  background: #dff7ea;
}

.support-response {
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  background: #edf9f4;
}

.support-response strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-dark);
  font-size: 12px;
}

.support-awaiting,
.support-loading,
.support-empty-state {
  color: var(--muted);
  font-size: 12px;
}

.support-awaiting {
  border-radius: 8px;
  padding: 9px 11px;
  background: #f1f4f3;
}

.support-admin-tickets {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.support-admin-ticket {
  display: grid;
  gap: 12px;
  border: 1px solid #d9e5df;
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
}

.support-admin-ticket > p {
  margin: 0;
  color: #4e5b57;
  line-height: 1.5;
  white-space: pre-wrap;
}

.support-admin-ticket label {
  display: grid;
  gap: 6px;
}

.support-admin-ticket textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #cfd8d4;
  border-radius: 8px;
  padding: 11px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
}

.support-admin-ticket textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 118, 110, 0.1);
}

.support-admin-actions {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(180px, 0.55fr);
  gap: 8px;
}

.admin-ticket-feedback {
  min-height: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-ticket-feedback.success {
  color: var(--good);
}

.admin-ticket-feedback.error {
  color: var(--bad);
}

.support-loading,
.support-empty-state {
  padding: 18px 0 4px;
  text-align: center;
}

.ml-imported-card {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(13, 118, 110, 0.22);
  border-radius: 18px;
  background: linear-gradient(135deg, #effaf6, #ffffff);
  text-align: left;
}

.ml-imported-media {
  width: 96px;
  height: 96px;
  overflow: hidden;
  border-radius: 14px;
  background: #edf4f1;
}

.ml-imported-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ml-imported-content {
  min-width: 0;
}

.ml-imported-content span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.ml-imported-content h3 {
  margin: 5px 0 7px;
  font-size: 19px;
  line-height: 1.25;
}

.ml-imported-content p {
  margin: 0 0 8px;
  color: #17211f;
  font-weight: 900;
}

.ml-imported-content a {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.ml-imported-card button {
  min-height: 42px;
  border-radius: 12px;
  padding: 0 14px;
  background: var(--accent);
  white-space: nowrap;
}

.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;
}

.calc-kpi.production-cost-kpi {
  border-color: rgba(13, 118, 110, 0.24);
  background: #f0faf6;
}

.calc-kpi.production-cost-kpi strong {
  color: var(--good);
}

.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(4, 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;
}

.cookie-banner {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(520px, calc(100% - 36px));
  border: 1px solid #cde2d8;
  border-radius: 10px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 60px rgba(28, 48, 41, 0.16);
}

.cookie-banner strong {
  display: block;
  margin-bottom: 4px;
}

.cookie-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.cookie-banner a {
  color: var(--accent-dark);
  font-weight: 800;
}

.cookie-banner button {
  flex: 0 0 auto;
  border-radius: 8px;
  padding: 11px 16px;
  background: var(--accent);
  font-weight: 900;
}

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

.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) {
  body {
    overflow-x: hidden;
  }

  .subscription-shell {
    padding: 16px;
  }

  .subscription-panel {
    padding: 22px;
    border-radius: 20px;
  }

  .subscription-grid {
    grid-template-columns: 1fr;
  }

  .subscription-card {
    padding: 20px;
  }

  .subscription-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .subscription-footer > div,
  .subscription-footer button {
    width: 100%;
  }

  .login-shell {
    grid-template-columns: 1fr;
    align-content: center;
    padding: 16px;
  }

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

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

  .shell {
    width: calc(100% - 12px);
    margin: 8px auto 28px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 14px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr 80px;
    gap: 8px;
  }

  .topbar-brand {
    min-width: 0;
  }

  .topbar-brand h1 {
    font-size: 23px;
  }

  .topbar-brand p {
    font-size: 12px;
  }

  .grid,
  .fields,
  .fields.two,
  .fields.three,
  .fields.four,
  .fields.five,
  .calc-layout,
  .product-card,
  .product-metrics,
  .ml-imported-card,
  .ranking-card,
  .ranking-metrics,
  .placeholder-grid,
  .finance-preview-items,
  .admin-metrics-grid,
  .admin-insights-grid,
  .support-hero,
  .support-layout,
  .extension-hero-panel,
  .extension-info-grid,
  .extension-steps-grid {
    grid-template-columns: 1fr;
  }

  .ml-imported-media {
    width: 100%;
    height: 180px;
  }

  .ml-imported-card button {
    width: 100%;
  }

  .support-hero-status {
    border-top: 1px solid rgba(13, 118, 110, 0.18);
    border-left: 0;
    padding-top: 14px;
    padding-left: 0;
  }

  .support-history-head,
  .support-ticket-item-head {
    align-items: stretch;
    flex-direction: column;
  }

  .support-history-head button {
    width: 100%;
  }

  .admin-dashboard-head,
  .admin-users-head {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-dashboard-head button {
    width: 100%;
  }

  .admin-users-filters {
    grid-template-columns: 1fr;
  }

  .support-admin-actions {
    grid-template-columns: 1fr;
  }

  .main-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 6px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .nav-button {
    flex: 0 0 auto;
    min-width: 128px;
    padding-inline: 8px;
    scroll-snap-align: start;
  }

  .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;
  }

  .product-photo-field {
    grid-template-columns: 1fr;
  }

  .extension-benefits-list {
    grid-template-columns: 1fr;
  }

  .photo-upload-box {
    width: 100%;
    height: 220px;
    aspect-ratio: auto;
  }

  .product-card-photo {
    width: 100%;
    height: 180px;
  }

  .calc-summary {
    position: static;
  }

  .step-top,
  .step-inline-result,
  .sell-decision-card,
  .price-title-row,
  .monthly-head,
  .monthly-total-row {
    align-items: stretch;
    flex-direction: column;
  }

  .step-next,
  .step-edit,
  .edit-calculation,
  .advanced-toggle {
    width: 100%;
    justify-self: stretch;
  }

  .sell-decision-icon,
  .price-icon {
    align-self: flex-start;
  }

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

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

  .calc-layout.results-mode .calc-kpi-grid,
  .calc-layout.results-mode .monthly-grid,
  .result-card {
    grid-template-columns: 1fr;
  }

  .summary-card.primary strong {
    font-size: 36px;
    overflow-wrap: anywhere;
  }

  .breakdown-sale,
  .breakdown-line,
  .breakdown-profit,
  .number-row {
    align-items: flex-start;
  }

  .breakdown-sale strong,
  .breakdown-line strong,
  .breakdown-profit strong,
  .number-row strong {
    text-align: right;
    overflow-wrap: anywhere;
  }

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

  .cookie-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .account-panel {
    max-height: calc(100vh - 36px);
    overflow: auto;
  }
}

@media (max-width: 820px) {
  #appView.shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 10px 10px 86px;
  }

  #appView .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    margin: -10px -10px 10px;
    padding: 12px 12px 10px;
    border-bottom: 1px solid rgba(13, 118, 110, 0.12);
    border-radius: 0 0 18px 18px;
    background: rgba(246, 251, 248, 0.96);
    box-shadow: 0 14px 32px rgba(31, 37, 40, 0.08);
    backdrop-filter: blur(12px);
  }

  #appView .topbar-brand {
    align-items: center;
  }

  #appView .topbar-brand > img {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  #appView .top-actions {
    grid-template-columns: 1fr 72px;
  }

  #appView .top-actions button {
    min-height: 42px;
    border-radius: 12px;
  }

  #appView .main-nav {
    position: sticky;
    top: 86px;
    z-index: 25;
    margin: 0 -10px 12px;
    padding: 8px 10px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 24px rgba(31, 37, 40, 0.08);
  }

  #appView .nav-button {
    min-width: 112px;
    min-height: 42px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
  }

  #appView .module-head,
  #appView .finance-workspace-head,
  #appView .finance-section-intro {
    margin-right: 0;
    margin-left: 0;
    border-radius: 18px;
    padding: 16px;
  }

  #appView .module-head h2,
  #appView .finance-workspace-head h2,
  #appView .finance-section-intro h2 {
    font-size: 24px;
    line-height: 1.12;
  }

  #appView .module-head p,
  #appView .finance-workspace-head p,
  #appView .finance-section-intro p {
    font-size: 14px;
    line-height: 1.45;
  }

  #appView .panel,
  #appView .results,
  #appView .finance-panel,
  #appView .finance-kpi,
  #appView .finance-overview-grid article,
  #appView .finance-dre-grid article,
  #appView .marketplace-sales-kpis article {
    border-radius: 18px;
    box-shadow: 0 10px 26px rgba(31, 37, 40, 0.06);
  }

  #appView .finance-layout {
    gap: 12px;
  }

  #appView .finance-nav {
    position: sticky;
    top: 146px;
    z-index: 20;
    display: flex;
    gap: 8px;
    margin: 0 -10px 12px;
    padding: 8px 10px;
    overflow-x: auto;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 24px rgba(31, 37, 40, 0.06);
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  #appView .finance-nav-button {
    flex: 0 0 auto;
    min-width: 140px;
    min-height: 40px;
    border-radius: 999px;
    scroll-snap-align: start;
  }

  #appView .finance-period-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #appView .finance-period {
    min-height: 42px;
    border-radius: 12px;
  }

  #appView .marketplace-sales-kpis,
  #appView .finance-overview-grid,
  #appView .finance-dre-grid,
  #appView .finance-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #appView .marketplace-sales-kpis article,
  #appView .finance-overview-grid article,
  #appView .finance-dre-grid article,
  #appView .finance-kpi {
    min-height: 104px;
    padding: 14px;
  }

  #appView .marketplace-sales-kpis strong,
  #appView .finance-overview-grid strong,
  #appView .finance-dre-grid strong,
  #appView .finance-kpi strong {
    font-size: clamp(22px, 7vw, 30px);
    line-height: 1.05;
  }

  #appView .finance-compact-form,
  #appView .stock-controls,
  #appView .finance-period-fields {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #appView input,
  #appView textarea,
  #appView select,
  #appView button {
    min-height: 44px;
    border-radius: 12px;
  }

  #appView .primary-action,
  #appView .secondary-button,
  #appView .finance-compact-submit {
    width: 100%;
  }

  #appView .marketplace-orders-wrap,
  #appView .finance-table-wrap {
    margin-right: -6px;
    margin-left: -6px;
    border-radius: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #appView .marketplace-orders-table,
  #appView .stock-table,
  #appView .finance-table {
    min-width: 760px;
  }

  #appView .marketplace-orders-table th,
  #appView .marketplace-orders-table td,
  #appView .stock-table th,
  #appView .stock-table td,
  #appView .finance-table th,
  #appView .finance-table td {
    padding: 12px 10px;
  }

  #appView .stock-product-cell img {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }
}

@media (max-width: 520px) {
  #appView.shell {
    padding-inline: 8px;
  }

  #appView .module-head,
  #appView .finance-workspace-head,
  #appView .finance-section-intro,
  #appView .finance-panel {
    padding: 14px;
  }

  #appView .marketplace-sales-kpis,
  #appView .finance-overview-grid,
  #appView .finance-dre-grid,
  #appView .finance-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #appView .finance-cash-position {
    padding: 18px;
    border-radius: 20px;
  }

  #appView .finance-cash-position > div:first-child > strong {
    font-size: clamp(34px, 12vw, 46px);
  }

  #appView .finance-panel-head,
  #appView .finance-table-head,
  #appView .results-head {
    gap: 10px;
  }

  #appView .finance-panel-head button,
  #appView .finance-table-head button,
  #appView .results-head button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .login-shell {
    padding: 10px;
  }

  .login-panel {
    padding: 22px 18px;
    border-radius: 14px;
  }

  .topbar-brand > img {
    width: 40px;
    height: 40px;
  }

  .secondary-button {
    padding-inline: 10px;
  }

  .panel,
  .results,
  .calc-step,
  .calc-summary,
  .monthly-potential {
    padding: 14px;
  }

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

  .platform-tabs {
    grid-template-columns: 1fr;
  }

  .monthly-title-row {
    flex-direction: column;
  }
}
