/* ═══════════════════════════════════════════════════════════════════════
   Projeto Criança Cidadã — Custom CSS (complementa Tailwind)
   Só customizações específicas do sistema
══════════════════════════════════════════════════════════════════════ */

/* ─── Variáveis ────────────────────────────────────────────────────── */
:root {
    --sidebar-w: 260px;
    --sidebar-collapsed: 72px;
    --topbar-h: 64px;
    --font: 'Inter', system-ui, sans-serif;

    --primary:    #1d4ed8;
    --primary-dk: #1e40af;
    --primary-lt: #dbeafe;

    --sidebar-grad: linear-gradient(175deg, #0c2461 0%, #1565c0 50%, #1976d2 100%);
}

/* ─── Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: #f1f5f9;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ─── Sidebar ───────────────────────────────────────────────────────── */
.sidebar {
    position: fixed; top:0; left:0; bottom:0;
    width: var(--sidebar-w);
    background: var(--sidebar-grad);
    z-index: 1000;
    display: flex; flex-direction: column;
    overflow: hidden;
    transition: width .22s cubic-bezier(.4,0,.2,1), transform .22s;
    box-shadow: 4px 0 20px rgba(0,0,0,.15);
}
.sidebar:hover { overflow-y: auto; overflow-x: hidden; }
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius:2px; }

/* Sidebar header / logo */
.sidebar-header {
    padding: 0 16px;
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}
.sidebar-logo-img {
    width: 42px; height: 42px; border-radius: 10px;
    object-fit: cover;
    background: rgba(255,255,255,.1);
    flex-shrink: 0;
    filter: brightness(0) invert(1);
}
.sidebar-logo-text { overflow: hidden; }
.sidebar-logo-title {
    font-size: 13.5px; font-weight: 700; color: #fff;
    white-space: nowrap; line-height: 1.2;
}
.sidebar-logo-sub {
    font-size: 10px; color: rgba(255,255,255,.5);
    white-space: nowrap;
}

/* Nav */
.sidebar-nav { padding: 10px 10px 0; flex: 1; }

.nav-section-label {
    font-size: 9.5px; font-weight: 700;
    color: rgba(255,255,255,.3);
    text-transform: uppercase; letter-spacing: 1.2px;
    padding: 12px 12px 4px;
}

.nav-link {
    display: flex; align-items: center; gap: 11px;
    padding: 9.5px 12px;
    border-radius: 9px;
    font-size: 13.5px; font-weight: 500;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    transition: background .15s, color .15s;
    margin-bottom: 1px;
    position: relative;
    white-space: nowrap;
}
.nav-link:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.nav-link.active {
    background: rgba(255,255,255,.18);
    color: #fff; font-weight: 600;
}
.nav-link.active::before {
    content: '';
    position: absolute; left: 0; top: 20%; bottom: 20%;
    width: 3px; border-radius: 0 3px 3px 0;
    background: #fff;
}
.nav-link .icon { width: 18px; text-align: center; font-size: 13px; flex-shrink: 0; opacity: .85; }
.nav-link.active .icon { opacity: 1; }
.nav-link .label { flex: 1; }
.nav-link .badge-pill {
    background: #ef4444; color: #fff;
    font-size: 9.5px; font-weight: 700;
    padding: 1px 6px; border-radius: 20px; min-width: 18px; text-align: center;
}

/* Accordion nav group */
.nav-group {}
.nav-group-toggle {
    display: flex; align-items: center; gap: 11px;
    padding: 9.5px 12px; border-radius: 9px;
    font-size: 13.5px; font-weight: 500;
    color: rgba(255,255,255,.75);
    cursor: pointer; transition: background .15s, color .15s;
    margin-bottom: 1px; user-select: none;
    white-space: nowrap;
}
.nav-group-toggle:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-group-toggle .icon { width: 18px; text-align: center; font-size: 13px; flex-shrink: 0; opacity: .85; }
.nav-group-toggle .label { flex: 1; }
.nav-group-toggle .arrow {
    font-size: 9px; opacity: .5;
    transition: transform .2s;
}
.nav-group.open .arrow { transform: rotate(90deg); }

.nav-sub {
    display: none;
    padding-left: 16px; margin-bottom: 2px;
}
.nav-group.open .nav-sub { display: block; }
.nav-sub .nav-link {
    font-size: 13px; padding: 7.5px 12px;
    color: rgba(255,255,255,.6);
}
.nav-sub .nav-link.active { color: #fff; }

/* Sidebar footer */
.sidebar-footer {
    padding: 10px;
    border-top: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}
.sidebar-user-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 9px;
    cursor: pointer; transition: background .15s;
    text-decoration: none;
}
.sidebar-user-btn:hover { background: rgba(255,255,255,.1); }
.sidebar-user-av {
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(255,255,255,.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #fff;
    flex-shrink: 0; overflow: hidden;
}
.sidebar-user-av img { width:100%; height:100%; object-fit:cover; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-role { font-size: 10px; color: rgba(255,255,255,.45); white-space: nowrap; }

/* ─── Main ──────────────────────────────────────────────────────────── */
.main-wrap {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex; flex-direction: column;
    transition: margin-left .22s;
}

/* ─── Topbar ────────────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    display: flex; align-items: center;
    padding: 0 24px; gap: 12px;
    position: sticky; top: 0; z-index: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.topbar-title { font-size: 15px; font-weight: 600; color: #0f172a; }
.topbar-spacer { flex: 1; }
.topbar-btn {
    width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; color: #64748b;
    background: none; border: none; cursor: pointer;
    position: relative; transition: background .15s, color .15s;
}
.topbar-btn:hover { background: #f1f5f9; color: #0f172a; }

/* Notif badge */
.notif-count {
    position: absolute; top: 4px; right: 4px;
    min-width: 16px; height: 16px;
    background: #ef4444; color: #fff;
    font-size: 9px; font-weight: 700;
    border-radius: 10px; padding: 0 3px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff;
}

/* Topbar user */
.topbar-user {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 8px 4px 4px; border-radius: 10px;
    cursor: pointer; transition: background .15s;
    border: none; background: none; position: relative;
}
.topbar-user:hover { background: #f1f5f9; }
.topbar-user-av {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #fff;
    overflow: hidden; flex-shrink: 0;
}
.topbar-user-av img { width:100%; height:100%; object-fit:cover; }
.topbar-user-name { font-size: 13px; font-weight: 600; color: #0f172a; line-height: 1.2; text-align: left; }
.topbar-user-role { font-size: 10px; color: #94a3b8; text-align: left; }

/* Dropdowns */
.dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: #fff; border: 1px solid #e2e8f0;
    border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.12);
    display: none; flex-direction: column;
    overflow: hidden; z-index: 600;
}
.dropdown.open { display: flex; }

.dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 16px; font-size: 13px; color: #374151;
    cursor: pointer; transition: background .12s;
    text-decoration: none; border: none; background: none; width: 100%;
}
.dropdown-item:hover { background: #f8fafc; color: #111827; text-decoration: none; }
.dropdown-item .di-icon { width: 16px; text-align: center; color: #9ca3af; font-size: 13px; }
.dropdown-sep { height: 1px; background: #e2e8f0; }
.dropdown-item.danger { color: #ef4444; }
.dropdown-item.danger .di-icon { color: #ef4444; }

/* Notif panel */
.notif-panel {
    width: 340px; max-height: 440px;
    display: none; flex-direction: column;
}
.notif-panel.open { display: flex; }
.notif-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px; font-weight: 700;
}
.notif-list { overflow-y: auto; flex: 1; }
.notif-item {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 12px 16px; border-bottom: 1px solid #f1f5f9;
    cursor: pointer; transition: background .12s;
}
.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: #eff6ff; }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: #2563eb; margin-top: 7px; flex-shrink: 0; }
.notif-title { font-size: 12.5px; font-weight: 600; color: #111827; line-height: 1.3; }
.notif-msg   { font-size: 11.5px; color: #6b7280; margin-top: 2px; }
.notif-time  { font-size: 10.5px; color: #9ca3af; margin-top: 3px; }
.notif-empty { padding: 32px; text-align: center; color: #9ca3af; font-size: 13px; }

/* ─── Page ───────────────────────────────────────────────────────────── */
.page-body { flex: 1; padding: 28px; }

.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-title { font-size: 22px; font-weight: 800; color: #0f172a; margin: 0; line-height: 1.2; }
.page-subtitle { font-size: 13px; color: #64748b; margin: 3px 0 0; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ─── Cards ─────────────────────────────────────────────────────────── */
.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    overflow: hidden;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}
.card-title { font-size: 14px; font-weight: 700; color: #111827; margin: 0; }
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid #e2e8f0; background: #f8fafc; }

/* ─── Stats grid ─────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 16px; margin-bottom: 24px;
}

.stat-card {
    background: #fff; border: 1px solid #e2e8f0;
    border-radius: 14px; padding: 20px;
    position: relative; overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.09); }
.stat-card::before {
    content: ''; position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
}
.stat-card-primary::before  { background: linear-gradient(90deg,#2563eb,#60a5fa); }
.stat-card-success::before  { background: linear-gradient(90deg,#16a34a,#4ade80); }
.stat-card-warning::before  { background: linear-gradient(90deg,#d97706,#fbbf24); }
.stat-card-info::before     { background: linear-gradient(90deg,#0891b2,#38bdf8); }
.stat-card-danger::before   { background: linear-gradient(90deg,#dc2626,#f87171); }
.stat-card-purple::before   { background: linear-gradient(90deg,#7c3aed,#c084fc); }
.stat-card-teal::before     { background: linear-gradient(90deg,#0d9488,#34d399); }
.stat-card-indigo::before   { background: linear-gradient(90deg,#4f46e5,#818cf8); }

.stat-card-icon {
    width: 44px; height: 44px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 19px; margin-bottom: 14px;
}
.stat-card-primary .stat-card-icon  { background: #eff6ff; color: #2563eb; }
.stat-card-success .stat-card-icon  { background: #f0fdf4; color: #16a34a; }
.stat-card-warning .stat-card-icon  { background: #fffbeb; color: #d97706; }
.stat-card-info .stat-card-icon     { background: #ecfeff; color: #0891b2; }
.stat-card-danger .stat-card-icon   { background: #fef2f2; color: #dc2626; }
.stat-card-purple .stat-card-icon   { background: #f5f3ff; color: #7c3aed; }
.stat-card-teal .stat-card-icon     { background: #f0fdfa; color: #0d9488; }
.stat-card-indigo .stat-card-icon   { background: #eef2ff; color: #4f46e5; }

.stat-card-value { font-size: 32px; font-weight: 900; color: #0f172a; line-height: 1; margin-bottom: 4px; }
.stat-card-label { font-size: 12.5px; color: #64748b; font-weight: 500; }
.stat-card-link {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; color: #2563eb; font-weight: 600;
    margin-top: 12px; text-decoration: none;
}
.stat-card-link:hover { text-decoration: underline; }

/* ─── Buttons ────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border-radius: 9px; border: none;
    font-size: 13.5px; font-weight: 600;
    cursor: pointer; text-decoration: none;
    transition: all .15s; white-space: nowrap; line-height: 1;
    font-family: var(--font);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: none; }

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37,99,235,.3);
}
.btn-primary:hover { background: linear-gradient(135deg,#1d4ed8,#1e40af); color:#fff; box-shadow:0 6px 16px rgba(37,99,235,.4); }

.btn-ghost {
    background: #fff; color: #374151;
    border: 1.5px solid #e2e8f0;
}
.btn-ghost:hover { background: #f8fafc; color: #111827; border-color: #cbd5e1; }

.btn-danger  { background:linear-gradient(135deg,#dc2626,#b91c1c); color:#fff; box-shadow:0 2px 8px rgba(220,38,38,.25); }
.btn-danger:hover  { background:linear-gradient(135deg,#b91c1c,#991b1b); color:#fff; }
.btn-success { background:linear-gradient(135deg,#16a34a,#15803d); color:#fff; }
.btn-success:hover { background:linear-gradient(135deg,#15803d,#166534); color:#fff; }
.btn-warning { background:linear-gradient(135deg,#d97706,#b45309); color:#fff; }
.btn-whatsapp{ background:#25d366; color:#fff; }
.btn-whatsapp:hover{ background:#20ba5a; color:#fff; }

.btn-sm  { padding:6px 12px; font-size:12px; border-radius:7px; }
.btn-lg  { padding:12px 28px; font-size:15px; border-radius:10px; }
.btn-icon{ width:34px; height:34px; padding:0; justify-content:center; }

/* ─── Forms ──────────────────────────────────────────────────────────── */
.form-label {
    display: block; font-size: 12.5px; font-weight: 600;
    color: #374151; margin-bottom: 5px;
}
.form-label.required::after { content:' *'; color:#ef4444; }
.form-control, .form-select {
    display: block; width: 100%;
    padding: 9px 12px;
    background: #fff; border: 1.5px solid #d1d5db;
    border-radius: 9px;
    font-size: 13.5px; color: #111827;
    font-family: var(--font);
    transition: border-color .15s, box-shadow .15s;
    line-height: 1.5;
}
.form-control:focus, .form-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-control::placeholder { color: #9ca3af; }
textarea.form-control { min-height: 90px; resize: vertical; }
.form-actions { display: flex; gap: 10px; padding-top: 8px; flex-wrap: wrap; }

/* ─── Tables ─────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
    padding: 11px 14px;
    background: #f8fafc; color: #64748b;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap; text-align: left;
}
.table td {
    padding: 13px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #374151; vertical-align: middle;
}
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border: none; }

/* ─── Badges ─────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 20px;
    font-size: 11px; font-weight: 700; white-space: nowrap;
}
.badge-success   { background:#dcfce7; color:#166534; }
.badge-danger    { background:#fee2e2; color:#991b1b; }
.badge-warning   { background:#fef3c7; color:#92400e; }
.badge-info      { background:#dbeafe; color:#1e40af; }
.badge-primary   { background:#dbeafe; color:#1e40af; }
.badge-secondary { background:#f1f5f9; color:#475569; }
.badge-gray      { background:#f1f5f9; color:#475569; }
.badge-purple    { background:#f5f3ff; color:#6d28d9; }

/* ─── Flash messages ─────────────────────────────────────────────────── */
.flash-wrap {
    position: fixed; top: 72px; right: 20px;
    z-index: 9000; display: flex; flex-direction: column; gap: 8px;
}
.flash {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 16px; border-radius: 11px;
    font-size: 13.5px; font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    min-width: 280px; max-width: 400px;
    animation: slideIn .25s ease;
    border: 1px solid;
}
@keyframes slideIn { from{opacity:0;transform:translateX(20px)} to{opacity:1;transform:none} }
.flash--success { background:#f0fdf4; color:#166534; border-color:#bbf7d0; }
.flash--error   { background:#fef2f2; color:#991b1b; border-color:#fecaca; }
.flash--warning { background:#fffbeb; color:#92400e; border-color:#fde68a; }
.flash--info    { background:#eff6ff; color:#1e40af; border-color:#bfdbfe; }
.flash-close { margin-left:auto; cursor:pointer; opacity:.5; background:none; border:none; font-size:16px; }
.flash-close:hover { opacity:1; }

/* ─── Alerts ─────────────────────────────────────────────────────────── */
.alert { padding:14px 16px; border-radius:10px; border:1px solid; font-size:13.5px; margin-bottom:16px; }
.alert-info    { background:#eff6ff; color:#1e40af; border-color:#bfdbfe; }
.alert-success { background:#f0fdf4; color:#166534; border-color:#bbf7d0; }
.alert-danger  { background:#fef2f2; color:#991b1b; border-color:#fecaca; }
.alert-warning { background:#fffbeb; color:#92400e; border-color:#fde68a; }
.alert-link { font-weight:700; }

/* ─── Filter bar ─────────────────────────────────────────────────────── */
.filter-card {
    background: #fff; border: 1px solid #e2e8f0;
    border-radius: 14px; padding: 16px 20px;
    margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.filter-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 150px; flex: 1; }
.filter-group label { font-size: 11.5px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .4px; }
.filter-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ─── Detail grid ────────────────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); }
.detail-item { padding: 13px 16px; border-bottom: 1px solid #f1f5f9; border-right: 1px solid #f1f5f9; }
.detail-label { font-size: 10.5px; color: #9ca3af; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 3px; }
.detail-value { font-size: 13.5px; color: #111827; font-weight: 500; }

/* ─── Tabs ───────────────────────────────────────────────────────────── */
.tabs { display:flex; gap:2px; border-bottom:2px solid #e2e8f0; margin-bottom:20px; flex-wrap:wrap; }
.tab  { padding:10px 18px; font-size:13px; font-weight:600; color:#6b7280; cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-2px; transition:color .15s,border-color .15s; white-space:nowrap; }
.tab:hover { color:#111827; }
.tab.active { color:#2563eb; border-bottom-color:#2563eb; }
.tab-content { display:none; }
.tab-content.active { display:block; }

/* ─── Pagination ─────────────────────────────────────────────────────── */
.pagination { display:flex; gap:4px; align-items:center; flex-wrap:wrap; }
.pagination a, .pagination span {
    display:flex; align-items:center; justify-content:center;
    min-width:34px; height:34px; padding:0 8px;
    border-radius:8px; font-size:13px;
    border:1px solid #e2e8f0; background:#fff;
    color:#374151; transition:all .15s; text-decoration:none;
}
.pagination a:hover { background:#f1f5f9; border-color:#cbd5e1; text-decoration:none; }
.pagination .current { background:#2563eb; color:#fff; border-color:#2563eb; font-weight:700; }
.pagination .disabled { opacity:.4; pointer-events:none; }

/* ─── Empty state ────────────────────────────────────────────────────── */
.empty-state { text-align:center; padding:60px 20px; }
.empty-state i { font-size:52px; opacity:.2; display:block; margin-bottom:16px; }
.empty-state h3 { font-size:16px; color:#374151; margin-bottom:8px; }
.empty-state p  { font-size:13.5px; color:#9ca3af; }

/* ─── Page footer ────────────────────────────────────────────────────── */
.page-footer { padding:16px 28px; font-size:12px; color:#9ca3af; border-top:1px solid #e2e8f0; text-align:center; }

/* ─── Sidebar overlay ────────────────────────────────────────────────── */
.sidebar-overlay {
    display:none; position:fixed; inset:0;
    background:rgba(0,0,0,.5); z-index:999;
    backdrop-filter:blur(2px);
}

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media(max-width:768px) {
    .sidebar { transform:translateX(-100%); width:var(--sidebar-w) !important; }
    .sidebar.open { transform:none; }
    .sidebar-overlay.open { display:block; }
    .main-wrap { margin-left:0 !important; }
    .page-body { padding:16px; }
    .stats-grid { grid-template-columns:repeat(2,1fr); gap:12px; }
    .page-header { flex-direction:column; }
    .topbar { padding:0 16px; }
    .topbar-user-name, .topbar-user-role { display:none; }
}
@media(max-width:480px) { .stats-grid { grid-template-columns:1fr; } }

/* ─── Sidebar collapsed ──────────────────────────────────────────────── */
.sidebar-collapsed .sidebar { width:var(--sidebar-collapsed); }
.sidebar-collapsed .main-wrap { margin-left:var(--sidebar-collapsed); }
.sidebar-collapsed .sidebar-logo-text,
.sidebar-collapsed .nav-link .label,
.sidebar-collapsed .nav-group-toggle .label,
.sidebar-collapsed .nav-group-toggle .arrow,
.sidebar-collapsed .nav-section-label,
.sidebar-collapsed .sidebar-user-name,
.sidebar-collapsed .sidebar-user-role,
.sidebar-collapsed .nav-sub { display:none; }
.sidebar-collapsed .nav-link,
.sidebar-collapsed .nav-group-toggle { justify-content:center; padding:10px; }
.sidebar-collapsed .nav-link .icon,
.sidebar-collapsed .nav-group-toggle .icon { margin:0; }
.sidebar-collapsed .sidebar-user-btn { justify-content:center; padding:10px; }

/* ─── Utilities ──────────────────────────────────────────────────────── */
.fw-semibold { font-weight:600 !important; }
.text-muted   { color:#64748b !important; }
.text-primary-color { color:#2563eb !important; }
.text-success { color:#16a34a !important; }
.text-danger  { color:#dc2626 !important; }
.text-warning { color:#d97706 !important; }
.sticky-top   { position:sticky; top:64px; }


/* Loading global */
.global-loading{position:fixed;inset:0;z-index:99999;display:none;align-items:center;justify-content:center;background:rgba(15,23,42,.28);backdrop-filter:blur(2px)}
.global-loading.show{display:flex}
.global-loading-box{display:flex;align-items:center;gap:12px;background:#fff;color:#111827;border-radius:16px;padding:16px 22px;box-shadow:0 18px 50px rgba(15,23,42,.22);font-weight:700;font-size:14px}
.global-spinner{width:22px;height:22px;border-radius:999px;border:3px solid #e5e7eb;border-top-color:#2563eb;animation:pccSpin .8s linear infinite}
@keyframes pccSpin{to{transform:rotate(360deg)}}
.nav-group.open>.nav-group-toggle{background:rgba(255,255,255,.12);color:#fff}
.nav-sub .nav-link.active{background:rgba(255,255,255,.15);border-left:3px solid #fff;padding-left:17px}

/* ChatGPT fix 2026-05-11: submenu aberto/ativo com destaque mais claro */
.nav-group.current > .nav-group-toggle,
.nav-group.open > .nav-group-toggle {
    background: rgba(255,255,255,.16) !important;
    color: #fff !important;
    font-weight: 700;
}
.nav-group.current > .nav-group-toggle .icon,
.nav-group.open > .nav-group-toggle .icon { opacity: 1; }
.nav-sub .nav-link.active {
    background: rgba(255,255,255,.24) !important;
    color: #fff !important;
    font-weight: 800 !important;
    box-shadow: inset 3px 0 0 #fff;
    padding-left: 17px !important;
}
.nav-sub .nav-link.active::before { display:none; }


/* ChatGPT FIX v3 - escopo correto dos tabs do Bootstrap e submenu persistente */
.page-body .nav-tabs {
    border-bottom: 1px solid #e2e8f0 !important;
    gap: 4px;
}
.page-body .nav-tabs .nav-link {
    color: #334155 !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-bottom-color: transparent !important;
    border-radius: 10px 10px 0 0 !important;
    font-weight: 700 !important;
    padding: 10px 14px !important;
    margin-bottom: -1px !important;
    box-shadow: none !important;
}
.page-body .nav-tabs .nav-link:hover {
    color: #0f172a !important;
    background: #eef2ff !important;
}
.page-body .nav-tabs .nav-link.active,
.page-body .nav-tabs .nav-item.show .nav-link {
    color: #1d4ed8 !important;
    background: #ffffff !important;
    border-color: #cbd5e1 #cbd5e1 #ffffff !important;
}
.page-body .nav-tabs .nav-link::before { display:none !important; }
.page-body .nav-tabs ~ .tab-content,
.page-body .tab-content.bootstrap-tabs {
    display: block !important;
}
.page-body .nav-tabs ~ .tab-content > .tab-pane {
    display: none;
}
.page-body .nav-tabs ~ .tab-content > .tab-pane.active,
.page-body .nav-tabs ~ .tab-content > .tab-pane.show.active {
    display: block !important;
}
.sidebar .nav-group.open > .nav-sub,
.sidebar .nav-group.current > .nav-sub { display:block !important; }
.sidebar .nav-group.current > .nav-group-toggle,
.sidebar .nav-group.open > .nav-group-toggle {
    background: rgba(255,255,255,.18) !important;
    color:#fff !important;
}
.sidebar .nav-sub .nav-link.active,
.sidebar .nav-sub .nav-link.pcc-current {
    background: rgba(255,255,255,.28) !important;
    color:#fff !important;
    font-weight:800 !important;
    box-shadow: inset 3px 0 0 #fff;
}


/* ─── Ajuda / Tour contextual ─────────────────────────────────────────────── */
.topbar-help-btn{width:auto!important;padding:0 11px!important;gap:6px!important}
.topbar-help-btn span{font-size:12px;font-weight:700}
.tour-highlight{position:relative!important;z-index:9997!important;outline:4px solid rgba(37,99,235,.28)!important;outline-offset:4px!important;border-radius:10px!important;pointer-events:none!important}
#tourBackdrop{position:fixed;inset:0;background:rgba(15,23,42,.28);z-index:9995;pointer-events:auto}
#tourTooltip{line-height:1.45}
@media(max-width:700px){.topbar-help-btn span{display:none}.topbar-help-btn{width:36px!important;padding:0!important}}
