  /* ========== ESTILOS RÁPIDOS (puedes mover a styles.css) ========== */
  
   :root {
      --color-primary: #b71c1c;
      --color-primary-soft: #f8e4e4;
      --color-bg: #f5f5f7;
      --color-text: #222;
      --color-muted: #888;
      --radius-lg: 16px;
  }
  
  * {
      box-sizing: border-box;
  }
  
  body {
      margin: 0;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: var(--color-bg);
      color: var(--color-text);
  }
  
  a {
      color: inherit;
      text-decoration: none;
  }
  
  header.main-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 20px;
      background: #ffffff;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
      position: sticky;
      top: 0;
      z-index: 20;
  }
  
  .header-left {
      display: flex;
      align-items: center;
      gap: 12px;
  }
  
  .logo {
      height: 40px;
      width: auto;
      object-fit: contain;
  }
  
  .header-title {
      display: flex;
      flex-direction: column;
  }
  
  .header-title h1 {
      margin: 0;
      font-size: 18px;
      font-weight: 700;
  }
  
  .header-title span {
      font-size: 11px;
      color: var(--color-muted);
  }
  
  .header-right {
      display: flex;
      align-items: center;
      gap: 16px;
      font-size: 13px;
  }
  
  #roleInfo {
      font-size: 12px;
      color: var(--color-muted);
  }
  
  #userInfo {
      font-weight: 600;
  }
  
  #btnLogout {
      padding: 6px 12px;
      border-radius: 999px;
      border: none;
      background: var(--color-primary);
      color: #fff;
      cursor: pointer;
      font-size: 12px;
      display: none;
  }
  /* Layout principal */
  
  .app-layout {
      display: flex;
      min-height: calc(100vh - 60px);
  }
  
  .sidebar {
      width: 240px;
      background: #ffffff;
      border-right: 1px solid #eee;
      display: flex;
      flex-direction: column;
      padding: 12px 0;
  }
  
  .sidebar-title {
      font-size: 11px;
      text-transform: uppercase;
      padding: 0 16px;
      margin-bottom: 6px;
      color: var(--color-muted);
      letter-spacing: 0.08em;
  }
  
  .nav-list {
      list-style: none;
      margin: 0;
      padding: 0;
  }
  
  .nav-item {
      padding: 10px 18px;
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 14px;
      cursor: pointer;
      color: #444;
  }
  
  .nav-item-icon {
      font-size: 17px;
  }
  
  .nav-item:hover {
      background: #fafafa;
  }
  
  .nav-active {
      background: var(--color-primary-soft);
      border-left: 3px solid var(--color-primary);
      padding-left: 15px;
      font-weight: 600;
      color: var(--color-primary);
  }
  
  .main-content {
      flex: 1;
      padding: 16px;
      overflow: auto;
  }
  
  .module-section {
      display: none;
  }
  
  .module-active {
      display: block;
  }
  
  h2 {
      margin: 0 0 8px 0;
      font-size: 18px;
  }
  
  h3 {
      margin: 16px 0 8px 0;
      font-size: 15px;
  }
  
  .card {
      background: #fff;
      border-radius: var(--radius-lg);
      padding: 16px;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
      margin-bottom: 16px;
  }
  
  .grid-2 {
      display: grid;
      grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.4fr);
      gap: 16px;
  }
  
  @media (max-width: 900px) {
      .app-layout {
          flex-direction: column;
      }
      .sidebar {
          width: 100%;
          flex-direction: row;
          overflow-x: auto;
          border-right: none;
          border-bottom: 1px solid #eee;
      }
      .nav-item {
          flex: 1;
          justify-content: center;
      }
      .main-content {
          padding: 12px;
      }
      .grid-2 {
          grid-template-columns: 1fr;
      }
  }
  /* Login card */
  
  #loginCard {
      position: fixed;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      background: linear-gradient(135deg, #fbe9e7, #f5f5f7);
      z-index: 100;
  }
  
  .login-box {
      background: #fff;
      border-radius: 20px;
      padding: 24px 22px 20px;
      width: 100%;
      max-width: 360px;
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
  }
  
  .login-box-header {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 16px;
  }
  
  .login-logo {
      height: 40px;
      width: auto;
      object-fit: contain;
  }
  
  .login-box h1 {
      margin: 0;
      font-size: 18px;
  }
  
  .login-subtitle {
      font-size: 12px;
      color: var(--color-muted);
      margin-bottom: 12px;
  }
  
  .login-box form {
      display: flex;
      flex-direction: column;
      gap: 10px;
  }
  
  .login-box input {
      padding: 8px 10px;
      border-radius: 8px;
      border: 1px solid #ddd;
      font-size: 14px;
      width: 100%;
  }
  
  .btn-primary {
      border-radius: 999px;
      padding: 8px 14px;
      border: none;
      background: var(--color-primary);
      color: #fff;
      font-size: 14px;
      cursor: pointer;
      margin-top: 4px;
  }
  
  .msg {
      font-size: 12px;
      margin-top: 6px;
  }
  
  .msg-success {
      color: #1b5e20;
  }
  
  .msg-error {
      color: #c62828;
  }
  /* Tabs módulo clientes */
  
  .tabs {
      display: inline-flex;
      border-radius: 999px;
      background: #f3f3f7;
      padding: 3px;
      margin-bottom: 12px;
  }
  
  .tab {
      border: none;
      background: transparent;
      padding: 6px 14px;
      border-radius: 999px;
      font-size: 13px;
      cursor: pointer;
      color: #555;
  }
  
  .tab.active {
      background: #fff;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
      color: var(--color-primary);
      font-weight: 600;
  }
  
  form input,
  form select,
  form textarea {
      width: 100%;
      padding: 7px 9px;
      border-radius: 8px;
      border: 1px solid #ddd;
      margin-bottom: 8px;
      font-size: 13px;
  }
  
  label {
      font-size: 12px;
      font-weight: 600;
      color: #555;
      display: block;
      margin-top: 4px;
      margin-bottom: 2px;
  }
  /* Tabla genérica */
  
  table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13px;
      background: #fff;
      border-radius: 16px;
      overflow: hidden;
  }
  
  thead tr {
      background: #fafafa;
  }
  
  th,
  td {
      padding: 8px 10px;
      border-bottom: 1px solid #eee;
      text-align: left;
  }
  
  tbody tr:hover {
      background: #fafafa;
      cursor: pointer;
  }
  
  .badge {
      display: inline-block;
      padding: 2px 8px;
      border-radius: 999px;
      font-size: 11px;
      background: #eee;
  }
  
  .badge-venta {
      background: #e3f2fd;
      color: #0d47a1;
  }
  
  .badge-renta {
      background: #f9e0ff;
      color: #6a1b9a;
  }
  
  .badge-ok {
      background: #e0f2f1;
      color: #004d40;
  }
  
  .badge-error {
      background: #ffebee;
      color: #b71c1c;
  }
  
  .badge-pendiente {
      background: #fff3e0;
      color: #ef6c00;
  }
  
  .btn-mini {
      font-size: 11px;
      padding: 4px 8px;
      border-radius: 999px;
      border: 1px solid #ccc;
      background: #fff;
      cursor: pointer;
  }
  
  .btn-mini:hover {
      background: #f5f5f5;
  }
  /* Pills de tipo operación */
  
  #tipoOperacion {
      display: inline-flex;
      gap: 4px;
      margin: 4px 0 8px;
  }
  
  #tipoOperacion .pill {
      padding: 4px 10px;
      border-radius: 999px;
      border: 1px solid #ddd;
      font-size: 12px;
      cursor: pointer;
      background: #fff;
      color: #555;
  }
  
  #tipoOperacion .pill.selected {
      background: var(--color-primary-soft);
      border-color: var(--color-primary);
      color: var(--color-primary);
      font-weight: 600;
  }
  
  .docs-col {
      display: flex;
      flex-direction: column;
      gap: 4px;
  }
  
  .docs-list {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
  }
  
  .doc-item {
      display: inline-flex;
      align-items: center;
      gap: 4px;
  }
  
  .doc-icon {
      font-size: 12px;
  }
  
  .detalle-cliente {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
      background: #fafafa;
      border-radius: 12px;
      padding: 12px;
      margin-top: 4px;
  }
  
  .cliente-detalle-row td {
      background: #fdfdfd;
  }
  
  .mini-map {
      border: 1px solid #ddd;
  }
  /* Side panels */
  
  .side-panel {
      position: fixed;
      inset: 0 0 0 auto;
      width: 360px;
      max-width: 100%;
      background: rgba(0, 0, 0, 0.3);
      display: none;
      justify-content: flex-end;
      z-index: 99;
  }
  
  .side-panel-inner {
      background: #fff;
      width: 360px;
      max-width: 100%;
      height: 100%;
      display: flex;
      flex-direction: column;
      box-shadow: -2px 0 12px rgba(0, 0, 0, 0.2);
  }
  
  .side-panel-header {
      padding: 12px 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid #eee;
  }
  
  .side-panel-header h3 {
      margin: 0;
      font-size: 15px;
  }
  
  .side-panel-close {
      border: none;
      background: transparent;
      font-size: 18px;
      cursor: pointer;
  }
  
  .side-panel-body {
      padding: 12px 14px 18px;
      overflow-y: auto;
      font-size: 13px;
  }
  /* Subnav inmuebles */
  
  .subnav {
      display: inline-flex;
      gap: 4px;
      border-radius: 999px;
      background: #f3f3f7;
      padding: 3px;
      margin-bottom: 12px;
  }
  
  .subnav-item {
      border: none;
      background: transparent;
      padding: 6px 12px;
      border-radius: 999px;
      font-size: 12px;
      cursor: pointer;
      color: #555;
  }
  
  .subnav-active {
      background: #fff;
      color: var(--color-primary);
      font-weight: 600;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  }
  
  #mapInmueblesGeneral {
      width: 100%;
      height: 380px;
      border-radius: 16px;
      overflow: hidden;
      border: 1px solid #e0e0e0;
  }
  
  @media (max-width: 900px) {
      .detalle-cliente {
          grid-template-columns: 1fr;
      }
  }
  /* Layout ahora es columna: header arriba, menú + contenido abajo */
  
  .app-layout {
      display: block;
  }
  /* Menú horizontal de módulos */
  
  .module-menu {
      display: inline-flex;
      gap: 8px;
      padding: 6px;
      background: #f3f3f7;
      border-radius: 999px;
      margin-bottom: 14px;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  }
  
  .module-btn {
      border: none;
      background: transparent;
      padding: 6px 14px;
      border-radius: 999px;
      font-size: 13px;
      cursor: pointer;
      color: #555;
      display: inline-flex;
      align-items: center;
      gap: 6px;
  }
  
  .module-btn:hover {
      background: #ffffff;
  }
  
  .module-btn-active {
      background: #ffffff;
      color: var(--color-primary);
      font-weight: 600;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  }
  /* Las secciones siguen igual */
  
  .module-section {
      display: none;
  }
  
  .module-section.module-active {
      display: block;
  }
  
  .tabla-predial {
      width: 100%;
      border-collapse: collapse;
      font-size: 12px;
      margin-top: 6px;
  }
  
  .tabla-predial th,
  .tabla-predial td {
      padding: 4px 6px;
      border-bottom: 1px solid #eee;
  }
  
  .tabla-predial .badge-ok {
      background: #e0f2f1;
      color: #004d40;
      border-radius: 999px;
      padding: 2px 8px;
      font-size: 11px;
  }
  
  .tabla-predial .badge-pendiente {
      background: #fff3e0;
      color: #ef6c00;
      border-radius: 999px;
      padding: 2px 8px;
      font-size: 11px;
  }
  
  .predial-row {
      display: flex;
      gap: 8px;
      align-items: flex-end;
      margin-top: 4px;
  }
  
  @media (max-width: 600px) {
      .predial-row {
          flex-direction: column;
      }
  }
  
  .docs-estado {
      margin-top: 12px;
      padding: 10px 12px;
      border-radius: 8px;
      background: #f7f7fb;
      border: 1px solid #e0e0ee;
  }
  
  .docs-estado h3 {
      margin-top: 0;
      margin-bottom: 6px;
      font-size: 14px;
  }
  
  .docs-estado .doc-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 13px;
      padding: 4px 0;
      border-bottom: 1px dashed #ddd;
  }
  
  .docs-estado .doc-row:last-child {
      border-bottom: none;
  }
  
  .docs-estado .doc-label {
      font-weight: 600;
  }
  
  .docs-estado .doc-status-ok {
      color: #1b873f;
  }
  
  .docs-estado .doc-status-error {
      color: #c0392b;
  }
  
  .docs-estado .doc-status-pending {
      color: #999;
  }