/* dashboard-main.css — Social Dealer concesionario VW
   Tema oscuro fijo: #001E50 bg · #3DDB84 accent · #152038 surface */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap');

* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }

:root {
  --bg: #001E50;
  --bg-2: #00163C;
  --surface: #152038;
  --surface-2: #1B2A48;
  --surface-3: #233458;
  --border: #2A3A5E;
  --border-soft: #1F2E50;
  --text: #FFFFFF;
  --text-2: #B8C2D6;
  --text-3: #7E8AA8;
  --accent: #3DDB84;
  --accent-press: #2BC971;
  --accent-text: #001E50;
  --accent-soft: rgba(61, 219, 132, 0.14);
  --lake: #4CC3E8;
  --mid: #6091C3;
  --silver: #C0C0C0;
  --positive: #3DDB84;
  --negative: #F77B6E;
  --warning: #F2C94C;

  --f-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --f-ui: 'Geist', system-ui, sans-serif;
  --f-mono: 'Geist Mono', ui-monospace, monospace;

  --ease: cubic-bezier(.2,.8,.2,1);
  --shadow: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 8px 24px -12px rgb(0 0 0 / 0.5);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-ui);
  font-size: 14px;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

.sd-app {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
  min-width: 1080px;
}
body { overflow-x: auto; }

/* Sidebar */
.sd-side {
  background: var(--bg-2);
  border-right: 1px solid var(--border-soft);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: auto;
}
.sd-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 6px 18px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 14px;
}
.sd-brand-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.sd-brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.sd-brand-text {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.sd-brand-text em {
  display: block;
  font-style: normal;
  font-weight: 400;
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sd-nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s var(--ease), color .12s var(--ease);
}
.sd-nav-item:hover { background: var(--surface); color: var(--text); }
.sd-nav-item.is-active {
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}
.sd-nav-item .dot { margin-left: auto; width: 6px; height: 6px; border-radius: 999px; background: var(--accent); }
.sd-nav-item.is-active .dot { display: none; }
.sd-nav-section {
  font-family: var(--f-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  padding: 14px 10px 6px;
}

/* Main */
.sd-main {
  display: flex; flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.sd-top {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg);
  flex-shrink: 0;
}
.sd-top-title {
  display: flex; flex-direction: column; gap: 2px;
}
.sd-top-title .name {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.sd-top-title .meta {
  font-size: 12px;
  color: var(--text-3);
  display: flex; gap: 8px; align-items: center;
}
.sd-top-title .meta .pulse {
  width: 6px; height: 6px; border-radius: 999px; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: sd-pulse 2.4s var(--ease) infinite;
}
@keyframes sd-pulse {
  0% { box-shadow: 0 0 0 0 rgba(61,219,132,0.6); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.sd-top .spacer { flex: 1; }
.sd-top-search {
  position: relative; min-width: 280px;
}
.sd-top-search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  padding: 8px 12px 8px 32px;
  color: var(--text);
  font-family: var(--f-ui);
  font-size: 13px;
  outline: none;
}
.sd-top-search input::placeholder { color: var(--text-3); }
.sd-top-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sd-top-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); }

.sd-icon-btn {
  width: 38px; height: 38px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  border-radius: 9px;
  display: grid; place-items: center;
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  transition: background .15s var(--ease);
}
.sd-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.sd-icon-btn .badge-dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--accent);
  border: 2px solid var(--bg);
}
.sd-avatar {
  width: 38px; height: 38px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--lake));
  color: var(--accent-text);
  display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 700; font-size: 13px;
  border: 2px solid var(--surface);
}

/* Content */
.sd-content {
  flex: 1; overflow: auto;
  padding: 22px 28px 36px;
  display: flex; flex-direction: column; gap: 20px;
}
.sd-content::-webkit-scrollbar { width: 10px; }
.sd-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; border: 3px solid var(--bg); }

.sd-pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.sd-h1 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.025em;
  margin: 0;
  line-height: 1.05;
}
.sd-h1 em { font-style: normal; color: var(--text-3); font-weight: 500; }
.sd-sub { color: var(--text-2); font-size: 14.5px; margin-top: 6px; }

.sd-tabs {
  display: inline-flex; padding: 3px;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: 11px; gap: 2px;
}
.sd-tabs button {
  border: none; background: transparent;
  font-family: var(--f-ui); font-weight: 500; font-size: 12.5px;
  color: var(--text-2);
  padding: 7px 14px; border-radius: 8px;
  cursor: pointer;
}
.sd-tabs button.active { background: var(--bg); color: var(--text); }

/* Cards */
.sd-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

.sd-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.sd-card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.sd-card-title {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.01em;
}
.sd-card-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.sd-eyebrow {
  font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-3);
}

/* KPI */
.sd-kpi { display: flex; flex-direction: column; gap: 10px; min-height: 130px; }
.sd-kpi-row { display: flex; justify-content: space-between; align-items: center; }
.sd-kpi-icon {
  width: 32px; height: 32px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 9px;
  display: grid; place-items: center;
}
.sd-kpi-label {
  font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-3); font-weight: 500;
}
.sd-kpi-val {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -0.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.sd-kpi-foot { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); margin-top: auto; }
.sd-delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--f-mono); font-size: 11.5px; font-weight: 500;
  padding: 2px 7px; border-radius: 999px;
}
.sd-delta.up { color: var(--positive); background: rgba(61,219,132,0.14); }
.sd-delta.down { color: var(--negative); background: rgba(247,123,110,0.14); }
.sd-delta.flat { color: var(--text-3); background: var(--surface-2); }

/* Banner */
.sd-banner {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 0;
  background: linear-gradient(135deg, var(--surface) 0%, #1A2A4F 60%, #1F2F57 100%);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  overflow: hidden;
  min-height: 180px;
  position: relative;
}
.sd-banner-body {
  padding: 26px 30px;
  display: flex; flex-direction: column; gap: 12px; justify-content: center;
}
.sd-banner-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-soft); color: var(--accent);
  padding: 4px 12px; border-radius: 999px;
  font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.1em; font-weight: 600;
  width: fit-content;
}
.sd-banner-title {
  font-family: var(--f-display);
  font-weight: 700; font-size: 22px; letter-spacing: -0.02em;
  line-height: 1.2;
  max-width: 420px;
  text-wrap: pretty;
}
.sd-banner-sub { color: var(--text-2); font-size: 13.5px; max-width: 480px; line-height: 1.5; }
.sd-banner-cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: var(--accent-text);
  border: none; padding: 9px 16px; border-radius: 9px;
  font-family: var(--f-ui); font-weight: 600; font-size: 13px;
  cursor: pointer;
  width: fit-content;
}
.sd-banner-cta:hover { background: var(--accent-press); }
.sd-banner-art {
  position: relative;
  background:
    radial-gradient(circle at 70% 50%, rgba(76,195,232,0.25), transparent 60%),
    linear-gradient(135deg, #001E50, #1F2F57);
  display: grid; place-items: center;
  overflow: hidden;
}
.sd-banner-art::before {
  content: "";
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.18);
  right: -60px; top: 50%; transform: translateY(-50%);
}
.sd-banner-art::after {
  content: "";
  position: absolute;
  width: 140px; height: 140px;
  border-radius: 999px;
  border: 1px solid rgba(76,195,232,0.4);
  right: -10px; top: 30%;
}
.sd-banner-art .month {
  position: relative; z-index: 1;
  font-family: var(--f-display);
  font-weight: 800; font-size: 64px; letter-spacing: -0.04em; line-height: 1;
  background: linear-gradient(180deg, #FFFFFF, #6091C3);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-align: center;
}
.sd-banner-art .month em {
  display: block; font-style: normal; font-size: 13px; font-weight: 500;
  color: var(--text-2); letter-spacing: 0.18em; text-transform: uppercase;
  background: none; -webkit-text-fill-color: var(--text-2); margin-top: 4px;
}

/* Ranking table */
.sd-rank-row {
  display: grid;
  grid-template-columns: 28px 1fr 88px 56px;
  gap: 14px; align-items: center;
  padding: 9px 8px;
  border-radius: 9px;
  transition: background .12s var(--ease);
  cursor: pointer;
}
.sd-rank-row:hover { background: var(--surface-2); }
.sd-rank-row.is-self {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
}
.sd-rank-row.is-self:hover { background: rgba(61,219,132,0.20); }
.sd-rank-pos {
  font-family: var(--f-mono); font-size: 12px;
  color: var(--text-3); font-weight: 500;
  text-align: center;
}
.sd-rank-row.is-self .sd-rank-pos { color: var(--accent); font-weight: 700; }
.sd-rank-row.top-3 .sd-rank-pos { color: var(--accent); font-weight: 700; }
.sd-rank-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sd-rank-name .n { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-rank-name .c { font-size: 11px; color: var(--text-3); font-family: var(--f-mono); }
.sd-rank-bar { display: flex; flex-direction: column; gap: 4px; }
.sd-rank-bar .v { font-family: var(--f-mono); font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; text-align: right; }
.sd-rank-track { height: 4px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.sd-rank-track > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.sd-rank-row.is-self .sd-rank-track > i { background: var(--accent); }
.sd-rank-trend {
  display: inline-flex; align-items: center; justify-content: flex-end; gap: 3px;
  font-family: var(--f-mono); font-size: 11.5px; font-weight: 500;
}
.sd-rank-trend.up { color: var(--positive); }
.sd-rank-trend.down { color: var(--negative); }
.sd-rank-trend.flat { color: var(--text-3); }

.sd-rank-head {
  display: grid;
  grid-template-columns: 28px 1fr 88px 56px;
  gap: 14px;
  padding: 4px 8px 8px;
  font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-3);
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 4px;
}
.sd-rank-head > span:nth-child(3) { text-align: right; }
.sd-rank-head > span:nth-child(4) { text-align: right; }

/* Chart */
.sd-chart-wrap { position: relative; height: 240px; }
.sd-chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; margin-top: 12px; }
.sd-chart-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); cursor: pointer; }
.sd-chart-legend i { width: 8px; height: 8px; border-radius: 2px; }
.sd-chart-tip {
  position: absolute;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  pointer-events: none;
  box-shadow: var(--shadow);
  min-width: 170px;
}
.sd-chart-tip-date {
  font-family: var(--f-mono); font-size: 10.5px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 6px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border-soft);
}
.sd-chart-tip-row { display: flex; justify-content: space-between; gap: 14px; padding: 2px 0; }
.sd-chart-tip-row .l { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.sd-chart-tip-row .l i { width: 7px; height: 7px; border-radius: 999px; }
.sd-chart-tip-row .v { font-family: var(--f-mono); font-weight: 500; color: var(--text); }

/* Region bars */
.sd-region-row {
  display: grid;
  grid-template-columns: 110px 1fr 58px 40px;
  gap: 12px; align-items: center;
  padding: 8px 0;
}
.sd-region-row .name { font-size: 13px; color: var(--text); font-weight: 500; }
.sd-region-row .track { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; position: relative; }
.sd-region-row .track > i { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--lake)); transition: width .8s var(--ease); }
.sd-region-row .v { font-family: var(--f-mono); font-size: 12px; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.sd-region-row .n {
  font-family: var(--f-mono); font-size: 11px; color: var(--text-3);
  text-align: right; font-variant-numeric: tabular-nums;
}

.sd-region-summary {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 16px; padding-top: 16px; margin-top: 12px;
  border-top: 1px solid var(--border-soft);
}
.sd-region-summary .v {
  font-family: var(--f-display); font-weight: 700; font-size: 22px;
  letter-spacing: -0.025em; line-height: 1; font-variant-numeric: tabular-nums;
}
.sd-region-summary .l {
  font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-3); margin-top: 4px;
}

/* Notification bell dropdown (visual only) */
.sd-bell-pop {
  position: absolute; right: 0; top: 46px;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 12px 40px -12px rgb(0 0 0 / 0.6);
  z-index: 20;
}
.sd-bell-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px;
  border-radius: 8px;
}
.sd-bell-row:hover { background: var(--surface-2); }
.sd-bell-row .ico {
  width: 28px; height: 28px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 8px; display: grid; place-items: center; flex-shrink: 0;
}
.sd-bell-row .text { font-size: 13px; color: var(--text); line-height: 1.4; }
.sd-bell-row .time { font-size: 11px; color: var(--text-3); font-family: var(--f-mono); margin-top: 3px; }
