/* SURACI Dashboard Inteligente - refinamientos visuales vigentes 30/06/2026 */
:root {
  --su-bg: #03111e;
  --su-bg-2: #061a2d;
  --su-surface: #08243a;
  --su-surface-2: #0a2a43;
  --su-surface-3: #0d314e;
  --su-line: rgba(92, 155, 190, 0.28);
  --su-line-strong: rgba(74, 223, 182, 0.55);
  --su-text: #f3f8ff;
  --su-muted: #8ea6bd;
  --su-soft: #bed0df;
  --su-blue: #244799;
  --su-cyan: #51c6d4;
  --su-green: #47d7ad;
  --su-red: #ff6558;
  --su-yellow: #f4bf43;
  --su-purple: #6d63ff;
  --su-radius: 8px;
  --su-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
  --su-font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--su-bg);
  color: var(--su-text);
  font-family: var(--su-font);
  font-size: 14px;
  letter-spacing: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 82% 18%, rgba(71, 215, 173, 0.09), transparent 28%),
    linear-gradient(135deg, #03101d 0%, #051827 46%, #061321 100%);
  color: var(--su-text);
}

body.auth-required .app-container {
  filter: blur(5px);
  pointer-events: none;
}

a {
  color: inherit;
}

.app-container {
  width: 100%;
  max-width: 1440px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 10px;
  display: grid;
  grid-template-columns: 184px repeat(12, minmax(0, 1fr));
  grid-auto-rows: min-content;
  gap: 10px;
  align-items: start;
}

.left-rail {
  grid-column: 1;
  grid-row: 1 / span 6;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.kpi-grid,
.charts-grid,
.charts-main-grid,
.ranking-section,
.dashboard-footer {
  margin: 0 !important;
}

.dashboard-header,
.period-bar,
.adaptation-panel,
.kpi-card,
.executive-panel,
.chart-card,
.table-section,
.ranking-card,
.config-panel,
.connection-card,
.settings-panel,
.alerts-panel {
  margin: 0 !important;
  border: 1px solid var(--su-line);
  background: linear-gradient(180deg, rgba(12, 45, 71, 0.96), rgba(7, 29, 48, 0.98));
  border-radius: var(--su-radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.dashboard-header,
.period-bar,
.adaptation-panel,
.kpi-card,
.executive-panel,
.chart-card,
.table-section,
.ranking-card,
.config-panel,
.connection-card {
  opacity: 1 !important;
  filter: none !important;
  animation: none !important;
}

.kpi-card::before,
.chart-card::before,
.table-section::before,
.ranking-card::before {
  display: none !important;
}

.suraci-sidebar {
  grid-column: 1;
  grid-row: 1 / span 2;
  min-height: 0;
  border-right: 1px solid rgba(83, 154, 190, 0.18);
  background: linear-gradient(180deg, rgba(3, 16, 29, 0.98), rgba(4, 20, 34, 0.94));
  border-radius: 0;
  padding: 9px 8px;
}

.suraci-sidebar-brand {
  height: 34px;
  display: flex;
  align-items: center;
  padding: 0 4px 8px;
  border-bottom: 1px solid rgba(95, 159, 190, 0.16);
}

.suraci-sidebar-brand img,
.suraci-sidebar-footer img,
.brand-logo img {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.suraci-sidebar-brand img {
  width: 126px;
}

.suraci-nav {
  display: grid;
  gap: 5px;
  padding-top: 8px;
}

.suraci-nav a,
.suraci-nav button {
  width: 100%;
  min-height: 32px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #b9c9da;
  background: linear-gradient(90deg, rgba(8, 28, 45, 0.2), transparent);
  text-decoration: none;
  font: 700 11px/1 var(--su-font);
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.suraci-nav a::after,
.suraci-nav button::after {
  content: "";
  position: absolute;
  inset: 4px auto 4px 0;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

.suraci-nav span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  overflow: hidden;
  color: #49ddbd;
  font-size: 0;
  border-radius: 6px;
  background: rgba(73, 221, 189, 0.08);
}

.suraci-nav span::before {
  content: "";
  width: 8px;
  height: 8px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.suraci-nav a.active,
.suraci-nav a:hover,
.suraci-nav button:hover {
  border-color: rgba(73, 221, 189, 0.22);
  background:
    linear-gradient(90deg, rgba(37, 78, 157, 0.48), rgba(13, 52, 74, 0.25)),
    rgba(9, 34, 55, 0.86);
  color: #ffffff;
  transform: translateX(2px);
}

.suraci-nav a.active::after,
.suraci-nav a:hover::after,
.suraci-nav button:hover::after {
  background: linear-gradient(180deg, #4de2bd, #74b9ff);
  box-shadow: 0 0 12px rgba(73, 221, 189, 0.54);
}

.suraci-nav a.active span,
.suraci-nav a:hover span,
.suraci-nav button:hover span {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(73, 221, 189, 0.35), rgba(116, 185, 255, 0.18));
}

.dashboard-header {
  grid-column: 2 / -1;
  grid-row: 1;
  min-height: 46px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dashboard-header .brand-logo {
  display: none;
}

.header-left {
  min-width: 210px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-title {
  margin: 0;
  color: var(--su-text);
  font-size: 19px;
  line-height: 1.04;
  font-weight: 800;
}

.header-subtitle {
  margin: 2px 0 0;
  color: var(--su-muted);
  font-size: 11px;
  line-height: 1.2;
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.header-right::-webkit-scrollbar {
  display: none;
}

.header-status,
.header-last-update {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  padding: 0 10px;
  border: 1px solid rgba(92, 155, 190, 0.23);
  border-radius: 6px;
  color: var(--su-muted);
  background: rgba(4, 18, 31, 0.62);
  font-size: 11px;
}

.status-dot,
.connection-status-dot,
#connectionCardDot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 999px;
  background: var(--su-yellow);
  box-shadow: 0 0 14px rgba(244, 191, 67, 0.5);
}

.btn,
button,
input,
select {
  font-family: var(--su-font);
  letter-spacing: 0;
}

.btn {
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgba(92, 155, 190, 0.25);
  border-radius: 6px;
  background: rgba(8, 28, 47, 0.86);
  color: #f4f8ff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  border-color: rgba(71, 215, 173, 0.48);
  background: rgba(13, 49, 78, 0.96);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary,
.btn-accent,
.btn-google {
  border-color: rgba(71, 215, 173, 0.75);
  background: linear-gradient(135deg, #50dfb6, #31caa1);
  color: #062018;
}

.btn-danger-soft {
  color: #ffb5ad;
  border-color: rgba(255, 101, 88, 0.38);
  background: rgba(255, 101, 88, 0.11);
}

.btn-icon {
  width: 32px;
  padding: 0;
}

.btn-svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.config-panel {
  grid-column: 1;
  grid-row: 3 / span 2;
  padding: 10px;
  height: 372px;
  overflow: hidden;
}

.connection-card {
  grid-column: 1;
  grid-row: 5;
  padding: 10px;
}

.suraci-sidebar-footer {
  grid-column: 1;
  grid-row: 6;
  padding: 9px 10px 2px;
  align-self: end;
}

.suraci-sidebar-footer img {
  width: 94px;
  margin-bottom: 8px;
}

.suraci-sidebar-footer p {
  margin: 0;
  color: #8ba2b8;
  font-size: 10px;
  line-height: 1.35;
}

.config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.config-header h3,
.connection-card h3,
.adaptation-copy h3 {
  margin: 0;
  color: #ffffff;
  font-size: 12px;
  line-height: 1.15;
  font-weight: 800;
}

.connection-copy,
.config-hint,
.privacy-note,
.google-status,
.settings-hint,
.connection-card dt,
.connection-card dd,
.adaptation-copy p {
  color: var(--su-muted);
  font-size: 10px;
  line-height: 1.35;
}

.connection-copy,
.config-hint,
.privacy-note,
.connection-card p {
  margin: 0 0 8px;
}

.config-input-row {
  display: grid;
  gap: 7px;
}

.config-input-row input,
.config-input-row select,
.table-search,
.modal-field input,
.modal-field select {
  width: 100%;
  min-width: 0;
  height: 32px;
  border: 1px solid rgba(92, 155, 190, 0.28);
  border-radius: 6px;
  background: rgba(5, 19, 33, 0.82);
  color: var(--su-text);
  padding: 0 10px;
  font-size: 11px;
  outline: 0;
}

.config-input-row input::placeholder,
.table-search::placeholder {
  color: rgba(186, 205, 220, 0.45);
}

.connection-status,
.google-connect-row,
.connection-example-row {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.connection-status {
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: center;
  color: var(--su-muted);
  font-size: 10px;
}

.connection-status.success,
.google-status.success,
.connection-card.is-connected strong {
  color: var(--su-green);
}

.connection-status.error,
.google-status.error {
  color: #ffaaa1;
}

.btn-example-sheet {
  border: 0;
  padding: 0;
  color: #7ee8cb;
  background: transparent;
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}

.connection-card p {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--su-green);
}

.connection-card dl {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 6px 7px;
  margin: 8px 0 10px;
}

.connection-card dd {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.period-bar {
  grid-column: 2 / -1;
  grid-row: 2;
  min-height: 74px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: 34px 22px;
  gap: 6px 22px;
  align-items: center;
}

.period-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.period-label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  margin: 0;
  color: #9db0c4;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.period-tabs,
.month-scroller {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.month-scroller {
  gap: 3px;
}

.period-tabs::-webkit-scrollbar,
.month-scroller::-webkit-scrollbar {
  display: none;
}

.period-tab,
.month-tab {
  height: 32px;
  min-width: 42px;
  padding: 0 13px;
  border: 1px solid rgba(120, 154, 185, 0.12);
  border-radius: 8px;
  background: rgba(8, 26, 43, 0.34);
  color: #aebfd3;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.period-tab::before,
.month-tab::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: translateX(-120%);
  transition: transform 0.36s ease;
}

.period-tab:hover,
.month-tab:hover {
  border-color: rgba(73, 221, 189, 0.34);
  background: rgba(23, 48, 68, 0.82);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(2, 12, 25, 0.18);
}

.period-tab:hover::before,
.month-tab:hover::before {
  transform: translateX(120%);
}

.period-tab.active,
.month-tab.active {
  border-color: rgba(90, 221, 196, 0.62);
  background: linear-gradient(135deg, #36d6b0 0%, #2a9fc3 52%, #5a50d7 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 10px 24px rgba(30, 118, 135, 0.24);
  color: #ffffff;
}

.month-tab {
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  font-size: 10px;
}

.year-tab {
  min-width: 54px;
}

.view-tab {
  min-width: 76px;
}

.period-active-badge {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 26px;
  padding: 0 12px;
  border: 1px solid rgba(126, 123, 255, 0.42);
  border-radius: 999px;
  background: rgba(48, 45, 132, 0.32);
  color: #c7c9ff;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.period-active-badge:empty {
  display: none;
}

.adaptation-panel {
  grid-column: 3;
  grid-row: 2;
  min-height: 34px;
  padding: 0;
  display: grid;
  grid-template-columns: 62px minmax(0, 150px);
  gap: 8px;
  align-items: center;
  align-self: center;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.adaptation-panel[hidden] {
  display: none;
}

.adaptation-score {
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(71, 215, 173, 0.42);
  border-radius: 8px;
  background: rgba(20, 117, 109, 0.38);
}

.adaptation-score span {
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.adaptation-score small {
  color: #7fe9cb;
  font-size: 7px;
  font-weight: 800;
  text-transform: uppercase;
}

.adaptation-copy h3 {
  display: none;
}

.adaptation-copy p {
  margin: 0;
  max-height: 28px;
  overflow: hidden;
  color: #95aac0;
  font-size: 10px;
  line-height: 1.25;
}

.adaptation-facts {
  grid-column: 1 / -1;
  display: none;
}

.kpi-grid {
  grid-column: 2 / -1;
  grid-row: 3;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.kpi-card {
  min-height: 106px;
  padding: 12px;
  overflow: hidden;
  position: relative;
}

.kpi-card[data-accent="success"] {
  border-color: rgba(71, 215, 173, 0.72);
  box-shadow: inset 0 0 0 1px rgba(71, 215, 173, 0.12);
}

.kpi-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.kpi-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(71, 215, 173, 0.2);
}

.kpi-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.kpi-card[data-accent="warn"] .kpi-icon {
  background: rgba(255, 101, 88, 0.24);
  color: #ff7c70;
}

.kpi-label {
  color: #a6b7c9;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;
}

.kpi-value {
  margin-top: 2px;
  color: var(--su-text);
  font-size: clamp(23px, 2vw, 31px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.kpi-sub,
.kpi-change,
.kpi-change-yoy {
  margin-top: 5px;
  color: var(--su-muted);
  font-size: 10px;
  line-height: 1;
}

.kpi-change.up,
.kpi-change-yoy {
  color: var(--su-green);
}

.kpi-change.down {
  color: var(--su-red);
}

.kpi-sparkline {
  width: 100% !important;
  height: 24px !important;
  margin-top: 6px;
}

.executive-panel {
  grid-column: 2 / 6;
  grid-row: 4;
  height: 218px;
  min-height: 218px;
  padding: 12px;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
}

.executive-hero {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}

.executive-score-ring {
  width: 56px;
  height: 56px;
  align-self: center;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle, #0b2237 56%, transparent 57%),
    conic-gradient(var(--su-green) calc(var(--score) * 1%), rgba(255, 255, 255, 0.12) 0);
}

.executive-score-ring span {
  display: block;
  color: #ffffff;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.executive-score-ring small {
  display: block;
  color: #8fa8bf;
  font-size: 8px;
  text-align: center;
  text-transform: uppercase;
}

.executive-kicker {
  color: var(--su-green);
  font-size: 12px;
  font-weight: 900;
}

.executive-copy h2 {
  margin: 6px 0;
  color: #ffffff;
  font-size: 15px;
  line-height: 1.18;
  font-weight: 900;
}

.executive-copy p {
  margin: 0;
  color: #a7bbcc;
  font-size: 11px;
  line-height: 1.4;
}

.executive-tags,
.executive-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.executive-copy {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.executive-copy::-webkit-scrollbar,
.ranking-list::-webkit-scrollbar {
  width: 6px;
}

.executive-copy::-webkit-scrollbar-thumb,
.ranking-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(73, 221, 189, 0.42);
}

.executive-tags span,
.executive-inline-actions span,
.executive-metrics > div {
  border: 1px solid rgba(92, 155, 190, 0.25);
  border-radius: 5px;
  background: rgba(36, 71, 153, 0.24);
  color: #d8e6f2;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 800;
}

.executive-metrics {
  display: none;
}

.executive-actions {
  display: none;
}

.charts-main-grid {
  grid-column: 6 / -1;
  grid-row: 4;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.chart-card {
  min-width: 0;
  height: 232px;
  min-height: 232px;
  padding: 12px 12px 10px;
  overflow: hidden;
}

.charts-main-grid .chart-card:nth-child(4) {
  display: none;
}

.chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.chart-title {
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.chart-subtitle {
  margin-top: 2px;
  color: var(--su-muted);
  font-size: 10px;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 174px;
}

.chart-container.tall,
.chart-container.square {
  height: 174px;
}

.chart-legend-custom {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.chart-legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #b9d0e3;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.chart-legend-pill i {
  width: 8px;
  height: 8px;
  border: 2px solid var(--legend-color);
  border-radius: 999px;
  box-shadow: 0 0 10px color-mix(in srgb, var(--legend-color) 55%, transparent);
}

.table-section {
  grid-column: 2 / 10;
  grid-row: 5;
  height: 214px;
  min-height: 214px;
  padding: 12px;
  overflow: hidden;
}

.ranking-section {
  grid-column: 10 / -1;
  grid-row: 5;
  min-width: 0;
}

.ranking-card {
  height: 214px;
  min-height: 214px;
  padding: 12px;
  overflow: hidden;
}

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

.table-title {
  margin: 0;
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

.table-search-wrapper {
  position: relative;
  width: 180px;
  min-width: 120px;
}

.table-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--su-muted);
  font-size: 0;
}

.table-search-icon::before {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
}

.table-search {
  padding-left: 28px;
}

.data-table-wrapper {
  width: 100%;
  max-height: 142px;
  overflow: auto;
  border-radius: 6px;
  background: rgba(4, 17, 30, 0.55);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: #e8f2fb;
  font-size: 11px;
}

.data-table th,
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(92, 155, 190, 0.15);
  text-align: right;
  white-space: nowrap;
}

.data-table th:first-child,
.data-table td:first-child {
  text-align: left;
  min-width: 190px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #071a2d;
  color: #8fb7d6;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.data-table tbody tr:hover {
  background: rgba(71, 215, 173, 0.06);
}

.data-table td,
.data-table td.num,
.data-table td.num.pos {
  color: #f7fbff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.22);
}

.data-table td:first-child {
  color: #c8d8e8;
}

.data-table td.num.neg {
  color: #ffb5ad;
}

.data-table td.num.zero {
  color: #8fa7bc;
}

.row-section td {
  color: #ffffff !important;
  background: linear-gradient(90deg, rgba(233, 240, 248, 0.96), rgba(222, 231, 240, 0.92)) !important;
  text-shadow: none;
}

.row-section td:first-child {
  color: #092033 !important;
}

.row-subtotal td {
  color: #eaf5ff !important;
  background: rgba(68, 126, 174, 0.18) !important;
  border-top-color: rgba(142, 183, 214, 0.26) !important;
  border-bottom-color: rgba(142, 183, 214, 0.28) !important;
}

.row-subtotal td:first-child {
  color: #ffffff !important;
}

.row-result.positive td {
  color: #7ef0cf !important;
  background: rgba(71, 215, 173, 0.13) !important;
}

.row-result.negative td {
  color: #ffb5ad !important;
  background: rgba(255, 101, 88, 0.13) !important;
}

.ranking-list {
  display: grid;
  gap: 8px;
  max-height: calc(100% - 42px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.ranking-head,
.ranking-row {
  display: grid;
  grid-template-columns: minmax(94px, 1fr) minmax(80px, 1.1fr) 62px 44px;
  gap: 8px;
  align-items: center;
}

.ranking-head {
  color: #86a0b7;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.ranking-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ffffff;
  font-size: 10px;
  white-space: nowrap;
}

.ranking-row i {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(142, 166, 189, 0.2);
}

.ranking-row i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--su-green), #7ee8cb);
}

.ranking-row span,
.ranking-row em {
  color: #dbe9f5;
  font-size: 10px;
  font-style: normal;
  text-align: right;
}

.ranking-link {
  width: fit-content;
  border: 0;
  padding: 0;
  color: #70e2c3;
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.detail-section,
.alerts-panel,
.settings-panel {
  grid-column: 2 / -1;
}

.detail-section {
  border: 1px solid var(--su-line);
  border-radius: var(--su-radius);
  background: linear-gradient(180deg, rgba(12, 45, 71, 0.96), rgba(7, 29, 48, 0.98));
  padding: 12px;
  overflow: hidden;
}

.detail-toggle {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(92, 155, 190, 0.25);
  border-radius: 6px;
  background: rgba(5, 19, 33, 0.62);
  color: var(--su-text);
  padding: 0 12px;
  cursor: pointer;
  text-align: left;
}

.detail-toggle-text,
.detail-toggle-badge {
  font-size: 12px;
  font-weight: 900;
}

.detail-toggle-badge {
  color: var(--su-green);
}

.detail-content {
  display: none;
  padding-top: 10px;
}

.detail-content.open {
  display: block;
}

.detail-view-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

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

.detail-card {
  --detail-accent: #47d7ad;
  --detail-accent-2: #73c7ff;
  --detail-ink: #eef7ff;
  min-height: 126px;
  border: 1px solid rgba(133, 185, 211, 0.22);
  border-radius: 10px;
  background:
    radial-gradient(circle at 14% 0%, color-mix(in srgb, var(--detail-accent) 24%, transparent), transparent 34%),
    linear-gradient(145deg, rgba(16, 45, 66, 0.98), rgba(8, 27, 47, 0.98) 58%, rgba(8, 22, 38, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 14px 30px rgba(1, 10, 22, 0.24);
  color: var(--detail-ink);
  padding: 14px;
  overflow: hidden;
}

.detail-card:nth-child(6n + 1) { --detail-accent: #47d7ad; --detail-accent-2: #93f0d7; }
.detail-card:nth-child(6n + 2) { --detail-accent: #74b9ff; --detail-accent-2: #a8d8ff; }
.detail-card:nth-child(6n + 3) { --detail-accent: #f7c873; --detail-accent-2: #ffe1a6; }
.detail-card:nth-child(6n + 4) { --detail-accent: #a995ff; --detail-accent-2: #d3c6ff; }
.detail-card:nth-child(6n + 5) { --detail-accent: #ff8f8f; --detail-accent-2: #ffc0a1; }
.detail-card:nth-child(6n + 6) { --detail-accent: #62d4ff; --detail-accent-2: #9eeeff; }

.detail-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 44%);
}

.detail-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--detail-accent) 48%, rgba(255, 255, 255, 0.12));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 36px rgba(1, 10, 22, 0.34),
    0 0 0 1px color-mix(in srgb, var(--detail-accent) 18%, transparent);
}

.detail-card-header {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.detail-card-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--detail-accent) 45%, transparent);
  border-radius: 9px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--detail-accent) 30%, rgba(255, 255, 255, 0.1)), rgba(255, 255, 255, 0.05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  font-size: 16px;
}

.detail-card-name {
  min-width: 0;
  overflow: hidden;
  color: #c7d8e8;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-card-value {
  position: relative;
  margin: 0 0 12px;
  color: #f8fcff;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: 0;
}

.detail-card-bar {
  height: 7px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: rgba(226, 239, 247, 0.18);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
}

.detail-bar-fill {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--detail-accent), var(--detail-accent-2));
  box-shadow: 0 0 16px color-mix(in srgb, var(--detail-accent) 38%, transparent);
}

.detail-card-pct {
  color: #9fb6c9;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.25;
}

.detail-card-change {
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.detail-bar-item {
  border-bottom-color: rgba(133, 185, 211, 0.16);
}

.detail-bar-track {
  background: rgba(226, 239, 247, 0.16);
}

.detail-bar-fill-h {
  background: linear-gradient(90deg, #47d7ad, #73c7ff) !important;
  color: #061524;
  font-weight: 900;
}

.dashboard-footer {
  grid-column: 2 / -1;
  color: #7891aa;
  font-size: 10px;
  padding: 4px 2px 12px;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 13, 23, 0.86);
  backdrop-filter: blur(14px);
}

.auth-gate[hidden] {
  display: none;
}

.auth-card {
  width: min(460px, 100%);
  border: 1px solid rgba(71, 215, 173, 0.32);
  border-radius: 10px;
  background: linear-gradient(180deg, #0b2840, #061827);
  box-shadow: var(--su-shadow);
  padding: 22px;
}

.auth-brand {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.auth-brand h1 {
  margin: 0;
  font-size: 20px;
}

.auth-brand p,
.auth-message,
.auth-legal-links a {
  color: var(--su-muted);
  font-size: 12px;
}

.auth-form {
  display: grid;
  gap: 8px;
}

.auth-form label,
.modal-field label,
.settings-label {
  color: #d8e6f2;
  font-size: 11px;
  font-weight: 800;
}

.auth-form input {
  height: 38px;
  border: 1px solid rgba(92, 155, 190, 0.3);
  border-radius: 6px;
  background: rgba(5, 19, 33, 0.82);
  color: var(--su-text);
  padding: 0 10px;
}

.auth-submit {
  height: 38px;
  margin-top: 4px;
}

.auth-legal-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(2, 10, 18, 0.7);
  backdrop-filter: blur(10px);
}

.modal-overlay[aria-hidden="false"] {
  display: grid;
}

.modal-card {
  width: min(620px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid rgba(92, 155, 190, 0.28);
  border-radius: 10px;
  background: #092238;
  padding: 16px;
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-body,
.settings-group {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.modal-title {
  margin: 0;
  font-size: 16px;
}

.modal-subtitle {
  margin: 2px 0 0;
  color: var(--su-muted);
  font-size: 12px;
}

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

.toast-container {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 11000;
  display: grid;
  gap: 8px;
}

.toast {
  max-width: 360px;
  border: 1px solid rgba(92, 155, 190, 0.3);
  border-radius: 8px;
  background: #092238;
  color: #ffffff;
  padding: 10px 12px;
  font-size: 12px;
  box-shadow: var(--su-shadow);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--su-bg);
}

.loading-overlay.hidden {
  display: none;
}

.loading-content {
  width: 260px;
  text-align: center;
}

.loading-logo {
  font-size: 0;
  width: 150px;
  height: 40px;
  margin: 0 auto 18px;
  background: url("assets/suraci-logo.png") center / contain no-repeat;
}

.loading-bar {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(142, 166, 189, 0.22);
}

.loading-bar-fill {
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--su-green), var(--su-cyan));
}

.loading-text {
  color: var(--su-muted);
  font-size: 12px;
}

.totalizator {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  border: 1px solid rgba(71, 215, 173, 0.5);
  border-radius: 8px;
  background: #092238;
  padding: 10px 12px;
  box-shadow: var(--su-shadow);
}

html[data-theme="light"] {
  color-scheme: light;
  --su-bg: #eef5f7;
  --su-bg-2: #f7fbfc;
  --su-surface: #ffffff;
  --su-surface-2: #edf7f8;
  --su-surface-3: #e5f1f4;
  --su-line: rgba(25, 81, 111, 0.16);
  --su-line-strong: rgba(28, 172, 143, 0.42);
  --su-text: #102033;
  --su-muted: #62778a;
  --su-soft: #33475b;
  --su-shadow: 0 18px 44px rgba(19, 61, 84, 0.13);
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 82% 18%, rgba(71, 215, 173, 0.12), transparent 28%),
    linear-gradient(135deg, #edf5f7 0%, #f8fbfc 52%, #e7f2f5 100%);
  color: var(--su-text);
}

html[data-theme="light"] .dashboard-header,
html[data-theme="light"] .period-bar,
html[data-theme="light"] .adaptation-panel,
html[data-theme="light"] .kpi-card,
html[data-theme="light"] .executive-panel,
html[data-theme="light"] .chart-card,
html[data-theme="light"] .table-section,
html[data-theme="light"] .ranking-card,
html[data-theme="light"] .config-panel,
html[data-theme="light"] .connection-card,
html[data-theme="light"] .settings-panel,
html[data-theme="light"] .alerts-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(237, 247, 249, 0.98));
  box-shadow: var(--su-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .suraci-sidebar {
  background: linear-gradient(180deg, rgba(245, 251, 252, 0.98), rgba(230, 241, 245, 0.96));
  border-right-color: rgba(25, 81, 111, 0.12);
}

html[data-theme="light"] .suraci-nav a,
html[data-theme="light"] .suraci-nav button,
html[data-theme="light"] .chart-title,
html[data-theme="light"] .table-title,
html[data-theme="light"] .executive-copy h2,
html[data-theme="light"] .config-header h3,
html[data-theme="light"] .connection-card h3,
html[data-theme="light"] .adaptation-copy h3 {
  color: #102033;
}

html[data-theme="light"] .suraci-nav a.active,
html[data-theme="light"] .suraci-nav a:hover,
html[data-theme="light"] .suraci-nav button:hover {
  color: #102033;
  background: linear-gradient(90deg, rgba(71, 215, 173, 0.22), rgba(73, 148, 214, 0.12));
}

html[data-theme="light"] .btn {
  color: #102033;
  background: rgba(239, 247, 249, 0.92);
}

html[data-theme="light"] .btn-primary,
html[data-theme="light"] .btn-accent,
html[data-theme="light"] .btn-google {
  color: #062018;
  background: linear-gradient(135deg, #5ee5c0, #35cba4);
}

html[data-theme="light"] .data-table-wrapper,
html[data-theme="light"] .config-input-row input,
html[data-theme="light"] .config-input-row select,
html[data-theme="light"] .table-search,
html[data-theme="light"] .modal-field input,
html[data-theme="light"] .modal-field select {
  background: rgba(255, 255, 255, 0.74);
  color: #102033;
}

html[data-theme="light"] .data-table td,
html[data-theme="light"] .data-table td.num,
html[data-theme="light"] .data-table td.num.pos {
  color: #102033;
  text-shadow: none;
}

html[data-theme="light"] .data-table td:first-child {
  color: #33475b;
}

html[data-theme="light"] .data-table thead th {
  background: #e6f1f5;
  color: #356077;
}

html[data-theme="light"] .row-section td {
  background: linear-gradient(90deg, rgba(214, 230, 238, 0.98), rgba(232, 242, 246, 0.96)) !important;
}

html[data-theme="light"] .row-subtotal td {
  color: #18364d !important;
  background: rgba(53, 127, 170, 0.12) !important;
}

.theme-icon .theme-sun {
  display: none;
}

html[data-theme="dark"] .theme-icon .theme-moon {
  display: none;
}

html[data-theme="dark"] .theme-icon .theme-sun {
  display: block;
}

@media (min-width: 861px) {
  .suraci-sidebar,
  .config-panel,
  .connection-card,
  .suraci-sidebar-footer {
    position: fixed;
    left: max(10px, calc((100vw - 1440px) / 2 + 10px));
    width: 184px;
    z-index: 20;
  }

  .suraci-sidebar {
    top: 10px;
    height: 305px;
    overflow: hidden;
  }

  .config-panel {
    top: 325px;
    bottom: 236px;
    height: auto;
    min-height: 130px;
    max-height: 270px;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(71, 215, 173, 0.45) rgba(7, 29, 48, 0.7);
  }

  .config-panel::-webkit-scrollbar {
    width: 5px;
  }

  .config-panel::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(71, 215, 173, 0.45);
  }

  .config-panel .privacy-note,
  .config-panel .connection-example-row,
  .config-panel .config-hint {
    display: none;
  }

  .connection-card {
    top: auto;
    bottom: 88px;
    height: 166px;
    overflow: hidden;
  }

  .connection-card dl {
    gap: 4px 7px;
    margin: 5px 0 7px;
  }

  .connection-card .btn {
    height: 28px;
  }

  .suraci-sidebar-footer {
    top: auto;
    bottom: 10px;
    height: 68px;
    overflow: hidden;
  }
}

@media (min-width: 861px) and (max-height: 760px) {
  .app-container {
    gap: 8px;
    padding: 8px 10px;
  }

  .dashboard-header {
    min-height: 44px;
    padding: 5px 10px;
  }

  .header-title {
    font-size: 18px;
  }

  .period-bar {
    min-height: 66px;
    padding: 8px 12px;
    gap: 8px 14px;
  }

  .period-tab {
    min-height: 28px;
    padding: 0 10px;
  }

  .period-tabs,
  .month-scroller {
    gap: 4px;
  }

  .adaptation-panel {
    min-height: 30px;
  }

  .kpi-grid {
    gap: 8px;
  }

  .kpi-card {
    min-height: 118px;
    padding: 10px 12px;
  }

  .kpi-icon {
    width: 30px;
    height: 30px;
  }

  .kpi-value {
    font-size: clamp(22px, 1.85vw, 28px);
  }

  .kpi-sparkline {
    height: 18px !important;
    margin-top: 4px;
  }

  .executive-panel,
  .chart-card {
    height: 184px;
    min-height: 184px;
    padding: 10px;
  }

  .executive-hero {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
  }

  .executive-score-ring {
    width: 50px;
    height: 50px;
  }

  .executive-copy h2 {
    margin: 4px 0;
    font-size: 14px;
  }

  .executive-copy p {
    font-size: 10px;
    line-height: 1.35;
  }

  .executive-tags,
  .executive-inline-actions {
    margin-top: 6px;
  }

  .chart-header {
    margin-bottom: 5px;
  }

  .chart-container,
  .chart-container.tall,
  .chart-container.square {
    height: 126px;
  }

  .table-section,
  .ranking-card {
    height: 168px;
    min-height: 168px;
    padding: 10px;
  }

  .table-header {
    margin-bottom: 7px;
  }

  .data-table-wrapper {
    max-height: 104px;
  }

  .data-table th,
  .data-table td {
    padding: 6px 9px;
  }

  .ranking-list {
    gap: 6px;
  }

  .ranking-head,
  .ranking-row {
    gap: 6px;
  }
}

@media (min-width: 861px) and (max-height: 700px) {
  .suraci-sidebar-footer {
    display: none;
  }

  .connection-card {
    bottom: 10px;
  }

  .config-panel {
    bottom: 186px;
    max-height: none;
    padding: 8px;
    overflow: hidden;
  }

  .config-panel .connection-copy,
  .config-panel .connection-status,
  .config-panel .google-status {
    display: none;
  }

  .config-panel .config-header {
    margin-bottom: 6px;
  }

  .config-panel .config-header h3 {
    font-size: 11px;
  }

  .config-panel .btn-icon {
    width: 28px;
    height: 28px;
  }

  .config-panel .config-input-row,
  .config-panel .google-connect-row {
    gap: 5px;
  }

  .config-panel .google-connect-row {
    margin-top: 6px;
  }

  .config-panel .config-input-row input,
  .config-panel .config-input-row .btn,
  .config-panel .google-connect-row .btn {
    height: 30px;
  }
}

@media (min-width: 861px) {
  .left-rail {
    position: fixed;
    top: 8px;
    bottom: 8px;
    left: max(10px, calc((100vw - 1440px) / 2 + 10px));
    width: 184px;
    z-index: 20;
    align-content: start;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(71, 215, 173, 0.62) rgba(7, 29, 48, 0.58);
  }

  .left-rail::-webkit-scrollbar {
    width: 6px;
  }

  .left-rail::-webkit-scrollbar-track {
    background: rgba(7, 29, 48, 0.58);
    border-radius: 999px;
  }

  .left-rail::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(71, 215, 173, 0.8), rgba(81, 198, 212, 0.52));
  }

  .left-rail > .suraci-sidebar,
  .left-rail > .config-panel,
  .left-rail > .connection-card,
  .left-rail > .suraci-sidebar-footer {
    position: static;
    inset: auto;
    left: auto;
    top: auto;
    right: auto;
    bottom: auto;
    width: auto;
    height: auto;
    max-height: none;
    z-index: auto;
  }

  .left-rail > .suraci-sidebar {
    overflow: visible;
  }

  .left-rail > .config-panel {
    min-height: 0;
    overflow: visible;
  }

  .left-rail > .connection-card {
    overflow: visible;
  }

  .left-rail > .suraci-sidebar-footer {
    display: block;
    overflow: visible;
    padding-bottom: 8px;
  }
}

/* ===== SURACI 01/07: explicit scroll panels for executive reading and expense ranking ===== */
.executive-panel {
  overflow: hidden !important;
}

.executive-hero {
  height: 100% !important;
  min-height: 0 !important;
  align-items: stretch !important;
}

.executive-copy {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow-y: scroll !important;
  overflow-x: hidden !important;
  padding-right: 10px !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(73, 221, 189, 0.72) rgba(16, 44, 67, 0.7);
}

.ranking-card {
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
}

.ranking-card .chart-header {
  flex: 0 0 auto;
}

.ranking-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none !important;
  overflow-y: scroll !important;
  overflow-x: hidden !important;
  padding: 0 10px 4px 0 !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(73, 221, 189, 0.72) rgba(16, 44, 67, 0.7);
}

.ranking-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 5px;
  background: linear-gradient(180deg, rgba(12, 45, 71, 0.98), rgba(12, 45, 71, 0.88));
}

.ranking-row {
  min-height: 19px;
}

.executive-copy::-webkit-scrollbar,
.ranking-list::-webkit-scrollbar {
  width: 8px;
}

.executive-copy::-webkit-scrollbar-track,
.ranking-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(16, 44, 67, 0.72);
}

.executive-copy::-webkit-scrollbar-thumb,
.ranking-list::-webkit-scrollbar-thumb {
  border: 2px solid rgba(16, 44, 67, 0.72);
  border-radius: 999px;
  background: #49ddb9;
}

.executive-copy:focus-visible,
.ranking-list:focus-visible {
  outline: 1px solid rgba(73, 221, 189, 0.7);
  outline-offset: 2px;
}

html[data-theme="light"] .executive-copy,
html[data-theme="light"] .ranking-list {
  scrollbar-color: rgba(28, 172, 143, 0.8) rgba(214, 229, 236, 0.9);
}

html[data-theme="light"] .ranking-head {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(241,248,250,0.92));
}

html[data-theme="light"] .executive-copy::-webkit-scrollbar-track,
html[data-theme="light"] .ranking-list::-webkit-scrollbar-track {
  background: rgba(214, 229, 236, 0.9);
}

html[data-theme="light"] .executive-copy::-webkit-scrollbar-thumb,
html[data-theme="light"] .ranking-list::-webkit-scrollbar-thumb {
  border-color: rgba(214, 229, 236, 0.9);
  background: #1cae91;
}

/* Executive action list: readable inside the scrollable panel. */
.executive-inline-actions {
  display: grid !important;
  gap: 6px !important;
  margin-top: 10px !important;
  padding-top: 9px;
  border-top: 1px solid rgba(92, 155, 190, 0.22);
}

.executive-actions-title {
  color: #7ee8cb;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.executive-inline-actions p {
  display: grid;
  grid-template-columns: 16px 58px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  margin: 0;
  padding: 6px 7px;
  border: 1px solid rgba(92, 155, 190, 0.18);
  border-radius: 6px;
  background: rgba(7, 25, 43, 0.38);
}

.executive-inline-actions p > span {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(73, 221, 189, 0.42);
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(73, 221, 189, 0.18), rgba(83, 119, 220, 0.12));
}

.executive-inline-actions p > strong {
  color: #9dd8ff;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.executive-inline-actions p > em {
  min-width: 0;
  color: #d8e6f2;
  font-size: 10px;
  font-style: normal;
  line-height: 1.25;
}

.executive-inline-actions p[data-priority*="alta"] {
  border-color: rgba(255, 198, 91, 0.24);
  background: rgba(107, 75, 21, 0.16);
}

.executive-inline-actions p[data-priority*="alta"] > span {
  border-color: rgba(255, 198, 91, 0.52);
  background: linear-gradient(135deg, rgba(255, 198, 91, 0.22), rgba(73, 221, 189, 0.08));
}

html[data-theme="light"] .executive-inline-actions {
  border-top-color: rgba(27, 85, 117, 0.14);
}

html[data-theme="light"] .executive-actions-title {
  color: #0aa083;
}

html[data-theme="light"] .executive-inline-actions p {
  border-color: rgba(27, 85, 117, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .executive-inline-actions p > strong {
  color: #2b6c99;
}

html[data-theme="light"] .executive-inline-actions p > em {
  color: #18324a;
}

@media (max-width: 1180px) {
  .app-container {
    grid-template-columns: 168px repeat(8, minmax(0, 1fr));
  }

  .dashboard-header,
  .kpi-grid,
  .dashboard-footer {
    grid-column: 2 / -1;
  }

  .period-bar {
    grid-column: 2 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    grid-template-rows: auto auto;
  }

  .adaptation-panel {
    grid-column: 1 / -1;
    grid-row: auto;
    justify-self: start;
    max-width: 360px;
  }

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

  .executive-panel {
    grid-column: 2 / 5;
    grid-row: 4;
  }

  .charts-main-grid {
    grid-column: 5 / -1;
    grid-row: 4;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-section {
    grid-column: 2 / 7;
    grid-row: 5;
  }

  .ranking-section {
    grid-column: 7 / -1;
    grid-row: 5;
  }
}

@media (max-width: 860px) {
  .app-container {
    display: block;
    padding: 8px;
  }

  .left-rail {
    max-height: calc(100vh - 16px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(71, 215, 173, 0.62) rgba(7, 29, 48, 0.58);
  }

  .left-rail::-webkit-scrollbar {
    width: 6px;
  }

  .left-rail::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(71, 215, 173, 0.8), rgba(81, 198, 212, 0.52));
  }

  .suraci-sidebar,
  .dashboard-header,
  .period-bar,
  .adaptation-panel,
  .kpi-grid,
  .executive-panel,
  .charts-main-grid,
  .table-section,
  .ranking-section,
  .config-panel,
  .connection-card,
  .suraci-sidebar-footer,
  .dashboard-footer {
    margin-bottom: 8px;
  }

  .suraci-sidebar {
    min-height: 0;
    border-radius: var(--su-radius);
  }

  .suraci-nav {
    grid-template-columns: 1fr;
  }

  .dashboard-header,
  .table-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-right,
  .table-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .period-bar,
  .adaptation-panel,
  .kpi-grid,
  .executive-panel,
  .charts-main-grid,
  .modal-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .period-bar {
    grid-template-rows: auto;
    gap: 10px;
    min-height: 0;
    padding: 12px;
  }

  .period-selector {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    overflow: visible;
  }

  .period-label {
    min-height: 32px;
  }

  .period-tabs,
  .month-scroller {
    overflow-x: auto;
    overflow-y: hidden;
  }

  .period-active-badge {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    max-width: 100%;
  }

  .adaptation-panel {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
    max-width: none;
    grid-template-columns: 62px minmax(0, 1fr);
    margin-bottom: 0;
  }

  .kpi-grid {
    gap: 8px;
  }

  .charts-main-grid .chart-card:nth-child(4) {
    display: block;
  }

  .table-search-wrapper {
    width: min(100%, 240px);
  }

  .data-table-wrapper {
    max-height: 360px;
  }
}

/* ===== SURACI 30/06: sidebar icons, light mode polish and favicon-era brand tuning ===== */
.suraci-nav a,
.suraci-nav button {
  grid-template-columns: 26px minmax(0, 1fr);
  min-height: 36px;
  gap: 9px;
  border-color: rgba(85, 160, 198, 0.08);
}

.suraci-nav .nav-icon {
  width: 20px;
  height: 20px;
  color: #48dfb2;
  background:
    radial-gradient(circle at 35% 25%, rgba(72, 223, 178, 0.28), transparent 54%),
    rgba(72, 223, 178, 0.08);
  border: 1px solid rgba(72, 223, 178, 0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.suraci-nav .nav-icon::before {
  display: none;
}

.suraci-nav .nav-icon svg {
  width: 14px;
  height: 14px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.suraci-nav a.active .nav-icon,
.suraci-nav a:hover .nav-icon,
.suraci-nav button:hover .nav-icon,
.suraci-nav button.active .nav-icon {
  color: #06251d;
  background: linear-gradient(135deg, #6ef0cc, #45d6b0);
  border-color: rgba(110, 240, 204, 0.72);
  box-shadow: 0 0 18px rgba(72, 223, 178, 0.32);
}

.suraci-nav button.active,
.suraci-nav button[aria-pressed="true"] {
  border-color: rgba(73, 221, 189, 0.22);
  background:
    linear-gradient(90deg, rgba(37, 78, 157, 0.48), rgba(13, 52, 74, 0.25)),
    rgba(9, 34, 55, 0.86);
  color: #ffffff;
}

.suraci-nav button.active::after,
.suraci-nav button[aria-pressed="true"]::after {
  background: linear-gradient(180deg, #4de2bd, #74b9ff);
  box-shadow: 0 0 12px rgba(73, 221, 189, 0.54);
}

html[data-theme="light"] {
  --su-bg: #edf6f8;
  --su-bg-2: #f8fcfd;
  --su-surface: #ffffff;
  --su-surface-2: #f1f8fa;
  --su-surface-3: #e7f1f5;
  --su-line: rgba(27, 85, 117, 0.18);
  --su-line-strong: rgba(28, 172, 143, 0.46);
  --su-text: #0f2235;
  --su-muted: #5d7082;
  --su-soft: #293f52;
}

html[data-theme="light"] body {
  background:
    linear-gradient(135deg, rgba(237, 247, 249, 0.98) 0%, rgba(250, 253, 253, 0.98) 48%, rgba(229, 241, 245, 0.98) 100%);
}

html[data-theme="light"] .left-rail {
  scrollbar-color: rgba(42, 181, 151, 0.72) rgba(215, 231, 237, 0.78);
}

html[data-theme="light"] .left-rail::-webkit-scrollbar-track {
  background: rgba(215, 231, 237, 0.78);
}

html[data-theme="light"] .left-rail::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(42, 181, 151, 0.85), rgba(37, 116, 176, 0.5));
}

html[data-theme="light"] .suraci-sidebar,
html[data-theme="light"] .suraci-sidebar-footer {
  background: linear-gradient(180deg, #ffffff, #edf7f9);
  border-color: rgba(27, 85, 117, 0.14);
  box-shadow: 0 14px 30px rgba(31, 74, 98, 0.08);
}

html[data-theme="light"] .suraci-nav a,
html[data-theme="light"] .suraci-nav button {
  color: #31465a;
  background: linear-gradient(90deg, rgba(255,255,255,0.72), rgba(231, 242, 246, 0.46));
  border-color: rgba(27, 85, 117, 0.08);
}

html[data-theme="light"] .suraci-nav .nav-icon {
  color: #1cae91;
  background: linear-gradient(135deg, rgba(65, 218, 183, 0.18), rgba(60, 137, 196, 0.08));
  border-color: rgba(28, 172, 143, 0.22);
}

html[data-theme="light"] .suraci-nav a.active,
html[data-theme="light"] .suraci-nav a:hover,
html[data-theme="light"] .suraci-nav button:hover,
html[data-theme="light"] .suraci-nav button.active,
html[data-theme="light"] .suraci-nav button[aria-pressed="true"] {
  color: #0f2235;
  border-color: rgba(28, 172, 143, 0.38);
  background:
    linear-gradient(90deg, rgba(71, 215, 173, 0.28), rgba(54, 126, 194, 0.13)),
    #ffffff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 8px 20px rgba(41, 96, 123, 0.09);
}

html[data-theme="light"] .suraci-nav a.active .nav-icon,
html[data-theme="light"] .suraci-nav a:hover .nav-icon,
html[data-theme="light"] .suraci-nav button:hover .nav-icon,
html[data-theme="light"] .suraci-nav button.active .nav-icon {
  color: #ffffff;
  background: linear-gradient(135deg, #2cc7a4, #3b82c4);
  border-color: transparent;
}

html[data-theme="light"] .dashboard-header,
html[data-theme="light"] .period-bar,
html[data-theme="light"] .adaptation-panel,
html[data-theme="light"] .kpi-card,
html[data-theme="light"] .executive-panel,
html[data-theme="light"] .chart-card,
html[data-theme="light"] .table-section,
html[data-theme="light"] .ranking-card,
html[data-theme="light"] .config-panel,
html[data-theme="light"] .connection-card,
html[data-theme="light"] .settings-panel,
html[data-theme="light"] .alerts-panel {
  border-color: rgba(27, 85, 117, 0.16);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(241,248,250,0.98));
  box-shadow: 0 16px 36px rgba(31, 74, 98, 0.10), inset 0 1px 0 rgba(255,255,255,0.9);
}

html[data-theme="light"] .header-title,
html[data-theme="light"] .kpi-value,
html[data-theme="light"] .chart-title,
html[data-theme="light"] .table-title,
html[data-theme="light"] .executive-copy h2,
html[data-theme="light"] .settings-panel .config-header h3,
html[data-theme="light"] .settings-label,
html[data-theme="light"] .ranking-label,
html[data-theme="light"] .ranking-amount,
html[data-theme="light"] .connection-card strong {
  color: #0f2235;
}

html[data-theme="light"] .header-subtitle,
html[data-theme="light"] .chart-subtitle,
html[data-theme="light"] .kpi-label,
html[data-theme="light"] .connection-copy,
html[data-theme="light"] .config-hint,
html[data-theme="light"] .privacy-note,
html[data-theme="light"] .google-status,
html[data-theme="light"] .settings-hint,
html[data-theme="light"] .connection-card dt,
html[data-theme="light"] .connection-card dd,
html[data-theme="light"] .adaptation-copy p {
  color: #5d7082;
}

html[data-theme="light"] .settings-group {
  border-color: rgba(27, 85, 117, 0.10);
}

html[data-theme="light"] .settings-label {
  display: inline-flex;
  margin-bottom: 7px;
  font-weight: 850;
  letter-spacing: 0;
}

html[data-theme="light"] .btn {
  color: #173049;
  background: linear-gradient(180deg, #ffffff, #eef6f8);
  border-color: rgba(27, 85, 117, 0.16);
  box-shadow: 0 5px 14px rgba(31, 74, 98, 0.08);
}

html[data-theme="light"] .btn:hover {
  color: #071b2c;
  border-color: rgba(28, 172, 143, 0.38);
  box-shadow: 0 8px 20px rgba(31, 74, 98, 0.12);
}

html[data-theme="light"] .btn-primary,
html[data-theme="light"] .btn-accent,
html[data-theme="light"] .btn-google {
  color: #05231b;
  background: linear-gradient(135deg, #63e6c4, #35cca7);
  border-color: transparent;
}

html[data-theme="light"] .header-status,
html[data-theme="light"] .header-last-update {
  color: #29435a;
  background: linear-gradient(180deg, #ffffff, #edf6f8);
  border-color: rgba(27, 85, 117, 0.18);
}

html[data-theme="light"] .chart-legend-pill,
html[data-theme="light"] .chart-subtitle,
html[data-theme="light"] .executive-copy p {
  color: #597188;
}

html[data-theme="light"] .executive-kicker {
  color: #0aa083;
}

html[data-theme="light"] .executive-tags span,
html[data-theme="light"] .executive-inline-actions span,
html[data-theme="light"] .executive-metrics > div {
  color: #173049;
  background: rgba(57, 112, 185, 0.13);
  border-color: rgba(57, 112, 185, 0.18);
}

html[data-theme="light"] .executive-score-ring {
  background:
    radial-gradient(circle, #ffffff 56%, transparent 57%),
    conic-gradient(var(--su-green) calc(var(--score) * 1%), rgba(27, 85, 117, 0.12) 0);
}

html[data-theme="light"] .executive-score-ring span {
  color: #0f2235;
}

html[data-theme="light"] .executive-score-ring small {
  color: #60768a;
}

html[data-theme="light"] .ranking-head {
  color: #587187;
}

html[data-theme="light"] .ranking-row strong {
  color: #102033;
}

html[data-theme="light"] .ranking-row span,
html[data-theme="light"] .ranking-row em {
  color: #2e465b;
}

html[data-theme="light"] .ranking-row i {
  background: rgba(27, 85, 117, 0.12);
}

html[data-theme="light"] .period-tab,
html[data-theme="light"] .month-tab,
html[data-theme="light"] .period-active-badge {
  color: #173049;
  background: #ffffff;
  border-color: rgba(27, 85, 117, 0.16);
}

html[data-theme="light"] .period-tab.active,
html[data-theme="light"] .month-tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, #2ebfa2, #4b67d8);
  border-color: transparent;
}

html[data-theme="light"] .config-input-row input,
html[data-theme="light"] .config-input-row select,
html[data-theme="light"] .table-search,
html[data-theme="light"] .modal-field input,
html[data-theme="light"] .modal-field select {
  color: #102033;
  background: #ffffff;
  border-color: rgba(27, 85, 117, 0.18);
}

html[data-theme="light"] .config-input-row input::placeholder,
html[data-theme="light"] .table-search::placeholder {
  color: rgba(54, 78, 99, 0.52);
}

html[data-theme="light"] .data-table-wrapper {
  background: #ffffff;
  border-color: rgba(27, 85, 117, 0.14);
}

html[data-theme="light"] .data-table td,
html[data-theme="light"] .data-table td.num,
html[data-theme="light"] .data-table td.num.pos {
  color: #11283d;
}

html[data-theme="light"] .data-table td.num.neg {
  color: #c24132;
}

html[data-theme="light"] .data-table td.num.zero {
  color: #8495a5;
}

html[data-theme="light"] .row-result.positive td {
  color: #08765f !important;
  background: rgba(47, 201, 165, 0.12);
}

html[data-theme="light"] .row-result.negative td {
  color: #bc3b32 !important;
  background: rgba(239, 68, 68, 0.10);
}

/* Keep the left rail as one independent scroll surface; legacy fixed rules must not cover nav clicks. */
@media (min-width: 861px) {
  .left-rail {
    position: sticky;
    top: 0;
    align-self: start;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    z-index: 30;
  }

  .left-rail > .suraci-sidebar,
  .left-rail > .config-panel,
  .left-rail > .connection-card,
  .left-rail > .suraci-sidebar-footer {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    z-index: auto !important;
  }

  .left-rail > .config-panel,
  .left-rail > .connection-card {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .left-rail::-webkit-scrollbar {
    width: 6px;
  }

  .left-rail::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(73, 221, 189, 0.44);
  }
}
