/* LoopMensal - Site CSS */
:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1a2035;
    --topbar-height: 56px;
    font-family: 'Inter', system-ui, sans-serif;
}

body { font-family: 'Inter', system-ui, sans-serif; }

/* ========== LANDING PAGE ========== */
.hero-section { background: linear-gradient(135deg, #f8faff 0%, #eef2ff 100%); min-height: 85vh; display: flex; align-items: center; }
.min-vh-75 { min-height: 75vh; }
.py-6 { padding-top: 5rem; padding-bottom: 5rem; }
.border-y { border-top: 1px solid #dee2e6; border-bottom: 1px solid #dee2e6; }
.text-white-75 { color: rgba(255,255,255,.75); }

.hero-dashboard-preview { position: relative; }
.hero-dashboard-preview .card { transform: perspective(1000px) rotateY(-5deg) rotateX(3deg); transition: transform .3s; }
.hero-dashboard-preview .card:hover { transform: perspective(1000px) rotateY(0deg) rotateX(0deg); }

.avatar-stack { display: flex; }
.avatar-item { width: 32px; height: 32px; border-radius: 50%; border: 2px solid white; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: bold; margin-left: -8px; }
.avatar-item:first-child { margin-left: 0; }

.feature-card { border-radius: 12px; transition: transform .2s, box-shadow .2s; }
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.1) !important; }
.feature-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }

.step-number { width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.2); color: white; font-size: 1.25rem; font-weight: bold; display: flex; align-items: center; justify-content: center; margin: 0 auto; }

.stat-mini { transition: transform .15s; }
.stat-mini:hover { transform: scale(1.02); }

/* Brand logo */
.brand-logo-lg { width: 60px; height: 60px; background: linear-gradient(135deg, #0d6efd, #6610f2); border-radius: 16px; display: flex; align-items: center; justify-content: center; }

/* ========== APP LAYOUT ========== */
#app-wrapper { min-height: 100vh; background: #f4f6fb; }

.sidebar { width: var(--sidebar-width); min-height: 100vh; background: var(--sidebar-bg); display: flex; flex-direction: column; position: sticky; top: 0; flex-shrink: 0; z-index: 100; }
.sidebar-header { border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-icon { width: 36px; height: 36px; background: linear-gradient(135deg, #0d6efd, #6610f2); border-radius: 8px; display: flex; align-items: center; justify-content: center; }

.sidebar-link { color: rgba(255,255,255,.7) !important; border-radius: 8px; padding: .6rem .8rem; display: flex; align-items: center; gap: .6rem; font-size: .875rem; transition: all .15s; margin-bottom: 2px; }
.sidebar-link:hover { color: white !important; background: rgba(255,255,255,.1); }
.sidebar-link.active { color: white !important; background: rgba(13,110,253,.4); }
.sidebar-link i { font-size: 1rem; width: 20px; text-align: center; }

.nav-divider { height: 1px; background: rgba(255,255,255,.1); margin: 0 .8rem; }

.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: #0d6efd; color: white; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: .85rem; flex-shrink: 0; }
.user-avatar-sm { width: 32px; height: 32px; border-radius: 50%; background: #0d6efd; color: white; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: .75rem; flex-shrink: 0; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.1); }

#main-content { min-width: 0; }
.top-bar { height: var(--topbar-height); position: sticky; top: 0; z-index: 50; }
.app-footer { box-shadow: 0 -1px 0 rgba(17,24,39,.02); }
.app-footer a:hover { color: #0d6efd !important; }
.app-swal-toast { box-shadow: 0 14px 38px rgba(15,23,42,.18) !important; }

/* KPI Cards */
.kpi-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.notif-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Sidebar toggle */
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed span, .sidebar.collapsed .sidebar-tenant, .sidebar.collapsed .sidebar-footer .flex-grow-1, .sidebar.collapsed .sidebar-footer a:not([title]) { display: none !important; }
.sidebar.collapsed .sidebar-link { justify-content: center; padding: .6rem; }
.sidebar.collapsed .nav-link.sidebar-link i { margin: 0; width: auto; }

/* Tables */
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }

/* Alerts auto dismiss */
.toast-auto { animation: fadeOut 5s forwards; }
@keyframes fadeOut { 0%,80% { opacity: 1; } 100% { opacity: 0; pointer-events: none; } }

/* Categories */
.category-health {
    background: #fff;
    border: 1px solid rgba(13,110,253,.12);
    border-radius: 999px;
    padding: .55rem .85rem;
    color: #64748b;
    font-size: .82rem;
    box-shadow: 0 4px 16px rgba(15,23,42,.05);
}
.category-summary-card {
    min-height: 98px;
    background: #fff;
    border: 1px solid rgba(15,23,42,.06);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: .85rem;
    box-shadow: 0 8px 24px rgba(15,23,42,.06);
}
.category-summary-icon,
.category-section-icon,
.category-row-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.category-summary-icon {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    font-size: 1.25rem;
}
.category-summary-value {
    font-size: 1.55rem;
    line-height: 1;
    font-weight: 700;
    color: #111827;
}
.category-section-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    font-size: 1.1rem;
}
.category-form-card { position: sticky; top: calc(var(--topbar-height) + 1.5rem); }
.category-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
}
.category-type-selector .btn {
    min-height: 42px;
    font-weight: 600;
}
.category-table tbody tr { border-top: 1px solid rgba(15,23,42,.06); }
.category-table tbody tr:hover { background: rgba(13,110,253,.025); }
.category-row-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
}
.category-empty {
    padding: 3.5rem 1rem;
    text-align: center;
    color: #6c757d;
}

/* Badge subtle colors fix */
.bg-warning-subtle { background-color: #fff3cd !important; }
.bg-success-subtle { background-color: #d1e7dd !important; }
.bg-danger-subtle { background-color: #f8d7da !important; }
.bg-primary-subtle { background-color: #cfe2ff !important; }
.bg-info-subtle { background-color: #cff4fc !important; }
.bg-secondary-subtle { background-color: #e2e3e5 !important; }

/* Rounded card tops */
.rounded-top-4 { border-top-left-radius: .75rem !important; border-top-right-radius: .75rem !important; }

/* Loading overlay */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(248,249,250,.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
#loading-overlay.d-none { display: none !important; }
.loading-box {
    background: #fff;
    border: 1px solid rgba(13,110,253,.12);
    border-radius: 24px;
    padding: 3rem 3.6rem;
    box-shadow: 0 18px 64px rgba(0,0,0,.16), 0 4px 14px rgba(0,0,0,.08);
    text-align: center;
    box-sizing: border-box;
    width: min(440px, calc(100vw - 2rem));
    max-width: 440px;
}
.loading-ring {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: #e8f0ff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    animation: loading-pulse 1.8s ease-in-out infinite;
}
.loading-icon-spin {
    font-size: 2.65rem;
    color: #0d6efd;
    animation: loading-spin 1.5s linear infinite;
}
.loading-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0d6efd;
    letter-spacing: -.2px;
}
.loading-status {
    font-size: 1rem;
    font-weight: 600;
    color: #6c757d;
}
.loading-dots {
    display: flex;
    gap: 7px;
    justify-content: center;
}
.loading-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #0d6efd;
    animation: loading-dot-bounce 1.3s ease-in-out infinite;
}
.loading-dot:nth-child(2) { animation-delay: .18s; }
.loading-dot:nth-child(3) { animation-delay: .36s; }
.loading-tip {
    font-size: .9rem;
    color: #8b96a3;
    line-height: 1.4;
    min-height: 2.6em;
    transition: opacity .25s ease;
}
@keyframes loading-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes loading-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(13,110,253,.22); }
    70%  { box-shadow: 0 0 0 16px rgba(13,110,253,0); }
    100% { box-shadow: 0 0 0 0 rgba(13,110,253,0); }
}
@keyframes loading-dot-bounce {
    0%, 80%, 100% { opacity: .18; transform: scale(.8); }
    40%            { opacity: 1;   transform: scale(1.15); }
}

/* Botão de ajuda "?" */
.help-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    flex-shrink: 0;
    border: 0;
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    color: #fff;
    box-shadow: 0 8px 22px rgba(13,110,253,.34);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.help-btn i { font-size: 1.25rem; line-height: 1; }
.help-btn:hover,
.help-btn:focus {
    color: #fff;
    background: linear-gradient(135deg, #0b5ed7, #5a0fc8);
    box-shadow: 0 10px 28px rgba(13,110,253,.45);
    filter: saturate(1.08);
    transform: translateY(-1px);
}
.help-btn:focus-visible {
    outline: 3px solid rgba(13,110,253,.28);
    outline-offset: 3px;
}

/* Topbar user dropdown */
.topbar-user .dropdown-menu { min-width: 200px; }
.topbar-user > button:focus { box-shadow: none; }
.topbar-user > button { padding: .25rem .35rem; border-radius: 999px; transition: background-color .15s ease; }
.topbar-user > button:hover { background: rgba(13,110,253,.07) !important; }
.topbar-user-avatar,
.topbar-user-menu-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    color: white;
    border: 3px solid #fff;
    box-shadow: 0 6px 16px rgba(13,110,253,.28), 0 0 0 1px rgba(13,110,253,.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .95rem;
    flex-shrink: 0;
}
.topbar-user-menu-avatar {
    width: 44px;
    height: 44px;
}

/* Topbar notificações */
.topbar-notif { border-radius: 50% !important; width: 2rem; height: 2rem; padding: 0; display: flex; align-items: center; justify-content: center; }

/* WhatsApp flutuante */
.whatsapp-float {
    position: fixed;
    bottom: 1.75rem;
    right: 1.75rem;
    width: 3.25rem;
    height: 3.25rem;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.625rem;
    box-shadow: 0 4px 20px rgba(0,0,0,.22);
    z-index: 1055;
    text-decoration: none;
    transition: transform .18s, box-shadow .18s;
}
.whatsapp-float:hover { transform: scale(1.12); box-shadow: 0 6px 28px rgba(0,0,0,.28); color: #fff; }

/* Plan cards */
.plan-card { border-top: 3px solid #0d6efd !important; transition: box-shadow .15s, transform .15s; }
.plan-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,.12) !important; transform: translateY(-2px); }
.plan-card-inactive { border-top-color: #adb5bd !important; }
.plan-divider { border-color: rgba(13,110,253,.15); }

/* Custom sidebar tooltips */
.tooltip .tooltip-inner {
    background: #1a2035;
    color: rgba(255,255,255,.92);
    font-size: .78rem;
    padding: .35rem .75rem;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    max-width: 220px;
    text-align: left;
}
.tooltip.bs-tooltip-end .tooltip-arrow::before { border-right-color: #1a2035; }
.tooltip.bs-tooltip-start .tooltip-arrow::before { border-left-color: #1a2035; }
.tooltip.bs-tooltip-top .tooltip-arrow::before { border-top-color: #1a2035; }
.tooltip.bs-tooltip-bottom .tooltip-arrow::before { border-bottom-color: #1a2035; }
