/* ===================================
   Valunext — Custom Filament Panel CSS
   Custom page utilities not in theme
   =================================== */

/* --- Layout --- */
.vn-grid            { display: grid; }
.vn-flex            { display: flex; }
.vn-flex-1          { flex: 1; }
.vn-flex-col        { flex-direction: column; }
.vn-items-center    { align-items: center; }
.vn-items-start     { align-items: flex-start; }
.vn-justify-between { justify-content: space-between; }
.vn-justify-center  { justify-content: center; }
.vn-text-center     { text-align: center; }
.vn-w-full          { width: 100%; }
.vn-h-2             { height: 0.5rem; }
.vn-overflow-hidden { overflow: hidden; }
.vn-shrink-0        { flex-shrink: 0; }
.vn-pointer-none    { pointer-events: none; }
.vn-opacity-40      { opacity: 0.4; }
.vn-col-span-2      { grid-column: span 2 / span 2; }

/* --- Gap / Spacing --- */
.vn-gap-2  { gap: 0.5rem; }
.vn-gap-3  { gap: 0.75rem; }
.vn-gap-4  { gap: 1rem; }
.vn-gap-5  { gap: 1.25rem; }
.vn-gap-6  { gap: 1.5rem; }
.vn-p-3    { padding: 0.75rem; }
.vn-p-4    { padding: 1rem; }
.vn-p-5    { padding: 1.25rem; }
.vn-p-6    { padding: 1.5rem; }
.vn-p-8    { padding: 2rem; }
.vn-px-4   { padding-left: 1rem; padding-right: 1rem; }
.vn-px-5   { padding-left: 1.25rem; padding-right: 1.25rem; }
.vn-py-2   { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.vn-py-3   { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.vn-py-4   { padding-top: 1rem; padding-bottom: 1rem; }
.vn-mt-2   { margin-top: 0.5rem; }
.vn-mt-3   { margin-top: 0.75rem; }
.vn-mt-4   { margin-top: 1rem; }
.vn-mt-6   { margin-top: 1.5rem; }
.vn-ml-2   { margin-left: 0.5rem; }
.vn-wrap    { flex-wrap: wrap; }

/* --- Grid columns --- */
.vn-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.vn-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vn-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vn-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 640px) {
    .sm\:vn-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:vn-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sm\:vn-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* --- Typography --- */
.vn-text-xs  { font-size: 0.75rem; line-height: 1rem; }
.vn-text-sm  { font-size: 0.875rem; line-height: 1.25rem; }
.vn-text-base { font-size: 1rem; line-height: 1.5rem; }
.vn-text-lg  { font-size: 1.125rem; line-height: 1.75rem; }
.vn-text-xl  { font-size: 1.25rem; line-height: 1.75rem; }
.vn-text-2xl { font-size: 1.5rem; line-height: 2rem; }
.vn-font-medium   { font-weight: 500; }
.vn-font-semibold { font-weight: 600; }
.vn-tracking-tight { letter-spacing: -0.025em; }

/* --- Text colours --- */
.vn-text-muted    { color: #6b7280; }
.vn-text-subtle   { color: #9ca3af; }
.vn-text-heading  { color: #111827; }
.vn-text-white    { color: #fff; }
.vn-text-amber    { color: #d97706; }
.vn-text-green    { color: #16a34a; }
.vn-text-blue     { color: #2563eb; }
.vn-text-purple   { color: #9333ea; }
.vn-text-orange   { color: #ea580c; }
.vn-text-red      { color: #dc2626; }
.vn-text-gray-i   { color: #9ca3af; }

/* --- Icon tint --- */
.vn-icon-amber  { color: #f59e0b; }
.vn-icon-green  { color: #22c55e; }
.vn-icon-blue   { color: #60a5fa; }
.vn-icon-purple { color: #a78bfa; }
.vn-icon-gray   { color: #9ca3af; }
.vn-icon-orange { color: #fb923c; }

/* --- Card base (mirrors fi-wi-stats-overview-stat but with custom size) --- */
.vn-card {
    position: relative;
    display: block;
    height: 100%;
    border-radius: 0.75rem;
    background-color: #fff;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
    outline: 1px solid rgb(3 7 18 / .05);
    padding: 1rem;
}
.dark .vn-card { background-color: #111827; outline-color: rgb(255 255 255 / .1); }

/* Compact stat card */
.vn-stat-value { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.025em; color: #111827; margin-top: 0.375rem; }
.dark .vn-stat-value { color: #fff; }
.vn-stat-label { font-size: 0.75rem; font-weight: 500; color: #6b7280; }
.vn-stat-desc  { font-size: 0.7rem; color: #9ca3af; margin-top: 0.1rem; }

/* --- Franqueado bar (compact, horizontal) --- */
.vn-info-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 0.75rem;
    background-color: #fff;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
    outline: 1px solid rgb(3 7 18 / .05);
    padding: 0.625rem 1rem;
}
.dark .vn-info-bar { background-color: #111827; outline-color: rgb(255 255 255 / .1); }
.vn-info-bar-label { font-size: 0.7rem; color: #9ca3af; }
.vn-info-bar-value { font-size: 0.875rem; font-weight: 600; color: #111827; }
.dark .vn-info-bar-value { color: #fff; }

/* --- Plan banner (top of EmitirRelatorio) --- */
.vn-plan-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-radius: 0.75rem;
    background-color: #fff;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
    outline: 1px solid rgb(3 7 18 / .05);
    padding: 0.875rem 1.25rem;
}
.dark .vn-plan-banner { background-color: #111827; outline-color: rgb(255 255 255 / .1); }
.vn-plan-banner-group { display: flex; align-items: center; gap: 0.625rem; }
.vn-plan-banner-label { font-size: 0.7rem; color: #9ca3af; }
.vn-plan-banner-value { font-size: 0.875rem; font-weight: 600; color: #111827; }
.dark .vn-plan-banner-value { color: #fff; }

/* Progress bar */
.vn-progress-wrap { display: flex; align-items: center; gap: 0.5rem; min-width: 140px; }
.vn-progress-bg   { height: 0.5rem; flex: 1; background: #e5e7eb; border-radius: 9999px; overflow: hidden; }
.dark .vn-progress-bg { background: #374151; }
.vn-progress-bar  { height: 100%; border-radius: 9999px; background: #f59e0b; transition: width .3s; }
.vn-progress-bar.danger { background: #ef4444; }
.vn-progress-pct  { font-size: 0.7rem; color: #9ca3af; white-space: nowrap; }

/* --- Action card (Emitir Relatório) --- */
.vn-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    border-radius: 1rem;
    background-color: #fff;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
    outline: 1px solid rgb(3 7 18 / .05);
    padding: 2rem 1.5rem;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: box-shadow .2s, outline-color .2s;
    min-height: 220px;
}
.dark .vn-action-card { background-color: #111827; outline-color: rgb(255 255 255 / .1); }
.vn-action-card:hover { box-shadow: 0 4px 16px 0 rgb(0 0 0 / .10); outline-color: rgb(3 7 18 / .15); }
.dark .vn-action-card:hover { box-shadow: 0 4px 16px 0 rgb(0 0 0 / .4); outline-color: rgb(255 255 255 / .18); }
.vn-action-card.disabled { opacity: 0.4; pointer-events: none; }

/* Horizontal (row) variant — compact, used in dashboard quick actions */
.vn-action-card.vn-row {
    flex-direction: row;
    align-items: center;
    text-align: left;
    min-height: 0;
    padding: 1.25rem 1.5rem;
    gap: 1rem;
}

/* Icon circle inside action card */
.vn-action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 9999px;
    flex-shrink: 0;
}
.vn-action-icon.primary { background: #fffbeb; color: #d97706; outline: 1px solid #fde68a; }
.vn-action-icon.warning { background: #fff7ed; color: #ea580c; outline: 1px solid #fed7aa; }
.vn-action-icon.danger  { background: #fff1f2; color: #e11d48; outline: 1px solid #fecdd3; }
.vn-action-icon.purple  { background: #f5f3ff; color: #7c3aed; outline: 1px solid #ddd6fe; }
.dark .vn-action-icon.primary { background: rgb(120 53 15 / .3); color: #fbbf24; outline-color: rgb(120 53 15 / .5); }
.dark .vn-action-icon.warning { background: rgb(124 45 18 / .3); color: #fb923c; outline-color: rgb(124 45 18 / .5); }
.dark .vn-action-icon.danger  { background: rgb(136 19 55 / .3); color: #fb7185; outline-color: rgb(136 19 55 / .5); }
.dark .vn-action-icon.purple  { background: rgb(91 33 182 / .3); color: #a78bfa; outline-color: rgb(91 33 182 / .5); }

.vn-action-card-title { font-size: 1.125rem; font-weight: 600; color: #111827; }
.dark .vn-action-card-title { color: #fff; }
.vn-action-card-desc  { font-size: 0.8125rem; color: #6b7280; margin-top: 0.25rem; line-height: 1.5; }
.vn-action-card-cta   { font-size: 0.8125rem; font-weight: 500; display: inline-flex; align-items: center; gap: 0.25rem; margin-top: 0.25rem; }
.vn-action-card-cta.primary { color: #d97706; }
.vn-action-card-cta.warning { color: #ea580c; }
.vn-action-card-cta.danger  { color: #e11d48; }
.vn-action-card-cta.purple  { color: #7c3aed; }

/* Icon size helpers */
.vn-icon-sm { width: 1rem; height: 1rem; }
.vn-icon-md { width: 1.25rem; height: 1.25rem; }
.vn-icon-lg { width: 2rem; height: 2rem; }

/* ============================================================
   VALUNEXT — CHART & TABLE UTILITIES
   ============================================================ */

/* Chart card wrapper */
.vn-chart-card {
    background-color: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
    outline: 1px solid rgb(3 7 18 / .05);
    padding: 1.25rem 1.5rem 1rem;
}
.dark .vn-chart-card { background-color: #111827; outline-color: rgb(255 255 255 / .1); }

.vn-chart-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dark .vn-chart-title { color: #9ca3af; }

.vn-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

/* Data table */
.vn-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.vn-table th {
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    padding: 0 0.5rem 0.5rem;
    border-bottom: 1px solid #f3f4f6;
}
.dark .vn-table th { border-color: #1f2937; color: #6b7280; }
.vn-table td {
    padding: 0.5rem;
    color: #111827;
    border-bottom: 1px solid #f9fafb;
    vertical-align: middle;
}
.dark .vn-table td { color: #e5e7eb; border-color: #1f2937; }
.vn-table tr:last-child td { border-bottom: none; }
.vn-table tr:hover td { background-color: #f9fafb; }
.dark .vn-table tr:hover td { background-color: #1f2937; }

/* Badge */
.vn-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
}
.vn-badge-green  { background: #dcfce7; color: #166534; }
.vn-badge-amber  { background: #fef3c7; color: #92400e; }
.vn-badge-red    { background: #fee2e2; color: #991b1b; }
.vn-badge-gray   { background: #f3f4f6; color: #4b5563; }
.dark .vn-badge-green  { background: rgb(22 101 52 / .3); color: #4ade80; }
.dark .vn-badge-amber  { background: rgb(120 53 15 / .3); color: #fbbf24; }
.dark .vn-badge-red    { background: rgb(153 27 27 / .3); color: #f87171; }

/* --- Field tiles (Wizard Pro360: resumo de revisão) --- */
.vn-field-tile      { padding: 0.6rem 0.75rem; background-color: #f9fafb; border-radius: 0.5rem; }
.dark .vn-field-tile { background-color: #1f2937; }
.vn-field-label      { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: #6b7280; }
.dark .vn-field-label { color: #9ca3af; }
.vn-field-value      { font-size: 0.92rem; font-weight: 800; color: #00234a; margin-top: 0.2rem; }
.dark .vn-field-value { color: #f3f4f6; }
.vn-field-delta-pos  { font-size: 0.7rem; color: #059669; margin-top: 0.15rem; }
.vn-field-delta-neg  { font-size: 0.7rem; color: #dc2626; margin-top: 0.15rem; }
.dark .vn-field-delta-pos { color: #34d399; }
.dark .vn-field-delta-neg { color: #f87171; }
.vn-gw-dot { display: inline-block; width: 0.45rem; height: 0.45rem; border-radius: 9999px; margin-right: 0.2rem; }

/* --- Wizard header: substitui a scrollbar cinzenta nativa por uma fina e na cor da marca --- */
.fi-sc-wizard-header {
    scrollbar-width: thin;
    scrollbar-color: rgba(1, 215, 164, .45) transparent;
    padding-bottom: 0.35rem;
}
.fi-sc-wizard-header::-webkit-scrollbar        { height: 5px; }
.fi-sc-wizard-header::-webkit-scrollbar-track  { background: transparent; }
.fi-sc-wizard-header::-webkit-scrollbar-thumb  { background-color: rgba(1, 215, 164, .4); border-radius: 9999px; }
.fi-sc-wizard-header::-webkit-scrollbar-thumb:hover { background-color: rgba(1, 215, 164, .7); }

/* --- Wizard PRO 360°: tratamento visual completo (scoped a .fi-sc-wizard) --- */

/* Passo activo: fade + slide subtil ao trocar de passo */
@keyframes vnWizardStepIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fi-sc-wizard-step.fi-active { animation: vnWizardStepIn .28s ease-out; }

/* Círculo do passo: glow na etapa activa, sombra na concluída */
.fi-sc-wizard-header-step.fi-active .fi-sc-wizard-header-step-icon-ctn {
    box-shadow: 0 0 0 5px rgba(1, 215, 164, .16);
}
.fi-sc-wizard-header-step.fi-completed .fi-sc-wizard-header-step-icon-ctn {
    box-shadow: 0 2px 8px rgba(1, 215, 164, .35);
}

/* Cards de secção: cantos arredondados, sombra suave, faixa superior na cor da marca */
.fi-sc-wizard .fi-section {
    border-radius: 1rem !important;
    box-shadow: 0 1px 3px rgba(0, 35, 74, .07), 0 1px 2px rgba(0, 35, 74, .04) !important;
    border-top: 3px solid rgba(1, 215, 164, .55);
    transition: box-shadow .2s ease, border-color .2s ease;
}
.fi-sc-wizard .fi-section + .fi-section { margin-top: 1.35rem; }
.fi-sc-wizard .fi-section:hover {
    box-shadow: 0 6px 18px rgba(0, 35, 74, .1), 0 2px 4px rgba(0, 35, 74, .05) !important;
}
.fi-sc-wizard .fi-section:focus-within {
    border-top-color: #01d7a4;
    box-shadow: 0 6px 20px rgba(1, 215, 164, .2) !important;
}

/* Cabeçalho da secção: ícone em badge circular com gradiente da marca */
.fi-sc-wizard .fi-section-header { align-items: center; }
.fi-sc-wizard .fi-section-header > .fi-icon {
    box-sizing: border-box;
    width: 2.5rem !important;
    height: 2.5rem !important;
    padding: .55rem;
    margin-top: 0 !important;
    border-radius: 9999px;
    background: linear-gradient(135deg, rgba(1, 215, 164, .18), rgba(0, 35, 74, .08));
    color: #01a389 !important;
}
.dark .fi-sc-wizard .fi-section-header > .fi-icon {
    background: linear-gradient(135deg, rgba(1, 215, 164, .24), rgba(255, 255, 255, .06));
    color: #5eead4 !important;
}
.fi-sc-wizard .fi-section-header-heading {
    font-weight: 800 !important;
    color: #00234a !important;
    letter-spacing: .01em;
}
.dark .fi-sc-wizard .fi-section-header-heading { color: #f3f4f6 !important; }

/* Labels dos campos: um pouco mais fortes que o texto normal */
.fi-sc-wizard .fi-fo-field-label-content { font-weight: 600; color: #374151; }
.dark .fi-sc-wizard .fi-fo-field-label-content { color: #d1d5db; }

/* Inputs: cantos mais suaves + halo teal ao focar */
.fi-sc-wizard .fi-input-wrp {
    border-radius: .625rem !important;
    transition: box-shadow .15s ease;
}
.fi-sc-wizard .fi-input-wrp:focus-within {
    box-shadow: 0 0 0 3px rgba(1, 215, 164, .22) !important;
}
.fi-sc-wizard .fi-input-wrp-prefix .fi-input-wrp-label {
    color: #01a389;
    font-weight: 700;
}
.dark .fi-sc-wizard .fi-input-wrp-prefix .fi-input-wrp-label { color: #5eead4; }

/* Rodapé do wizard: respiro extra + botões com leve elevação ao passar o rato */
.fi-sc-wizard .fi-sc-wizard-footer {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0, 35, 74, .08);
}
.dark .fi-sc-wizard .fi-sc-wizard-footer { border-top-color: rgba(255, 255, 255, .08); }
.fi-sc-wizard .fi-sc-wizard-footer .fi-btn {
    transition: transform .15s ease, box-shadow .15s ease;
}
.fi-sc-wizard .fi-sc-wizard-footer .fi-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(1, 215, 164, .25);
}

/* --- CenárioLab: mesmo tratamento visual, na cor de marca do módulo (violeta/roxo) --- */

.vn-cenariolab-form .fi-section {
    border-radius: 1rem !important;
    box-shadow: 0 1px 3px rgba(76, 29, 149, .07), 0 1px 2px rgba(76, 29, 149, .04) !important;
    border-top: 3px solid rgba(139, 92, 246, .55);
    transition: box-shadow .2s ease, border-color .2s ease;
}
.vn-cenariolab-form .fi-section + .fi-section { margin-top: 1.35rem; }
.vn-cenariolab-form .fi-section:hover {
    box-shadow: 0 6px 18px rgba(76, 29, 149, .12), 0 2px 4px rgba(76, 29, 149, .05) !important;
}
.vn-cenariolab-form .fi-section:focus-within {
    border-top-color: #8b5cf6;
    box-shadow: 0 6px 20px rgba(139, 92, 246, .22) !important;
}

.vn-cenariolab-form .fi-section-header { align-items: center; }
.vn-cenariolab-form .fi-section-header > .fi-icon {
    box-sizing: border-box;
    width: 2.5rem !important;
    height: 2.5rem !important;
    padding: .55rem;
    margin-top: 0 !important;
    border-radius: 9999px;
    background: linear-gradient(135deg, rgba(139, 92, 246, .18), rgba(76, 29, 149, .1));
    color: #7c3aed !important;
}
.dark .vn-cenariolab-form .fi-section-header > .fi-icon {
    background: linear-gradient(135deg, rgba(139, 92, 246, .28), rgba(255, 255, 255, .06));
    color: #c4b5fd !important;
}
.vn-cenariolab-form .fi-section-header-heading {
    font-weight: 800 !important;
    color: #4c1d95 !important;
    letter-spacing: .01em;
}
.dark .vn-cenariolab-form .fi-section-header-heading { color: #f3f4f6 !important; }
.vn-cenariolab-form .fi-section-header-description { color: #7c6a9c; }

.vn-cenariolab-form .fi-fo-field-label-content { font-weight: 600; color: #374151; }
.dark .vn-cenariolab-form .fi-fo-field-label-content { color: #d1d5db; }

.vn-cenariolab-form .fi-input-wrp {
    border-radius: .625rem !important;
    transition: box-shadow .15s ease;
}
.vn-cenariolab-form .fi-input-wrp:focus-within {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, .25) !important;
}
.vn-cenariolab-form .fi-input-wrp-suffix .fi-input-wrp-label,
.vn-cenariolab-form .fi-input-wrp-prefix .fi-input-wrp-label {
    color: #7c3aed;
    font-weight: 700;
}
.dark .vn-cenariolab-form .fi-input-wrp-suffix .fi-input-wrp-label,
.dark .vn-cenariolab-form .fi-input-wrp-prefix .fi-input-wrp-label { color: #c4b5fd; }

/* Botão "Calcular CenárioLab": gradiente violeta em vez do primary genérico */
.vn-cenariolab-submit .fi-btn {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9) !important;
    border-color: transparent !important;
    transition: transform .15s ease, box-shadow .15s ease;
}
.vn-cenariolab-submit .fi-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, .35);
}
.dark .vn-badge-gray   { background: #1f2937; color: #9ca3af; }

/* ============================================================
   VALUNEXT — COUNTRY FILTER TABS
   ============================================================ */

.vn-country-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    background: #f3f4f6;
    text-decoration: none;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.vn-country-tab:hover {
    background: #e5e7eb;
    color: #111827;
}
.vn-country-tab.active {
    background: #00234a;
    color: #fff;
}
.dark .vn-country-tab { background: #1f2937; color: #9ca3af; }
.dark .vn-country-tab:hover { background: #374151; color: #e5e7eb; }
.dark .vn-country-tab.active { background: #01d7a4; color: #00234a; }

/* ============================================================
   VALUNEXT — TOPBAR COUNTRY SELECTOR (Livewire)
   ============================================================ */

.vn-country-selector {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0 0.75rem;
}

.vn-cs-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.vn-cs-tab:hover { background: #e5e7eb; color: #111827; }
.vn-cs-tab.active { background: #00234a; color: #fff; }
.dark .vn-cs-tab { background: #1f2937; color: #9ca3af; }
.dark .vn-cs-tab:hover { background: #374151; color: #e5e7eb; }
.dark .vn-cs-tab.active { background: #01d7a4; color: #00234a; }

/* ============================================================
   VALUNEXT — SIDEBAR + BREADCRUMBS
   Brand: #00234a (navy) | #01d7a4 (teal)
   ============================================================ */

/* Hide breadcrumbs on all pages */
.fi-breadcrumbs { display: none !important; }
.fi-header-has-breadcrumbs > div { row-gap: 0 !important; }

/* ---------- Nav group labels (separators) ---------- */
/* e.g. "Rede ValuNext", "B2B — Licenciados", "B2C", "Sistema" */
.fi-sidebar-group-label {
    font-size: 0.6875rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.07em !important;
    text-transform: uppercase !important;
    color: #01d7a4 !important;
}
.dark .fi-sidebar-group-label { color: #01d7a4 !important; }

/* Keep collapse chevron in teal too */
.fi-sidebar-group-btn svg {
    color: #01d7a4 !important;
    opacity: 0.7;
}

/* ---------- Nav item — default state ---------- */
.fi-sidebar-item-label {
    font-size: 0.9375rem !important;
    font-weight: 500 !important;
    letter-spacing: -0.01em;
    color: #00234a !important;
}
.dark .fi-sidebar-item-label { color: #e2e8f0 !important; }

.fi-sidebar-item-icon {
    color: #00234a !important;
    opacity: 0.75;
    width: 1.5rem !important;
    height: 1.5rem !important;
    flex-shrink: 0;
}
.dark .fi-sidebar-item-icon { color: #94a3b8 !important; }

/* ---------- Nav item — hover ---------- */
.fi-sidebar-item-btn:hover .fi-sidebar-item-label {
    color: #01d7a4 !important;
}
.fi-sidebar-item-btn:hover .fi-sidebar-item-icon {
    color: #01d7a4 !important;
    opacity: 1;
}

/* ---------- Nav item — active ---------- */
.fi-sidebar-item.fi-active .fi-sidebar-item-btn {
    background-color: rgb(1 215 164 / 0.08) !important;
    border-radius: 0.5rem;
}
.fi-sidebar-item.fi-active .fi-sidebar-item-label {
    color: #01d7a4 !important;
    font-weight: 600 !important;
}
.fi-sidebar-item.fi-active .fi-sidebar-item-icon {
    color: #01d7a4 !important;
    opacity: 1;
}

/* ---------- Nav item height — slightly more generous ---------- */
.fi-sidebar-item-btn {
    padding-top: 0.5625rem !important;
    padding-bottom: 0.5625rem !important;
}

/* --- Sidebar — margin-top separators (Documentos, Masters) --- */
.fi-sidebar-item:has(a[href*="/documentos"]),
.fi-sidebar-item:has(a[href*="/masters"]) {
    margin-top: 10px;
}

/* ============================================================
   VALUNEXT — NEW ORDER TOAST NOTIFICATION
   Posição: canto superior esquerdo da área de conteúdo
   ============================================================ */

[x-cloak] { display: none !important; }

.vn-order-toast {
    position: fixed;
    top: 72px;
    left: calc(270px + 20px);
    z-index: 9999;
    width: 300px;
    background: #00234a;
    border: 1px solid rgba(1, 215, 164, 0.25);
    border-left: 3px solid #01d7a4;
    border-radius: 10px;
    padding: 14px 14px 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.vn-toast-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.vn-toast-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: rgba(1, 215, 164, 0.15);
    border-radius: 6px;
    color: #01d7a4;
    flex-shrink: 0;
}

.vn-toast-title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.vn-toast-close {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    border: none;
    border-radius: 4px;
    color: rgba(255,255,255,0.5);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, color .15s;
}
.vn-toast-close:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.vn-toast-body {
    font-size: 12px;
    color: rgba(194, 206, 232, 0.85);
    padding-left: 34px;
}

.vn-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: #01d7a4;
    border-radius: 0 0 0 10px;
    animation: vn-toast-countdown 5s linear forwards;
    transform-origin: left;
}

@keyframes vn-toast-countdown {
    from { width: 100%; }
    to   { width: 0%; }
}

/* Alpine transitions — slide-in from left */
.vn-toast-enter         { transition: opacity 300ms ease, transform 300ms ease; }
.vn-toast-enter-start   { opacity: 0; transform: translateX(-24px); }
.vn-toast-enter-end     { opacity: 1; transform: translateX(0); }
.vn-toast-leave         { transition: opacity 200ms ease, transform 200ms ease; }
.vn-toast-leave-start   { opacity: 1; transform: translateX(0); }
.vn-toast-leave-end     { opacity: 0; transform: translateX(-24px); }

/* --- Orders stats — 4 colunas, fonte compacta --- */
.fi-stats-overview-stat-value {
    font-size: 1.75rem !important;
    line-height: 1.2 !important;
}
.fi-stats-overview-stat-label {
    font-size: 0.8rem !important;
}
.fi-stats-overview-stat-description {
    font-size: 0.72rem !important;
}

/* ── Subscription Plan Edit — sections como separadores planos ─────────── */
.vn-plan-editor .fi-section {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 0 4px 0 !important;
}
.vn-plan-editor .fi-section-header-wrapper {
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.vn-plan-editor .fi-section-header {
    padding: 0 !important;
}
.vn-plan-editor .fi-section-heading {
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    color: #374151 !important;
}
.vn-plan-editor .fi-section-description {
    font-size: 12px !important;
    color: #6b7280 !important;
    margin-top: 2px !important;
}
.vn-plan-editor .fi-section-content-wrapper {
    padding: 0 !important;
}
.vn-plan-editor .fi-section-content {
    padding: 0 !important;
}
.vn-plan-editor > div > div {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ============================================================
   VALUNEXT — UNIVERSAL FILAMENT TABLE THEME
   Aplica-se automaticamente a TODAS as tabelas nativas Filament
   (Orders, Packs, Territories, Franqueados, Clients, Coupons, Users, etc.)
   — sem tocar em cada Table::configure() individual.
   Brand: #00234a (navy) | #01d7a4 (teal)
   ============================================================ */

/* --- Container: cantos e sombra alinhados com vn-card --- */
.fi-ta-ctn {
    border-radius: 0.75rem !important;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05) !important;
}

/* --- Header cells: muted uppercase, igual ao vn-section-title --- */
.fi-ta-header-cell {
    background-color: #f9fafb !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.055em !important;
    color: #6b7280 !important;
}
.dark .fi-ta-header-cell {
    background-color: #161f2e !important;
    color: #9ca3af !important;
}
/* O botão de ordenação herda a cor/tipografia do <th> — só o ícone precisa de reforço */
.fi-ta-header-cell-sort-btn { color: inherit !important; }

/* Coluna ordenada activa — em teal */
.fi-ta-header-cell-sorted,
.fi-ta-header-cell-sorted .fi-ta-header-cell-sort-btn {
    color: #01a37e !important;
}
.dark .fi-ta-header-cell-sorted,
.dark .fi-ta-header-cell-sorted .fi-ta-header-cell-sort-btn {
    color: #01d7a4 !important;
}

/* --- Rows: hover consistente com vn-table --- */
.fi-ta-row:hover {
    background-color: #f9fafb !important;
}
.dark .fi-ta-row:hover {
    background-color: #1a2332 !important;
}

/* --- Badges: peso/arredondamento coerentes com vn-badge --- */
.fi-badge {
    font-weight: 600 !important;
    border-radius: 9999px !important;
}

/* --- Search + filtros: foco e destaque em teal em vez do amber por omissão --- */
.fi-ta-search-field .fi-input-wrp:focus-within,
.fi-ta-filters-dropdown .fi-dropdown-trigger button:focus-visible {
    outline-color: #01d7a4 !important;
}
.fi-ta-filters-dropdown .fi-icon-btn-badge-ctn .fi-badge {
    background-color: #01d7a4 !important;
    color: #00234a !important;
}

/* --- Paginação: página actual em navy/teal em vez do amber por omissão --- */
.fi-pagination-item.fi-active .fi-pagination-item-btn {
    background-color: #00234a !important;
}
.fi-pagination-item.fi-active .fi-pagination-item-label {
    color: #fff !important;
}
.dark .fi-pagination-item.fi-active .fi-pagination-item-btn {
    background-color: #01d7a4 !important;
}
.dark .fi-pagination-item.fi-active .fi-pagination-item-label {
    color: #00234a !important;
}

/* ============================================================
   VALUNEXT — CHAT (Licenciado ↔ Franqueado ↔ Master)
   ============================================================ */

.vn-chat-shell {
    display: flex;
    height: calc(100vh - 220px);
    min-height: 480px;
    border-radius: 0.75rem;
    background-color: #fff;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
    outline: 1px solid rgb(3 7 18 / .05);
    overflow: hidden;
}
.dark .vn-chat-shell { background-color: #111827; outline-color: rgb(255 255 255 / .1); }

.vn-chat-sidebar {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #f3f4f6;
    overflow-y: auto;
}
.dark .vn-chat-sidebar { border-color: #1f2937; }

.vn-chat-contact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-left: 3px solid transparent;
    text-decoration: none;
    transition: background .15s;
}
.vn-chat-contact:hover { background-color: #f9fafb; }
.dark .vn-chat-contact:hover { background-color: #1a2332; }
.vn-chat-contact.active { background-color: rgb(1 215 164 / .08); border-left-color: #01d7a4; }

.vn-chat-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background: #00234a;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.vn-chat-contact-name { font-size: 0.875rem; font-weight: 600; color: #111827; }
.dark .vn-chat-contact-name { color: #fff; }
.vn-chat-contact-role { font-size: 0.7rem; color: #9ca3af; }

.vn-chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.vn-chat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}
.dark .vn-chat-header { border-color: #1f2937; }

.vn-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.vn-chat-bubble-row { display: flex; }
.vn-chat-bubble-row.mine { justify-content: flex-end; }

.vn-chat-bubble {
    max-width: 70%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    background: #f3f4f6;
    color: #111827;
    border-top-left-radius: 0.2rem;
}
.dark .vn-chat-bubble { background: #1f2937; color: #e5e7eb; }
.vn-chat-bubble-row.mine .vn-chat-bubble {
    background: #01d7a4;
    color: #00234a;
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.2rem;
}
.vn-chat-bubble-time { font-size: 0.65rem; color: #9ca3af; margin-top: 0.25rem; }
.vn-chat-bubble-row.mine .vn-chat-bubble-time { text-align: right; }

.vn-chat-input-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #f3f4f6;
    flex-shrink: 0;
}
.dark .vn-chat-input-bar { border-color: #1f2937; }
.vn-chat-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    padding: 0.55rem 1rem;
    font-size: 0.8125rem;
    background: transparent;
    color: #111827;
}
.dark .vn-chat-input { border-color: #374151; color: #fff; }
.vn-chat-input:focus { outline: none; border-color: #01d7a4; }
.vn-chat-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    background: #01d7a4;
    color: #00234a;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}
.vn-chat-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.875rem;
    text-align: center;
    padding: 2rem;
}

/* ============================================================
   VALUNEXT — SUPPORT TICKETS (SuperAdmin)
   ============================================================ */

.vn-ticket-tabs {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    background: #f3f4f6;
    border-radius: 0.5rem;
    padding: 0.125rem;
}
.dark .vn-ticket-tabs { background: #1f2937; }
.vn-ticket-tab {
    padding: 0.5rem 0.9rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    background: transparent;
    border: none;
    cursor: pointer;
}
.vn-ticket-tab.active { background: #fff; color: #111827; box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05); }
.dark .vn-ticket-tab { color: #9ca3af; }
.dark .vn-ticket-tab.active { background: #111827; color: #fff; }

.vn-badge-blue { background: #dbeafe; color: #1d4ed8; }
.dark .vn-badge-blue { background: rgb(29 78 216 / .25); color: #60a5fa; }

.vn-ticket-detail-list { list-style: none; margin: 0; padding: 0; }
.vn-ticket-detail-list li {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.8125rem;
}
.dark .vn-ticket-detail-list li { border-color: #1f2937; }
.vn-ticket-detail-list li:last-child { border-bottom: none; }
.vn-ticket-detail-list li span:first-child { color: #9ca3af; }
.vn-ticket-detail-list li span:last-child { color: #111827; font-weight: 500; }
.dark .vn-ticket-detail-list li span:last-child { color: #e5e7eb; }

/* ============================================================
   Vídeos tutoriais — botão "Ver tutorial" no título + modal
   ============================================================ */

/* Título da página com o botão ao lado.
   display:flex (não inline-flex): dentro do <h1> um inline-flex é alinhado
   pela baseline da linha, o que empurrava o botão para cima. Como bloco,
   o align-items:center centra o botão com o texto do título. */
.vn-tut-heading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    line-height: 1;
    width: fit-content;
    max-width: 100%;
}
.vn-tut-heading-text { display: inline-block; }

/* Wrapper do componente <x-tutorial-video variant="icon"> */
.vn-tut--icon { display: inline-flex; align-items: center; }

/* Trigger em linha: imagem à esquerda + "Ver tutorial" ao lado, ambos
   centrados à altura do título da página. */
.vn-tut-trigger {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    line-height: 1;
    font-size: inherit; /* para o 'em' do ícone seguir o tamanho do <h1> */
    color: #00234a;
    transition: transform 0.12s ease, opacity 0.12s ease;
}
.vn-tut-trigger:hover { transform: translateY(-1px); }
.vn-tut-trigger:active { transform: translateY(0); }
.vn-tut-trigger:focus-visible {
    outline: 2px solid #01d7a4;
    outline-offset: 3px;
    border-radius: 8px;
}
/* Acompanha a altura do título (font-size do <h1> herdado) */
.vn-tut-icon {
    width: auto;
    height: 1.4em;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
}
.vn-tut-caption {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #01d7a4;
    white-space: nowrap;
}
.dark .vn-tut-trigger { color: #e5e7eb; }

/* Variante "pill" âmbar — usada no wizard PRO 360 (Regras e Glossário / Como preencher) */
.vn-tut--pill { display: inline-flex; }
.vn-tut-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem 0.3rem 0.4rem;
    background: #fde68a;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background 0.12s ease, transform 0.12s ease;
}
.vn-tut-pill:hover { background: #fcd34d; transform: translateY(-1px); }
.vn-tut-pill:focus-visible { outline: 2px solid #01d7a4; outline-offset: 2px; }
.vn-tut-pill-icon { width: 20px; height: 20px; display: block; flex-shrink: 0; color: #92400e; }
.vn-tut-pill-label { white-space: nowrap; }
.dark .vn-tut-pill { background: #78350f; color: #fde68a; border-color: #92400e; }
.dark .vn-tut-pill:hover { background: #92400e; }
.dark .vn-tut-pill-icon { color: #fde68a; }

/* Linha do pill no topo de cada passo do wizard / abaixo do título */
.vn-tut-pill-row { margin: 0 0 1rem; }
.vn-tut-step-row { margin: 0 0 0.5rem; }

/* Overlay + modal (partilhado pelo tutorial e pelo onboarding) */
.vn-tut-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(2px);
}
.vn-tut-modal {
    position: relative;
    width: min(960px, 100%);
    background: #000;
    border-radius: 14px;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.6);
}
.vn-tut-close {
    position: absolute;
    top: -2.6rem;
    right: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    line-height: 1;
    color: #fff;
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0.85;
}
.vn-tut-close:hover { opacity: 1; }
.vn-tut-video {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
}
.vn-tut-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Modal de Onboarding — variação clara com cabeçalho e acções */
.vn-onb-modal {
    width: min(760px, 100%);
    background: #fff;
    padding: 1.75rem;
}
.dark .vn-onb-modal { background: #0f172a; }
.vn-onb-modal .vn-tut-close { color: #94a3b8; top: 0.75rem; right: 0.9rem; }
.vn-onb-head { margin-bottom: 1.1rem; padding-right: 2rem; }
.vn-onb-head h2 {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #00234a;
}
.dark .vn-onb-head h2 { color: #f1f5f9; }
.vn-onb-head p {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
}
.vn-onb-modal .vn-tut-video { border-radius: 10px; }
.vn-onb-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.25rem;
}
.vn-onb-actions form { margin: 0; }
.vn-onb-later {
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
}
.vn-onb-later:hover { color: #0f172a; }
.dark .vn-onb-later:hover { color: #e2e8f0; }
.vn-onb-done {
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background: #01d7a4;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s ease;
}
.vn-onb-done:hover { background: #01b98d; }

@media (max-width: 640px) {
    .vn-tut-close { top: 0.5rem; right: 0.5rem; }
    .vn-onb-actions { flex-direction: column-reverse; align-items: stretch; }
    .vn-onb-actions form,
    .vn-onb-done { width: 100%; }
}
