/* Aroeira Labs Design System — shared component classes
   Plain CSS (no Tailwind, no CSS-in-JS) consumed by the React primitives
   in components/. Mirrors the class names/behavior of the source shadcn/ui
   kit but reimplemented without Radix so components are dependency-free. */

* { box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; font-family: var(--font-sans); }

/* ---------- Button ---------- */
.al-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans);
  font-weight: var(--font-weight-medium);
  font-size: var(--text-body-size);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease;
  height: 36px; padding: 0 16px;
}
.al-btn:disabled { opacity: .5; cursor: not-allowed; }
.al-btn-default { background: var(--primary); color: var(--primary-foreground); }
.al-btn-default:hover:not(:disabled) { background: var(--primary-hover); }
.al-btn-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.al-btn-secondary:hover:not(:disabled) { background: var(--al-gray-200); }
.al-btn-outline { background: var(--background); color: var(--foreground); border-color: var(--border); }
.al-btn-outline:hover:not(:disabled) { background: var(--accent); color: var(--accent-foreground); }
.al-btn-ghost { background: transparent; color: var(--foreground); }
.al-btn-ghost:hover:not(:disabled) { background: var(--accent); color: var(--accent-foreground); }
.al-btn-link { background: transparent; color: var(--primary); height: auto; padding: 0; text-decoration: none; }
.al-btn-link:hover:not(:disabled) { text-decoration: underline; }
.al-btn-destructive { background: var(--destructive); color: var(--destructive-foreground); }
.al-btn-destructive:hover:not(:disabled) { opacity: .9; }
.al-btn-sm { height: 32px; padding: 0 12px; font-size: var(--text-small-size); gap: 6px; }
.al-btn-lg { height: 40px; padding: 0 24px; }
.al-btn-icon { height: 36px; width: 36px; padding: 0; }

/* ---------- Input / Textarea ---------- */
.al-input, .al-textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: var(--text-small-size);
  background: var(--background);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--foreground);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.al-input { height: 40px; }
.al-textarea { min-height: 64px; resize: none; }
.al-input::placeholder, .al-textarea::placeholder { color: var(--muted-foreground); }
.al-input:hover:not(:disabled), .al-textarea:hover:not(:disabled) { border-color: rgba(80,48,229,.3); }
.al-input:focus, .al-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(80,48,229,.2); }
.al-input:disabled, .al-textarea:disabled { background: var(--secondary); color: var(--muted-foreground); cursor: not-allowed; }
.al-input-icon-wrap { position: relative; display: flex; align-items: center; }
.al-input-icon-wrap .al-input { padding-left: 40px; }
.al-input-icon-wrap svg { position: absolute; left: 12px; color: var(--muted-foreground); pointer-events: none; }

/* ---------- Label ---------- */
.al-label {
  font-size: var(--text-small-size);
  font-weight: var(--font-weight-medium);
  color: var(--foreground);
  display: inline-flex; align-items: center; gap: 4px;
}
.al-label .req { color: var(--destructive); }

/* ---------- Select ---------- */
.al-select-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; height: 40px; padding: 8px 12px;
  background: var(--input-background); border: 1px solid var(--border); border-radius: var(--radius-md);
  font-size: var(--text-small-size); color: var(--foreground); cursor: pointer;
}
.al-select-trigger[data-placeholder="true"] { color: var(--muted-foreground); }
.al-select-trigger svg { color: var(--muted-foreground); flex-shrink: 0; }
.al-select-popover {
  position: absolute; z-index: 50; margin-top: 4px; min-width: 100%;
  background: var(--popover); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); padding: 4px; max-height: 240px; overflow: auto;
}
.al-select-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm);
  font-size: var(--text-small-size); cursor: pointer; color: var(--foreground);
}
.al-select-item:hover, .al-select-item[data-active="true"] { background: var(--accent); color: var(--accent-foreground); }
.al-select-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ---------- Checkbox / Radio ---------- */
.al-checkbox {
  appearance: none; width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--border);
  background: var(--input-background); cursor: pointer; position: relative; flex-shrink: 0;
}
.al-checkbox:checked { background: var(--primary); border-color: var(--primary); }
.al-checkbox:checked::after {
  content: ''; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px;
  border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.al-checkbox:disabled { opacity: .5; cursor: not-allowed; }

.al-radio {
  appearance: none; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--background); cursor: pointer; position: relative; flex-shrink: 0;
}
.al-radio:checked { border-color: var(--primary); }
.al-radio:checked::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px;
  background: var(--primary); border-radius: 50%; transform: translate(-50%,-50%);
}
.al-radio:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Switch ---------- */
.al-switch {
  appearance: none; width: 32px; height: 18px; border-radius: var(--radius-full);
  background: var(--switch-background); border: none; cursor: pointer; position: relative; transition: background .15s ease; flex-shrink: 0;
}
.al-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--background); transition: transform .15s ease; box-shadow: var(--shadow-sm);
}
.al-switch:checked { background: var(--primary); }
.al-switch:checked::after { transform: translateX(14px); }
.al-switch:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Slider ---------- */
.al-slider { width: 100%; height: 16px; display: flex; align-items: center; }
.al-slider input[type="range"] {
  -webkit-appearance: none; width: 100%; height: 4px; border-radius: var(--radius-full);
  background: var(--muted); outline: none;
}
.al-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--background); border: 1px solid var(--primary); box-shadow: var(--shadow-sm); cursor: pointer;
}

/* ---------- Badge ---------- */
.al-badge {
  display: inline-flex; align-items: center; gap: 4px; border-radius: var(--radius-md);
  padding: 2px 8px; font-size: var(--text-xs-size); font-weight: var(--font-weight-medium);
  border: 1px solid transparent; white-space: nowrap;
}
.al-badge-default { background: var(--primary); color: var(--primary-foreground); }
.al-badge-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.al-badge-outline { background: transparent; color: var(--foreground); border-color: var(--border); }
.al-badge-destructive { background: var(--al-red-700); color: var(--destructive-foreground); }
.al-badge-info { background: var(--al-blue-700); color: #fff; }
.al-badge-success { background: var(--al-green-700); color: #fff; }
.al-badge-warning { background: var(--status-warning); color: var(--foreground); }
.al-badge-error { background: var(--al-red-700); color: #fff; }
.al-badge-progress { background: var(--status-progress); color: #fff; }
.al-badge-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- Alert ---------- */
.al-alert { border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 12px 16px; display: flex; gap: 12px; background: var(--card); }
.al-alert svg { flex-shrink: 0; margin-top: 2px; }
.al-alert-title { font-weight: var(--font-weight-medium); font-size: var(--text-small-size); margin-bottom: 2px; }
.al-alert-desc { font-size: var(--text-small-size); color: var(--muted-foreground); }
.al-alert-accent { background: var(--accent); border-color: rgba(80,48,229,.2); }
.al-alert-destructive { border-color: rgba(212,24,61,.3); }
.al-alert-destructive .al-alert-title { color: var(--destructive); }
.al-alert-destructive svg { color: var(--destructive); }

/* ---------- Progress ---------- */
.al-progress { height: 8px; width: 100%; border-radius: var(--radius-full); background: rgba(80,48,229,.15); overflow: hidden; }
.al-progress-bar { height: 100%; background: var(--primary); border-radius: var(--radius-full); transition: width .2s ease; }
.al-progress-bar.success { background: var(--status-success); }

/* ---------- Skeleton ---------- */
.al-skeleton { background: var(--accent); border-radius: var(--radius-md); animation: al-pulse 1.6s ease-in-out infinite; }
@keyframes al-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

/* ---------- Tooltip ---------- */
.al-tooltip-wrap { position: relative; display: inline-flex; }
.al-tooltip-bubble {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--primary); color: var(--primary-foreground); font-size: var(--text-xs-size);
  padding: 6px 10px; border-radius: var(--radius-sm); white-space: nowrap; box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none; transition: opacity .12s ease; z-index: 50;
}
.al-tooltip-wrap:hover .al-tooltip-bubble, .al-tooltip-wrap:focus-within .al-tooltip-bubble { opacity: 1; }

/* ---------- Toast ---------- */
.al-toast-stack { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.al-toast {
  background: var(--popover); color: var(--popover-foreground); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px 16px; box-shadow: var(--shadow-lg); min-width: 280px;
  font-size: var(--text-small-size); display: flex; align-items: flex-start; gap: 8px;
  animation: al-toast-in .2s ease;
}
@keyframes al-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Tabs ---------- */
.al-tabs-list { display: inline-flex; background: var(--muted); border-radius: var(--radius-xl); padding: 3px; gap: 2px; }
.al-tabs-trigger {
  border: none; background: transparent; color: var(--foreground); font-size: var(--text-small-size);
  font-weight: var(--font-weight-medium); padding: 6px 14px; border-radius: var(--radius-lg); cursor: pointer;
  transition: background .15s ease;
}
.al-tabs-trigger[data-state="active"] { background: var(--card); box-shadow: var(--shadow-sm); }
.al-tabs-content { padding-top: 8px; }

/* ---------- Accordion ---------- */
.al-accordion-item { border-bottom: 1px solid var(--border); }
.al-accordion-item:last-child { border-bottom: none; }
.al-accordion-trigger {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: none; border: none; padding: 16px 0; font-size: var(--text-small-size); font-weight: var(--font-weight-medium);
  text-align: left; cursor: pointer; color: var(--foreground);
}
.al-accordion-trigger svg { transition: transform .2s ease; color: var(--muted-foreground); flex-shrink: 0; }
.al-accordion-trigger[data-state="open"] svg { transform: rotate(180deg); }
.al-accordion-content { padding-bottom: 16px; font-size: var(--text-small-size); color: var(--muted-foreground); }

/* ---------- Breadcrumb ---------- */
.al-breadcrumb-list { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; font-size: var(--text-small-size); color: var(--muted-foreground); flex-wrap: wrap; }
.al-breadcrumb-item { display: inline-flex; align-items: center; gap: 6px; }
.al-breadcrumb-link { color: inherit; text-decoration: none; }
.al-breadcrumb-link:hover { color: var(--foreground); }
.al-breadcrumb-page { color: var(--foreground); }
.al-breadcrumb-list svg { width: 14px; height: 14px; }

/* ---------- Pagination ---------- */
.al-pagination { display: flex; align-items: center; gap: 4px; }
.al-page-btn {
  height: 36px; min-width: 36px; padding: 0 10px; border-radius: var(--radius-md); border: 1px solid transparent;
  background: transparent; color: var(--foreground); font-size: var(--text-small-size); cursor: pointer;
}
.al-page-btn:hover { background: var(--accent); }
.al-page-btn[data-active="true"] { border-color: var(--border); }

/* ---------- Card ---------- */
.al-card { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radius-xl); display: flex; flex-direction: column; }
.al-card-accent { border-left: 4px solid var(--primary); }
.al-card-header { display: flex; flex-direction: column; gap: 4px; padding: 24px 24px 0; }
.al-card-title { font-size: var(--text-h4-size); font-weight: var(--font-weight-semibold); line-height: 1.3; }
.al-card-desc { font-size: var(--text-small-size); color: var(--muted-foreground); }
.al-card-content { padding: 24px; }
.al-card-content:first-child { padding-top: 24px; }
.al-card-footer { display: flex; align-items: center; padding: 0 24px 24px; gap: 12px; }
.al-card-shadow-sm { box-shadow: var(--shadow-sm); }
.al-card-shadow-md { box-shadow: var(--shadow-md); }
.al-card:hover.al-card-hoverable { box-shadow: var(--shadow-md); transition: box-shadow .15s ease; }

/* ---------- Avatar ---------- */
.al-avatar { position: relative; display: flex; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--muted); }
.al-avatar img { width: 100%; height: 100%; object-fit: cover; }
.al-avatar-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: var(--text-xs-size); color: var(--foreground); background: var(--muted); }

/* ---------- Table ---------- */
.al-table-wrap { width: 100%; overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.al-table { width: 100%; border-collapse: collapse; font-size: var(--text-small-size); }
.al-table thead tr { background: var(--muted); }
.al-table th { text-align: left; padding: 10px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); white-space: nowrap; }
.al-table td { padding: 12px 16px; border-top: 1px solid var(--border); color: var(--foreground); }
.al-table tbody tr:first-child td { border-top: none; }
.al-table tbody tr:hover { background: var(--muted); }

/* ---------- Separator ---------- */
.al-separator { background: var(--border); border: none; flex-shrink: 0; }
.al-separator-h { height: 1px; width: 100%; margin: 0; }
.al-separator-v { width: 1px; height: 100%; }

/* ---------- Dialog / Sheet overlay ---------- */
.al-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 50; animation: al-fade-in .15s ease; }
@keyframes al-fade-in { from { opacity: 0; } to { opacity: 1; } }
.al-dialog {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 51;
  background: var(--background); border-radius: var(--radius-lg); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); padding: 24px; width: 100%; max-width: 32rem; max-height: calc(100vh - 2rem); overflow: auto;
}
.al-dialog-header { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.al-dialog-title { font-size: var(--text-h4-size); font-weight: var(--font-weight-semibold); }
.al-dialog-desc { font-size: var(--text-small-size); color: var(--muted-foreground); }
.al-dialog-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.al-dialog-close {
  position: absolute; top: 16px; right: 16px; background: none; border: none; cursor: pointer;
  color: var(--muted-foreground); padding: 4px; border-radius: var(--radius-sm); opacity: .7;
}
.al-dialog-close:hover { opacity: 1; background: var(--accent); }

.al-sheet {
  position: fixed; top: 0; right: 0; height: 100%; width: 100%; max-width: 24rem;
  background: var(--background); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  z-index: 51; padding: 24px; overflow: auto; animation: al-slide-in .2s ease;
}
@keyframes al-slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* ---------- Popover / Dropdown ---------- */
.al-popover-anchor { position: relative; display: inline-flex; }
.al-popover {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 50; background: var(--popover);
  border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 16px; width: 288px;
}
.al-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 50; background: var(--popover);
  border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 4px; min-width: 180px;
}
.al-dropdown-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm);
  font-size: var(--text-small-size); cursor: pointer; color: var(--foreground);
}
.al-dropdown-item:hover { background: var(--accent); color: var(--accent-foreground); }
.al-dropdown-item.destructive { color: var(--destructive); }
.al-dropdown-item.destructive:hover { background: rgba(212,24,61,.08); }
.al-dropdown-sep { height: 1px; background: var(--border); margin: 4px -4px; }
.al-dropdown-label { padding: 6px 8px; font-size: var(--text-xs-size); font-weight: var(--font-weight-medium); color: var(--muted-foreground); }

/* ---------- Tema Cidadão — leve + mobile-first ----------
   Diferenças reais de peso visual (não só cor): alvos de toque maiores,
   botões em pílula, sombras mais suaves, respiro maior — para não parecer
   o mesmo DS de Gestão só repintado. */
[data-theme="cidadao"] .al-btn { height: 48px; padding: 0 20px; border-radius: var(--radius-full); font-size: 16px; }
[data-theme="cidadao"] .al-btn-sm { height: 40px; padding: 0 16px; border-radius: var(--radius-full); }
[data-theme="cidadao"] .al-btn-lg { height: 56px; padding: 0 28px; border-radius: var(--radius-full); }
[data-theme="cidadao"] .al-btn-icon { height: 48px; width: 48px; border-radius: var(--radius-full); }
[data-theme="cidadao"] .al-input, [data-theme="cidadao"] .al-select-trigger { height: 48px; border-radius: var(--radius-lg); border-width: 1.5px; font-size: 16px; }
[data-theme="cidadao"] .al-textarea { border-radius: var(--radius-lg); border-width: 1.5px; font-size: 16px; }
[data-theme="cidadao"] .al-checkbox, [data-theme="cidadao"] .al-radio { width: 22px; height: 22px; }
[data-theme="cidadao"] .al-switch { width: 44px; height: 26px; }
[data-theme="cidadao"] .al-switch::after { width: 20px; height: 20px; }
[data-theme="cidadao"] .al-card { border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); border-width: 1px; }
[data-theme="cidadao"] .al-card-header, [data-theme="cidadao"] .al-card-content { padding: 20px; }
[data-theme="cidadao"] .al-page-btn { height: 44px; min-width: 44px; border-radius: var(--radius-full); }
[data-theme="cidadao"] .al-card-title, [data-theme="cidadao"] .al-dialog-title, [data-theme="cidadao"] .al-empty-title, [data-theme="cidadao"] h1, [data-theme="cidadao"] h2, [data-theme="cidadao"] h3 { font-family: var(--font-display); letter-spacing: -0.01em; }

/* ---------- Bottom Nav (mobile tab bar — Cidadão) ---------- */
.al-bottomnav { display: none; }
.al-mobile-shell { container-type: inline-size; container-name: al-mobile-shell; position: relative; }
[data-theme="cidadao"] .al-bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; background: var(--card); border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-md);
}
[data-theme="cidadao"] .al-bottomnav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; padding: 4px 2px; background: none; border: none; cursor: pointer;
  color: var(--muted-foreground); font-family: var(--font-sans); font-size: 11px; border-radius: var(--radius-md);
}
[data-theme="cidadao"] .al-bottomnav-icon { display: flex; width: 24px; height: 24px; align-items: center; justify-content: center; }
[data-theme="cidadao"] .al-bottomnav-item[data-active="true"] { color: var(--primary); }
[data-theme="cidadao"] .al-bottomnav-item[data-active="true"] .al-bottomnav-label { font-weight: 600; }
@container al-mobile-shell (min-width: 768px) { [data-theme="cidadao"] .al-bottomnav { display: none; } }
/* Fallback when BottomNav isn't wrapped in .al-mobile-shell: fall back to viewport width */
@media (min-width: 768px) { [data-theme="cidadao"] .al-bottomnav:not(.al-mobile-shell .al-bottomnav) { display: none; } }

/* ---------- Mobile Drawer (hamburger nav — Cidadão default) ---------- */
.al-drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; }
.al-drawer { position: fixed; top: 0; left: 0; bottom: 0; width: 284px; background: var(--card); z-index: 50; display: flex; flex-direction: column; box-shadow: 6px 0 28px rgba(0,0,0,.18); }
.al-drawer-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: flex-end; }
.al-drawer-close, .al-drawer-trigger { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); background: var(--muted); border: none; cursor: pointer; color: var(--foreground); }
[data-theme="cidadao"] .al-drawer-trigger { background: rgba(255,255,255,.18); color: #fff; }
.al-drawer-nav { flex: 1; padding: 8px; overflow-y: auto; }
.al-drawer-item { width: 100%; padding: 12px 14px; display: flex; align-items: center; gap: 12px; border-radius: var(--radius-md); background: transparent; border: none; cursor: pointer; min-height: 52px; text-align: left; font-family: var(--font-sans); font-size: 14px; font-weight: 500; color: var(--foreground); }
.al-drawer-item:hover { background: var(--muted); }
.al-drawer-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--primary); }
.al-drawer-footer { padding: 12px 16px; border-top: 1px solid var(--border); }

/* ---------- Sigilo Banner (confidentiality notice — Cidadão) ---------- */
.al-sigilo-banner { background: var(--secondary); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 16px; display: flex; gap: 10px; align-items: flex-start; }
.al-sigilo-banner.compact { padding: 8px 12px; border-radius: var(--radius-sm); }
.al-sigilo-banner svg { flex-shrink: 0; margin-top: 2px; color: var(--secondary-foreground); }
.al-sigilo-banner p { font-size: 12px; line-height: 1.5; color: var(--secondary-foreground); font-family: var(--font-sans); margin: 0; }
.al-sigilo-banner.compact p { font-size: 11.5px; }

/* ---------- Contact Channel List (canais de atendimento — Cidadão) ---------- */
.al-channel-list { display: flex; flex-direction: column; gap: 10px; }
.al-channel-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--card); }
.al-channel-item[data-highlight="true"] { border: 2px solid var(--primary); background: var(--accent); }
.al-channel-icon { width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--accent); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.al-channel-item[data-highlight="true"] .al-channel-icon { background: var(--primary); color: var(--primary-foreground); }
.al-channel-body { flex: 1; min-width: 0; }
.al-channel-title { font-size: 13px; font-weight: 700; color: var(--foreground); font-family: var(--font-sans); margin: 0; }
.al-channel-item[data-highlight="true"] .al-channel-title { color: var(--primary); }
.al-channel-desc { font-size: 12px; color: var(--muted-foreground); font-family: var(--font-sans); margin: 0; word-break: break-word; }
.al-channel-action { font-size: 12px; font-weight: 600; color: var(--primary); border: 1.5px solid var(--primary); border-radius: var(--radius-md); padding: 8px 12px; min-height: 44px; display: flex; align-items: center; text-decoration: none; white-space: nowrap; flex-shrink: 0; }

/* ---------- Kanban (manifestação triage board — Gestão) ---------- */
.al-kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.al-kanban-col { flex: 0 0 240px; background: var(--muted); border-radius: var(--radius-lg); padding: 10px; }
.al-kanban-col-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; color: var(--foreground); font-family: var(--font-sans); padding: 4px 6px 10px; }
.al-kanban-count { background: var(--border); color: var(--muted-foreground); border-radius: var(--radius-full); padding: 1px 8px; font-size: 11px; }
.al-kanban-col-body { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.al-kanban-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; box-shadow: var(--shadow-sm); }
.al-kanban-card-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); margin-bottom: 6px; }
.al-kanban-card-title { font-size: 12.5px; font-weight: 700; color: var(--foreground); font-family: var(--font-sans); margin: 0; }
.al-kanban-card-subtitle { font-size: 11.5px; color: var(--muted-foreground); font-family: var(--font-sans); margin: 2px 0 0; }

/* Card variety — menos monotonia visual */
[data-theme="cidadao"] .al-card-flat { border: none; box-shadow: none; background: transparent; }
[data-theme="cidadao"] .al-card-tinted { border: none; background: var(--accent); box-shadow: none; }
[data-theme="cidadao"] .al-card-tinted-aroeira { border: none; background: var(--cidadao-aroeira-subtle); box-shadow: none; }

/* ---------- Status Timeline (acompanhamento de protocolo) ---------- */
.al-timeline { display: flex; flex-direction: column; }
.al-timeline-item { display: flex; gap: 14px; position: relative; }
.al-timeline-item:not(:last-child) { padding-bottom: 24px; }
.al-timeline-rail { display: flex; flex-direction: column; align-items: center; }
.al-timeline-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--muted); color: var(--muted-foreground); border: 2px solid var(--border); }
.al-timeline-item[data-status="done"] .al-timeline-dot { background: var(--cidadao-aroeira, var(--status-success)); border-color: var(--cidadao-aroeira, var(--status-success)); color: #fff; }
.al-timeline-item[data-status="current"] .al-timeline-dot { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 4px var(--tenant-brand-subtle, var(--accent)); }
.al-timeline-line { width: 2px; flex: 1; background: var(--border); margin: 2px 0; }
.al-timeline-item[data-status="done"] .al-timeline-line { background: var(--cidadao-aroeira, var(--status-success)); }
.al-timeline-body { padding-top: 2px; }
.al-timeline-title { font-size: var(--text-small-size); font-weight: var(--font-weight-semibold); color: var(--foreground); }
.al-timeline-item[data-status="pending"] .al-timeline-title { color: var(--muted-foreground); font-weight: var(--font-weight-medium); }
.al-timeline-date { font-size: var(--text-xs-size); color: var(--muted-foreground); margin-top: 2px; }
.al-timeline-desc { font-size: var(--text-small-size); color: var(--muted-foreground); margin-top: 4px; line-height: 1.5; }

/* ---------- Steps (wizard de formulário em etapas) ---------- */
.al-steps { display: flex; align-items: center; width: 100%; }
.al-step { display: flex; align-items: center; gap: 10px; flex: 1; }
.al-step:last-child { flex: 0 0 auto; }
.al-step-circle { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: var(--font-weight-semibold); background: var(--muted); color: var(--muted-foreground); border: 2px solid var(--border); transition: all .2s ease; }
.al-step[data-status="done"] .al-step-circle { background: var(--cidadao-aroeira, var(--status-success)); border-color: var(--cidadao-aroeira, var(--status-success)); color: #fff; }
.al-step[data-status="current"] .al-step-circle { background: var(--primary); border-color: var(--primary); color: #fff; }
.al-step-label { font-size: 13px; font-weight: var(--font-weight-medium); color: var(--muted-foreground); white-space: nowrap; }
.al-step[data-status="current"] .al-step-label, .al-step[data-status="done"] .al-step-label { color: var(--foreground); }
.al-step-connector { flex: 1; height: 2px; background: var(--border); margin: 0 8px; }
.al-step-connector[data-filled="true"] { background: var(--cidadao-aroeira, var(--status-success)); }
@media (max-width: 640px) { .al-step-label { display: none; } }

/* ---------- Accessibility bar ---------- */
.al-a11y-bar { display: flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-full); padding: 6px; box-shadow: var(--shadow-sm); }
.al-a11y-btn { height: 36px; min-width: 36px; padding: 0 10px; border-radius: var(--radius-full); border: none; background: transparent; color: var(--foreground); font-size: 13px; font-weight: var(--font-weight-semibold); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s ease; }
.al-a11y-btn:hover { background: var(--accent); color: var(--accent-foreground); }
.al-a11y-btn[data-active="true"] { background: var(--primary); color: #fff; }
.al-a11y-sep { width: 1px; height: 20px; background: var(--border); }
[data-a11y-contrast="true"] { --background: #000000; --foreground: #ffffff; --card: #0d0d0d; --card-foreground: #ffffff; --muted: #1a1a1a; --muted-foreground: #d0d0d0; --border: #555555; --primary: #ffe600; --primary-foreground: #000000; }
[data-a11y-fontscale="lg"] { font-size: 112.5%; }
[data-a11y-fontscale="xl"] { font-size: 125%; }

/* ---------- Success check (feedback expressivo) ---------- */
.al-success-check { display: flex; align-items: center; justify-content: center; }
.al-success-check circle { stroke: var(--status-success); stroke-width: 2; fill: none; stroke-dasharray: 76; stroke-dashoffset: 76; animation: al-success-ring .5s ease forwards; }
.al-success-check path { stroke: var(--status-success); stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; animation: al-success-check .3s ease .45s forwards; }
@keyframes al-success-ring { to { stroke-dashoffset: 0; } }
@keyframes al-success-check { to { stroke-dashoffset: 0; } }

/* Mobile breakpoint — empilha grids/painéis e garante alvos de toque ≥44px em qualquer tema */
@media (max-width: 640px) {
  .al-card-header, .al-card-content { padding: 16px; }
  .al-tabs-list { width: 100%; }
  .al-tabs-trigger { flex: 1; text-align: center; }
  .al-toast { min-width: 0; width: calc(100vw - 32px); }
  [data-theme="cidadao"] .al-btn { width: 100%; }
  [data-theme="cidadao"] .al-btn-icon { width: 48px; }
}

/* ---------- Empty state ---------- */
.al-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 48px 24px; }
.al-empty-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--muted); display: flex; align-items: center; justify-content: center; color: var(--muted-foreground); margin-bottom: 8px; }
.al-empty-title { font-size: var(--text-h4-size); font-weight: var(--font-weight-semibold); color: var(--foreground); margin-top: 4px; }
.al-empty-desc { font-size: var(--text-small-size); color: var(--muted-foreground); max-width: 360px; line-height: 1.5; }
.al-empty-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }

/* ---------- Illustration slot ---------- */
.al-illustration { position: relative; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-xl); background: var(--accent); border: 1.5px dashed var(--border); color: var(--primary); flex-shrink: 0; overflow: hidden; }
.al-illustration svg { width: 42%; height: 42%; opacity: .8; }
.al-illustration-label { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font-size: 10px; font-weight: var(--font-weight-medium); text-transform: uppercase; letter-spacing: .06em; color: var(--muted-foreground); }
.al-illustration-tone-neutral { background: var(--muted); color: var(--muted-foreground); }

/* ---------- Toggle / ToggleGroup ---------- */
.al-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; min-width: 36px; padding: 0 8px;
  border-radius: var(--radius-md); border: 1px solid transparent; background: transparent; color: var(--foreground);
  font-size: var(--text-small-size); font-weight: var(--font-weight-medium); cursor: pointer; transition: background .15s ease;
}
.al-toggle:hover { background: var(--muted); }
.al-toggle[data-state="on"] { background: var(--accent); color: var(--accent-foreground); }
.al-toggle-outline { border-color: var(--border); }
.al-toggle-group { display: inline-flex; gap: 2px; background: var(--muted); padding: 3px; border-radius: var(--radius-lg); }
.al-toggle-group .al-toggle:hover { background: var(--background); }
.al-toggle-group .al-toggle[data-state="on"] { background: var(--card); box-shadow: var(--shadow-sm); }

/* ---------- InputOTP ---------- */
.al-otp { display: inline-flex; gap: 8px; }
.al-otp-slot {
  width: 40px; height: 48px; text-align: center; font-size: 18px; font-weight: var(--font-weight-medium);
  border: 2px solid var(--border); border-radius: var(--radius-md); background: var(--background); outline: none; color: var(--foreground);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.al-otp-slot:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(80,48,229,.2); }

/* ---------- Form ---------- */
.al-form-item { display: flex; flex-direction: column; gap: 8px; }
.al-form-message { font-size: var(--text-xs-size); color: var(--destructive); }
.al-form-desc { font-size: var(--text-xs-size); color: var(--muted-foreground); }

/* ---------- Collapsible ---------- */
.al-collapsible-trigger {
  display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer;
  font-size: var(--text-small-size); font-weight: var(--font-weight-medium); color: var(--foreground); padding: 0;
}
.al-collapsible-trigger svg { transition: transform .2s ease; }
.al-collapsible-trigger[data-state="open"] svg { transform: rotate(180deg); }
.al-collapsible-content { padding-top: 8px; font-size: var(--text-small-size); color: var(--muted-foreground); }

/* ---------- Menubar ---------- */
.al-menubar { display: inline-flex; align-items: center; gap: 2px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 4px; }
.al-menubar-trigger {
  background: none; border: none; padding: 6px 12px; border-radius: var(--radius-sm); font-size: var(--text-small-size);
  color: var(--foreground); cursor: pointer;
}
.al-menubar-trigger[data-state="open"], .al-menubar-trigger:hover { background: var(--accent); color: var(--accent-foreground); }

/* ---------- NavigationMenu ---------- */
.al-navmenu { display: inline-flex; align-items: center; gap: 4px; position: relative; }
.al-navmenu-trigger {
  display: flex; align-items: center; gap: 4px; background: none; border: none; padding: 8px 14px; border-radius: var(--radius-md);
  font-size: var(--text-small-size); font-weight: var(--font-weight-medium); color: var(--foreground); cursor: pointer;
}
.al-navmenu-trigger:hover, .al-navmenu-trigger[data-state="open"] { background: var(--accent); color: var(--accent-foreground); }
.al-navmenu-trigger svg { transition: transform .2s ease; }
.al-navmenu-trigger[data-state="open"] svg { transform: rotate(180deg); }
.al-navmenu-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 50; background: var(--popover); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 12px; min-width: 320px;
}

/* ---------- Command palette ---------- */
.al-command {
  background: var(--popover); border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px; overflow: hidden;
}
.al-command-input-wrap { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.al-command-input { flex: 1; border: none; outline: none; font-size: var(--text-small-size); background: transparent; color: var(--foreground); }
.al-command-input::placeholder { color: var(--muted-foreground); }
.al-command-list { max-height: 300px; overflow-y: auto; padding: 6px; }
.al-command-group-label { padding: 6px 8px; font-size: var(--text-xs-size); color: var(--muted-foreground); font-weight: var(--font-weight-medium); }
.al-command-item { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: var(--radius-sm); font-size: var(--text-small-size); cursor: pointer; color: var(--foreground); }
.al-command-item[data-active="true"], .al-command-item:hover { background: var(--accent); color: var(--accent-foreground); }
.al-command-empty { padding: 24px; text-align: center; font-size: var(--text-small-size); color: var(--muted-foreground); }

/* ---------- ContextMenu ---------- */
.al-contextmenu {
  position: fixed; z-index: 60; background: var(--popover); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 4px; min-width: 180px;
}

/* ---------- HoverCard ---------- */
.al-hovercard-wrap { position: relative; display: inline-flex; }
.al-hovercard {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 50; background: var(--popover); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 16px; width: 260px;
  opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity .15s ease, transform .15s ease;
}
.al-hovercard-wrap:hover .al-hovercard, .al-hovercard-wrap:focus-within .al-hovercard { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* ---------- Drawer (bottom sheet) ---------- */
.al-drawer {
  position: fixed; bottom: 0; left: 0; right: 0; max-height: 85vh; background: var(--background);
  border-top-left-radius: var(--radius-xl); border-top-right-radius: var(--radius-xl); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); z-index: 51; padding: 12px 24px 24px; overflow: auto; animation: al-drawer-in .2s ease;
}
.al-drawer-handle { width: 40px; height: 4px; border-radius: var(--radius-full); background: var(--border); margin: 0 auto 16px; }
@keyframes al-drawer-in { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ---------- Carousel ---------- */
.al-carousel { position: relative; overflow: hidden; }
.al-carousel-track { display: flex; gap: 16px; transition: transform .3s ease; }
.al-carousel-slide { flex: 0 0 auto; }
.al-carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-sm); display: flex; align-items: center;
  justify-content: center; cursor: pointer; color: var(--foreground);
}
.al-carousel-btn.prev { left: 8px; }
.al-carousel-btn.next { right: 8px; }
.al-carousel-dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.al-carousel-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); cursor: pointer; }
.al-carousel-dot[data-active="true"] { background: var(--primary); width: 16px; border-radius: var(--radius-full); }

/* ---------- Chart ---------- */
.al-chart { width: 100%; }
.al-chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: var(--text-xs-size); color: var(--muted-foreground); }
.al-chart-legend-dot { width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; display: inline-block; }
.al-chart-tooltip { fill: var(--foreground); font-size: 11px; }

/* ---------- Calendar (standalone) ---------- */
.al-calendar { width: 260px; }
.al-calendar-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.al-calendar-dow { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; font-size: 12px; color: var(--muted-foreground); margin-bottom: 4px; }
.al-calendar-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.al-calendar-day { aspect-ratio: 1; border: none; border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; background: transparent; color: var(--foreground); }
.al-calendar-day:hover:not(:disabled) { background: var(--accent); }
.al-calendar-day[data-selected="true"] { background: var(--primary); color: var(--primary-foreground); }
.al-calendar-day:disabled { color: transparent; cursor: default; }

/* ---------- ScrollArea ---------- */
.al-scroll-area { overflow: auto; scrollbar-width: thin; scrollbar-color: var(--al-gray-300) transparent; }
.al-scroll-area::-webkit-scrollbar { width: 8px; height: 8px; }
.al-scroll-area::-webkit-scrollbar-thumb { background: var(--al-gray-300); border-radius: var(--radius-full); }
.al-scroll-area::-webkit-scrollbar-track { background: transparent; }

/* ---------- Resizable ---------- */
.al-resizable { display: flex; width: 100%; height: 100%; }
.al-resizable-handle { width: 4px; cursor: col-resize; background: var(--border); flex-shrink: 0; position: relative; }
.al-resizable-handle:hover, .al-resizable-handle.dragging { background: var(--primary); }
.al-resizable-pane { overflow: auto; }

/* ---------- Sidebar (full provider) ---------- */
.al-sidebar { width: 256px; background: var(--sidebar, var(--card)); border-right: 1px solid var(--border); display: flex; flex-direction: column; height: 100%; transition: width .2s ease; flex-shrink: 0; }
.al-sidebar[data-collapsed="true"] { width: 56px; }
.al-sidebar-header { padding: 16px; border-bottom: 1px solid var(--border); }
.al-sidebar-content { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 16px; }
.al-sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }
.al-sidebar-group-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); padding: 0 8px 6px; }
.al-sidebar-menu { display: flex; flex-direction: column; gap: 2px; }
.al-sidebar-menu-btn {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-md); font-size: var(--text-small-size);
  color: var(--muted-foreground); background: none; border: none; cursor: pointer; text-align: left; width: 100%;
}
.al-sidebar-menu-btn:hover { background: var(--accent); color: var(--accent-foreground); }
.al-sidebar-menu-btn[data-active="true"] { background: var(--accent); color: var(--accent-foreground); }
.al-sidebar-trigger { background: none; border: none; cursor: pointer; padding: 6px; border-radius: var(--radius-sm); color: var(--muted-foreground); }
.al-sidebar-trigger:hover { background: var(--accent); }
