/* SolarZ Call Monitor — design system v2 (warm + amber brand) */

:root {
  /* === Base — warm dark neutral === */
  --background: 20 14% 4%;
  --foreground: 0 0% 98%;

  --card: 20 6% 10%;
  --card-foreground: 0 0% 98%;

  --popover: 20 6% 10%;
  --popover-foreground: 0 0% 98%;

  /* Primary CTA — branco estilo Linear */
  --primary: 0 0% 98%;
  --primary-foreground: 20 14% 4%;

  --secondary: 20 4% 14%;
  --secondary-foreground: 0 0% 98%;

  --muted: 20 4% 14%;
  --muted-foreground: 0 0% 60%;

  --accent: 20 4% 18%;
  --accent-foreground: 0 0% 98%;

  --destructive: 0 65% 55%;
  --destructive-foreground: 0 0% 98%;

  --border: 20 4% 18%;
  --input: 20 4% 14%;
  --ring: 38 92% 50%;

  --radius: 0.5rem;

  /* Brand — sol/âmbar SolarZ */
  --brand: 38 92% 50%;
  --brand-foreground: 20 14% 4%;
  --brand-2: 20 95% 55%;

  /* Status semânticos — todos dessaturados */
  --success: 142 50% 50%;
  --warning: 38 92% 50%;
  --danger: 0 65% 55%;
  --info: 212 80% 55%;

  /* Score */
  --score-excellent: 38 92% 50%;
  --score-good: 142 50% 50%;
  --score-mid: 38 60% 55%;
  --score-low: 0 65% 55%;

  /* Sidebar width (used for collapse animation) */
  --sidebar-w: 240px;
}

[data-sidebar="collapsed"] { --sidebar-w: 64px; }

* { box-sizing: border-box; }
html, body { background: hsl(var(--background)); color: hsl(var(--foreground)); }
body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-feature-settings: "cv02","cv03","cv04","cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* === Layout Shell === */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  transition: grid-template-columns .2s ease;
}
.sidebar {
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sidebar-brand {
  display: flex; align-items: center; gap: .625rem;
  padding: 1.125rem 1.25rem;
  border-bottom: 1px solid hsl(var(--border));
  position: relative;
  min-height: 60px;
}
.sidebar-brand-logo { width: 28px; height: 28px; flex-shrink: 0; }
.sidebar-brand-text {
  font-weight: 700; font-size: .95rem; color: hsl(var(--foreground));
  white-space: nowrap;
}
.sidebar-brand-sub {
  font-size: .68rem; color: hsl(var(--muted-foreground));
  margin-left: auto;
  background: hsl(var(--secondary));
  padding: 2px .375rem; border-radius: 4px;
  white-space: nowrap;
}
.sidebar-collapse-btn {
  position: absolute; right: -10px; top: 22px;
  width: 20px; height: 20px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: hsl(var(--muted-foreground));
  transition: all .15s; z-index: 10;
}
.sidebar-collapse-btn:hover {
  background: hsl(var(--brand));
  color: hsl(var(--brand-foreground));
  border-color: hsl(var(--brand));
}
.sidebar-collapse-btn svg { width: 12px; height: 12px; transition: transform .2s; }

[data-sidebar="collapsed"] .sidebar-brand-text,
[data-sidebar="collapsed"] .sidebar-brand-sub,
[data-sidebar="collapsed"] .sidebar-section-title,
[data-sidebar="collapsed"] .nav-link span,
[data-sidebar="collapsed"] .sidebar-footer-text { display: none; }
[data-sidebar="collapsed"] .sidebar-brand { justify-content: center; padding: 1.125rem .5rem; }
[data-sidebar="collapsed"] .nav-link { justify-content: center; padding: .625rem; }
[data-sidebar="collapsed"] .sidebar-collapse-btn svg { transform: rotate(180deg); }
[data-sidebar="collapsed"] .sidebar-footer .btn { padding: 0; width: 36px; height: 36px; }
[data-sidebar="collapsed"] .sidebar-footer .btn span { display: none; }
[data-sidebar="collapsed"] .sidebar-section-divider {
  height: 1px; margin: .5rem .75rem; background: hsl(var(--border)); border: 0;
}

.sidebar-nav {
  padding: .75rem; display: flex; flex-direction: column;
  gap: 2px; flex:1; overflow-y:auto;
}
.sidebar-section-title {
  font-size: .65rem; text-transform: uppercase; letter-spacing: .08em;
  color: hsl(var(--muted-foreground)); padding: .75rem .5rem .25rem; font-weight: 600;
}
.nav-link {
  display: flex; align-items: center; gap: .625rem;
  padding: .5rem .75rem; border-radius: var(--radius);
  font-size: .875rem; color: hsl(var(--muted-foreground));
  text-decoration: none; transition: all .15s ease;
  font-weight: 500; position: relative;
}
.nav-link:hover { background: hsl(var(--secondary)); color: hsl(var(--foreground)); }
.nav-link.active {
  background: hsl(var(--brand) / .12); color: hsl(var(--brand));
}
.nav-link.active::before {
  content: ""; position: absolute; left: -0.75rem; top: 25%; bottom: 25%;
  width: 3px; background: hsl(var(--brand)); border-radius: 0 2px 2px 0;
}
[data-sidebar="collapsed"] .nav-link.active::before { left: 0; }
.nav-link svg, .nav-link [data-lucide] {
  width: 1.05rem; height: 1.05rem; flex-shrink:0; opacity:.85; stroke-width: 1.75;
}
.nav-link.active svg, .nav-link.active [data-lucide] { opacity: 1; }

.sidebar-footer {
  padding: .75rem 1rem;
  border-top: 1px solid hsl(var(--border));
  font-size: .7rem; color: hsl(var(--muted-foreground));
}
[data-sidebar="collapsed"] .sidebar-footer { padding: .75rem .5rem; }

.main-content { padding: 1.5rem 2rem 4rem; min-width: 0; }
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; margin-bottom: 1.5rem;
}
.page-title {
  font-size: 1.5rem; font-weight: 700; line-height: 1.2;
  color: hsl(var(--foreground)); margin: 0;
  letter-spacing: -0.015em;
}
.page-subtitle {
  font-size: .875rem; color: hsl(var(--muted-foreground));
  margin-top: .25rem;
}
.breadcrumbs {
  display: flex; align-items: center; gap: .375rem;
  font-size: .75rem; color: hsl(var(--muted-foreground));
  margin-bottom: .375rem;
}
.breadcrumbs a { color: hsl(var(--muted-foreground)); text-decoration: none; }
.breadcrumbs a:hover { color: hsl(var(--foreground)); }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  white-space: nowrap; border-radius: var(--radius); font-weight: 500;
  font-size: .875rem; line-height: 1;
  height: 2.25rem; padding: 0 1rem;
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s, box-shadow .15s;
  user-select: none;
}
.btn:focus-visible {
  outline: 2px solid hsl(var(--brand) / .5);
  outline-offset: 2px;
}
.btn:disabled { opacity: .5; pointer-events: none; }
.btn:active { transform: translateY(1px); }
.btn svg, .btn [data-lucide] { width: 1rem; height: 1rem; flex-shrink:0; stroke-width: 2; }

/* Default = white CTA (Linear style) */
.btn-default {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.btn-default:hover { background: hsl(0 0% 88%); }

/* Brand = amber */
.btn-brand {
  background: hsl(var(--brand)); color: hsl(var(--brand-foreground));
}
.btn-brand:hover { background: hsl(38 92% 45%); }

.btn-secondary {
  background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
  border-color: hsl(var(--border));
}
.btn-secondary:hover { background: hsl(var(--accent)); }
.btn-destructive { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }
.btn-destructive:hover { background: hsl(0 65% 48%); }
.btn-success { background: hsl(var(--success)); color: hsl(20 14% 4%); }
.btn-success:hover { background: hsl(142 50% 45%); }
.btn-outline {
  background: transparent; border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}
.btn-outline:hover { background: hsl(var(--secondary)); border-color: hsl(var(--accent)); }
.btn-ghost { background: transparent; color: hsl(var(--muted-foreground)); }
.btn-ghost:hover { background: hsl(var(--secondary)); color: hsl(var(--foreground)); }
.btn-link {
  background: transparent; color: hsl(var(--brand));
  padding: 0; height: auto;
}
.btn-link:hover { text-decoration: underline; }

.btn-xs { height: 1.5rem; padding: 0 .5rem; font-size: .6875rem; gap: .25rem; }
.btn-xs svg, .btn-xs [data-lucide] { width: .75rem; height: .75rem; }
.btn-sm { height: 2rem; padding: 0 .75rem; font-size: .75rem; }
.btn-sm svg, .btn-sm [data-lucide] { width: .875rem; height: .875rem; }
.btn-lg { height: 2.75rem; padding: 0 2rem; font-size: 1rem; }
.btn-icon { width: 2.25rem; padding: 0; }
.btn-icon-sm { width: 2rem; height: 2rem; padding: 0; }

/* === Card === */
.card {
  background: hsl(var(--card)); color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.card-hover:hover {
  border-color: hsl(var(--accent));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -10px rgba(0,0,0,.4);
}
.card-interactive { cursor: pointer; }
.card-interactive:hover {
  border-color: hsl(var(--brand) / .5);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -10px rgba(0,0,0,.4);
}
.card-header { padding: 1.25rem 1.5rem 1rem; }
.card-title { font-size: 1rem; font-weight: 600; line-height: 1.25; margin: 0; letter-spacing: -.01em; }
.card-description { font-size: .8125rem; color: hsl(var(--muted-foreground)); margin-top: .25rem; }
.card-content { padding: 1.25rem 1.5rem; }
.card-footer { padding: 1rem 1.5rem 1.25rem; display: flex; align-items: center; gap: .5rem; }
.card-content + .card-footer { padding-top: 0; }
.card-header + .card-content { padding-top: 0; }

/* === Input === */
.input, .textarea, .select {
  display: flex; width: 100%; height: 2.25rem;
  padding: 0 .75rem; background: hsl(var(--background));
  border: 1px solid hsl(var(--input)); border-radius: var(--radius);
  font-size: .875rem; color: hsl(var(--foreground));
  font-family: inherit; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: hsl(var(--brand));
  box-shadow: 0 0 0 3px hsl(var(--brand) / .15);
}
.input::placeholder, .textarea::placeholder { color: hsl(var(--muted-foreground) / .6); }
.textarea { padding: .5rem .75rem; height: auto; resize: vertical; line-height: 1.4; }
.select {
  padding-right: 2rem; appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2399999b'><path d='M5.23 7.21a.75.75 0 0 1 1.06.02L10 11.06l3.71-3.83a.75.75 0 1 1 1.08 1.04l-4.25 4.39a.75.75 0 0 1-1.08 0L5.21 8.27a.75.75 0 0 1 .02-1.06z'/></svg>");
  background-repeat: no-repeat; background-position: right .5rem center; background-size: 1.25rem;
}
.label { font-size: .75rem; font-weight: 500; color: hsl(var(--muted-foreground)); margin-bottom: .375rem; display: block; }

/* === Search input variant === */
.search-input {
  position: relative;
}
.search-input .input { padding-left: 2.25rem; height: 2.5rem; font-size: .875rem; }
.search-input [data-lucide], .search-input svg.search-icon {
  position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
  width: 1rem; height: 1rem; color: hsl(var(--muted-foreground));
  pointer-events: none;
}

/* === Badge === */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: 2px .5rem; border-radius: 9999px;
  font-size: .6875rem; font-weight: 600; line-height: 1.25;
  border: 1px solid transparent; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.badge-default { background: hsl(var(--brand) / .14); color: hsl(38 92% 65%); border-color: hsl(var(--brand) / .3); }
.badge-secondary { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); border-color: hsl(var(--border)); }
.badge-destructive { background: hsl(var(--destructive) / .15); color: hsl(0 70% 70%); border-color: hsl(var(--destructive) / .35); }
.badge-success { background: hsl(var(--success) / .14); color: hsl(142 50% 65%); border-color: hsl(var(--success) / .3); }
.badge-warning { background: hsl(var(--warning) / .14); color: hsl(38 92% 65%); border-color: hsl(var(--warning) / .3); }
.badge-info { background: hsl(var(--info) / .14); color: hsl(212 80% 70%); border-color: hsl(var(--info) / .3); }
.badge-outline { background: transparent; color: hsl(var(--foreground)); border-color: hsl(var(--border)); }
.badge-purple { background: hsl(265 50% 30% / .35); color: hsl(265 60% 75%); border-color: hsl(265 50% 50% / .35); }
.badge-removable { padding-right: .25rem; }
.badge-removable button {
  background: transparent; border: 0; color: inherit;
  cursor: pointer; padding: 0 .25rem; font-size: 1rem; line-height: 1;
  border-radius: 9999px; opacity: .65;
}
.badge-removable button:hover { opacity: 1; background: hsl(0 0% 100% / .1); }

/* === Table === */
.table-wrapper { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table thead { background: hsl(var(--card)); }
.table th {
  text-align: left; padding: .625rem 1rem; font-weight: 500;
  color: hsl(var(--muted-foreground)); font-size: .7rem;
  border-bottom: 1px solid hsl(var(--border)); white-space: nowrap;
  text-transform: uppercase; letter-spacing: .04em;
}
.table td {
  padding: .75rem 1rem; border-bottom: 1px solid hsl(var(--border));
  color: hsl(var(--foreground)); vertical-align: middle;
}
.table tbody tr { transition: background .1s ease; }
.table tbody tr:hover { background: hsl(var(--secondary) / .55); }
.table tbody tr.row-clickable { cursor: pointer; }
.table tbody tr:last-child td { border-bottom: 0; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.sortable { cursor: pointer; user-select:none; }
.sortable:hover { color: hsl(var(--foreground)); }
.sort-asc::after { content: " ↑"; color: hsl(var(--brand)); }
.sort-desc::after { content: " ↓"; color: hsl(var(--brand)); }

/* Dense table (40px rows) */
.table-dense td { padding: .5rem 1rem; font-size: .8125rem; }
.table-dense th { padding: .5rem 1rem; }
.table-day-header td {
  background: hsl(var(--secondary) / .5);
  color: hsl(var(--muted-foreground));
  font-size: .7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  padding: .5rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
}
.table-day-header:hover td { background: hsl(var(--secondary) / .5) !important; }

/* === Avatar === */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; border-radius: 9999px;
  background: hsl(20 30% 40%); color: hsl(0 0% 95%);
  font-weight: 600; font-size: .75rem; flex-shrink: 0;
  letter-spacing: -.02em;
}
.avatar-sm { width: 1.75rem; height: 1.75rem; font-size: .625rem; }
.avatar-lg { width: 3rem; height: 3rem; font-size: 1rem; }
.avatar-xs { width: 1.25rem; height: 1.25rem; font-size: .55rem; }

/* === Dialog / Modal === */
.dialog-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 80; opacity: 0; pointer-events: none;
  transition: opacity .15s ease;
}
.dialog-overlay.open { opacity: 1; pointer-events: auto; }
.dialog {
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius); width: 100%; max-width: 32rem;
  margin: 1rem; box-shadow: 0 20px 50px -10px rgba(0,0,0,.7);
  transform: scale(.96); transition: transform .15s ease;
  display: flex; flex-direction: column; max-height: calc(100vh - 2rem);
}
.dialog-overlay.open .dialog { transform: scale(1); }
.dialog-header { padding: 1.25rem 1.5rem 1rem; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.dialog-title { font-size: 1.125rem; font-weight: 600; margin: 0; letter-spacing: -.015em; }
.dialog-description { font-size: .8125rem; color: hsl(var(--muted-foreground)); margin-top: .25rem; }
.dialog-content { padding: 0 1.5rem 1rem; overflow-y: auto; }
.dialog-footer { padding: 1rem 1.5rem 1.25rem; display: flex; justify-content: flex-end; gap: .5rem; border-top: 1px solid hsl(var(--border)); }
.dialog-close {
  background: transparent; border: 0; color: hsl(var(--muted-foreground));
  cursor: pointer; padding: .25rem; border-radius: var(--radius); font-size: 1.25rem;
}
.dialog-close:hover { color: hsl(var(--foreground)); background: hsl(var(--secondary)); }
.dialog-lg { max-width: 48rem; }
.dialog-xl { max-width: 64rem; }

/* === Sheet (drawer) === */
.sheet-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 70; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet-overlay.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; right: 0; top: 0; bottom: 0; width: 28rem; max-width: 100vw;
  background: hsl(var(--card)); border-left: 1px solid hsl(var(--border));
  z-index: 71; transform: translateX(100%); transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.sheet.open { transform: translateX(0); }
.sheet-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid hsl(var(--border)); display: flex; justify-content: space-between; align-items: center; }
.sheet-content { padding: 1.25rem 1.5rem; overflow-y: auto; flex: 1; }
.sheet-footer { padding: 1rem 1.5rem; border-top: 1px solid hsl(var(--border)); display: flex; gap: .5rem; justify-content: flex-end; }

/* === Toast === */
.toast-container { position: fixed; top: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 100; max-width: 22rem; }
.toast {
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius); padding: .75rem 1rem;
  font-size: .8125rem; color: hsl(var(--foreground));
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.6);
  transform: translateX(120%); opacity: 0;
  transition: all .25s ease; display: flex; align-items: flex-start; gap: .625rem;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast-success { border-left: 3px solid hsl(var(--success)); }
.toast-error { border-left: 3px solid hsl(var(--destructive)); }
.toast-info { border-left: 3px solid hsl(var(--brand)); }
.toast-warning { border-left: 3px solid hsl(var(--warning)); }

/* === Tabs === */
.tabs-list {
  display: inline-flex; padding: .25rem; background: hsl(var(--secondary));
  border-radius: var(--radius); gap: 2px;
  border: 1px solid hsl(var(--border));
}
.tab-trigger {
  padding: .375rem .875rem; border-radius: calc(var(--radius) - 2px);
  font-size: .8125rem; font-weight: 500; color: hsl(var(--muted-foreground));
  background: transparent; border: 0; cursor: pointer; transition: all .15s ease;
}
.tab-trigger:hover { color: hsl(var(--foreground)); }
.tab-trigger.active { background: hsl(var(--card)); color: hsl(var(--foreground)); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.tab-content { display: none; padding-top: 1rem; }
.tab-content.active { display: block; }

/* === Skeleton (shimmer) === */
.skeleton {
  background: linear-gradient(90deg, hsl(var(--secondary)) 0%, hsl(var(--accent)) 50%, hsl(var(--secondary)) 100%);
  background-size: 200% 100%;
  border-radius: var(--radius);
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* === Spinner === */
.spinner {
  width: 1rem; height: 1rem; border: 2px solid hsl(var(--border));
  border-top-color: hsl(var(--brand)); border-radius: 50%;
  animation: spin .6s linear infinite; display: inline-block; flex-shrink:0;
}
.spinner-lg { width: 1.5rem; height: 1.5rem; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === Progress === */
.progress { width: 100%; height: .5rem; background: hsl(var(--secondary)); border-radius: 9999px; overflow: hidden; }
.progress-bar { height: 100%; background: hsl(var(--brand)); border-radius: 9999px; transition: width .3s ease; }
.progress-success { background: hsl(var(--success)); }
.progress-warning { background: hsl(var(--warning)); }

/* === Tooltip === */
.tooltip-host { position: relative; display: inline-block; }
.tooltip-host[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: hsl(var(--popover)); border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground)); font-size: .6875rem;
  padding: .25rem .5rem; border-radius: var(--radius); white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 90;
}
.tooltip-host[data-tooltip]:hover::after { opacity: 1; }

/* Tooltip for collapsed sidebar */
[data-sidebar="collapsed"] .nav-link {
  position: relative;
}
[data-sidebar="collapsed"] .nav-link[data-label]:hover::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
  background: hsl(var(--popover)); border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground)); font-size: .75rem;
  padding: .25rem .5rem; border-radius: var(--radius); white-space: nowrap;
  z-index: 100; pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
}

/* === Dropdown menu === */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 4px); min-width: 12rem;
  background: hsl(var(--popover)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius); padding: .25rem;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.6);
  z-index: 50; opacity: 0; pointer-events: none; transform: translateY(-4px);
  transition: opacity .15s, transform .15s;
}
.dropdown.open .dropdown-menu { opacity: 1; pointer-events: auto; transform: translateY(0); }
.dropdown-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .375rem .5rem; border-radius: calc(var(--radius) - 2px);
  font-size: .8125rem; color: hsl(var(--foreground)); cursor: pointer;
  background: transparent; border: 0; width: 100%; text-align: left;
}
.dropdown-item:hover { background: hsl(var(--secondary)); }
.dropdown-item-destructive { color: hsl(0 70% 70%); }
.dropdown-separator { height: 1px; background: hsl(var(--border)); margin: .25rem 0; }
.dropdown-label { padding: .375rem .5rem; font-size: .6875rem; color: hsl(var(--muted-foreground)); text-transform: uppercase; }

/* === Alert === */
.alert {
  border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  padding: .875rem 1rem; display: flex; gap: .75rem;
  background: hsl(var(--card));
}
.alert-icon { flex-shrink: 0; width: 1.125rem; height: 1.125rem; margin-top: 1px; }
.alert-title { font-weight: 600; font-size: .875rem; margin: 0 0 2px; }
.alert-description { font-size: .8125rem; color: hsl(var(--muted-foreground)); margin: 0; }
.alert-destructive { border-color: hsl(var(--destructive) / .4); background: hsl(var(--destructive) / .07); }
.alert-destructive .alert-icon, .alert-destructive .alert-title { color: hsl(0 70% 75%); }
.alert-warning { border-color: hsl(var(--warning) / .4); background: hsl(var(--warning) / .07); }
.alert-warning .alert-icon, .alert-warning .alert-title { color: hsl(38 92% 65%); }
.alert-success { border-color: hsl(var(--success) / .4); background: hsl(var(--success) / .07); }
.alert-success .alert-icon, .alert-success .alert-title { color: hsl(142 50% 65%); }
.alert-info { border-color: hsl(var(--info) / .4); background: hsl(var(--info) / .07); }
.alert-info .alert-icon, .alert-info .alert-title { color: hsl(212 80% 70%); }

/* === Separator === */
.separator { height: 1px; background: hsl(var(--border)); margin: 1rem 0; }
.separator-vertical { width: 1px; height: 1.5rem; background: hsl(var(--border)); display: inline-block; vertical-align: middle; }

/* === Utility === */
.muted { color: hsl(var(--muted-foreground)); }
.text-xs { font-size: .75rem; }
.text-sm { font-size: .875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }
.tabular-nums { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none !important; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.gap-1 { gap: .25rem; } .gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; } .gap-5 { gap: 1.25rem; } .gap-6 { gap: 1.5rem; }
.flex-1 { flex: 1; } .flex-wrap { flex-wrap: wrap; } .flex-shrink-0 { flex-shrink: 0; }
.flex-col { flex-direction: column; }
.w-full { width: 100%; }
.mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; } .mt-3 { margin-top: .75rem; } .mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .25rem; } .mb-2 { margin-bottom: .5rem; } .mb-3 { margin-bottom: .75rem; } .mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; }
.p-2 { padding: .5rem; } .p-3 { padding: .75rem; } .p-4 { padding: 1rem; } .p-5 { padding: 1.25rem; } .p-6 { padding: 1.5rem; }
.px-2 { padding-left:.5rem; padding-right:.5rem; } .px-3 { padding-left:.75rem; padding-right:.75rem; } .px-4 { padding-left:1rem; padding-right:1rem; }
.py-2 { padding-top:.5rem; padding-bottom:.5rem; } .py-4 { padding-top:1rem; padding-bottom:1rem; } .py-8 { padding-top:2rem; padding-bottom:2rem; } .py-12 { padding-top:3rem; padding-bottom:3rem; }
.space-y-2 > * + * { margin-top: .5rem; }
.space-y-3 > * + * { margin-top: .75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; top: 0; z-index: 20; }
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }
.text-foreground { color: hsl(var(--foreground)); }
.text-muted { color: hsl(var(--muted-foreground)); }
.text-success { color: hsl(142 50% 65%); }
.text-destructive { color: hsl(0 70% 75%); }
.text-warning { color: hsl(38 92% 65%); }
.text-brand { color: hsl(var(--brand)); }
.text-info { color: hsl(212 80% 70%); }
.bg-card { background: hsl(var(--card)); }
.border-b { border-bottom: 1px solid hsl(var(--border)); }
.border-t { border-top: 1px solid hsl(var(--border)); }
.rounded { border-radius: var(--radius); }
.rounded-full { border-radius: 9999px; }

/* === Grid utilities === */
.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
.grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 768px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4, .grid-cols-5, .grid-cols-6 { grid-template-columns: 1fr; }
  .md\\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* === Score colors === */
.score-high { color: hsl(var(--score-good)); }
.score-mid { color: hsl(var(--score-mid)); }
.score-low { color: hsl(var(--score-low)); }
.score-excellent { color: hsl(var(--score-excellent)); }

/* === Kanban === */
.kanban-board {
  display: flex; gap: 1rem; overflow-x: auto;
  padding-bottom: 1rem; min-height: 400px;
}
.kanban-column {
  width: 280px; min-width: 280px; max-width: 280px; flex-shrink: 0;
  display: flex; flex-direction: column;
  background: hsl(var(--secondary) / .25);
  border-radius: var(--radius);
  padding: .25rem;
}
.kanban-column-header {
  padding: .625rem .75rem; display: flex; align-items: center; gap: .5rem;
  font-size: .75rem; font-weight: 600;
  color: hsl(var(--foreground));
  border-radius: calc(var(--radius) - 2px);
  margin-bottom: .375rem;
}
.kanban-column-header .col-dot {
  width: 8px; height: 8px; border-radius: 9999px;
}
.kanban-column-header .col-name {
  text-transform: uppercase; letter-spacing: .04em;
}
.kanban-column-header .col-count {
  margin-left: auto;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 9999px;
  padding: 1px .45rem;
  font-size: .65rem;
  font-variant-numeric: tabular-nums;
}
.kanban-cards {
  display: flex; flex-direction: column; gap: .5rem;
  min-height: 200px; flex: 1;
  padding: .25rem;
  border-radius: calc(var(--radius) - 2px);
  transition: background .15s;
}
.kanban-card {
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius); padding: .75rem; cursor: grab;
  transition: border-color .15s, transform .1s, box-shadow .15s;
}
.kanban-card:hover {
  border-color: hsl(var(--brand) / .4);
  box-shadow: 0 4px 12px -4px rgba(0,0,0,.3);
}
.kanban-card.dragging { opacity: .4; cursor: grabbing; }
.kanban-cards.drag-over {
  background: hsl(var(--brand) / .08);
  outline: 2px dashed hsl(var(--brand) / .4);
  outline-offset: -2px;
}

/* Pulse animation for "in_progress" col */
.kanban-column.col-active {
  background: hsl(var(--brand) / .05);
  outline: 1px solid hsl(var(--brand) / .35);
  animation: col-active-pulse 2.4s ease-in-out infinite;
}
@keyframes col-active-pulse {
  0%, 100% { box-shadow: 0 0 0 0 hsl(var(--brand) / .25); }
  50% { box-shadow: 0 0 0 6px hsl(var(--brand) / 0); }
}

/* Empty state in kanban columns */
.kanban-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 2rem 1rem;
  color: hsl(var(--muted-foreground));
}
.kanban-empty [data-lucide], .kanban-empty svg {
  width: 36px; height: 36px;
  opacity: .25; margin-bottom: .5rem;
  stroke-width: 1.5;
}
.kanban-empty .empty-text { font-size: .75rem; }

/* === Audio player === */
.audio-player {
  background: hsl(var(--secondary)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius); padding: .75rem 1rem;
}
.audio-player audio { width: 100%; height: 36px; }

/* === Transcript === */
.transcript-line {
  display: grid; grid-template-columns: 3rem 1fr; gap: .5rem;
  padding: .375rem .25rem; font-size: .8125rem; border-radius: 4px;
  cursor: pointer;
}
.transcript-line:hover { background: hsl(var(--secondary) / .5); }
.transcript-line.active { background: hsl(var(--brand) / .15); border-left: 2px solid hsl(var(--brand)); padding-left: .5rem; }
.transcript-time { color: hsl(var(--muted-foreground)); font-size: .6875rem; text-align: right; padding-top: 2px; font-family: 'JetBrains Mono', monospace; }
.transcript-role-agent { color: hsl(var(--brand)); font-weight: 600; }
.transcript-role-user { color: hsl(var(--info)); font-weight: 600; }
.transcript-text { color: hsl(var(--foreground)); }
mark.search-highlight { background: hsl(var(--warning) / .35); color: hsl(38 92% 75%); padding: 1px 2px; border-radius: 2px; }

/* === Animations === */
.fade-in { animation: fade-in .25s ease both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.live-dot {
  display: inline-block; width: .5rem; height: .5rem; border-radius: 9999px;
  background: hsl(var(--brand)); margin-right: .25rem;
  animation: live-pulse 1.6s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 hsl(var(--brand)/.5); }
  50% { opacity: .7; box-shadow: 0 0 0 6px hsl(var(--brand)/0); }
}
.live-dot-success { background: hsl(var(--success)); animation: live-pulse-success 1.6s ease-in-out infinite; }
@keyframes live-pulse-success {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 hsl(var(--success)/.5); }
  50% { opacity: .7; box-shadow: 0 0 0 6px hsl(var(--success)/0); }
}

/* Live calls badge in page header */
.live-calls-badge {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .25rem .625rem; border-radius: 9999px;
  background: hsl(var(--brand) / .12);
  border: 1px solid hsl(var(--brand) / .35);
  color: hsl(38 92% 65%);
  font-size: .7rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: all .15s;
}
.live-calls-badge:hover { background: hsl(var(--brand) / .2); }

/* === Scrollbar === */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: hsl(var(--accent)); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: hsl(20 4% 25%); }

/* === Stat card === */
.stat-card { padding: 1.25rem 1.5rem; }
.stat-label {
  font-size: .7rem; font-weight: 600; color: hsl(var(--muted-foreground));
  margin: 0 0 .5rem; text-transform: uppercase; letter-spacing: .06em;
}
.stat-value, .metric-value {
  font-size: 1.875rem; font-weight: 600; color: hsl(var(--foreground));
  line-height: 1; margin: 0;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-feature-settings: 'tnum';
  letter-spacing: -.025em;
}
.stat-trend {
  font-size: .75rem; color: hsl(var(--muted-foreground));
  margin-top: .375rem;
  display: inline-flex; align-items: center; gap: .25rem;
}
.stat-trend-up { color: hsl(142 50% 65%); }
.stat-trend-down { color: hsl(0 70% 75%); }
.stat-trend-neutral { color: hsl(var(--muted-foreground)); }
.stat-icon-bg {
  width: 2.25rem; height: 2.25rem; border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center;
  background: hsl(var(--brand) / .12); color: hsl(var(--brand));
  flex-shrink: 0;
}
.stat-icon-bg svg, .stat-icon-bg [data-lucide] { width: 1.125rem; height: 1.125rem; }

/* Sparkline mini */
.sparkline-wrap { margin-top: .5rem; opacity: .8; }

/* === Alert card (full-width destacado dashboard) === */
.alert-card {
  background: hsl(var(--brand) / .06);
  border: 1px solid hsl(var(--brand) / .35);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.alert-card-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: hsl(var(--brand) / .15);
  color: hsl(var(--brand));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.alert-card-icon svg, .alert-card-icon [data-lucide] { width: 22px; height: 22px; }
.alert-card-body { flex: 1; min-width: 0; }
.alert-card-title { font-size: .95rem; font-weight: 600; margin: 0; }
.alert-card-sub {
  font-size: .8125rem; color: hsl(var(--muted-foreground));
  margin-top: .25rem;
}
.alert-card-calm {
  background: hsl(var(--success) / .05);
  border-color: hsl(var(--success) / .3);
}
.alert-card-calm .alert-card-icon {
  background: hsl(var(--success) / .15);
  color: hsl(var(--success));
}

/* === Empty state (general) === */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 3rem 1.5rem;
  color: hsl(var(--muted-foreground));
}
.empty-state .empty-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: hsl(var(--secondary));
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
  color: hsl(var(--muted-foreground));
}
.empty-state .empty-icon svg, .empty-state .empty-icon [data-lucide] {
  width: 32px; height: 32px; stroke-width: 1.5;
}
.empty-state .empty-title {
  font-size: 1rem; font-weight: 600; color: hsl(var(--foreground));
  margin: 0 0 .375rem;
}
.empty-state .empty-sub {
  font-size: .875rem; max-width: 28rem;
  margin: 0 0 1.25rem;
}
.empty-state .empty-actions { display: flex; gap: .5rem; }

/* === Filter chips === */
.filter-chips {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
}

/* Sticky filter bar */
.search-bar {
  position: sticky; top: 0; z-index: 10;
  background: hsl(var(--background) / .95);
  backdrop-filter: blur(8px);
  margin: 0 -2rem 1rem; padding: 1rem 2rem;
  border-bottom: 1px solid hsl(var(--border));
}

/* === Score trend (used in agent/calls) === */
.score-trend {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
}
.score-trend.up { color: hsl(142 50% 65%); }
.score-trend.down { color: hsl(0 70% 75%); }
.score-trend.neutral { color: hsl(var(--muted-foreground)); }

/* === Voice / LLM / config cards (agent detail) === */
.config-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex; flex-direction: column; gap: .875rem;
}
.config-card-header {
  display: flex; align-items: center; gap: .625rem;
}
.config-card-header .icon {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  background: hsl(var(--brand) / .12);
  color: hsl(var(--brand));
  display: flex; align-items: center; justify-content: center;
}
.config-card-header .icon [data-lucide], .config-card-header .icon svg {
  width: 18px; height: 18px;
}
.config-card-title { font-size: .9rem; font-weight: 600; margin: 0; }
.config-card-sub { font-size: .75rem; color: hsl(var(--muted-foreground)); margin: 0; }
.config-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: .375rem 0;
  font-size: .8125rem;
  border-bottom: 1px dashed hsl(var(--border) / .5);
}
.config-row:last-child { border-bottom: 0; }
.config-row .key { color: hsl(var(--muted-foreground)); }
.config-row .val {
  color: hsl(var(--foreground)); font-weight: 500;
  font-family: 'JetBrains Mono', monospace; font-size: .75rem;
  max-width: 60%; text-align: right;
  word-break: break-word;
}
.config-slider {
  display: flex; align-items: center; gap: .625rem;
}
.config-slider .slider-track {
  flex: 1; height: 6px; background: hsl(var(--secondary)); border-radius: 9999px;
  position: relative;
}
.config-slider .slider-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: hsl(var(--brand)); border-radius: 9999px;
}
.config-slider .slider-val {
  font-family: 'JetBrains Mono', monospace; font-size: .75rem;
  font-weight: 600; min-width: 2.5rem; text-align: right;
  font-variant-numeric: tabular-nums;
}
.tag-chips { display: flex; flex-wrap: wrap; gap: .375rem; }
.tag-chips .badge { cursor: pointer; }

/* === Print === */
@media print {
  .sidebar, .toast-container, .btn, .dropdown { display: none !important; }
  .main-content { padding: 0; }
  .card { break-inside: avoid; }
}
