/* ============================================================
   GestorPro - Estilos CSS
   ============================================================ */

:root {
    /* App shell */
    --topbar: #4A1060;
    --topbar-b: #3A0A50;
    --topbar-text: #EDE8F5;
    
    /* Content (dark) */
    --bg: #0D1117;
    --panel: #161B22;
    --card: #1C2333;
    --card-h: #212D40;
    --border: #2D3748;
    --border-s: #21262D;
    
    /* Accent */
    --primary: #2563EB;
    --primary-l: #3B82F6;
    --gold: #D97706;
    --green: #059669;
    --red: #DC2626;
    --orange: #EA580C;
    --teal: #0891B2;
    --purple: #7C3AED;
    --pink: #DB2777;
    
    /* Text */
    --text: #E2E8F0;
    --text-sub: #94A3B8;
    --text-dim: #64748B;
    
    /* Home (light) */
    --home-bg: #EDE8F5;
    --home-card: #FFFFFF;
    --home-text: #2D1B4E;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
    height: 44px;
    background: var(--topbar);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 200;
}

.topbar-logo, .topbar-menu {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(255,255,255,.1);
    text-decoration: none;
    font-size: 20px;
}

.topbar-menu { font-size: 16px; color: var(--topbar-text); }

.topbar-module {
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    border-right: 1px solid rgba(255,255,255,.1);
}

.module-icon { font-size: 14px; }
.module-name { font-size: 13px; font-weight: 700; color: var(--topbar-text); }

.topbar-spacer { flex: 1; }

.topbar-search {
    padding: 0 10px;
    border-right: 1px solid rgba(255,255,255,.1);
}

.topbar-search input {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 5px;
    padding: 4px 10px;
    color: var(--topbar-text);
    font-size: 12px;
    outline: none;
    font-family: inherit;
    width: 200px;
}

.topbar-notifications {
    padding: 0 12px;
    border-right: 1px solid rgba(255,255,255,.1);
    display: flex;
    gap: 10px;
    align-items: center;
}

.notification-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--topbar-text);
    font-size: 14px;
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--red);
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar-user { position: relative; }

.user-btn {
    height: 44px;
    padding: 0 14px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-name { font-size: 11px; font-weight: 700; color: var(--topbar-text); }
.dropdown-arrow { color: rgba(255,255,255,.5); font-size: 9px; }

.user-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 9px;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0,0,0,.6);
    z-index: 999;
    display: none;
}

.user-dropdown.show { display: block; }

.user-info {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-s);
}

.user-fullname { font-size: 12px; font-weight: 700; color: var(--text); }
.user-dept { font-size: 10px; color: var(--text-sub); margin-top: 2px; }

.user-status {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    font-size: 10px;
    color: var(--text-dim);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-dot.online { background: var(--green); }

.user-actions { padding: 6px; }

.user-action {
    display: flex;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-sub);
    font-size: 12px;
    text-align: left;
    border-radius: 5px;
    text-decoration: none;
}

.user-action:hover { background: var(--card); }
.user-action.danger { color: var(--red); }
.user-action.danger:hover { background: rgba(220,38,38,.08); }

/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: -0.5px;
    border: 1.5px solid;
}

.avatar.sm { width: 20px; height: 20px; font-size: 7px; }
.avatar.md { width: 28px; height: 28px; font-size: 9px; }
.avatar.lg { width: 36px; height: 36px; font-size: 12px; }
.avatar.xl { width: 44px; height: 44px; font-size: 14px; }

/* ============================================================
   STATUS BADGE
   ============================================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.sm { padding: 2px 7px; font-size: 10px; }

.status-badge .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    padding: 7px 14px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .1s;
    font-family: inherit;
    border: none;
    text-decoration: none;
}

.btn.sm { padding: 4px 10px; font-size: 11px; }
.btn.full { width: 100%; justify-content: center; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-l); }

.btn-white { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn-white:hover { background: var(--card-h); }

.btn-ghost { background: transparent; color: var(--text-sub); }
.btn-ghost:hover { color: var(--text); }

.btn-danger { background: rgba(220,38,38,.1); color: var(--red); border: 1px solid rgba(220,38,38,.25); }
.btn-danger:hover { background: rgba(220,38,38,.15); }

.btn-green { background: rgba(5,150,105,.1); color: var(--green); border: 1px solid rgba(5,150,105,.3); }
.btn-green:hover { background: rgba(5,150,105,.15); }

.btn-accent { background: var(--gold); color: #0a0500; font-weight: 800; }

.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ============================================================
   FORM FIELDS
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 4px; }

.field label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .7px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 7px 10px;
    color: var(--text);
    font-size: 12px;
    outline: none;
    font-family: inherit;
    transition: border-color .12s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--primary);
}

.field textarea {
    resize: vertical;
    min-height: 70px;
    line-height: 1.5;
}

.field select { cursor: pointer; }
.field select option { background: var(--panel); color: var(--text); }

/* ============================================================
   CARDS & PANELS
   ============================================================ */
.panel {
    background: var(--panel);
    border: 1px solid var(--border-s);
    border-radius: 9px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border-s);
    border-radius: 8px;
}

.card:hover { background: var(--card-h); border-color: var(--border); }

/* ============================================================
   KPI CARD
   ============================================================ */
.kpi-card {
    background: var(--panel);
    border: 1px solid var(--border-s);
    border-radius: 9px;
    padding: 14px 16px;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--kpi-color, var(--primary));
}

.kpi-icon { font-size: 20px; margin-bottom: 6px; }
.kpi-value { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1; }
.kpi-label { font-size: 11px; color: var(--text-sub); margin-top: 5px; font-weight: 500; }
.kpi-sub { font-size: 10px; color: var(--text-dim); margin-top: 3px; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.78);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow: auto;
    box-shadow: 0 20px 80px rgba(0,0,0,.7);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border-s);
    position: sticky;
    top: 0;
    background: var(--panel);
    z-index: 1;
}

.modal-title { font-size: 13px; font-weight: 700; color: var(--text); }

.modal-close {
    background: none;
    border: none;
    color: var(--text-sub);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.modal-body { padding: 18px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
    z-index: 2000;
    animation: slideIn .3s ease;
}

.toast.success { border-color: rgba(5,150,105,.5); }
.toast.error { border-color: rgba(220,38,38,.5); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   HOME VIEW
   ============================================================ */
.home-view {
    flex: 1;
    background: var(--home-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    overflow-y: auto;
}

.home-welcome {
    margin-bottom: 36px;
    text-align: center;
}

.home-welcome h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--home-text);
    margin-bottom: 4px;
}

.home-welcome p {
    font-size: 13px;
    color: #6B4F8A;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 160px));
    gap: 20px;
    justify-content: center;
}

.module-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 26px 16px 20px;
    background: var(--home-card);
    border: 2px solid #E2D9F3;
    border-radius: 18px;
    cursor: pointer;
    transition: all .18s;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(74,16,96,.06);
}

.module-card:hover {
    border-color: var(--module-color);
    box-shadow: 0 8px 28px rgba(74,16,96,.18);
    transform: translateY(-3px);
}

.module-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.module-label { font-size: 13px; font-weight: 700; color: var(--home-text); }
.module-desc { font-size: 10px; color: #7B5EA7; line-height: 1.4; text-align: center; }

/* ============================================================
   LOGIN VIEW
   ============================================================ */
.login-view {
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--topbar), var(--purple));
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-right: 10px;
    vertical-align: middle;
}

.login-logo-text {
    font-size: 30px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.5px;
    vertical-align: middle;
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-sub);
    margin-top: 10px;
}

.login-box {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 26px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 20px 80px rgba(0,0,0,.5);
}

.login-title {
    font-size: 10px;
    color: var(--text-dim);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 14px;
}

.user-select-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.user-select-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    background: rgba(28,35,51,.8);
    border: 1px solid var(--border-s);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all .15s;
    text-decoration: none;
    color: inherit;
}

.user-select-btn:hover {
    background: var(--card);
    border-color: var(--user-color);
}

.user-select-info { flex: 1; }
.user-select-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-select-dept { font-size: 10px; color: var(--text-dim); margin-top: 1px; }

.user-select-role {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ============================================================
   LEFT NAV
   ============================================================ */
.layout-with-nav {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.left-nav {
    width: 200px;
    background: var(--panel);
    border-right: 1px solid var(--border-s);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .8px;
    padding: 10px 14px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 14px;
    background: none;
    border: none;
    border-left: 2px solid transparent;
    color: var(--text-sub);
    cursor: pointer;
    font-size: 12px;
    font-weight: 400;
    transition: all .1s;
    text-align: left;
    text-decoration: none;
}

.nav-item:hover { color: var(--text); }

.nav-item.active {
    background: rgba(37,99,235,.1);
    border-left-color: var(--primary);
    color: var(--primary-l);
    font-weight: 700;
}

.nav-item-icon { font-size: 13px; }

/* ============================================================
   CONTENT AREA
   ============================================================ */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* ============================================================
   ACTION BAR
   ============================================================ */
.action-bar {
    padding: 9px 16px;
    background: var(--panel);
    border-bottom: 1px solid var(--border-s);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.action-bar .separator {
    width: 1px;
    height: 20px;
    background: var(--border-s);
}

.view-toggle {
    display: flex;
    gap: 2px;
}

.view-toggle-btn {
    width: 28px;
    height: 28px;
    border-radius: 5px;
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    color: var(--text-sub);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle-btn.active {
    background: var(--card);
    border-color: var(--border);
    color: var(--text);
}

.record-count {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-dim);
}

/* ============================================================
   DATA TABLE
   ============================================================ */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table thead tr {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    padding: 8px 14px;
    text-align: left;
    color: var(--text-dim);
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .6px;
    white-space: nowrap;
}

.data-table th.right { text-align: right; }

.data-table tbody tr {
    border-bottom: 1px solid var(--border-s);
    cursor: pointer;
    transition: background .1s;
}

.data-table tbody tr:hover { background: var(--card); }

.data-table td {
    padding: 10px 14px;
}

.data-table td.right { text-align: right; }

.client-name { font-weight: 600; color: var(--text); max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-rnc { color: var(--text-dim); font-size: 10px; margin-top: 1px; }

.balance { color: var(--gold); font-weight: 700; }
.date { color: var(--text-dim); font-size: 11px; }

.gestor-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gestor-cell span { color: var(--text-sub); font-size: 11px; }

.empty-state {
    padding: 48px;
    text-align: center;
    color: var(--text-dim);
}

.empty-state-icon { font-size: 28px; margin-bottom: 8px; }
.empty-state-text { font-size: 13px; }

/* ============================================================
   KANBAN VIEW
   ============================================================ */
.kanban-view {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    padding: 12px 14px;
    gap: 10px;
    align-items: flex-start;
}

.kanban-column {
    width: 225px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.kanban-header {
    padding: 8px 10px 10px;
}

.kanban-header-row {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 2px;
}

.kanban-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.kanban-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text);
}

.kanban-count {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-dim);
    background: var(--card);
    padding: 1px 6px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.kanban-total {
    font-size: 10px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.kanban-progress {
    height: 2px;
    border-radius: 2px;
    overflow: hidden;
}

.kanban-progress-fill {
    width: 100%;
    height: 100%;
    border-radius: 2px;
}

.kanban-cards {
    overflow-y: auto;
    flex: 1;
}

.kanban-card {
    background: var(--card);
    border: 1px solid var(--border-s);
    border-radius: 8px;
    padding: 11px 12px;
    cursor: pointer;
    transition: all .12s;
    margin-bottom: 7px;
}

.kanban-card:hover {
    background: var(--card-h);
    border-color: var(--border);
}

.kanban-card-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
    line-height: 1.3;
}

.kanban-card-subtitle {
    font-size: 10px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.kanban-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kanban-card-date {
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 6px;
}

.kanban-empty {
    padding: 16px 10px;
    text-align: center;
    color: var(--text-dim);
    font-size: 11px;
}

/* ============================================================
   CASE DETAIL
   ============================================================ */
.case-toolbar {
    padding: 9px 18px;
    border-bottom: 1px solid var(--border-s);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    background: var(--panel);
}

.case-toolbar .separator {
    width: 1px;
    height: 20px;
    background: var(--border-s);
}

.pipeline-bar {
    background: var(--card);
    border-bottom: 1px solid var(--border-s);
    padding: 10px 20px;
    flex-shrink: 0;
    overflow-x: auto;
}

.pipeline {
    display: flex;
    align-items: center;
}

.pipeline-step {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.pipeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.pipeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--border);
    transition: all .2s;
    flex-shrink: 0;
}

.pipeline-dot.done,
.pipeline-dot.current {
    border-color: var(--step-color);
    background: var(--step-color);
}

.pipeline-dot.current {
    width: 16px;
    height: 16px;
    box-shadow: 0 0 0 3px var(--step-color-bg);
}

.pipeline-label {
    font-size: 9px;
    color: var(--text-dim);
    font-weight: 400;
    white-space: nowrap;
    max-width: 56px;
    text-align: center;
    line-height: 1.3;
}

.pipeline-label.done,
.pipeline-label.current { color: var(--step-color); }
.pipeline-label.current { font-weight: 700; }

.pipeline-line {
    width: 16px;
    height: 2px;
    background: var(--border);
    flex-shrink: 0;
    margin: 0 1px 14px;
}

.pipeline-line.done { background: var(--primary); }

.case-header {
    margin-bottom: 14px;
}

.case-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 5px;
}

.case-meta {
    font-size: 11px;
    color: var(--text-sub);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.case-meta .sep { color: var(--text-dim); }

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.info-card {
    background: var(--card);
    border: 1px solid var(--border-s);
    border-radius: 8px;
    padding: 14px 16px;
}

.info-card-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 11px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid var(--border-s);
    font-size: 12px;
}

.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-sub); }
.info-value { color: var(--text); font-weight: 500; }
.info-value.balance { color: var(--gold); font-weight: 700; }

/* ============================================================
   ACTIVITY / CHATTER
   ============================================================ */
.activity-form {
    background: var(--card);
    border: 1px solid rgba(37,99,235,.4);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 14px;
}

.activity-form-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.activity-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.activity-form-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.activity-list {
    background: var(--card);
    border: 1px solid var(--border-s);
    border-radius: 8px;
}

.activity-list-header {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-s);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.activity-list-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

.activity-list-count {
    font-size: 11px;
    color: var(--text-dim);
}

.activity-list-body {
    padding: 12px 16px;
}

.activity-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-s);
}

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

.activity-avatar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.activity-line {
    width: 1px;
    flex: 1;
    background: var(--border-s);
    margin-top: 6px;
}

.activity-content { flex: 1; padding-bottom: 4px; }

.activity-header {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.activity-user { font-size: 12px; font-weight: 700; }
.activity-tipo { font-size: 11px; font-weight: 600; color: var(--primary-l); text-transform: capitalize; }
.activity-date { margin-left: auto; font-size: 10px; color: var(--text-dim); white-space: nowrap; }

.activity-body {
    background: var(--panel);
    border: 1px solid var(--border-s);
    border-radius: 7px;
    padding: 10px 12px;
}

.activity-nota {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--text);
    line-height: 1.6;
}

.activity-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.activity-detail-box {
    background: var(--card);
    border-radius: 6px;
    padding: 7px 9px;
}

.activity-detail-label {
    font-size: 9px;
    color: var(--text-dim);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 2px;
}

.activity-detail-value { font-size: 11px; color: var(--text); }
.activity-detail-value.prox { color: var(--gold); }

/* ============================================================
   TEAM VIEW
   ============================================================ */
.page-header {
    margin-bottom: 20px;
}

.page-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 11px;
    color: var(--text-sub);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

.gestor-card {
    background: var(--panel);
    border: 1px solid var(--border-s);
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    color: inherit;
}

.gestor-card:hover {
    border-color: var(--gestor-color);
    transform: translateY(-2px);
}

.gestor-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-s);
}

.gestor-info { flex: 1; }
.gestor-name { font-size: 14px; font-weight: 700; color: var(--text); }
.gestor-dept { font-size: 11px; color: var(--text-sub); margin-top: 2px; }
.gestor-link { font-size: 11px; font-weight: 600; }

.gestor-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.gestor-stat {
    text-align: center;
    background: var(--card);
    border-radius: 7px;
    padding: 8px 4px;
    border: 1px solid var(--border-s);
}

.gestor-stat-value { font-size: 18px; font-weight: 800; }
.gestor-stat-label { font-size: 9px; color: var(--text-dim); margin-top: 1px; }

.gestor-activity-types {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.gestor-activity-type {
    font-size: 11px;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 4px;
}

.gestor-activity-type span { font-weight: 600; color: var(--text); }

.gestor-last-activity {
    background: var(--card);
    border-radius: 7px;
    padding: 7px 10px;
    border: 1px solid var(--border-s);
}

.gestor-last-label {
    font-size: 9px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 2px;
}

.gestor-last-date { font-size: 11px; color: var(--text); font-weight: 600; }
.gestor-last-nota { font-size: 10px; color: var(--text-sub); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   REPORTS
   ============================================================ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.chart-panel {
    background: var(--panel);
    border: 1px solid var(--border-s);
    border-radius: 9px;
    padding: 16px;
}

.chart-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
}

.status-legend {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.status-legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
}

.status-legend-dot {
    width: 7px;
    height: 7px;
    border-radius: 2px;
    flex-shrink: 0;
}

.status-legend-bar {
    flex: 1;
    height: 3px;
    background: var(--card);
    border-radius: 2px;
    overflow: hidden;
}

.status-legend-fill {
    height: 100%;
    border-radius: 2px;
}

.status-legend-count {
    font-size: 10px;
    color: var(--text);
    font-weight: 700;
    min-width: 14px;
    text-align: right;
}

.status-legend-name {
    font-size: 10px;
    color: var(--text-sub);
    min-width: 82px;
}

.chart-legend {
    display: flex;
    gap: 14px;
    margin-top: 8px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: var(--text-sub);
}

.chart-legend-dot {
    width: 8px;
    height: 4px;
    border-radius: 2px;
}

/* ============================================================
   CONFIG / USERS TABLE
   ============================================================ */
.users-table {
    background: var(--panel);
    border: 1px solid var(--border-s);
    border-radius: 9px;
    overflow: hidden;
}

.role-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.status-badge-active {
    font-size: 10px;
    color: var(--green);
    background: rgba(5,150,105,.1);
    border: 1px solid rgba(5,150,105,.3);
    padding: 3px 9px;
    border-radius: 20px;
    font-weight: 600;
}

/* ============================================================
   IMPORT VIEW
   ============================================================ */
.import-cards {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.import-card {
    background: var(--card);
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 28px 32px;
    cursor: pointer;
    text-align: center;
    flex: 1;
    min-width: 200px;
    transition: border-color .15s;
}

.import-card:hover { border-color: var(--primary); }
.import-card.export:hover { border-color: var(--green); }

.import-card-icon { font-size: 36px; margin-bottom: 10px; }
.import-card-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.import-card-desc { font-size: 12px; color: var(--text-sub); }

.expected-columns {
    background: var(--card);
    border: 1px solid var(--border-s);
    border-radius: 8px;
    padding: 14px;
    margin-top: 16px;
}

.expected-columns-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.expected-columns-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.expected-column {
    font-size: 11px;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 5px;
}

.expected-column::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.ml-auto { margin-left: auto; }

@media (max-width: 768px) {
    .modules-grid { grid-template-columns: repeat(2, 1fr); }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; }
    .left-nav { width: 180px; }
}

@media (max-width: 480px) {
    .modules-grid { grid-template-columns: 1fr; }
    .left-nav { display: none; }
    .topbar-search { display: none; }
}
