:root {
  --ink: #111111;
  --muted: #666666;
  --soft: #f5f5f4;
  --paper: #ffffff;
  --line: #dededb;
  --yellow: #ffd62c;
  --rail: #171717;
  --rail-width: 216px;
  --topbar: 62px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--soft); color: var(--ink); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; } button { cursor: pointer; }
.hidden { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

.kicker, .panel-kicker { margin: 0; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

/* Navegación al estilo Contacto App */
.dashboard { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; flex-direction: column; width: var(--rail-width); padding: 18px 14px; background: var(--rail); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px; color: #fff; text-decoration: none; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.brand img { width: 32px; height: 32px; object-fit: contain; }
.side-nav { display: grid; gap: 5px; margin-top: 34px; }
.side-link { position: relative; display: flex; align-items: center; min-height: 42px; border-radius: 8px; padding: 0 12px; color: #aaa; text-decoration: none; font-size: 13px; font-weight: 600; }
.side-link:hover { background: #262626; color: #fff; }.side-link.active { background: #2b2b2b; color: #fff; }
.side-link.active::before { content: ""; position: absolute; left: 0; width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: var(--yellow); }
.sidebar-footer { margin-top: auto; border-top: 1px solid #333; padding-top: 12px; }

.workspace { min-height: 100vh; margin-left: var(--rail-width); }
.commandbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; min-height: var(--topbar); border-bottom: 1px solid var(--line); padding: 0 28px; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
.breadcrumb { display: flex; align-items: center; gap: 8px; color: #8a8a86; font-size: 12px; }.breadcrumb b { color: #c8c8c4; }.breadcrumb strong { color: #222; }
.command-actions, .user-block, .system-status { display: flex; align-items: center; }.command-actions { gap: 12px; }
.system-status { gap: 8px; color: #555; font-size: 11px; }
.icon-button, .logout { min-height: 34px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #333; padding: 0 11px; font-size: 11px; font-weight: 700; }
.icon-button:hover, .logout:hover { border-color: #999; }
.user-block { gap: 8px; border-left: 1px solid var(--line); padding-left: 12px; color: #555; font-size: 11px; }
.user-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: #171717; }.user-avatar img { width: 20px; height: 20px; object-fit: contain; }

/* Contenido */
.page { width: min(1420px, 100%); margin: 0 auto; padding: 34px 30px 56px; }
.page-head { display: flex; justify-content: space-between; gap: 30px; align-items: end; margin-bottom: 24px; }
.page-title { display: flex; align-items: center; gap: 14px; }.page-title > img { width: 48px; height: 48px; object-fit: contain; }
.page-head h1 { margin: 0; font-size: clamp(27px, 3vw, 40px); letter-spacing: -.045em; }
.head-meta { max-width: 430px; text-align: right; }.head-meta p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }.head-meta .updated { margin-top: 5px; color: #222; font-weight: 600; }
.dashboard-error { border: 1px solid #d7a6a6; border-radius: 8px; background: #fff5f5; color: #8a2020; padding: 11px 13px; }

.control-panel, .metric, .panel { border: 0; border-radius: 9px; background: #fff; box-shadow: none; }
.control-panel { margin-bottom: 16px; padding: 15px; }.control-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 11px; }
.control-title span { font-size: 12px; font-weight: 800; }.control-title small { color: var(--muted); font-size: 10px; }
.filters { display: grid; grid-template-columns: minmax(230px, 1.45fr) repeat(3, minmax(140px, .75fr)) auto; gap: 8px; align-items: end; }
.field { display: grid; gap: 5px; }.field-label { color: #555; font-size: 10px; font-weight: 700; }
.field input, .field select { width: 100%; min-height: 38px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #222; padding: 8px 10px; outline: none; }
.field input:focus, .field select:focus { border-color: #777; box-shadow: 0 0 0 3px rgba(0,0,0,.05); }
.export { min-height: 38px; border: 1px solid #171717; border-radius: 7px; background: #171717; color: #fff; padding: 0 14px; font-size: 11px; font-weight: 700; }.export:hover { background: #333; }.export:disabled { opacity: .4; cursor: default; }

.overview-grid { display: grid; grid-template-columns: minmax(390px, 1.25fr) minmax(440px, 1fr); gap: 16px; }.metric { padding: 20px; }
.metric-primary { position: relative; overflow: hidden; min-height: 244px; }
.metric-top, .metric-foot, .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.metric-label { color: #555; font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.hero-value { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 11px; }.hero-value strong { font-size: clamp(54px, 6vw, 82px); line-height: .9; letter-spacing: -.07em; font-variant-numeric: tabular-nums; }.hero-value span { color: #777; font-size: 12px; font-weight: 700; }
.metric-foot p { margin: 0; color: #555; font-size: 11px; }
.nps-explanation { max-width: 760px; margin: 16px 0 0; padding-top: 0; color: #555; font-size: 11px; line-height: 1.55; }.nps-explanation strong { color: #111; }
.metric-stack { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }.metric-stack .metric { display: flex; flex-direction: column; justify-content: space-between; min-height: 118px; padding: 15px; }
.metric-stack strong { margin-top: 12px; font-size: 29px; letter-spacing: -.045em; }.metric-stack small { color: #777; font-size: 10px; }

.insight-grid { display: grid; grid-template-columns: minmax(320px, .82fr) minmax(440px, 1.18fr); gap: 16px; margin-top: 16px; }.panel { padding: 20px; }
.panel-head { margin-bottom: 20px; }.panel-head h2 { margin: 5px 0 0; font-size: 16px; }.panel-note, .result-count { color: #777; font-size: 10px; }
.branch-list { display: grid; gap: 15px; }.branch-row { display: grid; grid-template-columns: 72px minmax(100px, 1fr) 72px; gap: 10px; align-items: center; }.branch-row b { font-size: 11px; }.branch-row > span { color: #555; font-size: 10px; text-align: right; }
.track { height: 7px; overflow: hidden; border-radius: 99px; background: #ececea; }.fill { height: 100%; border-radius: inherit; background: #171717; }
.score-legend { display: flex; gap: 9px; color: #777; font-size: 9px; }.score-legend span::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: #bbb; }.score-legend .promoter::before { background: var(--yellow); }.score-legend .detractor::before { background: #222; }
.score-chart { display: grid; grid-template-columns: repeat(11, minmax(17px, 1fr)); gap: 7px; height: 150px; }.score-col { display: grid; grid-template-rows: 1fr auto; gap: 7px; text-align: center; }.score-bar-wrap { display: flex; align-items: end; height: 100%; border-bottom: 1px solid var(--line); }.score-bar { width: 100%; min-height: 3px; background: #171717; }.score-col:nth-last-child(-n+2) .score-bar { background: var(--yellow); }.score-col small { color: #666; font-size: 9px; }

.table-panel { margin-top: 16px; padding: 0; overflow: hidden; }.table-head { padding: 18px 20px; margin: 0; border-bottom: 1px solid var(--line); }.table-wrap { overflow: auto; }
table { width: 100%; min-width: 980px; border-collapse: collapse; }th, td { border-bottom: 1px solid #ecece9; padding: 11px 14px; text-align: left; vertical-align: top; }th { position: sticky; top: 0; z-index: 1; background: #fafafa; color: #666; font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }td { color: #333; font-size: 11px; line-height: 1.45; }tbody tr:hover { background: #fcfcfa; }
.date { white-space: nowrap; color: #666; }.response { min-width: 200px; max-width: 340px; }.branch-chip, .score-pill { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 4px 7px; font-size: 9px; font-weight: 700; }.score-pill { min-width: 28px; color: #111; }.score-pill.good { border-color: #dfc64c; background: #fffbe5; }.score-pill.bad { border-color: #999; background: #f0f0ee; }.phone-link { color: #111; font-weight: 600; }
.empty { display: grid; place-items: center; min-height: 260px; padding: 40px; text-align: center; }.empty img { width: 45px; height: 45px; }.empty strong { margin-top: 12px; }.empty p { max-width: 360px; margin: 7px 0 0; color: #777; font-size: 11px; }
footer { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 28px; padding-top: 18px; color: #888; font-size: 10px; }
.loading { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(255,255,255,.74); backdrop-filter: blur(3px); }.spinner { width: 34px; height: 34px; border: 3px solid #ddd; border-top-color: #171717; border-radius: 50%; animation: spin .7s linear infinite; }@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) { .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }.overview-grid, .insight-grid { grid-template-columns: 1fr; }.metric-stack { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
  :root { --rail-width: 0px; }
  .sidebar { inset: auto 0 0; width: 100%; height: 62px; flex-direction: row; align-items: center; padding: 7px 12px; border-top: 1px solid #333; }.brand, .sidebar-footer { display: none; }.side-nav { grid-template-columns: repeat(2, 1fr); flex: 1; margin: 0; }.side-link { justify-content: center; min-height: 46px; }.side-link.active::before { inset: auto auto 0; width: 24px; height: 3px; border-radius: 3px 3px 0 0; }
  .workspace { margin-left: 0; padding-bottom: 66px; }.commandbar { padding: 0 16px; }.breadcrumb, .system-status, #user-email { display: none; }.command-actions { width: 100%; justify-content: flex-end; }.user-block { border-left: 0; margin-left: auto; padding-left: 0; }
  .page { padding: 24px 16px 42px; }.page-head { display: block; }.page-title > img { width: 42px; height: 42px; }.head-meta { margin-top: 12px; text-align: left; }
  .filters, .metric-stack { grid-template-columns: 1fr; }.overview-grid { grid-template-columns: 1fr; }.metric-primary { min-height: auto; }.score-legend { display: none; } footer { display: grid; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; }.spinner { animation: none; } }
