/* ============================================================
   Portal CGCCI — Estilos Globais
   ============================================================ */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1e2a3b;
    --sidebar-text: #ced4da;
    --sidebar-link-hover: #2d3f58;
    --sidebar-link-active: #0d6efd;
    --topbar-height: 60px;
    --topbar-bg: #ffffff;
    --body-bg: #f4f6fb;
    --card-radius: 12px;
    --transition: .2s ease;
}

/* ── Reset / Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    background: var(--body-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: .925rem;
    color: #343a40;
    margin: 0;
}

/* ── Wrapper ──────────────────────────────────────────────── */
.wrapper {
    min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: width var(--transition);
    z-index: 1000;
}

.sidebar-brand {
    color: #fff !important;
}
.sidebar-brand-icon {
    width: 40px; height: 40px;
    background: var(--sidebar-link-active);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
    color: #fff;
}
.sidebar-brand-text { line-height: 1.2; }

.sidebar-divider { border-color: rgba(255,255,255,.08); }

.sidebar-heading {
    font-size: .68rem;
    letter-spacing: .08em;
    color: #6c757d !important;
    display: block;
}

.sidebar-link {
    color: var(--sidebar-text) !important;
    border-radius: 8px;
    padding: .55rem .85rem;
    display: flex;
    align-items: center;
    gap: .65rem;
    transition: background var(--transition), color var(--transition);
    font-size: .875rem;
}
.sidebar-link i { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-link:hover { background: var(--sidebar-link-hover); color: #fff !important; }
.sidebar-link.active {
    background: var(--sidebar-link-active) !important;
    color: #fff !important;
    font-weight: 600;
}

.sidebar-sub {
    font-size: .82rem;
    padding-top: .3rem;
    padding-bottom: .3rem;
    opacity: .85;
}
.sidebar-sub i { font-size: .85rem !important; }

.sidebar-footer .avatar-sm {
    width: 34px; height: 34px;
    font-size: .8rem;
}

/* ── Área principal ───────────────────────────────────────── */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    background: var(--topbar-bg);
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.topbar-title { font-size: .95rem; color: #495057; }

/* ── Conteúdo ─────────────────────────────────────────────── */
.main-content {
    flex: 1;
    padding: 1.75rem;
    overflow-x: hidden;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
    border: none;
    border-radius: var(--card-radius);
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

/* ── Cards de estatística ─────────────────────────────────── */
.stat-card {
    border-radius: var(--card-radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    color: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    transition: transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,.18); }

.stat-card-icon {
    width: 56px; height: 56px;
    border-radius: 12px;
    background: rgba(255,255,255,.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}
.stat-card-info { min-width: 0; }
.stat-card-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-card-label { font-size: .78rem; opacity: .85; }

.stat-blue    { background: linear-gradient(135deg, #0d6efd, #4a9af5); }
.stat-green   { background: linear-gradient(135deg, #198754, #28c76f); }
.stat-orange  { background: linear-gradient(135deg, #fd7e14, #ffb84d); }
.stat-purple  { background: linear-gradient(135deg, #6f42c1, #a97bda); }
.stat-teal    { background: linear-gradient(135deg, #20c997, #0ea5a0); }

/* ── Tabelas ──────────────────────────────────────────────── */
.table { font-size: .875rem; }
.table thead th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}
.table-hover tbody tr:hover { background: #f1f5ff; }

/* ── Badges de status ─────────────────────────────────────── */
.badge-status-ativo     { background: #d1f5e0; color: #0f7735; }
.badge-status-encerrado { background: #e2e3e5; color: #495057; }
.badge-status-suspenso  { background: #fff3cd; color: #856404; }
.badge-status-pendente  { background: #fff3cd; color: #856404; }
.badge-status-aprovado  { background: #d1f5e0; color: #0f7735; }
.badge-status-rejeitado { background: #f8d7da; color: #842029; }

/* ── Formulários ──────────────────────────────────────────── */
.form-label { font-weight: 600; font-size: .875rem; margin-bottom: .3rem; }
.form-control, .form-select {
    font-size: .875rem;
    border-radius: 8px;
    border-color: #dee2e6;
}
.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 .2rem rgba(13,110,253,.15);
}

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb { font-size: .8rem; }

/* ── Page header ──────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: .5rem;
}
.page-header-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #212529;
    margin: 0;
}

/* ── Alert flash ──────────────────────────────────────────── */
.alert { border-radius: 10px; font-size: .875rem; }

/* ── Avatar ───────────────────────────────────────────────── */
.avatar-sm { width: 34px; height: 34px; }

/* ── Botões ───────────────────────────────────────────────── */
.btn { border-radius: 8px; font-size: .875rem; }
.btn-sm { padding: .3rem .65rem; font-size: .8rem; }

/* ── Responsividade ───────────────────────────────────────── */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: calc(-1 * var(--sidebar-width));
        top: 0; bottom: 0;
        transition: left var(--transition);
    }
    .sidebar.show { left: 0; }
    .main-wrapper { width: 100%; }
    .main-content { padding: 1.25rem; }
}

@media (max-width: 575.98px) {
    .stat-card-value { font-size: 1.4rem; }
}
