/* ============================================================================
   BugTrack Priorizer — Design System
   Light, tech-precise theme. Geist + JetBrains Mono.
   ============================================================================ */

/* ──────────── TOKENS ──────────── */
:root {
    /* Surfaces */
    --bg:              #F4F6FA;
    --surface:         #FFFFFF;
    --surface-2:       #FAFBFC;
    --surface-3:       #F1F4F9;

    /* Borders */
    --border:          #E6E8EE;
    --border-strong:   #D1D5DC;

    /* Text */
    --text:            #0F1729;
    --text-muted:      #6C7589;
    --text-subtle:     #98A0B0;

    /* Brand */
    --primary:         #4F66FF;
    --primary-hover:   #3B5BFF;
    --primary-bg:      #EEF1FF;
    --primary-tint:    #DDE3FF;

    /* Semantic */
    --success:         #16C784;
    --success-bg:      #E5F8F0;
    --warning:         #F59E0B;
    --warning-bg:      #FFF6E5;
    --danger:          #EF4344;
    --danger-bg:       #FEEBEC;
    --info:            #4F66FF;
    --info-bg:         #EEF1FF;

    /* Accents (badges, charts) */
    --accent-purple:   #8B5CF6;
    --accent-orange:   #FF9F43;
    --accent-pink:     #EC4899;
    --accent-cyan:     #06B6D4;

    /* Sidebar (light theme) */
    --sidebar-bg:      #FFFFFF;
    --sidebar-text:    #4A5366;
    --sidebar-active:  var(--primary);
    --card-bg:         var(--surface);

    /* Spacing */
    --sp-1:  4px;
    --sp-2:  8px;
    --sp-3:  12px;
    --sp-4:  16px;
    --sp-5:  20px;
    --sp-6:  24px;
    --sp-8:  32px;
    --sp-10: 40px;
    --sp-12: 48px;

    /* Radius */
    --r-sm:    4px;
    --r-md:    6px;
    --r-lg:    8px;
    --r-xl:    12px;
    --r-pill:  999px;
    --radius:  6px;  /* legacy alias */

    /* Shadows */
    --shadow-xs: 0 1px 1px rgba(15,23,41,.03);
    --shadow-sm: 0 1px 2px rgba(15,23,41,.04), 0 1px 3px rgba(15,23,41,.05);
    --shadow-md: 0 4px 12px rgba(15,23,41,.06), 0 2px 4px rgba(15,23,41,.04);
    --shadow-lg: 0 12px 32px rgba(15,23,41,.08), 0 4px 8px rgba(15,23,41,.05);
    --shadow-xl: 0 24px 64px rgba(15,23,41,.12);
    --ring-primary: 0 0 0 3px rgba(79,102,255,.15);

    /* Typography */
    --font-sans:  'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono:  'JetBrains Mono', 'SF Mono', 'Cascadia Code', Consolas, monospace;
}

/* ──────────── DARK MODE ──────────── */
:root.dark {
    --bg:              #0E1116;
    --surface:         #161B22;
    --surface-2:       #1C2230;
    --surface-3:       #232A3A;

    --border:          #2A3140;
    --border-strong:   #3A4258;

    --text:            #E6E8EE;
    --text-muted:      #8A92A6;
    --text-subtle:     #5A6378;

    --primary:         #6478FF;
    --primary-hover:   #8094FF;
    --primary-bg:      #1A2148;
    --primary-tint:    #2C3870;

    --success:         #20D88E;
    --success-bg:      #103A26;
    --warning:         #F7B43E;
    --warning-bg:      #3F2E10;
    --danger:          #F25657;
    --danger-bg:       #3A1A1B;
    --info:            #6478FF;
    --info-bg:         #1A2148;

    --accent-purple:   #A580FF;
    --accent-orange:   #FFB066;
    --accent-pink:     #F472B6;
    --accent-cyan:     #22D3EE;

    --sidebar-bg:      #11151C;
    --sidebar-text:    #B5BCD0;

    --shadow-xs: 0 1px 1px rgba(0,0,0,.20);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.30), 0 1px 3px rgba(0,0,0,.20);
    --shadow-md: 0 4px 12px rgba(0,0,0,.35), 0 2px 4px rgba(0,0,0,.20);
    --shadow-lg: 0 12px 32px rgba(0,0,0,.45), 0 4px 8px rgba(0,0,0,.25);
    --shadow-xl: 0 24px 64px rgba(0,0,0,.55);
    --ring-primary: 0 0 0 3px rgba(100,120,255,.25);
}

/* Smooth transition between modes */
:root, :root.dark { color-scheme: light; }
:root.dark { color-scheme: dark; }
html, body, .layout, .sidebar, .card, .stat-card,
input, select, textarea, button, table, th, td, .btn, .badge, .alert {
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

/* ──────────── RESET ──────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv11', 'ss01', 'ss03';  /* Geist niceties */
}

a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-hover); }

button { font-family: inherit; font-size: inherit; }

::selection { background: var(--primary-tint); color: var(--text); }

/* ──────────── TYPOGRAPHY HELPERS ──────────── */
.mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }
.text-subtle { color: var(--text-subtle); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: #92400e; }

/* ──────────── LAYOUT SHELL ──────────── */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    border-right: 1px solid var(--border);
    z-index: 40;
}

.content {
    margin-left: 240px;
    flex: 1;
    padding: var(--sp-8) var(--sp-8) var(--sp-12);
    min-width: 0;  /* permite flex shrink em telas estreitas */
}

.content-full { padding: 0; margin: 0; }

/* ──────────── SIDEBAR ──────────── */
.sidebar-header {
    padding: 22px var(--sp-5) 18px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.015em;
    line-height: 1.1;
}

.sidebar-header .subtitle {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.cmd-trigger {
    margin-top: 14px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    text-align: left;
    transition: background .15s, border-color .15s, color .15s;
}
.cmd-trigger:hover {
    background: var(--primary-bg);
    border-color: var(--primary-tint);
    color: var(--primary);
}
.cmd-trigger svg { color: currentColor; flex-shrink: 0; }
.cmd-trigger span { flex: 1; }
.cmd-trigger kbd {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 1px 5px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text-muted);
}

.nav-menu {
    list-style: none;
    padding: var(--sp-2) 0 var(--sp-4);
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-menu::-webkit-scrollbar { width: 6px; }
.nav-menu::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Section header (PRINCIPAL, TRABALHO, etc.) */
.nav-section-header {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    padding: var(--sp-4) var(--sp-5) var(--sp-2);
    user-select: none;
}

/* Each nav item is a <li><a> */
.nav-menu li a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px var(--sp-5);
    color: var(--sidebar-text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-left: 3px solid transparent;
    margin-right: var(--sp-3);
    border-top-right-radius: var(--r-md);
    border-bottom-right-radius: var(--r-md);
    transition: background .15s, color .15s, border-color .15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-menu li a:hover {
    background: var(--surface-3);
    color: var(--text);
}

.nav-menu li a.active {
    background: var(--primary-bg);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.nav-menu li a.active .nav-icon { color: var(--primary); }

.nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: color .15s;
}

.nav-menu li a:hover .nav-icon { color: var(--text); }

/* Contador ao vivo na sidebar (Tickets / Fila de Revisão / Releases) */
.nav-count {
    margin-left: auto;
    min-width: 20px;
    padding: 1px 7px;
    background: var(--surface-3);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    border-radius: 999px;
    text-align: center;
    line-height: 1.4;
}
.nav-menu li a.active .nav-count {
    background: var(--primary);
    color: #fff;
}
.nav-count-danger {
    background: var(--danger);
    color: #fff;
    animation: nav-pulse 1.6s ease-in-out infinite;
}
@keyframes nav-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 67, 68, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(239, 67, 68, 0); }
}

.nav-separator {
    height: 1px;
    background: var(--border);
    margin: var(--sp-3) var(--sp-5);
}

/* Sidebar footer with user */
.sidebar-footer {
    padding: var(--sp-3) var(--sp-4);
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: var(--sp-3);
    row-gap: var(--sp-2);
    align-items: center;
}
/* Linha 1: avatar (col 1) + info (col 2) */
.sidebar-footer .user-avatar { grid-row: 1; grid-column: 1; }
.sidebar-footer .user-info   { grid-row: 1; grid-column: 2; }
/* Linha 2: barra de botões ocupa o full width */
.sidebar-footer .footer-actions {
    grid-row: 2;
    grid-column: 1 / -1;
    display: flex;
    gap: var(--sp-1);
    justify-content: space-between;
    align-items: center;
    padding-top: var(--sp-1);
    border-top: 1px dashed var(--border);
}
.sidebar-footer .footer-actions .btn-logout {
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--r-pill);
    background: linear-gradient(135deg, var(--primary), var(--accent-purple));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

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

.user-role {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.user-badge {
    /* legacy — mantido para retrocompatibilidade caso algum template ainda use */
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: var(--sp-2);
}

.btn-logout {
    color: var(--text-muted);
    padding: 6px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background .15s, color .15s;
    text-decoration: none;
}

.btn-logout:hover { background: var(--danger-bg); color: var(--danger); }

.btn-logout svg { width: 16px; height: 16px; }

/* Theme toggle: mostra ícone oposto ao tema atual */
.theme-toggle:hover { background: var(--primary-bg); color: var(--primary); }
.theme-toggle .theme-icon-sun  { display: none; }
.theme-toggle .theme-icon-moon { display: inline-block; }
:root.dark .theme-toggle .theme-icon-sun  { display: inline-block; }
:root.dark .theme-toggle .theme-icon-moon { display: none; }

/* ──────────── PAGE HEADER ──────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--sp-6);
    gap: var(--sp-4);
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--text);
}

.action-bar {
    display: flex;
    gap: var(--sp-2);
    margin-bottom: var(--sp-4);
    flex-wrap: wrap;
    align-items: center;
}

.filters {
    display: flex;
    gap: var(--sp-2);
    margin-bottom: var(--sp-4);
    flex-wrap: wrap;
    align-items: center;
}

.filters select,
.filters input[type="text"] {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    font-size: 13px;
    background: var(--surface);
    color: var(--text);
}

/* ──────────── CARDS ──────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    margin-bottom: var(--sp-4);
    box-shadow: var(--shadow-xs);
    transition: box-shadow .2s ease;
}

.card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--sp-3);
    letter-spacing: -0.01em;
}

.card-header { margin-bottom: var(--sp-5); }
.card-header h3 { margin-bottom: 4px; }

.section-title {
    font-family: var(--font-mono);
    font-size: 10px;
    margin: 0 0 var(--sp-3) 0;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 500;
}

/* ──────────── STAT CARDS ──────────── */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 18px var(--sp-5);
    text-align: left;
    box-shadow: var(--shadow-xs);
    transition: box-shadow .15s, transform .15s;
}

.stat-card:hover {
    box-shadow: var(--shadow-sm);
}

.stat-number {
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}

.stat-delta {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    margin-top: var(--sp-2);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stat-delta.positive { color: var(--success); }
.stat-delta.negative { color: var(--danger); }

/* ──────────── BUTTONS ──────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: var(--r-md);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
    line-height: 1.2;
    white-space: nowrap;
    user-select: none;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 1px 0 rgba(0,0,0,.04), inset 0 1px 0 rgba(255,255,255,.12);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--surface-3);
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
    background: #d33636;
    border-color: #d33636;
    color: #fff;
}

.btn-full { width: 100%; }

/* ──────────── FORMS ──────────── */
.form-group { margin-bottom: var(--sp-4); }

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    font-size: 14px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring-primary);
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-subtle); }

.form-grid { display: flex; gap: var(--sp-4); }
.form-grid .form-group { flex: 1; }

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

.form-actions {
    display: flex;
    gap: var(--sp-2);
    align-items: center;
    margin-top: var(--sp-5);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--border);
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.upload-zone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--r-lg);
    padding: 48px var(--sp-6);
    text-align: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--primary);
}

/* ──────────── TABLES ──────────── */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
}
/* Cell-level radii (substitui overflow:hidden, que bloqueava sticky thead) */
thead tr:first-child th:first-child { border-top-left-radius: var(--r-lg); }
thead tr:first-child th:last-child  { border-top-right-radius: var(--r-lg); }
tbody tr:last-child td:first-child  { border-bottom-left-radius: var(--r-lg); }
tbody tr:last-child td:last-child   { border-bottom-right-radius: var(--r-lg); }

th, td {
    padding: 11px var(--sp-3);
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text);
}

th {
    background: var(--surface-2);
    font-weight: 500;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: default;
    border-bottom-color: var(--border);
    position: sticky;
    top: 0;
    z-index: 2;
}

th:hover { background: var(--surface-3); }

/* Wrapper scrollável: tabelas largas (tickets/ranking) viram região rolável
   com sticky thead funcionando dentro do container. */
.table-scroll {
    max-height: calc(100vh - 240px);
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface);
}
.table-scroll > table {
    border: none;
    border-radius: 0;
}
.table-scroll thead tr:first-child th:first-child,
.table-scroll thead tr:first-child th:last-child,
.table-scroll tbody tr:last-child td:first-child,
.table-scroll tbody tr:last-child td:last-child {
    border-radius: 0;
}

/* Sortable: cabeçalhos clicáveis com setinha indicadora */
th.sortable { cursor: pointer; user-select: none; padding-right: 22px; position: relative; }
th.sortable::after {
    content: '↕';
    position: absolute;
    right: 8px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-subtle);
    font-size: 10px;
    opacity: .5;
}
th.sortable:hover::after { opacity: 1; color: var(--primary); }
th.sortable.sort-asc::after  { content: '↑'; color: var(--primary); opacity: 1; }
th.sortable.sort-desc::after { content: '↓'; color: var(--primary); opacity: 1; }

tbody tr { transition: background .12s, box-shadow .12s; position: relative; }
tbody tr:hover { background: var(--surface-2); }
tbody tr[hx-get]:hover {
    background: var(--primary-bg);
    cursor: pointer;
    box-shadow: inset 3px 0 0 var(--primary);
}
tbody tr:last-child td { border-bottom: none; }

tr.low-confidence { box-shadow: inset 3px 0 0 var(--warning); }
tr.not-analyzed { background: var(--surface-2); }

/* ──────────── ALERTS ──────────── */
.alert {
    padding: 12px 14px;
    border-radius: var(--r-md);
    margin-bottom: var(--sp-4);
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: var(--sp-2);
    border: 1px solid transparent;
}

.alert-error    { background: var(--danger-bg);  color: #991b1b; border-color: #FBCFD0; }
.alert-success  { background: var(--success-bg); color: #065f46; border-color: #B6E9D2; }
.alert-warning  { background: var(--warning-bg); color: #92400e; border-color: #FCE0A8; }

.alert-icon {
    display: inline-flex;
    width: 18px; height: 18px;
    border-radius: var(--r-pill);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    align-items: center;
    justify-content: center;
    cursor: help;
    margin-right: 2px;
}

.alert-badge {
    display: inline-flex;
    background: #fff;
    color: var(--danger);
    border-radius: var(--r-pill);
    padding: 0 8px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
    min-width: 18px;
    align-items: center;
    justify-content: center;
}

/* ──────────── BADGES ──────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: var(--r-pill);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
}

.badge-bug         { background: var(--danger-bg);   color: var(--danger);       border-color: #FBCFD0; }
.badge-melhoria    { background: var(--info-bg);     color: var(--primary);      border-color: #D5DDFF; }
.badge-custom,
.badge-customização,
.badge-customizacao { background: #F4EEFF;            color: var(--accent-purple); border-color: #DCC9FF; }
.badge-projeto     { background: var(--success-bg);  color: var(--success);      border-color: #B6E9D2; }
.badge-estrategico,
.badge-item-estratégico,
.badge-item-estrategico { background: #FFF1E0;       color: #B25C0E;             border-color: #FCD9A8; }
.badge-edited      { background: var(--success-bg);  color: var(--success);      border-color: #B6E9D2; }

/* ──────────── PAGINATION ──────────── */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: var(--sp-5);
}

.pagination a,
.pagination span {
    padding: 6px 11px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
    font-family: var(--font-mono);
    transition: background .15s, color .15s, border-color .15s;
    background: var(--surface);
}

.pagination a:hover {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: var(--primary-tint);
}

.pagination span.active,
.pagination a[style*="primary"] {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}

/* ──────────── PROGRESS BAR ──────────── */
.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: var(--r-pill);
    overflow: hidden;
    margin: var(--sp-2) 0;
}

.progress-bar .fill {
    height: 100%;
    background: var(--primary);
    transition: width .3s;
}

/* ──────────── TABS ──────────── */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--sp-6);
}

.tab {
    padding: 10px var(--sp-5);
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color .15s, border-color .15s;
}

.tab:hover { color: var(--text); }

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ──────────── MODALS ──────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,41,.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn .15s ease;
}

.modal {
    background: var(--surface);
    border-radius: var(--r-lg);
    padding: var(--sp-6);
    width: 420px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
}

.modal h3 { margin-bottom: var(--sp-3); font-size: 16px; font-weight: 600; }

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

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ──────────── ENTRANCE ANIMATIONS ──────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Cards do conteúdo principal entram em cascata sutil */
.content > .page-header { animation: fadeInUp .35s ease both; }
.content > .card,
.content > div > .card,
.content > div .card {
    animation: fadeInUp .4s ease both;
}
.content > .card:nth-child(2) { animation-delay: .04s; }
.content > .card:nth-child(3) { animation-delay: .08s; }
.content > .card:nth-child(4) { animation-delay: .12s; }
.content > .card:nth-child(5) { animation-delay: .16s; }
.content > .card:nth-child(6) { animation-delay: .20s; }

/* Sidebar entra deslizando da esquerda */
.sidebar { animation: fadeInLeft .25s ease both; }

/* HTMX swaps — content novo aparece com fade rápido */
.htmx-swapping { opacity: 0; transition: opacity .15s ease; }
.htmx-settling { opacity: 1; transition: opacity .15s ease; }

/* ──────────── SKELETON LOADING ──────────── */
@keyframes skeletonPulse {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton {
    display: inline-block;
    background: linear-gradient(
        90deg,
        var(--surface-2) 0%,
        var(--surface-3) 50%,
        var(--surface-2) 100%
    );
    background-size: 200% 100%;
    animation: skeletonPulse 1.4s ease-in-out infinite;
    border-radius: var(--r-md);
    color: transparent !important;
    user-select: none;
}
.skeleton-line { height: 14px; width: 100%; margin: 6px 0; }
.skeleton-line.short { width: 40%; }
.skeleton-line.med { width: 70%; }
.skeleton-block { height: 80px; width: 100%; }

/* HTMX: durante request, aplica overlay sutil no alvo */
[hx-target].htmx-request,
.htmx-request[hx-post],
.htmx-request[hx-get] {
    position: relative;
}
[hx-target].htmx-request::after {
    content: '';
    position: absolute; inset: 0;
    background: var(--surface);
    opacity: .55;
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
}

/* Quando o target receberá conteúdo novo, mostra um placeholder discreto */
.htmx-loading-placeholder {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-muted);
    font-size: 12px;
    animation: fadeIn .15s ease;
}
.htmx-loading-placeholder::before {
    content: '';
    width: 12px; height: 12px;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}

/* ──────────── EMPTY STATE ──────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 24px;
    text-align: center;
    color: var(--text-muted);
}
.empty-state .empty-icon {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    color: var(--text-subtle);
    border: 1px solid var(--border);
    position: relative;
}
.empty-state .empty-icon::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-bg) 0%, transparent 70%);
    z-index: -1;
    opacity: .6;
}
.empty-state .empty-icon svg {
    width: 44px;
    height: 44px;
}
.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 6px 0;
    letter-spacing: -0.01em;
}
.empty-state p {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 420px;
    line-height: 1.55;
    margin: 0 0 18px 0;
}
.empty-state .empty-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ──────────── TOAST NOTIFICATIONS ──────────── */
#toast-container {
    position: fixed;
    top: 16px; right: 16px;
    z-index: 320;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: calc(100vw - 32px);
}
.toast {
    pointer-events: auto;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-left: 3px solid var(--text-muted);
    border-radius: var(--r-md);
    padding: 11px 14px;
    font-size: 13px;
    box-shadow: var(--shadow-lg);
    max-width: 420px;
    transform: translateX(120%);
    opacity: 0;
    transition: transform .3s cubic-bezier(.16,1,.3,1), opacity .25s ease;
    word-wrap: break-word;
    display: flex;
    align-items: center;
    gap: 10px;
}
.toast.toast-show { transform: translateX(0); opacity: 1; }
.toast.toast-out { transform: translateX(120%); opacity: 0; }

.toast-msg {
    flex: 1;
    cursor: pointer;
    line-height: 1.35;
}
.toast-msg::before {
    margin-right: 4px;
    font-weight: 700;
}
.toast-action {
    flex-shrink: 0;
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 4px 12px;
    border-radius: var(--r-md);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans, inherit);
}
.toast-action:hover {
    background: var(--primary);
    color: #fff;
}

.toast-success { border-left-color: var(--success); }
.toast-success .toast-msg::before { content: '✓ '; color: var(--success); }
.toast-error   { border-left-color: var(--danger); }
.toast-error .toast-msg::before   { content: '✕ '; color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-warning .toast-msg::before { content: '⚠ '; color: var(--warning); }
.toast-info    { border-left-color: var(--primary); }
.toast-info .toast-msg::before    { content: 'ℹ '; color: var(--primary); }

/* ──────────── CONFIRM MODAL ──────────── */
#confirm-modal[hidden] { display: none; }
#confirm-modal {
    position: fixed; inset: 0; z-index: 330;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    animation: fadeIn .12s ease;
}
.confirm-box {
    position: relative;
    width: 420px; max-width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-xl);
    padding: 28px 28px 22px;
    text-align: center;
    animation: slideInRight .22s cubic-bezier(.16,1,.3,1);
}
.confirm-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--warning-bg);
    color: var(--warning);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; font-weight: 700;
    margin: 0 auto 16px;
    border: 1px solid #FCE0A8;
}
.confirm-icon.danger { background: var(--danger-bg); color: var(--danger); border-color: #FBCFD0; }
.confirm-box h3 {
    margin: 0 0 8px 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.confirm-box p {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 20px 0;
}
.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.confirm-actions .btn { min-width: 100px; }


#shortcuts-modal[hidden] { display: none; }
#shortcuts-modal {
    position: fixed; inset: 0; z-index: 310;
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 12vh;
    animation: fadeIn .12s ease;
}
.kbd-section {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    margin: 14px 0 6px;
}
.kbd-section:first-child { margin-top: 0; }
.kbd-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 7px 0;
    border-top: 1px solid var(--border);
    font-size: 13px;
}
.kbd-row > span:first-child {
    flex: 0 0 130px;
    color: var(--text);
    font-size: 12px;
}
.kbd-row > span:last-child {
    color: var(--text-muted);
    flex: 1;
}
.kbd-row kbd {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 2px 7px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: var(--r-sm);
    color: var(--text);
    box-shadow: 0 1px 0 var(--border);
}

/* ──────────── COMMAND PALETTE (Ctrl+K) ──────────── */
#cmd-palette[hidden] { display: none; }
#cmd-palette {
    position: fixed; inset: 0; z-index: 300;
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 12vh;
    animation: fadeIn .12s ease;
}
.cmd-backdrop {
    position: absolute; inset: 0;
    background: rgba(15,23,41,.5);
    backdrop-filter: blur(4px);
}
.cmd-modal {
    position: relative;
    width: 640px; max-width: calc(100vw - 32px);
    max-height: 70vh;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-xl);
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: slideInRight .2s cubic-bezier(.16,1,.3,1);
}
.cmd-input-wrap {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.cmd-input-icon { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
#cmd-input {
    flex: 1;
    border: none; outline: none; background: transparent;
    font-size: 15px;
    font-family: var(--font-sans);
    color: var(--text);
}
#cmd-input::placeholder { color: var(--text-subtle); }
.cmd-kbd {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 2px 6px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text-muted);
    text-transform: uppercase;
}
.cmd-results {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}
.cmd-empty {
    padding: 32px 18px;
    color: var(--text-subtle);
    text-align: center;
    font-size: 13px;
}
.cmd-section {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    padding: 10px 14px 6px;
}
.cmd-item {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 12px;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: background .1s;
}
.cmd-item.cmd-selected {
    background: var(--primary-bg);
}
.cmd-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.cmd-text { flex: 1; min-width: 0; }
.cmd-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cmd-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    display: flex; gap: 6px; align-items: center;
}
.cmd-mono { font-family: var(--font-mono); }
.cmd-score { color: var(--primary); font-weight: 600; }
.cmd-pill {
    font-family: var(--font-mono);
    font-size: 9px;
    padding: 1px 6px;
    border-radius: var(--r-pill);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.cmd-pill-danger  { background: var(--danger); }
.cmd-pill-warning { background: var(--warning); }
.cmd-pill-info    { background: var(--primary); }
.cmd-pill-type {
    background: var(--surface-3);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.cmd-footer {
    display: flex; gap: 14px; align-items: center;
    padding: 8px 14px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 11px;
    color: var(--text-muted);
}
.cmd-footer kbd { font-size: 9px; }


/* ──────────── DETAIL PANEL (right slide-over) ──────────── */
#detail-panel {
    position: fixed;
    top: 0; right: 0;
    width: min(920px, 92vw);   /* laptops 1366px → 920px com folga; ultrawide → 920px */
    height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
    z-index: 100;
    overflow: hidden;
    transform: translateX(0);
    transition: transform .35s cubic-bezier(.16,1,.3,1);
    will-change: transform;
}
#detail-panel:empty {
    transform: translateX(105%);
    box-shadow: none;
    pointer-events: none;
}

/* backdrop overlay quando o painel tá aberto */
body:has(#detail-panel:not(:empty))::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15,23,41,.32);
    backdrop-filter: blur(2px);
    z-index: 90;
    animation: fadeIn .25s ease;
    pointer-events: auto;
}
/* fallback: clica fora pra fechar */
.detail-panel { animation: slideInRight .35s cubic-bezier(.16,1,.3,1); }

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.detail-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 !important;
    background: var(--surface);
}

.detail-panel .panel-header {
    padding: 16px var(--sp-5) 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.detail-panel .panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px var(--sp-4);
    background: var(--bg);
}

/* Em telas mais estreitas, reduz padding pra dar mais espaço útil */
@media (max-width: 1500px) {
    .detail-panel .panel-body { padding: 10px 14px; }
    .detail-panel .panel-header { padding: 14px 18px 10px; }
}

.detail-panel .close-btn {
    position: absolute;
    top: 12px; right: 14px;
    cursor: pointer;
    font-size: 22px;
    color: var(--text-muted);
    background: none;
    border: none;
    padding: 4px 8px;
    line-height: 1;
    border-radius: var(--r-md);
    transition: background .15s, color .15s;
}

.detail-panel .close-btn:hover {
    color: var(--text);
    background: var(--surface-3);
}

.panel-two-col {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 12px;
    align-items: start;
}

.panel-edit-col {
    position: sticky;
    top: 0;
}

/* Em telas mais estreitas, coluna direita encolhe ainda mais */
@media (max-width: 1500px) {
    .panel-two-col { grid-template-columns: 1fr 300px; }
}

/* Em laptops menores, vira coluna única */
@media (max-width: 1280px) {
    .panel-two-col { grid-template-columns: 1fr; }
    .panel-edit-col { position: static; }
}

/* Manual factor inputs */
.factor-input-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: var(--sp-3);
}

.factor-input-group .form-group { margin: 0; }

.factor-input-group input {
    text-align: center;
    font-size: 17px !important;
    font-weight: 600 !important;
    padding: 7px 4px !important;
    font-family: var(--font-mono) !important;
}

.factor-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: center;
    margin-bottom: 4px;
    display: block;
    font-weight: 500;
}

/* ──────────── GROUP CARDS ──────────── */
.group-card {
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--sp-4);
    margin-bottom: var(--sp-3);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.group-card h4 { margin-bottom: var(--sp-2); font-size: 14px; font-weight: 600; }
.group-card .meta { color: var(--text-muted); font-size: 12px; margin-bottom: var(--sp-2); }
.group-card ul { padding-left: 20px; font-size: 13px; }

/* ──────────── DATA ACTION CARDS (config) ──────────── */
.data-action-card {
    flex: 1;
    padding: var(--sp-5);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface);
    min-width: 240px;
}

.data-action-card h4 { margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.data-action-danger { border-color: #FBCFD0; background: #FFF7F7; }

/* ──────────── CONFIG SECTIONS ──────────── */
.config-section { margin-bottom: var(--sp-8); }
.config-section h3 {
    margin-bottom: var(--sp-3);
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--sp-2);
    font-size: 16px;
    font-weight: 600;
}

/* ──────────── HTMX ──────────── */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { display: inline-flex; align-items: center; gap: 6px; }

/* Pequeno spinner CSS-only que pode ser usado em qualquer indicator */
.htmx-indicator::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Botão "loading" — disable enquanto a request rola */
.htmx-request[type="submit"],
.htmx-request button {
    opacity: 0.65;
    cursor: wait;
}

/* ──────────── LOGIN ──────────── */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 10%, var(--primary-bg) 0%, transparent 40%),
        radial-gradient(circle at 80% 90%, #F4EEFF 0%, transparent 40%),
        var(--bg);
}

.login-box {
    background: var(--surface);
    padding: 40px;
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    width: 400px;
    border: 1px solid var(--border);
}

.login-box h1 {
    margin-bottom: 4px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.login-subtitle {
    color: var(--text-muted);
    margin-bottom: var(--sp-6);
    font-size: 13px;
}

.back-link {
    display: block;
    margin-top: var(--sp-4);
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ──────────── SCROLLBAR (subtle) ──────────── */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }

/* ──────────── MOBILE NAV TRIGGER ──────────── */
#nav-toggle {
    display: none;
    position: fixed;
    top: 12px; left: 12px;
    z-index: 50;
    width: 40px; height: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    color: var(--text);
    align-items: center;
    justify-content: center;
    padding: 0;
}
#nav-toggle svg { width: 20px; height: 20px; }
#nav-toggle:hover { background: var(--surface-3); }

#nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,41,.5);
    backdrop-filter: blur(2px);
    z-index: 35;
    animation: fadeIn .2s ease;
}

/* ──────────── RESPONSIVE ──────────── */
@media (max-width: 900px) {
    #nav-toggle { display: flex; }
    .layout.nav-open #nav-backdrop { display: block; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s cubic-bezier(.16,1,.3,1);
        will-change: transform;
        z-index: 45;
    }
    .layout.nav-open .sidebar {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }
    .content {
        margin-left: 0;
        padding: 64px var(--sp-4) var(--sp-8);  /* topo extra pra não esconder atrás do hamburger */
    }
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .page-header > div:last-child { display: flex; flex-wrap: wrap; gap: 6px; }

    /* Detail panel ocupa quase tela cheia em mobile */
    #detail-panel { width: 100vw; }

    /* Stat cards e cards múltiplos: stackados sempre */
    .stat-card { padding: 14px; }
    .card { padding: 14px; }

    /* Tabela: scroll horizontal preservado, mas com sombra de borda pra avisar */
    [style*="overflow-x"] table,
    .card table { min-width: 600px; }

    /* Filter form do tickets: stack pra ficar utilizável */
    #filter-form { grid-template-columns: 1fr 1fr !important; }

    /* Modais menores em mobile */
    .cmd-modal { max-width: calc(100vw - 24px); }
    #shortcuts-modal .cmd-modal { max-width: calc(100vw - 24px); }
}

@media (max-width: 600px) {
    .content { padding: 60px var(--sp-3) var(--sp-6); }
    .page-header h1 { font-size: 18px; }
    .stat-number { font-size: 22px; }
    #filter-form { grid-template-columns: 1fr !important; }

    /* Action bar dos tickets: empilha tudo */
    .action-bar, .filters { flex-direction: column; align-items: stretch; }
    .action-bar > *, .filters > * { width: 100%; }
}

/* ============================================================================
   SCORE PILL — fundo neutro + ponto colorido (não compete com badges de tipo)
   ============================================================================ */
.score-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 8px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    min-width: 44px;
    justify-content: center;
}
.score-pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--text-subtle);
}
.score-pill-high  .score-pill-dot,
.score-pill-high  .score-pill-symbol { color: #0E9F6E; background: transparent; }    /* verde escuro */
.score-pill-mhigh .score-pill-dot,
.score-pill-mhigh .score-pill-symbol { color: #16C784; background: transparent; }    /* verde médio */
.score-pill-mid   .score-pill-dot,
.score-pill-mid   .score-pill-symbol { color: #F59E0B; background: transparent; }    /* amarelo */
.score-pill-mlow  .score-pill-dot,
.score-pill-mlow  .score-pill-symbol { color: #FB923C; background: transparent; }    /* laranja */
.score-pill-low   .score-pill-dot,
.score-pill-low   .score-pill-symbol { color: #EF4344; background: transparent; }    /* vermelho */
.score-pill-high  .score-pill-dot { background: #0E9F6E; }
.score-pill-mhigh .score-pill-dot { background: #16C784; }
.score-pill-mid   .score-pill-dot { background: #F59E0B; }
.score-pill-mlow  .score-pill-dot { background: #FB923C; }
.score-pill-low   .score-pill-dot { background: #EF4344; }

/* ============================================================================
   FILTER CHIPS
   ============================================================================ */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin: 0 0 12px 0;
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 4px 4px 10px;
    background: var(--primary-bg);
    border: 1px solid var(--primary-tint);
    border-radius: 999px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
}
.filter-chip-key {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 11px;
}
.filter-chip button {
    width: 18px;
    height: 18px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--primary);
    border-radius: 999px;
    font-size: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.filter-chip button:hover {
    background: var(--primary);
    color: #fff;
}
.filter-chip-warning {
    background: var(--warning-bg);
    border-color: #FCE0A8;
    color: #92400e;
}
.filter-chip-warning .filter-chip-key { color: #92400e; opacity: .75; }
.filter-chip-warning button { color: #92400e; }
.filter-chip-warning button:hover { background: var(--warning); color: #fff; }

.filter-chip-clear {
    margin-left: 4px;
    padding: 4px 10px;
    background: transparent;
    border: 1px dashed var(--border-strong);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 11px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: color .12s, border-color .12s;
}
.filter-chip-clear:hover {
    color: var(--danger);
    border-color: var(--danger);
}

/* ============================================================================
   UX EXTRAS — loading state, copy buttons, tooltips
   ============================================================================ */

/* ──────────── BOTÕES EM LOADING ──────────── */
/* HTMX adiciona automaticamente .htmx-request no elemento que disparou.
   .is-loading é controlado pelo ux-extras.js para forms nativos.
   Quando hx-post está no <form>, propagamos visual para o submit dentro dele. */
button.htmx-request,
button.is-loading,
.btn.htmx-request,
.btn.is-loading,
form.htmx-request button[type="submit"],
form.htmx-request input[type="submit"] {
    cursor: wait;
    opacity: 0.85;
    pointer-events: none;
    position: relative;
}
button.htmx-request::after,
button.is-loading::after,
.btn.htmx-request::after,
.btn.is-loading::after,
form.htmx-request button[type="submit"]::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -2px;
    animation: bt-spin 0.7s linear infinite;
}
@keyframes bt-spin {
    to { transform: rotate(360deg); }
}

/* ──────────── DENSIDADE COMPACTA (toggle) ──────────── */
/* Aplicada via classe .density-compact no <body>. Diminui padding e altura
   das linhas de tabela pra caber mais informação na tela. */
body.density-compact th,
body.density-compact td {
    padding: 5px 10px;
    font-size: 12px;
}
body.density-compact .badge,
body.density-compact .score-pill {
    font-size: 10px;
    padding-top: 1px;
    padding-bottom: 1px;
}
body.density-compact .copy-btn {
    width: 16px;
    height: 16px;
    font-size: 10px;
}
body.density-compact .table-scroll {
    max-height: calc(100vh - 200px);
}

/* ──────────── COLUNAS OCULTAS (toggle) ──────────── */
.col-hidden { display: none !important; }

/* Botão de menu de colunas */
.cols-toggle-btn {
    position: relative;
}
.cols-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 50;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 6px 4px;
}
.cols-menu[hidden] { display: none; }
.cols-menu-header {
    padding: 6px 12px 8px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}
.cols-menu label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    margin: 0;
    user-select: none;
}
.cols-menu label:hover { background: var(--surface-2); }
.cols-menu input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* ──────────── CENÁRIOS CRÍTICOS ──────────── */
/* Pílula compacta inline (lista de tickets, ranking, etc) */
.critical-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px 1px 6px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.5;
    margin-right: 6px;
    border: 1px solid;
    white-space: nowrap;
    vertical-align: 1px;
}
/* Detected: aguarda revisão humana — amarelo/laranja */
.critical-pill-detected {
    background: var(--warning-bg);
    color: #92400e;
    border-color: #FCE0A8;
}
/* Confirmed: escalada ativa — vermelho saturado */
.critical-pill-confirmed {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
/* Rejected: humano disse "não é crítico" — cinza, normalmente não exibido */
.critical-pill-rejected {
    background: var(--surface-3);
    color: var(--text-subtle);
    border-color: var(--border);
    text-decoration: line-through;
}
:root.dark .critical-pill-detected {
    background: #4a3520;
    color: #FCE0A8;
    border-color: #6b4a2a;
}

/* Bloco grande no topo do ticket detail */
.critical-block {
    padding: 14px 18px;
    border-radius: var(--r-md);
    margin-bottom: 16px;
    border-left: 4px solid;
}
.critical-block-detected {
    background: var(--warning-bg);
    color: #7a3a05;
    border-left-color: var(--warning);
    border: 1px solid #FCE0A8;
    border-left: 4px solid var(--warning);
}
.critical-block-confirmed {
    background: linear-gradient(180deg, var(--danger-bg) 0%, var(--surface) 100%);
    color: #7e1314;
    border: 1px solid #FBCFD0;
    border-left: 4px solid var(--danger);
}
.critical-block-rejected {
    background: var(--surface-2);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-left: 4px solid var(--text-subtle);
    opacity: 0.85;
}
:root.dark .critical-block-detected {
    background: #2e2412;
    color: #FCE0A8;
    border-color: #6b4a2a;
}
:root.dark .critical-block-confirmed {
    background: #2a1416;
    color: #FBCFD0;
    border-color: #6e2628;
}

/* ──────────── HIGHLIGHT DE BUSCA ──────────── */
mark.search-mark {
    background: #FEF3C7;
    color: var(--text);
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 600;
}
:root.dark mark.search-mark {
    background: #92400E;
    color: #FEF3C7;
}

/* ──────────── COPY BUTTON ──────────── */
.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 4px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-subtle);
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    vertical-align: middle;
    transition: background .12s, color .12s, border-color .12s;
}
.copy-btn:hover {
    background: var(--surface-3);
    color: var(--primary);
    border-color: var(--border);
}
.copy-btn.copied {
    background: var(--success-bg);
    color: var(--success);
    border-color: transparent;
}

/* ──────────── TOOLTIP ──────────── */
.bt-tooltip {
    position: fixed;
    z-index: 9999;
    background: var(--text);
    color: #fff;
    font-family: var(--font-sans, inherit);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
    padding: 5px 9px;
    border-radius: 4px;
    pointer-events: none;
    max-width: 280px;
    white-space: normal;
    text-align: center;
    box-shadow: var(--shadow-md, 0 4px 12px rgba(15,23,41,.18));
    opacity: 0;
    transform: translate(-50%, calc(-100% - 6px));
    transition: opacity .12s ease;
}
.bt-tooltip.visible { opacity: 1; }
.bt-tooltip::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -4px;
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--text);
    transform: translateX(-50%);
}
:root.dark .bt-tooltip { background: #f3f4f6; color: #0f172a; }
:root.dark .bt-tooltip::after { border-top-color: #f3f4f6; }

/* ============================================================================
   ACESSIBILIDADE — focus visible, skip link, reduced motion
   ============================================================================ */

/* Foco visível: aparece SÓ pra navegação por teclado (não em clique de mouse).
   Usa box-shadow em vez de outline pra respeitar border-radius do elemento. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-tint), 0 0 0 4px var(--primary);
    border-radius: var(--r-md);
    z-index: 1;
    position: relative;
}
/* Linhas de tabela e itens de menu já têm bg highlight em hover; mesmo tratamento ao focar */
.nav-menu li a:focus-visible {
    box-shadow: inset 3px 0 0 var(--primary), 0 0 0 3px var(--primary-tint);
}
tbody tr[hx-get]:focus-visible {
    background: var(--primary-bg);
    box-shadow: inset 3px 0 0 var(--primary);
}
/* Inputs com :focus-visible mantém border do tema, sem ring duplo */
.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-tint);
    border-color: var(--primary);
}

/* Skip link — fica fora da viewport até receber foco */
.skip-link {
    position: absolute;
    top: -100px;
    left: 8px;
    z-index: 10000;
    padding: 10px 18px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    transition: top .15s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
    top: 8px;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Respeita "reduzir movimento" do SO/navegador.
   Útil pra quem tem enxaqueca, vertigem, transtorno vestibular,
   ou simplesmente prefere uma interface mais calma. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    /* Spinners viram pontos estáticos em vez de girarem */
    button.htmx-request::after,
    button.is-loading::after,
    .btn.htmx-request::after,
    .btn.is-loading::after {
        animation: none !important;
        border-right-color: currentColor;
    }
    /* Pílula de fila não pulsa */
    .nav-count-danger {
        animation: none !important;
    }
}

/* Símbolo direcional na score pill — redundância pra daltônicos */
.score-pill-symbol {
    font-size: 10px;
    line-height: 1;
    flex-shrink: 0;
    font-weight: 700;
    margin-right: 1px;
}

/* ============================================================================
   TICKET LABELS (tags do analista)
   ============================================================================ */

.ticket-labels-cell {
    white-space: nowrap;
    font-size: 11px;
    line-height: 1.3;
}

.ticket-label {
    display: inline-flex;
    align-items: center;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 1px 2px 1px 8px;
    margin-right: 3px;
    margin-bottom: 2px;
    font-size: 10.5px;
    line-height: 1.4;
    transition: border-color .12s;
}
.ticket-label:hover {
    border-color: var(--primary);
}
.ticket-label-text {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}
.ticket-label-text:hover {
    color: var(--primary);
}
.ticket-label-remove {
    width: 16px;
    height: 16px;
    border: none;
    background: transparent;
    color: var(--text-subtle);
    cursor: pointer;
    border-radius: 999px;
    padding: 0;
    margin-left: 3px;
    font-size: 11px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ticket-label-remove:hover {
    background: var(--danger);
    color: #fff;
}

.ticket-label-add {
    width: 22px;
    height: 22px;
    border: 1px dashed var(--border-strong);
    background: transparent;
    color: var(--text-subtle);
    cursor: pointer;
    border-radius: 999px;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color .12s, color .12s;
}
.ticket-label-add:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Popover de adicionar tag */
#label-popover {
    position: fixed;
    z-index: 200;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: 0 12px 32px rgba(15, 23, 41, 0.18);
    padding: 12px;
    min-width: 240px;
    max-width: 280px;
    font-size: 13px;
    animation: assistant-slide-in .15s ease-out;
}
#label-popover[hidden] { display: none; }
.label-popover-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.label-popover-presets {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}
.label-popover-preset {
    text-align: left;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text);
    transition: background .12s, border-color .12s;
}
.label-popover-preset:hover {
    background: var(--primary-bg);
    border-color: var(--primary-tint);
    color: var(--primary);
}
.label-popover-form {
    display: flex;
    gap: 6px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}
.label-popover-form input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 5px 9px;
    font-size: 12px;
    background: var(--surface);
    color: var(--text);
}
.label-popover-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-tint);
}

/* ============================================================================
   ASSISTENTE IA (bubble + panel)
   ============================================================================ */

#assistant-bubble {
    position: fixed;
    bottom: 22px;
    right: 22px;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--accent-purple));
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(79, 102, 255, 0.35), 0 2px 6px rgba(0, 0, 0, 0.08);
    z-index: 150;
    transition: transform .15s ease, box-shadow .15s ease;
}
#assistant-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(79, 102, 255, 0.45), 0 2px 6px rgba(0, 0, 0, 0.1);
}
#assistant-bubble svg {
    width: 26px;
    height: 26px;
}
#assistant-bubble[hidden] { display: none; }

#assistant-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 41, 0.18);
    backdrop-filter: blur(2px);
    z-index: 339;
    cursor: pointer;
}
#assistant-backdrop[hidden] { display: none; }
:root.dark #assistant-backdrop { background: rgba(0, 0, 0, 0.35); }

#assistant-panel {
    position: fixed;
    bottom: 90px;
    right: 22px;
    width: 460px;
    max-width: calc(100vw - 32px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: 0 24px 60px rgba(15, 23, 41, 0.18), 0 8px 16px rgba(15, 23, 41, 0.08);
    z-index: 340;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: assistant-slide-in .2s ease-out;
}
#assistant-panel[hidden] { display: none; }

@keyframes assistant-slide-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.assistant-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}
.assistant-header strong {
    font-size: 14px;
    color: var(--text);
}
.assistant-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.4;
}
.assistant-header-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.assistant-btn-icon {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--r-sm);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s, color .12s;
}
.assistant-btn-icon:hover {
    background: var(--surface-3);
    color: var(--text);
}

.assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--surface);
}
.assistant-messages:empty::before {
    content: "Pergunte qualquer coisa sobre o BugTrack — tickets, ranking, releases, cenários críticos.";
    color: var(--text-subtle);
    font-size: 12px;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.assistant-msg {
    max-width: 85%;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.45;
    word-wrap: break-word;
    white-space: pre-wrap;
}
.assistant-msg-user {
    align-self: flex-end;
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.assistant-msg-assistant {
    align-self: flex-start;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}
.assistant-msg-error {
    align-self: stretch;
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #FBCFD0;
    font-size: 12px;
    text-align: center;
}
.assistant-msg code {
    background: rgba(0,0,0,0.06);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 92%;
}
.assistant-msg-user code {
    background: rgba(255,255,255,0.18);
    color: #fff;
}

.assistant-tool-chip {
    align-self: flex-start;
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: var(--surface-3);
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    margin-bottom: -4px;
}

.assistant-typing {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
}
.assistant-typing span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: assistant-dot 1.2s infinite;
}
.assistant-typing span:nth-child(2) { animation-delay: .15s; }
.assistant-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes assistant-dot {
    0%, 60%, 100% { opacity: .3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

.assistant-form {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}
.assistant-form textarea {
    flex: 1;
    resize: none;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    line-height: 1.4;
    max-height: 100px;
    transition: border-color .12s;
}
.assistant-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-tint);
}
.assistant-form button {
    align-self: flex-end;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
}
.assistant-form button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.assistant-footer {
    padding: 6px 16px 8px;
    font-size: 10px;
    color: var(--text-subtle);
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    text-align: center;
}

/* Mobile: drawer fullscreen */
@media (max-width: 700px) {
    #assistant-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }
    #assistant-bubble {
        bottom: 16px;
        right: 16px;
    }
}

/* Reduced motion: tira animações */
@media (prefers-reduced-motion: reduce) {
    #assistant-bubble { transition: none; }
    #assistant-panel { animation: none; }
    .assistant-typing span { animation: none; opacity: .6; }
}
