﻿    :root {
      --blue-900: #0b2340;
      --blue-800: #0f2f57;
      --blue-700: #154276;
      --blue-600: #1b5aa2;
      --blue-500: #2a7bd6;
      --blue-100: #e7f0ff;
      --surface: #f7f9fc;
      --ink: #0f1b2d;
      --muted: #5a6c86;
    }

    body {
      font-family: "Manrope", "SF Pro Text", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
      color: var(--ink);
      background:
        radial-gradient(1200px 400px at 10% -10%, #d8e8ff 0%, rgba(216, 232, 255, 0) 70%),
        radial-gradient(900px 500px at 100% 0%, #e2f1ff 0%, rgba(226, 241, 255, 0) 65%),
        var(--surface);
    }

    h1,
    h2,
    h3,
    h4,
    h5 {
      letter-spacing: -0.02em;
    }

    h2,
    h3,
    h4 {
      background: #e7f0ff;
      color: #0f2f57;
      border-radius: 8px;
      padding: 0.25rem 0.5rem;
    }

    .card {
      border: 1px solid rgba(15, 47, 87, 0.08);
      background-image: linear-gradient(to right top, #f8fcfd, #f3f7f8, #eef2f3, #eaedee, #e5e8e9);
      border-radius: 20px;
      backdrop-filter: blur(6px);
    }

    .totals-dashboard-panel {
      background: linear-gradient(135deg, #0b2340 0%, #154276 58%, #245d86 100%);
      color: #fff;
    }

    .chip {
      font-size: 12px;
      padding: .25rem .65rem;
      border-radius: 999px;
      background: linear-gradient(90deg, #e9f1ff, #d7e8ff);
      color: var(--blue-800);
      border: 1px solid rgba(15, 47, 87, 0.08);
    }

    .mono {
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    }

    .lumer-brand {
      font-family: "Audiowide", "Fugaz One", "Anta", "Michroma", "Segoe UI", sans-serif;
      letter-spacing: 0.04em;
      background-image: linear-gradient(to right top, #e1db12, #bdcd01, #99be00, #76af00, #539f04);
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
    }

    .table td,
    .table th {
      vertical-align: middle;
    }

    .table thead th {
      color: var(--muted);
      font-weight: 600;
    }

    .hint {
      font-size: 12px;
      color: var(--muted);
    }

    .form-label {
      color: var(--blue-800);
      font-weight: 600;
    }

    .form-control,
    .form-select {
      border-radius: 12px;
      border-color: rgba(15, 47, 87, 0.16);
      box-shadow: none;
    }

    .form-control:focus,
    .form-select:focus {
      border-color: var(--blue-500);
      box-shadow: 0 0 0 0.2rem rgba(42, 123, 214, 0.15);
    }

    .btn {
      background: linear-gradient(120deg, var(--blue-600), var(--blue-500));
      border: none;
      color: #fff;
      box-shadow: 0 10px 20px rgba(27, 90, 162, 0.25);
    }

    .btn:hover {
      filter: brightness(0.98);
    }

    .btn-primary {
      background: linear-gradient(120deg, var(--blue-600), var(--blue-500));
      border: none;
      box-shadow: 0 10px 20px rgba(27, 90, 162, 0.25);
    }

    .btn-primary:hover {
      filter: brightness(0.98);
    }

    .modal-content {
      border: 1px solid rgba(15, 47, 87, 0.08);
      box-shadow: 0 24px 60px rgba(15, 47, 87, 0.2);
    }

    .bg-light {
      background-color: #f1f6ff !important;
    }

    .amb-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      border-radius: 8px;
      margin-right: 8px;
      color: var(--blue-700);
      background: linear-gradient(160deg, #e9f2ff, #d9eaff);
      border: 1px solid rgba(15, 47, 87, 0.08);
      flex: 0 0 auto;
    }

    .ab-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 26px;
      height: 26px;
      border-radius: 8px;
      margin-right: 8px;
      color: var(--blue-700);
      background: linear-gradient(160deg, #eef5ff, #dfeeff);
      border: 1px solid rgba(15, 47, 87, 0.08);
      flex: 0 0 auto;
    }

    body.dark {
      color: #e7efff;
      background:
        radial-gradient(1200px 400px at 10% -10%, rgba(20, 45, 80, 0.6) 0%, rgba(20, 45, 80, 0) 70%),
        radial-gradient(900px 500px at 100% 0%, rgba(12, 28, 50, 0.7) 0%, rgba(12, 28, 50, 0) 65%),
        #0b1526;
    }

    body.dark .card {
      background: rgba(15, 24, 40, 0.9);
      border-color: rgba(231, 239, 255, 0.08);
      box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
    }

    body.dark .chip {
      background: linear-gradient(90deg, rgba(30, 60, 110, 0.9), rgba(20, 50, 95, 0.9));
      color: #d6e6ff;
      border-color: rgba(214, 230, 255, 0.12);
    }

    body.dark .form-label,
    body.dark .table thead th,
    body.dark .text-secondary {
      color: #b9c8e6 !important;
    }

    body.dark .hint {
      color: #9bb0d4;
    }

    body.dark .form-control,
    body.dark .form-select {
      background-color: #0f1c32;
      color: #e7efff;
      border-color: rgba(231, 239, 255, 0.12);
    }

    body.dark .form-control::placeholder {
      color: #8ea5c7;
    }

    body.dark .bg-light {
      background-color: #0f1c32 !important;
    }

    body.dark .bg-white {
      background-color: #0f1c32 !important;
    }

    body.dark .modal-content {
      background-color: #0f1c32;
      color: #e7efff;
    }

    body.dark h2,
    body.dark h3,
    body.dark h4 {
      background: #142945;
      color: #d6e6ff;
    }

    body.dark .table {
      color: #d6e6ff;
      background-color: #0f1c32;
    }

    body.dark .table td,
    body.dark .table th {
      border-color: rgba(214, 230, 255, 0.1);
    }

    body.dark .table> :not(caption)>*>* {
      background-color: #0f1c32;
    }

    body.dark .amb-icon {
      background: linear-gradient(160deg, #1b2f4f, #142945);
      color: #cfe0ff;
      border-color: rgba(214, 230, 255, 0.12);
    }

    body.dark .ab-icon {
      background: linear-gradient(160deg, #1b2f4f, #142945);
      color: #cfe0ff;
      border-color: rgba(214, 230, 255, 0.12);
    }

    .client-selected {
      border: 2px solid #2f9e44;
      box-shadow: 0 10px 20px rgba(47, 158, 68, 0.2);
    }

    body.dark .client-selected {
      border-color: #6ee7a0;
      box-shadow: 0 10px 20px rgba(110, 231, 160, 0.2);
    }

    .btn-client-delete {
      display: flex;
      align-items: center;
      align-content: stretch;
      justify-content: space-between;
    }

    .access-overlay {
      position: fixed;
      inset: 0;
      background:
        radial-gradient(800px 400px at 20% 0%, rgba(15, 47, 87, 0.3), transparent 60%),
        linear-gradient(180deg, rgba(8, 16, 30, 0.7), rgba(8, 16, 30, 0.85));
      display: grid;
      place-items: center;
      padding: 24px;
      z-index: 9999;
      opacity: 0;
      pointer-events: none;
      transition: opacity 180ms ease;
    }

    body.locked .access-overlay {
      opacity: 1;
      pointer-events: auto;
    }

    body.locked #appRoot {
      filter: blur(6px);
      pointer-events: none;
      user-select: none;
    }

    .access-card {
      max-width: 520px;
      width: 100%;
      background-image: linear-gradient(to top, #d2e4e9, #d9eae8, #e3efe9, #eef3eb, #f8f7f0);
      border-radius: 22px;
      border: 1px solid rgba(15, 47, 87, 0.12);
      box-shadow: 0 24px 60px rgba(12, 24, 40, 0.35);
      padding: 28px;
      backdrop-filter: blur(8px);
    }

    .access-title {
      font-size: 1.5rem;
      font-weight: 700;
      color: var(--blue-900);
    }

    .access-logo {
      width: 96px;
      height: 96px;
      border-radius: 24px;
      overflow: hidden;
      border: 1px solid rgba(15, 47, 87, 0.12);
      box-shadow: 0 12px 24px rgba(12, 24, 40, 0.18);
      background: #fff;
      margin-bottom: 16px;
    }

    .access-logo img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .access-hint {
      color: var(--muted);
      font-size: 0.95rem;
    }

    .access-error {
      color: #b42318;
      font-size: 0.9rem;
      display: none;
    }

    .access-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
    }

    .trial-banner {
      display: none;
      margin-top: 12px;
      background: #f1f6ff;
      border: 1px solid rgba(15, 47, 87, 0.12);
      color: var(--blue-800);
      border-radius: 12px;
      padding: 8px 12px;
      font-size: 0.95rem;
    }

    .trial-timer {
      font-weight: 700;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    }

    .darkmode-wrap {
      position: relative;
      display: inline-flex;
      align-items: center;
    }

    .free-mode-icon {
      width: 14px;
      height: 14px;
      fill: none;
      stroke: currentColor;
      stroke-width: 1.8;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .empresa-header-identity {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 0;
    }

    .empresa-header-logo {
      width: 58px;
      height: 58px;
      flex: 0 0 58px;
      overflow: hidden;
      border: 1px solid rgba(21, 66, 118, 0.18);
      border-radius: 14px;
      background: #ffffff;
      box-shadow: 0 8px 18px rgba(15, 47, 87, 0.14);
    }

    .empresa-header-logo img {
      display: block;
      width: 100%;
      height: 100%;
      padding: 4px;
      object-fit: contain;
    }

    body.dark .empresa-header-logo {
      border-color: rgba(214, 230, 255, 0.3);
      background: #f5f8ff;
      box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
    }

    .darkmode-button {
      position: relative;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 44px;
      height: 36px;
      padding: 0;
      overflow: hidden;
      color: #f59f00;
      background: #fff8db;
      border: 1px solid #f1c453;
      border-radius: 999px;
      cursor: pointer;
      transition: color 0.35s ease, background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
    }

    .darkmode-button:hover,
    .darkmode-button:focus-visible {
      box-shadow: 0 0 0 4px rgba(245, 159, 0, 0.2);
    }

    .theme-icon {
      position: absolute;
      width: 21px;
      height: 21px;
      fill: none;
      stroke: currentColor;
      stroke-width: 1.8;
      stroke-linecap: round;
      stroke-linejoin: round;
      transition: transform 0.4s ease, opacity 0.3s ease;
    }

    .theme-icon-sun {
      transform: translateY(0) rotate(0deg) scale(1);
      opacity: 1;
    }

    .theme-icon-moon {
      transform: translateY(22px) rotate(-35deg) scale(0.6);
      opacity: 0;
    }

    .darkmode-button.is-dark {
      color: #dbeafe;
      background: #172b4d;
      border-color: #739bd5;
      box-shadow: 0 0 16px rgba(115, 155, 213, 0.25);
    }

    .darkmode-button.is-dark .theme-icon-sun {
      transform: translateY(-22px) rotate(35deg) scale(0.6);
      opacity: 0;
    }

    .darkmode-button.is-dark .theme-icon-moon {
      transform: translateY(0) rotate(0deg) scale(1);
      opacity: 1;
    }

    .trial-badge {
      position: absolute;
      top: -10px;
      right: -12px;
      background: #0f2f57;
      color: #fff;
      border-radius: 999px;
      padding: 2px 8px;
      font-size: 0.75rem;
      letter-spacing: 0.02em;
      box-shadow: 0 8px 16px rgba(12, 24, 40, 0.25);
      display: none;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    }

    .trial-pill {
      position: fixed;
      left: 50%;
      bottom: 16px;
      transform: translateX(-50%);
      background: rgba(12, 24, 40, 0.92);
      color: #fff;
      padding: 8px 16px;
      border-radius: 999px;
      font-size: 0.9rem;
      display: none;
      gap: 8px;
      align-items: center;
      box-shadow: 0 14px 28px rgba(12, 24, 40, 0.35);
      border: 1px solid rgba(255, 255, 255, 0.12);
      z-index: 9990;
    }

    .trial-pill .mono {
      font-weight: 700;
    }

    body.dark .trial-pill {
      background: rgba(8, 16, 30, 0.95);
      border-color: rgba(214, 230, 255, 0.12);
    }

    /* --- Menú Inferior (Bottom Nav) --- */
    .bottom-nav {
      position: fixed;
      bottom: 0;
      left: 0;
      width: 100%;
      background: linear-gradient(to top, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.78) 62%, rgba(255, 255, 255, 0) 100%);
      backdrop-filter: blur(12px);
      box-shadow: 0 -4px 24px rgba(15, 47, 87, 0.08);
      display: flex;
      justify-content: space-around;
      padding: 12px 0;
      padding-bottom: env(safe-area-inset-bottom, 12px);
      z-index: 1000;
      border-top: 1px solid rgba(15, 47, 87, 0.06);
      transition: background 0.3s, border-color 0.3s;
    }
    
    body.dark .bottom-nav {
      background: linear-gradient(to top, rgba(15, 28, 50, 0.97) 0%, rgba(15, 28, 50, 0.8) 62%, rgba(15, 28, 50, 0) 100%);
      border-top: 1px solid rgba(231, 239, 255, 0.08);
      box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
    }

    .bottom-nav-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      color: var(--muted);
      text-decoration: none;
      font-size: 0.75rem;
      font-weight: 700;
      transition: all 0.2s ease-in-out;
      cursor: pointer;
      user-select: none;
      background: none;
      border: none;
      padding: 6px 24px;
      border-radius: 12px;
    }
    
    .bottom-nav-item:hover,
    .bottom-nav-item:focus {
      color: var(--blue-500);
      background: rgba(42, 123, 214, 0.08);
    }
    
    .bottom-nav-item.active {
      color: var(--blue-600);
    }
    .bottom-nav-item.active svg {
      color: var(--blue-600);
      transform: scale(1.1);
    }

    body.dark .bottom-nav-item { color: #8ea5c7; }
    body.dark .bottom-nav-item:hover { color: #6ee7a0; background: rgba(110, 231, 160, 0.08); }
    body.dark .bottom-nav-item.active { color: #6ee7a0; }
    body.dark .bottom-nav-item.active svg { color: #6ee7a0; }

    .bottom-nav-item svg {
      width: 24px;
      height: 24px;
      margin-bottom: 6px;
      transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s;
    }

    body {
      padding-bottom: 90px;
    }

    /* --- Historial --- */
    .history-card {
      transition: transform 0.2s;
      cursor: pointer;
    }
    .history-card:hover {
      transform: translateY(-2px);
    }

    .premium-benefit-image {
      display: block;
      width: min(200px, 100%);
      height: 200px;
      object-fit: cover;
      margin: 0 auto 1rem;
      border-radius: 1rem;
      box-shadow: 0 0.75rem 1.5rem rgba(22, 12, 58, 0.28);
    }

    .premium-access-image {
      display: block;
      width: min(200px, 100%);
      height: 200px;
      object-fit: cover;
      margin: 0 auto 1rem;
      border-radius: 1rem;
      box-shadow: 0 0.75rem 1.5rem rgba(22, 12, 58, 0.28);
    }

    .empresa-logo-preview {
      display: grid;
      place-items: center;
      width: 92px;
      height: 92px;
      overflow: hidden;
      border: 1px dashed #8ca7c7;
      border-radius: 14px;
      background: #f4f8ff;
      color: #58708f;
      flex: 0 0 auto;
    }

    .empresa-logo-preview img {
      width: 100%;
      height: 100%;
      padding: 6px;
      object-fit: contain;
    }

    .empresa-logo-empty {
      font-size: 0.75rem;
      text-align: center;
    }

    body.dark .empresa-logo-preview {
      border-color: #8ca7c7;
      background: #172b4d;
      color: #dbeafe;
    }

    /* --- Legibilidad reforzada en modo oscuro --- */
    body.dark {
      --bs-body-color: #f3f7ff;
      --bs-body-color-rgb: 243, 247, 255;
      --bs-secondary-color: #c5d4ee;
      --bs-secondary-color-rgb: 197, 212, 238;
      --bs-heading-color: #ffffff;
    }

    body.dark,
    body.dark .card,
    body.dark .modal-content,
    body.dark .dropdown-menu,
    body.dark .list-group-item,
    body.dark .form-check-label,
    body.dark label,
    body.dark p,
    body.dark li,
    body.dark td,
    body.dark th {
      color: #f3f7ff;
    }

    body.dark .text-secondary,
    body.dark .text-muted,
    body.dark .text-body-secondary,
    body.dark .text-body,
    body.dark .text-dark,
    body.dark .hint,
    body.dark .table thead th {
      color: #c5d4ee !important;
    }

    body.dark .text-primary { color: #8fc4ff !important; }
    body.dark .text-success { color: #7ff0a7 !important; }
    body.dark .text-danger { color: #ff9f9f !important; }

    body.dark .form-control,
    body.dark .form-select,
    body.dark textarea,
    body.dark select,
    body.dark option {
      color: #f3f7ff !important;
      background-color: #0f1c32 !important;
    }

    body.dark .form-control::placeholder,
    body.dark textarea::placeholder {
      color: #afc2e2 !important;
      opacity: 1;
    }

    body.dark .btn-outline-secondary,
    body.dark .btn-outline-dark {
      color: #e5efff !important;
      border-color: #9fb6d8 !important;
    }

    body.dark .badge.bg-light,
    body.dark .text-bg-light {
      color: #e5efff !important;
      background-color: #223653 !important;
    }

    body.dark .list-group-item,
    body.dark .table > :not(caption) > * > * {
      background-color: #0f1c32 !important;
      border-color: rgba(214, 230, 255, 0.16) !important;
    }

    body.dark .modal-header,
    body.dark .modal-footer {
      border-color: rgba(214, 230, 255, 0.16) !important;
    }

    body.dark .btn-close {
      filter: invert(1) grayscale(1) brightness(2);
      opacity: .9;
    }

    /* --- Tour inicial --- */
    body.tour-open {
      overflow: hidden;
    }

    .tour-overlay {
      position: fixed;
      inset: 0;
      z-index: 11000;
      pointer-events: none;
    }

    .tour-overlay[hidden] {
      display: none !important;
    }

    .tour-backdrop {
      position: absolute;
      inset: 0;
      background: transparent;
      pointer-events: auto;
    }

    .tour-spotlight {
      position: fixed;
      z-index: 11001;
      border: 2px solid #8fc4ff;
      border-radius: 12px;
      box-shadow: 0 0 0 9999px rgba(5, 15, 32, 0.64), 0 0 0 6px rgba(143, 196, 255, 0.2);
      pointer-events: none;
      transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
    }

    .tour-card {
      position: fixed;
      z-index: 11002;
      width: min(360px, calc(100vw - 32px));
      padding: 20px;
      color: #24364f;
      background: #ffffff;
      border: 1px solid rgba(21, 66, 118, 0.18);
      border-radius: 18px;
      box-shadow: 0 20px 55px rgba(8, 24, 48, 0.3);
      pointer-events: auto;
      transition: top 0.2s ease, left 0.2s ease;
    }

    .tour-kicker {
      margin-bottom: 8px;
      color: #154276;
      font-size: 0.72rem;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .tour-progress {
      color: #58708f;
      font-size: 0.78rem;
      font-weight: 700;
    }

    .tour-close {
      width: 30px;
      height: 30px;
      padding: 0;
      color: #58708f;
      background: transparent;
      border: 0;
      border-radius: 50%;
      font-size: 1.5rem;
      line-height: 1;
      cursor: pointer;
    }

    .tour-close:hover,
    .tour-close:focus-visible {
      color: #154276;
      background: #eef4fc;
    }

    .tour-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-top: 20px;
    }

    body.dark .tour-card {
      color: #f3f7ff;
      background: #0f1c32;
      border-color: rgba(214, 230, 255, 0.2);
    }

    body.dark .tour-kicker,
    body.dark .tour-close:hover,
    body.dark .tour-close:focus-visible {
      color: #8fc4ff;
    }

    body.dark .tour-progress,
    body.dark .tour-close {
      color: #afc2e2;
    }

    body.dark .tour-close:hover,
    body.dark .tour-close:focus-visible {
      background: #172b4d;
    }

    @media (max-width: 575px) {
      body {
        padding-bottom: 78px;
      }

      .app-shell-header {
        align-items: stretch !important;
        flex-direction: column;
        gap: 12px;
      }

      .empresa-header-identity {
        min-width: 0;
      }

      .empresa-header-identity h1 {
        font-size: 1.55rem;
      }

      .empresa-header-identity h5 {
        overflow-wrap: anywhere;
      }

      .app-status-actions {
        align-items: center;
        flex-wrap: wrap;
        justify-content: flex-start;
        width: 100%;
      }

      .app-status-actions > .btn {
        flex: 1 1 auto;
        min-height: 40px;
      }

      .view-action-bar {
        row-gap: 8px !important;
      }

      .view-action-bar > .btn {
        justify-content: center;
        width: 100%;
      }

      .bottom-nav {
        padding-top: 8px;
      }

      .bottom-nav-item {
        min-width: 0;
        padding: 5px 6px;
        font-size: 0.66rem;
      }

      .bottom-nav-item svg {
        width: 21px;
        height: 21px;
        margin-bottom: 3px;
      }

      .tour-card {
        padding: 16px;
      }

      .tour-actions {
        align-items: stretch;
        flex-direction: column;
      }

      .tour-actions > .d-flex {
        justify-content: flex-end;
      }
    }
  

