/* =========================================
   Marketing Unidos - App CSS
   ========================================= */

:root {
    --sidebar-width: 240px;
    --topbar-height: 56px;
    --primary: #4361ee;
    --sidebar-bg: #1a1f2e;
    --sidebar-text: rgba(255,255,255,.75);
    --sidebar-text-active: #fff;
    --sidebar-active-bg: rgba(255,255,255,.1);
}

/* Layout */
body {
    margin: 0;
    background: #f4f6fb;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Sidebar */
#sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    overflow-y: auto;
    z-index: 200;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 1.25rem 1.25rem 1rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
}

.sidebar-brand i { font-size: 1.3rem; color: var(--primary); }
.sidebar-brand img.sidebar-logo { max-height: 32px; max-width: 100%; }

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: .5rem 0;
    flex-grow: 1;
}

.sidebar-section {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.35);
    padding: 1rem 1.25rem .25rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .6rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 0;
    transition: background .15s, color .15s;
    font-size: .88rem;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,.07);
    color: var(--sidebar-text-active);
}

.sidebar-nav .nav-link.active {
    background: var(--primary);
    color: #fff;
}

.sidebar-nav .nav-link i { font-size: 1rem; flex-shrink: 0; }

/* Main content */
#main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1rem;
}

.topbar-title {
    font-weight: 600;
    font-size: .95rem;
    color: #495057;
}

/* Page container */
.main-container {
    padding: 1.5rem;
    flex-grow: 1;
}

/* Cards */
.card {
    border: 1px solid #e9ecef;
    border-radius: .75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: .875rem 1.25rem;
    border-radius: .75rem .75rem 0 0 !important;
}

/* Stat cards */
.stat-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: .75rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.stat-card-primary { border-left: 3px solid var(--primary); }
.stat-card-success  { border-left: 3px solid #28a745; }
.stat-card-warning  { border-left: 3px solid #ffc107; }
.stat-card-danger   { border-left: 3px solid #dc3545; }

.stat-icon { font-size: 1.5rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .8rem; color: #6c757d; font-weight: 500; }

/* Tables */
.table { margin-bottom: 0; }
.table th {
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6c757d;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

/* Badges */
.badge { font-weight: 500; }

/* Auth layout */
.auth-body {
    background: linear-gradient(135deg, var(--sidebar-bg), #2d3561);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

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

.auth-card {
    background: #fff;
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,.2);
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo i { font-size: 2.5rem; color: var(--primary); }
.auth-logo h1 { font-size: 1.5rem; font-weight: 700; margin: .5rem 0 .25rem; }

/* Timeline */
.timeline { max-height: 500px; overflow-y: auto; }

/* Responsive */
@media (max-width: 768px) {
    #sidebar {
        transform: translateX(-100%);
        transition: transform .25s;
    }
    #sidebar.open {
        transform: translateX(0);
    }
    #main-content {
        margin-left: 0;
    }
}

/* Misc */
.font-monospace { font-size: .85rem; }
code.copy-var:hover { opacity: .7; }
