/* GERADO no startup por core/asset_bundler.py — NAO editar a mao.
   Edite os fontes em static/css/ e reinicie a API. Ordem e fallback:
   static/css/main.css. */

/* >>> /static/css/tokens/colors.css */

:root,
[data-theme="padrao"] {
  --color-primary: #1F2937;   
  --color-secondary: #111827; 
  --color-accent: #D1D5DB;    

  --color-bg: #F4F5F7;        
  --color-surface: #FFFFFF;
  --color-text: #1A1D23;
  --color-text-muted: #69707A;
  --color-border: #D9DDE2;

  
  --color-success-bg: #E9F7EF;
  --color-success-text: #1F7A44;
  --color-error-bg: #FDECEC;
  --color-error-text: #9A1F1F;
  --color-warning-bg: #FFF6E8;
  --color-warning-text: #8C4A00;
  
  --color-search-highlight: #F7C948;

  
  --ink-800: var(--color-text);
  --ink-700: var(--color-text);
  --ink-600: var(--color-text-muted);
  --color-muted: var(--color-text-muted);
  --stroke-soft: var(--color-border);
  --brand-700: var(--color-primary);
  --brand-300: var(--color-accent);
  --brand-50: var(--surface-tint);

  
  --color-success-border: #BFE5CD;
  --color-error-border: #F2BBBB;
  --color-warning-border: #F8D3A8;
  --color-info-bg: #EAF2FD;
  --color-info-text: #1E40AF;
  --color-info-border: #BFDBFE;

  
  --gradient-brand: linear-gradient(135deg, #1F2937 0%, #3B4351 100%);
  --gradient-surface: linear-gradient(160deg, #ffffff 0%, #f5f6f8 100%);
  --color-focus-ring: rgba(31, 41, 55, 0.35);
  --motion-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --motion-fast: 140ms;
  --motion-base: 240ms;

  
  --gradient-sidebar: linear-gradient(180deg, #1C1F26 0%, #121419 100%);
  --gradient-nav-active: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.12) 100%);
  --gradient-auth: linear-gradient(135deg, #f4f5f7 0%, #e9ebee 100%);
  --surface-tint: #F1F2F4;        
  --surface-tint-strong: #E7E9EC; 
  --surface-subtle: #FAFAFB;      
  --color-btn-primary-hover: #111827;
  --color-btn-secondary-hover: #3B4351;
  
  --color-btn-primary-text: #FFFFFF;
  
  --sidebar-accent: #FFFFFF;

  
  --sidebar-text: rgba(255, 255, 255, 0.87);
  --sidebar-text-dim: rgba(255, 255, 255, 0.55);   
  --sidebar-subtext: rgba(255, 255, 255, 0.66);    
  --sidebar-icon: rgba(255, 255, 255, 0.62);
  --sidebar-hover-bg: rgba(255, 255, 255, 0.08);
  --sidebar-border: rgba(255, 255, 255, 0.1);
  --sidebar-tooltip-bg: #111827;
  --sidebar-badge-bg: rgba(255, 255, 255, 0.92);
  --sidebar-badge-text: #1A1D23;

  
  --sidebar-section-atendimento: var(--sidebar-text-dim);
  --sidebar-section-envio: var(--sidebar-text-dim);
  --sidebar-section-cadastros: var(--sidebar-text-dim);
  --sidebar-section-configuracoes: var(--sidebar-text-dim);
}

:root {
  --media-stage-bg: #101820;
  --media-stage-bg-deep: #0b1220;
  --media-stage-border: #1f2d45;
  --media-stage-text: #cbd5e1;
}

/* >>> /static/css/tokens/typography.css */
:root {
  
  --font-family-base: -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-md: 16px;
  --font-size-lg: 20px;
  --font-size-xl: 28px;

  --line-height-tight: 1.2;
  --line-height-base: 1.5;
}

/* >>> /static/css/tokens/spacing.css */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
}

/* >>> /static/css/tokens/radius.css */
:root {
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* >>> /static/css/tokens/shadows.css */
:root {
  --shadow-sm: 0 2px 8px rgba(0, 35, 70, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 35, 70, 0.08);
}

/* >>> /static/css/tokens/z-index.css */
:root {
  --z-sidebar: 30;
  --z-topbar: 20;
  --z-dropdown: 40;
  --z-toast: 60;
}

/* >>> /static/css/foundations/reset.css */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

/* >>> /static/css/foundations/base.css */
body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-md);
  line-height: var(--line-height-base);
  background: var(--color-bg);
  color: var(--color-text);
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: var(--line-height-tight);
  color: var(--color-primary);
}

p {
  margin: 0;
}

small,
.text-muted {
  color: var(--color-text-muted);
}

/* >>> /static/css/foundations/utilities.css */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.row {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}

.grid {
  display: grid;
  gap: var(--space-4);
}

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

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

@media (max-width: 900px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* >>> /static/css/components/buttons.css */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-secondary);
  
  color: var(--color-btn-primary-text, var(--color-primary));
}

.btn-primary:hover {
  background: var(--color-btn-primary-hover);
  text-decoration: none;
}

.btn-secondary {
  background: var(--color-primary);
  color: #fff;
}

.btn-secondary:hover {
  background: var(--color-btn-secondary-hover);
  text-decoration: none;
}

.btn-outline {
  background: var(--color-surface);
  color: var(--color-primary);
  border-color: var(--color-accent);
}

.btn-outline:hover {
  background: var(--surface-tint);
  text-decoration: none;
}

.btn-danger {
  background: transparent;
  color: var(--color-error-text);
  border-color: var(--color-error-border);
}

.btn-danger:hover:not(:disabled) {
  background: var(--color-error-text);
  color: #fff;
  border-color: var(--color-error-text);
  text-decoration: none;
}

.btn-full {
  width: 100%;
}

.btn-small {
  padding: 8px 10px;
  font-size: var(--font-size-sm);
}

/* >>> /static/css/components/cards.css */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
}

.card-title {
  font-size: var(--font-size-lg);
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.metric-card {
  background: var(--gradient-surface);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.metric-label {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.metric-value {
  color: var(--color-primary);
  font-size: 34px;
  font-weight: 700;
}

/* >>> /static/css/components/forms.css */
.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  flex: 0 0 auto;
  display: inline-grid;
  place-content: center;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  vertical-align: -3px;
  transition: background var(--motion-fast), border-color var(--motion-fast),
    box-shadow var(--motion-fast);
}
input[type="checkbox"] { border-radius: 5px; }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]::before,
input[type="radio"]::before {
  content: "";
  transform: scale(0);
  transition: transform var(--motion-fast);
  background: var(--color-btn-primary-text, #fff);
}
input[type="checkbox"]::before {
  width: 11px;
  height: 11px;
  clip-path: polygon(14% 44%, 0 60%, 40% 100%, 100% 18%, 86% 4%, 40% 72%);
}
input[type="radio"]::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
}
input[type="checkbox"]:checked::before,
input[type="radio"]:checked::before {
  transform: scale(1);
}
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-secondary) 18%, transparent);
}
input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-primary);
}

.input,
.select,
.textarea {
  width: 100%;
  
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  padding: 10px 12px;
  font: inherit;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--color-secondary);
  
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-secondary) 18%, transparent);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  background: var(--surface-subtle);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.help {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

input[type="file"] {
  font: inherit;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  max-width: 100%;
}
input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
input[type="file"]::file-selector-button:hover {
  background: var(--surface-tint);
}
input[type="file"]:disabled::file-selector-button {
  opacity: 0.6;
  cursor: not-allowed;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* >>> /static/css/components/tables.css */
.table-wrap {
  overflow: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.table th,
.table td {
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  padding: 10px;
  color: var(--color-text);
}

.table th {
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  background: var(--surface-tint);
}

@media (max-width: 768px) {
  .table-cards { min-width: 0; }
  .table-wrap:has(.table-cards) { overflow: visible; }
  .table-cards thead { display: none; }
  .table-cards,
  .table-cards tbody,
  .table-cards tr,
  .table-cards td {
    display: block;
    width: auto;
  }
  .table-cards tr {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-surface);
    padding: 12px 14px;
    margin-bottom: 10px;
  }
  .table-cards td {
    border: 0;
    padding: 5px 0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    text-align: right;
    min-width: 0;
    
    overflow-wrap: anywhere;
  }
  .table-cards td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 auto;
    text-align: left;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
  }
  .table-cards td[data-hide-mobile] { display: none; }
  
  .table-cards td[data-card-title] {
    order: -1;
    display: block;
    text-align: left;
    font-size: 16px;
    font-weight: 650;
    line-height: 1.25;
    padding: 0 0 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
  }
  .table-cards td[data-card-title]::before { display: none; }
  
  .table-cards td[data-block-mobile] {
    display: block;
    text-align: left;
    padding-top: 8px;
  }
  .table-cards td[data-block-mobile]::before {
    display: block;
    margin-bottom: 6px;
  }
}

/* >>> /static/css/components/badges.css */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.badge-active,
.badge-paused,
.badge-completed,
.badge-draft {
  gap: 6px;
  font-weight: 600;
}
.badge-active::before,
.badge-paused::before,
.badge-completed::before,
.badge-draft::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-active {
  color: var(--color-success-text);
  background: color-mix(in srgb, var(--color-success-text) 10%, transparent);
  border-color: color-mix(in srgb, var(--color-success-text) 24%, var(--color-border));
}

.badge-paused {
  color: var(--color-warning-text);
  background: color-mix(in srgb, var(--color-warning-text) 10%, transparent);
  border-color: color-mix(in srgb, var(--color-warning-text) 24%, var(--color-border));
}

.badge-completed {
  color: var(--color-info-text);
  background: color-mix(in srgb, var(--color-info-text) 10%, transparent);
  border-color: color-mix(in srgb, var(--color-info-text) 24%, var(--color-border));
}

.badge-draft {
  color: var(--color-text-muted);
  background: var(--surface-subtle);
  border-color: var(--color-border);
}

.badge-danger {
  color: var(--color-error-text);
  background: var(--color-error-bg);
  border-color: var(--color-error-border);
}

.badge-critical {
  color: #fff;
  background: var(--color-error-text);
  border-color: color-mix(in srgb, var(--color-error-text) 55%, #000);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-error-text) 18%, transparent);
}

.badge-critical::before {
  content: "⚠ ";
  font-weight: 900;
}

.badge-blocked-by-student {
  color: var(--color-error-text);
  background: var(--color-error-bg);
  border-color: var(--color-error-border);
  font-size: 11px;
  margin-left: 6px;
  letter-spacing: 0.2px;
}

/* >>> /static/css/components/alerts.css */
.alert {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  border: 1px solid transparent;
  margin-bottom: var(--space-4);
}

.alert-success {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: var(--color-success-text);
}

.alert-error {
  background: var(--color-error-bg);
  border-color: var(--color-error-border);
  color: var(--color-error-text);
}

.alert-warning {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
  color: var(--color-warning-text);
}

/* >>> /static/css/components/toast.css */

.toast-stack {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(480px, calc(100vw - 24px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px 11px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  font-size: 13px;
  color: var(--color-text);
  animation: toast-in 0.28s ease both;
}

.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast-icon svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.toast-success .toast-icon {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.toast-error .toast-icon {
  background: var(--color-error-bg);
  color: var(--color-error-text);
}

.toast-text {
  flex: 1;
  min-width: 0;
  line-height: 1.45;
  word-break: break-word;
}

.toast-close {
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 5px 6px;
  border-radius: 8px;
  flex-shrink: 0;
}

.toast-close:hover {
  background: var(--surface-tint);
  color: var(--color-text);
}

.toast.is-leaving {
  animation: toast-out 0.22s ease both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast.is-leaving {
    animation: none;
  }
}

/* >>> /static/css/components/sidebar.css */

.sidebar {
  background: var(--gradient-sidebar);
  color: #fff;
  padding: 16px 12px;
  min-height: 100vh;
  max-height: 100vh;
  position: sticky;
  top: 0;
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.brand {
  font-size: 18px;
  font-weight: 700;
  margin: 2px 6px 16px;
  color: #fff;
  letter-spacing: 0.015em;
}

.brand-short {
  display: none;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-section + .nav-section {
  margin-top: 14px;
}

.nav-section-title {
  --section-accent: var(--sidebar-text-dim);
  margin: 0 10px 4px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--sidebar-text-dim);
  border: 0;
  background: transparent;
  line-height: 1.2;
}

.nav-section-title::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--section-accent);
  flex: 0 0 6px;
}

.nav-section-title--atendimento { --section-accent: var(--sidebar-section-atendimento); }
.nav-section-title--envio { --section-accent: var(--sidebar-section-envio); }
.nav-section-title--cadastros { --section-accent: var(--sidebar-section-cadastros); }
.nav-section-title--configuracoes { --section-accent: var(--sidebar-section-configuracoes); }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sidebar-text);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13.5px;
  font-weight: 600;
  border: 0;
  background: transparent;
  position: relative;
  transition:
    background-color var(--motion-fast) var(--motion-ease),
    color var(--motion-fast) var(--motion-ease);
}

.nav-link-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 1;
  color: var(--sidebar-icon);
  background: transparent;
  border: 0;
  flex-shrink: 0;
  transition: color var(--motion-fast) var(--motion-ease);
}

.nav-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.nav-link:hover {
  background: var(--sidebar-hover-bg);
  color: #fff;
  text-decoration: none;
}

.nav-link:hover .nav-icon {
  color: #fff;
}

.nav-link.active {
  background: color-mix(in srgb, var(--sidebar-accent) 18%, transparent);
  color: #fff;
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 999px;
  background: var(--sidebar-accent);
}

.nav-link.active .nav-icon {
  color: var(--sidebar-accent);
}

.nav-submenu {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 1px 0 4px 20px;
  padding-left: 12px;
  border-left: 1px solid var(--sidebar-border);
}

.nav-sublink {
  color: var(--sidebar-subtext);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 600;
  border: 0;
  background: transparent;
  transition:
    background-color var(--motion-fast) var(--motion-ease),
    color var(--motion-fast) var(--motion-ease);
}

.nav-sublink:hover {
  background: var(--sidebar-hover-bg);
  color: #fff;
  text-decoration: none;
}

.nav-sublink.active {
  background: color-mix(in srgb, var(--sidebar-accent) 14%, transparent);
  color: #fff;
}

.nav-link-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.nav-badges {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--sidebar-badge-text);
  background: var(--sidebar-badge-bg);
  border: 0;
  border-radius: 999px;
  padding: 2px 8px;
}

.nav-badge-alerta {
  color: #fff;
  background: var(--color-error-text);
}

.sidebar-footer {
  margin-top: 16px;
  flex-shrink: 0;
}

.sidebar-logout,
.sidebar-logout.btn.btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--sidebar-text) 26%, transparent);
  color: var(--sidebar-text);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 600;
  box-shadow: none;
  transition:
    background-color var(--motion-fast) var(--motion-ease),
    color var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease);
}

.sidebar-logout:hover,
.sidebar-logout.btn.btn-outline:hover {
  background: var(--sidebar-hover-bg);
  border-color: color-mix(in srgb, var(--sidebar-text) 40%, transparent);
  color: #fff;
  transform: none;
  box-shadow: none;
}

.sidebar-logout-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logout-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

@media (min-width: 1025px) {
  body.sidebar-collapsed .sidebar {
    padding: 12px 8px;
    
    overflow: visible;
    max-height: none;
  }

  body.sidebar-collapsed .brand {
    margin: 0 0 14px;
    display: flex;
    justify-content: center;
  }

  body.sidebar-collapsed .brand-full {
    display: none;
  }

  body.sidebar-collapsed .brand-short {
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 14px;
    line-height: 1;
  }

  body.sidebar-collapsed .nav {
    align-items: center;
    gap: 4px;
  }

  body.sidebar-collapsed .nav-section {
    width: 100%;
    align-items: center;
    gap: 4px;
  }

  body.sidebar-collapsed .nav-section + .nav-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  body.sidebar-collapsed .nav-section-title {
    display: none;
  }

  body.sidebar-collapsed .nav-link {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    font-size: 0;
    border-radius: 12px;
  }

  body.sidebar-collapsed .nav-submenu {
    display: none;
  }

  body.sidebar-collapsed .nav-link-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: auto;
  }

  body.sidebar-collapsed .nav-link-label {
    display: none;
  }

  body.sidebar-collapsed .nav-link-between {
    justify-content: center;
    gap: 0;
  }

  body.sidebar-collapsed .nav-badges {
    display: none;
  }

  body.sidebar-collapsed .nav-icon {
    width: 26px;
    height: 26px;
  }

  body.sidebar-collapsed .nav-icon svg {
    width: 17px;
    height: 17px;
  }

  body.sidebar-collapsed .nav-link.active {
    background: color-mix(in srgb, var(--sidebar-accent) 22%, transparent);
  }

  body.sidebar-collapsed .nav-link.active::before {
    top: 8px;
    bottom: 8px;
  }

  
  body.sidebar-collapsed .nav-link:hover::after,
  body.sidebar-collapsed .sidebar-logout:hover::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--sidebar-tooltip-bg);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    z-index: 60;
    pointer-events: none;
  }

  
  body.sidebar-collapsed .nav-link:has(.nav-badge)::after {
    content: "";
    position: absolute;
    top: 7px;
    right: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sidebar-accent);
    
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45);
  }

  body.sidebar-collapsed .nav-link:has(.nav-badge-alerta)::after {
    background: var(--color-error-text);
  }

  
  body.sidebar-collapsed .nav-link:has(.nav-badge):hover::after {
    content: attr(title);
    position: absolute;
    top: 50%;
    right: auto;
    width: auto;
    height: auto;
    border-radius: 8px;
    background: var(--sidebar-tooltip-bg);
    box-shadow: var(--shadow-md);
  }

  body.sidebar-collapsed .sidebar-footer {
    margin-top: 12px;
    display: flex;
    justify-content: center;
  }

  body.sidebar-collapsed .sidebar-footer .sidebar-logout {
    width: 44px;
    height: 44px;
    padding: 0;
    min-width: 44px;
    justify-content: center;
    border-radius: 12px;
    position: relative;
  }

  body.sidebar-collapsed .sidebar-footer .sidebar-logout-label {
    display: none;
  }
}

/* >>> /static/css/components/topbar.css */
.topbar {
  
  background: color-mix(in srgb, var(--color-surface) 86%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
  padding: 0 var(--space-4);
  min-height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.topbar-context {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 5px 3px 11px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--color-secondary) 24%, var(--color-border));
  background: color-mix(in srgb, var(--color-secondary) 8%, var(--color-surface));
  max-width: 340px;
  white-space: nowrap;
}
.topbar-context-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-secondary);
  flex-shrink: 0;
}
.topbar-context-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}
.topbar-context-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}
.topbar-context-exit-form {
  display: inline-flex;
  margin: 0;
}
.topbar-context-exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--motion-fast), color var(--motion-fast);
}
.topbar-context-exit:hover {
  background: color-mix(in srgb, var(--color-secondary) 16%, transparent);
  color: var(--color-secondary);
}
.topbar-context-exit svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

@media (max-width: 640px) {
  .topbar-context-label { display: none; }
  .topbar-context-name { max-width: 120px; }
}

.topbar-actions .badge {
  font-size: 11px;
  line-height: 1.2;
  padding: 3px 9px;
  border-radius: 999px;
}

.topbar-account-link {
  white-space: nowrap;
}

.topbar .topbar-connection-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--color-border);
  transition:
    background var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    color var(--motion-fast) ease;
}

.topbar-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.topbar .topbar-connection-badge.badge-connection-inactive {
  color: var(--color-error-text);
  background: color-mix(in srgb, var(--color-error-text) 10%, transparent);
  border-color: color-mix(in srgb, var(--color-error-text) 24%, var(--color-border));
}

.topbar .topbar-connection-badge.badge-success {
  color: var(--color-success-text);
  background: color-mix(in srgb, var(--color-success-text) 10%, transparent);
  border-color: color-mix(in srgb, var(--color-success-text) 24%, var(--color-border));
}

.topbar .topbar-connection-badge.badge-info {
  color: var(--color-info-text);
  background: color-mix(in srgb, var(--color-info-text) 10%, transparent);
  border-color: color-mix(in srgb, var(--color-info-text) 24%, var(--color-border));
}

.topbar .topbar-connection-badge:hover {
  background: color-mix(in srgb, currentColor 16%, transparent);
  border-color: color-mix(in srgb, currentColor 38%, var(--color-border));
}

.topbar-connection-badge-pulse .topbar-status-dot {
  animation: topbarConnectionPulse 1.6s ease-in-out infinite;
}

@keyframes topbarConnectionPulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent);
  }
  70% {
    box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 0%, transparent);
  }
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 0%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .topbar-connection-badge-pulse .topbar-status-dot {
    animation: none;
  }
}

.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 8px 2px 3px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  transition: background var(--motion-fast) ease;
}

.topbar-user:hover {
  background: var(--surface-tint);
}

.topbar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--color-primary) 84%, #fff) 0%,
    var(--color-primary) 100%
  );
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, #fff 16%, transparent),
    var(--shadow-sm);
}

.topbar-user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.topbar-user-label {
  font-size: 9px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.topbar-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-toggle,
.sidebar-desktop-toggle {
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background var(--motion-fast, 140ms) ease,
    color var(--motion-fast, 140ms) ease;
}

.sidebar-toggle {
  display: none;
}

.sidebar-desktop-toggle {
  display: inline-flex;
}

.sidebar-toggle svg,
.sidebar-desktop-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.sidebar-toggle:hover,
.sidebar-desktop-toggle:hover {
  background: var(--surface-tint);
  color: var(--color-primary);
}

.sidebar-toggle-arrow {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform var(--motion-fast, 140ms) ease;
}

body.sidebar-collapsed .sidebar-toggle-arrow {
  transform: rotate(180deg);
}

@media (max-width: 1024px) {
  .sidebar-toggle {
    display: inline-flex;
    
    width: 40px;
    height: 40px;
  }
  .sidebar-toggle svg {
    width: 22px;
    height: 22px;
  }

  .sidebar-desktop-toggle {
    display: none;
  }

  .topbar {
    padding: 0 var(--space-3);
  }

  .topbar-title {
    font-size: 15px;
  }

  .topbar-user-meta {
    display: none;
  }

  .topbar-account-link {
    display: none;
  }
}

@media (max-width: 640px) {
  .topbar-title {
    font-size: 13px;
    line-height: 1.2;
    letter-spacing: 0;
  }
  .topbar .topbar-conn-prefix {
    display: none;
  }
  .topbar .topbar-connection-badge {
    padding: 3px 8px;
  }
}

/* >>> /static/css/components/tabs.css */

.tabs {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px;
  padding: 4px;
  max-width: 100%;
  background: color-mix(in srgb, var(--color-bg) 75%, var(--color-surface));
  border: 1px solid color-mix(in srgb, var(--color-border) 65%, transparent);
  border-radius: 999px;
  margin-bottom: var(--space-4);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background var(--motion-fast) var(--motion-ease),
    color var(--motion-fast) var(--motion-ease);
}

.tab-link:hover {
  text-decoration: none;
  background: var(--surface-tint);
  color: var(--color-text);
}

.tab-link.active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* >>> /static/css/components/search-select.css */

.search-select-wrap {
  position: relative;
}

.search-select-panel {
  position: absolute;
  left: 0;
  right: 0;
  margin-top: 4px;
  max-height: 256px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 10px);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  z-index: var(--z-dropdown);
}

.search-select-panel--tall {
  max-height: 320px;
}

.search-select-option {
  appearance: none;
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.search-select-option:last-child {
  border-bottom: 0;
}

.search-select-option:hover {
  background: var(--surface-tint);
}

.search-select-option.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.search-select-option.is-disabled:hover {
  background: transparent;
}

.search-select-empty {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.search-select-group-header {
  padding: 8px 12px;
  font-size: 11px;
  color: var(--color-text-muted);
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
}

.chip-remove-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font: inherit;
  line-height: 1;
  padding: 0 2px;
}

.chip-remove-btn:hover {
  color: var(--color-text);
}

/* >>> /static/css/components/disclosure.css */

.disclosure-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background var(--motion-fast, 140ms) ease,
    color var(--motion-fast, 140ms) ease;
}

.disclosure-btn:hover {
  background: var(--surface-tint);
  color: var(--color-text);
}

.disclosure-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: transform var(--motion-fast, 140ms) ease;
}

.disclosure-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* >>> /static/css/components/bulk_accelerate.css */

.bulk-accel-btn {
  background: color-mix(in srgb, var(--color-warning-text) 10%, transparent);
  color: var(--color-warning-text);
  border: 1px solid color-mix(in srgb, var(--color-warning-text) 28%, var(--color-border));
  padding: 7px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color var(--motion-fast), border-color var(--motion-fast);
}
.bulk-accel-btn:hover:not([disabled]) {
  background: color-mix(in srgb, var(--color-warning-text) 18%, transparent);
  border-color: color-mix(in srgb, var(--color-warning-text) 40%, var(--color-border));
}
.bulk-accel-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--color-warning-text) 50%, transparent);
  outline-offset: 2px;
}
.bulk-accel-btn[disabled] {
  background: var(--surface-subtle);
  color: var(--color-text-muted);
  border-color: var(--color-border);
  cursor: not-allowed;
}

.bulk-accel-badge {
  background: color-mix(in srgb, var(--color-warning-text) 12%, transparent);
  color: var(--color-warning-text);
  border: 1px solid color-mix(in srgb, var(--color-warning-text) 24%, var(--color-border));
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bulk-accel-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.bulk-accel-modal {
  background: var(--color-surface);
  border-radius: 14px;
  width: min(540px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
  color: var(--color-text);
}
.bulk-accel-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.bulk-accel-modal-header h3 {
  margin: 0;
  font-size: 19px;
  color: var(--color-warning-text);
}
.bulk-accel-modal-emoji {
  font-size: 28px;
}
.bulk-accel-modal-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}
.bulk-accel-modal-comparison > div {
  padding: 10px 12px;
  border-radius: 8px;
  text-align: center;
}
.bulk-accel-modal-normal {
  background: color-mix(in srgb, var(--color-info-text) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-info-text) 24%, var(--color-border));
}
.bulk-accel-modal-fast {
  background: color-mix(in srgb, var(--color-warning-text) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-warning-text) 24%, var(--color-border));
}
.bulk-accel-modal-comparison-label {
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 4px;
}
.bulk-accel-modal-comparison-value {
  font-size: 16px;
  font-weight: 700;
}
.bulk-accel-modal-risk {
  background: var(--color-error-bg);
  border-left: 3px solid var(--color-error-text);
  padding: 10px 14px;
  border-radius: 6px;
  margin: 12px 0;
  font-size: 13px;
  color: var(--color-error-text);
}
.bulk-accel-modal-risk strong {
  display: block;
  margin-bottom: 6px;
  color: var(--color-error-text);
}
.bulk-accel-modal-risk ul {
  margin: 4px 0 0 0;
  padding-left: 22px;
}
.bulk-accel-modal-risk li {
  margin: 2px 0;
}
.bulk-accel-modal-guide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
  font-size: 12px;
}
.bulk-accel-modal-guide-block {
  padding: 8px 10px;
  border-radius: 6px;
}
.bulk-accel-modal-guide-block.ok {
  background: color-mix(in srgb, var(--color-success-text) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-success-text) 24%, var(--color-border));
  color: var(--color-success-text);
}
.bulk-accel-modal-guide-block.no {
  background: color-mix(in srgb, var(--color-error-text) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-error-text) 24%, var(--color-border));
  color: var(--color-error-text);
}
.bulk-accel-modal-guide-block strong {
  display: block;
  margin-bottom: 4px;
}
.bulk-accel-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.bulk-accel-modal-error {
  display: none;
  color: var(--color-error-text);
  font-size: 13px;
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--color-error-bg);
  border-radius: 6px;
}

/* >>> /static/css/components/bulk_pipeline.css */
.sbp-current {
  background: var(--surface-subtle);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.sbp-current-label {
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 3px;
}
.sbp-current-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 2px;
}
.sbp-current-meta {
  font-size: 12px;
  color: var(--color-text-muted);
}
.sbp-pipeline {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.sbp-pipeline .sbp-current {
  margin-bottom: 0;
}
.sbp-pipeline-side {
  border-left-color: var(--color-border);
}
@media (max-width: 720px) {
  .sbp-pipeline {
    grid-template-columns: 1fr;
  }
}

.sbp-imminent {
  border-color: var(--color-primary);
  border-left-color: var(--color-primary);
  --sbp-glow: rgba(37, 99, 235, 0.45);
  animation: sbp-imminent-pulse 1.6s ease-in-out infinite;
}
@supports (box-shadow: 0 0 0 color-mix(in srgb, red 50%, transparent)) {
  .sbp-imminent {
    --sbp-glow: color-mix(in srgb, var(--color-primary) 45%, transparent);
  }
}
@keyframes sbp-imminent-pulse {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 12px 2px var(--sbp-glow); }
}
@media (prefers-reduced-motion: reduce) {
  .sbp-imminent {
    animation: none;
    box-shadow: 0 0 10px 1px var(--sbp-glow);
  }
}

/* >>> /static/css/components/apple.css */

nav.tabs.ap-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  margin-bottom: 22px;
  background: var(--surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--color-border);
}
nav.tabs.ap-tabs .tab-link {
  border: 0;
  background: transparent;
  margin: 0;
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: background var(--motion-fast), color var(--motion-fast),
    box-shadow var(--motion-fast);
}
nav.tabs.ap-tabs .tab-link:hover { color: var(--color-text); }
nav.tabs.ap-tabs .tab-link.active {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  border: 0;
}

.ap-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.ap-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  overflow: hidden;
}
.ap-stat {
  flex: 1 1 0;
  min-width: 140px;
  padding: 14px 18px;
  border-left: 1px solid var(--color-border);
}
.ap-stat:first-child { border-left: 0; }
.ap-stat-value {
  display: block;
  font-size: 24px;
  font-weight: 680;
  line-height: 1.1;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.ap-stat-value.is-muted { color: var(--color-text-muted); }
.ap-stat-label {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.ap-note {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--surface-subtle);
  overflow: hidden;
}
.ap-note + .ap-note { margin-top: 10px; }
.ap-note > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.ap-note > summary::-webkit-details-marker { display: none; }
.ap-note > summary::after {
  content: "";
  margin-left: auto;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(45deg);
  transition: transform var(--motion-fast);
}
.ap-note[open] > summary::after { transform: rotate(225deg); }
.ap-note-body { padding: 4px 14px 14px; }
.ap-note-count {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--color-secondary);
  color: var(--color-btn-primary-text, #fff);
  font-variant-numeric: tabular-nums;
}

.ap-section {
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--color-border);
}
.ap-section:first-of-type { padding-top: 0; margin-top: 0; border-top: 0; }
.ap-section-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}
.ap-section > .field:last-child { margin-bottom: 0; }

.ap-table thead th {
  background: transparent;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 14px 11px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.ap-table tbody td {
  padding: 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border);
  font-variant-numeric: tabular-nums;
}
.ap-table tbody tr { transition: background var(--motion-fast); }
.ap-table tbody tr:hover { background: var(--surface-subtle); }
.ap-table tbody tr:last-child td { border-bottom: 0; }

.btn.ap-btn-danger {
  background: transparent;
  color: var(--color-error-text);
  border: 1px solid var(--color-error-border);
}
.btn.ap-btn-danger:hover:not(:disabled) {
  background: var(--color-error-text);
  color: #fff;
  border-color: var(--color-error-text);
}
.btn.ap-btn-danger:disabled { opacity: 0.5; }

.card { border-radius: 16px; }

@media (max-width: 720px) {
  
  .ap-stat { flex-basis: 50%; }
  .ap-stat:nth-child(odd) { border-left: 0; }
  .ap-stat:nth-child(even) { border-left: 1px solid var(--color-border); }
  .ap-stat:nth-child(n + 3) { border-top: 1px solid var(--color-border); }
  
  .ap-stat:last-child:nth-child(odd) { flex-basis: 100%; }
}

.imp-result {
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.imp-result-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}
.imp-result-icon {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  font-size: 17px; line-height: 1;
  background: color-mix(in srgb, var(--color-secondary) 10%, transparent);
  color: var(--color-secondary);
}
.imp-result.is-error .imp-result-icon {
  background: color-mix(in srgb, var(--color-error-text, #b91c1c) 14%, transparent);
  color: var(--color-error-text, #b91c1c);
}
.imp-result-title {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  color: var(--ink-800, var(--color-text, #111827));
}
.imp-result-sub {
  margin: 3px 0 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-muted);
}
.imp-groups { margin-top: 2px; }
.imp-group {
  margin-top: 18px;
  padding-top: 13px;
  border-top: 1px solid var(--color-border);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.imp-groups > .imp-group:first-child { margin-top: 12px; padding-top: 0; border-top: 0; }
.imp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  font-size: 14px;
  color: var(--ink-800, var(--color-text, #111827));
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 55%, transparent);
}
.imp-group + .imp-row { border-top: 0; }
.imp-row:last-child { border-bottom: 0; }
.imp-row [data-alert-correct-btn] { margin-left: auto; flex: 0 0 auto; }
.imp-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--color-text-muted);
}
.imp-note::before { content: "ℹ"; opacity: .65; flex: 0 0 auto; }
.imp-result .form-actions-inline { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }

.imp-advice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--color-border);
  border-left: 3px solid color-mix(in srgb, var(--color-secondary) 45%, var(--color-border));
  border-radius: 12px;
  background: var(--surface-subtle);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.imp-advice-icon {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  font-size: 15px; line-height: 1;
  background: color-mix(in srgb, var(--color-secondary) 12%, transparent);
  color: var(--color-secondary);
}
.imp-advice-body { font-size: 13px; line-height: 1.5; color: var(--ink-700, var(--color-text)); }
.imp-advice-body strong { color: var(--ink-800, var(--color-text)); }
.imp-advice-sub { display: block; margin-top: 5px; font-size: 12px; line-height: 1.45; color: var(--color-text-muted); }

.imp-summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 0;
}
.imp-summary-label {
  font-size: 11px; font-weight: 700; letter-spacing: .045em;
  text-transform: uppercase; color: var(--color-text-muted);
  margin-right: 2px;
}
.imp-summary + .imp-summary { padding-top: 0; }

.imp-phone-chip {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px; line-height: 1.5;
  color: var(--color-text-muted);
  background: var(--surface-subtle);
  border: 1px solid var(--color-border);
}

.imp-pill-muted {
  display: inline-flex; align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.6;
  color: var(--color-text-muted);
  background: var(--surface-subtle);
  border: 1px solid var(--color-border);
}

.ap-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0 0 18px 0;
  padding: 0;
}
.ap-stepper .ap-step {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}
.ap-stepper .ap-step-num {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 12.5px;
  background: var(--surface-subtle);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}
.ap-stepper .ap-step.is-current { color: var(--color-text); }
.ap-stepper .ap-step.is-current .ap-step-num {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
  color: var(--color-btn-primary-text, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-secondary) 14%, transparent);
}
.ap-stepper .ap-step.is-done { color: var(--color-text); }
.ap-stepper .ap-step.is-done .ap-step-num {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
  color: var(--color-btn-primary-text, #fff);
}
.ap-stepper .ap-step-sep {
  flex: 1 1 auto;
  height: 1px;
  min-width: 24px;
  margin: 0 12px;
  background: var(--color-border);
}
.ap-stepper .ap-step.is-done + .ap-step-sep { background: color-mix(in srgb, var(--color-secondary) 45%, var(--color-border)); }
@media (max-width: 640px) {
  .ap-stepper .ap-step-label { display: none; }
  .ap-stepper .ap-step-sep { margin: 0 6px; }
  
  nav.tabs.ap-tabs {
    display: flex;
    width: 100%;
  }
  nav.tabs.ap-tabs .tab-link {
    flex: 1 1 auto;
    text-align: center;
    padding: 8px 10px;
  }
}

.imp-review-filter { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-subtle); border: 1px solid var(--color-border); border-radius: 11px; }
.imp-review-filter button {
  border: 0; background: transparent; cursor: pointer;
  padding: 6px 13px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--color-text-muted);
}
.imp-review-filter button.is-active { background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-sm); }

.imp-ready-line {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; margin: 12px 0;
  border: 1px solid var(--color-border); border-radius: 12px;
  background: var(--surface-subtle);
  font-size: 13.5px; color: var(--color-text);
}
.imp-ready-line .imp-ready-check {
  flex: 0 0 auto; width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 50%; font-size: 13px;
  background: color-mix(in srgb, var(--color-success-text, #15803d) 14%, transparent);
  color: var(--color-success-text, #15803d);
}
.imp-ready-line .btn { margin-left: auto; }

.imp-actionbar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 16px -18px -18px -18px;
  padding: 14px 18px;
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-top: 1px solid var(--color-border);
  border-radius: 0 0 16px 16px;
}
.imp-actionbar .imp-actionbar-spacer { flex: 1 1 auto; }
.imp-actionbar .help { margin: 0; }

.imp-bullet-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.imp-row-ico {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 6px;
  font-size: 12px; font-weight: 700; line-height: 1;
  background: var(--surface-subtle);
  color: var(--color-text-muted);
}
.imp-row-text { flex: 1 1 auto; min-width: 0; }

.imp-sev-phone .imp-row-ico,
.imp-sev-invalid .imp-row-ico {
  background: color-mix(in srgb, var(--color-warning-text, #b45309) 13%, transparent);
  color: var(--color-warning-text, #b45309);
}

.imp-sev-skip .imp-row-ico { background: var(--surface-subtle); color: var(--color-text-muted); }

/* >>> /static/css/components/flatpickr.css */

.flatpickr-calendar {
  border-radius: 14px !important;
  border: 1px solid var(--color-border) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14) !important;
  background: var(--color-surface) !important;
  font-family: inherit !important;
}
.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after { border-bottom-color: var(--color-border) !important; }
.flatpickr-calendar.arrowBottom::before,
.flatpickr-calendar.arrowBottom::after { border-top-color: var(--color-border) !important; }
.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year { color: var(--color-text) !important; font-weight: 650 !important; }
.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg { fill: var(--color-text-muted) !important; }
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg { fill: var(--color-text) !important; }
span.flatpickr-weekday {
  color: var(--color-text-muted) !important;
  font-weight: 600 !important;
  font-size: 11px !important;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.flatpickr-day {
  border-radius: 9px !important;
  color: var(--color-text);
}
.flatpickr-day:hover,
.flatpickr-day:focus { background: var(--surface-subtle) !important; border-color: transparent !important; }
.flatpickr-day.today { border-color: var(--color-border) !important; }
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus {
  background: var(--color-secondary) !important;
  border-color: var(--color-secondary) !important;
  color: var(--color-btn-primary-text, #fff) !important;
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay { color: var(--color-text-muted) !important; opacity: 0.55; }
.flatpickr-time input { color: var(--color-text) !important; }
.flatpickr-time input:hover,
.flatpickr-time input:focus { background: var(--surface-subtle) !important; }
.flatpickr-time .flatpickr-am-pm:hover { background: var(--surface-subtle) !important; }
.flatpickr-monthDropdown-months,
.numInputWrapper:hover { background: transparent !important; }

/* >>> /static/css/components/select.css */

.app-select {
  position: relative;
  display: block;
  width: 100%;
}

.app-select > select.app-select__native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.app-select__btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  padding: 10px 12px;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast);
}
.app-select__btn:focus-visible,
.app-select.is-open > .app-select__btn {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-secondary) 18%, transparent);
}
.app-select.is-disabled > .app-select__btn {
  background: var(--surface-subtle);
  color: var(--color-text-muted);
  cursor: not-allowed;
}
.app-select__label {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-select__label.is-placeholder { color: var(--color-text-muted); }
.app-select__chev {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-left: 4px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform var(--motion-fast);
}
.app-select.is-open > .app-select__btn .app-select__chev {
  transform: translateY(2px) rotate(-135deg);
}

.app-select__panel {
  position: absolute;
  z-index: 60;
  left: 0;
  top: calc(100% + 6px);
  min-width: 100%;
  max-width: min(420px, 92vw);
  max-height: 280px;
  overflow-y: auto;
  padding: 5px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}
.app-select__panel.is-above {
  top: auto;
  bottom: calc(100% + 6px);
}

.app-select__opt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.3;
  color: var(--color-text);
  cursor: pointer;
  
  white-space: normal;
  overflow-wrap: anywhere;
}
.app-select__opt-check {
  flex: 0 0 auto;
  width: 14px;
  text-align: center;
  opacity: 0;
  font-weight: 700;
}
.app-select__opt[aria-selected="true"] { font-weight: 600; }
.app-select__opt[aria-selected="true"] .app-select__opt-check { opacity: 1; }

.app-select__opt.is-active {
  background: var(--color-secondary);
  color: var(--color-btn-primary-text, #fff);
}
.app-select__opt[aria-disabled="true"] {
  color: var(--color-text-muted);
  cursor: not-allowed;
}
.app-select__opt[aria-disabled="true"].is-active { background: var(--surface-subtle); }

.app-select__group {
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

/* >>> /static/css/components/emoji-picker.css */

.emoji-pop {
  position: fixed;
  z-index: 1200;
  width: 320px;
  max-width: calc(100vw - 16px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: var(--shadow-md, 0 12px 32px rgba(0, 0, 0, .16));
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.emoji-pop-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--color-border);
}
.emoji-pop-tab {
  flex: none;
  width: 32px;
  height: 30px;
  font-size: 17px;
  line-height: 1;
  border: 0;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  opacity: .65;
}
.emoji-pop-tab:hover { background: var(--surface-subtle); opacity: 1; }
.emoji-pop-tab.is-active {
  background: var(--surface-subtle);
  opacity: 1;
  box-shadow: inset 0 -2px 0 var(--color-secondary);
}
.emoji-pop-search-input { width: 100%; height: 34px; font-size: 13px; }
.emoji-pop-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  max-height: 230px;
  overflow-y: auto;
  padding-right: 2px;
}
.emoji-pop-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  font-size: 21px;
  line-height: 1;
  aspect-ratio: 1 / 1;
  padding: 0;
}
.emoji-pop-btn:hover { background: var(--surface-subtle); transform: scale(1.12); }
.emoji-pop-cat-label {
  grid-column: 1 / -1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 6px 2px 2px;
}
.emoji-pop-empty {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--color-text-muted);
  padding: 14px 6px;
  text-align: center;
}

/* >>> /static/css/components/copy-chip.css */

.copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--surface-subtle);
  color: var(--color-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.4;
  padding: 1px 7px;
  cursor: pointer;
  white-space: nowrap;
  vertical-align: middle;
  transition:
    border-color var(--motion-fast, 0.15s) ease,
    background var(--motion-fast, 0.15s) ease,
    color var(--motion-fast, 0.15s) ease;
}
.copy-chip:hover {
  border-color: color-mix(in srgb, var(--color-secondary) 40%, var(--color-border));
  background: var(--surface-tint);
}
.copy-chip:focus-visible {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-secondary) 18%, transparent);
}
.copy-chip:active {
  transform: translateY(0.5px);
}

.copy-chip::before {
  content: "⧉";
  font-size: 11px;
  color: var(--color-text-muted);
  opacity: 0.55;
}
.copy-chip:hover::before,
.copy-chip:focus-visible::before {
  opacity: 1;
}

.copy-chip.is-copied {
  border-color: color-mix(in srgb, var(--color-success-text) 45%, var(--color-border));
  background: color-mix(in srgb, var(--color-success-text) 10%, transparent);
  color: var(--color-success-text);
}
.copy-chip.is-copied::before {
  content: "✓";
  color: var(--color-success-text);
  opacity: 1;
}
.copy-chip.is-copied::after {
  content: "Copiado!";
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--color-secondary);
  color: var(--color-btn-primary-text, #fff);
  font-family: var(--font-family, system-ui);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  z-index: 5;
}

/* >>> /static/css/components/password-strength.css */

.pw-strength {
  display: flex;
  gap: 5px;
  margin: 10px 0 4px;
}
.pw-strength span {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: var(--color-border);
  transition: background var(--motion-fast);
}
.pw-strength[data-score="1"] span:nth-child(-n + 1) { background: var(--color-error-text); }
.pw-strength[data-score="2"] span:nth-child(-n + 2) { background: var(--color-warning-text); }
.pw-strength[data-score="3"] span:nth-child(-n + 3),
.pw-strength[data-score="4"] span:nth-child(-n + 4) { background: var(--color-success-text); }

.pw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.pw-actions .pw-show {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  cursor: pointer;
}

.pw-cell-compact .pw-strength { margin: 8px 0 4px; }
.pw-cell-compact .pw-strength[data-score="0"] { display: none; }

/* >>> /static/css/layouts/app-shell.css */
.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

@media (min-width: 1025px) {
  body.sidebar-collapsed .app-shell {
    grid-template-columns: 88px 1fr;
  }
}

.app-content {
  min-width: 0;
}

.page-content {
  padding: var(--space-4) var(--space-6) var(--space-6);
}

.page-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@supports selector(.app-content:has(a)) {
  .app-content:has(> .page-content--fullbleed) {
    display: flex;
    flex-direction: column;
    height: 100vh;
    
    height: 100dvh;
  }

  .page-content--fullbleed {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
  }

  
  .page-content--fullbleed .page-stack {
    flex: 1 1 auto;
    min-height: 0;
    gap: 0;
  }
}

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -320px;
    width: min(300px, 85vw);
    min-height: 0;
    max-height: none;
    transition: left 0.2s ease;
    z-index: var(--z-sidebar);
  }

  body.sidebar-open .sidebar {
    left: 0;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
  }

  
  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(10, 13, 18, 0.45);
    z-index: calc(var(--z-sidebar) - 1);
  }
}

@media (max-width: 640px) {
  .page-content {
    padding: var(--space-3) var(--space-3) var(--space-5);
  }
}

/* >>> /static/css/layouts/dashboard.css */
.dashboard-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.dashboard-tab {
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-surface);
}

.dashboard-tab:hover {
  text-decoration: none;
  background: var(--surface-tint);
}

.dashboard-tab.active {
  border-color: var(--color-secondary);
  background: var(--surface-tint-strong);
}

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

.card-collapsible-header .card-title {
  margin-bottom: 0;
}

.card-collapsed-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface-subtle);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.severity-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  align-items: end;
}

.field-actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
}

.severity-card {
  display: block;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: var(--space-4);
  background: var(--color-surface);
  color: var(--color-primary);
}

.severity-card:hover {
  text-decoration: none;
  background: var(--surface-tint);
}

.severity-card-disabled {
  opacity: 0.7;
  cursor: default;
  pointer-events: none;
}

.severity-label {
  font-size: var(--font-size-sm);
  font-weight: 700;
}

.severity-value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
}

.severity-critical {
  border-color: color-mix(in srgb, var(--color-error-text) 24%, var(--color-border));
}

.severity-high {
  border-color: color-mix(in srgb, var(--color-warning-text) 24%, var(--color-border));
}

.severity-medium {
  border-color: color-mix(in srgb, var(--color-warning-text) 18%, var(--color-border));
}

.severity-tech {
  border-color: color-mix(in srgb, var(--color-info-text) 24%, var(--color-border));
}

.severity-action {
  margin-top: 8px;
  margin-bottom: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
}

.severity-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.severity-preview-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--color-surface);
}

.severity-preview-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.severity-preview-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.severity-preview-list li {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--surface-subtle);
}

.severity-preview-list a {
  display: inline-block;
  color: var(--color-primary);
  font-weight: 700;
  line-height: 1.2;
}

.severity-preview-list small {
  display: block;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.severity-preview-footer {
  display: inline-flex;
  margin-top: 10px;
  font-weight: 700;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.content-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--space-4);
}

.content-grid-two {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
}

.backlog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.backlog-card {
  border-color: var(--color-accent);
  background: var(--gradient-surface);
}

.backlog-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.backlog-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-primary);
}

.backlog-value-critical {
  color: var(--color-error-text);
}

.queue-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge-alerta {
  color: #fff;
  background: var(--color-error-text);
  border-color: color-mix(in srgb, var(--color-error-text) 55%, #000);
}

.alert-action-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.alert-action-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--color-surface);
  color: var(--color-primary);
  font-weight: 600;
}

.alert-action-item:hover {
  text-decoration: none;
  background: var(--surface-tint);
}

.alert-level-critico {
  border-color: color-mix(in srgb, var(--color-error-text) 24%, var(--color-border));
}

.alert-level-alto {
  border-color: color-mix(in srgb, var(--color-warning-text) 24%, var(--color-border));
}

.alert-level-medio {
  border-color: color-mix(in srgb, var(--color-warning-text) 18%, var(--color-border));
}

.alert-level-tecnico {
  border-color: color-mix(in srgb, var(--color-info-text) 24%, var(--color-border));
}

@media (max-width: 1024px) {
  .severity-grid,
  .severity-preview-grid,
  .chart-grid,
  .metric-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .field-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .backlog-kpis {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .alert-action-list {
    grid-template-columns: 1fr;
  }

  .dashboard-tabs {
    gap: 6px;
  }

  .card-collapsed-summary {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* >>> /static/css/layouts/auth.css */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--gradient-auth);
  padding: var(--space-6);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
}

/* >>> /static/css/pages/students.css */
.students-filter-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-4);
}

.form-actions-inline {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.section-toolbar .card-title {
  margin: 0;
}

.students-toolbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.students-toolbar-actions .text-muted {
  margin: 0;
}

.students-export-actions {
  display: inline-flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.students-pagination-row {
  margin-top: var(--space-3);
}

.students-pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.students-page-size-form {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.students-page-size-label {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.students-page-size-input {
  width: 90px;
  min-width: 90px;
}

.student-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.search-box {
  position: relative;
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: var(--z-dropdown);
}

.search-option {
  display: block;
  width: 100%;
  border: 0;
  background: var(--color-surface);
  text-align: left;
  padding: 10px 12px;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
}

.search-option:last-child {
  border-bottom: 0;
}

.search-option:hover {
  background: var(--surface-tint);
}

.search-empty {
  padding: 10px 12px;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.selected-chips {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

.selected-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface-tint-strong);
  color: var(--color-primary);
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: var(--font-size-sm);
}

.selected-chip-remove {
  border: 0;
  background: transparent;
  color: var(--color-primary);
  cursor: pointer;
  font-weight: 700;
}

.extra-phone-adder-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2);
  align-items: center;
}

.extra-phone-list {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.extra-phone-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  padding: 8px 10px;
}

.extra-phone-item-main {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.field-note-warning {
  margin: 0;
  font-size: var(--font-size-xs);
  color: var(--color-warning-text);
}

.edit-panel {
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-accent);
  background: var(--surface-tint);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.edit-panel-class {
  background: var(--surface-subtle);
  border-color: var(--color-border);
}

.edit-panel-student {
  background: var(--surface-tint);
  border-color: var(--color-accent);
}

.edit-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.edit-panel-title {
  margin: 0;
  font-size: 18px;
  color: var(--color-primary);
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text);
  font-size: var(--font-size-sm);
}

@media (max-width: 900px) {
  
  .students-filter-grid,
  .student-edit-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .extra-phone-adder-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .extra-phone-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .students-toolbar-actions {
    justify-content: flex-start;
  }

  .students-pagination-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .students-pagination-controls {
    justify-content: flex-start;
  }

  .edit-panel-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

.students-filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}
.stu-filter-card .form-actions-inline { margin-top: 4px; }

.section-toolbar { margin-bottom: var(--space-3); }
.students-toolbar-actions { gap: var(--space-2); }

.stu-export { position: relative; }
.stu-export > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  user-select: none;
  transition: border-color var(--motion-fast), background var(--motion-fast);
}
.stu-export > summary:hover { border-color: var(--color-text-muted); }
.stu-export > summary::-webkit-details-marker { display: none; }
.stu-export > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(45deg);
  transition: transform var(--motion-fast);
}
.stu-export[open] > summary::after { transform: rotate(225deg); }
.stu-export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: var(--z-dropdown);
  display: grid;
  gap: 2px;
  min-width: 190px;
  padding: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}
.stu-export-menu .inline-form { display: block; }
.stu-export-menu .btn {
  width: 100%;
  justify-content: flex-start;
  border: 0;
  background: transparent;
  text-align: left;
}
.stu-export-menu .btn:hover { background: var(--surface-subtle); }

.students-table td[data-sem-cell="name"] {
  font-weight: 650;
  color: var(--color-text);
}
.student-global-send-cell .help { margin-top: 6px; }

@media (max-width: 720px) {
  .stu-export-menu { right: auto; left: 0; }
}

@media (max-width: 640px) {
  .btn {
    padding: 8px 12px;
    font-size: var(--font-size-sm);
  }

  
  .form-actions-inline .btn {
    flex: 1 1 auto;
  }

  
  .students-toolbar-actions {
    width: 100%;
  }
  .students-export-actions { flex: 1 1 auto; }

  
  .students-pagination-row {
    align-items: stretch;
    gap: 10px;
  }
  .students-pagination-row > span:empty {
    display: none;
  }
  
  .students-pagination-row > .btn {
    width: 100%;
  }
  .students-pagination-controls {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .students-pagination-controls > .btn {
    width: 100%;
  }
  
  .students-page-size-form {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* >>> /static/css/pages/courses.css */
.courses-search-grid {
  display: grid;
  
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--space-3);
  align-items: end;
  margin-bottom: var(--space-4);
}

.edit-panel {
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-accent);
  background: var(--surface-tint);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.edit-panel-course {
  background: var(--surface-subtle);
  border-color: var(--color-border);
}

.edit-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.edit-panel-title {
  margin: 0;
  font-size: 18px;
  color: var(--color-primary);
}

.course-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.courses-form-actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
}

.edit-panel-course .edit-panel-head { align-items: flex-start; }

.courses-table tbody tr.courses-group-header:hover { background: transparent; }
.courses-group-header td {
  background: var(--surface-subtle);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  border-bottom: 1px solid var(--color-border);
}

@media (max-width: 900px) {
  .courses-search-grid {
    
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .edit-panel-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .courses-search-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
  }
  .courses-search-grid .field {
    flex: 1 1 100%;
  }
  .courses-search-grid .btn {
    flex: 1 1 0;
    padding: 8px 12px;
    font-size: var(--font-size-sm);
  }
}

/* >>> /static/css/pages/classes.css */
.class-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.classes-search-grid {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--space-3);
  align-items: end;
  margin-bottom: var(--space-4);
}

.classes-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--space-3);
  align-items: end;
  margin-bottom: var(--space-3);
}

.classes-filters .classes-filter-wide {
  grid-column: span 2;
}

.classes-filters-actions {
  display: flex;
  gap: var(--space-2);
  align-items: end;
}

.classes-result-count {
  margin: 0 0 var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.class-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.class-extend-form {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.class-extend-form .input {
  min-width: 130px;
  padding: 8px 10px;
}

.classes-pagination-row {
  margin-top: var(--space-3);
}

.classes-pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.classes-page-size-form {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.classes-page-size-label {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.classes-page-size-input {
  width: 90px;
  min-width: 90px;
}

.classes-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
}

.classes-modal.hidden {
  display: none;
}

.classes-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.classes-modal-card {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-md);
}

.classes-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.text-danger {
  color: var(--color-error-text);
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  
  .class-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .classes-search-grid {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .class-extend-form {
    flex-wrap: wrap;
  }

  .classes-pagination-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .classes-pagination-controls {
    justify-content: flex-start;
  }
}

.ap-note-body .classes-filters { margin-bottom: 0; }

@media (max-width: 768px) {
  .classes-filters {
    grid-template-columns: minmax(0, 1fr);
  }
  .classes-filters .classes-filter-wide {
    grid-column: auto;
  }

  .btn {
    padding: 8px 12px;
    font-size: var(--font-size-sm);
  }

  
  .classes-filters-actions {
    flex-wrap: wrap;
  }
  .classes-filters-actions .btn {
    flex: 1 1 auto;
  }

  
  .class-actions {
    width: 100%;
    gap: 6px;
  }
  .class-actions > .inline-form,
  .class-actions > .btn {
    flex: 1 1 140px;
  }
  .class-actions > .inline-form > .btn,
  .class-actions > .btn {
    width: 100%;
  }
  .class-actions > .class-extend-form {
    flex: 1 1 100%;
    flex-wrap: nowrap;
    gap: 6px;
  }
  .class-extend-form .input {
    min-width: 0;
    flex: 1 1 auto;
  }
  .class-extend-form .btn {
    flex: 0 0 auto;
  }
  .class-actions .btn {
    padding: 7px 10px;
    font-size: 12px;
  }
}

/* >>> /static/css/pages/campaigns.css */
.campaign-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* >>> /static/css/pages/messages.css */
.chips {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.bulk-send-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
  gap: var(--space-4);
  align-items: start;
}

.bulk-send-main {
  min-width: 0;
}

.bulk-send-main.card,
.bulk-send-summary.card {
  margin: 0;
}

.bulk-send-side {
  min-width: 0;
  display: grid;
  gap: var(--space-3);
  align-self: start;
  position: sticky;
  top: 16px;
}

.bulk-send-guide {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  padding: 10px;
  margin-bottom: 10px;
}

.bulk-send-targets-card {
  padding: 12px;
}

.bulk-send-targets-card .bulk-send-guide {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  margin-bottom: 0;
}

.bulk-send-targets-card .bulk-send-setup-grid {
  margin-top: 0;
  gap: 8px;
}

.bulk-send-targets-card .field {
  gap: 6px;
}

.bulk-send-targets-card .input {
  padding: 8px 10px;
}

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

.bulk-send-guide-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.bulk-send-setup-grid {
  margin-top: 12px;
  display: grid;
  
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
  align-items: start;
}

.individual-send-setup-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 10px;
  align-items: end;
}

.individual-send-targets-card {
  padding: 12px;
}

.individual-send-targets-card .bulk-send-guide {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  margin-bottom: 0;
}

.individual-send-targets-card .individual-send-setup-grid {
  margin-top: 0;
  gap: 8px;
}

.individual-send-targets-card .field {
  gap: 6px;
}

.individual-send-targets-card .input {
  padding: 8px 10px;
}

.individual-send-targets-card .help {
  margin: 0;
}

.bulk-send-summary {
  min-width: 0;
  background: var(--surface-subtle);
}

.bulk-summary-compact {
  margin-top: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  padding: 10px;
}

.bulk-summary-inline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.bulk-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  margin-top: 8px;
}

.bulk-summary-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.bulk-summary-item span {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.bulk-summary-item strong {
  color: var(--color-primary);
  font-size: var(--font-size-md);
}

.bulk-summary-details {
  margin-top: 8px;
}

.bulk-summary-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--color-primary);
  user-select: none;
}

.bulk-summary-details[open] summary {
  margin-bottom: 6px;
}

.bulk-preview-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  padding: 10px;
}

.bulk-preview-title {
  margin: 0 0 6px 0;
  color: var(--color-primary);
  font-size: var(--font-size-md);
}

.bulk-preview-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin-bottom: 8px;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.bulk-preview-bubble {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--color-text);
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.bulk-preview-bubble code {
  background: var(--surface-tint-strong);
  border-radius: 4px;
  padding: 1px 4px;
  font-family: "Courier New", monospace;
  font-size: 12px;
}

.send-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.send-profile-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  padding: 10px;
  display: grid;
  gap: 6px;
  cursor: pointer;
}

.send-profile-card input[type="radio"] {
  margin: 0 6px 0 0;
}

.send-profile-card:has(input[type="radio"]:checked) {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 2px rgba(247, 148, 29, 0.2);
  background: var(--surface-tint);
}

.send-profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.send-profile-card .help {
  margin: 0;
}

.send-profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.send-profile-meta span {
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--color-surface);
}

.individual-send-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: var(--space-4);
  align-items: start;
}

.individual-send-main {
  min-width: 0;
}

.individual-send-main.card,
.individual-send-preview.card {
  margin: 0;
}

.individual-send-preview {
  min-width: 0;
  background: var(--surface-tint);
  position: sticky;
  top: 16px;
}

.bulk-preview-code {
  margin: 6px 0;
  white-space: pre-wrap;
  background: var(--surface-subtle);
  border-radius: 6px;
  padding: 8px;
  font-family: "Courier New", monospace;
  font-size: 12px;
}

.conversations-filters {
  display: block;
}

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

.conversations-sync-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.conversations-sync-form {
  margin: 0;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.conversations-sync-form .btn {
  white-space: nowrap;
}

.conversation-sync-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--color-info-bg);
  border: 1px solid var(--color-info-border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--color-info-text);
  width: 100%;
}

.conversation-sync-progress.hidden {
  display: none;
}

.conversation-sync-progress.done {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: var(--color-success-text);
}

.conversation-sync-progress.failed {
  background: var(--color-error-bg);
  border-color: var(--color-error-border);
  color: var(--color-error-text);
}

.conversation-sync-progress-label {
  font-weight: 600;
  flex-shrink: 0;
}

.conversation-sync-progress.failed .conversation-sync-progress-label {
  flex-shrink: 1;
  white-space: normal;
  line-height: 1.45;
}

.conversation-sync-progress.failed .conversation-sync-progress-elapsed,
.conversation-sync-progress.failed .conversation-sync-progress-bar {
  display: none;
}

.conversation-sync-progress-elapsed {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  opacity: 0.85;
  flex-shrink: 0;
}

.conversation-sync-progress-bar {
  flex: 1;
  min-width: 80px;
  height: 6px;
  background: rgba(30, 64, 175, 0.15);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.conversation-sync-progress.done .conversation-sync-progress-bar {
  background: rgba(22, 101, 52, 0.15);
}

.conversation-sync-progress.failed .conversation-sync-progress-bar {
  background: rgba(153, 27, 27, 0.15);
}

.conversation-sync-progress-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 35%;
  background: currentColor;
  border-radius: 999px;
  animation: conv-sync-slide 1.2s ease-in-out infinite;
}

.conversation-sync-progress.done .conversation-sync-progress-bar-fill,
.conversation-sync-progress.failed .conversation-sync-progress-bar-fill {
  width: 100%;
  animation: none;
}

@keyframes conv-sync-slide {
  0%   { left: -35%; }
  100% { left: 100%; }
}

.conversation-top-panel {
  margin-bottom: 10px;
}

.conversations-control-menu {
  margin: 10px 0;
}

.conversations-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.conversations-filter-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
}

.conversations-filter-cards:has(> .conversations-filter-card.hidden) {
  grid-template-columns: minmax(0, 1fr);
}

.conversations-filter-card {
  margin: 0;
}

.conversations-collapsible-card.is-collapsed {
  padding: 12px 16px;
}

.conversations-collapsible-card.is-collapsed .conversations-main-header {
  margin-bottom: 0;
  min-height: 34px;
}

.conversations-collapsible-card.is-collapsed .card-title {
  margin: 0;
  font-size: var(--font-size-lg);
  line-height: 1.2;
}

.conversations-filter-grid-basic {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  align-items: start;
}

.conversations-filter-grid-advanced {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
  align-items: start;
}

.conversation-advanced-filter {
  display: none;
}

.conversations-filters.show-advanced .conversation-advanced-filter {
  display: block;
}

.conversations-filters-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.history-period-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.queue-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.preset-save-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.preset-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preset-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  background: var(--color-surface);
}

.preset-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.metric-card {
  min-height: 96px;
}

.metric-card strong {
  display: block;
  font-size: var(--font-size-lg);
  color: var(--color-primary);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface-tint-strong);
  color: var(--color-primary);
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: var(--font-size-sm);
}

.chip-removable-filter {
  cursor: pointer;
  user-select: none;
}

.chip-removable-filter .chip-removable-x {
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(1, 73, 137, 0.28);
  font-weight: 700;
  line-height: 1;
  font-size: 11px;
}

.chip-removable-filter:hover .chip-removable-x {
  background: rgba(1, 73, 137, 0.08);
}

.chip-removable-filter:focus-visible {
  outline: 2px solid rgba(1, 73, 137, 0.35);
  outline-offset: 1px;
}

.unresolved-message-cell {
  min-width: 260px;
  max-width: 420px;
}

.unresolved-message-cell .btn {
  margin-top: 6px;
}

.unresolved-preview-body {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  padding: 10px;
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.unresolved-preview-empty {
  margin: 0;
}

.unresolved-preview-item {
  border: 1px solid var(--color-border);
  border-radius: 14px 14px 14px 4px;
  background: var(--chat-bubble-in, var(--color-surface));
  box-shadow: var(--shadow-sm);
  padding: 8px 11px;
  max-width: 86%;
  align-self: flex-start;
}

.unresolved-preview-item.is-outbound {
  align-self: flex-end;
  border-radius: 14px 14px 4px 14px;
  background: var(--chat-bubble-out, var(--surface-tint));
  border-color: var(--chat-bubble-out-border, var(--color-border));
}

.unresolved-preview-item-target {
  border-color: var(--color-secondary);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--color-secondary) 22%, transparent),
    var(--shadow-sm);
}

.unresolved-preview-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.unresolved-preview-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: color-mix(in srgb, var(--color-text-muted) 10%, transparent);
  color: var(--color-text-muted);
}
.unresolved-preview-pill.is-outbound {
  color: var(--color-success-text);
  border-color: color-mix(in srgb, var(--color-success-text) 24%, var(--color-border));
  background: color-mix(in srgb, var(--color-success-text) 10%, transparent);
}

.unresolved-preview-text {
  white-space: pre-wrap;
  color: var(--color-text);
}

.conversation-context-card,
.conversation-export-card {
  margin: 0;
}

.conversation-export-card {
  align-self: start;
}

.conversation-export-controls-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
  gap: 8px;
  align-items: end;
}

.conversation-context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: var(--space-3);
}

.conversation-context-grid--single {
  grid-template-columns: minmax(0, 1fr);
}

.conversation-context-cols {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 2fr);
  gap: 16px;
  align-items: start;
}

.conversation-context-col {
  min-width: 0;
}

.conversation-context-col--info .context-info-list {
  margin-bottom: 0;
}

.conversation-context-side-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1fr);
  gap: 12px;
  align-items: start;
}

.conversation-context-side-block {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.conversation-context-side-block > .label {
  display: block;
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.conversation-context-side-block > .context-label-list,
.conversation-context-side-block > .context-class-list {
  margin-bottom: 6px;
}

.conversation-context-side-block > div:last-child,
.conversation-context-side-block > form:last-child {
  margin-bottom: 0 !important;
}

.conversation-context-side-block .context-class-item {
  border: none;
  background: transparent;
  padding: 0;
  min-height: 0;
}

@media (max-width: 960px) {
  .conversation-context-side-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 720px) {
  .conversation-context-cols {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.conversation-context-box {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  padding: 8px 10px;
}

.context-info-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 6px;
}

.context-info-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  line-height: 1.3;
}

.context-info-row dt {
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
  min-width: 58px;
  flex-shrink: 0;
}

.context-info-row dd {
  margin: 0;
  color: var(--color-text);
  word-break: break-word;
  min-width: 0;
}

.context-label-add {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-bottom: 6px;
}

.context-label-add .input {
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
  font-size: 12px;
}

.context-label-add .btn {
  padding: 4px 10px;
  font-size: 12px;
}

.conversation-context-box .label {
  font-size: 11px;
  margin-bottom: 2px !important;
}

.conversation-context-box form {
  margin-bottom: 6px !important;
}

.conversation-context-box .alert {
  font-size: 12px;
  padding: 6px 8px;
  margin-bottom: 6px !important;
}

.context-label-add .btn {
  white-space: nowrap;
  padding: 6px 12px;
  font-size: 13px;
}

.conversations-result-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.conversations-summary-button {
  cursor: pointer;
  font: inherit;
}

.conversations-summary-button:hover {
  filter: brightness(0.97);
}

.no-conversation-students-modal-card {
  width: min(680px, calc(100vw - 32px));
}

.conversations-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.no-conversation-students-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(420px, 60vh);
  overflow-y: auto;
}

.no-conversation-student-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: var(--color-surface);
}

.no-conversation-student-link {
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: none;
}

.no-conversation-student-link:hover,
.no-conversation-student-link:focus-visible {
  color: var(--color-secondary);
  text-decoration: underline;
}

.context-class-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.context-label-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.chip-button {
  cursor: pointer;
  background: var(--surface-tint-strong);
  border: 1px solid var(--color-accent);
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.pagination-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.context-class-item {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  background: var(--color-surface);
  font-size: 12px;
  line-height: 1.3;
}

.context-class-item strong {
  font-size: 12px !important;
}

.context-class-item p {
  font-size: 11px !important;
}

.badge-warning {
  color: var(--color-warning-text);
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
}

@media (max-width: 1100px) {
  .bulk-send-layout {
    grid-template-columns: 1fr;
  }

  .bulk-send-side {
    position: static;
  }

  .bulk-summary-inline {
    grid-template-columns: 1fr;
  }

  .individual-send-layout {
    grid-template-columns: 1fr;
  }

  .individual-send-preview {
    position: static;
  }

  .bulk-send-setup-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

.badge-success {
  color: var(--color-success-text);
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
}

.badge-muted {
  color: var(--color-text-muted);
  background: var(--surface-subtle);
  border-color: var(--color-border);
}

.badge-info {
  color: var(--color-info-text);
  background: var(--color-info-bg);
  border-color: var(--color-info-border);
}

.attendance-badge-nova {
  color: var(--color-warning-text);
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
}

.attendance-badge-em_atendimento {
  color: var(--color-info-text);
  background: var(--color-info-bg);
  border-color: var(--color-info-border);
}

.attendance-badge-aguardando_retorno {
  color: var(--color-success-text);
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
}

.attendance-badge-finalizada {
  color: var(--color-text-muted);
  background: var(--surface-subtle);
  border-color: var(--color-border);
}

.attendance-badge-sua_vez {
  color: var(--color-warning-text);
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
}

.attendance-badge-aguardando_aluno {
  color: var(--color-success-text);
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
}

.priority-badge-baixa {
  color: var(--color-success-text);
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
}

.priority-badge-media {
  color: var(--color-warning-text);
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
}

.priority-badge-alta {
  color: var(--color-warning-text);
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
}

.priority-badge-critica {
  color: var(--color-error-text);
  background: color-mix(in srgb, var(--color-error-text) 10%, transparent);
  border-color: color-mix(in srgb, var(--color-error-text) 24%, var(--color-border));
}

@media (max-width: 1200px) {
  .conversations-main-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .conversations-sync-strip {
    align-items: flex-start;
  }

  .preset-save-row {
    grid-template-columns: 1fr;
  }

  .preset-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .conversations-active-filters {
    align-items: flex-start;
  }

  .conversations-filter-cards {
    grid-template-columns: 1fr;
  }

  .conversations-filter-grid-basic {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .conversations-filter-grid-advanced {
    grid-template-columns: 1fr;
  }

  .history-period-form {
    grid-template-columns: 1fr;
  }

  .queue-actions {
    flex-direction: column;
  }

  .conversation-export-controls-row {
    grid-template-columns: 1fr;
  }

  .conversations-result-summary {
    justify-content: flex-start;
  }

  .conversation-context-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .conversations-filter-grid-basic {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .bulk-send-setup-grid {
    grid-template-columns: 1fr;
  }

  .individual-send-setup-grid {
    grid-template-columns: 1fr;
  }
}

/* >>> /static/css/pages/unresolved.css */

.unresolved-preview-media {
  margin: 8px 0 6px 0;
}

.unresolved-preview-media img,
.unresolved-preview-media video,
.unresolved-preview-media audio {
  display: block;
  width: 100%;
  max-width: 360px;
}

.unresolved-preview-media img,
.unresolved-preview-media video {
  max-height: 280px;
  border-radius: 10px;
  border: 1px solid var(--stroke-soft);
  background: var(--color-surface);
  object-fit: contain;
}

.unresolved-preview-document {
  max-width: 420px;
  border: 1px solid var(--stroke-soft);
  border-radius: 10px;
  background: var(--color-surface);
  padding: 10px;
}

.unresolved-preview-document-name {
  display: block;
  margin-top: 4px;
  color: var(--ink-700);
  word-break: break-word;
}

.unresolved-card-wide {
  width: min(100%, 1600px);
}

.unresolved-filters-row {
  display: flex;
  
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.unresolved-filter-search {
  flex: 1 1 260px;
  min-width: 0;
}

.unresolved-filter-select {
  flex: 0 1 220px;
  min-width: 170px;
}

.unresolved-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.unresolved-triage-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--color-warning-text) 24%, var(--color-border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-warning-text) 8%, var(--color-surface));
}
.unresolved-triage-warning-icon {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--color-warning-text);
}
.unresolved-triage-warning-icon svg {
  display: block;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.unresolved-triage-warning p {
  margin: 0;
  min-width: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text);
}
.unresolved-triage-warning strong {
  color: var(--color-warning-text);
  font-weight: 600;
}
@media (max-width: 640px) {
  .unresolved-triage-warning {
    padding: 10px;
    gap: 8px;
  }
  .unresolved-triage-warning p {
    font-size: 12.5px;
  }
}

.unresolved-batch-bar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.unresolved-batch-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .unresolved-batch-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .unresolved-batch-actions .btn {
    flex: 1 1 auto;
    padding: 8px 12px;
    font-size: var(--font-size-sm);
  }
  .unresolved-batch-actions .btn-primary {
    flex-basis: 100%;
  }

  
  .unresolved-filter-select {
    flex: 1 1 100%;
    min-width: 0;
  }
  .unresolved-filter-actions {
    margin-left: 0;
    width: 100%;
  }
  .unresolved-filter-actions .btn {
    flex: 1 1 0;
    padding: 8px 12px;
    font-size: var(--font-size-sm);
  }

  
  .unresolved-pager {
    flex-direction: column;
    align-items: stretch;
  }
  .unresolved-pager-controls {
    margin-left: 0;
    width: 100%;
  }
}

.unresolved-pager {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.unresolved-pager-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.unresolved-page-size-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.unresolved-page-size-label {
  color: var(--ink-700);
  font-size: 0.92rem;
  white-space: nowrap;
}

.unresolved-page-size-input {
  width: 90px;
}

.unresolved-triage-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--stroke-soft);
  border-radius: 12px;
  background: var(--color-surface);
}

.unresolved-triage-setting-copy {
  min-width: 0;
}

.unresolved-triage-setting-title {
  display: block;
  font-weight: 600;
  color: var(--color-text);
}

.unresolved-triage-setting-help {
  display: block;
  margin-top: 2px;
  color: var(--color-muted);
  font-size: 13px;
}

.unresolved-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 4px;
  cursor: pointer;
  font: inherit;
  flex-shrink: 0;
}

.unresolved-switch-state {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.unresolved-switch.is-on .unresolved-switch-state {
  color: var(--color-success-text);
}

.unresolved-switch-track {
  position: relative;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-text-muted) 35%, var(--color-surface));
  transition: background var(--motion-fast) var(--motion-ease);
  flex-shrink: 0;
}

.unresolved-switch.is-on .unresolved-switch-track {
  background: var(--wa-green, #34c759);
}

.unresolved-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: left var(--motion-fast) var(--motion-ease);
}

.unresolved-switch.is-on .unresolved-switch-knob {
  left: 20px;
}

.unresolved-switch:focus-visible .unresolved-switch-track {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

.unresolved-card-wide .table th {
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.unresolved-card-wide .table td {
  vertical-align: top;
}

.unresolved-card-wide .table tbody tr {
  transition: background var(--motion-fast) var(--motion-ease);
}

.unresolved-card-wide .table tbody tr:hover {
  background: var(--surface-tint);
}

.unresolved-phone-hint {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--color-text-muted);
}

.unresolved-case-cell strong {
  display: block;
  font-weight: 600;
  color: var(--color-text);
}

.unresolved-case-cell span,
.unresolved-date-cell span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.unresolved-mentioned-courses {
  min-width: 140px;
}

.unresolved-source-cell {
  min-width: 190px;
}

.unresolved-source-cell strong {
  display: block;
  color: var(--color-text);
  font-weight: 600;
}

.unresolved-source-cell span {
  display: block;
  margin-top: 3px;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.25;
  word-break: break-word;
}

.unresolved-mentioned-courses-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.unresolved-course-chip {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--color-success-text) 30%, transparent);
  border-radius: 999px;
  background: var(--color-success-bg);
  color: var(--color-success-text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: normal;
}

.unresolved-course-chip:nth-child(even) {
  border-color: color-mix(in srgb, var(--color-info-text) 30%, transparent);
  background: var(--color-info-bg);
  color: var(--color-info-text);
}

.unresolved-course-chip-extra {
  display: none;
}

.unresolved-mentioned-courses.is-expanded .unresolved-course-chip-extra {
  display: inline-flex;
}

.unresolved-course-expand {
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-info-bg);
  color: var(--color-primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  min-width: 34px;
  padding: 5px 9px;
}

.unresolved-course-expand:hover,
.unresolved-course-expand:focus-visible {
  border-color: color-mix(in srgb, var(--color-info-text) 30%, transparent);
}

.unresolved-preview-modal-card {
  width: min(760px, calc(100vw - 32px));
}

.unresolved-preview-load-note {
  margin: 0 0 8px 0;
  color: var(--color-muted);
}

@media (max-width: 900px) {
  .unresolved-filters-row {
    flex-direction: column;
    align-items: stretch;
  }

  .unresolved-filter-search,
  .unresolved-filter-select {
    flex: 1 1 auto;
  }

  .unresolved-filter-actions {
    margin-left: 0;
    width: 100%;
  }

  .unresolved-pager {
    flex-direction: column;
    align-items: stretch;
  }

  .unresolved-pager-controls {
    margin-left: 0;
    width: 100%;
  }

  .unresolved-triage-setting {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* >>> /static/css/pages/conversations.css */

:root {
  --chat-bg: color-mix(in srgb, var(--color-primary) 5%, var(--color-bg));
  --chat-bubble-in: var(--color-surface);
  --chat-bubble-out: color-mix(in srgb, #25d366 13%, var(--color-surface));
  --chat-bubble-out-border: color-mix(in srgb, #25d366 30%, var(--color-border));
  --chat-pane-border: color-mix(in srgb, var(--color-border) 65%, transparent);
}

.conversations-layout.conversations-shell {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 0;
  
  height: calc(100vh - 88px);
  min-height: 560px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--color-surface);
}

.conversations-shell .conversations-column {
  min-height: 0;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.conversations-pane-list {
  border-right: 1px solid var(--chat-pane-border);
  background: var(--color-surface);
}

.conversations-pane-list .conversations-list-header {
  padding: 14px 16px 10px 16px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--chat-pane-border);
  flex-shrink: 0;
  
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.conversations-pane-list .conversations-list {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  max-height: none;
  gap: 0;
  padding: 0;
  overscroll-behavior: contain;
}

.conversations-shell .conversation-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--chat-pane-border);
  border-left: 4px solid transparent;
  border-radius: 0;
  padding: 10px 12px 10px 8px;
  transition: background var(--motion-fast) var(--motion-ease);
}

.conversations-shell .conversation-item:hover {
  background: var(--surface-tint);
}

.conversations-shell .conversation-item.active {
  background: var(--surface-tint-strong);
  border-left-color: var(--color-secondary);
  box-shadow: none;
}

.conversations-shell .conversation-item.priority-baixa { border-left-color: var(--color-success-text); }
.conversations-shell .conversation-item.priority-media { border-left-color: var(--color-warning-text); }
.conversations-shell .conversation-item.priority-alta { border-left-color: var(--color-warning-text); }
.conversations-shell .conversation-item.priority-critica { border-left-color: var(--color-error-text); }
.conversations-shell .conversation-item.active.priority-baixa,
.conversations-shell .conversation-item.active.priority-media,
.conversations-shell .conversation-item.active.priority-alta,
.conversations-shell .conversation-item.active.priority-critica {
  box-shadow: inset 0 0 0 1px var(--color-secondary);
}

.conversation-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
  background: hsl(var(--avatar-hue, 210), 45%, 48%);
  flex-shrink: 0;
  user-select: none;
}

.conversation-avatar--sm {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

.conversation-item-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.conversation-item-content strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.conversation-item-time {
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.conversation-item-time.has-unread {
  color: var(--wa-green);
  font-weight: 600;
}

.conversations-shell .conversation-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 0 !important;
  min-width: 0;
}

.conversation-item-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.conversation-item-preview {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.conversation-item-preview-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.conversation-item-signals {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 11px;
  line-height: 1.4;
}

.conversation-status-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
}

.conversation-status-text::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.conversation-signal {
  color: var(--color-text-muted);
  white-space: nowrap;
}

.conversation-signal-warning {
  color: var(--color-warning-text);
  font-weight: 600;
}

.conversations-infinite-loader {
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-muted);
}

.insight-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.insight-stat {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  min-width: 0;
}

.insight-stat--clickable {
  cursor: pointer;
  transition: background var(--motion-fast) var(--motion-ease);
}

.insight-stat--clickable:hover {
  background: var(--surface-tint);
}

.insight-stat-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--color-text);
}

.insight-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
}

.insight-stat-bar {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-border) 55%, transparent);
  overflow: hidden;
  margin: 3px 0 2px;
}

.insight-stat-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.insight-stat-bar-fill--sent {
  background: color-mix(in srgb, var(--color-text-muted) 55%, transparent);
}

.insight-stat-bar-fill--reached {
  background: color-mix(in srgb, var(--color-text-muted) 80%, var(--color-text));
}

.insight-stat-bar-fill--read {
  background: var(--color-info-text); 
}

.insight-stat-bar-fill--engaged {
  background: var(--wa-green);
}

.insight-stat-sub {
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.insight-failed-note {
  margin: 8px 2px 0;
  font-size: 12px;
  color: var(--color-error-text);
}

.conversations-empty-state {
  margin: 0;
  padding: 28px 20px;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
}

.conversation-unread-pill {
  background: var(--wa-green);
  color: #fff;
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.conversations-shell .pagination-row {
  flex-shrink: 0;
  border-top: 1px solid var(--chat-pane-border);
  padding: 8px 12px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--color-surface);
}

.conversations-shell .pagination-row .btn {
  padding: 4px 12px;
  font-size: 12px;
}

.conversations-pane-chat {
  background: var(--chat-bg);
  position: relative;
}

.conversation-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--chat-pane-border);
  flex-shrink: 0;
  min-height: 56px;
}

.conversation-chat-header-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.conversation-chat-header-info strong {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-chat-header-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.conversation-chat-header-meta .badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: inherit;
}

.conversation-chat-header-meta .badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.conversation-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.conversation-chat-icon-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition:
    background var(--motion-fast, 140ms) ease,
    color var(--motion-fast, 140ms) ease;
}

.conversation-chat-icon-btn:hover,
.conversation-chat-icon-btn[aria-expanded="true"] {
  background: var(--surface-tint);
  color: var(--color-text);
}

.conversation-chat-icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.conversation-chat-menu-wrap {
  position: relative;
}

.conversation-chat-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 210px;
  padding: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  z-index: 50;
}

.conversation-chat-menu .inline-form {
  display: block;
}

.conversation-chat-menu-item {
  appearance: none;
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text);
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.conversation-chat-menu-item:hover {
  background: var(--surface-tint);
}

.conversation-chat-menu-transfer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 12px 10px;
}

.conversation-chat-menu-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.conversation-chat-transfer-field {
  position: relative;
  display: block;
}

.conversation-chat-transfer-field .select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 9px 32px 9px 12px;
  font-size: 13px;
  border-radius: 10px;
  cursor: pointer;
}

.conversation-chat-transfer-field::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.6px solid var(--color-text-muted);
  border-bottom: 1.6px solid var(--color-text-muted);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.conversation-chat-transfer-ok {
  width: 100%;
  justify-content: center;
}

.conversation-chat-back {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: -6px;
  text-decoration: none;
  border-radius: 50%;
  color: var(--color-text);
  flex-shrink: 0;
}

.conversation-chat-back svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.conversation-chat-back:hover {
  background: var(--surface-tint);
  text-decoration: none;
}

.conversations-shell .conversation-thread {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding: 16px 8%;
  gap: 4px;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  
  background-image: radial-gradient(
    color-mix(in srgb, var(--color-primary) 7%, transparent) 1px,
    transparent 1px
  );
  background-size: 22px 22px;
}

.conversation-thread-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--color-text-muted);
  text-align: center;
  padding: 32px;
}

.conversation-thread-empty .conversation-thread-empty-icon {
  font-size: 44px;
  opacity: 0.45;
}

.conversation-date-separator {
  align-self: center;
  background: color-mix(in srgb, var(--color-surface) 85%, var(--color-primary));
  color: var(--color-text-muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  margin: 10px 0 6px 0;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 4px;
  z-index: 2;
}

.conversations-shell .conversation-bubble {
  display: flex;
  flex-direction: column;
  max-width: min(72%, 560px);
  padding: 7px 10px 6px 10px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  box-shadow: 0 1px 1px rgba(0, 20, 40, 0.08);
  margin-bottom: 2px;
}

.conversations-shell .conversation-bubble.inbound {
  align-self: flex-start;
  background: var(--chat-bubble-in);
  border-color: var(--chat-pane-border);
  border-top-left-radius: 4px;
}

.conversations-shell .conversation-bubble.outbound {
  align-self: flex-end;
  background: var(--chat-bubble-out);
  border-color: var(--chat-bubble-out-border);
  border-top-right-radius: 4px;
}

.conversations-shell .conversation-bubble.has-reaction {
  margin-bottom: 18px;
}

.conversations-shell .conversation-message-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13.5px;
  line-height: 1.45;
}

.conversations-shell .conversation-meta {
  order: 10;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 10.5px;
  color: var(--color-text-muted);
  margin-top: 3px;
  margin-bottom: 0;
}

.conversations-shell .conversation-meta .badge {
  font-size: 10px;
  padding: 1px 6px;
}

.conversations-shell .conversation-meta .btn {
  padding: 1px 7px !important;
  font-size: 10.5px !important;
}

.conversations-shell .conversation-delegation-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  color: var(--color-text-muted);
  opacity: 0.7;
  cursor: help;
  transition:
    color var(--motion-fast) var(--motion-ease),
    opacity var(--motion-fast) var(--motion-ease);
}
.conversations-shell .conversation-bubble:hover .conversation-delegation-mark {
  opacity: 1;
}
.conversations-shell .conversation-delegation-mark:hover {
  color: var(--color-secondary);
  opacity: 1;
}

.conversations-shell .wa-delivery {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.conversations-shell .wa-delivery-read { color: var(--color-info-text); }
.conversations-shell .wa-delivery-delivered { color: var(--color-text-muted); }
.conversations-shell .wa-delivery-sent { color: var(--color-text-muted); }
.conversations-shell .wa-delivery-queued { color: var(--color-warning-text); }
.conversations-shell .wa-delivery-failed { color: var(--color-error-text); }

.conversations-shell .conversation-reaction-stack {
  position: absolute;
  bottom: -14px;
  left: auto;
  right: 10px;
  transform: none;
  display: flex;
  gap: 2px;
}

.conversations-shell .conversation-bubble.inbound .conversation-reaction-stack {
  right: auto;
  left: 10px;
}

.conversations-shell .conversation-bubble {
  position: relative;
}

.conversations-shell .conversation-reaction-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--chat-pane-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  line-height: 1;
}

.conversations-shell .conversation-message-body strong { font-weight: 700; }
.conversations-shell .conversation-message-body em { font-style: italic; }
.conversations-shell .conversation-message-body del { text-decoration: line-through; }

.conversations-shell .conversation-message-body .conversation-inline-code {
  font-family: "Courier New", monospace;
  font-size: 12px;
  background: color-mix(in srgb, var(--color-primary) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-primary) 16%, transparent);
  border-radius: 6px;
  padding: 1px 5px;
}

.conversations-shell .conversation-message-body .conversation-block-code {
  font-family: "Courier New", monospace;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  margin: 6px 0;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--color-primary) 16%, transparent);
  background: color-mix(in srgb, var(--color-primary) 7%, transparent);
}

.conversations-shell .conversation-media-trigger {
  display: inline-block;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0 0 6px 0;
  cursor: zoom-in;
}

.conversations-shell .conversation-media-image {
  display: block;
  max-width: min(320px, 78vw);
  max-height: 320px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--chat-pane-border);
  background: var(--surface-subtle);
  object-fit: contain;
}

.conversations-shell .conversation-media-document {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: min(320px, 78vw);
  max-width: min(320px, 78vw);
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--chat-pane-border);
  background: var(--surface-subtle);
  text-align: left;
}

.conversations-shell .conversation-media-document strong {
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.conversations-shell .conversation-media-document span {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.conversation-media-modal-card {
  width: min(96vw, 1080px);
}

.conversation-media-modal-body {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--media-stage-bg);
  min-height: min(68vh, 560px);
  max-height: 74vh;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.conversation-media-modal-image {
  display: block;
  width: min(94vw, 980px);
  max-width: 100%;
  max-height: calc(74vh - 24px);
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: var(--media-stage-bg-deep);
}

.conversation-media-modal-video {
  display: block;
  width: min(94vw, 980px);
  max-width: 100%;
  max-height: calc(74vh - 24px);
  border-radius: var(--radius-sm);
  background: var(--media-stage-bg-deep);
}

.conversation-media-modal-document {
  display: block;
  width: min(94vw, 980px);
  max-width: 100%;
  min-height: 360px;
  max-height: calc(74vh - 24px);
  border: 1px solid var(--media-stage-border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--color-text);
  padding: 16px;
  overflow: auto;
}

.conversation-composer {
  flex-shrink: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--chat-pane-border);
  padding: 10px 14px 12px 14px;
  max-height: 52%;
  overflow-y: auto;
}

.conversation-composer .alert {
  font-size: 12.5px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.conversation-composer-class-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.conversation-composer-class-row .label {
  margin: 0;
  font-size: 11.5px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.conversation-composer-class-row .select {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  font-size: 12.5px;
}

.conversation-composer-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.conversation-composer-input-row .textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border-radius: 18px;
  padding: 9px 14px;
  font-size: 13.5px;
  line-height: 1.4;
  max-height: 132px;
  field-sizing: content; 
}

.conversation-composer-attach-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  padding: 0 !important;
  flex-shrink: 0;
}

.conversation-composer-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.conversation-composer-send-btn svg {
  display: block;
  margin-left: 2px; 
}

.conversation-composer-send-btn.is-loading svg {
  opacity: 0.45;
}

.conversation-composer-mic-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  flex-shrink: 0;
}

.conversation-composer-mic-btn svg {
  display: block;
}

.conversation-voice-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 38px;
}

.conversation-voice-bar.hidden {
  display: none;
}

.conversation-voice-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  flex-shrink: 0;
}

.conversation-voice-cancel-btn:hover {
  color: var(--color-error-text);
  border-color: var(--color-error-border);
}

.conversation-voice-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

.conversation-voice-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-error-text);
  animation: conversation-voice-pulse 1.2s ease-in-out infinite;
}

@keyframes conversation-voice-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.conversation-voice-preview {
  flex: 1;
  min-width: 0;
  max-width: 320px;
  height: 36px;
}

.conversation-voice-preview.hidden {
  display: none;
}

.conversation-composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  
  margin-top: 0;
}

.conversation-composer-footer:has(> :not(.hidden)) {
  margin-top: 6px;
}

.conversation-composer-footer .help {
  margin: 0;
  font-size: 11px;
}

.conversation-composer #conversationAttachmentList {
  margin-top: 8px;
}

@media (max-width: 1100px) {
  .conversations-layout.conversations-shell {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  }
  .conversations-shell .conversation-thread {
    padding: 14px 16px;
  }
}

@media (max-width: 860px) {
  .conversations-layout.conversations-shell {
    
    grid-template-columns: minmax(0, 1fr);
    
    height: calc(100vh - 88px);
    height: calc(100dvh - 88px);
    min-height: 0;
  }
  
  .conversations-shell:not(.has-selection) .conversations-pane-chat { display: none; }
  .conversations-shell.has-selection .conversations-pane-list { display: none; }
  .conversations-shell.has-selection .conversation-chat-back { display: inline-flex; }
  .conversations-shell .conversation-bubble { max-width: 86%; }

  
  .conversations-shell .conversation-thread {
    padding: 12px 10px;
  }

  .conversation-chat-header {
    padding: 6px 10px;
    gap: 8px;
  }

  .conversation-chat-icon-btn {
    width: 40px;
    height: 40px;
  }

  
  .conversation-composer {
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  
  .conversations-shell .conversation-item {
    padding: 12px 12px 12px 8px;
  }
}

:root {
  --wa-green: #00a884;
  --wa-green-dark: #008f72;
  --chat-bg: color-mix(in srgb, #efeae2 72%, var(--color-bg));
  --chat-bubble-out: color-mix(in srgb, #d9fdd3 78%, var(--color-surface));
  --chat-bubble-out-border: color-mix(in srgb, #b8e8b0 60%, var(--color-border));
}

.conversations-shell .conversation-thread {
  background-color: var(--chat-bg);
  background-image: url("data:image/svg+xml,%3Csvg width='160' height='160' viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23000' stroke-opacity='0.045' stroke-width='1.6'%3E%3Ccircle cx='22' cy='26' r='7'/%3E%3Cpath d='M120 18l8 8m0-8l-8 8'/%3E%3Cpath d='M64 52c6-8 16-8 22 0'/%3E%3Crect x='104' y='84' width='14' height='14' rx='3'/%3E%3Cpath d='M28 104l6 10h-12z'/%3E%3Ccircle cx='84' cy='128' r='5'/%3E%3Cpath d='M138 132c4 0 7 3 7 7s-3 7-7 7'/%3E%3Cpath d='M48 148h16'/%3E%3Ccircle cx='148' cy='52' r='4'/%3E%3Cpath d='M8 64c4-4 10-4 14 0'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 320px 320px;
}

.conversations-list-search {
  padding: 8px 12px;
  border-bottom: 1px solid var(--chat-pane-border);
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.conversations-list-search .input {
  border-radius: 999px;
  padding: 7px 14px 7px 36px;
  font-size: 13px;
  background-color: color-mix(in srgb, var(--color-bg) 70%, var(--color-surface));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23667781' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 13px center;
  border-color: transparent;
}

.conversations-list-search .input:focus {
  border-color: var(--wa-green);
  outline: none;
  box-shadow: 0 0 0 1px var(--wa-green);
}

.conversations-filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.conversations-filter-chip {
  border: 1px solid var(--chat-pane-border);
  background: color-mix(in srgb, var(--color-bg) 60%, var(--color-surface));
  color: var(--color-text-muted);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 12.5px;
  text-decoration: none;
  transition: background var(--motion-fast) var(--motion-ease);
}

.conversations-filter-chip:hover {
  background: var(--surface-tint);
  text-decoration: none;
}

.conversations-filter-chip.is-active {
  background: color-mix(in srgb, var(--wa-green) 16%, var(--color-surface));
  border-color: color-mix(in srgb, var(--wa-green) 40%, transparent);
  color: var(--wa-green-dark);
  font-weight: 600;
}

.conversation-unread-pill { background: var(--wa-green); }

.conversation-composer-send-btn {
  background: var(--wa-green) !important;
  border-color: var(--wa-green) !important;
}

.conversation-composer-send-btn:hover:not(:disabled) {
  background: var(--wa-green-dark) !important;
  border-color: var(--wa-green-dark) !important;
}

.conversation-composer-emoji-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  padding: 0 !important;
  flex-shrink: 0;
  line-height: 1;
}

@media (hover: hover) {
  .conversations-shell .conversation-meta .btn {
    opacity: 0;
    transition: opacity var(--motion-fast) var(--motion-ease);
  }
  .conversations-shell .conversation-bubble:hover .conversation-meta .btn {
    opacity: 1;
  }
}

.conversation-select-check {
  position: absolute;
  top: 50%;
  left: -30px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--color-text-muted) 55%, transparent);
  background: var(--color-surface);
  cursor: pointer;
  padding: 0;
  display: none;
  align-items: center;
  justify-content: center;
}

.conversations-shell .conversation-bubble.inbound .conversation-select-check {
  left: auto;
  right: -30px;
}

.conversation-thread.selection-mode .conversation-bubble.selectable .conversation-select-check {
  display: inline-flex;
}

.conversation-thread.selection-mode .conversation-bubble.selectable {
  cursor: pointer;
}

.conversation-thread.selection-mode .conversation-bubble.selectable.is-selected {
  outline: 2px solid var(--wa-green);
  outline-offset: 1px;
  background: color-mix(in srgb, var(--wa-green) 10%, var(--color-surface));
}

.conversation-bubble.is-selected .conversation-select-check {
  background: var(--wa-green);
  border-color: var(--wa-green);
}

.conversation-bubble.is-selected .conversation-select-check::after {
  content: "✓";
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.conversation-selection-bar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--chat-pane-border);
  flex-shrink: 0;
  min-height: 58px;
}

.conversations-pane-chat.selection-active .conversation-selection-bar { display: flex; }
.conversations-pane-chat.selection-active .conversation-chat-header { display: none; }

.conversation-selection-count {
  font-weight: 600;
  font-size: 14px;
  flex: 1;
}

.conversation-selection-bar .btn-delete-selected {
  background: var(--color-error-text);
  border-color: var(--color-error-text);
  color: #fff;
}

.conversation-emoji-panel {
  position: absolute;
  bottom: 96px; 
  left: 8px;
  width: min(360px, calc(100% - 16px));
  height: 320px;
  background: var(--color-surface);
  border: 1px solid var(--chat-pane-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 30;
}

.conversation-emoji-panel.is-open { display: flex; }

.conversation-composer { position: relative; }

.conversation-emoji-tabs {
  display: flex;
  border-bottom: 1px solid var(--chat-pane-border);
  flex-shrink: 0;
}

.conversation-emoji-tab {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 17px;
  padding: 7px 0 5px 0;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  line-height: 1;
}

.conversation-emoji-tab.is-active {
  border-bottom-color: var(--wa-green);
}

.conversation-emoji-search {
  padding: 8px 10px;
  flex-shrink: 0;
}

.conversation-emoji-search .input {
  width: 100%;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
}

.conversation-emoji-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 2px;
  padding: 6px 10px 10px 10px;
  align-content: start;
}

.conversation-emoji-grid .emoji-cat-title {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 8px 2px 2px 2px;
}

.conversation-emoji-item {
  border: 0;
  background: transparent;
  font-size: 21px;
  line-height: 1;
  padding: 5px 0;
  cursor: pointer;
  border-radius: 6px;
}

.conversation-emoji-item:hover {
  background: var(--surface-tint);
}

.conversation-emoji-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 12.5px;
  padding: 16px 0;
}

.conversation-search-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--chat-pane-border);
  flex-shrink: 0;
}

.conversations-pane-chat.search-active .conversation-search-bar { display: flex; }

.conversation-search-bar .input {
  flex: 1;
  min-width: 0;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
}

.conversation-search-nav-btn {
  width: 32px;
  height: 32px;
}

.conversation-search-nav-btn svg {
  width: 18px;
  height: 18px;
}

.conversation-search-count {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.conversations-shell .conversation-bubble.search-hit {
  outline: 2px solid color-mix(in srgb, var(--color-search-highlight) 75%, transparent);
  outline-offset: 1px;
}

.conversations-shell .conversation-bubble.search-current {
  outline: 3px solid var(--wa-green);
  outline-offset: 1px;
}

.conversation-delete-modal-card {
  width: min(480px, calc(100vw - 32px));
}

.conversation-delete-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.conversation-delete-modal-actions .btn {
  border-radius: 999px;
}

.conversation-delete-for-all-btn {
  background: var(--color-error-text);
  border-color: var(--color-error-text);
  color: #fff;
}

.conversation-delete-for-all-btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

.conversation-composer-context {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 14px;
  margin-bottom: 4px;
}

.conversation-context-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  padding: 0;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
}

.conversation-context-chip--channel {
  background: transparent;
  border: 0;
  color: var(--wa-green-dark);
  font-weight: 600;
}

.conversation-context-chip-select {
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  background-color: color-mix(in srgb, var(--color-bg) 60%, var(--color-surface));
  border: 1px solid var(--chat-pane-border);
  max-width: 100%;
  min-width: 0;
}

.conversations-control-menu-buttons {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 2px;
  padding: 4px;
  max-width: 100%;
  background: color-mix(in srgb, var(--color-bg) 75%, var(--color-surface));
  border: 1px solid var(--chat-pane-border);
  border-radius: 999px;
  overflow-x: auto;
  scrollbar-width: none; 
}

.conversations-control-menu-buttons::-webkit-scrollbar { display: none; }

.conversations-control-tab,
.conversations-control-tab.btn.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
  box-shadow: none;
  transition:
    background var(--motion-fast) var(--motion-ease),
    color var(--motion-fast) var(--motion-ease);
}

.conversations-control-tab:hover,
.conversations-control-tab.btn.btn-outline:hover {
  background: var(--surface-tint);
  color: var(--color-text);
  border: 0;
}

.conversations-control-tab.is-active,
.conversations-control-tab.btn.btn-outline.is-active {
  background: var(--color-surface);
  color: var(--wa-green-dark);
  border: 0;
  box-shadow: var(--shadow-sm);
}

.conversations-control-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.conversations-control-tab-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.conversation-panel-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 0 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--chat-pane-border);
  position: sticky;
  top: 0;
  background: var(--color-surface);
  z-index: 5;
}

.conversation-panel-sheet-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
}

.conversation-panel-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.conversation-panel-close:hover {
  background: var(--surface-tint);
  color: var(--color-text);
}

.conversation-top-panel .conversations-sync-strip {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.conversations-sync-intro {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.conversations-sync-meta {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.conversation-top-panel .conversations-sync-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.conversations-sync-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--motion-fast) var(--motion-ease),
    background var(--motion-fast) var(--motion-ease);
}

.conversations-sync-option:hover:not(:disabled) {
  border-color: var(--color-secondary);
  background: var(--surface-tint);
}

.conversations-sync-option:disabled {
  opacity: 0.55;
  cursor: default;
}

.conversations-sync-option.is-running {
  opacity: 1;
  border-color: var(--color-secondary);
  background: var(--surface-tint);
}

.conversations-sync-option-title {
  font-weight: 600;
  font-size: 14px;
}

.conversations-sync-option-desc {
  font-size: 12px;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.conversation-panel-intro {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

#conversationFiltersPanel .card-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

#conversationFiltersPanel .conversations-filter-grid-basic .btn-small {
  align-self: flex-start;
  border: 0;
  background: transparent;
  padding: 2px 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

#conversationFiltersPanel .conversations-filter-grid-basic .btn-small:hover {
  background: transparent;
  color: var(--color-text);
  text-decoration: underline;
}

.conversations-list-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
}

.conversations-list-header-row .card-title {
  margin: 0;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

#conversationsQuickSearchToggle {
  display: none;
}

.conversations-list-header .conversations-control-menu-buttons {
  display: flex;
  width: 100%;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  overflow: visible;
}

.conversations-list-header .conversations-control-tab,
.conversations-list-header .conversations-control-tab.btn.btn-outline {
  padding: 6px 8px;
  border-radius: 10px;
}

.conversations-list-header .conversations-control-tab > span:not(.conversations-control-tab-icon) {
  display: none;
}

.conversations-list-header .conversations-control-tab-icon {
  font-size: 16px;
}

.conversations-list-header .conversations-control-tab-icon svg {
  width: 18px;
  height: 18px;
}

.conversations-list-header .conversations-control-tab.is-active,
.conversations-list-header .conversations-control-tab.btn.btn-outline.is-active {
  background: var(--surface-tint);
  box-shadow: none;
}

@supports selector(.app-content:has(a)) {
  .page-content--fullbleed .conversations-layout.conversations-shell {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  
  .page-content--fullbleed .conversation-top-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(720px, 94%);
    margin: 0;
    overflow-y: auto;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    z-index: 45;
    padding: 0 16px 16px;
    
    overflow-x: hidden;
  }

  
  .page-content--fullbleed .conversation-top-panel .conversations-filter-grid-basic {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .page-content--fullbleed .conversation-top-panel .conversations-filter-grid-advanced {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  
  .page-content--fullbleed #conversationOrionPanel {
    left: 0;
    width: auto;
    margin: 0 auto;
    border-left: 0;
  }

  
  .page-content--fullbleed #realtimeNotice {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    margin: 0;
    box-shadow: var(--shadow-md);
    width: max-content;
    max-width: min(560px, 92%);
  }
}

@media (max-width: 860px) {
  
  #conversationsQuickSearchToggle {
    display: inline-flex;
  }

  .conversations-list-search #conversationsQuickFilterInput {
    display: none;
  }

  .conversations-list-search.is-search-open #conversationsQuickFilterInput {
    display: block;
  }

  
  .conversations-list-header .conversations-control-tab,
  .conversations-list-header .conversations-control-tab.btn.btn-outline {
    width: 44px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 12px;
    flex: 0 1 auto;
  }

  .conversations-list-header .conversations-control-tab-icon svg {
    width: 20px;
    height: 20px;
  }

  .conversations-list-header .conversations-control-tab.is-active,
  .conversations-list-header .conversations-control-tab.btn.btn-outline.is-active {
    background: color-mix(in srgb, var(--wa-green) 16%, var(--color-surface));
    color: var(--wa-green-dark);
  }

  
  .page-content--fullbleed .conversation-top-panel {
    width: 100%;
    border-left: 0;
    padding: 0 12px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  
  .conversation-top-panel .conversation-export-controls-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

/* >>> /static/css/pages/saas.css */
.saas-filter-grid {
  display: grid;
  
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-3);
}

.saas-pagination-row {
  margin-top: var(--space-3);
}

.saas-new-user-card { max-width: 720px; }
.saas-new-user-sub { margin: 2px 0 4px; }

.saas-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-3);
}
.saas-field-row > .field { margin-bottom: 0; }

.saas-form-actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
}

.saas-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.saas-module-grid-inline {
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  min-width: 0;
  gap: 10px;
}

.saas-module-item {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast),
    background var(--motion-fast);
}

.saas-module-item input {
  accent-color: var(--color-secondary);
  margin-top: 2px;
  flex-shrink: 0;
}

.saas-module-item:hover { border-color: var(--color-text-muted); }

.saas-module-item:has(input:checked) {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-secondary) 12%, transparent);
}

.saas-module-item:has(input:disabled) {
  cursor: default;
  background: var(--surface-subtle);
}
.saas-module-item:has(input:disabled):hover { border-color: var(--color-border); }

.saas-module-item-inline {
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--color-surface);
  align-items: center;
  line-height: 1.2;
}

.saas-module-item-inline input { margin-top: 0; }

.saas-module-item-inline:has(input:checked) {
  box-shadow: none;
  background: var(--surface-subtle);
}

.saas-module-item-inline input {
  margin: 0;
  flex-shrink: 0;
}

.saas-module-item-inline span {
  display: block;
}

.saas-module-item-inline input:disabled + span {
  color: var(--color-text-muted);
}

.saas-module-item small {
  color: var(--color-text-muted);
}

.saas-users-table {
  min-width: 1450px;
}

.saas-users-table th,
.saas-users-table td {
  vertical-align: top;
}

.saas-col-role,
.saas-role-cell {
  min-width: 170px;
}

.saas-role-select {
  min-width: 160px;
}

.saas-role-readonly {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--surface-subtle);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.saas-event-chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--surface-subtle);
  color: var(--color-text);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.saas-col-modules,
.saas-modules-cell {
  min-width: 360px;
}

.saas-modules-details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.saas-modules-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 8px 10px;
  cursor: pointer;
  color: var(--color-primary);
  font-weight: 600;
  list-style: none;
}

.saas-modules-summary::-webkit-details-marker {
  display: none;
}

.saas-modules-summary-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.saas-modules-summary-title::before {
  content: "▸";
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 1;
  transition: transform 120ms ease;
}

.saas-modules-details[open] .saas-modules-summary-title::before {
  transform: rotate(90deg);
}

.saas-modules-summary-count {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  background: var(--surface-subtle);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.saas-modules-panel {
  border-top: 1px solid var(--color-border);
  background: var(--surface-subtle);
  padding: 10px;
}

.saas-modules-readonly {
  display: inline-block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--surface-subtle);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

@media (max-width: 1400px) {
  .saas-module-grid-inline {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .saas-filter-grid {
    grid-template-columns: 1fr;
  }

  .saas-module-grid {
    grid-template-columns: 1fr;
  }

  .saas-col-role,
  .saas-role-cell,
  .saas-col-modules,
  .saas-modules-cell {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .saas-field-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* >>> /static/css/pages/account.css */
.account-security-card {
  max-width: 680px;
}

.account-security-form {
  margin-top: var(--space-4);
}

.account-security-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.account-security-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.account-security-show-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  
  margin-top: 10px;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.account-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 0;
  padding: 7px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--surface-subtle);
  font-size: var(--font-size-sm);
  color: var(--color-text);
}
.account-user-chip strong { font-weight: 650; }
.account-user-chip .account-user-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-success-text);
  flex: 0 0 auto;
}

.account-security-quick-actions { margin-top: 10px; }

/* >>> /static/css/pages/appearance.css */

.appearance-card {
  max-width: 980px;
}

.appearance-section-title {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.appearance-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-6, 24px) 0;
}

.appearance-actions {
  margin-top: var(--space-4, 16px);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--space-3, 12px);
  margin-top: var(--space-3, 12px);
}

.theme-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
  cursor: pointer;
  transition:
    border-color var(--motion-fast, 140ms) ease,
    box-shadow var(--motion-fast, 140ms) ease,
    transform var(--motion-fast, 140ms) ease;
}

.theme-option:hover {
  border-color: var(--color-text-muted);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.theme-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-option:has(input:checked) {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-secondary) 12%, transparent);
}

.theme-option:has(input:focus-visible) {
  outline: 2px solid var(--color-focus-ring, rgba(0, 74, 141, 0.35));
  outline-offset: 2px;
}

.theme-thumb {
  display: flex;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: var(--t-bg, #f5f7fa);
  overflow: hidden;
}

.theme-thumb-sidebar {
  flex: 0 0 26%;
  background: var(--t-primary, #1f2937);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px 5px;
}

.theme-thumb-sidebar span {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
}

.theme-thumb-sidebar span:first-child {
  background: var(--t-accent, #9ca3af);
}

.theme-thumb-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px 7px;
  min-width: 0;
}

.theme-thumb-topbar {
  height: 6px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--t-primary, #1f2937) 30%, var(--t-card, #ffffff));
}

.theme-thumb-card {
  flex: 1;
  border-radius: 4px;
  background: var(--t-card, #ffffff);
  border: 1px solid rgba(127, 127, 127, 0.25);
}

.theme-thumb-row {
  display: flex;
  gap: 5px;
  align-items: stretch;
  flex: 1;
}

.theme-thumb-card--small {
  flex: 1;
}

.theme-thumb-chip {
  flex: 0 0 34%;
  border-radius: 4px;
  background: var(--t-accent, #9ca3af);
}

.theme-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.theme-name {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.theme-inuse {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-success-text);
  background: var(--color-success-bg);
  border-radius: 999px;
  padding: 2px 8px;
}

.theme-inherit-from {
  font-weight: 600;
  font-size: 12px;
  color: var(--color-text-muted);
}

.theme-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: 1.35;
}

.theme-check {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-secondary);
  color: var(--color-btn-primary-text, #fff);
  font-size: 13px;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity var(--motion-fast, 140ms) ease, transform var(--motion-fast, 140ms) ease;
}

.theme-option:has(input:checked) .theme-check {
  opacity: 1;
  transform: scale(1);
}

.appearance-preview-note {
  margin-top: var(--space-3, 12px);
  font-weight: 600;
  color: var(--color-secondary);
}

@media (prefers-reduced-motion: reduce) {
  .theme-option,
  .theme-check {
    transition: none;
    transform: none;
  }
}

.theme-option--auto {
  border-style: dashed;
}

.theme-option--auto:has(input:checked) {
  border-style: solid;
}

.theme-auto-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
  background: rgba(10, 35, 66, 0.75);
  border-radius: 999px;
  padding: 3px 8px;
  backdrop-filter: blur(2px);
}

.theme-brand-pickers {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.theme-brand-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.theme-brand-picker input[type="color"] {
  width: 30px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.theme-custom-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(17, 24, 39, 0.78);
  border-radius: 999px;
  padding: 3px 8px;
  backdrop-filter: blur(2px);
}

/* >>> /static/css/tokens/themes/azul.css */

[data-theme="azul"] {
  --color-primary: #004A8D;
  --color-secondary: #F7941D;
  --color-accent: #FDC180;

  --color-bg: #F5F7FA;
  --color-surface: #FFFFFF;
  --color-text: #0A2F57;
  --color-text-muted: #496480;
  --color-border: #BDC9D8;

  --color-success-bg: #E9F7EF;
  --color-success-text: #1F7A44;
  --color-error-bg: #FDECEC;
  --color-error-text: #9A1F1F;
  --color-warning-bg: #FFF6E8;
  --color-warning-text: #8C4A00;

  --color-success-border: #BFE5CD;
  --color-error-border: #F2BBBB;
  --color-warning-border: #F8D3A8;
  --color-info-bg: #EAF2FD;
  --color-info-text: #1E40AF;
  --color-info-border: #BFDBFE;

  --gradient-brand: linear-gradient(135deg, #004A8D 0%, #0A6FB5 100%);
  --gradient-surface: linear-gradient(160deg, #ffffff 0%, #fff7ee 100%);
  --color-focus-ring: rgba(0, 74, 141, 0.35);

  --gradient-sidebar: linear-gradient(180deg, #0c4f95 0%, #0a447f 100%);
  --gradient-nav-active: linear-gradient(180deg, rgba(220, 138, 55, 0.88) 0%, rgba(197, 118, 40, 0.9) 100%);
  --gradient-auth: linear-gradient(135deg, #eef4fb 0%, #fff7ef 100%);
  --surface-tint: #fff8ef;        
  --surface-tint-strong: #fff3e3; 
  --surface-subtle: #fcfdff;
  --color-btn-primary-hover: #f18200;
  --color-btn-secondary-hover: #003a70;
  --color-btn-primary-text: #004A8D; 
  --sidebar-accent: #F7941D;

  
  --sidebar-text: #c9dcf2;
  --sidebar-subtext: #a8c4e4;
  --sidebar-icon: #9fc1e4;
  --sidebar-tooltip-bg: #0b2c52;
  --sidebar-badge-bg: #f7dfb8;
  --sidebar-badge-text: #0e3f75;

  
  --sidebar-section-atendimento: #7fc4e8;
  --sidebar-section-envio: #7ed3a4;
  --sidebar-section-cadastros: #ecc678;
  --sidebar-section-configuracoes: #a9bdd9;
}

/* >>> /static/css/tokens/themes/moderna.css */

[data-theme="moderna"] {
  
  --color-primary: #A78BFA;   
  --color-secondary: #7C3AED; 
  --color-accent: #38343F;    

  --color-bg: #18151E;        
  --color-surface: #221E2B;   
  --color-text: #E6E3EC;      
  --color-text-muted: #9D98A8;
  --color-border: #36303F;

  
  --color-success-bg: #16271D;
  --color-success-text: #4ADE80;
  --color-error-bg: #2A1518;
  --color-error-text: #F87171;
  --color-warning-bg: #2A2412;
  --color-warning-text: #FBBF24;
  --color-success-border: #1F4D33;
  --color-error-border: #5A2530;
  --color-warning-border: #5A4A1E;
  --color-info-bg: #1A2133;
  --color-info-text: #93B8FF;
  --color-info-border: #2C3A5A;

  
  --gradient-brand: linear-gradient(135deg, #6D28D9 0%, #9333EA 100%);
  --gradient-surface: linear-gradient(160deg, #221E2B 0%, #1B1825 100%);
  --color-focus-ring: rgba(167, 139, 250, 0.45);

  
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 16px 40px rgba(124, 58, 237, 0.22);

  
  --gradient-sidebar: linear-gradient(180deg, #221E2C 0%, #161520 100%);
  --gradient-nav-active: linear-gradient(180deg, rgba(167, 139, 250, 0.26) 0%, rgba(167, 139, 250, 0.15) 100%);
  --gradient-auth: linear-gradient(135deg, #1B1726 0%, #120F1A 100%);
  --surface-tint: #2C2735;        
  --surface-tint-strong: #322B44; 
  --surface-subtle: #1E1A28;
  --color-btn-primary-hover: #7C3AED;
  --color-btn-secondary-hover: #6D28D9;
}

[data-theme="moderna"] .alert-success { border-color: #1F4D33; }
[data-theme="moderna"] .alert-error { border-color: #5A2530; }
[data-theme="moderna"] .alert-warning { border-color: #5A4A1E; }

[data-theme="moderna"] .btn-primary {
  background: var(--gradient-brand);
  border: none;
  color: #fff;
}
[data-theme="moderna"] .btn-primary:hover {
  background: var(--gradient-brand);
  filter: brightness(1.1);
}

[data-theme="moderna"] .nav-link.active {
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.16);
}
[data-theme="moderna"] .nav-sublink.active {
  background: rgba(167, 139, 250, 0.18);
  border-color: rgba(167, 139, 250, 0.4);
}

[data-theme="moderna"] .nav-badge {
  background: rgba(167, 139, 250, 0.2);
  color: #E4DAFF;
  border-color: rgba(167, 139, 250, 0.35);
}

[data-theme="moderna"] .badge-active {
  background: rgba(74, 222, 128, 0.14);
  color: #4ADE80;
  border-color: rgba(74, 222, 128, 0.3);
}
[data-theme="moderna"] .badge-paused {
  background: rgba(251, 191, 36, 0.14);
  color: #FBBF24;
  border-color: rgba(251, 191, 36, 0.3);
}
[data-theme="moderna"] .badge-completed {
  background: rgba(167, 139, 250, 0.18);
  color: #C4B5FD;
  border-color: rgba(167, 139, 250, 0.34);
}
[data-theme="moderna"] .badge-draft {
  background: rgba(148, 163, 184, 0.14);
  color: #B6C0CE;
  border-color: rgba(148, 163, 184, 0.28);
}

[data-theme="moderna"] ::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
[data-theme="moderna"] ::-webkit-scrollbar-track {
  background: transparent;
}
[data-theme="moderna"] ::-webkit-scrollbar-thumb {
  background: #443D55;
  border: 3px solid var(--color-bg);
  border-radius: 999px;
}
[data-theme="moderna"] ::-webkit-scrollbar-thumb:hover {
  background: #544B68;
}
[data-theme="moderna"] {
  scrollbar-color: #443D55 transparent;
}

[data-theme="moderna"] h1,
[data-theme="moderna"] h2 {
  letter-spacing: -0.01em;
}

@media (prefers-reduced-motion: no-preference) {
  [data-theme="moderna"] body,
  [data-theme="moderna"] .card,
  [data-theme="moderna"] .btn {
    transition:
      background-color var(--motion-base) var(--motion-ease),
      border-color var(--motion-base) var(--motion-ease),
      color var(--motion-base) var(--motion-ease),
      box-shadow var(--motion-base) var(--motion-ease),
      transform var(--motion-fast) var(--motion-ease);
  }
  [data-theme="moderna"] .card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
}

/* >>> /static/css/tokens/themes/moderna2.css */

[data-theme="moderna2"] {
  
  --color-primary: #4DA3FF;   
  --color-secondary: #007ACC; 
  --color-accent: #37373D;    

  --color-bg: #1A1A1D;        
  --color-surface: #252526;   
  --color-text: #E4E4E7;      
  --color-text-muted: #9CA3AF;
  --color-border: #37373D;

  
  --color-success-bg: #16271D;
  --color-success-text: #4ADE80;
  --color-error-bg: #2A1518;
  --color-error-text: #F87171;
  --color-warning-bg: #2A2412;
  --color-warning-text: #FBBF24;
  --color-success-border: #1F4D33;
  --color-error-border: #5A2530;
  --color-warning-border: #5A4A1E;
  --color-info-bg: #14233A;
  --color-info-text: #7CC0FF;
  --color-info-border: #244066;

  
  --gradient-brand: linear-gradient(135deg, #0E639C 0%, #1177BB 100%);
  --gradient-surface: linear-gradient(160deg, #252526 0%, #1F1F22 100%);
  --color-focus-ring: rgba(77, 163, 255, 0.45);

  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 14px 36px rgba(0, 0, 0, 0.55);

  
  --gradient-sidebar: linear-gradient(180deg, #202023 0%, #161618 100%);
  --gradient-nav-active: linear-gradient(180deg, rgba(77, 163, 255, 0.24) 0%, rgba(77, 163, 255, 0.14) 100%);
  --gradient-auth: linear-gradient(135deg, #1B1B1F 0%, #101218 100%);
  --surface-tint: #2D2D31;        
  --surface-tint-strong: #28303E; 
  --surface-subtle: #202022;
  --color-btn-primary-hover: #1177BB;
  --color-btn-secondary-hover: #1C8AD6;
}

[data-theme="moderna2"] .alert-success { border-color: #1F4D33; }
[data-theme="moderna2"] .alert-error { border-color: #5A2530; }
[data-theme="moderna2"] .alert-warning { border-color: #5A4A1E; }

[data-theme="moderna2"] .btn-primary {
  background: #0E639C;
  color: #fff;
  border: none;
}

[data-theme="moderna2"] .nav-link.active {
  border-color: rgba(77, 163, 255, 0.4);
  box-shadow: 0 0 0 1px rgba(77, 163, 255, 0.15);
}
[data-theme="moderna2"] .nav-sublink.active {
  background: rgba(77, 163, 255, 0.16);
  border-color: rgba(77, 163, 255, 0.34);
}

[data-theme="moderna2"] .nav-badge {
  background: rgba(77, 163, 255, 0.2);
  color: #CFE6FF;
  border-color: rgba(77, 163, 255, 0.35);
}

[data-theme="moderna2"] .badge-active {
  background: rgba(74, 222, 128, 0.14);
  color: #4ADE80;
  border-color: rgba(74, 222, 128, 0.3);
}
[data-theme="moderna2"] .badge-paused {
  background: rgba(251, 191, 36, 0.14);
  color: #FBBF24;
  border-color: rgba(251, 191, 36, 0.3);
}
[data-theme="moderna2"] .badge-completed {
  background: rgba(77, 163, 255, 0.16);
  color: #7CC0FF;
  border-color: rgba(77, 163, 255, 0.32);
}
[data-theme="moderna2"] .badge-draft {
  background: rgba(148, 163, 184, 0.14);
  color: #B6C0CE;
  border-color: rgba(148, 163, 184, 0.28);
}

[data-theme="moderna2"] ::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
[data-theme="moderna2"] ::-webkit-scrollbar-track {
  background: transparent;
}
[data-theme="moderna2"] ::-webkit-scrollbar-thumb {
  background: #3C3C44;
  border: 3px solid var(--color-bg);
  border-radius: 999px;
}
[data-theme="moderna2"] ::-webkit-scrollbar-thumb:hover {
  background: #4A4A54;
}
[data-theme="moderna2"] {
  scrollbar-color: #3C3C44 transparent;
}

@media (prefers-reduced-motion: no-preference) {
  [data-theme="moderna2"] body,
  [data-theme="moderna2"] .card,
  [data-theme="moderna2"] .btn {
    transition:
      background-color var(--motion-base) var(--motion-ease),
      border-color var(--motion-base) var(--motion-ease),
      color var(--motion-base) var(--motion-ease),
      box-shadow var(--motion-base) var(--motion-ease),
      transform var(--motion-fast) var(--motion-ease);
  }
  [data-theme="moderna2"] .card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
}

/* >>> /static/css/tokens/themes/noir.css */

[data-theme="noir"] {
  --color-primary: #F472B6;   
  --color-secondary: #EC4899; 
  --color-accent: #3A3A42;    

  --color-bg: #0E0E11;        
  --color-surface: #1B1B20;   
  --color-text: #ECECF1;      
  --color-text-muted: #9B9BA8;
  --color-border: #2D2D35;

  
  --color-success-bg: #142A1E;
  --color-success-text: #4ADE80;
  --color-error-bg: #2E1418;
  --color-error-text: #F87171;
  --color-warning-bg: #2C2412;
  --color-warning-text: #FBBF24;
  --color-success-border: #1F4D33;
  --color-error-border: #5A2530;
  --color-warning-border: #5A4A1E;
  --color-info-bg: #251a2e;
  --color-info-text: #E9A8FF;
  --color-info-border: #4A2D5E;

  
  --gradient-brand: linear-gradient(135deg, #DB2777 0%, #EC4899 100%);
  --gradient-surface: linear-gradient(160deg, #1B1B20 0%, #16161A 100%);
  --color-focus-ring: rgba(236, 72, 153, 0.45);

  
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 14px 36px rgba(0, 0, 0, 0.6), 0 0 24px rgba(236, 72, 153, 0.07);

  
  --gradient-sidebar: linear-gradient(180deg, #17171B 0%, #101013 100%);
  --gradient-nav-active: linear-gradient(180deg, rgba(236, 72, 153, 0.26) 0%, rgba(236, 72, 153, 0.15) 100%);
  --gradient-auth: linear-gradient(135deg, #141417 0%, #1C0F18 100%);
  --surface-tint: #232329;        
  --surface-tint-strong: #2E2129; 
  --surface-subtle: #18181C;
  --color-btn-primary-hover: #DB2777;
  --color-btn-secondary-hover: #F472B6;
}

[data-theme="noir"] .alert-success { border-color: #1F4D33; }
[data-theme="noir"] .alert-error { border-color: #5A2530; }
[data-theme="noir"] .alert-warning { border-color: #5A4A1E; }

[data-theme="noir"] .btn-primary {
  background: #EC4899;
  color: #fff;
  border: none;
}

[data-theme="noir"] .nav-link.active {
  background: rgba(236, 72, 153, 0.18);
}
[data-theme="noir"] .nav-link.active::before {
  background: #EC4899;
}
[data-theme="noir"] .nav-link.active .nav-icon {
  color: #F472B6;
}
[data-theme="noir"] .nav-sublink.active {
  background: rgba(236, 72, 153, 0.16);
  color: #F9A8D4;
}

[data-theme="noir"] .nav-badge {
  background: rgba(236, 72, 153, 0.2);
  color: #FBCFE8;
  border-color: rgba(236, 72, 153, 0.35);
}

[data-theme="noir"] .badge-active {
  background: rgba(74, 222, 128, 0.14);
  color: #4ADE80;
  border-color: rgba(74, 222, 128, 0.3);
}
[data-theme="noir"] .badge-paused {
  background: rgba(251, 191, 36, 0.14);
  color: #FBBF24;
  border-color: rgba(251, 191, 36, 0.3);
}
[data-theme="noir"] .badge-completed {
  background: rgba(236, 72, 153, 0.16);
  color: #F9A8D4;
  border-color: rgba(236, 72, 153, 0.32);
}
[data-theme="noir"] .badge-draft {
  background: rgba(148, 163, 184, 0.14);
  color: #B6C0CE;
  border-color: rgba(148, 163, 184, 0.28);
}

[data-theme="noir"] {
  --chat-bg: #131316;
  --chat-bubble-in: #1F1F25;
  --chat-bubble-out: #311B27;
  --chat-bubble-out-border: rgba(236, 72, 153, 0.35);
  --chat-pane-border: #2D2D35;
  --wa-green: #EC4899;
  --wa-green-dark: #DB2777;
}

[data-theme="noir"] ::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
[data-theme="noir"] ::-webkit-scrollbar-track {
  background: transparent;
}
[data-theme="noir"] ::-webkit-scrollbar-thumb {
  background: #34343C;
  border: 3px solid var(--color-bg);
  border-radius: 999px;
}
[data-theme="noir"] ::-webkit-scrollbar-thumb:hover {
  background: #45454F;
}
[data-theme="noir"] {
  scrollbar-color: #34343C transparent;
}

@media (prefers-reduced-motion: no-preference) {
  [data-theme="noir"] body,
  [data-theme="noir"] .card,
  [data-theme="noir"] .btn {
    transition:
      background-color var(--motion-base) var(--motion-ease),
      border-color var(--motion-base) var(--motion-ease),
      color var(--motion-base) var(--motion-ease),
      box-shadow var(--motion-base) var(--motion-ease),
      transform var(--motion-fast) var(--motion-ease);
  }
  [data-theme="noir"] .card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
}

/* >>> /static/css/tokens/themes/marca.css */

[data-theme="marca"] {
  --color-primary: var(--brand-primary, #1F2937);
  --color-secondary: var(--brand-accent, #9CA3AF);
  --color-accent: color-mix(in srgb, var(--brand-accent, #9CA3AF) 45%, #ffffff);

  --color-bg: color-mix(in srgb, var(--brand-primary, #1F2937) 5%, #f8f9fb);
  --color-surface: #FFFFFF;
  --color-text: color-mix(in srgb, var(--brand-primary, #1F2937) 70%, #16202c);
  --color-text-muted: color-mix(in srgb, var(--brand-primary, #1F2937) 36%, #66707d);
  --color-border: color-mix(in srgb, var(--brand-primary, #1F2937) 16%, #d4dbe3);

  
  --gradient-brand: linear-gradient(
    135deg,
    var(--brand-primary, #1F2937) 0%,
    color-mix(in srgb, var(--brand-primary, #1F2937) 70%, #4B5563) 100%
  );
  --gradient-surface: linear-gradient(
    160deg,
    #ffffff 0%,
    color-mix(in srgb, var(--brand-accent, #9CA3AF) 6%, #ffffff) 100%
  );
  --color-focus-ring: color-mix(in srgb, var(--brand-primary, #1F2937) 35%, transparent);

  
  --gradient-sidebar: linear-gradient(
    180deg,
    color-mix(in srgb, var(--brand-primary, #1F2937) 92%, #ffffff) 0%,
    color-mix(in srgb, var(--brand-primary, #1F2937) 82%, #000000) 100%
  );
  --gradient-nav-active: linear-gradient(
    180deg,
    color-mix(in srgb, var(--brand-accent, #9CA3AF) 88%, #000000) 0%,
    color-mix(in srgb, var(--brand-accent, #9CA3AF) 72%, #000000) 100%
  );
  --gradient-auth: linear-gradient(
    135deg,
    color-mix(in srgb, var(--brand-primary, #1F2937) 8%, #ffffff) 0%,
    color-mix(in srgb, var(--brand-accent, #9CA3AF) 8%, #ffffff) 100%
  );
  --surface-tint: color-mix(in srgb, var(--brand-accent, #9CA3AF) 8%, #ffffff);
  --surface-tint-strong: color-mix(in srgb, var(--brand-accent, #9CA3AF) 16%, #ffffff);
  --surface-subtle: color-mix(in srgb, var(--brand-primary, #1F2937) 3%, #ffffff);
  
  --color-btn-primary-hover: color-mix(in srgb, var(--brand-accent, #9CA3AF) 78%, #000000);
  --color-btn-secondary-hover: color-mix(in srgb, var(--brand-accent, #9CA3AF) 82%, #000000);
  --color-btn-primary-text: var(--brand-primary, #1F2937);
}

[data-theme="marca"] .nav-link.active {
  background: color-mix(in srgb, var(--brand-accent, #9CA3AF) 18%, transparent);
}
[data-theme="marca"] .nav-link.active::before {
  background: var(--brand-accent, #9CA3AF);
}
[data-theme="marca"] .nav-link.active .nav-icon {
  color: color-mix(in srgb, var(--brand-accent, #9CA3AF) 80%, #ffffff);
}
[data-theme="marca"] .nav-sublink.active {
  background: color-mix(in srgb, var(--brand-accent, #9CA3AF) 14%, transparent);
  color: #fff;
}
