/* =====================================================
   MINHA CONTABILIDADE — APP CSS
   Mobile First | Dark/Light Mode | Bootstrap 5
   ===================================================== */

:root {
    --mc-sidebar-width: 260px;

    /* Sidebar — light mode */
    --mc-sidebar-bg: #ffffff;
    --mc-sidebar-border: #e2e8f0;
    --mc-sidebar-color: #64748b;
    --mc-sidebar-hover-bg: rgba(13,110,253,.07);
    --mc-sidebar-hover-color: #0d6efd;
    --mc-sidebar-active-bg: rgba(13,110,253,.12);
    --mc-sidebar-active-color: #0d6efd;
    --mc-sidebar-label-color: #94a3b8;
    --mc-sidebar-brand-color: #1e293b;
    --mc-sidebar-footer-border: #e2e8f0;
    --mc-sidebar-user-color: #64748b;
    --mc-sidebar-user-name: #1e293b;
    --mc-sidebar-divider: rgba(0,0,0,.06);

    --mc-topbar-h: 60px;
    --mc-content-bg: #f1f5f9;
    --mc-card-bg: #ffffff;
    --mc-card-border: #e2e8f0;
    --mc-text: #1e293b;
    --mc-muted: #64748b;
    --mc-radius: 12px;
    --mc-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --mc-shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

[data-bs-theme="dark"] {
    /* Sidebar — dark mode */
    --mc-sidebar-bg: #0f172a;
    --mc-sidebar-border: #1e293b;
    --mc-sidebar-color: #94a3b8;
    --mc-sidebar-hover-bg: rgba(255,255,255,.06);
    --mc-sidebar-hover-color: #e2e8f0;
    --mc-sidebar-active-bg: rgba(13,110,253,.18);
    --mc-sidebar-active-color: #60a5fa;
    --mc-sidebar-label-color: #475569;
    --mc-sidebar-brand-color: #e2e8f0;
    --mc-sidebar-footer-border: rgba(255,255,255,.06);
    --mc-sidebar-user-color: #94a3b8;
    --mc-sidebar-user-name: #e2e8f0;
    --mc-sidebar-divider: rgba(255,255,255,.06);

    --mc-content-bg: #0f172a;
    --mc-card-bg: #1e293b;
    --mc-card-border: #334155;
    --mc-text: #e2e8f0;
    --mc-muted: #94a3b8;
    --mc-shadow: 0 1px 3px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--mc-content-bg);
    color: var(--mc-text);
    margin: 0;
}

/* ===== LAYOUT ===== */
.mc-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.mc-sidebar {
    width: var(--mc-sidebar-width);
    background: var(--mc-sidebar-bg);
    border-right: 1px solid var(--mc-sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1000;
    transition: transform .25s ease, background .2s, border-color .2s;
    overflow-y: auto;
}

.mc-sidebar-header {
    padding: 20px 16px 12px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--mc-sidebar-divider);
}

.mc-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--mc-sidebar-brand-color);
    font-size: .95rem;
    transition: color .2s;
}
.mc-brand i { font-size: 1.4rem; }
.mc-brand strong { font-weight: 800; }

.mc-nav { padding: 12px 0; flex: 1; }

.mc-nav-label {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mc-sidebar-label-color);
    padding: 12px 16px 4px;
    transition: color .2s;
}

.mc-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: var(--mc-sidebar-color);
    text-decoration: none;
    font-size: .875rem;
    border-radius: 8px;
    margin: 1px 8px;
    transition: background .15s, color .15s;
}

.mc-nav-item:hover {
    background: var(--mc-sidebar-hover-bg);
    color: var(--mc-sidebar-hover-color);
}

.mc-nav-item.active {
    background: var(--mc-sidebar-active-bg);
    color: var(--mc-sidebar-active-color);
    font-weight: 600;
}

.mc-nav-item i { width: 18px; text-align: center; font-size: 1rem; }

.mc-sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--mc-sidebar-footer-border);
    transition: border-color .2s;
}

.mc-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--mc-sidebar-user-color);
    transition: background .15s, color .2s;
}
.mc-user-info:hover { background: var(--mc-sidebar-hover-bg); }

.mc-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #0d6efd, #6f42c1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: .9rem;
    flex-shrink: 0;
}

.mc-user-details strong {
    display: block;
    font-size: .8rem;
    color: var(--mc-sidebar-user-name);
    line-height: 1.2;
    transition: color .2s;
}
.mc-user-details small { font-size: .7rem; }

/* ===== MAIN ===== */
.mc-main {
    margin-left: var(--mc-sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== TOPBAR ===== */
.mc-topbar {
    height: var(--mc-topbar-h);
    background: var(--mc-card-bg);
    border-bottom: 1px solid var(--mc-card-border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--mc-shadow);
}

.mc-topbar-title {
    font-weight: 600;
    font-size: .95rem;
    color: var(--mc-text);
}

/* ===== CONTENT ===== */
.mc-content {
    padding: 20px;
    flex: 1;
}

/* ===== CARDS ===== */
.mc-card {
    background: var(--mc-card-bg);
    border: 1px solid var(--mc-card-border);
    border-radius: var(--mc-radius);
    box-shadow: var(--mc-shadow);
    overflow: hidden;
}

.mc-card-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--mc-card-border);
    font-weight: 600;
}

.mc-card-body {
    padding: 16px;
}

/* ===== KPI CARDS ===== */
.mc-kpi {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.mc-kpi-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.mc-kpi-info { flex: 1; min-width: 0; }
.mc-kpi-info small { font-size: .75rem; }
.mc-kpi-info h4 { font-size: 1.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== TABLE ===== */
.mc-table th {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--mc-muted);
    border-bottom-width: 1px;
    padding: 10px 12px;
    white-space: nowrap;
}

.mc-table td {
    padding: 10px 12px;
    vertical-align: middle;
    font-size: .875rem;
    border-bottom: 1px solid var(--mc-card-border);
}

.mc-table tbody tr:last-child td { border-bottom: none; }
.mc-table tbody tr:hover { background: rgba(13,110,253,.03); }

/* ===== AUTH ===== */
.mc-auth-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mc-auth-wrapper {
    width: 100%;
    max-width: 440px;
}

.mc-auth-card {
    background: var(--mc-card-bg);
    border: 1px solid var(--mc-card-border);
    border-radius: 20px;
    padding: 0 32px 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.mc-auth-brand {
    text-align: center;
    margin-bottom: 4px;
}

.mc-auth-brand img {
    margin-top: -32px;
    margin-bottom: -40px;
}

.mc-auth-brand h4 { font-size: 1.3rem; }

/* ===== OVERLAY MOBILE ===== */
.mc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
}

.mc-overlay.active { display: block; }

/* ===== MOBILE ===== */
@media (max-width: 991.98px) {
    .mc-sidebar {
        transform: translateX(-100%);
    }

    .mc-sidebar.open {
        transform: translateX(0);
    }

    .mc-main {
        margin-left: 0;
    }
}

/* ===== LANDING ===== */
.mc-landing-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
    color: white;
    padding: 100px 0;
}

.mc-landing-hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; }

.mc-plan-card {
    border-radius: 16px;
    border: 2px solid var(--mc-card-border);
    transition: transform .2s, box-shadow .2s;
}

.mc-plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,.15);
}

.mc-plan-card.featured {
    border-color: #0d6efd;
    box-shadow: 0 8px 32px rgba(13,110,253,.2);
}

/* ===== SIDEBAR MASTER ===== */
[data-bs-theme="dark"] .mc-sidebar-master {
    --mc-sidebar-bg: #0a0a1a;
    --mc-sidebar-border: #1a1a2e;
    --mc-sidebar-brand-color: #e2e8f0;
    --mc-sidebar-color: #94a3b8;
    --mc-sidebar-hover-bg: rgba(255,255,255,.06);
    --mc-sidebar-hover-color: #e2e8f0;
    --mc-sidebar-active-bg: rgba(13,110,253,.18);
    --mc-sidebar-active-color: #60a5fa;
    --mc-sidebar-label-color: #475569;
    --mc-sidebar-footer-border: rgba(255,255,255,.06);
    --mc-sidebar-user-color: #94a3b8;
    --mc-sidebar-user-name: #e2e8f0;
    --mc-sidebar-divider: rgba(255,255,255,.06);
    background: var(--mc-sidebar-bg);
}

/* ===== LOGO POR TEMA ===== */
.mc-logo-dark { display: none; }
[data-bs-theme="dark"] .mc-logo-light { display: none; }
[data-bs-theme="dark"] .mc-logo-dark { display: inline-block; }

/* ===== TOPBAR REMOVIDA (MASTER) ===== */
.mc-mobile-toggle {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
@media (max-width: 991.98px) {
    .mc-no-topbar .mc-content { padding-top: 60px; }
}

/* ===== USER CHIP (TOPBAR) ===== */
.mc-user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    border: 1px solid var(--mc-card-border);
    border-radius: 999px;
    background: var(--mc-card-bg);
    color: var(--bs-body-color);
    cursor: pointer;
    transition: background .2s, border-color .2s;
}
.mc-user-chip::after { margin-left: 2px; opacity: .5; }
.mc-user-chip:hover { background: var(--mc-sidebar-hover-bg); border-color: var(--mc-sidebar-hover-color); }
.mc-user-chip-avatar {
    width: 34px; height: 34px;
    flex: 0 0 34px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd, #6f42c1);
    color: #fff; font-weight: 700; font-size: .9rem;
}
.mc-user-chip-meta { flex-direction: column; line-height: 1.1; text-align: left; }
.mc-user-chip-name { font-weight: 600; font-size: .85rem; }
.mc-user-chip-role { font-size: .7rem; opacity: .6; }
.mc-user-menu { min-width: 220px; border-radius: 12px; }

/* ===== UTILITIES ===== */
.text-purple { color: #6f42c1 !important; }
.bg-purple-subtle { background: rgba(111,66,193,.15) !important; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #475569; border-radius: 10px; }

/* ===== RESPONSIVE UTILITIES ===== */
@media (max-width: 575.98px) {
    .mc-content { padding: 12px; }
    .mc-kpi-info h4 { font-size: 1rem; }
    .mc-card-body { padding: 12px; }
}

@media (max-width: 767.98px) {
    .mc-kpi { padding: 12px; }
    .mc-kpi-icon { width: 40px; height: 40px; font-size: 1.1rem; }
}
