/* ============================================================
   MELIORUS Visitas — Estilos principais
   ============================================================ */

:root {
    --sidebar-w: 250px;
    --sidebar-bg: #1a1f2e;
    --sidebar-color: #b0b7c3;
    --sidebar-active: #4f8ef7;
    --topbar-h: 56px;
    --primary: #0d6efd;
}

/* ─── Body base ─────────────────────────────────────────────── */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f1f4f9;
    color: #1a1f2e;
}

/* ─── Auth ──────────────────────────────────────────────────── */
.auth-body {
    background: linear-gradient(135deg, #0d6efd 0%, #1a1f2e 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 16px;
}
.auth-card {
    border-radius: 12px;
}
.auth-logo-wrap i {
    color: var(--primary);
}

/* ─── Sidebar ───────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-color);
    z-index: 1040;
    transition: transform 0.25s ease;
    overflow-y: auto;
    padding: 0;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}
.sidebar-brand-text {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
    line-height: 1.3;
}

.sidebar-nav {
    padding: 8px 0;
    overflow-y: auto;
}
.sidebar-nav .nav-item {
    margin: 1px 8px;
}
.sidebar-nav .nav-link {
    color: var(--sidebar-color);
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.15s;
}
.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.07);
    color: #fff;
}
.sidebar-nav .nav-link.active {
    background: rgba(79,142,247,0.18);
    color: var(--sidebar-active);
    font-weight: 600;
}
.sidebar-nav .nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}
.nav-section {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.3);
    padding: 14px 20px 4px;
    list-style: none;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.07);
}

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

/* ─── Topbar ────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ─── Page content ──────────────────────────────────────────── */
.page-content {
    flex: 1;
}

/* ─── Stat cards ─────────────────────────────────────────────── */
.stat-card .card-body {
    padding: 16px;
}
.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 10px;
}
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
}
.stat-label {
    font-size: 0.78rem;
    color: #6c757d;
    margin-top: 2px;
}

/* ─── Cards ──────────────────────────────────────────────────── */
.card {
    border-radius: 10px;
}
.card-header {
    border-radius: 10px 10px 0 0 !important;
}

/* ─── Tables ─────────────────────────────────────────────────── */
.table thead th {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #6c757d;
    border-bottom-width: 1px;
}
.table tbody tr:hover {
    background: rgba(13,110,253,0.03);
}

/* ─── Badges ─────────────────────────────────────────────────── */
.badge {
    font-weight: 500;
    font-size: 0.72rem;
    padding: 0.35em 0.65em;
}

/* ─── Alert small ────────────────────────────────────────────── */
.alert-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
}

/* ─── Responsive: mobile sidebar ─────────────────────────────── */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1039;
    }
    .sidebar-overlay.show {
        display: block;
    }
}

/* ─── Print ──────────────────────────────────────────────────── */
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #dee2e6 !important; }
}

/* ─── Misc ───────────────────────────────────────────────────── */
.form-label {
    font-size: 0.875rem;
    margin-bottom: 4px;
}
.form-label-sm {
    font-size: 0.8rem;
}
.text-truncate {
    max-width: 200px;
}
