/* ==========================================================================
   OXYGER · Liberações · CSS standalone (escopo .lib-*)
   Portado do protótipo docs/prototipos/liberacoes.html
   Sem dependência do Tailwind do Filament.
   ========================================================================== */

/* ==========================================================================
   RESET v4 — Scroll fica INTERNO ao .lib-root
   - body/html/Filament layout NÃO rolam (sidebar fixa)
   - Containers internos (.lib-container, .lib-detail-main) rolam normalmente
   Só ativa quando a página atual tem .lib-root no DOM.
   ========================================================================== */

/* 1. Bloqueia scroll do body/html quando há .lib-root. */
html:has(.lib-root),
body:has(.lib-root) {
    overflow: hidden !important;
    height: 100vh !important;
}

/* 2. Cadeia Filament (layout → main-ctn → main) fixa em 100vh */
body:has(.lib-root) .fi-layout,
body:has(.lib-root) .fi-main-ctn,
body:has(.lib-root) .fi-main {
    height: 100vh !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

/* 3. Main sem paddings nem max-width */
.fi-main:has(.lib-root) {
    padding: 0 !important;
    max-width: 100% !important;
}

/* 4. Cascade page → section → div → [PRIMEIRO FILHO DIRETO]
      > * evita pegar todos descendentes wire:id aninhados (que quebrava o scroll interno).
      Removido max-height — impedia containers internos de calcular overflow corretamente. */
.fi-page:has(.lib-root),
.fi-page:has(.lib-root) > section,
.fi-page:has(.lib-root) > section > div,
.fi-page:has(.lib-root) > section > div > * {
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
}

/* 5. Oculta heading/breadcrumb default */
.fi-page:has(.lib-root) .fi-page-header { display: none !important; }
.fi-page:has(.lib-root) .fi-breadcrumbs { display: none !important; }

/* 6. display: block no div wrapper */
.fi-page:has(.lib-root) > section > div { display: block !important; }

/* 7. Defesa contra svg { width: 100% } do Filament */
.lib-root svg {
    width: 1em !important;
    height: 1em !important;
    max-width: 100% !important;
    max-height: 100% !important;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

/* ---------- TOKENS ---------- */
:root {
    --lib-bg-body: #f8fafc;
    --lib-bg-card: #ffffff;
    --lib-bg-input: #f9fafb;
    --lib-bg-table-head: #f9fafb;
    --lib-border: #e5e7eb;
    --lib-border-hover: #d1d5db;
    --lib-text-body: #1f2937;
    --lib-text-sub: #374151;
    --lib-text-dim: #6b7280;
    --lib-text-faint: #9ca3af;
    --lib-text-pri: #b45309;
    --lib-text-pri-strong: #92400e;

    --lib-pri-50:  #fffbeb;
    --lib-pri-100: #fef3c7;
    --lib-pri-200: #fde68a;
    --lib-pri-300: #fcd34d;
    --lib-pri-400: #fbbf24;
    --lib-pri-500: #f59e0b;
    --lib-pri-600: #d97706;
    --lib-pri-700: #b45309;
    --lib-pri-800: #92400e;

    --lib-good: #15803d;
    --lib-warn: #b45309;
    --lib-bad:  #b91c1c;

    --lib-amber-50:  #fffbeb;
    --lib-amber-100: #fef3c7;
    --lib-amber-600: #d97706;
    --lib-red-50:  #fef2f2;
    --lib-red-100: #fee2e2;
    --lib-red-600: #dc2626;
    --lib-purple-100: #f3e8ff;
    --lib-purple-600: #9333ea;
    --lib-blue-100: #dbeafe;
    --lib-blue-600: #2563eb;
    --lib-green-100: #dcfce7;
    --lib-green-600: #16a34a;
}

.dark, [data-theme="dark"] {
    --lib-bg-body: #111827;
    --lib-bg-card: #1f2937;
    --lib-bg-input: rgba(255, 255, 255, 0.05);
    --lib-bg-table-head: #172033;
    --lib-border: rgba(255, 255, 255, 0.08);
    --lib-border-hover: rgba(255, 255, 255, 0.12);
    --lib-text-body: #ffffff;
    --lib-text-sub: #d1d5db;
    --lib-text-dim: #9ca3af;
    --lib-text-faint: #6b7280;
    --lib-text-pri: #fbbf24;
    --lib-text-pri-strong: #f59e0b;

    --lib-good: #4ade80;
    --lib-warn: #fbbf24;
    --lib-bad:  #f87171;
}

/* ---------- RESET LOCAL ---------- */
.lib-root,
.lib-root * {
    box-sizing: border-box;
}

.lib-root {
    font-family: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
    background: var(--lib-bg-body);
    color: var(--lib-text-body);
    /* Scroll fica INTERNO aos containers (.lib-container / .lib-detail-main),
       evitando que o body/Filament sidebar rolem junto com o conteúdo. */
    height: 100% !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    /* isolation: isolate cria um stacking context que CONFINA os z-index
       internos do componente. Drawers/overlays do Filament (position:fixed
       com z-index 30+) ficam naturalmente acima deste contexto inteiro. */
    isolation: isolate;
}

/* ---------- COR / TEXTO ---------- */
.lib-t-body  { color: var(--lib-text-body); }
.lib-t-sub   { color: var(--lib-text-sub); }
.lib-t-dim   { color: var(--lib-text-dim); }
.lib-t-faint { color: var(--lib-text-faint); }
.lib-t-pri   { color: var(--lib-text-pri); }
.lib-t-pri-strong { color: var(--lib-text-pri-strong); }

.lib-tc-good { color: var(--lib-good); }
.lib-tc-warn { color: var(--lib-warn); }
.lib-tc-bad  { color: var(--lib-bad); }

/* ---------- CARDS ---------- */
.lib-card {
    background: var(--lib-bg-card);
    border: 1px solid var(--lib-border);
    border-radius: 12px;
    padding: 16px;
}
.lib-card-sm { padding: 12px; border-radius: 10px; }
.lib-card-muted { background: var(--lib-bg-input); }

/* ---------- TOP BAR ---------- */
.lib-topbar {
    background: var(--lib-bg-card);
    border-bottom: 1px solid var(--lib-border);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Não precisa mais de position:sticky — é flex child fixo no topo */
    flex-shrink: 0;
    /* z-index não definido — com isolation:isolate no .lib-root, o stacking
       context interno não compete com overlays fixed do Filament. */
}

.lib-topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lib-topbar-right { display: flex; align-items: center; gap: 12px; }

.lib-logo-dot {
    width: 32px; height: 32px;
    background: var(--lib-pri-600);
    color: #fff;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}

.lib-badge-count {
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    background: var(--lib-pri-100);
    color: var(--lib-pri-700);
    border: 1px solid var(--lib-pri-200);
}
.dark .lib-badge-count { background: rgba(245, 158, 11, 0.15); color: var(--lib-pri-400); border-color: rgba(245, 158, 11, 0.2); }

/* ---------- KBD BADGE ---------- */
.lib-kbd {
    display: inline-flex; align-items: center;
    padding: 1px 6px;
    font-size: 10px;
    font-family: 'Instrument Sans', monospace;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.45);
}
.dark .lib-kbd {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.45);
}

/* ---------- KPI CARDS ---------- */
.lib-kpi-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 768px) {
    .lib-kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.lib-kpi-card {
    background: var(--lib-bg-card);
    border: 1px solid var(--lib-border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
}
.lib-kpi-card:hover { border-color: var(--lib-border-hover); transform: translateY(-1px); }
.lib-kpi-card.active {
    border-color: var(--lib-pri-500);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.18);
}

.lib-kpi-icon {
    width: 40px; height: 40px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.lib-kpi-icon svg { width: 20px; height: 20px; }

.lib-kpi-icon-total { background: var(--lib-pri-100); color: var(--lib-pri-600); }
.lib-kpi-icon-amber { background: var(--lib-amber-100); color: var(--lib-amber-600); }
.lib-kpi-icon-red   { background: var(--lib-red-100); color: var(--lib-red-600); }
.lib-kpi-icon-purple{ background: var(--lib-purple-100); color: var(--lib-purple-600); }
.dark .lib-kpi-icon-total  { background: rgba(245,158,11,.15); color: var(--lib-pri-400); }
.dark .lib-kpi-icon-amber  { background: rgba(245,158,11,.15); color: var(--lib-pri-400); }
.dark .lib-kpi-icon-red    { background: rgba(239,68,68,.15);  color: #fca5a5; }
.dark .lib-kpi-icon-purple { background: rgba(147,51,234,.15); color: #c4b5fd; }

.lib-kpi-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--lib-text-faint);
}
.lib-kpi-value { font-size: 22px; font-weight: 700; color: var(--lib-text-body); font-variant-numeric: tabular-nums; }
.lib-kpi-sub { font-size: 11px; color: var(--lib-text-faint); }
.lib-kpi-strong { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- TABS + FILTROS ---------- */
.lib-tabs-row {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    padding: 8px 12px;
    background: var(--lib-bg-card);
    border: 1px solid var(--lib-border);
    border-radius: 12px;
}

.lib-tabs { display: flex; gap: 4px; }
.lib-tab {
    padding: 8px 14px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border-bottom: 2px solid transparent;
    color: var(--lib-text-sub);
    font-size: 13px;
    user-select: none;
    background: transparent;
    border-left: none; border-right: none; border-top: none;
}
.lib-tab:hover { background: rgba(0, 0, 0, 0.03); }
.dark .lib-tab:hover { background: rgba(255, 255, 255, 0.04); }
.lib-tab.active { border-bottom-color: var(--lib-pri-500); color: var(--lib-pri-700); font-weight: 600; }
.dark .lib-tab.active { color: var(--lib-pri-400); }
.lib-tab-count { margin-left: 6px; font-size: 10px; color: var(--lib-text-faint); }

.lib-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.lib-input, .lib-select, .lib-textarea {
    background: var(--lib-bg-input);
    border: 1px solid var(--lib-border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--lib-text-body);
    min-width: 140px;
    height: 32px;
    font-family: inherit;
}
.lib-textarea { height: auto; }

/* Select: appearance custom + chevron próprio (evita conflito com chevron nativo do browser) */
.lib-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 28px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236b7280' stroke-width='2.2' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    cursor: pointer;
}
.dark .lib-select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23d1d5db' stroke-width='2.2' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/></svg>");
}
.lib-select::-ms-expand { display: none; }

.lib-input:focus, .lib-select:focus, .lib-textarea:focus {
    border-color: var(--lib-pri-500);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
    outline: none;
}
.lib-input-search {
    min-width: 260px;
    padding-left: 32px;
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 14px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%239ca3af' stroke-width='2' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' d='M21 21l-4.35-4.35m0 0A7.5 7.5 0 103 10a7.5 7.5 0 0013.65 6.65z'/></svg>");
}

/* Range de datas (flatpickr) */
.lib-range-wrap { position: relative; display: inline-flex; align-items: center; }
.lib-range-input { min-width: 200px; cursor: pointer; }
.lib-range-clear {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; padding: 0;
    border: none; background: transparent;
    color: var(--lib-text-faint);
    font-size: 16px; line-height: 1; cursor: pointer;
    border-radius: 4px;
}
.lib-range-clear:hover { color: var(--lib-text-body); background: rgba(0,0,0,0.06); }

/* ---------- TABELA ---------- */
.lib-table-wrap {
    background: var(--lib-bg-card);
    border: 1px solid var(--lib-border);
    border-radius: 12px;
    overflow: hidden;
}

.lib-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.lib-table thead th {
    background: var(--lib-bg-table-head);
    color: var(--lib-text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--lib-border);
    white-space: nowrap;
}

.lib-table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--lib-border);
    vertical-align: middle;
}

.lib-row {
    transition: background 0.12s;
    cursor: pointer;
}
.lib-row:nth-child(odd)  td { background: rgba(0, 0, 0, 0.015); }
.lib-row:nth-child(even) td { background: var(--lib-bg-card); }
.lib-row:hover td { background: rgba(59, 130, 246, 0.08) !important; }
.dark .lib-row:nth-child(odd)  td { background: rgba(255, 255, 255, 0.025); }
.dark .lib-row:nth-child(even) td { background: rgba(0, 0, 0, 0.10); }
.dark .lib-row:hover td { background: rgba(59, 130, 246, 0.15) !important; }

.lib-row.lib-row-urgent-discount td:first-child { box-shadow: inset 3px 0 0 var(--lib-pri-500); }
.lib-row.lib-row-urgent-cancel   td:first-child { box-shadow: inset 3px 0 0 var(--lib-red-600); }
.lib-row.lib-row-selected td { background: rgba(59, 130, 246, 0.06) !important; }

/* ---------- BADGES ---------- */
.lib-badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px; font-weight: 500;
    white-space: nowrap;
    gap: 4px;
}
.lib-badge-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.lib-badge-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.lib-badge-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.lib-badge-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.lib-badge-purple  { background: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.lib-badge-gray    { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }

.dark .lib-badge-warning { background: rgba(245,158,11,.15); color: var(--lib-pri-400); border-color: rgba(245,158,11,.25); }
.dark .lib-badge-danger  { background: rgba(239,68,68,.15);  color: #fca5a5;            border-color: rgba(239,68,68,.25); }
.dark .lib-badge-info    { background: rgba(59,130,246,.15); color: #93c5fd;            border-color: rgba(59,130,246,.25); }
.dark .lib-badge-success { background: rgba(34,197,94,.15);  color: #86efac;            border-color: rgba(34,197,94,.25); }
.dark .lib-badge-purple  { background: rgba(147,51,234,.15); color: #d8b4fe;            border-color: rgba(147,51,234,.25); }
.dark .lib-badge-gray    { background: rgba(255,255,255,.08); color: #d1d5db; border-color: rgba(255,255,255,.12); }

/* ---------- AVATAR ---------- */
.lib-avatar {
    width: 28px; height: 28px;
    border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--lib-pri-600);
    color: #fff;
    font-size: 11px; font-weight: 700;
    flex-shrink: 0;
}
.lib-avatar-lg { width: 36px; height: 36px; font-size: 12px; }

/* ---------- BUTTONS ---------- */
.lib-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    color: var(--lib-text-sub);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    font-family: inherit;
    text-decoration: none;
}
.lib-btn:hover { background: rgba(0, 0, 0, 0.03); }
.dark .lib-btn:hover { background: rgba(255, 255, 255, 0.06); }

.lib-btn-primary {
    background: var(--lib-pri-600);
    color: #fff;
    border-color: var(--lib-pri-600);
}
.lib-btn-primary:hover { background: var(--lib-pri-700); border-color: var(--lib-pri-700); }

.lib-btn-danger {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}
.lib-btn-danger:hover { background: #fecaca; }
.dark .lib-btn-danger { background: rgba(239,68,68,.15); color: #fca5a5; border-color: rgba(239,68,68,.25); }

.lib-btn-outline {
    border-color: var(--lib-border);
    background: var(--lib-bg-card);
    color: var(--lib-text-sub);
}
.lib-btn-outline:hover { border-color: var(--lib-border-hover); }

.lib-btn-ghost { color: var(--lib-text-dim); }
.lib-btn-sm { padding: 4px 10px; font-size: 12px; }

/* ---------- BULK FOOTER ---------- */
.lib-bulk-footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--lib-bg-card);
    border-top: 1px solid var(--lib-border);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 20;
    transform: translateY(120%);
    transition: transform 0.25s ease;
    gap: 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
}
.lib-bulk-footer.show { transform: translateY(0); }

/* ---------- ANIMAÇÕES ---------- */
@keyframes libPulseUrgent {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}
.lib-urgent-pulse { animation: libPulseUrgent 1.6s ease-in-out infinite; }

/* ---------- SCROLLBAR ---------- */
.lib-root ::-webkit-scrollbar { width: 6px; height: 6px; }
.lib-root ::-webkit-scrollbar-track { background: transparent; }
.lib-root ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
.dark .lib-root ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); }

/* ---------- LAYOUT HELPERS (apenas utilidades internas) ---------- */
.lib-flex { display: flex; }
.lib-flex-col { display: flex; flex-direction: column; }
.lib-items-center { align-items: center; }
.lib-items-start { align-items: flex-start; }
.lib-justify-between { justify-content: space-between; }
.lib-justify-end { justify-content: flex-end; }
.lib-gap-1 { gap: 4px; }
.lib-gap-2 { gap: 8px; }
.lib-gap-3 { gap: 12px; }
.lib-gap-4 { gap: 16px; }
.lib-w-full { width: 100%; }
.lib-flex-1 { flex: 1 1 0%; min-width: 0; }
.lib-text-xs  { font-size: 11px; }
.lib-text-sm  { font-size: 13px; }
.lib-text-md  { font-size: 14px; }
.lib-text-lg  { font-size: 16px; }
.lib-text-xl  { font-size: 18px; }
.lib-text-2xl { font-size: 22px; }
.lib-fw-500 { font-weight: 500; }
.lib-fw-600 { font-weight: 600; }
.lib-fw-700 { font-weight: 700; }
.lib-tabnum { font-variant-numeric: tabular-nums; }
.lib-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-space-y-3 > * + * { margin-top: 12px; }
.lib-space-y-4 > * + * { margin-top: 16px; }
.lib-mb-2 { margin-bottom: 8px; }
.lib-mb-3 { margin-bottom: 12px; }
.lib-mt-1 { margin-top: 4px; }
.lib-pb-32 { padding-bottom: 128px; }
.lib-px-4 { padding-left: 16px; padding-right: 16px; }
.lib-py-4 { padding-top: 16px; padding-bottom: 16px; }

/* ---------- MAIN CONTAINER ---------- */
.lib-container {
    flex: 1 1 0%;
    min-height: 0;          /* permite que o child com overflow encolha */
    overflow-y: auto;       /* scroll INTERNO (mantém sidebar Filament fixa) */
    padding: 16px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}
.lib-container > * + * { margin-top: 16px; }

/* ---------- HIDE/SHOW ---------- */
.lib-hidden { display: none !important; }
@media (min-width: 768px) { .lib-md-inline { display: inline !important; } }

/* ---------- CHECKBOX ---------- */
.lib-check {
    width: 16px; height: 16px;
    cursor: pointer;
    accent-color: var(--lib-pri-600);
}

/* ---------- ACTION MENU ---------- */
.lib-action-menu {
    position: absolute;
    right: 0; top: 100%;
    min-width: 180px;
    background: var(--lib-bg-card);
    border: 1px solid var(--lib-border);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    z-index: 15;
    padding: 4px;
}
.lib-action-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    color: var(--lib-text-sub);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.lib-action-item:hover { background: rgba(0, 0, 0, 0.04); }
.dark .lib-action-item:hover { background: rgba(255, 255, 255, 0.06); }

/* ---------- THEME TOGGLE ---------- */
.lib-theme-toggle {
    position: relative;
    width: 44px; height: 24px;
    border-radius: 12px;
    cursor: pointer;
    background: #d1d5db;
    transition: background 0.3s;
    flex-shrink: 0;
    border: none;
    padding: 0;
}
.lib-theme-toggle .lib-toggle-dot {
    position: absolute;
    top: 2px; left: 2px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.dark .lib-theme-toggle { background: var(--lib-pri-600); }
.dark .lib-theme-toggle .lib-toggle-dot { transform: translateX(20px); }

/* ==========================================================================
   TELA DE DETALHE (Desconto / Cancelamento)
   Sidebar + Main + Footer fixo + Modal
   ========================================================================== */

/* ---------- LAYOUT GERAL DETALHE (single-column) ---------- */
.lib-detail {
    flex: 1 1 0%;
    display: flex;
    flex-direction: column;
    min-height: 0;          /* permite que .lib-detail-main encolha e role internamente */
    overflow: hidden;       /* scroll fica em .lib-detail-main, não aqui */
    background: var(--lib-bg-body);
}

/* ---------- ALÇADA INLINE (substitui sidebar removida) ---------- */
.lib-alcada-inline {
    background: var(--lib-bg-input);
    border: 1px solid var(--lib-border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 12px;
    font-size: 12px;
}
.lib-alcada-inline .lib-alcada-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--lib-text-faint);
    margin-bottom: 4px;
}

/* ---------- SIDEBAR (deprecated — mantido por compatibilidade, sem uso ativo) ---------- */
.lib-sidebar {
    width: 320px;
    background: var(--lib-bg-card);
    border-right: 1px solid var(--lib-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.lib-sidebar-top {
    padding: 12px;
    border-bottom: 1px solid var(--lib-border);
}

.lib-sidebar-list {
    flex: 1;
    overflow-y: auto;
}

.lib-sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--lib-border);
    background: var(--lib-bg-input);
}

/* ---------- REQ ITEM (sidebar) ---------- */
.lib-req-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--lib-border);
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.lib-req-item:hover { background: rgba(59, 130, 246, 0.06); }
.dark .lib-req-item:hover { background: rgba(59, 130, 246, 0.12); }
.lib-req-item.active {
    background: rgba(245, 158, 11, 0.12);
    border-left-color: var(--lib-pri-500);
}
.dark .lib-req-item.active { background: rgba(245, 158, 11, 0.15); }

/* ---------- MAIN (detalhe) ---------- */
.lib-detail-main {
    flex: 1 1 0%;
    overflow-y: auto;
    min-width: 0;
    min-height: 0;
}

.lib-detail-inner {
    padding: 16px;
    padding-bottom: 96px; /* espaço para footer fixo */
}
.lib-detail-inner > * + * { margin-top: 16px; }

/* ---------- GRID DE 12 COLUNAS ---------- */
.lib-grid-12 {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
}
.lib-col-4 { grid-column: span 4 / span 4; }
.lib-col-6 { grid-column: span 6 / span 6; }
.lib-col-12 { grid-column: span 12 / span 12; }

@media (max-width: 900px) {
    .lib-col-4, .lib-col-6 { grid-column: span 12 / span 12; }
}

/* ---------- INFO CARD (com header) ---------- */
.lib-info-card {
    background: var(--lib-bg-card);
    border: 1px solid var(--lib-border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.lib-info-card:hover { border-color: var(--lib-border-hover); }
.lib-info-card.lib-info-card-primary {
    border-width: 2px;
    border-color: var(--lib-pri-400);
}
.lib-info-card.lib-info-card-danger {
    border-width: 2px;
    border-color: #fca5a5;
}

.lib-info-header {
    background: var(--lib-bg-table-head);
    border-bottom: 1px solid var(--lib-border);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
    color: var(--lib-text-dim);
}
.lib-info-header > svg { width: 16px !important; height: 16px !important; flex-shrink: 0; color: var(--lib-pri-500); }

/* Tamanhos exatos por contexto — sempre com !important para vencer Filament */
.lib-topbar svg            { width: 14px !important; height: 14px !important; }
.lib-kpi-icon > svg        { width: 20px !important; height: 20px !important; }
.lib-btn svg               { width: 14px !important; height: 14px !important; }
.lib-modal-header svg      { width: 18px !important; height: 18px !important; }
.lib-detail-header-card svg { width: 16px !important; height: 16px !important; }
.lib-info-body svg         { width: 14px !important; height: 14px !important; }
.lib-action-item svg       { width: 14px !important; height: 14px !important; }
.lib-table svg             { width: 12px !important; height: 12px !important; }
.lib-items-table svg       { width: 12px !important; height: 12px !important; }

.lib-info-card-primary .lib-info-header {
    background: var(--lib-pri-50);
    border-bottom-color: var(--lib-pri-200);
    color: var(--lib-text-pri-strong);
}
.dark .lib-info-card-primary .lib-info-header {
    background: rgba(245, 158, 11, 0.10);
    border-bottom-color: rgba(245, 158, 11, 0.20);
    color: var(--lib-pri-400);
}
.lib-info-card-danger .lib-info-header {
    background: var(--lib-red-50);
    border-bottom-color: #fecaca;
    color: #991b1b;
}
.dark .lib-info-card-danger .lib-info-header {
    background: rgba(239, 68, 68, 0.10);
    border-bottom-color: rgba(239, 68, 68, 0.20);
    color: #fca5a5;
}

.lib-info-body { padding: 16px; }
.lib-info-body .lib-kv {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 12px;
}
.lib-info-body .lib-kv > :first-child { color: var(--lib-text-dim); }
.lib-info-body .lib-kv > :last-child { color: var(--lib-text-body); font-weight: 500; }
.lib-info-divider {
    margin: 8px 0;
    border-top: 1px solid var(--lib-border);
}

/* ---------- GAUGE ---------- */
.lib-gauge {
    height: 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin: 4px 0;
}
.dark .lib-gauge { background: rgba(255, 255, 255, 0.08); }
.lib-gauge > .lib-gauge-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s;
}
.lib-gauge-fill-good { background: var(--lib-green-600); }
.lib-gauge-fill-warn { background: var(--lib-pri-500); }
.lib-gauge-fill-bad  { background: var(--lib-red-600); }

/* ---------- TABELA DE ITENS DE PEDIDO (margens) ---------- */
.lib-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.lib-items-table thead th {
    background: var(--lib-bg-table-head);
    color: var(--lib-text-dim);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
    text-align: left;
    padding: 8px;
    border-bottom: 1px solid var(--lib-border);
    white-space: nowrap;
}
.lib-items-table tbody td {
    padding: 8px;
    border-bottom: 1px solid var(--lib-border);
    vertical-align: middle;
}

.lib-item-row { transition: background 0.15s; }
.lib-item-row:nth-child(odd)  td { background: rgba(0, 0, 0, 0.02); }
.lib-item-row:nth-child(even) td { background: var(--lib-bg-card); }
.dark .lib-item-row:nth-child(odd)  td { background: rgba(255, 255, 255, 0.03); }
.dark .lib-item-row:nth-child(even) td { background: rgba(0, 0, 0, 0.1); }

.lib-item-row.lib-item-pending td {
    background: rgba(245, 158, 11, 0.08) !important;
}
.lib-item-row.lib-item-pending td:first-child {
    box-shadow: inset 3px 0 0 var(--lib-pri-500);
}
.lib-item-row.lib-item-pending:hover td { background: rgba(245, 158, 11, 0.14) !important; }
.lib-item-row.lib-item-pending.lib-item-selected td {
    background: rgba(245, 158, 11, 0.18) !important;
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.25);
}

.lib-item-row.lib-item-alert td {
    background: rgba(220, 38, 38, 0.08) !important;
}
.lib-item-row.lib-item-alert td:first-child {
    box-shadow: inset 3px 0 0 var(--lib-red-600);
}
.lib-item-row.lib-item-alert:hover td { background: rgba(220, 38, 38, 0.14) !important; }

.dark .lib-item-row.lib-item-pending td { background: rgba(245, 158, 11, 0.12) !important; }
.dark .lib-item-row.lib-item-alert td { background: rgba(220, 38, 38, 0.15) !important; }

/* ---------- MARGEM SEMÂNTICA ---------- */
.lib-margin-good { color: var(--lib-good); font-weight: 600; }
.lib-margin-warn { color: var(--lib-warn); font-weight: 600; }
.lib-margin-bad  { color: var(--lib-bad);  font-weight: 700; }

/* ---------- VALUE BOX (KPI mini) ---------- */
.lib-value-box {
    background: var(--lib-bg-input);
    border: 1px solid var(--lib-border);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}
.lib-value-box.lib-value-box-bad {
    border-width: 2px;
    border-color: #fca5a5;
    background: var(--lib-red-50);
}
.dark .lib-value-box.lib-value-box-bad {
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.30);
}

/* ---------- FOOTER FIXO DE AÇÕES (detalhe) ---------- */
.lib-detail-footer {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--lib-bg-card);
    border-top: 1px solid var(--lib-border);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    /* z-index removido — isolation:isolate no .lib-root confina stacking context */
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
}

.lib-detail-footer--success {
    background: #f0fdf4;
    border-top-color: #86efac;
}
.lib-success-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--lib-good, #15803d);
}
.lib-success-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--lib-good, #15803d);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

/* ---------- MODAL ---------- */
.lib-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60;
}
.lib-modal {
    background: var(--lib-bg-card);
    border: 1px solid var(--lib-border);
    border-radius: 12px;
    width: 92%;
    max-width: 480px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}
.lib-modal-header {
    background: var(--lib-bg-table-head);
    border-bottom: 1px solid var(--lib-border);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.lib-modal-body { padding: 16px; }
.lib-modal-body > * + * { margin-top: 12px; }
.lib-modal-footer {
    background: var(--lib-bg-table-head);
    border-top: 1px solid var(--lib-border);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.lib-modal-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--lib-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

/* ---------- CONTRA-PROPOSTA BOX ---------- */
.lib-counter-box {
    background: var(--lib-pri-50);
    border: 1px solid var(--lib-pri-200);
    border-radius: 8px;
    padding: 10px;
    font-size: 11px;
}
.dark .lib-counter-box {
    background: rgba(245, 158, 11, 0.10);
    border-color: rgba(245, 158, 11, 0.20);
}

/* ---------- STATUS BADGES (pendente/aprovado/rejeitado/expirado) ---------- */
.lib-status-header-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-status-big {
    font-size: 24px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--lib-bad);
}

/* ---------- EXPIRES COUNTDOWN BOX ---------- */
.lib-expires-box {
    text-align: right;
}
.lib-expires-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--lib-text-faint);
}

/* ---------- ALERT PILL (erro linha tabela) ---------- */
.lib-alert-text {
    font-size: 10px;
    color: var(--lib-bad);
    margin-top: 2px;
}

/* ---------- MAIN HEADER CARD ---------- */
.lib-detail-header-card {
    background: var(--lib-bg-card);
    border: 1px solid var(--lib-border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

/* ---------- TOTAIS (sum/sub) ---------- */
.lib-totais-line {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.lib-totais-line.lib-totais-emphasis {
    padding-top: 10px;
    border-top: 1px solid var(--lib-border);
    margin-top: 6px;
    align-items: baseline;
}
.lib-totais-line.lib-totais-emphasis > :last-child {
    font-size: 22px;
    font-weight: 700;
    color: var(--lib-pri-600);
}
.dark .lib-totais-line.lib-totais-emphasis > :last-child { color: var(--lib-pri-400); }

/* ---------- HISTORIC KPI MINI GRID ---------- */
.lib-histo-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 700px) {
    .lib-histo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.lib-histo-card {
    background: var(--lib-bg-input);
    border: 1px solid var(--lib-border);
    border-radius: 8px;
    padding: 12px;
    font-size: 11px;
}
.lib-histo-card .lib-histo-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--lib-text-body);
    margin-top: 2px;
}

/* ==========================================================================
   TELA DE DETALHE CANCELAMENTO
   Timeline vertical + Impact grid + Modal de ciência
   ========================================================================== */

/* ---------- TIMELINE VERTICAL ---------- */
.lib-tl-step {
    position: relative;
    display: flex;
    gap: 12px;
}
.lib-tl-step + .lib-tl-step { margin-top: 10px; }

.lib-tl-dot {
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    flex-shrink: 0;
    border: 2px solid;
    position: relative;
    z-index: 1;
}
.lib-tl-line {
    position: absolute;
    left: 11px;
    top: 24px;
    bottom: -10px;
    width: 2px;
    background: var(--lib-border);
    z-index: 0;
}
.dark .lib-tl-line { background: rgba(255, 255, 255, 0.1); }

.lib-tl-dot.lib-tl-done {
    background: #dcfce7; color: #15803d; border-color: #bbf7d0;
}
.lib-tl-dot.lib-tl-current {
    background: #fef3c7; color: #b45309; border-color: #fcd34d;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}
.lib-tl-dot.lib-tl-future {
    background: #f3f4f6; color: #9ca3af; border-color: #e5e7eb;
}
.lib-tl-dot.lib-tl-blocked {
    background: #fee2e2; color: #b91c1c; border-color: #fecaca;
}
.dark .lib-tl-dot.lib-tl-done    { background: rgba(34, 197, 94, 0.15); color: #4ade80; border-color: rgba(34, 197, 94, 0.3); }
.dark .lib-tl-dot.lib-tl-current { background: rgba(245, 158, 11, 0.20); color: #fbbf24; border-color: rgba(245, 158, 11, 0.4); }
.dark .lib-tl-dot.lib-tl-future  { background: rgba(255, 255, 255, 0.04); color: #6b7280; border-color: rgba(255, 255, 255, 0.08); }
.dark .lib-tl-dot.lib-tl-blocked { background: rgba(220, 38, 38, 0.20); color: #f87171; border-color: rgba(220, 38, 38, 0.4); }

/* ---------- IMPACT GRID ---------- */
.lib-impact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
}
@media (max-width: 900px) {
    .lib-impact-grid { grid-template-columns: 1fr; }
}
.lib-impact-grid-col-2 { grid-column: span 2 / span 2; }
@media (max-width: 900px) {
    .lib-impact-grid-col-2 { grid-column: span 1 / span 1; }
}

.lib-impact-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid;
    font-size: 12px;
}
.lib-impact-row.lib-impact-yes {
    background: rgba(220, 38, 38, 0.06);
    border-color: rgba(220, 38, 38, 0.25);
}
.lib-impact-row.lib-impact-warn {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.30);
}
.lib-impact-row.lib-impact-no {
    background: rgba(34, 197, 94, 0.06);
    border-color: rgba(34, 197, 94, 0.25);
}
.dark .lib-impact-row.lib-impact-yes  { background: rgba(220, 38, 38, 0.12); }
.dark .lib-impact-row.lib-impact-warn { background: rgba(245, 158, 11, 0.12); }
.dark .lib-impact-row.lib-impact-no   { background: rgba(34, 197, 94, 0.10); }

.lib-impact-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.lib-impact-icon > svg { width: 16px !important; height: 16px !important; }
.lib-impact-yes  .lib-impact-icon { background: var(--lib-red-100);   color: var(--lib-red-600); }
.lib-impact-warn .lib-impact-icon { background: var(--lib-amber-100); color: var(--lib-amber-600); }
.lib-impact-no   .lib-impact-icon { background: var(--lib-green-100); color: var(--lib-green-600); }
.dark .lib-impact-yes  .lib-impact-icon { background: rgba(220, 38, 38, 0.2);  color: #fca5a5; }
.dark .lib-impact-warn .lib-impact-icon { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.dark .lib-impact-no   .lib-impact-icon { background: rgba(34, 197, 94, 0.2);  color: #4ade80; }

.lib-impact-body { flex: 1; min-width: 0; }

.lib-impact-title {
    font-size: 13px;
    font-weight: 600;
}
.lib-impact-yes  .lib-impact-title { color: var(--lib-bad); }
.lib-impact-warn .lib-impact-title { color: var(--lib-warn); }
.lib-impact-no   .lib-impact-title { color: var(--lib-good); }

.lib-impact-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}
.lib-impact-yes  .lib-impact-tag { background: var(--lib-red-100);   color: #991b1b; }
.lib-impact-warn .lib-impact-tag { background: var(--lib-amber-100); color: #92400e; }
.lib-impact-no   .lib-impact-tag { background: var(--lib-green-100); color: #166534; }
.dark .lib-impact-yes  .lib-impact-tag { background: rgba(220, 38, 38, 0.2);  color: #fca5a5; }
.dark .lib-impact-warn .lib-impact-tag { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.dark .lib-impact-no   .lib-impact-tag { background: rgba(34, 197, 94, 0.2);  color: #86efac; }

/* ---------- MODAL DE CIÊNCIA (cancelamento) ---------- */
.lib-modal-danger .lib-modal-header {
    background: var(--lib-red-50);
    border-bottom-color: #fecaca;
}
.dark .lib-modal-danger .lib-modal-header {
    background: rgba(220, 38, 38, 0.10);
    border-bottom-color: rgba(220, 38, 38, 0.25);
}
.lib-modal-danger .lib-modal-header .lib-modal-title {
    color: #991b1b;
}
.dark .lib-modal-danger .lib-modal-header .lib-modal-title {
    color: #fca5a5;
}

.lib-impact-warn-box {
    background: var(--lib-amber-50);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
}
.dark .lib-impact-warn-box {
    background: rgba(245, 158, 11, 0.10);
    border-color: rgba(245, 158, 11, 0.20);
}

.lib-impact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 12px;
}
.lib-impact-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 3px 0;
    color: var(--lib-text-body);
}
.lib-impact-list li::before {
    content: '•';
    color: var(--lib-bad);
    font-weight: bold;
    flex-shrink: 0;
}

.lib-confirm-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--lib-bg-input);
    border: 1px solid var(--lib-border);
    border-radius: 8px;
    font-size: 12px;
    color: var(--lib-text-sub);
    cursor: pointer;
}
.lib-confirm-check input[type="checkbox"] {
    accent-color: var(--lib-red-600);
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   THREAD DE PERGUNTAS/RESPOSTAS (Solicitar mais info)
   ========================================================================== */
.lib-chat-thread {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}
.lib-chat-thread-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--lib-text-faint);
    margin-bottom: 4px;
}

.lib-chat-bubble {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--lib-text-body);
}
.lib-chat-bubble-meta {
    font-size: 10px;
    color: var(--lib-text-faint);
    margin-top: 4px;
}

/* Pergunta (aprovador) — alinhada à esquerda, cor amarela suave */
.lib-chat-bubble.lib-chat-pergunta {
    align-self: flex-start;
    background: var(--lib-pri-50);
    border: 1px solid var(--lib-pri-200);
}
.dark .lib-chat-bubble.lib-chat-pergunta {
    background: rgba(245, 158, 11, 0.10);
    border-color: rgba(245, 158, 11, 0.20);
}

/* Resposta (solicitante) — alinhada à direita, cor azul suave */
.lib-chat-bubble.lib-chat-resposta {
    align-self: flex-end;
    background: var(--lib-blue-100);
    border: 1px solid rgba(59, 130, 246, 0.25);
}
.dark .lib-chat-bubble.lib-chat-resposta {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.25);
}

.lib-chat-input-wrap {
    margin-top: 8px;
    padding: 8px;
    background: var(--lib-bg-input);
    border: 1px solid var(--lib-border);
    border-radius: 8px;
}

.lib-chat-input-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--lib-text-dim);
    margin-bottom: 4px;
    display: block;
}

/* ==========================================================================
   LINK do número do Pedido (abre o Filament Resource em nova aba)
   ========================================================================== */
.lib-pedido-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(59, 130, 246, 0.55);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: color 0.12s ease, text-decoration-color 0.12s ease;
}
.lib-pedido-link:hover,
.lib-pedido-link:focus {
    color: #2563eb;
    text-decoration-color: #2563eb;
}
.lib-pedido-link:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 3px;
}
