/* CRM Mais Networking - Main Stylesheet */
:root {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-sidebar: #0c2340;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.08);
    --bg-sidebar-active: #3b82f6;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-sidebar: #e2e8f0;
    --border-color: #e2e8f0;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: #dbeafe;
    --success: #22c55e;
    --success-light: #dcfce7;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --purple: #8b5cf6;
    --purple-light: #ede9fe;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-sm: 6px;
}

body.dark {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-sidebar: #071528;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.1);
    --bg-sidebar-active: #2563eb;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-sidebar: #cbd5e1;
    --border-color: #334155;
    --accent: #60a5fa;
    --accent-hover: #3b82f6;
    --accent-light: #1e3a5f;
    --success-light: #14532d;
    --warning-light: #78350f;
    --danger-light: #7f1d1d;
    --purple-light: #3b1f6e;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); }

/* ===== LAYOUT ===== */
.app-container { display: flex; min-height: 100vh; overflow-x: hidden; }

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--bg-sidebar);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 200;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
    /* Mobile: closed by default */
    transform: translateX(-100%);
    box-shadow: 5px 0 25px rgba(0,0,0,0.25);
    border-right: 1px solid #334155;
}
.sidebar.sidebar-open,
.sidebar.mobile-open {
    transform: translateX(0);
}
.sidebar-brand {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: auto;
    flex-shrink: 0;
    height: 40px;
    overflow: hidden;
}
.sidebar-brand img {
    max-width: 140px !important;
    max-height: 28px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
}
.sidebar-nav { flex: 1; padding: 8px 0; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-sidebar);
    transition: background 0.15s, color 0.15s;
    font-size: 14px;
    text-decoration: none;
}
.nav-item:hover { background: var(--bg-sidebar-hover); color: #fff; }
.nav-item.active { background: var(--bg-sidebar-active); color: #fff; font-weight: 500; }
.nav-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.user-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}
.user-details { flex: 1; min-width: 0; }
.user-name { color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: var(--text-sidebar); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Sidebar credits */
.sidebar-credits {
    text-align: center;
    color: var(--text-sidebar);
    font-size: 9px;
    padding: 6px 12px;
    margin: 8px 12px 0 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
    opacity: 0.7;
}

/* Main content */
.main-content {
    margin-left: 250px;
    flex: 1;
    min-height: 100vh;
    width: calc(100% - 250px);
    transition: margin 0.2s ease;
}
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 10px;
    height: 71px;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--bg-primary); }
.page-content { padding: 20px 24px; max-width: 100%; }

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.page-title { font-size: 1.5rem; font-weight: 700; line-height: 1.3; }

/* ===== CARDS ===== */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.card-title { font-size: 0.95rem; font-weight: 600; }
.card-body { padding: 18px; }

/* ===== STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.stat-icon { font-size: 1.8rem; opacity: 0.7; flex-shrink: 0; line-height: 1; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.3; }
.stat-red .stat-value { color: var(--danger); }
.stat-blue .stat-value { color: var(--accent); }
.stat-green .stat-value { color: var(--success); }

/* Dashboard 2-col grid */
.dashboard-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }

/* ===== FORMS ===== */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-label { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); display: block; margin-bottom: 2px; }
.form-input {
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    -webkit-appearance: none;
}
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.form-actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
select.form-input { appearance: auto; }
.info-table { width: 100%; }
.info-table td { padding: 8px 10px; border-bottom: 1px solid var(--border-color); vertical-align: top; word-break: break-word; }
.info-table td:first-child { width: 150px; color: var(--text-secondary); font-weight: 500; }
.info-table tr:last-child td { border-bottom: none; }

/* ===== TEXT ===== */
.text-muted { color: var(--text-secondary); font-size: 0.85rem; }
.text-danger { color: var(--danger); }
.link-primary { color: var(--accent); font-weight: 500; }
.link-primary:hover { color: var(--accent-hover); }
.ml-auto { margin-left: auto; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mr-1 { margin-right: 4px; }
.mb-1 { margin-bottom: 4px; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 8px 14px; border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 500;
    border: 1px solid transparent; cursor: pointer;
    transition: all 0.15s; text-decoration: none;
    background: none; white-space: nowrap; line-height: 1.3;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-outline { color: var(--text-primary); border-color: var(--border-color); background: transparent; }
.btn-outline:hover { background: var(--bg-primary); }
.btn-ghost { color: var(--text-secondary); padding: 4px 8px; }
.btn-ghost:hover { background: var(--bg-primary); }
.btn-warning { background: var(--warning); color: #000; border-color: var(--warning); }
.btn-warning:hover { opacity: 0.9; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { opacity: 0.9; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-xs { padding: 3px 7px; font-size: 0.75rem; border-radius: 4px; }
.btn-full { width: 100%; justify-content: center; }

/* ===== TABLES ===== */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 10px; text-align: left; border-bottom: 1px solid var(--border-color); }
.table th { font-size: 0.75rem; text-transform: uppercase; color: var(--text-secondary); font-weight: 600; letter-spacing: 0.3px; white-space: nowrap; }
.table tbody tr:hover { background: var(--bg-primary); }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; }

/* ===== PAGINATION ===== */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; flex-wrap: wrap; gap: 12px; }
.pagination-links { display: flex; align-items: center; gap: 10px; }
.pagination-current { font-size: 0.8rem; color: var(--text-secondary); white-space: nowrap; }
.pagination-info { font-size: 0.85rem; color: var(--text-secondary); }

/* ===== BADGES ===== */
.badge {
    display: inline-block; padding: 2px 9px;
    border-radius: 999px; font-size: 0.72rem; font-weight: 500;
    white-space: nowrap; line-height: 1.4;
}
.badge-novo { background: var(--accent-light); color: var(--accent); }
.badge-em-contato { background: var(--warning-light); color: var(--warning); } /* Em contacto -> em-contato */
.badge-proposta-enviada { background: var(--purple-light); color: var(--purple); }
.badge-cliente { background: var(--success-light); color: var(--success); }
.badge-perdido { background: var(--danger-light); color: var(--danger); }
.badge-blue { background: var(--accent-light); color: var(--accent); }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-priority-alta { background: var(--danger-light); color: var(--danger); }
.badge-priority-media { background: var(--warning-light); color: var(--warning); }
.badge-priority-baixa { background: var(--success-light); color: var(--success); }
.badge-outline { background: none !important; border: 1px solid var(--border-color); color: var(--text-primary); }

/* ===== ALERTS ===== */
.alert { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; position: relative; font-size: 0.88rem; }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid var(--success); }
.alert-error { background: var(--danger-light); color: var(--danger); border: 1px solid var(--danger); }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid var(--warning); }
.alert-close { position: absolute; right: 10px; top: 8px; background: none; border: none; cursor: pointer; font-size: 18px; color: inherit; opacity: 0.6; padding: 0; line-height: 1; }
.alert-close:hover { opacity: 1; }

/* ===== FILTERS ===== */
.filters-row {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end;
}
.filter-input { min-width: 140px; flex: 1 1 140px; }
.filters-row .btn, .filters-row a.btn { flex-shrink: 0; align-self: flex-end; }

/* ===== TIMELINE ===== */
.timeline { position: relative; }
.timeline-item { position: relative; padding-left: 28px; margin-bottom: 16px; }
.timeline-dot {
    position: absolute; left: 2px; top: 14px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent);
}
.timeline-dot.chamada { background: var(--success); }
.timeline-dot.email { background: var(--purple); }
.timeline-dot.reuniao { background: var(--warning); }
.timeline-content {
    background: var(--bg-primary); border-radius: var(--radius-sm); padding: 10px 14px;
    border: 1px solid var(--border-color);
}
.timeline-header { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; flex-wrap: wrap; }
.timeline-desc { margin: 4px 0; word-break: break-word; }

/* ===== PROGRESS / CHARTS ===== */
.progress-bar { height: 6px; background: var(--bg-primary); border-radius: 3px; margin-bottom: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.bg-blue { background: var(--accent); }
.bg-green { background: var(--success); }
.bg-red { background: var(--danger); }
.bg-yellow { background: var(--warning); }
.bg-purple { background: var(--purple); }
.bg-gray { background: var(--text-secondary); }

.chart-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.chart-label { width: 110px; font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.chart-bar-track { flex: 1; min-width: 40px; height: 12px; background: var(--bg-primary); border-radius: 6px; overflow: hidden; }
.chart-bar-fill { height: 100%; border-radius: 6px; transition: width 0.3s; }
.chart-value { width: 26px; text-align: right; font-weight: 600; font-size: 0.82rem; flex-shrink: 0; }

.estado-item { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.estado-left { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.estado-icon { font-size: 13px; }

/* ===== TAGS ===== */
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; background: var(--bg-primary); border: 1px solid var(--border-color); color: var(--text-primary); margin: 1px; }

/* ===== EMPTY STATE ===== */
.empty-state { padding: 50px 20px; text-align: center; }
.empty-state-icon { font-size: 2.8rem; margin-bottom: 10px; opacity: 0.4; display: block; }

/* ===== LOGIN PAGE ===== */
.login-wrapper {
    min-height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px;
    width: 100%;
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: #1e293b;
    border-radius: 10px;
    padding: 36px 28px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

/* ===== PWA: Viewport & Safe Areas ===== */
@supports (padding: env(safe-area-inset-bottom)) {
    .page-content { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
    .sidebar { padding-bottom: env(safe-area-inset-bottom); }
}

/* ==============================================
   RESPONSIVE
   ============================================== */

/* --- Desktop (> 768px): sidebar always visible --- */
@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0) !important;
        box-shadow: none;
    }
    .sidebar-toggle { display: none !important; }
    /* Hide overlay on desktop */
    .sidebar-overlay { display: none !important; }
    /* Stats 4 cols on desktop */
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Mobile - 768px */
@media (max-width: 768px) {
    /* Sidebar off-canvas, open via .sidebar-open */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    .sidebar-toggle { display: block !important; }
    .topbar { padding: 8px 14px; }
    .page-content { padding: 14px; }

    /* Overlay */
    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.55);
        z-index: 150;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    .sidebar.mobile-open ~ .sidebar-overlay,
    .sidebar.sidebar-open ~ .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    /* Page header stacks */
    .page-header { flex-direction: column; align-items: stretch; gap: 10px; }
    .page-header > div:last-child { display: flex; flex-wrap: wrap; gap: 6px; }

    /* Filters stack */
    .filters-row { flex-direction: column; }
    .filter-input { min-width: 100%; flex: 1 1 100%; }

    /* Cards */
    .card { margin-bottom: 14px; }
    .card-header { padding: 11px 14px; }
    .card-body { padding: 14px; }

    /* Table cells compact */
    .table th, .table td { padding: 8px 6px; font-size: 0.82rem; }
    .table th { font-size: 0.7rem; }

    /* Form single column */
    .form-grid { grid-template-columns: 1fr; gap: 12px; }

    /* Chart */
    .chart-bar-label { width: 90px; font-size: 0.78rem; }
}

/* Mobile - 768px */
@media (max-width: 768px) {
    /* Sidebar always off-canvas on mobile, open via .sidebar-open */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    .sidebar-toggle { display: block !important; }
    .topbar { padding: 8px 14px; }
    .page-content { padding: 14px; }

    /* Page header stacks */
    .page-header { flex-direction: column; align-items: stretch; gap: 10px; }
    .page-header > div:last-child { display: flex; flex-wrap: wrap; gap: 6px; }

    /* Filters stack */
    .filters-row { flex-direction: column; }
    .filter-input { min-width: 100%; flex: 1 1 100%; }

    /* Cards */
    .card { margin-bottom: 14px; }
    .card-header { padding: 11px 14px; }
    .card-body { padding: 14px; }

    /* Table cells compact */
    .table th, .table td { padding: 8px 6px; font-size: 0.82rem; }
    .table th { font-size: 0.7rem; }

    /* Form single column */
    .form-grid { grid-template-columns: 1fr; gap: 12px; }

    /* Chart */
    .chart-bar-label { width: 90px; font-size: 0.78rem; }
}

/* Small Mobile - 576px */
@media (max-width: 576px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-card { padding: 10px; flex-direction: row; }
    .stat-icon { font-size: 1.2rem; }
    .stat-value { font-size: 1.2rem; }
    .stat-label { font-size: 0.7rem; }

    .page-title { font-size: 1.2rem; }
    .page-content { padding: 12px; }

    /* Dashboard single col */
    .dashboard-grid-2 { grid-template-columns: 1fr; }

    /* Pagination stacks */
    .pagination { flex-direction: column; align-items: stretch; gap: 10px; }
    .pagination-links { justify-content: center; }

    /* Buttons in header fill width */
    .page-header > div:last-child .btn { flex: 1; justify-content: center; min-width: 0; }

    /* Timeline compact */
    .timeline-item { padding-left: 22px; margin-bottom: 12px; }
    .timeline-content { padding: 8px 10px; }
    .timeline-dot { width: 6px; height: 6px; top: 12px; left: 1px; }

    /* Info table stacks */
    .info-table td, .info-table td:first-child { display: block; width: 100%; padding: 2px 8px; }
    .info-table tr { display: block; padding: 6px 0; }
    .info-table td:first-child { padding-bottom: 0; padding-top: 2px; }
}

/* Extra small - 400px */
@media (max-width: 400px) {
    html { font-size: 13.5px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-card { padding: 8px; gap: 8px; }
    .stat-value { font-size: 1.1rem; }
    .stat-label { font-size: 0.68rem; }
    .stat-icon { font-size: 1rem; }

    .login-card { padding: 28px 20px; }
    .sidebar { width: 240px; }

    /* Action buttons row scroll */
    .table-actions-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Touch optimization */
@media (hover: none) and (pointer: coarse) {
    .btn, .nav-item, select, input[type="file"] { min-width: 44px; }
    .nav-item { padding: 12px 16px; min-height: 44px; }
    .btn-xs { min-height: 32px; padding: 4px 8px; }
    .btn-sm { min-height: 38px; padding: 6px 12px; }
    input, select, textarea { min-height: 42px; font-size: 16px; } /* Prevent zoom on iOS */
}

/* PWA: installable look */
@media (display-mode: standalone) {
    .topbar { padding-top: calc(10px + env(safe-area-inset-top, 0)); }
    .sidebar { padding-top: env(safe-area-inset-top, 0); }
}

/* Print */
@media print {
    .sidebar, .topbar, .btn, .alert-close, .sidebar-toggle { display: none !important; }
    .main-content { margin-left: 0 !important; width: 100% !important; }
    .card { box-shadow: none; border: 1px solid #ddd; page-break-inside: avoid; }
    body { background: #fff; color: #000; }
    a { color: #000; text-decoration: underline; }
}

/* Focus visible for accessibility */
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Scrollbar customization */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(130,130,130,0.4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(130,130,130,0.6); }

/* ===== DASHBOARD ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--accent);
}

.stat-card.stat-green { border-left-color: var(--success); }
.stat-card.stat-blue { border-left-color: var(--accent); }
.stat-card.stat-yellow { border-left-color: var(--warning); }
.stat-card.stat-red { border-left-color: var(--danger); }
.stat-card.stat-purple { border-left-color: var(--purple); }

.stat-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: var(--radius);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Dashboard Grid */
.dashboard-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.dashboard-grid-2 .full-width {
    grid-column: 1 / -1;
}

/* Estado Items */
.estado-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.estado-item:last-child {
    border-bottom: none;
}

.estado-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.estado-icon {
    font-size: 16px;
}

.estado-right .tag {
    background: var(--accent-light);
    color: var(--accent);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.bg-blue { background: var(--accent); }
.bg-green { background: var(--success); }
.bg-yellow { background: var(--warning); }
.bg-red { background: var(--danger); }
.bg-purple { background: var(--purple); }
.bg-gray { background: var(--text-secondary); }

/* Chart Bars */
.chart-bar-row {
    display: grid;
    grid-template-columns: 120px 1fr 50px;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.chart-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-bar-track {
    height: 20px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.chart-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
}

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: var(--radius);
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.activity-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.activity-time {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Badge variants */
.badge-info {
    background: #3B82F6;
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-grid-2 {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-bar-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .chart-label {
        text-align: left;
    }
}

