/* ============================================================
   CRM V7 — tema global moderno / sidebar azul / dark mode
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Montserrat:wght@400;500;600;700&family=Nunito:wght@400;500;600;700&family=Poppins:wght@400;500;600;700&family=Roboto:wght@400;500;700&display=swap');
:root{
  --crm-primary:#1769e0;--crm-secondary:#4b8cff;
  --bg:#f5f7fb;--panel:#fff;--surface-2:#eef3fb;
  --ink:#172033;--ink-soft:#667085;--ink-muted:#98a2b3;
  --border:#e7ebf1;--border-strong:#d7dde7;
  --accent:var(--crm-primary);--accent-hover:var(--crm-primary);--accent-soft:color-mix(in srgb,var(--crm-primary) 10%,white);
  --font-display:var(--font-body);--shadow-sm:0 2px 8px rgba(24,38,68,.05);--shadow-md:0 16px 40px rgba(24,38,68,.10);
}
body{font-family:var(--font-body);background:var(--bg);color:var(--ink)}
h1,h2,h3,.section-title{font-family:var(--font-display);font-weight:700}
.crm-theme-dark{--bg:#0d1424;--panel:#111b2e;--surface-2:#18243a;--ink:#eef4ff;--ink-soft:#aab7cb;--ink-muted:#7f8da4;--border:#24324a;--border-strong:#33445f;--accent-soft:color-mix(in srgb,var(--crm-primary) 18%,#111b2e)}
.crm-theme-dark input,.crm-theme-dark select,.crm-theme-dark textarea,.crm-theme-dark .modal,.crm-theme-dark .stat-card,.crm-theme-dark .form-card,.crm-theme-dark .new-form-box,.crm-theme-dark .new-auto-form{background:var(--panel);color:var(--ink);border-color:var(--border)}
.crm-theme-dark input::placeholder,.crm-theme-dark textarea::placeholder{color:var(--ink-muted)}
.crm-theme-dark .topbar{background:color-mix(in srgb,var(--panel) 92%,transparent)}
.crm-buttons-gradient .btn-primary{background:linear-gradient(135deg,var(--crm-primary),var(--crm-secondary))}
.btn-primary{background:var(--crm-primary);border-radius:calc(var(--radius) - 2px);box-shadow:0 8px 22px color-mix(in srgb,var(--crm-primary) 22%,transparent);transition:.18s ease}
.btn-primary:hover{filter:brightness(.98);transform:translateY(-1px)}
.btn-secondary{border-radius:calc(var(--radius) - 4px)}

/* Sidebar V7 */
.sidebar-toggle{background:linear-gradient(135deg,var(--crm-primary),var(--crm-secondary));color:#fff;border:0;box-shadow:0 10px 24px rgba(0,0,0,.14)}
.sidebar{
 width:264px;padding:14px 12px 14px;background:linear-gradient(180deg,color-mix(in srgb,var(--crm-primary) 96%,#062452),color-mix(in srgb,var(--crm-primary) 82%,#091e44));
 border-right:0;color:#fff;gap:0;box-shadow:12px 0 34px rgba(11,38,82,.13);transition:transform .22s ease,width .22s ease;
}
.sidebar-top{padding:4px 4px 14px}.sidebar-brand-wrap{min-height:54px;display:flex;align-items:center;gap:10px;position:relative}.sidebar-brand{position:static;font-family:var(--font-body);font-weight:700;font-size:18px;color:#fff;line-height:1.15;max-width:190px}.sidebar-logo{max-width:176px;max-height:48px;object-fit:contain;object-position:left center;display:block}.sidebar-logo-dark{display:none}.crm-theme-dark.crm-has-dark-logo .sidebar-logo-light{display:none}.crm-theme-dark.crm-has-dark-logo .sidebar-logo-dark{display:block}.sidebar-collapse{margin-left:auto;width:34px;height:34px;flex:0 0 34px;border:1px solid rgba(255,255,255,.18);border-radius:10px;background:rgba(255,255,255,.10);color:#fff;font-size:20px;cursor:pointer}.sidebar-collapse:hover{background:rgba(255,255,255,.17)}
.sidebar-user-top{display:flex;align-items:center;gap:10px;margin-top:8px;padding:10px;border-radius:14px;background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.10)}.sidebar-user-avatar{width:38px;height:38px;border-radius:12px;background:#fff;color:var(--crm-primary);display:grid;place-items:center;font-weight:800;flex:0 0 38px}.sidebar-user-copy{display:flex;flex-direction:column;min-width:0}.sidebar-user-copy strong{font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sidebar-user-copy small{font-size:10px;color:rgba(255,255,255,.68);margin-top:2px}
.sidebar-menu{display:flex;flex-direction:column;gap:3px}.sidebar-section-label{font-size:9px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:rgba(255,255,255,.48);padding:15px 12px 5px}.sidebar-link{color:rgba(255,255,255,.86);padding:10px 12px;border-radius:12px;min-height:44px;font-size:13px;font-weight:500;transition:.16s ease}.sidebar-link:hover{background:rgba(255,255,255,.10);color:#fff;transform:translateX(2px)}.sidebar-link.active{background:linear-gradient(135deg,rgba(255,255,255,.24),rgba(255,255,255,.13));color:#fff;font-weight:700;box-shadow:inset 0 0 0 1px rgba(255,255,255,.10)}.sidebar-icon{width:24px;height:24px;display:grid;place-items:center;font-size:17px;color:#fff;flex:0 0 24px}.sidebar-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sidebar-logout{color:#fff;background:rgba(212,45,45,.14);margin-top:8px}.sidebar-logout:hover{background:rgba(212,45,45,.24)}
.crm-sidebar-collapsed .sidebar{width:82px;padding-left:10px;padding-right:10px}.crm-sidebar-collapsed .sidebar-brand,.crm-sidebar-collapsed .sidebar-logo,.crm-sidebar-collapsed .sidebar-user-copy,.crm-sidebar-collapsed .sidebar-label,.crm-sidebar-collapsed .sidebar-section-label span{display:none}.crm-sidebar-collapsed .sidebar-brand-wrap{justify-content:center}.crm-sidebar-collapsed .sidebar-collapse{margin-left:0}.crm-sidebar-collapsed .sidebar-user-top{justify-content:center;padding:8px}.crm-sidebar-collapsed .sidebar-link{justify-content:center;padding-left:8px;padding-right:8px}.crm-sidebar-collapsed .sidebar-section-label{height:10px;padding:6px 0}.crm-sidebar-collapsed .sidebar-icon{font-size:18px}.crm-sidebar-collapsed .sidebar-link:hover{transform:none}
.topbar{background:rgba(255,255,255,.92);backdrop-filter:blur(14px);border-bottom:1px solid var(--border);min-height:70px}.topbar h1{font-size:21px}.crm-theme-dark .topbar{background:rgba(17,27,46,.92)}
@media(min-width:720px){.sidebar{transform:translateX(0)}.app-content{margin-left:264px;transition:margin-left .22s ease}.crm-sidebar-collapsed .app-content{margin-left:82px}.sidebar-toggle{display:none}}
@media(max-width:719px){.sidebar-collapse{display:none}.crm-sidebar-collapsed .sidebar{width:264px}.crm-sidebar-collapsed .sidebar-brand,.crm-sidebar-collapsed .sidebar-logo,.crm-sidebar-collapsed .sidebar-user-copy,.crm-sidebar-collapsed .sidebar-label{display:initial}.crm-sidebar-collapsed .sidebar-link{justify-content:flex-start}.crm-sidebar-collapsed .sidebar-user-top{justify-content:flex-start}}

/* Superfícies modernas */
.stat-card,.form-card,.new-form-box,.new-auto-form,.chart-box,.modal{border-radius:var(--radius-lg);box-shadow:var(--shadow-sm)}
input[type=text],input[type=password],input[type=email],input[type=date],input[type=number],input[type=color],select,textarea{border-radius:calc(var(--radius) - 5px);background:var(--panel);color:var(--ink)}
.crm-theme-dark .user-row,.crm-theme-dark .shortcut-row,.crm-theme-dark .highlight-card,.crm-theme-dark .field-row{background:var(--panel);border-color:var(--border);color:var(--ink)}
.crm-theme-dark .tabs{border-color:var(--border)}.crm-theme-dark .tab-btn{color:var(--ink-soft)}.crm-theme-dark .tab-btn.active{color:var(--crm-secondary)}
body:not(.crm-buttons-gradient) .sv6-btn.primary,body:not(.crm-buttons-gradient) .sv6-toolbar-btn.primary{background:var(--crm-primary)!important;color:#fff!important;border-color:transparent!important}
.crm-buttons-gradient .sv6-btn.primary,.crm-buttons-gradient .sv6-toolbar-btn.primary{background:linear-gradient(135deg,var(--crm-primary),var(--crm-secondary))!important;color:#fff!important;border-color:transparent!important}
