    :root {
      --principal: #D8235C;
      --principal-hover: #BF1B4E;
      --principal-soft: #FDE8EF;
      --principal-border: #F9A8C2;
      --secundario: #64748B;
      --fondo: #F8FAFC;
      --blanco: #FFFFFF;
      --texto: #0F172A;
      --borde: #E2E8F0;
      --radio: 10px;
      --sombra-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
      --sombra: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
      --sombra-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    }

    html, body {
      width: 100%;
      max-width: 100%;
      overflow-x: hidden;
    }

    body {
      background-color: var(--fondo);
      color: var(--texto);
      min-height: 100vh;
      display: block;
    }

    #vistaApp {
      width: 100%;
      min-height: 100vh;
    }

    /* CONTENEDOR PRINCIPAL */
    .app {
      display: flex;
      width: 100%;
      min-height: 100vh;
    }

    /* BARRA LATERAL (SIDEBAR) */
    .sidebar {
      width: 260px;
      background: var(--blanco);
      border-right: 1px solid var(--borde);
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      position: sticky;
      top: 0;
      height: 100vh;
      overflow-y: auto;
      z-index: 30;
    }

    .brand {
      padding: 24px 20px 20px;
      border-bottom: 1px solid var(--borde);
    }

    .brand-row {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .brand-logo {
      width: 44px;
      height: 44px;
      border-radius: 10px;
      background: #FFFFFF;
      display: grid;
      place-items: center;
      border: 1px solid var(--borde);
      padding: 3px;
      box-shadow: var(--sombra-sm);
    }

    .brand-logo img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
    }

    .brand-name {
      font-size: 19px;
      font-weight: 800;
      color: var(--principal);
      letter-spacing: -0.5px;
      line-height: 1.1;
    }

    .brand-subtitle {
      font-size: 9.5px;
      font-weight: 700;
      letter-spacing: 1px;
      color: var(--secundario);
      margin-top: 4px;
    }

    .menu-title {
      margin: 20px 14px 8px;
      font-size: 10.5px;
      font-weight: 700;
      letter-spacing: 1.2px;
      color: var(--secundario);
      text-transform: uppercase;
    }

    .nav-links {
      display: flex;
      flex-direction: column;
      gap: 4px;
      padding: 0 10px;
      flex: 1;
    }

    .menu-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px 14px;
      border-radius: var(--radio);
      color: #475569;
      font-size: 13.5px;
      font-weight: 600;
      text-decoration: none;
      border: none;
      background: transparent;
      width: 100%;
      text-align: left;
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .menu-item:hover {
      background: #F1F5F9;
      color: var(--texto);
    }

    .menu-item.active {
      background: var(--principal);
      color: var(--blanco);
      box-shadow: 0 2px 4px rgba(216, 35, 92, 0.25);
    }

    .menu-item span {
      font-size: 17px;
      width: 22px;
      text-align: center;
    }

    .sidebar-footer {
      padding: 16px;
      border-top: 1px solid var(--borde);
      font-size: 11px;
      color: var(--secundario);
      line-height: 1.4;
      text-align: center;
    }

    /* AREA PRINCIPAL */
    .main {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-width: 0;
    }

    /* TOPBAR */
    .topbar {
      height: 70px;
      background: var(--blanco);
      border-bottom: 1px solid var(--borde);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 32px;
      position: sticky;
      top: 0;
      z-index: 20;
    }

    .topbar-title {
      font-size: 14px;
      font-weight: 700;
      color: var(--secundario);
      letter-spacing: 0.5px;
    }

    .topbar-actions {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .btn-notif {
      background: #F1F5F9;
      color: #334155;
      padding: 8px 14px;
      border-radius: 20px;
      font-size: 13px;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 8px;
      border: 1px solid var(--borde);
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .btn-notif:hover {
      background: #E2E8F0;
    }

    .badge-count {
      background: var(--principal);
      color: var(--blanco);
      font-size: 11px;
      font-weight: 700;
      padding: 2px 7px;
      border-radius: 12px;
    }

    .user-profile {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 5px 12px 5px 6px;
      background: #F8FAFC;
      border: 1px solid var(--borde);
      border-radius: 30px;
    }

    .user-avatar {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: var(--principal);
      color: var(--blanco);
      font-weight: 700;
      font-size: 12px;
      display: grid;
      place-items: center;
    }

    .user-meta .name {
      font-size: 12.5px;
      font-weight: 600;
      line-height: 1.2;
    }

    .user-meta .role {
      font-size: 10px;
      color: var(--secundario);
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    /* CONTENEDOR DE PANTALLA */
    .content {
      padding: 28px 32px;
      flex: 1;
    }

    /* BANNER MODO LOCAL Y SWITCH DE ROLES */
    .local-preview-banner {
      background: #FFFBEB;
      border: 1px solid #FDE68A;
      border-radius: 12px;
      padding: 14px 18px;
      margin-bottom: 22px;
      box-shadow: var(--sombra-sm);
    }

    .role-switcher-box {
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px dashed #FCD34D;
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .btn-role-switch {
      background: #FFFFFF;
      border: 1px solid #CBD5E1;
      color: #334155;
      padding: 5px 12px;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .btn-role-switch:hover {
      border-color: var(--principal);
      color: var(--principal);
    }

    .btn-role-switch.active {
      background: var(--principal);
      color: #FFFFFF;
      border-color: var(--principal);
    }

    /* CARDS Y CONTENEDORES */
    .section-card {
      background: var(--blanco);
      border-radius: 14px;
      border: 1px solid var(--borde);
      box-shadow: var(--sombra-sm);
      padding: 26px 28px;
      margin-bottom: 26px;
    }

    .section-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 20px;
      flex-wrap: wrap;
      gap: 14px;
    }

    .section-header h2 {
      font-size: 20px;
      font-weight: 800;
      letter-spacing: -0.3px;
    }

    .section-header p {
      font-size: 13px;
      color: var(--secundario);
      margin-top: 4px;
    }

    /* KPI STATS GRID */
    .kpi-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 16px;
      margin-bottom: 24px;
    }

    .kpi-card {
      background: var(--blanco);
      border: 1px solid var(--borde);
      border-radius: 12px;
      padding: 20px 22px;
      position: relative;
      overflow: hidden;
      box-shadow: var(--sombra-sm);
      transition: all 0.2s ease;
    }

    .kpi-card:hover {
      transform: translateY(-2px);
      box-shadow: var(--sombra);
      border-color: var(--principal-border);
    }

    .kpi-title {
      font-size: 11.5px;
      font-weight: 700;
      color: var(--secundario);
      text-transform: uppercase;
      letter-spacing: 0.8px;
      margin-bottom: 10px;
    }

    .kpi-value {
      font-size: 30px;
      font-weight: 800;
      color: var(--texto);
      line-height: 1;
      margin-bottom: 6px;
    }

    .kpi-desc {
      font-size: 12px;
      color: var(--secundario);
    }

    .kpi-badge {
      position: absolute;
      top: 18px;
      right: 18px;
      width: 38px;
      height: 38px;
      border-radius: 10px;
      background: var(--principal-soft);
      color: var(--principal);
      display: grid;
      place-items: center;
      font-size: 18px;
    }

    /* GRID MÓDULOS DE ACCESO RÁPIDO */
    .modules-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 18px;
    }

    .module-item {
      background: var(--blanco);
      border: 1px solid var(--borde);
      border-radius: 12px;
      padding: 22px;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .module-item:hover {
      border-color: var(--principal);
      box-shadow: var(--sombra);
      transform: translateY(-3px);
    }

    .module-icon {
      width: 42px;
      height: 42px;
      border-radius: 10px;
      background: #FFF1F5;
      color: var(--principal);
      display: grid;
      place-items: center;
      font-size: 20px;
      margin-bottom: 14px;
    }

    .module-item h3 {
      font-size: 15.5px;
      font-weight: 700;
      margin-bottom: 6px;
    }

    .module-item p {
      font-size: 12.5px;
      color: var(--secundario);
      line-height: 1.5;
    }

    /* BOTONES */
    .btn-primary {
      background: var(--principal);
      color: var(--blanco);
      padding: 9px 18px;
      border-radius: var(--radio);
      font-size: 13px;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      border: none;
      cursor: pointer;
      box-shadow: 0 2px 6px rgba(216, 35, 92, 0.25);
      transition: all 0.15s ease;
    }

    .btn-primary:hover {
      background: var(--principal-hover);
    }

    .btn-secondary {
      background: #F1F5F9;
      color: #334155;
      padding: 9px 16px;
      border-radius: var(--radio);
      font-size: 13px;
      font-weight: 600;
      border: 1px solid var(--borde);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: all 0.15s ease;
    }

    .btn-secondary:hover {
      background: #E2E8F0;
    }

    .btn-danger {
      background: #FEE2E2;
      color: #991B1B;
      padding: 6px 12px;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 600;
      border: 1px solid #FECACA;
      cursor: pointer;
    }

    .btn-danger:hover {
      background: #FCA5A5;
    }

    .btn-sm {
      padding: 5px 10px;
      font-size: 12px;
      border-radius: 6px;
    }

    .btn-wa {
      background: #DCFCE7;
      color: #166534;
      border: 1px solid #BBF7D0;
      padding: 4px 9px;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 600;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }

    .btn-wa:hover {
      background: #BBF7D0;
    }

    /* TABLAS */
    .table-container {
      width: 100%;
      overflow-x: auto;
      border: 1px solid var(--borde);
      border-radius: 10px;
      background: var(--blanco);
    }

    table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13px;
      text-align: left;
    }

    th {
      background: #F8FAFC;
      color: var(--secundario);
      font-weight: 700;
      font-size: 11.5px;
      text-transform: uppercase;
      letter-spacing: 0.6px;
      padding: 12px 14px;
      border-bottom: 1px solid var(--borde);
      white-space: nowrap;
    }

    td {
      padding: 12px 14px;
      border-bottom: 1px solid #F1F5F9;
      color: #334155;
      vertical-align: middle;
    }

    tr:last-child td {
      border-bottom: none;
    }

    /* PAGINACIÓN GLOBAL */
    .pagination-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 12px;
      padding: 10px 14px;
      background: #F8FAFC;
      border: 1px solid var(--borde);
      border-radius: 10px;
      font-size: 12.5px;
      color: var(--secundario);
    }

    .pagination-info strong {
      color: var(--texto);
    }

    .pagination-controls {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }

    .btn-page {
      padding: 5px 11px;
      border: 1px solid var(--borde);
      background: var(--blanco);
      color: var(--texto);
      border-radius: 6px;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .btn-page:hover:not(:disabled):not(.active) {
      background: var(--principal-soft);
      border-color: var(--principal-border);
      color: var(--principal);
    }

    .btn-page.active {
      background: var(--principal);
      border-color: var(--principal);
      color: var(--blanco);
    }

    .btn-page:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }

    tr:hover td {
      background-color: #F8FAFC;
    }

    /* BADGES */
    .badge {
      display: inline-flex;
      align-items: center;
      padding: 3px 9px;
      border-radius: 12px;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.3px;
      text-transform: uppercase;
      white-space: nowrap;
    }

    .badge-gray { background: #F1F5F9; color: #475569; }
    .badge-blue { background: #E0F2FE; color: #0369A1; }
    .badge-emerald { background: #DCFCE7; color: #166534; }
    .badge-amber { background: #FEF3C7; color: #92400E; }
    .badge-rose { background: #FFE4E6; color: #BE123C; }
    .badge-gerente { background: #FCE7F3; color: #9D174D; border: 1px solid #FBCFE8; }
    .badge-admin { background: #EDE9FE; color: #5B21B6; border: 1px solid #DDD6FE; }
    .badge-vendedor { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }

    /* FILTROS Y BÚSQUEDA */
    .filter-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 18px;
      flex-wrap: wrap;
    }

    .search-input-box {
      position: relative;
      flex: 1;
      min-width: 250px;
      display: flex;
      align-items: center;
    }

    .search-input-box input,
    .search-input-box input[type="search"],
    .search-input-box input[type="text"] {
      width: 100%;
      padding: 10px 14px 10px 44px !important;
      border: 1px solid var(--borde);
      border-radius: var(--radio);
      font-size: 13px;
      background: #FFFFFF;
      color: var(--texto);
      outline: none;
      transition: border-color 0.15s ease, box-shadow 0.15s ease;
    }

    .search-input-box input:focus,
    .search-input-box input[type="search"]:focus,
    .search-input-box input[type="text"]:focus {
      border-color: var(--principal);
      box-shadow: 0 0 0 3px rgba(216, 35, 92, 0.12);
    }

    .search-input-box input::placeholder,
    .search-input-box input[type="search"]::placeholder {
      color: #94A3B8;
      font-size: 13px;
    }

    .search-icon {
      position: absolute;
      left: 14px;
      top: 50%;
      transform: translateY(-50%);
      color: #94A3B8;
      pointer-events: none;
      z-index: 2;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 18px;
      height: 18px;
    }

    .search-icon svg {
      display: block;
      width: 16px;
      height: 16px;
      stroke: #94A3B8;
    }

    .filter-chips {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }

    .chip {
      background: var(--blanco);
      border: 1px solid var(--borde);
      padding: 6px 12px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 600;
      color: var(--secundario);
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .chip:hover {
      border-color: #CBD5E1;
      color: var(--texto);
    }

    .chip.active {
      background: var(--principal-soft);
      border-color: var(--principal);
      color: var(--principal);
    }

    /* FORMULARIOS */
    .form-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 16px;
    }

    .field {
      display: flex;
      flex-direction: column;
      gap: 5px;
    }

    .field.full {
      grid-column: span 2;
    }

    label {
      font-size: 12.5px;
      font-weight: 700;
      color: #334155;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="date"],
    input[type="number"],
    select,
    textarea {
      width: 100%;
      padding: 9px 12px;
      border: 1px solid var(--borde);
      border-radius: 8px;
      font-size: 13px;
      background: var(--blanco);
      color: var(--texto);
      outline: none;
      transition: all 0.15s ease;
    }

    input:focus, select:focus, textarea:focus {
      border-color: var(--principal);
      box-shadow: 0 0 0 3px rgba(216, 35, 92, 0.12);
    }

    small {
      font-size: 11px;
      color: var(--secundario);
    }

    .form-actions {
      display: flex;
      justify-content: flex-end;
      gap: 12px;
      margin-top: 22px;
      padding-top: 18px;
      border-top: 1px solid var(--borde);
    }

    /* MODALES */
    .modal-backdrop {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background: rgba(15, 23, 42, 0.55);
      backdrop-filter: blur(4px);
      display: grid;
      place-items: center;
      z-index: 100;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease;
      padding: 18px;
    }

    .modal-backdrop.show {
      opacity: 1;
      pointer-events: auto;
    }

    .modal-box {
      background: var(--blanco);
      border-radius: 14px;
      width: 100%;
      max-width: 620px;
      max-height: 90vh;
      overflow-y: auto;
      box-shadow: var(--sombra-lg);
      transform: scale(0.96);
      transition: transform 0.2s ease;
      padding: 24px 26px;
    }

    .modal-backdrop.show .modal-box {
      transform: scale(1);
    }

    .modal-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 18px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--borde);
    }

    .modal-header h3 {
      font-size: 17px;
      font-weight: 800;
    }

    .btn-close {
      background: none;
      border: none;
      font-size: 18px;
      color: var(--secundario);
      cursor: pointer;
      padding: 4px;
      line-height: 1;
    }

    .btn-close:hover {
      color: var(--texto);
    }

    /* FICHA DE VENTA (ESTILO EXPEDIENTE) */
    .ficha-card {
      background: #F8FAFC;
      border: 1px solid var(--borde);
      border-radius: 10px;
      padding: 16px;
      margin-bottom: 14px;
    }

    .ficha-card-title {
      font-size: 12.5px;
      font-weight: 700;
      color: var(--principal);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 10px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .ficha-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 12px;
    }

    .ficha-item .lbl {
      font-size: 10.5px;
      color: var(--secundario);
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.4px;
      margin-bottom: 2px;
    }

    .ficha-item .val {
      font-size: 13px;
      font-weight: 600;
      color: #1E293B;
      word-break: break-word;
    }

    /* BARRAS DE PROGRESO DE COMISIONES */
    .chart-bar-container {
      margin-bottom: 14px;
    }

    .chart-bar-header {
      display: flex;
      justify-content: space-between;
      font-size: 12.5px;
      font-weight: 600;
      margin-bottom: 4px;
    }

    .chart-bar-bg {
      height: 10px;
      background: #F1F5F9;
      border-radius: 6px;
      overflow: hidden;
    }

    .chart-bar-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--principal), #FB7185);
      border-radius: 6px;
      transition: width 0.4s ease;
    }

    /* ALERTAS */
    .alert-banner {
      padding: 12px 16px;
      border-radius: 8px;
      font-size: 13px;
      margin-bottom: 18px;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .alert-info { background: #F0F9FF; border: 1px solid #BAE6FD; color: #0369A1; }
    .alert-success { background: #F0FDF4; border: 1px solid #BBF7D0; color: #166534; }
    .alert-warning { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
    .alert-danger { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }

    .hidden {
      display: none !important;
    }

    /* ========================================================================= */
    /* PANTALLA LOGIN (SPLIT SCREEN ESTILO CORPORATIVO ECSALUD)                  */
    /* ========================================================================= */
    .login-screen {
      width: 100%;
      min-height: 100vh;
      display: flex;
      background: #F4F6FA;
    }

    .login-left {
      width: 470px;
      max-width: 100%;
      min-height: 100vh;
      background: #FFFFFF;
      padding: 34px 38px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      box-shadow: 4px 0 28px rgba(15, 23, 42, 0.06);
      position: relative;
      z-index: 2;
    }

    .login-card {
      width: 100%;
      max-width: 380px;
      margin: 0 auto;
    }

    .login-back {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      font-weight: 700;
      color: var(--principal);
      text-decoration: none;
      text-transform: uppercase;
      letter-spacing: 0.6px;
      margin-bottom: 20px;
    }

    .login-back:hover {
      color: var(--principal-hover);
      text-decoration: underline;
    }

    .login-brand-mini {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 18px;
    }

    .login-brand-mini img {
      width: 40px;
      height: 40px;
      object-fit: contain;
    }

    .login-brand-mini .brand-name {
      font-size: 19px;
      line-height: 1.05;
    }

    .login-title {
      font-size: 22px;
      font-weight: 800;
      color: #1E293B;
      line-height: 1.25;
      margin-bottom: 6px;
    }

    .login-subtitle {
      font-size: 13.5px;
      font-weight: 700;
      color: #334155;
      margin-bottom: 4px;
    }

    .login-helper {
      font-size: 12.5px;
      color: var(--secundario);
      margin-bottom: 22px;
      line-height: 1.45;
    }

    .login-field {
      margin-bottom: 15px;
    }

    .login-field label {
      display: block;
      font-size: 12px;
      font-weight: 700;
      color: #475569;
      margin-bottom: 6px;
    }

    .login-input-wrap {
      position: relative;
      display: flex;
      align-items: center;
    }

    .login-input-wrap input {
      width: 100%;
      padding: 11px 40px 11px 14px;
      border: 1.5px solid #CBD5E1;
      border-radius: 10px;
      font-family: inherit;
      font-size: 14px;
      color: var(--texto);
      outline: none;
      transition: border-color 0.15s ease, box-shadow 0.15s ease;
    }

    .login-input-wrap input:focus {
      border-color: var(--principal);
      box-shadow: 0 0 0 3px rgba(216, 35, 92, 0.12);
    }

    .pass-toggle-btn {
      position: absolute;
      right: 10px;
      background: none;
      border: none;
      cursor: pointer;
      color: var(--secundario);
      font-size: 16px;
      padding: 4px;
      line-height: 1;
    }

    .pass-toggle-btn:hover {
      color: var(--principal);
    }

    .login-forgot-row {
      text-align: center;
      margin: 4px 0 18px;
    }

    .login-forgot-btn {
      background: none;
      border: none;
      color: var(--principal);
      font-size: 12.5px;
      font-weight: 700;
      cursor: pointer;
      font-family: inherit;
    }

    .login-forgot-btn:hover {
      text-decoration: underline;
    }

    .btn-login-submit {
      width: 100%;
      padding: 13px 18px;
      border: none;
      border-radius: 10px;
      background: var(--principal);
      color: #FFFFFF;
      font-family: inherit;
      font-size: 14px;
      font-weight: 800;
      letter-spacing: 0.6px;
      text-transform: uppercase;
      cursor: pointer;
      box-shadow: 0 6px 18px rgba(216, 35, 92, 0.25);
      transition: background 0.15s ease, transform 0.1s ease;
    }

    .btn-login-submit:hover {
      background: var(--principal-hover);
    }

    .btn-login-submit:disabled {
      opacity: 0.65;
      cursor: not-allowed;
    }

    .login-divider {
      display: flex;
      align-items: center;
      gap: 10px;
      margin: 18px 0;
      color: #94A3B8;
      font-size: 12px;
      font-weight: 600;
    }

    .login-divider::before,
    .login-divider::after {
      content: "";
      flex: 1;
      height: 1px;
      background: #E2E8F0;
    }

    .btn-google-login {
      width: 100%;
      padding: 11px 16px;
      background: #FFFFFF;
      border: 1.5px solid #CBD5E1;
      border-radius: 10px;
      font-family: inherit;
      font-size: 13.5px;
      font-weight: 700;
      color: #1E293B;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      transition: background 0.15s ease, border-color 0.15s ease;
    }

    .btn-google-login:hover {
      background: #F8FAFC;
      border-color: #94A3B8;
    }

    .login-error-box {
      background: #FEF2F2;
      border: 1px solid #FECACA;
      color: #991B1B;
      font-size: 12.5px;
      font-weight: 600;
      padding: 10px 12px;
      border-radius: 8px;
      margin-bottom: 14px;
    }

    .login-info-box {
      background: #F0FDF4;
      border: 1px solid #BBF7D0;
      color: #166534;
      font-size: 12.5px;
      font-weight: 600;
      padding: 10px 12px;
      border-radius: 8px;
      margin-bottom: 14px;
    }

    .login-footer-note {
      margin-top: 20px;
      text-align: center;
      font-size: 11.5px;
      color: #94A3B8;
      line-height: 1.5;
    }

    .login-demo-box {
      margin-top: 16px;
      padding: 12px;
      background: #FFFBEB;
      border: 1px solid #FDE68A;
      border-radius: 10px;
      font-size: 11.5px;
      color: #78350F;
    }

    .login-demo-btns {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 8px;
    }

    .login-demo-btns button {
      background: #FFFFFF;
      border: 1px solid #F59E0B;
      color: #92400E;
      font-family: inherit;
      font-size: 11px;
      font-weight: 700;
      padding: 5px 9px;
      border-radius: 6px;
      cursor: pointer;
    }

    .login-demo-btns button:hover {
      background: #FEF3C7;
    }

    .login-right {
      flex: 1;
      position: relative;
      background-color: #6B1030;
      background-image: linear-gradient(135deg, rgba(136, 19, 55, 0.72), rgba(216, 35, 92, 0.45)), url('../assets/login-hero.jpg');
      background-size: cover;
      background-position: center;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      padding: 48px 52px;
      color: #FFFFFF;
      overflow: hidden;
    }

    .login-hero-overlay {
      max-width: 520px;
      background: rgba(15, 23, 42, 0.42);
      backdrop-filter: blur(8px);
      border: 1px solid rgba(255, 255, 255, 0.18);
      border-radius: 18px;
      padding: 26px 30px;
    }

    .login-hero-brand {
      display: flex;
      align-items: center;
      gap: 14px;
      margin-bottom: 12px;
    }

    .login-hero-brand img {
      width: 48px;
      height: 48px;
      object-fit: contain;
      background: #FFFFFF;
      border-radius: 12px;
      padding: 6px;
    }

    .login-hero-overlay h2 {
      font-size: 24px;
      font-weight: 800;
      letter-spacing: -0.3px;
      margin: 0;
    }

    .login-hero-overlay p {
      font-size: 14px;
      line-height: 1.55;
      color: rgba(255, 255, 255, 0.92);
      margin: 0;
    }

    /* ========================================================================= */
    /* NAVEGACIÓN MÓVIL Y BOTÓN CERRAR SESIÓN                                    */
    /* ========================================================================= */
    .btn-hamburger {
      display: none;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
      border-radius: 10px;
      border: 1px solid var(--borde);
      background: #F8FAFC;
      color: var(--texto);
      font-size: 20px;
      cursor: pointer;
      flex-shrink: 0;
    }

    .topbar-left {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 0;
    }

    .sidebar-backdrop {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.48);
      backdrop-filter: blur(2px);
      z-index: 45;
    }

    .sidebar-backdrop.show {
      display: block;
    }

    .btn-logout {
      background: #FFF1F2;
      color: #BE123C;
      border: 1px solid #FECDD3;
      padding: 7px 12px;
      border-radius: 18px;
      font-family: inherit;
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
      transition: background 0.15s ease;
    }

    .btn-logout:hover {
      background: #FFE4E6;
    }

    .sidebar-mobile-close {
      display: none;
      margin-left: auto;
      background: none;
      border: none;
      font-size: 20px;
      color: var(--secundario);
      cursor: pointer;
      padding: 4px 6px;
    }

    /* ========================================================================= */
    /* RESPONSIVE DESIGN (TABLET Y CELULAR)                                      */
    /* ========================================================================= */
    @media (max-width: 960px) {
      .login-right {
        display: none;
      }

      .login-left {
        width: 100%;
        min-height: 100vh;
        background: linear-gradient(180deg, #FFF1F5 0%, #FFFFFF 36%);
        padding: 24px 16px;
        box-shadow: none;
      }

      .login-card {
        max-width: 100%;
      }

      .app {
        flex-direction: column;
        width: 100%;
        overflow-x: hidden;
      }

      .main,
      .content,
      .section-card,
      .local-preview-banner {
        min-width: 0;
        max-width: 100%;
        word-break: break-word;
      }

      .btn-hamburger {
        display: inline-flex;
      }

      .sidebar-mobile-close {
        display: block;
      }

      .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 84vw;
        height: 100vh;
        z-index: 50;
        transform: translateX(-105%);
        transition: transform 0.24s ease;
        box-shadow: 12px 0 32px rgba(15, 23, 42, 0.18);
      }

      .sidebar.open {
        transform: translateX(0);
      }

      .topbar {
        height: auto;
        min-height: 60px;
        padding: 10px 12px;
        gap: 8px;
        flex-direction: column;
        align-items: stretch;
      }

      .topbar-left {
        width: 100%;
      }

      .topbar-title {
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .topbar-actions {
        width: 100%;
        gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-start;
      }

      .user-profile .user-meta {
        display: none;
      }

      .user-profile {
        padding: 3px;
      }

      .btn-secondary,
      .btn-notif,
      .btn-logout {
        padding: 7px 10px;
        font-size: 12px;
      }

      .content {
        padding: 14px 12px 28px;
      }

      .section-card {
        padding: 16px 14px;
        border-radius: 12px;
        margin-bottom: 16px;
      }

      .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
      }

      .kpi-card {
        padding: 14px 12px;
      }

      .kpi-value {
        font-size: 22px;
      }

      .modules-grid,
      .charts-grid,
      .form-grid,
      .ficha-grid {
        grid-template-columns: 1fr !important;
      }

      .field.full {
        grid-column: span 1 !important;
      }

      .filters-bar,
      .toolbar {
        flex-direction: column;
        align-items: stretch;
      }

      .table-container {
        -webkit-overflow-scrolling: touch;
      }

      .modal-box {
        width: 96vw;
        max-height: 92vh;
        padding: 16px 14px;
        border-radius: 12px;
      }

      .form-actions {
        flex-direction: column-reverse;
        gap: 8px;
      }

      .form-actions button {
        width: 100%;
      }

      .pagination-bar {
        flex-direction: column;
        align-items: flex-start;
      }
    }

    @media (max-width: 540px) {
      .kpi-grid {
        grid-template-columns: 1fr;
      }

      .topbar-actions {
        width: 100%;
        justify-content: flex-start;
      }

      .btn-secondary,
      .btn-notif,
      .btn-logout {
        font-size: 11px;
        padding: 6px 9px;
      }
    }
