/* ============================================================
   CCFMMS — Global Stylesheet
   Design System: Navy + Orange + Gold
   Font: Inter (Google Fonts)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================================
   VARIÁVEIS CSS
   ============================================================ */
:root {
    --navy:              #002244;
    --navy-light:        #003366;
    --orange:            #FF7733;
    --orange-light:      #FF8C42;
    --gold:              #FFB84D;
    --bg-app:            #f4f7fa;
    --bg-card:           #ffffff;
    --text-main:         #2d3436;
    --text-muted:        #636e72;
    --border-soft:       #e2e8f0;
    --sidebar-width:     260px;
    --sidebar-collapsed: 80px;
    --transition:        all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

/* ============================================================
   RESET
   ============================================================ */
/* *, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
} */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}


body {
    background-color: var(--bg-app);
    color: var(--text-main);
    display: flex;
    overflow-x: hidden;
    min-height: 100vh;
    align-items: stretch;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--navy);
    position: fixed;
    left: 0;
    top: 0;
    transition: var(--transition);
    overflow-x: hidden;
    z-index: 9999;
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar .logo {
    padding: 20px;
    height: 70px;
    display: flex;
    align-items: center;
    gap: 15px;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo-text {
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
    transition: opacity 0.3s;
    letter-spacing: 1px;
}

.sidebar.collapsed .logo-text {
    opacity: 0;
    pointer-events: none;
}

/* Nav Links */
.nav-links {
    list-style: none;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-links a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    border-radius: 12px;
    transition: 0.3s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-links a i {
    min-width: 35px;
    font-size: 1.1rem;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--gold);
}

.nav-links li.active a {
    background: var(--orange);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 119, 51, 0.3);
}

/* Sidebar colapsada */
.sidebar.collapsed .nav-links span,
.sidebar.collapsed .badge {
    opacity: 0;
    display: none;
    pointer-events: none;
}

.sidebar.collapsed .nav-links a {
    justify-content: center;
    padding: 12px 0;
}

.sidebar.collapsed .nav-links a i {
    min-width: unset;
    margin: 0;
    font-size: 1.3rem;
}

.sidebar.collapsed .nav-links a:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Badge */
.badge {
    background: var(--orange);
    color: #fff;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 50px;
    margin-left: auto;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    width: calc(100% - var(--sidebar-width));
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    align-items: stretch;
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed);
    width: calc(100% - var(--sidebar-collapsed));
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    height: 70px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-soft);
}

.toggle-sidebar {
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--navy);
}

.nav-icons {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Dropdown de usuário */
.user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 50px;
    background: #fff;
    min-width: 200px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-soft);
    display: none;
    padding: 10px;
    z-index: 2000;
}

.dropdown-menu.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    text-decoration: none;
    color: var(--text-main);
    border-radius: 8px;
    font-size: 0.9rem;
}

.dropdown-menu a:hover {
    background: var(--bg-app);
    color: var(--orange);
}

/* ============================================================
   CONTAINER
   ============================================================ */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
    flex-grow: 1;
}

/* ============================================================
   CARDS
   ============================================================ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid var(--border-soft);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: 0.3s;
}

.card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: var(--orange);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.card-info h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.card-info p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
}

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
    font-size: 0.9rem;
    text-decoration: none;
}

.btn-add {
    background: var(--navy);
    color: #fff;
}

.btn-add:hover {
    background: var(--orange);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 119, 51, 0.3);
}

.btn-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    background: none;
    cursor: pointer;
    transition: 0.2s;
    color: var(--text-muted);
}

.btn-action:hover {
    background: var(--bg-app);
    color: var(--navy);
    border-color: var(--navy);
}

/* ============================================================
   TABELAS
   ============================================================ */
.table-container {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-soft);
    overflow-x: auto;
    margin-bottom: 25px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th {
    background: #fafbfc;
    padding: 15px 20px;
    text-align: left;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-soft);
    font-weight: 600;
}

td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.9rem;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #fafbfc;
}

/* ============================================================
   STATUS BADGES
   ============================================================ */
.status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-active {
    background: #eafaf1;
    color: #27ae60;
}

.status-inactive {
    background: #fdf0ef;
    color: #e74c3c;
}

.status-pending {
    background: #fef9ef;
    color: #f39c12;
}

/* ============================================================
   MODAIS
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 34, 68, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalShow 0.3s ease;
}

/* ============================================================
   FORMULÁRIOS (classes utilitárias)
   ============================================================ */
.label-form {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-form {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: all 0.3s;
    background: #fff;
    font-family: 'Inter', sans-serif;
}

.input-form:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255, 119, 51, 0.1);
}

textarea.input-form {
    resize: vertical;
    min-height: 80px;
}

/* ============================================================
   TAGS (Cursos)
   ============================================================ */
.tag {
    background: var(--navy);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tag i {
    cursor: pointer;
    font-size: 0.7rem;
    opacity: 0.7;
}

.tag i:hover {
    opacity: 1;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.alert i { font-size: 1.1rem; flex-shrink: 0; }
.alert span { flex: 1; }

.alert-error   { background: #fee; border: 1px solid #fcc; color: #c00; }
.alert-success { background: #efe; border: 1px solid #cfc; color: #070; }
.alert-warning { background: #fff3cd; border: 1px solid #ffeaa7; color: #856404; }
.alert-info    { background: #e7f3ff; border: 1px solid #b3d9ff; color: #004085; }

/* ============================================================
   PREVIEW DE FOTO
   ============================================================ */
#previewContainer {
    position: relative;
    width: 240px;
    height: 240px;
    background: #fff;
    border-radius: 30px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#previewContainer img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================================
   FOOTER DO PAINEL
   ============================================================ */
.admin-footer {
    width: 100%;
    padding: 20px 40px;
    background-color: #fff;
    border-top: 1px solid var(--border-soft);
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.footer-content strong {
    color: var(--navy);
}

.footer-whatsapp {
    text-decoration: none;
    color: #25d366;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: opacity 0.2s;
}

.footer-whatsapp:hover {
    opacity: 0.8;
}

/* ============================================================
   ANIMAÇÕES
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes modalShow {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   RESPONSIVIDADE — MOBILE
   ============================================================ */
@media (max-width: 768px) {
    .sidebar {
        left: -260px;
        box-shadow: none;
    }

    .sidebar.active {
        left: 0;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .logo-text {
        display: block !important;
    }

    .d-none-mobile {
        display: none;
    }

    .container {
        padding: 20px 15px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 5px;
        text-align: right;
    }

    .navbar {
        padding: 0 15px;
    }

    /* Grid de 2 colunas em tablets */
    @media (min-width: 480px) {
        .cards-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }
}

/* ============================================================
   COMPONENTES EXPANDIDOS — v2.0
   Buscas, Filtros, Avatares, Tabs, Drawers, Upload, Steps
   ============================================================ */

/* ---- Barra de Busca + Filtros ---- */
.page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.page-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 380px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    font-size: 0.9rem;
    background: #fff;
    transition: 0.3s;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
}

.search-input:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255,119,51,.08);
}

.filter-select {
    padding: 10px 14px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background: #fff;
    cursor: pointer;
    transition: 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--orange);
}

/* ---- Avatar ---- */
.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
}

.avatar-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-group .info strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 600;
}

.avatar-group .info small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ---- Tabs ---- */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-soft);
    margin-bottom: 25px;
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
}

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

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

.tab-badge {
    background: var(--orange);
    color: #fff;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 20px;
    font-weight: 700;
}

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

/* ---- Modal Largo ---- */
.modal-content.modal-lg { max-width: 680px; }
.modal-content.modal-xl { max-width: 860px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-soft);
}

.modal-header h3 {
    color: var(--navy);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i { color: var(--orange); }

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    font-size: 0.9rem;
}

.modal-close:hover { background: #fee; color: #e74c3c; border-color: #fcc; }

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-soft);
}

/* ---- Formulário em Grid ---- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid.cols-1 { grid-template-columns: 1fr; }

.form-group-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group-field.full { grid-column: 1 / -1; }

/* ---- Upload de Arquivo ---- */
.upload-area {
    border: 2px dashed var(--border-soft);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
    background: #fafbfc;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--orange);
    background: rgba(255,119,51,.04);
}

.upload-area i {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: block;
}

.upload-area p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.upload-area span {
    color: var(--orange);
    font-weight: 600;
    cursor: pointer;
}

/* ---- Steps / Hierarquia de Curso ---- */
.step-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.step-item {
    background: #fafbfc;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: 0.2s;
}

.step-item:hover { border-color: var(--orange); background: #fff; }

.step-handle {
    color: var(--text-muted);
    cursor: grab;
    font-size: 1rem;
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-item input {
    flex: 1;
    border: none;
    background: none;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
}

.step-item input:focus { outline: none; }

.step-del {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    opacity: 0.5;
    font-size: 0.9rem;
    transition: 0.2s;
}

.step-del:hover { opacity: 1; }

/* ---- Comment Card ---- */
.comment-card {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 14px;
    transition: 0.2s;
    position: relative;
}

.comment-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.06); }

.comment-card.pending { border-left: 3px solid #f39c12; }
.comment-card.approved { border-left: 3px solid #27ae60; }
.comment-card.rejected { border-left: 3px solid #e74c3c; }

.comment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.comment-body {
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 12px;
}

.comment-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ---- Ticket Card ---- */
.ticket-card {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 14px;
    transition: 0.2s;
    cursor: pointer;
}

.ticket-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.06); transform: translateY(-1px); }

.ticket-priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ---- Chip / Tag de Filtro ---- */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: 0.2s;
    background: #f0f0f0;
    color: var(--text-muted);
}

.chip.active, .chip:hover {
    background: var(--navy);
    color: #fff;
}

.chip.chip-orange.active, .chip.chip-orange:hover {
    background: var(--orange);
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 16px;
    display: block;
}

.empty-state h4 {
    font-size: 1rem;
    color: var(--navy);
    margin-bottom: 8px;
}

.empty-state p { font-size: 0.9rem; }

/* ---- Detail View (visualização de registro) ---- */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-field label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.detail-field span {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 500;
}

/* ---- Rating Stars ---- */
.stars {
    display: inline-flex;
    gap: 3px;
    color: var(--gold);
}

.stars i { font-size: 0.85rem; }

/* ---- Toggle Switch ---- */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-track {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: #ccc;
    cursor: pointer;
    transition: 0.3s;
}

.toggle-track::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    top: 3px;
    left: 3px;
    transition: 0.3s;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

.toggle-switch input:checked + .toggle-track { background: var(--orange); }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(20px); }

/* ---- Skeleton Loader ---- */
@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 400px 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 6px;
}

/* ---- Stat Badge (interna em tabelas) ---- */
.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    background: var(--bg-app);
    color: var(--text-muted);
}

/* ---- Breadcrumb ---- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.breadcrumb a { color: var(--orange); text-decoration: none; }
.breadcrumb i { font-size: 0.6rem; }

/* ---- Page Header ---- */
.page-header {
    margin-bottom: 28px;
}

.page-header h2 {
    color: var(--navy);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---- Scroll Snap para tabs em mobile ---- */
@media (max-width: 600px) {
    .tabs {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar { display: none; }

    .tab-btn { scroll-snap-align: start; white-space: nowrap; }

    .form-grid,
    .form-grid.cols-3 {
        grid-template-columns: 1fr;
    }

    .detail-grid { grid-template-columns: 1fr; }

    .modal-footer { flex-direction: column; }
    .modal-footer .btn { width: 100%; justify-content: center; }
}

/* ============================================================
   TOOLBAR — barra de busca + chips de filtro
   ============================================================ */
.toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: auto;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 9px 14px;
    flex: 1;
    min-width: 200px;
    max-width: 320px;
    transition: border-color .2s;
}

.search-box:focus-within {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255,119,51,.08);
}

.search-box i {
    color: var(--text-muted);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.search-box input {
    border: none;
    outline: none;
    font-size: 0.875rem;
    color: var(--text-main);
    background: transparent;
    width: 100%;
    font-family: 'Inter', sans-serif;
}

.search-box input::placeholder { color: #bbb; }

/* ============================================================
   MODAL — header, footer, close button
   ============================================================ */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-soft);
}

.modal-header h3 {
    color: var(--navy);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: var(--orange);
}

.modal-close {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: .2s;
    flex-shrink: 0;
}

.modal-close:hover {
    background: #fdf0ef;
    color: #e74c3c;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--border-soft);
}

/* ============================================================
   FORM GRID — layout de formulários em 2 colunas
   ============================================================ */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
    margin-bottom: 8px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-full {
    grid-column: 1 / -1;
}

/* ============================================================
   ALERT — inline dentro de modais e formulários
   ============================================================ */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 14px;
    animation: fadeIn .25s ease;
}

.alert-success {
    background: #eafaf1;
    color: #27ae60;
    border: 1px solid #a9dfbf;
}

.alert-error {
    background: #fdf0ef;
    color: #e74c3c;
    border: 1px solid #f5b7b1;
}

.alert-info {
    background: #eaf4fd;
    color: #2980b9;
    border: 1px solid #aed6f1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   PAGE HEADER — cabeçalho padrão de seções
   ============================================================ */
.page-header {
    margin-bottom: 28px;
}

.page-header h2 {
    color: var(--navy);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

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

.breadcrumb a:hover { text-decoration: underline; }

.breadcrumb i { font-size: 0.6rem; }

/* ============================================================
   TAG — label inline
   ============================================================ */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: rgba(0,34,68,.07);
    color: var(--navy);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

/* ============================================================
   DETAIL GRID — visualização de registro
   ============================================================ */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-field label {
    display: block;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 3px;
}

.detail-field span {
    font-size: 0.92rem;
    color: var(--text-main);
    font-weight: 500;
}

/* ============================================================
   TOGGLE SWITCH
   ============================================================ */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-track {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: #ccc;
    cursor: pointer;
    transition: .3s;
}

.toggle-track::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    top: 3px;
    left: 3px;
    transition: .3s;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

.toggle-switch input:checked + .toggle-track { background: var(--orange); }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(20px); }

/* ============================================================
   RESPONSIVE — media queries adicionais
   ============================================================ */
@media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-right { margin-left: 0; }
    .search-box { max-width: none; }
    .modal-footer { flex-direction: column; }
    .modal-footer .btn { width: 100%; justify-content: center; }
    .page-header [style*="display:flex"] { flex-direction: column; align-items: flex-start; }
}
