/* Dashboard finish uses the published panel's glass tokens. Native data and
   handlers stay in crizol-system.html; large surfaces avoid live blur. */
@font-face {
  font-family: Geist;
  src: url('/assets/panel-reference/geist.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Crizol Brand';
  src: url('/assets/panel-reference/dm-sans-brand.woff2') format('woff2');
  font-weight: 300;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --dash-glass: linear-gradient(135deg,rgba(114,114,118,.19),rgba(40,40,43,.42) 58%,rgba(84,84,88,.19));
  --dash-edge: rgba(232,234,240,.13);
  --dash-shadow: inset 0 1px 0 #ffffff1c,inset 0 -1px 0 #ffffff06,0 10px 30px #0002;
  --dash-text: #eef0f3;
  --dash-muted: #a6b0bd;
  --dash-blue: #55c5ff;
}
body {
  color: var(--dash-text);
  background-color: #08090b;
  background-image: radial-gradient(ellipse at 92% 0%,#00a8ff24,transparent 56%),
    radial-gradient(ellipse at 9% 90%,#00a8ff16,transparent 57%),
    linear-gradient(140deg,#08090b,#08121c 62%,#08090b);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button,input,select { font-family: inherit; }
button,a,input { -webkit-tap-highlight-color: transparent; }
button:focus-visible,a:focus-visible {
  outline: 2px solid var(--dash-blue);
  outline-offset: 3px;
}

/* Glass surface for the native rail; compact desktop layout follows below. */
.sidebar {
  bottom: 20px;
  border: 1px solid var(--dash-edge);
  border-radius: 26px;
  background: var(--dash-glass);
  box-shadow: var(--dash-shadow);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.sidebar:hover {
  background: linear-gradient(135deg,#26313bef,#111920f5);
  box-shadow: var(--dash-shadow),0 18px 48px #0005;
}
.brand-word {
  font: 300 15px/1.2 'Crizol Brand',Geist,sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.sidebar-nav-item { color: #b4beca; font-weight: 450; }
.sidebar-nav-item.active {
  background: linear-gradient(145deg,#eef0f216,#ffffff07);
  box-shadow: inset 0 1px 0 #ffffff19;
  font-weight: 550;
}
.sidebar-nav-item:hover { background-color: #ffffff08; }
.sidebar-client-avatar { border-color: var(--dash-edge); }

/* A compact rail, centered in the viewport with space between its sections. */
@media (min-width: 769px) {
  .sidebar {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    left: 16px;
    width: 64px;
    height: max-content;
    max-height: calc(100dvh - 40px);
    margin-block: 0;
    padding: 12px 8px;
    border-radius: 24px;
    overflow: visible;
    transition: background .18s ease,box-shadow .18s ease;
  }
  .sidebar:hover { width: 64px; background: var(--dash-glass); box-shadow: var(--dash-shadow); }
  .sidebar-brand-top { height: 44px; padding: 0; margin: 0; justify-content: center; }
  .sidebar-nav { margin: 16px 0; padding: 0; gap: 8px; flex-shrink: 1; min-height: 0; }
  .sidebar .sidebar-nav-item { height: 44px; padding: 0; justify-content: center; overflow: visible; border-radius: 14px; }
  .sidebar .sidebar-nav-item .nav-label {
    position: absolute;
    left: calc(100% + 16px);
    top: 50%;
    transform: translateY(-50%);
    padding: 7px 11px;
    border: 1px solid var(--dash-edge);
    border-radius: 10px;
    background: #20262ff5;
    box-shadow: 0 8px 24px #0004;
    font-size: 11px;
    font-weight: 450;
    opacity: 0;
    pointer-events: none;
  }
  .sidebar:hover .sidebar-nav-item .nav-label { opacity: 0; pointer-events: none; }
  .sidebar .sidebar-nav-item:is(:hover,:focus-visible) .nav-label { opacity: 1; }
  .sidebar-client { padding: 16px 0 8px; justify-content: center; gap: 0; }
  .sidebar .sidebar-client-info,.sidebar .sidebar-client-switch { display: none !important; }
  .dash-switcher { max-height: calc(100dvh - 24px); }
  .dash-switcher-head { flex-shrink: 0; }
  .dash-switcher-list { min-height: 0; }
}
@media (min-width: 769px) and (max-height: 560px) {
  .sidebar { padding-block: 8px; }
  .sidebar-brand-top { height: 36px; }
  .sidebar-nav { margin-block: 10px; gap: 4px; }
  .sidebar .sidebar-nav-item { height: 36px; }
  .sidebar-client { padding: 12px 0 6px; }
}

/* Same controls and hit areas, softer edges and quieter labels. */
.filters-row .filter-card,.filters-top-row .icon-btn {
  border: 1px solid var(--dash-edge);
  border-radius: 16px;
  background: var(--dash-glass);
  box-shadow: var(--dash-shadow);
  transition: border-color .18s ease,background-color .18s ease;
}
.filters-row .filter-card:hover,.filters-top-row .icon-btn:hover {
  border-color: #dbeaff38;
  background-color: #ffffff05;
}
.filters-row .filter-card .filter-label { font-weight: 500; color: #c0c7d0; }
/* Selected names may shrink inside a filter; they never set its minimum width. */
#page-dashboard .filter-date-wrapper,
#page-dashboard .filters-row .filter-card { min-width: 0; }
#page-dashboard .filter-card .card-content { min-width: 0; box-sizing: border-box; }
#page-dashboard .filter-card .filter-label {
  flex: 1 1 0%;
  min-width: 0;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.filter-card svg,.icon-btn svg { color: var(--dash-blue); }
#dashboard-refresh-status { color: #9eb8ca; font-size: 11px; letter-spacing: .01em; }

/* Keep the original two-layer KPI identity: angled SVG tab behind the
   overlapping front card. Only its surface receives the glass finish. */
.metric-card .tag-layer svg {
  /* The lower part was covered by the original opaque front card. Keep it
     covered so its outline does not show through the new glass surface. */
  clip-path: inset(0 0 27px 0);
}
.metric-card .card-body {
  background: var(--dash-glass);
  border: 1px solid var(--dash-edge);
  box-shadow: var(--dash-shadow);
}

/* Retain the main three columns and the heights used by the responsive grid. */
:is(.timeline-card,.funil-card,.video-card,.insight-card,.saldo-card,.saldo-check-card,.ad-card) {
  background: var(--dash-glass);
  border: 1px solid var(--dash-edge);
  border-radius: 22px;
  box-shadow: var(--dash-shadow);
}
:is(.timeline-title,.funil-title,.insight-title,.video-title) {
  color: #e7edf4;
  font-weight: 550;
  letter-spacing: -.025em;
}
.timeline-legend { color: var(--dash-muted); }
:is(.funil-icon-badge,.insight-icon) {
  background: linear-gradient(145deg,#b8dcff19,#00a8ff0c);
  color: var(--dash-blue);
  border: 1px solid #c6e4ff1f;
  border-radius: 9px;
}
:is(.funil-icon-badge,.insight-icon) svg { stroke: currentColor; stroke-width: 1.8; }
.funil-tipo,.video-metric-selector {
  border: 1px solid var(--dash-edge);
  border-radius: 11px;
  background: #d9e8f008;
  position: relative;
  top: auto;
  right: auto;
  height: 30px;
  min-width: 0;
  max-width: 60%;
  flex: 0 1 auto;
  margin-left: auto;
}
.funil-card,.video-card { padding-top: 14px; }
.funil-card { margin-top: 0; }
.funil-header,.video-card .insight-header { min-height: 30px; gap: 8px; margin-bottom: 12px; padding-right: 0; }
.funil-header-left,.video-card .insight-title { min-width: 0; flex: 1 0 auto; }
.video-card .insight-actions { flex: 0 0 auto; margin-left: 0; }
.video-card .video-metric-selector { flex: 0 1 140px; width: 140px; }
.funil-tipo .tipo-content { display: block; overflow: hidden; text-overflow: ellipsis; padding-right: 26px; }
.funil-tipo .tipo-content svg { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); }
/* Fixed header tracks prevent intrinsic event names from moving over the title. */
.funil-header { display: grid; grid-template-columns: minmax(96px,1fr) minmax(0,54%); }
.funil-header-left { overflow: hidden; }
.funil-header .funil-tipo { width: 100%; max-width: 168px; justify-self: end; margin-left: 0; }
.funil-tipo .tipo-content { box-sizing: border-box; min-width: 0; }
.funil-source { color: var(--dash-muted); font-size: 9px; line-height: 1.4; overflow-wrap: anywhere; }
.funil-source[hidden] { display: none; }
.funil-row { grid-template-columns: minmax(0,1fr) minmax(0,108px); min-height: 48px; }
.funil-stage { height: 48px; }
.funil-bar { box-sizing: border-box; min-height: 44px; }
.funil-bar-label {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.funil-bar-value { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funil-metric-text { max-width: 100%; margin-right: 0; padding-right: 2px; box-sizing: border-box; }
.funil-metric-text .fm-label {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.funil-metric-text .fm-value { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.video-metric-selector .vms-content { min-width: 0; }
.video-metric-selector .vms-content>span { overflow: hidden; text-overflow: ellipsis; }
.video-metric-selector .vms-content>svg { flex-shrink: 0; }
.funil-tipo:hover,.funil-tipo:focus-visible,.video-metric-selector:hover {
  background: #d9e8f010;
}
.funil-tipo .tipo-content,.video-metric-selector .vms-content { color: #b7c2ce; font-weight: 450; }
.funil-bar {
  border: 1px solid #b7e9ff30;
  border-radius: 14px;
  background: linear-gradient(135deg,#17b7f4,#008cdb);
  box-shadow: inset 0 1px 0 #ffffff30,0 5px 12px #007fc214;
}
.funil-bar .bar-value,.fm-value { font-variant-numeric: tabular-nums; font-weight: 550; }
.video-ad-row { border-bottom-color: #ffffff0c; }
.video-ad-thumb { border-radius: 15px; }
.video-ad-name { font-weight: 550; color: #e7edf4; }
.video-ad-list { scrollbar-color: #a4b5c12e transparent; }
.video-ad-list::-webkit-scrollbar-thumb { background: #a4b5c12e; }

/* Menus float above the data. Blur is limited to these small, transient layers. */
.crz-popover,.dash-date-popover {
  border-color: var(--dash-edge);
  border-radius: 18px;
  background: linear-gradient(135deg,#29323bf5,#111b25f5);
  box-shadow: inset 0 1px 0 #ffffff1c,0 20px 60px #0006;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.crz-option { border-radius: 10px; }
.crz-option:hover,.crz-option.active { background: #cce8ff0c; }

@media (max-width: 768px) {
  :is(.timeline-card,.funil-card,.video-card,.insight-card,.saldo-card,.ad-card) { border-radius: 20px; }
}
/* At tablet widths, preserve readable cards instead of squeezing the desktop
   minimum grid beyond the viewport. The narrow mobile dock stays native. */
@media (min-width: 769px) and (max-width: 1100px) {
  .dash-scale { width: 100% !important; transform: none !important; margin-bottom: 24px !important; }
  .dashboard-body,.bottom-modules { grid-template-columns: minmax(0,1fr); }
  .bottom-modules>* { grid-column: auto !important; min-width: 0; }
  .metrics-grid { grid-template-columns: repeat(3,minmax(0,1fr)); width: 100%; }
  .metrics-grid .metric-card,.timeline-card,.funil-card { width: 100%; }
  .funil-card { min-height: 320px; }
  .right-col { height: auto !important; }
  .filters-row { flex-direction: column; align-items: stretch; }
  .filters-top-row { display: flex; align-items: center; gap: 10px; }
  .filters-top-row .filter-card { flex: 1; }
  .filters-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .filters-row .filter-card { min-width: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .filters-row .filter-card,.filters-top-row .icon-btn,.sidebar,.sidebar-nav-item { transition: none; }
}
