/* =====================================================================
   CONTROLE DE FROTAS — TEMA DO SISTEMA
   ---------------------------------------------------------------------
   Mesmo visual do painel de atendimento (chatbot). Cores, fonte e
   arredondamento vêm das variáveis geradas pela Personalização
   (ver css_tema() em inc/configuracoes.php).

   1. Base, botões e formulários        6. Login e recuperação de senha
   2. Menu lateral                      7. Responsivo
   3. Topo colorido (hero)              8. Personalização e fotos
   4. Rodapé                            9. Componentes da frota
   5. Componentes gerais               10. Tabelas, modais e agenda
   ===================================================================== */

:root {
    --fc-sidebar-w: 218px;
    --fc-sidebar-w-collapsed: 76px;
    --fc-card-bg: #ffffff;
    --fc-card-border: rgba(20, 20, 40, .06);
    --fc-muted: #6d6d78;
    --fc-text: #26262c;
    --fc-soft-gray: #f1f1f4;
    --fc-shadow: 0 1px 2px rgba(20, 20, 40, .04), 0 6px 18px rgba(20, 20, 40, .045);
    --fc-shadow-lg: 0 12px 38px rgba(20, 20, 40, .16);
    --fc-green: #1f9d55;
    --fc-green-soft: rgba(31, 157, 85, .12);
    --fc-blue: #2f6fdb;
    --fc-blue-soft: rgba(47, 111, 219, .12);
    --fc-gray-soft: rgba(110, 110, 125, .12);
}

[data-bs-theme="dark"] {
    --fc-body-bg: #16161b !important;
    --fc-sidebar-bg: #1d1d23 !important;
    --fc-sidebar-text: #d7d7de !important;
    --fc-sidebar-text-rgb: 215, 215, 222 !important;
    --fc-card-bg: #202027;
    --fc-card-border: rgba(255, 255, 255, .06);
    --fc-muted: #a1a1ad;
    --fc-text: #ececf1;
    --fc-soft-gray: #2a2a33;
    --fc-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --bs-body-bg: #16161b;
    --bs-tertiary-bg: #202027;
}

html, body { height: 100%; }

body.fc {
    font-family: var(--fc-font);
    background: var(--fc-body-bg);
    color: var(--fc-text);
    font-size: .875rem;
    -webkit-font-smoothing: antialiased;
}

.min-w-0 { min-width: 0; }
.text-primary { color: var(--fc-primary) !important; }
.bg-primary { background-color: var(--fc-primary) !important; }
a { text-decoration: none; }

/* ------------------------------------------------------------------ botões */
.btn { font-weight: 500; border-radius: var(--fc-radius-sm); }
.btn-primary {
    --bs-btn-bg: var(--fc-primary);
    --bs-btn-border-color: var(--fc-primary);
    --bs-btn-color: var(--fc-on-primary);
    --bs-btn-hover-bg: var(--fc-primary-dark);
    --bs-btn-hover-border-color: var(--fc-primary-dark);
    --bs-btn-hover-color: var(--fc-on-primary);
    --bs-btn-active-bg: var(--fc-primary-darker);
    --bs-btn-active-border-color: var(--fc-primary-darker);
    --bs-btn-active-color: var(--fc-on-primary);
    --bs-btn-disabled-bg: var(--fc-primary);
    --bs-btn-disabled-border-color: var(--fc-primary);
    --bs-btn-disabled-color: var(--fc-on-primary);
    font-weight: 600;
}
.btn-outline-primary {
    --bs-btn-color: var(--fc-primary);
    --bs-btn-border-color: var(--fc-primary);
    --bs-btn-hover-bg: var(--fc-primary);
    --bs-btn-hover-border-color: var(--fc-primary);
    --bs-btn-hover-color: var(--fc-on-primary);
    --bs-btn-active-bg: var(--fc-primary-dark);
    --bs-btn-active-border-color: var(--fc-primary-dark);
}
.btn-soft {
    background: var(--fc-primary-soft);
    color: var(--fc-primary);
    border: 0;
}
.btn-soft:hover, .btn-soft:focus { background: var(--fc-primary); color: var(--fc-on-primary); }
.btn-light-gray { background: var(--fc-soft-gray); border: 0; color: var(--fc-text); }
.btn-light-gray:hover { background: rgba(var(--fc-primary-rgb), .12); color: var(--fc-primary); }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn-sm.btn-icon { width: 30px; height: 30px; }

.form-control, .form-select { border-radius: var(--fc-radius-sm); }
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: rgba(var(--fc-primary-rgb), .55);
    box-shadow: 0 0 0 .2rem rgba(var(--fc-primary-rgb), .15);
}
.form-check-input:checked { background-color: var(--fc-primary); border-color: var(--fc-primary); }
.form-label { font-weight: 500; font-size: .82rem; margin-bottom: .3rem; }
.form-text { font-size: .76rem; }
.nav-pills .nav-link.active { background: var(--fc-primary); color: var(--fc-on-primary); }
.nav-pills .nav-link { color: var(--fc-text); font-weight: 500; }
.page-link { color: var(--fc-primary); }
.active > .page-link, .page-link.active { background: var(--fc-primary); border-color: var(--fc-primary); color: var(--fc-on-primary); }
.badge-status { font-weight: 500; padding: .38em .7em; }
.badge-status i { margin-right: .15rem; }
.text-bg-primary { background-color: var(--fc-primary) !important; color: var(--fc-on-primary) !important; }
.dropdown-item.active, .dropdown-item:active { background: var(--fc-primary); color: var(--fc-on-primary); }
.progress-bar { background-color: var(--fc-primary); }

/* ------------------------------------------------------------------ menu lateral */
.fc-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--fc-sidebar-w);
    background: var(--fc-sidebar-bg);
    color: var(--fc-sidebar-text);
    border-right: 1px solid rgba(var(--fc-sidebar-text-rgb), .08);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: width .2s ease, transform .25s ease;
}
.fc-brand {
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    flex-shrink: 0;
}
.fc-brand-logo { max-height: 42px; max-width: 100%; object-fit: contain; }
.fc-brand-icon { display: none; width: 38px; height: 38px; object-fit: contain; }

.fc-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 10px; scrollbar-width: thin; }
.fc-nav-item { margin-bottom: 4px; }
.fc-nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--fc-sidebar-text);
    padding: 6px 8px;
    border-radius: var(--fc-radius);
    font-weight: 500;
    font-size: .84rem;
    text-align: left;
    transition: background .15s;
}
.fc-nav-link:hover { background: rgba(var(--fc-sidebar-text-rgb), .05); color: var(--fc-sidebar-text); }
.fc-nav-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: calc(var(--fc-radius-sm) + 1px);
    background: rgba(var(--fc-sidebar-text-rgb), .07);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    color: rgba(var(--fc-sidebar-text-rgb), .75);
    transition: background .15s, color .15s;
}
.fc-nav-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-caret { font-size: .7rem; opacity: .6; transition: transform .2s; }
.fc-nav-item.open > .fc-nav-link .fc-caret { transform: rotate(180deg); }
.fc-nav-item.active > .fc-nav-link { background: var(--fc-primary-soft); color: var(--fc-primary); font-weight: 600; }
.fc-nav-item.active > .fc-nav-link .fc-nav-icon { background: var(--fc-primary); color: var(--fc-on-primary); }

.fc-sub { display: none; padding: 4px 0 6px 20px; }
.fc-nav-item.open > .fc-sub { display: block; }
.fc-sub-label { display: none !important; }
.fc-sub-title { display: none; }
.fc-sub-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px 7px 14px;
    color: rgba(var(--fc-sidebar-text-rgb), .85);
    font-size: .82rem;
    border-radius: var(--fc-radius-sm);
    border-left: 2px solid rgba(var(--fc-sidebar-text-rgb), .1);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.fc-sub-link i { font-size: .9rem; opacity: .7; }
.fc-sub-link:hover { color: var(--fc-primary); background: rgba(var(--fc-sidebar-text-rgb), .04); }
.fc-sub-link.active { color: var(--fc-primary); font-weight: 600; border-left-color: var(--fc-primary); background: var(--fc-primary-soft); }
.fc-sub-link.active i { opacity: 1; }
.fc-count {
    margin-left: auto;
    min-width: 20px;
    padding: 0 6px;
    height: 18px;
    border-radius: 9px;
    background: var(--fc-secondary);
    color: var(--fc-on-secondary);
    font-size: .68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fc-collapse {
    border: 0;
    border-top: 1px solid rgba(var(--fc-sidebar-text-rgb), .08);
    background: transparent;
    color: var(--fc-sidebar-text);
    height: 54px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 26px;
    font-weight: 500;
    font-size: .82rem;
    flex-shrink: 0;
}
.fc-collapse:hover { color: var(--fc-primary); }
.fc-collapse i { transition: transform .2s; }

/* Menu recolhido: só ícones e submenus flutuantes */
.sidebar-collapsed .fc-sidebar { width: var(--fc-sidebar-w-collapsed); }
.sidebar-collapsed .fc-brand-logo { display: none; }
.sidebar-collapsed .fc-brand-icon { display: block; }
.sidebar-collapsed .fc-nav { overflow: visible; padding: 6px 13px; }
.sidebar-collapsed .fc-nav-link { justify-content: center; padding: 6px; }
.sidebar-collapsed .fc-nav-label,
.sidebar-collapsed .fc-caret,
.sidebar-collapsed .fc-collapse span { display: none; }
.sidebar-collapsed .fc-collapse { justify-content: center; padding: 0; }
.sidebar-collapsed .fc-collapse i { transform: rotate(180deg); }
.sidebar-collapsed .fc-nav-item.open > .fc-sub { display: none; }
.sidebar-collapsed .fc-nav-item > .fc-sub {
    position: fixed;
    left: calc(var(--fc-sidebar-w-collapsed) - 4px);
    min-width: 220px;
    padding: 8px;
    background: var(--fc-sidebar-bg);
    border-radius: var(--fc-radius);
    box-shadow: var(--fc-shadow-lg);
    border: 1px solid rgba(var(--fc-sidebar-text-rgb), .08);
    z-index: 1060;
}
.sidebar-collapsed .fc-nav-item > .fc-sub::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 0;
    bottom: 0;
    width: 14px;
}
.sidebar-collapsed .fc-nav-item.flyout > .fc-sub { display: block !important; animation: fcFly .14s ease-out; }
.sidebar-collapsed .fc-sub-title {
    display: block;
    font-weight: 700;
    font-size: .8rem;
    padding: 4px 10px 8px;
    color: var(--fc-sidebar-text);
}
.sidebar-collapsed .fc-sub-label .fc-sub-title { padding: 2px 6px; }
.sidebar-collapsed .fc-sub-link { border-left: 0; border-radius: var(--fc-radius-sm); padding-left: 10px; }
@keyframes fcFly { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ área principal */
.fc-main {
    margin-left: var(--fc-sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .2s ease;
}
.sidebar-collapsed .fc-main { margin-left: var(--fc-sidebar-w-collapsed); }

.fc-hero {
    position: relative;
    z-index: 1025; /* acima do conteúdo: os menus do topo não ficam por trás dos cartões */
    background: linear-gradient(180deg, var(--fc-primary) 0%, var(--fc-primary-deep, var(--fc-primary)) 100%);
    color: var(--fc-hero-text);
    padding: 12px 36px 0;
}
.fc-hero-deco { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.fc-hero-line { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: linear-gradient(180deg, var(--fc-secondary) 0 55%, var(--fc-accent) 55% 100%); }
.hero-full .fc-hero { min-height: 218px; padding-bottom: 54px; }
.hero-page .fc-hero { padding-bottom: 44px; }
.hero-mini .fc-hero { padding-bottom: 22px; }
.hero-mini .fc-wave { height: 28px; }

.fc-topbar { display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }
.fc-search {
    display: flex;
    align-items: center;
    width: min(526px, 100%);
    min-width: 0;
    flex: 0 1 auto;
    background: rgba(255, 255, 255, .15);
    border-radius: 999px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, .08);
}
.fc-search-scope {
    border: 0;
    background: rgba(255, 255, 255, .15) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='white' d='M4 6l4 4 4-4z'/%3e%3c/svg%3e") no-repeat right 10px center / 10px;
    color: var(--fc-hero-text);
    border-radius: 999px;
    height: 30px;
    padding: 0 28px 0 12px;
    font-size: .76rem;
    font-weight: 600;
    appearance: none;
    width: 150px;
    cursor: pointer;
}
.fc-search-scope option { color: #222; }
.fc-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--fc-hero-text);
    padding: 0 12px;
    font-size: .8rem;
    outline: none;
}
.fc-search input::placeholder { color: rgba(255, 255, 255, .75); }
.fc-search button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 0;
    background: #fff;
    color: var(--fc-primary);
    font-size: .82rem;
    flex-shrink: 0;
}
.fc-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.fc-round {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, .15);
    color: var(--fc-hero-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    transition: background .15s;
}
.fc-round:hover, .fc-round[aria-expanded="true"] { background: rgba(255, 255, 255, .28); color: var(--fc-hero-text); }
.fc-dot {
    position: absolute;
    top: -3px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--fc-secondary);
    color: var(--fc-on-secondary);
    font-size: .6rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px var(--fc-primary);
}
.fc-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .85);
    background: #fff;
    color: var(--fc-primary);
    font-weight: 700;
    font-size: .78rem;
    padding: 0;
    overflow: hidden;
}
.fc-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
img.fc-av, img.fc-av.has-photo { object-fit: cover; background: var(--fc-soft-gray); padding: 0; }
.fc-dropdown { border: 0; box-shadow: var(--fc-shadow-lg); border-radius: var(--fc-radius); padding: 6px; min-width: 240px; font-size: .84rem; }
.fc-dropdown .dropdown-item { border-radius: var(--fc-radius-sm); padding: 7px 10px; }
.fc-acc-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.fc-hero-body { position: relative; z-index: 2; padding: 22px 0 6px; max-width: calc(100% - 200px); }
.fc-greeting {
    font-weight: 800;
    font-style: italic;
    font-size: clamp(1.9rem, 3.2vw, 2.65rem);
    letter-spacing: -.02em;
    margin: 0 0 6px;
    line-height: 1.1;
}
.fc-hero-sub { margin: 0 0 12px; opacity: .92; font-size: .86rem; }
.fc-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.fc-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, .16);
    border-radius: 999px;
    padding: 4px 11px;
    font-size: .72rem;
    font-weight: 600;
}
.fc-hero-mark {
    position: absolute;
    right: 36px;
    top: 58px;
    width: 160px;
    height: 128px;
    object-fit: contain;
    opacity: .96;
    z-index: 1;
    pointer-events: none;
}
.fc-hero-mark.to-white { filter: brightness(0) invert(1); }
.fc-hero-page { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: none; padding-top: 20px; flex-wrap: wrap; }
.fc-page-title { font-weight: 800; font-style: italic; font-size: 1.65rem; margin: 0; letter-spacing: -.01em; line-height: 1.15; }
.fc-hero-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--fc-radius);
    background: rgba(255, 255, 255, .16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.fc-crumbs { font-size: .74rem; opacity: .85; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fc-crumbs a { color: inherit; }
.fc-crumbs a:hover { text-decoration: underline; }
.fc-crumbs i { font-size: .6rem; }
.fc-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fc-hero-actions .btn-light { color: var(--fc-primary); font-weight: 600; border: 0; }
.fc-hero-actions .btn-ghost { background: rgba(255, 255, 255, .16); color: var(--fc-hero-text); border: 0; }
.fc-hero-actions .btn-ghost:hover { background: rgba(255, 255, 255, .28); }

.fc-wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 40px; display: block; z-index: 1; }
.fc-wave-s1 { fill: var(--fc-secondary); }
.fc-wave-s2 { fill: var(--fc-accent); }
.fc-wave-body { fill: var(--fc-body-bg); }

.fc-content { flex: 1; padding: 22px 36px 24px; width: 100%; max-width: 1480px; margin: 0 auto; }
.hero-mini .fc-content { max-width: none; }

/* ------------------------------------------------------------------ rodapé */
.fc-footer {
    position: sticky;
    bottom: 12px;
    margin: 0 36px 12px;
    background: var(--fc-card-bg);
    border-radius: var(--fc-radius);
    box-shadow: var(--fc-shadow);
    padding: 7px 14px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: .76rem;
    z-index: 20;
}
.fc-footer-brand { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.fc-footer-brand img { width: 22px; height: 22px; object-fit: contain; }
.fc-footer-brand strong { font-weight: 700; white-space: nowrap; }
.fc-footer-text { color: var(--fc-muted); }
.fc-version { background: var(--fc-primary-soft); color: var(--fc-primary); border-radius: 999px; padding: 2px 9px; font-weight: 600; }
.fc-chip {
    border: 0;
    background: var(--fc-soft-gray);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: .74rem;
    font-weight: 600;
    color: var(--fc-text);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.fc-chip-count { background: rgba(0, 0, 0, .12); border-radius: 999px; padding: 0 6px; font-size: .68rem; }
.fc-chip-count.has { background: var(--fc-primary); color: var(--fc-on-primary); }
.fc-alerts { min-width: 320px; max-width: 380px; }
.fc-footer-stats { margin-left: auto; display: flex; gap: 14px; color: var(--fc-muted); flex-wrap: wrap; justify-content: flex-end; }
.fc-footer-stats b { color: var(--fc-text); font-weight: 700; margin-left: 3px; }
.fc-footer-year { color: var(--fc-muted); }
.hero-mini .fc-footer { display: none; }

/* ------------------------------------------------------------------ componentes */
.fc-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 6px 2px 12px;
}
.fc-section-title h2, .fc-section-title h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.fc-section-title small { color: var(--fc-muted); font-size: .76rem; }

.fc-card {
    background: var(--fc-card-bg);
    border-radius: var(--fc-radius);
    box-shadow: var(--fc-shadow);
    border: 1px solid var(--fc-card-border);
}
.fc-card-body { padding: 18px 20px; }
.fc-card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--fc-card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.fc-card-header h3, .fc-card-header h4 { font-size: .95rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 8px; }
.fc-card-footer { padding: 12px 20px; border-top: 1px solid var(--fc-card-border); }

.fc-ico {
    width: 36px;
    height: 36px;
    border-radius: var(--fc-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--fc-primary-soft);
    color: var(--fc-primary);
    font-size: 1.05rem;
    flex-shrink: 0;
}
.fc-ico.sm { width: 30px; height: 30px; font-size: .9rem; }
.fc-ico.lg { width: 44px; height: 44px; font-size: 1.25rem; }
.fc-ico.alt { background: var(--fc-secondary-soft); color: var(--fc-secondary-dark); }
.fc-ico.green { background: var(--fc-green-soft); color: var(--fc-green); }
.fc-ico.blue { background: var(--fc-blue-soft); color: var(--fc-blue); }
.fc-ico.gray { background: var(--fc-gray-soft); color: var(--fc-muted); }

/* Acesso rápido */
.fc-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 26px; }
.fc-quick a {
    background: var(--fc-card-bg);
    border-radius: var(--fc-radius);
    box-shadow: var(--fc-shadow);
    border: 1px solid var(--fc-card-border);
    min-height: 92px;
    padding: 14px 10px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--fc-text);
    font-weight: 600;
    font-size: .78rem;
    text-align: center;
    transition: border-color .15s, transform .15s;
}
.fc-quick a:hover { border-color: rgba(var(--fc-primary-rgb), .35); transform: translateY(-1px); }

/* Visão geral */
.fc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.fc-stat {
    display: block;
    background: var(--fc-card-bg);
    border-radius: var(--fc-radius);
    box-shadow: var(--fc-shadow);
    border: 1px solid var(--fc-card-border);
    padding: 14px 16px 12px;
    color: var(--fc-text);
    min-height: 112px;
}
a.fc-stat:hover { border-color: rgba(var(--fc-primary-rgb), .35); color: var(--fc-text); }
.fc-stat .fc-ico { width: 30px; height: 30px; font-size: .9rem; margin-bottom: 12px; }
.fc-stat-label { font-size: .76rem; font-weight: 600; color: var(--fc-muted); display: block; }
.fc-stat-value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.fc-stat-value small { font-size: .7rem; font-weight: 600; color: var(--fc-muted); }
.fc-stat.highlight { background: var(--fc-primary); color: var(--fc-on-primary); border-color: transparent; box-shadow: 0 8px 22px rgba(var(--fc-primary-rgb), .3); }
.fc-stat.highlight .fc-stat-label, .fc-stat.highlight .fc-stat-value small { color: var(--fc-on-primary); opacity: .9; }
.fc-stat.highlight .fc-ico { background: rgba(255, 255, 255, .2); color: var(--fc-on-primary); }
a.fc-stat.highlight:hover { color: var(--fc-on-primary); }

.fc-row-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; flex-wrap: wrap; }
.fc-row-card .fc-row-text { flex: 1; min-width: 200px; }
.fc-row-card .fc-row-text strong { font-size: .8rem; display: block; }
.fc-row-card .fc-row-text small { color: var(--fc-muted); font-size: .74rem; }

/* Tabelas */
.fc-table { margin: 0; --bs-table-bg: transparent; }
.fc-table > :not(caption) > * > * { padding: .7rem .9rem; border-color: var(--fc-card-border); vertical-align: middle; }
.fc-table thead th { font-size: .72rem; font-weight: 600; color: var(--fc-muted); background: transparent; white-space: nowrap; }
.fc-table tbody tr:hover > * { background: rgba(var(--fc-primary-rgb), .025); }
.fc-table .cell-title { font-weight: 600; color: var(--fc-text); }
.fc-table .cell-sub { font-size: .74rem; color: var(--fc-muted); }
.table-actions { white-space: nowrap; text-align: right; }

.fc-empty { text-align: center; padding: 40px 20px; color: var(--fc-muted); }
.fc-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--fc-primary-soft);
    color: var(--fc-primary);
    font-size: 1.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.fc-empty h2, .fc-empty h3 { color: var(--fc-text); font-size: 1.05rem; font-weight: 700; }
.fc-empty p { max-width: 460px; margin: 0 auto 14px; }

.fc-filter { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fc-filter .form-control, .fc-filter .form-select { width: auto; min-width: 150px; }

.fc-kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: .82rem; }
.fc-kv dt { color: var(--fc-muted); font-weight: 500; }
.fc-kv dd { margin: 0; word-break: break-word; }

.fc-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .76rem;
    background: var(--fc-soft-gray);
    border-radius: var(--fc-radius-sm);
    padding: 10px 12px;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 360px;
    overflow: auto;
}
.fc-copy { position: relative; display: flex; gap: 6px; }
.fc-copy input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; }

.fc-steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.fc-steps li { counter-increment: step; position: relative; padding: 0 0 14px 38px; font-size: .82rem; }
.fc-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: -2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--fc-primary-soft);
    color: var(--fc-primary);
    font-weight: 700;
    font-size: .75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fc-tabs { border-bottom: 1px solid var(--fc-card-border); gap: 4px; padding: 0 12px; }
.fc-tabs .nav-link { border: 0; color: var(--fc-muted); font-weight: 600; font-size: .82rem; padding: 12px 12px 10px; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; }
.fc-tabs .nav-link.active { color: var(--fc-primary); border-bottom-color: var(--fc-primary); background: transparent; }

.fc-color { display: flex; align-items: center; gap: 8px; }
.fc-color input[type=color] { width: 44px; height: 38px; padding: 3px; border-radius: var(--fc-radius-sm); flex-shrink: 0; }
.fc-color input[type=text] { font-family: ui-monospace, Menlo, Consolas, monospace; text-transform: uppercase; }

.fc-dot-status { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--fc-muted); }
.fc-dot-status.on { background: var(--fc-green); box-shadow: 0 0 0 3px var(--fc-green-soft); }
.fc-dot-status.off { background: #dc3545; }

.fc-meter { height: 8px; border-radius: 4px; background: var(--fc-soft-gray); overflow: hidden; }
.fc-meter > span { display: block; height: 100%; background: var(--fc-primary); border-radius: 4px; }
.fc-meter.warn > span { background: var(--fc-secondary); }
.fc-meter.danger > span { background: #dc3545; }

.list-tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--fc-soft-gray); }
.list-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tag, #999); }

.var-chip {
    display: inline-block;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: .72rem;
    background: var(--fc-secondary-soft);
    color: var(--fc-secondary-dark);
    padding: 1px 7px;
    border-radius: 6px;
    margin: 2px;
    cursor: pointer;
    border: 0;
}
[data-bs-theme="dark"] .var-chip { color: var(--fc-secondary); }

/* TomSelect no tema */
.ts-wrapper.form-select, .ts-wrapper.form-control { padding: 0 !important; }
.ts-control { border-radius: var(--fc-radius-sm) !important; min-height: 38px; }
.focus .ts-control { border-color: rgba(var(--fc-primary-rgb), .55) !important; box-shadow: 0 0 0 .2rem rgba(var(--fc-primary-rgb), .15) !important; }
.ts-dropdown .active { background: var(--fc-primary-soft) !important; color: var(--fc-text) !important; }
.ts-wrapper.multi .ts-control > div { background: var(--fc-primary-soft) !important; color: var(--fc-primary) !important; border-radius: 6px !important; border: 0 !important; }
[data-bs-theme="dark"] .ts-control, [data-bs-theme="dark"] .ts-dropdown { background: #2a2a33 !important; color: #eee !important; border-color: #3a3a44 !important; }
[data-bs-theme="dark"] .ts-control input { color: #eee !important; }

/* SweetAlert no tema */
.swal2-popup { border-radius: var(--fc-radius) !important; font-family: var(--fc-font) !important; }
.swal2-styled.swal2-confirm { background: var(--fc-primary) !important; border-radius: var(--fc-radius-sm) !important; }
.swal2-styled.swal2-cancel { border-radius: var(--fc-radius-sm) !important; }
.swal2-styled:focus { box-shadow: 0 0 0 3px rgba(var(--fc-primary-rgb), .3) !important; }
[data-bs-theme="dark"] .swal2-popup { background: #202027; color: #ececf1; }

/* ------------------------------------------------------------------ login e recuperação de senha */
.fc-blank { background: var(--fc-body-bg); }
.fc-auth { display: flex; min-height: 100vh; }
.fc-auth-art {
    position: relative;
    flex: 0 0 43%;
    max-width: 43%;
    background: linear-gradient(180deg, var(--fc-primary) 0%, var(--fc-primary-deep, var(--fc-primary)) 100%) center / cover no-repeat;
    color: var(--fc-hero-text);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 72px 48px 40px;
    overflow: hidden;
}
.fc-auth-art.has-image::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(var(--fc-primary-rgb), .55), rgba(var(--fc-primary-rgb), .85)); }
.fc-auth-art-inner { position: relative; z-index: 2; max-width: 380px; display: flex; flex-direction: column; align-items: center; }
.fc-auth-mark { width: 96px; height: 82px; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .18)); }
.fc-auth-mark.to-white { filter: brightness(0) invert(1) drop-shadow(0 6px 14px rgba(0, 0, 0, .18)); }
.fc-auth-art h2 { font-weight: 800; font-style: italic; font-size: clamp(2.2rem, 3.6vw, 3.3rem); letter-spacing: -.02em; margin: 14px 0 6px; line-height: 1.05; }
.fc-auth-art p { font-size: .98rem; opacity: .92; margin: 0; max-width: 300px; line-height: 1.45; }
.fc-auth-divider { position: absolute; top: 0; right: 0; bottom: 0; width: 46px; height: 100%; z-index: 3; }
.fc-auth-divider .s1 { fill: var(--fc-secondary); }
.fc-auth-divider .s2 { fill: var(--fc-accent); }
.fc-auth-divider .bg { fill: var(--fc-body-bg); }
.fc-auth-wave { display: none; }
.fc-auth-main { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; }
.fc-auth-theme { position: fixed; top: 14px; right: 18px; z-index: 10; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--fc-card-bg); color: var(--fc-text); box-shadow: var(--fc-shadow); display: inline-flex; align-items: center; justify-content: center; }
.fc-auth-theme:hover { color: var(--fc-primary); }
.fc-auth-card { width: 100%; max-width: 380px; background: var(--fc-card-bg); border-radius: 20px; box-shadow: 0 8px 30px rgba(20, 20, 40, .06), 0 1px 2px rgba(20, 20, 40, .04); padding: 30px 28px 28px; }
.fc-auth-logo { display: block; max-height: 62px; max-width: 230px; margin: 0 auto 22px; object-fit: contain; }
.fc-auth-title { font-weight: 800; font-size: 1.2rem; margin: 0 0 2px; }
.fc-auth-sub { color: var(--fc-muted); font-size: .8rem; margin: 0 0 18px; line-height: 1.45; }
.fc-field { position: relative; }
.fc-field > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--fc-muted); font-size: .95rem; pointer-events: none; z-index: 2; }
.fc-field .form-control { height: 46px; padding-left: 40px; border-radius: 10px; font-size: .88rem; }
.fc-field .form-control:focus { border-color: rgba(var(--fc-primary-rgb), .55); box-shadow: 0 0 0 3px rgba(var(--fc-primary-rgb), .12); }
.fc-field .fc-field-btn + *, .fc-field:has(.fc-field-btn) .form-control { padding-right: 42px; }
.fc-field-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--fc-muted); width: 34px; height: 34px; border-radius: 8px; z-index: 2; }
.fc-field-btn:hover { color: var(--fc-primary); }
.fc-field .form-control.is-invalid { background-image: none; padding-right: 42px; }
.fc-auth-link { color: var(--fc-primary); font-weight: 700; font-size: .78rem; text-decoration: none; }
.fc-auth-link:hover { text-decoration: underline; color: var(--fc-primary-dark); }
.fc-auth-btn { height: 46px; border-radius: 10px; font-weight: 700; }
.fc-auth-back { display: block; text-align: center; margin-top: 16px; font-size: .8rem; color: var(--fc-muted); text-decoration: none; }
.fc-auth-back:hover { color: var(--fc-primary); }
.fc-auth-copy { margin: 18px 0 0; font-size: .74rem; color: var(--fc-muted); text-align: center; }
.fc-auth-copy b { color: var(--fc-text); }
.fc-auth-copy .sep { opacity: .6; margin: 0 2px; }
.fc-auth-steps { display: flex; gap: 6px; margin-bottom: 16px; }
.fc-auth-steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--fc-soft-gray); }
.fc-auth-steps span.done { background: rgba(var(--fc-primary-rgb), .4); }
.fc-auth-steps span.on { background: var(--fc-primary); }
.fc-otp { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 4px 0 20px; }
.fc-otp-box { width: 44px; height: 54px; text-align: center; font-size: 1.45rem; font-weight: 700; border: 1px solid var(--bs-border-color); border-radius: 10px; background: var(--bs-body-bg); color: var(--fc-text); caret-color: var(--fc-primary); transition: border-color .15s, box-shadow .15s; }
.fc-otp-box:focus { outline: 0; border-color: var(--fc-primary); box-shadow: 0 0 0 3px rgba(var(--fc-primary-rgb), .14); }
.fc-otp-sep { font-weight: 700; color: var(--fc-muted); margin: 0 3px; }
form.shake { animation: fcShake .4s; }
@keyframes fcShake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.fc-pw-rules { list-style: none; padding: 10px 12px; margin: 0; border-radius: 10px; background: var(--fc-body-bg); font-size: .76rem; display: grid; gap: 3px; }
.fc-pw-rules li { display: flex; align-items: center; gap: 7px; color: var(--fc-muted); transition: color .15s; }
.fc-pw-rules li i { font-size: .8rem; }
.fc-pw-rules li.ok { color: #198754; }
.fc-pw-rules.touched li:not(.ok) { color: var(--fc-text); }
@media (max-width: 860px) {
    .fc-auth { flex-direction: column; }
    .fc-auth-art { flex: none; max-width: none; min-height: 230px; padding: 36px 24px 64px; }
    .fc-auth-divider { display: none; }
    .fc-auth-wave { display: block; height: 40px; }
    .fc-auth-art h2 { font-size: 2rem; }
    .fc-auth-mark { width: 70px; height: 60px; }
    .fc-auth-main { padding: 20px 16px 30px; justify-content: flex-start; }
    .fc-auth-theme { background: rgba(255, 255, 255, .2); color: #fff; box-shadow: none; }
}
@media (max-width: 400px) {
    .fc-otp-box { width: 38px; height: 48px; font-size: 1.2rem; }
    .fc-auth-card { padding: 24px 18px; }
}

/* ------------------------------------------------------------------ responsivo */
.fc-backdrop { display: none; }
@media (max-width: 991.98px) {
    .fc-sidebar { transform: translateX(-100%); width: var(--fc-sidebar-w) !important; box-shadow: var(--fc-shadow-lg); }
    .sidebar-open .fc-sidebar { transform: none; }
    .sidebar-open .fc-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 1035; }
    .fc-main, .sidebar-collapsed .fc-main { margin-left: 0; }
    .sidebar-collapsed .fc-brand-logo { display: block; }
    .sidebar-collapsed .fc-brand-icon { display: none; }
    .sidebar-collapsed .fc-nav-label, .sidebar-collapsed .fc-caret { display: inline; }
    .sidebar-collapsed .fc-nav-link { justify-content: flex-start; }
    .fc-collapse { display: none; }
    .fc-hero { padding: 10px 16px 0; }
    .fc-content { padding: 18px 16px 20px; }
    .fc-footer { margin: 0 16px 10px; flex-wrap: wrap; }
    .fc-hero-mark { width: 90px; height: 76px; right: 16px; top: 64px; opacity: .35; }
    .fc-hero-body { max-width: 100%; }
    .fc-search-scope { display: none; }
}
@media (max-width: 575.98px) {
    .fc-actions .dropdown:nth-of-type(2), .fc-actions .dropdown:nth-of-type(1) { display: none; }
    .fc-topbar { gap: 8px; }
    .fc-hero-mark { display: none; }
    .fc-actions { gap: 6px; }
    .fc-kv { grid-template-columns: 1fr; }
    .fc-footer-stats { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------------------------ extras */
.fc-acc-dot { display: inline-block; vertical-align: middle; }
.fc-av {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 700; color: #fff;
    background: var(--acc, var(--fc-primary));
}
.fc-av.lg { width: 56px; height: 56px; font-size: 1.05rem; }
.swal2-styled.swal2-confirm.swal-danger { background: #dc3545 !important; }
.cursor-pointer { cursor: pointer; }
.fs-7 { font-size: .8rem; }
.text-pre { white-space: pre-wrap; }
.fc-help { font-size: .76rem; color: var(--fc-muted); }
.fc-toggle-card { border: 1px solid var(--fc-card-border); border-radius: var(--fc-radius-sm); padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; }
.fc-toggle-card .form-check-input { margin-top: 3px; }
.fc-sticky-actions { position: sticky; bottom: 76px; z-index: 5; background: var(--fc-card-bg); border: 1px solid var(--fc-card-border); border-radius: var(--fc-radius); box-shadow: var(--fc-shadow-lg); padding: 10px 14px; display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 16px; }

/* ------------------------------------------------------------------ personalização */
.fc-preset { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--fc-card-border); background: var(--fc-card-bg); border-radius: 999px; padding: 4px 10px 4px 4px; color: var(--fc-text); }
.fc-preset span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--fc-card-bg); }
.fc-preset span + span { margin-left: -6px; }
.fc-preset span:last-of-type { margin-right: 6px; }
.fc-preset small { font-weight: 600; font-size: .74rem; }
.fc-preset:hover { border-color: var(--fc-primary); }
.fc-upload { display: flex; gap: 12px; align-items: flex-start; border: 1px dashed var(--fc-card-border); border-radius: var(--fc-radius-sm); padding: 10px; height: 100%; }
.fc-upload-thumb { width: 84px; height: 64px; border-radius: 8px; background: var(--fc-body-bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; color: var(--fc-muted); font-size: 1.4rem; }
.fc-upload-thumb.dark { background: #1f2227; }
.fc-upload-thumb img { max-width: 90%; max-height: 90%; object-fit: contain; }
.fc-brand-pv { --pv-radius: 14px; display: grid; grid-template-columns: 34% 1fr; border-radius: 12px; overflow: hidden; border: 1px solid var(--fc-card-border); font-family: var(--pv-font); min-height: 300px; background: var(--pv-body); }
.fc-brand-pv .pv-side { background: var(--pv-side-bg); color: var(--pv-side-text); padding: 12px 8px; font-size: .68rem; border-right: 1px solid rgba(0, 0, 0, .06); }
.fc-brand-pv .pv-logo { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: .95rem; color: var(--pv-primary); margin: 0 4px 12px; min-height: 26px; }
.fc-brand-pv .pv-logo .pv-icon { width: 24px; height: 24px; }
.fc-brand-pv .pv-logo .pv-full { display: none; max-width: 100%; max-height: 28px; }
.fc-brand-pv .pv-logo.has-logo .pv-icon, .fc-brand-pv .pv-logo.has-logo span { display: none; }
.fc-brand-pv .pv-logo.has-logo .pv-full { display: block; }
.fc-brand-pv .pv-item { padding: 7px 8px; border-radius: calc(var(--pv-radius) * .6); margin-bottom: 3px; display: flex; gap: 6px; font-weight: 500; }
.fc-brand-pv .pv-item.active { background: color-mix(in srgb, var(--pv-primary) 12%, transparent); color: var(--pv-primary); font-weight: 700; }
.fc-brand-pv .pv-main { display: flex; flex-direction: column; }
.fc-brand-pv .pv-hero { background: linear-gradient(135deg, var(--pv-primary), var(--pv-primary-dark)); color: var(--pv-hero-text); padding: 16px 14px 14px; display: flex; flex-direction: column; font-size: .7rem; }
.fc-brand-pv .pv-hero strong { font-size: 1rem; font-style: italic; }
.fc-brand-pv .pv-pills { display: flex; gap: 4px; margin-top: 8px; }
.fc-brand-pv .pv-pills span { background: rgba(255, 255, 255, .18); border-radius: 999px; padding: 2px 8px; font-size: .62rem; }
.fc-brand-pv .pv-wave { height: 10px; background: linear-gradient(176deg, var(--pv-primary-dark) 30%, var(--pv-secondary) 31%, var(--pv-secondary) 55%, var(--pv-accent, #F7DC2B) 56%, var(--pv-accent, #F7DC2B) 78%, transparent 79%); }
.fc-brand-pv.no-wave .pv-wave { background: var(--pv-primary-dark); height: 2px; }
.fc-brand-pv .pv-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.fc-brand-pv .pv-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fc-brand-pv .pv-card { background: #fff; border-radius: var(--pv-radius); padding: 10px; display: flex; flex-direction: column; font-size: .64rem; color: #555; box-shadow: 0 1px 4px rgba(0, 0, 0, .06); }
.fc-brand-pv .pv-card b { font-size: 1.1rem; color: #222; }
.fc-brand-pv .pv-card.hl { background: var(--pv-primary); color: var(--pv-hero-text); }
.fc-brand-pv .pv-card.hl b { color: var(--pv-hero-text); }
.fc-brand-pv .pv-btn { align-self: flex-start; background: var(--pv-primary); color: #fff; border-radius: 999px; padding: 6px 14px; font-size: .7rem; font-weight: 600; }
.fc-content section[id] { scroll-margin-top: 16px; }
/* ------------------------------------------------------------------ carregamento entre páginas */
.fc-loader {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(242, 242, 245, .82);
    background: color-mix(in srgb, var(--fc-body-bg) 78%, transparent);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s ease, visibility 0s linear .22s;
}
.fc-loader.is-on, .fc-loader.is-boot { opacity: 1; visibility: visible; transition: opacity .18s ease; }
/* garantia: se o JavaScript falhar, a tela de carregamento some sozinha */
.fc-loader.is-boot { animation: fcLoaderAuto 0s linear 5s forwards; }
@keyframes fcLoaderAuto { to { opacity: 0; visibility: hidden; } }
.fc-loader-box { position: relative; width: 104px; height: 104px; display: flex; align-items: center; justify-content: center; }
.fc-loader-ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: fcSpin 1.1s linear infinite; }
.fc-loader-ring circle { fill: none; stroke-width: 5; stroke-linecap: round; }
.fc-loader-ring .track { stroke: rgba(var(--fc-primary-rgb), .12); }
.fc-loader-ring .arc { stroke: var(--fc-primary); stroke-dasharray: 90 190; }
.fc-loader-box::after {
    content: "";
    position: absolute;
    inset: 9px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--fc-secondary);
    border-right-color: var(--fc-accent);
    animation: fcSpin 1.6s linear infinite reverse;
}
.fc-loader-icon { width: 54px; height: 54px; object-fit: contain; animation: fcPulse 1.1s ease-in-out infinite; }
@keyframes fcSpin { to { transform: rotate(360deg); } }
@keyframes fcPulse { 0%, 100% { transform: scale(.9); } 50% { transform: scale(1.06); } }
/* ------------------------------------------------------------------ foto do usuário */
.fc-photo-picker { position: relative; width: 124px; height: 124px; }
.fc-photo-picker img, .fc-photo-initials { width: 124px; height: 124px; border-radius: 50%; object-fit: cover; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 4px var(--fc-card-bg), 0 0 0 6px rgba(var(--fc-primary-rgb), .25); }
.fc-photo-initials { background: var(--fc-primary-soft); color: var(--fc-primary); font-size: 2.4rem; font-weight: 800; }
.fc-photo-btn { position: absolute; right: 2px; bottom: 2px; width: 38px; height: 38px; border-radius: 50%; background: var(--fc-primary); color: var(--fc-on-primary); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 0 0 3px var(--fc-card-bg); transition: transform .15s; }
.fc-photo-btn:hover { transform: scale(1.08); }
.fc-photo-picker.busy::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: rgba(255, 255, 255, .6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Ccircle cx='25' cy='25' r='20' fill='none' stroke='%23999' stroke-width='5' stroke-dasharray='80 60'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='.8s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") center / 40px no-repeat; }
.fc-photo-mini { display: flex; align-items: center; gap: 12px; }
.fc-photo-mini .fc-av { width: 56px; height: 56px; font-size: 1.1rem; }
/* ------------------------------------------------------------------ webcam */
.fc-cam { position: relative; width: 100%; max-width: 420px; aspect-ratio: 1 / 1; margin: 0 auto; border-radius: var(--fc-radius); overflow: hidden; background: #111; }
.fc-cam video, .fc-cam img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fc-cam video { transform: scaleX(-1); }
.fc-cam-guide { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle closest-side at 50% 50%, transparent 0 78%, rgba(0, 0, 0, .42) 79%); }
.fc-cam-guide::after { content: ""; position: absolute; inset: 11%; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .75); }
.fc-cam-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; color: #fff; font-size: .86rem; line-height: 1.5; background: rgba(0, 0, 0, .55); }
.fc-cam-count { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 6rem; font-weight: 800; color: #fff; text-shadow: 0 4px 20px rgba(0, 0, 0, .5); pointer-events: none; }
.fc-cam-count.pop { animation: fcPop .9s ease-out; }
@keyframes fcPop { from { transform: scale(1.6); opacity: 0; } 30% { opacity: 1; } to { transform: scale(.9); opacity: .2; } }
.fc-cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.fc-cam-flash.go { animation: fcFlash .45s ease-out; }
@keyframes fcFlash { from { opacity: .9; } to { opacity: 0; } }
.fc-photo-picker .dropdown { position: absolute; right: 2px; bottom: 2px; }
.fc-photo-picker .dropdown .fc-photo-btn { position: static; }

/* =====================================================================
   9. COMPONENTES DA FROTA
   ===================================================================== */

/* Menu: ponto no ícone do grupo quando há pendências e contador em item simples */
.fc-nav-icon { position: relative; }
.fc-nav-dot { position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--fc-secondary); box-shadow: 0 0 0 2px var(--fc-sidebar-bg); }
.fc-nav-link .fc-count { margin-left: auto; }
.sidebar-collapsed .fc-nav-link .fc-count { display: none; }
.btn-ghost { background: rgba(255, 255, 255, .16); color: var(--fc-hero-text); border: 0; }
.btn-ghost:hover, .btn-ghost:focus { background: rgba(255, 255, 255, .28); color: var(--fc-hero-text); }
.fc-hero-actions .btn { border-radius: 999px; padding-left: 1rem; padding-right: 1rem; }
.fc-hero-actions .btn-light:hover { background: #fff; color: var(--fc-primary-dark); }

/* Cartões do Bootstrap com o mesmo visual dos cartões do painel */
.fc .card {
    background: var(--fc-card-bg);
    border: 1px solid var(--fc-card-border);
    border-radius: var(--fc-radius);
    box-shadow: var(--fc-shadow);
    --bs-card-inner-border-radius: calc(var(--fc-radius) - 1px);
}
.fc .card-header {
    background: transparent;
    border-bottom: 1px solid var(--fc-card-border);
    padding: 14px 20px;
    font-weight: 700;
    font-size: .95rem;
}
.fc .card-header .bi { color: var(--fc-primary); }
.fc .card-body { padding: 18px 20px; }
.fc .card-footer { background: transparent; border-top: 1px solid var(--fc-card-border); padding: 12px 20px; }
.fc .card-title { font-weight: 700; }

/* Indicadores (antigo card_indicador) */
.card-indicador .card-body { padding: 14px 16px 12px; }

/* Lista vazia */
.estado-vazio { text-align: center; padding: 34px 16px; color: var(--fc-muted); }
.estado-vazio i { font-size: 2rem; opacity: .45; display: block; margin-bottom: 8px; }
.estado-vazio p { margin: 0; }

/* Cartões de itens (reservas, retiradas, devoluções) */
.item-lista {
    border: 1px solid var(--fc-card-border);
    border-left: 4px solid var(--fc-primary);
    border-radius: var(--fc-radius-sm);
    padding: 14px 16px;
    margin-bottom: 12px;
    background: var(--fc-card-bg);
    box-shadow: var(--fc-shadow);
    transition: box-shadow .15s, transform .15s, border-color .15s;
}
.item-lista:hover { border-color: rgba(var(--fc-primary-rgb), .35); border-left-color: var(--fc-primary); }
.item-lista.selecionado { box-shadow: 0 0 0 2px var(--fc-primary); }
.item-lista h6 { margin: 0 0 6px; font-weight: 700; }
.item-lista .item-dados { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .8rem; color: var(--fc-muted); }
.item-lista .item-dados strong { color: var(--fc-text); font-weight: 600; }

/* Botões de ação dentro de tabelas */
.acoes-tabela { display: flex; gap: 4px; flex-wrap: nowrap; justify-content: flex-end; }
.acoes-tabela .btn { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--fc-radius-sm); font-size: .82rem; }
.acoes-tabela .btn-outline-primary { border: 0; background: var(--fc-primary-soft); color: var(--fc-primary); }
.acoes-tabela .btn-outline-primary:hover { background: var(--fc-primary); color: var(--fc-on-primary); }
.acoes-tabela .btn-outline-danger { border: 0; background: rgba(220, 53, 69, .1); color: #dc3545; }
.acoes-tabela .btn-outline-danger:hover { background: #dc3545; color: #fff; }
.acoes-tabela .btn-outline-success { border: 0; background: var(--fc-green-soft); color: var(--fc-green); }
.acoes-tabela .btn-outline-success:hover { background: var(--fc-green); color: #fff; }
.acoes-tabela .btn-outline-secondary, .acoes-tabela .btn-outline-dark, .acoes-tabela .btn-outline-info, .acoes-tabela .btn-outline-warning { border: 0; background: var(--fc-soft-gray); color: var(--fc-text); }
.acoes-tabela .btn-outline-secondary:hover, .acoes-tabela .btn-outline-dark:hover, .acoes-tabela .btn-outline-info:hover, .acoes-tabela .btn-outline-warning:hover { background: rgba(var(--fc-primary-rgb), .12); color: var(--fc-primary); }
.table-foto { width: 46px; height: 34px; object-fit: cover; border-radius: 8px; background: var(--fc-soft-gray); }
.table-foto-vazia { width: 46px; height: 34px; border-radius: 8px; background: var(--fc-soft-gray); color: var(--fc-muted); display: inline-flex; align-items: center; justify-content: center; }

/* Componente de foto (upload ou câmera) */
.campo-foto { margin-bottom: 16px; }
.campo-foto-botoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.campo-foto-camera { margin-top: 10px; background: #111; border-radius: var(--fc-radius-sm); overflow: hidden; }
.campo-foto-camera video { width: 100%; max-height: 320px; display: block; object-fit: contain; background: #000; }
.campo-foto-camera-botoes { display: flex; gap: 8px; padding: 10px; background: #111; align-items: center; }
.campo-foto-preview { margin-top: 10px; }
.campo-foto-preview img { max-width: 100%; max-height: 200px; border-radius: var(--fc-radius-sm); border: 1px solid var(--fc-card-border); }

/* Última KM entregue */
.bloco-km {
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--fc-primary-soft);
    border: 1px solid rgba(var(--fc-primary-rgb), .22);
    border-radius: var(--fc-radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
}
.bloco-km .fc-ico { background: var(--fc-primary); color: var(--fc-on-primary); }
.bloco-km-rotulo { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--fc-primary); }
.bloco-km-valor { font-size: 1.6rem; font-weight: 700; line-height: 1.1; color: var(--fc-text); }
.bloco-km-valor small { font-size: .8rem; font-weight: 600; color: var(--fc-muted); }
.bloco-km-detalhe { margin-top: 2px; font-size: .76rem; color: var(--fc-muted); }

.destaque-numero { background: var(--fc-soft-gray); border-radius: var(--fc-radius-sm); padding: 12px 14px; text-align: center; }
.destaque-numero span { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--fc-muted); font-weight: 600; }
.destaque-numero strong { font-size: 1.5rem; font-weight: 700; }

/* Link de convite gerado */
.caixa-link { display: flex; gap: 8px; align-items: center; background: var(--fc-soft-gray); border-radius: var(--fc-radius-sm); padding: 8px 8px 8px 12px; }
.caixa-link input { border: 0; background: transparent; flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; color: var(--fc-text); min-width: 0; }
.caixa-link input:focus { outline: none; }

/* Faixa de aviso dentro do conteúdo */
.fc-banner { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--fc-radius); background: var(--fc-card-bg); box-shadow: var(--fc-shadow); border: 1px solid var(--fc-card-border); margin-bottom: 18px; flex-wrap: wrap; }
.fc-banner.warn { border-color: rgba(var(--fc-secondary-rgb), .45); background: var(--fc-secondary-soft); }
.fc-banner .fc-banner-text { flex: 1; min-width: 200px; }
.fc-banner .fc-banner-text strong { display: block; font-size: .84rem; }
.fc-banner .fc-banner-text small { color: var(--fc-muted); }

/* Listas do painel */
.fc-list-item { display: flex; gap: 12px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--fc-card-border); color: var(--fc-text); }
.fc-list-item:last-child { border-bottom: 0; }
a.fc-list-item:hover { background: rgba(var(--fc-primary-rgb), .03); color: var(--fc-text); }
.fc-list-item strong { font-size: .8rem; display: block; }
.fc-list-item small { color: var(--fc-muted); font-size: .74rem; }
.fc-veiculo-thumb { width: 52px; height: 38px; border-radius: 8px; object-fit: cover; background: var(--fc-soft-gray); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--fc-muted); }

/* Resultados da busca */
.fc-busca-grupo + .fc-busca-grupo { margin-top: 18px; }
.fc-busca-grupo mark { background: rgba(var(--fc-secondary-rgb), .35); padding: 0 1px; border-radius: 3px; color: inherit; }

/* Seletor de preferências (perfil) */
.fc-settings-nav .list-group-item { border: 0; font-size: .84rem; font-weight: 500; color: var(--fc-text); background: transparent; }
.fc-settings-nav .list-group-item:hover { color: var(--fc-primary); }
.fc-settings-nav .list-group-item.active-soft { background: var(--fc-primary-soft); color: var(--fc-primary); font-weight: 600; }

/* =====================================================================
   10. TABELAS, MODAIS, ABAS E AGENDA
   ===================================================================== */
.fc .table { --bs-table-bg: transparent; margin-bottom: 0; font-size: .84rem; }
.fc .table > :not(caption) > * > * { padding: .65rem .8rem; border-color: var(--fc-card-border); }
.fc .table > thead th { font-size: .72rem; font-weight: 600; color: var(--fc-muted); white-space: nowrap; text-transform: none; letter-spacing: 0; background: transparent; }
.fc .table > tbody td { vertical-align: middle; }
.fc .table-hover > tbody > tr:hover > * { --bs-table-bg-state: rgba(var(--fc-primary-rgb), .025); }

/* DataTables 3 */
.dt-container { font-size: .82rem; }
.dt-container .dt-layout-row { margin: 0 0 12px; }
.dt-container .dt-layout-row:last-child { margin: 12px 0 0; }
.dt-container .dt-search input, .dt-container .dt-length select { border-radius: 999px; border-color: var(--bs-border-color); background-color: var(--fc-body-bg); }
.dt-container .dt-search input { min-width: 220px; padding-left: 14px; }
.dt-container .dt-search label, .dt-container .dt-length label { color: var(--fc-muted); font-weight: 500; }
.dt-container .dt-length select { margin: 0 .45rem; }
/* Colunas numéricas (alinhadas à direita): ícone de ordenação encostado no título */
table.dataTable th.dt-type-numeric div.dt-column-header, table.dataTable th.dt-right div.dt-column-header, table.dataTable thead th.dt-head-right div.dt-column-header { justify-content: flex-start; gap: .35rem; }
table.dataTable thead > tr > th.dt-type-numeric div.dt-column-header .dt-column-title, table.dataTable thead > tr > th.dt-right div.dt-column-header .dt-column-title, table.dataTable thead > tr > th.dt-head-right div.dt-column-header .dt-column-title { flex-grow: 0; }
@media (max-width: 575.98px) { .dt-container .dt-search input { min-width: 0; width: 100%; } }
.dt-container .dt-info { color: var(--fc-muted); padding-top: .4rem; }
.dt-container .pagination { --bs-pagination-border-radius: 999px; gap: 3px; }
.dt-container .page-link { border: 0; border-radius: 999px !important; min-width: 32px; text-align: center; color: var(--fc-text); background: transparent; }
.dt-container .page-item.active .page-link { background: var(--fc-primary); color: var(--fc-on-primary); }
.dt-container .page-item.disabled .page-link { background: transparent; opacity: .5; }
table.dataTable thead > tr > th.dt-orderable-asc:hover, table.dataTable thead > tr > th.dt-orderable-desc:hover { outline: 0; color: var(--fc-primary); }
table.dataTable > tbody > tr.child ul.dtr-details { width: 100%; }
table.dataTable > tbody > tr > td.dtr-control::before, table.dataTable > tbody > tr > th.dtr-control::before { color: var(--fc-primary); }
div.dt-container div.dt-processing > div:last-child > div { background: var(--fc-primary); }

.modal-content { border: 0; border-radius: var(--fc-radius); box-shadow: var(--fc-shadow-lg); background: var(--fc-card-bg); }
.modal-header { border-bottom: 1px solid var(--fc-card-border); padding: 16px 20px; }
.modal-title { font-weight: 700; font-size: 1.02rem; }
.modal-footer { border-top: 1px solid var(--fc-card-border); padding: 12px 20px; }
.modal-footer .btn { border-radius: 999px; padding-left: 1.1rem; padding-right: 1.1rem; }

.fc .nav-tabs { border-bottom: 1px solid var(--fc-card-border); gap: 4px; }
.fc .nav-tabs .nav-link { border: 0; color: var(--fc-muted); font-weight: 600; font-size: .82rem; padding: 12px 12px 10px; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; }
.fc .nav-tabs .nav-link:hover { color: var(--fc-text); }
.fc .nav-tabs .nav-link.active { color: var(--fc-primary); border-bottom-color: var(--fc-primary); background: transparent; }

.badge { font-weight: 600; }
.text-bg-light { background: var(--fc-soft-gray) !important; color: var(--fc-text) !important; }
.form-control[readonly] { background-color: var(--fc-soft-gray); }
.form-control-color { padding: 3px; }

/* Agenda (FullCalendar 7) nas cores da marca */
.fc-agenda {
    --fc-classic-primary: var(--fc-primary);
    --fc-classic-primary-foreground: var(--fc-on-primary);
    --fc-classic-button: var(--fc-soft-gray);
    --fc-classic-button-border: transparent;
    --fc-classic-button-strong: var(--fc-primary);
    --fc-classic-button-strong-border: var(--fc-primary);
    --fc-classic-button-foreground: var(--fc-text);
    --fc-classic-today: rgba(var(--fc-secondary-rgb), .12);
    --fc-classic-border: var(--fc-card-border);
    --fc-classic-background: transparent;
    --fc-classic-foreground: var(--fc-text);
    --fc-classic-muted-foreground: var(--fc-muted);
    font-size: .8rem;
}
[data-bs-theme="dark"] .fc-agenda { --fc-classic-border: rgba(255, 255, 255, .08); --fc-classic-faint: #ffffff0a; --fc-classic-muted: #ffffff14; }
.fc-legenda { display: flex; flex-wrap: wrap; gap: 12px; font-size: .74rem; color: var(--fc-muted); }
.fc-legenda span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--cor); }

/* Impressão */
@media print {
    .fc-sidebar, .fc-topbar, .fc-hero-actions, .fc-footer, .fc-hero-deco, .acoes-tabela, .fc-loader { display: none !important; }
    .fc-main { margin-left: 0 !important; }
    .fc-hero { background: none !important; color: #000 !important; padding: 0 !important; }
    .fc .card { box-shadow: none; border: 1px solid #ccc; }
}
/* Datas alinhadas à esquerda nas tabelas (o padrão do DataTables é à direita) */
.fc table.dataTable th.dt-type-date, .fc table.dataTable td.dt-type-date { text-align: left; }
.fc table.dataTable th.dt-type-date .dt-column-header { flex-direction: row; }
.fc-empty small { font-size: .8rem; }

/* Cadastro por convite (tela de acesso mais larga) */
.auth-largo .fc-auth-card { max-width: 760px; }
.auth-largo .fc-auth-art { flex-basis: 34%; max-width: 34%; }
.fc-cad-secao { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .86rem; margin: 22px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--fc-card-border); }
.fc-cad-secao span { width: 24px; height: 24px; border-radius: 50%; background: var(--fc-primary); color: var(--fc-on-primary); font-size: .74rem; display: inline-flex; align-items: center; justify-content: center; }
.fc-auth-card .fc-empty-icon { display: inline-flex; }
@media (max-width: 860px) { .auth-largo .fc-auth-art { max-width: none; } }

/* ------------------------------------------------------------------ Google reCAPTCHA */
.fc-captcha { margin: 0 0 14px; }
.fc-captcha-widget { display: flex; justify-content: center; min-height: 78px; }
.fc-captcha-widget:empty::before {
    content: "Carregando verificação de segurança…"; align-self: center;
    font-size: .76rem; color: var(--fc-muted);
}
.fc-captcha-aviso { font-size: .7rem; color: var(--fc-muted); text-align: center; margin: 0; }
.fc-captcha-aviso a { color: inherit; text-decoration: underline; }
/* v3: o selo flutuante é trocado pelo aviso acima (permitido pelo Google) */
body:has(.fc-captcha[data-captcha="v3"]) .grecaptcha-badge { visibility: hidden !important; }
.fc-captcha-ajuda { background: var(--fc-soft-gray, rgba(0, 0, 0, .04)); border-radius: var(--fc-radius-sm, 10px); padding: 12px 14px; }
.fc-captcha-ajuda ol { margin-top: 6px; }
.fc-captcha-ajuda li { margin-bottom: 3px; }
.fc-captcha-frame { width: 100%; height: 110px; border: 0; display: block; transition: height .15s; }
@media (max-width: 360px) {
    .fc-captcha-widget { transform: scale(.88); transform-origin: center top; min-height: 70px; }
}

/* Menu de seções (Configurações) e prévia (Personalização) acompanham a rolagem */
@media (min-width: 992px) {
    .fc-sticky-top { position: sticky; top: 16px; z-index: 2; }
}
section.fc-card[id] { scroll-margin-top: 16px; }
.fc-diagnostico td { padding-top: .45rem; padding-bottom: .45rem; }
.fc-erros { max-height: 280px; font-size: .72rem; }
.fc-diagnostico td:nth-child(2) { white-space: nowrap; }
.fc-diagnostico td:nth-child(3) { word-break: break-word; }
@media (max-width: 575.98px) {
    .fc-diagnostico td:nth-child(2) { white-space: normal; width: 42%; }
}
