:root {
  color: #17212b;
  background: #eef3f2;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #17212b;
  --muted: #627179;
  --line: #d9e3e0;
  --surface: #ffffff;
  --surface-soft: #f7faf9;
  --brand: #087b70;
  --brand-strong: #075f58;
  --accent: #d9472f;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: radial-gradient(circle at top left, #f8fbfa 0, #eef3f2 34%, #eaf0ef 100%);
}
button, input { font: inherit; }
[hidden] { display: none !important; }

.page-shell { min-height: 100vh; }
.eyebrow {
  margin: 0 0 7px;
  color: var(--brand);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h1, h2 { margin: 0; letter-spacing: 0; color: var(--ink); }
h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1; }
h2 { font-size: 1.15rem; line-height: 1.2; }
.intro, .header-subtitle { color: var(--muted); line-height: 1.55; }
.intro { margin: 18px 0 0; max-width: 520px; font-size: 1.05rem; }
.header-subtitle { margin: 10px 0 0; }

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 48px;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px;
}
.login-brand {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 42px;
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(8, 123, 112, .16), rgba(217, 71, 47, .08)),
    linear-gradient(135deg, #ffffff, #e2eeec);
  border: 1px solid rgba(8, 123, 112, .18);
}
.login-card {
  display: grid;
  gap: 10px;
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(23, 33, 43, .08);
}
.login-card h2 { font-size: 1.55rem; }

label { font-size: .84rem; font-weight: 750; margin-top: 8px; color: #2b3a40; }
input {
  width: 100%;
  min-height: 45px;
  padding: 11px 12px;
  border: 1px solid #bdcbc8;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}
input:focus { outline: 3px solid rgba(8, 123, 112, .18); border-color: var(--brand); }
button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
}
.primary-button { background: var(--brand); color: #fff; }
.primary-button:hover { background: var(--brand-strong); }
button:disabled { cursor: wait; opacity: .65; }
.secondary-button { margin: 0; background: #e1ebe8; color: #173536; }
.secondary-button:hover { background: #d4e2df; }
.message { min-height: 1.3em; margin: 8px 0 0; color: #a82626; font-size: .9rem; }
.message.success { color: var(--brand); }

.dashboard-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}
.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: #fbfdfc;
  border-right: 1px solid var(--line);
}
.brand-mark { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; }
.brand-symbol {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  font-weight: 900;
}
.brand-mark strong, .brand-mark small { display: block; }
.brand-mark small { color: var(--muted); margin-top: 2px; }
.side-nav { display: grid; gap: 6px; }
.side-nav a {
  padding: 11px 12px;
  border-radius: 8px;
  color: #34464c;
  text-decoration: none;
  font-weight: 750;
}
.side-nav a:hover, .side-nav a.active { color: var(--brand-strong); background: #e8f2f0; }

.dashboard { display: grid; gap: 18px; padding: 28px; max-width: 1180px; width: 100%; }
.dashboard-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding-bottom: 4px;
}
.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.status-strip article,
.control-panel,
.ranking-section,
.soft-card {
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.status-strip article { padding: 14px 16px; }
.status-strip span { display: block; color: var(--muted); font-size: .78rem; font-weight: 750; }
.status-strip strong { display: block; margin-top: 4px; font-size: 1rem; }

.control-panel { padding: 18px; }
.pdv-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.filter-card {
  display: grid;
  grid-template-columns: minmax(110px, .45fr) minmax(180px, .7fr) auto;
  align-items: end;
  gap: 14px;
  margin-top: 12px;
}
.filter-card div { display: grid; gap: 7px; }
.filter-card button { margin: 0; }
.compact-filter { grid-template-columns: .42fr .72fr .72fr auto; }

.overview-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.25fr) repeat(2, minmax(210px, .65fr));
  gap: 14px;
  align-items: stretch;
}
.metric-card { min-height: 190px; padding: 22px; border-radius: 8px; }
.metric-card-primary { background: #0a3f3b; color: #f6fffd; }
.metric-card-primary h2, .metric-card-primary .metric-label { color: #b5e0da; }
.metric-label { margin: 0; color: var(--muted); font-size: .86rem; font-weight: 800; }
.metric-value {
  margin: 8px 0 22px;
  color: #fff;
  font-size: clamp(2.35rem, 6vw, 4rem);
  font-weight: 850;
  line-height: 1;
}
.soft-value { margin: 12px 0 0; font-size: 1.45rem; font-weight: 850; color: var(--ink); }
.metric-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 16px 0;
  margin: 0;
  border-top: 1px solid rgba(255,255,255,.2);
  border-bottom: 1px solid rgba(255,255,255,.2);
}
.metric-details div { display: grid; gap: 4px; }
dt { color: #b5e0da; font-size: .78rem; font-weight: 750; }
dd { margin: 0; font-weight: 800; }
.metric-note { color: #5b6b70; margin: 14px 0 0; font-size: .84rem; line-height: 1.45; }
.metric-card-primary .metric-note { color: #c7e8e3; }

.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.pdv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ranking-section { display: grid; gap: 12px; padding: 18px; min-width: 0; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.products-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.products-list li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  background: var(--surface-soft);
  border: 1px solid #e2ebe8;
  border-radius: 8px;
}
.product-position {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--brand-strong);
  background: #dcefeb;
  font-weight: 850;
}
.product-name { font-weight: 800; overflow-wrap: anywhere; }
.product-detail { color: var(--muted); font-size: .84rem; }
.product-value { font-weight: 850; text-align: right; white-space: nowrap; }

@media (max-width: 980px) {
  .login-screen { grid-template-columns: 1fr; gap: 20px; }
  .login-brand { min-height: 260px; }
  .dashboard-shell { grid-template-columns: 1fr; }
  .app-sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .side-nav a { text-align: center; }
  .overview-grid, .content-grid, .pdv-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .login-screen { padding: 18px; }
  .login-brand, .login-card { padding: 22px; }
  .dashboard { padding: 18px; }
  .dashboard-header { flex-direction: column; }
  .status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-card, .compact-filter { grid-template-columns: 1fr; }
  .metric-details { grid-template-columns: 1fr; }
  .products-list li { grid-template-columns: 34px minmax(0, 1fr); }
  .product-value { grid-column: 2; text-align: left; }
  .side-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
