:root {
  --gold: #F2C14E;
  --gold-deep: #B9892B;
  --gold-soft: #FFF3C4;
  --black: #0B1D33;
  --charcoal: #0B1D33;
  --ink: #0B1D33;
  --ink-soft: #334155;
  --paper: #F5F7FB;
  --cream: #EEF2F6;
  --cloud: #FFFFFF;
  --line: #E2E8F0;
  --muted: #64748B;
  --oxblood: #0B1D33;
  --sage: #22C55E;
  --shadow: rgba(11, 29, 51, 0.16);
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --font-display: "Playfair Display", "Times New Roman", serif;
  --font-ui: "Space Grotesk", "Source Sans 3", sans-serif;
  --layout-max: 1820px;
  --layout-gutter: clamp(14px, 2.2vw, 38px);
  --section-pad-x: clamp(16px, 1.6vw, 28px);
  --section-pad-y: clamp(16px, 1.4vw, 24px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% -10%, rgba(242, 193, 78, 0.14), transparent 50%),
    radial-gradient(circle at 85% 0%, rgba(56, 189, 248, 0.12), transparent 48%),
    radial-gradient(circle at 75% 95%, rgba(34, 197, 94, 0.11), transparent 52%),
    linear-gradient(180deg, var(--paper) 0%, var(--cream) 100%);
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.auth-pending main {
  visibility: hidden;
}

body.auth-locked main {
  visibility: hidden;
}

body.modal-open {
  overflow: hidden;
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding:
    calc(28px + var(--safe-top))
    calc(clamp(16px, 2.4vw, 40px) + var(--safe-right))
    26px
    calc(clamp(16px, 2.4vw, 40px) + var(--safe-left));
  border-bottom: 1px solid rgba(242, 193, 78, 0.22);
  background:
    radial-gradient(circle at 8% 20%, rgba(242, 193, 78, 0.28), transparent 42%),
    radial-gradient(circle at 85% 20%, rgba(56, 189, 248, 0.18), transparent 46%),
    linear-gradient(125deg, #0B1D33 0%, #0F2742 56%, #182F55 100%);
  color: #f7f4ee;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  cursor: pointer;
}

.brand img {
  width: 240px;
  height: 56px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: 1.2px;
  font-weight: 600;
  color: #F5F5F5;
}

.brand p {
  margin: 6px 0 0;
  color: rgba(245, 245, 245, 0.9);
  font-size: 13px;
  letter-spacing: 0.4px;
}

.meta {
  display: grid;
  gap: 6px;
  justify-items: end;
  text-align: right;
  color: rgba(245, 245, 245, 0.92);
  font-size: 13px;
  letter-spacing: 0.3px;
  font-family: var(--font-ui);
}

.density-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  padding: 4px;
}

.density-label {
  font-size: 10px;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  color: rgba(245, 245, 245, 0.88);
  padding: 0 6px;
}

.density-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: rgba(245, 245, 245, 0.95);
  padding: 5px 10px;
  font-size: 11px;
  letter-spacing: 0.2px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
}

.density-btn:hover {
  border-color: rgba(255, 255, 255, 0.42);
  transform: none;
  box-shadow: none;
}

.density-btn.active {
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.9);
}

main {
  padding: 26px var(--layout-gutter) 64px;
  display: grid;
  gap: 24px;
  max-width: var(--layout-max);
  width: 100%;
  margin: 0 auto;
  padding-bottom: calc(64px + var(--safe-bottom));
}

.ui-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px clamp(16px, 2.4vw, 40px);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 18;
}

.ui-context-copy {
  display: grid;
  gap: 2px;
}

.ui-context-copy strong {
  font-family: var(--font-ui);
  letter-spacing: 0.2px;
}

.ui-context-copy span {
  color: var(--muted);
  font-size: 13px;
}

.ui-context-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

section {
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.92) 48%, rgba(243, 247, 245, 0.92) 100%),
    var(--paper);
  border: 1px solid rgba(190, 206, 198, 0.85);
  border-radius: 20px;
  padding: var(--section-pad-y) var(--section-pad-x) calc(var(--section-pad-y) + 4px);
  box-shadow: 0 14px 32px rgba(12, 10, 8, 0.1);
  border-top: 3px solid rgba(242, 193, 78, 0.45);
  animation: fadeUp 0.6s ease both;
}

h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: 0.2px;
}

.card,
.form-card,
.data-card,
.dashboard-card {
  background: var(--cloud);
  border: 1px solid rgba(217, 211, 199, 0.8);
  border-radius: 18px;
  box-shadow: 0 16px 35px rgba(12, 10, 8, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover,
.form-card:hover,
.data-card:hover,
.dashboard-card:hover {
  transform: translateY(-1px);
  border-color: rgba(242, 193, 78, 0.32);
  box-shadow: 0 20px 36px rgba(12, 10, 8, 0.12);
}

.muted {
  color: var(--muted);
  letter-spacing: 0.2px;
}

button,
.btn,
.tab,
input,
select,
textarea {
  font-family: var(--font-ui);
}

button,
.btn {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: #f5f5f5;
  border: none;
  border-radius: 14px;
  padding: 10px 16px;
  box-shadow: 0 10px 20px rgba(11, 29, 51, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

button:hover,
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(11, 29, 51, 0.22);
}

button.secondary,
.btn.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

.catastro-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.catastro-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.catastro-brand strong {
  display: block;
  font-size: 18px;
  color: var(--ink);
}

.catastro-brand p {
  margin: 2px 0 0;
}

.catastro-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 34px;
  padding: 0 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1b4f72 0%, #2d6c98 56%, #5a9cc7 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.catastro-icon--catastro {
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(130, 76, 69, 0.16);
}

.catastro-icon--catastro .catastro-logo-img {
  display: block;
  height: 18px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

.tabs,
.tab-group {
  background: rgba(253, 251, 247, 0.7);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.tab {
  border-radius: 14px;
  padding: 8px 16px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  transition: all 0.18s ease;
}

.tab.active {
  background: var(--gold);
  color: #f5f5f5;
  border-color: rgba(60, 110, 113, 0.6);
  box-shadow: 0 10px 20px rgba(60, 110, 113, 0.25);
}

input,
select,
textarea {
  background: rgba(253, 251, 247, 0.9);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(60, 110, 113, 0.8);
  box-shadow: 0 0 0 3px rgba(60, 110, 113, 0.18);
}

.data-table {
  border-collapse: separate;
  border-spacing: 0;
  background: var(--cloud);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.data-table th {
  background: rgba(60, 110, 113, 0.15);
  font-family: var(--font-ui);
  letter-spacing: 0.3px;
}

.data-table td,
.data-table th {
  padding: 10px 12px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.fade-up {
  animation: fadeUp 0.6s ease both;
}

.seguros-tab {
  display: none;
}

.seguros-tab.active {
  display: block;
}

.hidden {
  display: none !important;
}

body.page-empresa #homeSection {
  display: none;
}

body.page-empresa #renewalAlert {
  display: none;
}

#explorerSection.operativa-mode #tableToolbar,
#explorerSection.operativa-mode #tableContainer,
#explorerSection.operativa-mode #tableInfo {
  display: none;
}

#bdtSection.hidden {
  display: none;
}

section:nth-of-type(2) {
  animation-delay: 0.08s;
}

section:nth-of-type(3) {
  animation-delay: 0.16s;
}

h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border: 1px solid rgba(60, 110, 113, 0.4);
}

a.pill {
  text-decoration: none;
}

a.pill:hover {
  text-decoration: none;
  filter: brightness(0.98);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.crm-kpis.grid {
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 12px;
}

.home-block {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.home-block h3 {
  margin: 0;
  font-size: 18px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
}

.org-chart {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 8px 0;
}

.org-chart ul {
  padding: 0;
  margin: 0;
  list-style: none;
  position: relative;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.org-chart li {
  text-align: center;
  position: relative;
  padding: 20px 12px 0;
}

.org-chart li::before,
.org-chart li::after {
  content: "";
  position: absolute;
  top: 0;
  width: 50%;
  height: 12px;
  border-top: 1px solid rgba(60, 110, 113, 0.35);
}

.org-chart li::before {
  right: 50%;
  border-right: 1px solid rgba(60, 110, 113, 0.35);
}

.org-chart li::after {
  left: 50%;
  border-left: 1px solid rgba(60, 110, 113, 0.35);
}

.org-chart li:only-child::before,
.org-chart li:only-child::after {
  display: none;
}

.org-chart li:only-child {
  padding-top: 0;
}

.org-chart ul ul::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  border-left: 1px solid rgba(60, 110, 113, 0.35);
  width: 0;
  height: 12px;
}

.org-node {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--cloud);
  box-shadow: 0 12px 24px rgba(44, 34, 24, 0.08);
  min-width: 200px;
}

.org-node h4 {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus,
button:focus,
.tab:focus,
[role="tab"]:focus {
  outline: 3px solid rgba(60, 110, 113, 0.22);
  outline-offset: 2px;
}

.ui-form-managed.is-dirty {
  position: relative;
}

.ui-form-managed.is-dirty::after {
  content: "Borrador";
  position: absolute;
  top: -10px;
  right: 10px;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.25px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(95, 122, 97, 0.14);
  color: var(--sage);
  border: 1px solid rgba(95, 122, 97, 0.24);
}

[aria-invalid="true"] {
  border-color: #b64a42 !important;
  box-shadow: 0 0 0 3px rgba(182, 74, 66, 0.12);
}

.ui-field-error {
  margin-top: 6px;
  font-size: 12px;
  color: #b64a42;
  font-family: var(--font-ui);
}

.ui-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  padding: 4px 0;
}

.ui-status.is-pending {
  color: #6c6f1b;
}

.ui-status.is-success {
  color: #2f6a43;
}

.ui-status.is-error {
  color: #a33c32;
}

.ui-status.is-empty {
  color: var(--muted);
}

.ui-empty-state {
  padding: 16px 18px;
  border: 1px dashed rgba(100, 112, 107, 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
}

.ui-table-shell {
  display: grid;
  gap: 10px;
}

.ui-table-meta {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.2px;
}

.ui-table-scroll {
  overflow-x: auto;
  border-radius: 16px;
}

.ui-table th.ui-sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 22px;
}

.ui-table th.ui-sortable::after {
  content: "↕";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--muted);
}

.ui-table th.ui-sortable.sort-asc::after {
  content: "↑";
}

.ui-table th.ui-sortable.sort-desc::after {
  content: "↓";
}

.form-actions,
.modal-actions,
.crm-actions,
.section-head {
  row-gap: 10px;
}

.tabs {
  overflow-x: auto;
  scrollbar-width: thin;
}

.tabs .tab {
  white-space: nowrap;
}

@media (max-width: 980px) {
  .ui-context-bar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  header,
  .section-head,
  .crm-actions,
  .form-actions {
    align-items: stretch;
  }

  .ui-context-actions {
    width: 100%;
  }

  .ui-context-actions button {
    flex: 1 1 180px;
  }
}

@media (max-width: 760px) {
  main {
    padding-top: 18px;
  }

  .ui-table-scroll {
    overflow: visible;
  }

  .ui-table table,
  .ui-table thead,
  .ui-table tbody,
  .ui-table tr,
  .ui-table th,
  .ui-table td {
    display: block;
    width: 100%;
  }

  .ui-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }

  .ui-table tbody {
    display: grid;
    gap: 12px;
  }

  .ui-table tr {
    border: 1px solid rgba(214, 222, 218, 0.9);
    border-radius: 16px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 18px rgba(12, 10, 8, 0.06);
  }

  .ui-table td {
    border: none;
    padding: 7px 0;
  }

  .ui-table td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-ui);
    font-size: 11px;
    letter-spacing: 0.35px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2px;
  }
}

.org-node .muted {
  font-size: 12px;
}

.org-node button {
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--gold);
  color: #f5f5f5;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.2px;
  margin-top: 6px;
}

.org-node.org-aie {
  border-color: rgba(106, 107, 98, 0.45);
  background: #f5f3ee;
}

.org-aie-node {
  margin-top: 24px;
}

.card {
  background: var(--cloud);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 10px 24px rgba(12, 10, 8, 0.08);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--ink-soft);
  font-family: var(--font-display);
  letter-spacing: 0.2px;
}

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

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border-radius: 18px;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.76), rgba(234, 240, 237, 0.74));
  border: 1px solid rgba(179, 196, 188, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  margin-bottom: 16px;
}

body.crm-seguros #viewTabs,
body.crm-fin #viewTabs {
  display: none !important;
}

body.crm-seguros #explorerSection > .section-head,
body.crm-fin #explorerSection > .section-head,
body.crm-seguros #companySummary,
body.crm-fin #companySummary {
  display: none !important;
}

.form-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  background: var(--cloud);
  display: grid;
  gap: 12px;
}

#clientesColumnsPanel .grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.column-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
}

.postal-options {
  margin-top: 8px;
  width: 100%;
}

.columns-toggle {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: transparent;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.form-grid.inmo-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.form-grid.inmo-grid select[multiple] {
  min-height: 110px;
}

#segurosContabilidadClientesMulti {
  min-height: 120px;
}

.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.form-grid label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  min-width: 0;
}

.form-grid .span-2 {
  grid-column: span 2;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  background: #ffffff;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.form-grid input[type="file"] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-layout {
  display: grid;
  gap: 14px;
}

.admin-summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 10px;
}

.admin-users-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.admin-user-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 4px;
}

.admin-user-item:hover {
  border-color: rgba(60, 110, 113, 0.45);
}

.admin-user-item.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(60, 110, 113, 0.18);
}

.admin-user-name {
  font-weight: 600;
  color: var(--ink);
}

.admin-user-meta {
  font-size: 12px;
  color: var(--muted);
}

.admin-detail-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  align-items: start;
}

.admin-detail-field {
  align-self: start;
}

.admin-detail-services {
  grid-column: span 2;
}

.admin-detail-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 6px;
}

.admin-detail-status {
  min-width: 220px;
}

@media (max-width: 1100px) {
  .admin-detail-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
  .admin-detail-services {
    grid-column: span 2;
  }
}

@media (max-width: 740px) {
  .admin-detail-grid {
    grid-template-columns: 1fr;
  }
  .admin-detail-services {
    grid-column: span 1;
  }
}

.admin-service-multi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.admin-service-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink);
}

.admin-service-option input {
  width: auto;
  margin: 0;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-actions button {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--gold);
  color: #f5f5f5;
  cursor: pointer;
}

.service-config {
  display: grid;
  gap: 16px;
}

.service-config-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  background: #fffaf0;
}

.service-config-card h4 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.2px;
  color: var(--ink);
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(60, 110, 113, 0.35);
  background: #ffffff;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
}

.pill-option input {
  accent-color: var(--gold);
}

.icon-action {
  border: 1px solid var(--line);
  background: #fff;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-action svg {
  width: 20px;
  height: 20px;
  fill: var(--ink);
}

.icon-action.danger svg {
  fill: #8b2f2f;
}

.stack {
  display: grid;
  gap: 16px;
}

.link-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--cloud);
}
.tab {
  border: 1px solid rgba(11, 29, 51, 0.14);
  background: rgba(255, 255, 255, 0.6);
  padding: 9px 16px;
  border-radius: 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.tab.active {
  background: linear-gradient(135deg, #0B1D33 0%, #0F2742 56%, #182F55 100%);
  color: #f5f5f5;
  border-color: rgba(242, 193, 78, 0.55);
  box-shadow: 0 10px 18px rgba(11, 29, 51, 0.22);
  transform: translateY(-1px);
}

.tab:hover {
  color: var(--ink);
  border-color: rgba(242, 193, 78, 0.38);
  box-shadow: 0 8px 16px rgba(11, 29, 51, 0.1);
}

.toolbar select,
.toolbar input {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--cloud);
  min-width: 200px;
  font-size: 13px;
}

.toolbar button {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--gold);
  color: #f5f5f5;
  letter-spacing: 0.3px;
  cursor: pointer;
}

.toolbar button.secondary {
  background: var(--charcoal);
  color: #f7f4ee;
}

.toolbar button.ghost,
.section-head .ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(60, 110, 113, 0.4);
}

.alert {
  width: min(var(--layout-max), calc(100% - (var(--layout-gutter) * 2)));
  margin: 0 auto 20px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(60, 110, 113, 0.45);
  background: linear-gradient(120deg, rgba(60, 110, 113, 0.16), rgba(255, 255, 255, 0.6));
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.alert button {
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--black);
  color: var(--gold);
  cursor: pointer;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.company-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid #e4ded4;
  border-top: 4px solid var(--gold);
  background: #fffdf8;
  box-shadow: 0 18px 36px rgba(16, 12, 8, 0.1);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.company-card-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.company-card.personal-card .rrhh-avatar {
  width: 52px;
  height: 52px;
}

.company-card h3 {
  margin: 0;
  font-size: 18px;
  color: var(--ink);
  font-weight: 600;
}

.company-card button,
.company-card .card-link {
  justify-self: start;
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--gold);
  color: #f5f5f5;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

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

.company-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 56px rgba(44, 34, 24, 0.18);
}

.company-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(120deg, #ffffff 0%, #f2ece1 100%);
  border: 1px solid #e4ded4;
  margin-bottom: 12px;
}

.company-summary h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
}

.company-summary-meta {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.workspace-kpis {
  margin-bottom: 14px;
}

.workspace-central-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(340px, 1.1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.workspace-central-layout > .span-2 {
  grid-column: 1 / -1;
}

.workspace-list-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border-radius: 16px;
  border: 1px solid rgba(60, 110, 113, 0.18);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(238, 242, 239, 0.96));
  text-align: left;
}

.workspace-list-item.is-active {
  border-color: rgba(60, 110, 113, 0.52);
  box-shadow: 0 12px 28px rgba(43, 43, 43, 0.08);
}

.workspace-list-meta {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.workspace-chip-list {
  display: grid;
  gap: 10px;
}

.workspace-chip {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(60, 110, 113, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.workspace-company-switcher {
  display: grid;
}

.workspace-company-switcher-card {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(11, 29, 51, 0.12);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 251, 0.98)),
    #fff;
}

.workspace-company-switcher-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.workspace-company-pill {
  border: 1px solid rgba(11, 29, 51, 0.14);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
}

.workspace-company-pill.is-active {
  background: linear-gradient(135deg, #0B1D33 0%, #0F2742 56%, #182F55 100%);
  color: #f5f5f5;
  border-color: rgba(242, 193, 78, 0.5);
  box-shadow: 0 10px 18px rgba(11, 29, 51, 0.16);
}

.workspace-company-chip {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.workspace-company-chip.is-active {
  border-color: rgba(242, 193, 78, 0.24);
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.95));
}

.workspace-company-chip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.workspace-chip span {
  color: var(--muted);
  font-size: 12px;
}

.workspace-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.workspace-module-explainer {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(60, 110, 113, 0.16);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(241, 247, 243, 0.98)),
    #fff;
}

.workspace-module-explainer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.workspace-suite-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.workspace-home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.workspace-home-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(60, 110, 113, 0.16);
  background:
    radial-gradient(circle at top right, rgba(95, 122, 97, 0.12), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(240, 246, 242, 0.96));
  box-shadow: 0 14px 26px rgba(43, 43, 43, 0.06);
}

.workspace-home-card[data-workspace-home-action] {
  cursor: pointer;
}

.workspace-home-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.workspace-home-card-head h4 {
  margin: 4px 0 0;
}

.workspace-home-kicker,
.workspace-home-count {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-weight: 700;
}

.workspace-home-kicker {
  background: rgba(60, 110, 113, 0.1);
  color: var(--sage);
}

.workspace-home-count {
  background: rgba(95, 122, 97, 0.12);
  color: var(--muted);
}

.workspace-home-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workspace-home-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 11px;
  border: 1px solid rgba(60, 110, 113, 0.14);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.workspace-home-chip.is-planned {
  border-style: dashed;
  color: var(--muted);
}

.workspace-home-card-actions {
  display: flex;
  justify-content: flex-start;
}

.workspace-home-detail-card {
  margin: 0 0 16px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(60, 110, 113, 0.14);
  background:
    radial-gradient(circle at top right, rgba(95, 122, 97, 0.08), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(242, 247, 244, 0.96));
  box-shadow: 0 16px 28px rgba(43, 43, 43, 0.05);
}

.workspace-home-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.workspace-home-detail-item {
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(60, 110, 113, 0.14);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.workspace-home-detail-item span {
  color: var(--muted);
  font-size: 12px;
}

.tenant-home-card {
  border-radius: 24px;
  padding: 22px;
  border: 1px solid rgba(60, 110, 113, 0.14);
  background:
    radial-gradient(circle at top right, rgba(95, 122, 97, 0.1), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(242, 247, 244, 0.96));
  box-shadow: 0 16px 28px rgba(43, 43, 43, 0.06);
}

.workspace-suite-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(60, 110, 113, 0.14);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  text-decoration: none;
}

.workspace-suite-card strong {
  color: #0b0e0d;
  font-weight: 700;
}

.workspace-suite-card .muted {
  color: var(--muted);
}

.workspace-time-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 420px);
  gap: 18px;
  align-items: start;
}

.workspace-time-layout[data-mode="employee"] {
  grid-template-columns: 1fr;
}

.workspace-time-layout[data-mode="employee"] .workspace-time-config {
  display: none;
}

.workspace-time-layout[data-mode="employee"] .workspace-time-sidebar {
  max-width: 760px;
  margin: 0 auto;
}

.workspace-motores-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.workspace-motores-nav {
  position: sticky;
  top: 18px;
  align-self: start;
}

.workspace-motores-body {
  display: grid;
  gap: 14px;
  align-content: start;
}

.workspace-rrhh-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.workspace-rrhh-sidebar,
.workspace-rrhh-panel-card {
  border: 1px solid rgba(60, 110, 113, 0.15);
  border-radius: 16px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 12px 24px rgba(43, 43, 43, 0.05);
}

.workspace-rrhh-controls {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.workspace-rrhh-sidebar-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-top: 14px;
}

.workspace-rrhh-sidebar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.workspace-rrhh-search input {
  width: 100%;
}

.workspace-rrhh-empty {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed rgba(60, 110, 113, 0.28);
  background: rgba(246, 251, 248, 0.6);
}

.workspace-rrhh-employee-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.workspace-rrhh-employee {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(43, 43, 43, 0.08);
  background: rgba(255, 255, 255, 0.94);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.workspace-rrhh-employee:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(43, 43, 43, 0.08);
  border-color: rgba(60, 110, 113, 0.24);
}

.workspace-rrhh-employee.is-active {
  border-color: rgba(60, 110, 113, 0.34);
  background: linear-gradient(135deg, rgba(246, 251, 248, 0.98), rgba(236, 244, 239, 0.95));
}

.workspace-rrhh-employee.is-inactive {
  opacity: 0.8;
}

.workspace-rrhh-employee span {
  color: var(--muted);
  font-size: 12px;
}

.workspace-rrhh-sysusers {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(43, 43, 43, 0.08);
}

.workspace-rrhh-sysusers summary {
  cursor: pointer;
  font-weight: 800;
}

.workspace-rrhh-sysuser-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.workspace-rrhh-sysuser-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(43, 43, 43, 0.08);
  background: rgba(255, 255, 255, 0.94);
}

.workspace-rrhh-sysuser-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: flex-start;
}

.workspace-rrhh-employee-kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(43, 43, 43, 0.08);
  background: rgba(253, 251, 247, 0.78);
}

.workspace-rrhh-employee-kv > div {
  display: grid;
  gap: 4px;
}

.workspace-rrhh-employee-kv span {
  font-size: 11px;
}

.workspace-rrhh-user-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 14px;
  align-items: start;
}

.workspace-rrhh-user-pass-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.workspace-rrhh-user-row {
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.workspace-rrhh-user-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(43, 43, 43, 0.08);
  border-color: rgba(60, 110, 113, 0.22);
}

.workspace-rrhh-user-row.is-active {
  border-color: rgba(60, 110, 113, 0.34);
  background: linear-gradient(135deg, rgba(246, 251, 248, 0.98), rgba(236, 244, 239, 0.95));
}

.workspace-rrhh-user-row-meta {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.workspace-rrhh-user-services {
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(43, 43, 43, 0.08);
  background: rgba(253, 251, 247, 0.6);
}

.workspace-rrhh-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.rrhh-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: #2b2b2b;
  font-size: 11px;
  font-weight: 900;
}

.rrhh-alert {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(176, 127, 0, 0.22);
  background: rgba(255, 247, 224, 0.55);
  margin: 10px 0 12px;
}

.rrhh-alert-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.workspace-rrhh-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.workspace-rrhh-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(43, 43, 43, 0.08);
  background: rgba(255, 255, 255, 0.94);
}

.workspace-rrhh-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  justify-content: flex-end;
}

.rrhh-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(60, 110, 113, 0.18);
  background: rgba(60, 110, 113, 0.1);
  color: #2b2b2b;
  font-size: 11px;
  font-weight: 700;
}

.rrhh-pill-warn {
  border-color: rgba(176, 127, 0, 0.25);
  background: rgba(255, 214, 102, 0.28);
}

.rrhh-member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.rrhh-member-card {
  --rrhh-accent: rgba(60, 110, 113, 0.85);
  --rrhh-accent-2: rgba(218, 170, 83, 0.9);
  position: relative;
  overflow: hidden;
  text-align: left;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(43, 43, 43, 0.08);
  background: linear-gradient(180deg, rgba(246, 251, 248, 0.85) 0%, rgba(255, 255, 255, 0.97) 46%, rgba(255, 255, 255, 0.96) 100%);
  box-shadow: 0 10px 22px rgba(43, 43, 43, 0.06);
  cursor: pointer;
  color: var(--ink);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.rrhh-member-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--rrhh-accent) 0%, var(--rrhh-accent-2) 100%);
  opacity: 0.9;
}

.rrhh-member-card.no-ficha {
  --rrhh-accent: rgba(176, 127, 0, 0.85);
  --rrhh-accent-2: rgba(218, 170, 83, 0.95);
  background: linear-gradient(180deg, rgba(255, 247, 224, 0.7) 0%, rgba(255, 255, 255, 0.97) 52%, rgba(255, 255, 255, 0.96) 100%);
}

.rrhh-member-card strong {
  color: var(--ink);
}

.rrhh-member-card:hover {
  border-color: rgba(60, 110, 113, 0.25);
  box-shadow: 0 18px 34px rgba(43, 43, 43, 0.09);
  transform: translateY(-2px);
}

.rrhh-member-card:active {
  transform: translateY(-1px);
}

.rrhh-member-card:focus-visible {
  outline: 3px solid rgba(218, 170, 83, 0.35);
  outline-offset: 2px;
}

.rrhh-member-card.no-ficha:hover {
  border-color: rgba(176, 127, 0, 0.3);
}

.rrhh-member-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 4px;
}

.rrhh-member-card-left {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.rrhh-member-card-title {
  min-width: 0;
}

.rrhh-member-card-title strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}

.rrhh-member-card-title .muted {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rrhh-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(60, 110, 113, 0.12);
  border: 1px solid rgba(60, 110, 113, 0.18);
  flex: 0 0 auto;
}

.rrhh-member-card .rrhh-avatar {
  width: 46px;
  height: 46px;
  box-shadow: 0 6px 14px rgba(43, 43, 43, 0.08);
}

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

.rrhh-avatar-initials {
  font-weight: 800;
  font-size: 13px;
  color: rgba(43, 43, 43, 0.78);
}

.rrhh-avatar-lg {
  width: 76px;
  height: 76px;
}

.rrhh-photo-row {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(60, 110, 113, 0.25);
  background: rgba(246, 251, 248, 0.55);
}

.rrhh-photo-actions input[type="file"] {
  margin-top: 6px;
}

.rrhh-inline-input {
  width: min(320px, 100%);
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(60, 110, 113, 0.18);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
}

.rrhh-member-metrics {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  font-size: 12px;
  color: rgba(43, 43, 43, 0.72);
}

.rrhh-member-metrics > span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rrhh-member-metrics > span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--rrhh-accent) 0%, var(--rrhh-accent-2) 100%);
  opacity: 0.55;
  flex: 0 0 auto;
}

.rrhh-member-metrics span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rrhh-vac {
  margin-top: 2px;
}

.rrhh-vac-label {
  font-size: 11px;
  color: rgba(43, 43, 43, 0.65);
  margin-bottom: 4px;
}

.rrhh-vacbar {
  height: 8px;
  border-radius: 999px;
  background: rgba(60, 110, 113, 0.12);
  overflow: hidden;
  border: 1px solid rgba(60, 110, 113, 0.16);
}

.rrhh-vacbar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  width: 0%;
}

.rrhh-member-detail {
  display: grid;
  gap: 12px;
}

.rrhh-member-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.rrhh-member-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.rrhh-service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 12px;
  margin-top: 10px;
}

.rrhh-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.rrhh-cal-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(43, 43, 43, 0.6);
  text-transform: uppercase;
  padding: 2px 6px;
}

.rrhh-cal-day {
  position: relative;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(60, 110, 113, 0.14);
  background: rgba(255, 255, 255, 0.86);
  padding: 6px 8px;
  overflow: hidden;
}

.rrhh-cal-day.is-out {
  opacity: 0.35;
}

.rrhh-cal-day.is-weekend {
  background: rgba(60, 110, 113, 0.06);
}

.rrhh-cal-day.is-approved {
  background: rgba(70, 165, 98, 0.12);
  border-color: rgba(70, 165, 98, 0.26);
}

.rrhh-cal-day.is-requested {
  background: rgba(185, 150, 60, 0.12);
  border-color: rgba(185, 150, 60, 0.26);
}

.rrhh-cal-day.is-rejected {
  background: rgba(186, 77, 70, 0.12);
  border-color: rgba(186, 77, 70, 0.26);
}

.rrhh-cal-day.is-canceled {
  background: rgba(120, 120, 120, 0.10);
  border-color: rgba(120, 120, 120, 0.22);
}

.rrhh-cal-num {
  font-size: 12px;
  font-weight: 700;
  color: rgba(43, 43, 43, 0.78);
}

.rrhh-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.rrhh-cal-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(60, 110, 113, 0.14);
  background: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  color: rgba(43, 43, 43, 0.72);
}

.rrhh-cal-chip.is-approved {
  border-color: rgba(70, 165, 98, 0.28);
  background: rgba(70, 165, 98, 0.12);
}

.rrhh-cal-chip.is-requested {
  border-color: rgba(185, 150, 60, 0.28);
  background: rgba(185, 150, 60, 0.12);
}

.rrhh-cal-chip.is-rejected {
  border-color: rgba(186, 77, 70, 0.28);
  background: rgba(186, 77, 70, 0.12);
}

.rrhh-cal-chip.is-canceled {
  border-color: rgba(120, 120, 120, 0.24);
  background: rgba(120, 120, 120, 0.10);
}

.workspace-motores-nav #workspaceEngineTabs {
  display: grid;
  gap: 10px;
  padding: 0;
  overflow: visible;
  flex-wrap: unset;
}

.workspace-motores-nav #workspaceEngineTabs .tab {
  width: 100%;
  min-width: 0;
  justify-content: flex-start;
}

.section-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

@media (max-width: 900px) {
  .workspace-motores-layout {
    grid-template-columns: 1fr;
  }
  .workspace-motores-nav {
    position: static;
  }
  .workspace-motores-nav #workspaceEngineTabs {
    display: grid;
    gap: 8px;
    padding: 0;
    overflow: visible;
  }
  .workspace-motores-nav #workspaceEngineTabs .tab {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
  }
  .workspace-rrhh-layout {
    grid-template-columns: 1fr;
  }
  .workspace-rrhh-user-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .workspace-rrhh-sysuser-row {
    flex-direction: column;
  }
  .workspace-rrhh-sysuser-actions {
    justify-content: flex-start;
  }
  .workspace-rrhh-employee-kv {
    grid-template-columns: 1fr;
  }
}

.workspace-time-config,
.workspace-time-sidebar {
  border: 1px solid rgba(60, 110, 113, 0.15);
  border-radius: 16px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 12px 24px rgba(43, 43, 43, 0.05);
}

.workspace-time-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.workspace-time-layout .workspace-time-exports {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.workspace-time-exports button {
  width: 100%;
}

.workspace-time-preview {
  border: 1px dashed rgba(60, 110, 113, 0.2);
  border-radius: 12px;
  padding: 10px;
  margin-top: 12px;
  background: rgba(245, 249, 247, 0.8);
}

.workspace-time-period-lock {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(60, 110, 113, 0.18);
  background: rgba(245, 249, 247, 0.75);
  margin: 12px 0 14px;
}

.workspace-time-period-lock strong {
  display: block;
  font-size: 13px;
}

.workspace-time-period-lock button {
  white-space: nowrap;
}

.workspace-time-sweep {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(43, 43, 43, 0.08);
  background: rgba(255, 255, 255, 0.92);
  margin-bottom: 14px;
}

.workspace-time-sweep button {
  white-space: nowrap;
}

.workspace-time-hidden {
  display: none;
}

.workspace-time-cardstack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.workspace-time-card {
  border: 1px solid rgba(43, 43, 43, 0.08);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.workspace-time-card footer {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.workspace-time-userlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workspace-time-userrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(43, 43, 43, 0.08);
  background: rgba(255, 255, 255, 0.95);
}

.workspace-time-userrow small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.workspace-time-userrow button {
  white-space: nowrap;
}

.workspace-suite-card-button {
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.workspace-suite-card-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(43, 43, 43, 0.08);
  border-color: rgba(60, 110, 113, 0.28);
}

.workspace-suite-card span,
.workspace-module-section-head span {
  color: var(--muted);
  font-size: 12px;
}

.workspace-module-section {
  display: grid;
  gap: 12px;
}

.workspace-module-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.workspace-module-section-head h4 {
  margin: 0 0 4px;
}

.workspace-module-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(60, 110, 113, 0.16);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(245, 245, 245, 0.96));
}

.workspace-module-card input {
  width: 18px;
  height: 18px;
}

.workspace-launcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.workspace-health-score-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: 16px;
  border: 1px solid rgba(60, 110, 113, 0.16);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(245, 245, 245, 0.96));
}

.workspace-health-ring {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95), rgba(214, 226, 216, 0.9));
  border: 1px solid rgba(60, 110, 113, 0.2);
  font-weight: 700;
  color: var(--text);
}

.workspace-checklist,
.workspace-module-health-list {
  display: grid;
  gap: 10px;
}

.workspace-check-item,
.workspace-module-health-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(60, 110, 113, 0.14);
  background: rgba(255, 255, 255, 0.92);
}

.workspace-check-item.is-done {
  border-color: rgba(95, 122, 97, 0.35);
  background: linear-gradient(135deg, rgba(247, 251, 248, 0.98), rgba(233, 244, 236, 0.92));
}

.workspace-module-health-meta {
  display: grid;
  gap: 4px;
  justify-items: end;
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.workspace-module-health-row.status-operativo {
  border-color: rgba(95, 122, 97, 0.35);
}

.workspace-module-health-row.status-configuracion {
  border-color: rgba(190, 153, 64, 0.35);
}

.workspace-module-health-row.status-disabled {
  opacity: 0.78;
}

.workspace-launcher-card {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(60, 110, 113, 0.16);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(245, 245, 245, 0.96));
}

.workspace-mini-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.workspace-billing-layout {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.workspace-client-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 16px;
}

.workspace-client-toolbar input {
  flex: 1 1 280px;
}

.workspace-billing-list {
  display: grid;
  gap: 10px;
}

.workspace-billing-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(60, 110, 113, 0.14);
  background: rgba(255, 255, 255, 0.92);
}

.workspace-billing-meta {
  display: grid;
  gap: 4px;
  justify-items: end;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.workspace-billing-meta .button-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.workspace-client-row {
  cursor: pointer;
}

.workspace-client-row.is-active {
  border-color: rgba(60, 110, 113, 0.38);
  box-shadow: 0 10px 24px rgba(43, 43, 43, 0.06);
}

.workspace-client-detail {
  display: grid;
  gap: 14px;
}

.workspace-client-hero {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(60, 110, 113, 0.16);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(244, 246, 244, 0.96));
}

.workspace-client-hero-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.workspace-client-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.workspace-client-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workspace-client-meta span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(60, 110, 113, 0.08);
  color: var(--muted);
  font-size: 12px;
}

.workspace-client-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.workspace-client-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(60, 110, 113, 0.14);
  background: rgba(255, 255, 255, 0.92);
}

.workspace-client-card h4 {
  margin: 0;
}

.workspace-client-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.workspace-gestoria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.workspace-gestoria-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.workspace-gestoria-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(60, 110, 113, 0.14);
  background: rgba(255, 255, 255, 0.92);
}

.workspace-gestoria-card h4 {
  margin: 0;
}

.form-grid select[multiple] {
  min-height: 144px;
}

.workspace-mini-kpi {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(60, 110, 113, 0.14);
  background: rgba(255, 255, 255, 0.92);
}

.workspace-mini-kpi span {
  color: var(--muted);
  font-size: 12px;
}

.workspace-context-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(60, 110, 113, 0.16);
  background: rgba(248, 244, 236, 0.92);
}

.workspace-summary-list,
.workspace-document-list {
  display: grid;
  gap: 10px;
}

.workspace-summary-row,
.workspace-document-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(60, 110, 113, 0.14);
  background: rgba(255, 255, 255, 0.92);
}

.workspace-summary-metrics,
.workspace-document-meta {
  display: grid;
  gap: 4px;
  justify-items: end;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.workspace-document-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.workspace-document-total {
  font-weight: 700;
}

.workspace-document-suggestion {
  margin-top: 6px;
  font-size: 12px;
  color: var(--brand-700);
  font-weight: 600;
}

.portal-public-shell {
  display: grid;
  gap: 18px;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 100%;
}

@media (max-width: 980px) {
  .workspace-central-layout {
    grid-template-columns: 1fr;
  }

  .workspace-list-item,
  .workspace-module-card,
  .workspace-launcher-card,
  .workspace-health-score-card {
    padding: 13px 14px;
    border-radius: 15px;
  }

  .workspace-client-columns,
  .workspace-gestoria-columns {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .workspace-billing-row,
  .workspace-check-item,
  .workspace-module-health-row,
  .workspace-summary-row,
  .workspace-document-row,
  .workspace-document-head {
    flex-direction: column;
  }

  .workspace-billing-meta,
  .workspace-module-health-meta,
  .workspace-summary-metrics,
  .workspace-document-meta {
    justify-items: start;
    text-align: left;
  }

  .workspace-client-toolbar {
    flex-wrap: wrap;
  }

  .workspace-client-toolbar input {
    flex-basis: 100%;
  }

  .workspace-client-hero-head {
    flex-direction: column;
  }

  .workspace-client-actions {
    width: 100%;
  }

  .workspace-client-actions > * {
    flex: 1 1 180px;
  }
}

.map-box {
  display: grid;
  gap: 8px;
  min-height: 140px;
}

.map-box-image {
  width: 100%;
  min-height: 220px;
  object-fit: cover;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 251, 244, 0.72);
}

.map-box-embed {
  width: 100%;
  min-height: 220px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 251, 244, 0.72);
}

.map-box-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.map-box-empty {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 140px;
  padding: 16px;
  border-radius: 14px;
  border: 1px dashed rgba(130, 76, 69, 0.18);
  background: rgba(255, 251, 244, 0.72);
}

.crm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid #e4ded4;
  background: #fffdf8;
}

.crm-header-stack {
  flex-wrap: wrap;
}

.crm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.crm-actions .secondary {
  background: var(--charcoal);
  color: #f7f4ee;
}

.crm-workspace-shell {
  display: grid;
  gap: 16px;
}

.crm-workspace-tabs {
  position: sticky;
  top: 14px;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(130, 76, 69, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 251, 244, 0.98), rgba(244, 238, 227, 0.96)),
    #fff;
}

.crm-workspace-tabs .tab {
  min-width: 120px;
}

#workspaceEngineTabs {
  position: static;
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  padding: 6px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}

#workspaceEngineTabs .tab {
  flex: 0 0 auto;
  min-width: max-content;
  scroll-snap-align: start;
}

.crm-workspace-view {
  display: grid;
  gap: 14px;
  align-content: start;
}

.crm-workspace-view + .crm-workspace-view {
  margin-top: -2px;
}

.crm-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 14px;
}

.crm-ops-split {
  grid-template-columns: minmax(0, 2.1fr) minmax(320px, 0.95fr);
}

.crm-summary-secondary {
  margin-top: 14px;
  margin-bottom: 14px;
}

.fin-workflow-stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.fin-stage-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(60, 110, 113, 0.16);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(238, 242, 239, 0.98));
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.fin-stage-card strong {
  font-size: 15px;
}

.fin-stage-card span {
  color: var(--muted);
  font-size: 12px;
}

.fin-stage-card.active {
  border-color: rgba(60, 110, 113, 0.42);
  box-shadow: 0 12px 26px rgba(60, 110, 113, 0.14);
}

tr.is-selected td {
  background: rgba(60, 110, 113, 0.08);
}

.crm-focus-card {
  display: grid;
  gap: 14px;
}

.crm-quick-actions,
.crm-focus-list {
  display: grid;
  gap: 10px;
}

.crm-quick-action,
.crm-focus-link {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(130, 76, 69, 0.12);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 243, 236, 0.98)),
    #fff;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.crm-quick-action strong,
.crm-focus-link {
  font-size: 14px;
  font-weight: 700;
}

.crm-quick-action span {
  color: var(--muted);
  font-size: 12px;
}

.crm-resumen-link span {
  display: block;
}

.crm-resumen-card {
  width: 100%;
}

.crm-quick-action:hover,
.crm-focus-link:hover,
.crm-quick-action:focus-visible,
.crm-focus-link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(60, 110, 113, 0.4);
  box-shadow: 0 12px 26px rgba(16, 12, 8, 0.1);
  outline: none;
}

.crm-kpis .kpi-card {
  display: grid;
  gap: 8px;
  border-left: 3px solid rgba(60, 110, 113, 0.6);
}

.gestoria-renta-banner {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(60, 110, 113, 0.18);
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(247, 232, 0, 0.18), transparent 28%),
    linear-gradient(135deg, #fffef7 0%, #f5efe4 52%, #eef4f8 100%);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(18, 16, 12, 0.08);
}

.gestoria-renta-banner:hover,
.gestoria-renta-banner:focus-visible {
  border-color: rgba(60, 110, 113, 0.45);
  box-shadow: 0 18px 34px rgba(18, 16, 12, 0.14);
  transform: translateY(-1px);
  outline: none;
}

.gestoria-renta-banner-mark {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.gestoria-renta-banner-gov {
  width: 108px;
  height: 30px;
  border-radius: 6px;
  background-image: url("../assets/logos/hacienda-sprite-07.png");
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 430px auto;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.gestoria-renta-banner-aeat {
  display: grid;
  gap: 2px;
  font-family: var(--font-ui);
  color: #34459b;
  line-height: 1;
}

.gestoria-renta-banner-aeat span {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gestoria-renta-banner-aeat strong {
  font-size: 22px;
  color: #34459b;
}

.gestoria-renta-banner-copy {
  display: grid;
  gap: 6px;
}

.gestoria-renta-banner-copy h3 {
  margin: 0;
  font-size: 28px;
}

.gestoria-renta-banner-copy p {
  margin: 0;
  color: var(--muted);
  max-width: 56ch;
}

.portal-public-shell {
  display: grid;
  gap: 18px;
}

.workspace-automation-logs {
  margin-top: 18px;
}

.gestoria-renta-banner-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--charcoal);
  color: #f7f4ee;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .gestoria-renta-banner {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .gestoria-renta-banner-mark {
    flex-wrap: wrap;
  }

  .crm-summary-grid {
    grid-template-columns: 1fr;
  }

  .inmueble-summary-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .inmueble-summary-footer {
    grid-template-columns: 1fr;
  }

  .inmueble-summary-badges {
    max-width: none;
    justify-content: flex-start;
  }

  .workspace-kpis .kpi-grid,
  .crm-kpis .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-mini-kpis,
  .workspace-gestoria-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-gestoria-columns,
  .workspace-client-columns,
  .workspace-module-grid,
  .workspace-launcher-grid,
  .workspace-suite-summary {
    grid-template-columns: 1fr;
  }

  .workspace-company-chip {
    grid-template-columns: 1fr;
  }

  .workspace-company-chip-actions,
  .workspace-company-switcher-actions {
    justify-content: flex-start;
  }

  .workspace-client-meta span {
    width: 100%;
  }

  .crm-workspace-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 8px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .crm-workspace-tabs .tab {
    flex: 0 0 auto;
    min-width: max-content;
    scroll-snap-align: start;
  }
}

.crm-kpis .kpi-clickable {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.crm-kpis .kpi-clickable:hover {
  transform: translateY(-1px);
  border-color: rgba(60, 110, 113, 0.5);
  box-shadow: 0 12px 24px rgba(18, 16, 12, 0.12);
}

.crm-kpis .kpi-clickable:focus-visible {
  outline: 2px solid rgba(60, 110, 113, 0.65);
  outline-offset: 2px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--ink);
}

#segurosKpis .kpi-value,
#segurosRamoKpis .kpi-value {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
}

.crm-split {
  display: grid;
  grid-template-columns: minmax(0, 2.35fr) minmax(340px, 1fr);
  gap: 14px;
}

.crm-recent {
  display: grid;
  gap: 10px;
}

.crm-recent-list {
  display: grid;
  gap: 10px;
}

.crm-recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  cursor: pointer;
  text-align: left;
}

.crm-recent-item:hover {
  border-color: rgba(60, 110, 113, 0.6);
  box-shadow: 0 10px 22px rgba(16, 12, 8, 0.12);
}

.crm-mini-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.crm-mini-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fffdf8;
  text-align: left;
  cursor: pointer;
}

.crm-mini-card:hover {
  border-color: rgba(60, 110, 113, 0.6);
  box-shadow: 0 12px 22px rgba(16, 12, 8, 0.12);
}

.crm-mini-card h4 {
  margin: 0;
  font-size: 14px;
}

.crm-mini-meta {
  display: grid;
  gap: 6px;
  justify-items: end;
  text-align: right;
  font-size: 12px;
}

.crm-mini-meta strong {
  font-size: 22px;
  line-height: 1;
}

.crm-resumen-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  margin-bottom: 14px;
}

.crm-resumen-toolbar label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.crm-resumen-toolbar select,
.crm-resumen-toolbar input {
  width: 100%;
}

.crm-resumen-toolbar button {
  justify-self: end;
  height: 42px;
  border-radius: 14px;
}

.crm-resumen-toolbar .crm-resumen-date.hidden {
  display: none;
}

.inmueble-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.inmueble-catalog-card {
  display: grid;
  gap: 12px;
  text-align: left;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 243, 236, 0.96)),
    #fff;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.inmueble-catalog-card:hover {
  transform: translateY(-1px);
  border-color: rgba(60, 110, 113, 0.45);
  box-shadow: 0 16px 34px rgba(16, 12, 8, 0.12);
}

.inmueble-catalog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.inmueble-catalog-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.inmueble-catalog-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.inmueble-catalog-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.inmueble-catalog-price {
  font-size: 18px;
  font-weight: 700;
  color: #1f3e39;
}

.inmueble-catalog-owners {
  font-size: 12px;
  color: var(--ink);
  padding-top: 10px;
  border-top: 1px solid rgba(130, 76, 69, 0.12);
}

.inmueble-profile {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
  gap: 10px;
  margin-bottom: 12px;
  align-items: start;
}

.inmueble-profile-top {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
}

.inmueble-profile-side {
  display: grid;
  gap: 10px;
}

.inmueble-map-card {
  display: grid;
  gap: 8px;
}

.inmueble-data-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.85fr);
  gap: 10px;
  align-items: start;
}

.inmueble-summary-card,
.inmueble-fact-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 251, 244, 0.98), rgba(245, 240, 231, 0.98)),
    #fff;
}

.inmueble-summary-card {
  padding: 12px 14px;
  display: grid;
  gap: 8px;
  overflow: hidden;
}

.inmueble-summary-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.inmueble-summary-top h3 {
  margin: 2px 0 4px;
  font-size: 17px;
  line-height: 1.2;
}

.inmueble-summary-kicker {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a6c58;
  font-weight: 700;
}

.inmueble-summary-subline,
.inmueble-summary-pricing {
  color: var(--ink);
}

.inmueble-summary-subline {
  font-size: 12px;
}

.inmueble-summary-badges,
.inmueble-summary-owners {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inmueble-summary-badges {
  justify-content: flex-end;
  align-items: flex-start;
  max-width: 34%;
}

.inmueble-badge,
.inmueble-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.inmueble-badge {
  border: 1px solid rgba(130, 76, 69, 0.16);
  background: rgba(255, 255, 255, 0.72);
  color: #5a3a34;
}

.inmueble-badge.verifika2 {
  gap: 6px;
  background: rgba(242, 193, 78, 0.16);
  border-color: rgba(242, 193, 78, 0.55);
  color: var(--ink);
  letter-spacing: 0.03em;
}

.inmueble-badge.verifika2 img {
  width: 14px;
  height: 14px;
  display: block;
}

.inmueble-badge.verifika2.compact {
  padding: 3px 7px;
  font-size: 9px;
}

.inmueble-badge.tone-accent {
  background: #824c45;
  color: #fff;
  border-color: #824c45;
}

.inmueble-badge.tone-soft {
  background: #ece4d8;
  color: #634c3f;
}

.inmueble-chip {
  background: #f3ede3;
  color: #3a2d28;
  border: 1px solid rgba(130, 76, 69, 0.1);
}

.inmueble-summary-pricing {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.inmueble-summary-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.inmueble-summary-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.inmueble-summary-metric {
  display: grid;
  gap: 2px;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid rgba(130, 76, 69, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.inmueble-summary-metric span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.inmueble-summary-metric strong {
  font-size: 12px;
  color: var(--ink);
}

.inmueble-summary-footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.inmueble-summary-ownerline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(130, 76, 69, 0.1);
  background: rgba(255, 255, 255, 0.74);
}

.inmueble-summary-ownerline strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.inmueble-summary-ownerlabel {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7a6c58;
}

.inmueble-owner-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f7f0e4;
  border: 1px solid rgba(130, 76, 69, 0.08);
}

.inmueble-owner-avatar {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #824c45;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.inmueble-owner-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.inmueble-owner-copy strong {
  font-size: 12px;
  color: var(--ink);
}

.inmueble-owner-copy span {
  font-size: 10px;
  color: var(--muted);
}

.inmueble-facts-panel {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inmueble-fact-card {
  padding: 9px 10px;
}

.inmueble-fact-card h4 {
  margin: 0 0 6px;
  font-size: 12px;
  color: #5a3a34;
}

.inmueble-fact-list {
  display: grid;
  gap: 4px;
}

.inmueble-fact-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 10px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(130, 76, 69, 0.08);
}

.inmueble-fact-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.inmueble-fact-row span {
  color: var(--muted);
}

.inmueble-fact-row strong {
  text-align: right;
  color: var(--ink);
}

.inmueble-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.inmueble-media-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  text-decoration: none;
  color: inherit;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.inmueble-media-item:hover {
  transform: translateY(-1px);
  border-color: rgba(60, 110, 113, 0.45);
  box-shadow: 0 12px 22px rgba(16, 12, 8, 0.12);
}

.inmueble-media-item img {
  width: 100%;
  height: 128px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  background: rgba(60, 110, 113, 0.06);
}

.inmueble-media-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.inmueble-media-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1024px) {
  .inmueble-profile-top,
  .inmueble-data-workspace {
    grid-template-columns: 1fr;
  }

  .inmueble-facts-panel,
  .inmueble-summary-footer,
  .crm-ops-split {
    grid-template-columns: 1fr;
  }
}

.crm-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(60, 110, 113, 0.5);
  color: var(--ink);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: rgba(60, 110, 113, 0.12);
}

#crmInmuebleSearch,
#crmInmuebleSearchMirror {
  min-width: 300px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.editable-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(60, 110, 113, 0.12);
  border-radius: 16px;
  background: linear-gradient(180deg, #fffdfa 0%, #ffffff 100%);
  box-shadow: none;
}

.editable-card h3 {
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 14px;
}

.editable-card--location,
.editable-card--catastro {
  background: linear-gradient(180deg, #fffdfa 0%, #f8f3ea 100%);
}

.editable-card--money {
  background: linear-gradient(180deg, #fffdfa 0%, #f6f2e9 100%);
}

.editable-card--technical {
  background: #fbfaf7;
  border-style: dashed;
}

.editable-card--owners {
  grid-column: 1 / -1;
}

.inline-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
}

.inline-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(60, 110, 113, 0.18);
}

.admin-service-select {
  min-width: 180px;
  min-height: 110px;
}

.admin-service-inline {
  display: grid;
  gap: 6px 10px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  max-height: none;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #ffffff;
}

.inline-list {
  display: grid;
  gap: 8px;
}

.renta-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.renta-card {
  width: 100%;
  text-align: left;
  background: linear-gradient(180deg, #fffdfa 0%, #f6f1e7 100%);
  color: var(--ink);
  border: 1px solid rgba(60, 110, 113, 0.18);
  box-shadow: none;
  padding: 16px;
}

.renta-card:hover {
  box-shadow: 0 12px 26px rgba(12, 10, 8, 0.12);
}

.renta-card.is-selected {
  border-color: rgba(60, 110, 113, 0.5);
  box-shadow: 0 16px 28px rgba(60, 110, 113, 0.14);
}

.renta-card-top,
.renta-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.renta-card h4 {
  margin: 10px 0 2px;
}

.renta-card-meta {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.renta-result {
  margin-top: 12px;
  font-weight: 700;
}

.renta-result.negative {
  color: #1f7a4c;
}

.renta-result.positive {
  color: #b33a2f;
}

.renta-result.neutral {
  color: var(--ink);
}

.renta-detail-card {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdfa;
}

.gestoria-renta-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.gestoria-renta-overview-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(60, 110, 113, 0.18);
  background: linear-gradient(180deg, #fffdfa 0%, #f5efe4 100%);
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(12, 10, 8, 0.08);
  cursor: pointer;
}

.gestoria-renta-overview-card:hover,
.gestoria-renta-overview-card:focus-visible {
  border-color: rgba(60, 110, 113, 0.46);
  box-shadow: 0 18px 32px rgba(12, 10, 8, 0.14);
  outline: none;
}

.gestoria-renta-overview-card h4 {
  margin: 0;
  font-size: 18px;
}

.gestoria-renta-overview-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.gestoria-renta-overview-top > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gestoria-renta-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.gestoria-renta-overview-grid span,
.gestoria-renta-overview-meta {
  font-size: 12px;
}

.gestoria-renta-overview-grid strong {
  display: block;
  margin-top: 3px;
}

.gestoria-renta-overview-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
}

.gestoria-renta-overview-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.renta-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 14px;
}

.renta-detail-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 10px 12px;
}

.inline-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  min-width: 0;
  flex-wrap: wrap;
}

.inline-row select,
.inline-row .inline-input {
  flex: 1 1 220px;
  min-width: 0;
}

.company-cell {
  white-space: nowrap;
}

.company-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fffdfa;
  font-size: 12px;
}

.company-badge.compact {
  padding: 2px 6px;
  gap: 6px;
}

.company-logo {
  display: block;
  width: auto;
  height: 24px;
  max-width: 48px;
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
  image-rendering: -webkit-optimize-contrast;
}

.company-badge.compact .company-logo {
  height: 18px;
  max-width: 34px;
}

.company-initials {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f2eadc;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
}

.company-badge.compact .company-initials {
  width: 16px;
  height: 16px;
  font-size: 9px;
}

.company-name {
  color: inherit;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.ramo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f7f1e6;
  font-size: 12px;
  font-weight: 600;
}

.ramo-icon {
  font-size: 13px;
  line-height: 1;
}

.inline-row button {
  padding: 6px 10px;
  border-radius: 999px;
  border: none;
  background: var(--charcoal);
  color: #f7f4ee;
  cursor: pointer;
}

.inline-row button.secondary {
  background: transparent;
  color: var(--charcoal);
  border: 1px solid var(--line);
}

.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.catastro-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.catastro-actions .catastro-button {
  width: 100%;
  min-width: 0;
  justify-content: flex-start;
}

.table-tools {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 8px 0 12px;
}

.table-tools input {
  max-width: 340px;
}

.form-section {
  grid-column: 1 / -1;
  display: grid;
  gap: 2px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(60, 110, 113, 0.12);
}

.form-section strong {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--ink);
}

.form-section span {
  font-size: 12px;
  color: var(--muted);
}

.editable-field-hint {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(191, 153, 74, 0.14);
  color: #8b6a1d;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.editable-card-help {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.editable-grid--inmueble,
.editable-grid--captacion {
  gap: 12px;
}

.editable-grid--inmueble {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.editable-grid--inmueble .form-section,
.editable-grid--captacion .form-section {
  margin-top: 4px;
}

.editable-grid--captacion {
  grid-template-columns: 1fr;
}

.editable-grid--captacion .editable-card:not(.editable-card--owners) {
  background: #fff;
}

@media (max-width: 900px) {
  .editable-grid--inmueble {
    grid-template-columns: 1fr;
  }
}

.agenda-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.agenda-view-controls,
.agenda-range-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.agenda-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}

.agenda-view-controls button,
.agenda-range-controls select,
.agenda-filters select {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
}

.agenda-view-controls button.active {
  background: var(--charcoal);
  color: #f7f4ee;
  border-color: var(--charcoal);
}

.agenda-create {
  padding: 6px 12px;
  border-radius: 999px;
  border: none;
  background: var(--charcoal);
  color: #f7f4ee;
  cursor: pointer;
  font-size: 13px;
}

.agenda-body {
  display: grid;
  gap: 12px;
}

.agenda-split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

.agenda-side {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #ffffff;
  display: grid;
  gap: 8px;
}

.agenda-side-title {
  font-weight: 600;
}

.agenda-month-grid {
  display: grid;
  gap: 8px;
}

.agenda-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.agenda-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.agenda-day {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  background: #ffffff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 64px;
}

.agenda-day.day-status-pendiente {
  background: #fff9ec;
}

.agenda-day.day-status-en-curso {
  background: #f7efe8;
}

.agenda-day.day-status-en-espera {
  background: #fbf6e9;
}

.agenda-day.day-status-hecho,
.agenda-day.day-status-completado,
.agenda-day.day-status-finalizado {
  background: #edf5ef;
}

.agenda-day.day-status-cancelado {
  background: #f8ecec;
}

.agenda-day.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(60, 110, 113, 0.18);
}

.agenda-day.empty {
  background: transparent;
  border: none;
  cursor: default;
}

.agenda-day .day-number {
  font-weight: 600;
}

.agenda-day .day-count {
  font-size: 12px;
  color: var(--muted);
}

.agenda-day-list {
  display: grid;
  gap: 10px;
}

.agenda-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: 8px;
}

.agenda-week-day {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #ffffff;
  display: grid;
  gap: 8px;
  min-height: 140px;
}

.agenda-week-title {
  font-weight: 600;
  font-size: 13px;
}

.agenda-week-row {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 8px;
  font-size: 12px;
}

.agenda-week-hours {
  display: grid;
  gap: 6px;
}

.agenda-day-hours {
  display: grid;
  gap: 6px;
}

.agenda-week-hour {
  border-top: 1px dashed var(--line);
  padding-top: 6px;
  display: grid;
  gap: 4px;
}

.agenda-hour-label {
  font-size: 11px;
  color: var(--muted);
}

.agenda-hour-slot {
  display: grid;
  gap: 4px;
}

.agenda-day-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.agenda-event {
  position: relative;
}

.agenda-event.estado-pendiente {
  border-left: 4px solid #d7b04b;
  background: #fff9ec;
}

.agenda-event.estado-en-curso {
  border-left: 4px solid #9b6b4a;
  background: #f7efe8;
}

.agenda-event.estado-en-espera {
  border-left: 4px solid #b7a36d;
  background: #fbf6e9;
}

.agenda-event.estado-hecho,
.agenda-event.estado-completado,
.agenda-event.estado-finalizado {
  border-left: 4px solid #4f6f52;
  background: #edf5ef;
}

.agenda-event.estado-cancelado {
  border-left: 4px solid #8c4b4b;
  background: #f8ecec;
}

.agenda-event.estado-en-curso .agenda-title,
.agenda-event.estado-pendiente .agenda-title,
.agenda-event.estado-en-espera .agenda-title,
.agenda-event.estado-hecho .agenda-title,
.agenda-event.estado-completado .agenda-title,
.agenda-event.estado-finalizado .agenda-title,
.agenda-event.estado-cancelado .agenda-title {
  font-weight: 600;
}

.agenda-open-client {
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f7f4ee;
  font-size: 11px;
  cursor: pointer;
}

.agenda-link {
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  font-size: 11px;
  cursor: pointer;
}

.agenda-reminders {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff7e0;
  display: grid;
  gap: 6px;
}

.agenda-reminders-list {
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal.hidden {
  display: none;
}

.modal-content {
  width: min(720px, 92vw);
  background: #ffffff;
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  display: grid;
  gap: 12px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body textarea {
  width: 100%;
}

.modal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.cliente-seguro-modal-content {
  max-height: 80vh;
  overflow: auto;
}

.hipoteca-ficha-modal-content {
  width: min(1100px, 96vw);
  max-height: 86vh;
  overflow: auto;
}

.hipoteca-bank-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hipoteca-bank-logo {
  display: block;
  width: auto;
  height: 28px;
  min-width: 52px;
  max-width: 72px;
  border-radius: 10px;
  object-fit: contain;
  object-position: center;
  background: #fff;
  border: 1px solid var(--line);
  padding: 4px 6px;
  image-rendering: -webkit-optimize-contrast;
}

.hipoteca-bank-badge {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #824c45;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.cliente-seguro-meta {
  display: grid;
  gap: 6px;
}

.cliente-seguro-meta-line {
  font-size: 14px;
  color: var(--ink);
}

.cliente-seguro-highlights {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: grid;
  gap: 8px;
}

.cliente-seguro-highlights h4 {
  margin: 0;
}

.cliente-seguro-highlights ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.cliente-seguro-actions {
  margin-top: 12px;
}

.cliente-seguro-actions h4 {
  margin: 0 0 8px;
}

.cliente-seguro-actions-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  align-items: center;
}

.cliente-mini-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.cliente-mini-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.cliente-mini-chart {
  display: grid;
  gap: 8px;
}

.cliente-mini-chart-row {
  display: grid;
  grid-template-columns: 120px 1fr 90px;
  align-items: center;
  gap: 8px;
}

.cliente-mini-chart-label {
  font-size: 12px;
  color: var(--muted);
}

.cliente-mini-chart-track {
  height: 10px;
  border-radius: 999px;
  background: #eef1f8;
  overflow: hidden;
}

.cliente-mini-chart-fill {
  height: 100%;
  border-radius: 999px;
}

.cliente-mini-chart-value {
  font-size: 12px;
  text-align: right;
}

.cliente-ramo-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.cliente-ramo-kpi-card {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  cursor: pointer;
}

.cliente-ramo-kpi-card .kpi-label {
  color: #2B2B2B;
  font-weight: 700;
}

.cliente-ramo-kpi-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(60, 110, 113, 0.2);
}

.cliente-ramo-listado {
  margin-top: 12px;
}

.cliente-ramo-listado h5 {
  margin: 0 0 8px;
}

.agenda-time {
  font-weight: 600;
}

.agenda-info .agenda-title {
  font-weight: 600;
}

.agenda-info .agenda-meta,
.agenda-info .agenda-notes {
  font-size: 12px;
  color: var(--muted);
}

.agenda-year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.agenda-year-cell {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
}

.agenda-year-cell .month-name {
  font-weight: 600;
}

.agenda-year-cell .month-count {
  font-size: 12px;
  color: var(--muted);
}

.details {
  margin-top: 12px;
}

.details textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: #ffffff;
  color: var(--ink);
  resize: vertical;
}

.crm-kpis .card {
  display: grid;
  gap: 6px;
}

.crm-pipeline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.crm-pipeline button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.2px;
}

.crm-pipeline button.active {
  background: var(--gold);
  color: #f5f5f5;
  border-color: var(--gold);
}

.crm-pipeline button.stage-prospecto {
  border-color: #d8c8ad;
}

.crm-pipeline button.stage-contactado {
  border-color: #7e776d;
}

.crm-pipeline button.stage-visita-valoracion {
  border-color: #38BDF8;
}

.crm-pipeline button.stage-negociacion {
  border-color: #6b4c3b;
}

.crm-pipeline button.stage-encargo-firmado {
  border-color: #2f4f3e;
}

.crm-pipeline button.stage-publicado {
  border-color: #2f3d4e;
}

.crm-pipeline button.stage-perdido {
  border-color: #b0a9a0;
  color: var(--muted);
}

.crm-kanban {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 12px;
  scroll-snap-type: x proximity;
}

.crm-kanban-column {
  flex: 0 0 280px;
  min-width: 280px;
  max-width: 280px;
  min-height: 220px;
  background: #fffdf8;
  border: 1px solid #e4ded4;
  border-radius: 16px;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 10px;
  align-self: flex-start;
  scroll-snap-align: start;
}

.crm-kanban-column h4 {
  margin: 0;
  font-size: 13px;
  color: var(--ink);
}

.crm-kanban-column > .crm-kanban-card:last-child {
  margin-bottom: 0;
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.pipeline-col {
  background: #fffaf1;
  border: 1px solid #ede2d5;
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.pipeline-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--ink);
}

.pipeline-head span {
  background: var(--gold-soft);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.pipeline-list {
  display: grid;
  gap: 10px;
}

.pipeline-card {
  border: 1px solid #e5dbc9;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 4px;
}

.pipeline-card h5 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.input-with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-with-icon input {
  flex: 1;
}

.icon-btn {
  border: 1px solid #e4ded4;
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}

.crm-kanban-card {
  border: 1px solid #eee6db;
  border-radius: 12px;
  padding: 10px;
  background: #ffffff;
  font-size: 12px;
  display: grid;
  gap: 6px;
  cursor: default;
  box-shadow: 0 8px 18px rgba(34, 28, 20, 0.04);
}

.crm-kanban-titleline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.crm-kanban-titleline strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-kanban-handle {
  width: 42px;
  height: 18px;
  border-radius: 999px;
  border: 1px dashed rgba(60, 110, 113, 0.35);
  background:
    radial-gradient(circle, rgba(60, 110, 113, 0.25) 0%, rgba(60, 110, 113, 0) 65%),
    rgba(255, 255, 255, 0.6);
  cursor: grab;
}

.crm-timeline {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.crm-timeline-item {
  position: relative;
  padding-left: 18px;
  border-left: 2px solid #e6dccb;
}

.crm-timeline-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
}

.crm-timeline-item .title {
  font-weight: 600;
  color: var(--ink);
}

.crm-timeline-item .meta {
  font-size: 12px;
  color: var(--muted);
}

.crm-timeline-item .notes {
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink);
}

.crm-kanban-column.drag-over {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(215, 176, 76, 0.15);
}

.dashboard {
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #e3ddd3;
  background: linear-gradient(140deg, #fffdfa 0%, #f2ede2 100%);
}

.dashboard.hidden {
  display: none;
}

.dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.dashboard-head h3 {
  margin: 0;
  font-size: 18px;
  color: var(--ink);
}

.dashboard-kpis .card {
  background: #fffef9;
}

.dashboard-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.dashboard-controls label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.dashboard-controls select {
  min-width: 140px;
}

.dashboard-kpis .card h3 {
  font-size: 15px;
}

.dashboard-kpis .kpi-clickable {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.dashboard-kpis .kpi-clickable:hover {
  transform: translateY(-1px);
  border-color: rgba(60, 110, 113, 0.5);
  box-shadow: 0 12px 24px rgba(18, 16, 12, 0.12);
}

.dashboard-kpis .kpi-clickable:focus-visible {
  outline: 2px solid rgba(60, 110, 113, 0.65);
  outline-offset: 2px;
}

.dashboard-charts {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.chart-card {
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 250, 248, 0.92) 100%),
    var(--cloud);
  border-radius: 18px;
  border: 1px solid rgba(190, 206, 198, 0.85);
  border-top: 3px solid rgba(60, 110, 113, 0.32);
  padding: 14px 16px 16px;
  min-height: 330px;
  display: grid;
  gap: 10px;
  overflow: hidden;
  box-shadow: 0 12px 26px rgba(18, 16, 12, 0.08);
}

.chart-card h4 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-family: var(--font-display);
  letter-spacing: 0.2px;
  font-weight: 600;
}

.chart-card canvas {
  display: block;
  width: 100%;
  height: 275px;
  border-radius: 10px;
}

/* CRM resumen: charts más compactos para no comerse la pantalla. */
#crmResumenYtdBoard .chart-card {
  min-height: 290px;
}

#crmResumenYtdBoard .chart-card canvas {
  height: 230px;
}

/* Seguros dashboard: more room for labels and values */
#fincasDashboardSection .dashboard-charts {
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}

#fincasDashboardSection .chart-card {
  min-height: 410px;
  padding: 16px 18px 18px;
}

#fincasDashboardSection .chart-card canvas {
  height: 340px;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  background: rgba(26, 23, 20, 0.92);
  color: #f8f4ec;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  pointer-events: none;
  min-width: 120px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.ocr-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.ocr-badge.alta {
  background: #e3f3e8;
  color: #2f7a50;
}

.ocr-badge.media {
  background: #fff1d6;
  color: #c4871c;
}

.ocr-badge.baja {
  background: #fde6e3;
  color: #b33b2e;
}

.ocr-compare-content {
  max-width: 720px;
}

.ocr-compare-summary {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.ocr-compare-grid {
  display: grid;
  gap: 8px;
}

.ocr-compare-row {
  display: grid;
  grid-template-columns: 140px 1fr 1fr;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fffdf8;
  font-size: 12px;
}

.ocr-compare-label {
  font-weight: 600;
  color: var(--ink);
}

.ocr-compare-val {
  color: var(--ink-soft);
  word-break: break-word;
}

.progress-card {
  display: grid;
  gap: 8px;
  padding: 8px 6px 4px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.progress-bar {
  height: 12px;
  border-radius: 999px;
  background: #efe7d6;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #F2C14E, #0B1D33);
  border-radius: 999px;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.3;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
}

table input,
table select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  background: #ffffff;
}

table button {
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--black);
  color: var(--gold);
  cursor: pointer;
  font-size: 12px;
}

th,
td {
  border-bottom: 1px solid #ece6db;
  padding: 6px 8px;
  text-align: left;
}

th {
  background: linear-gradient(90deg, #f7f1e6 0%, #efe8db 100%);
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  font-size: 10px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

tbody tr:nth-child(even) {
  background: #faf7f1;
}

tbody tr:hover {
  background: #f0f6f4;
}

#tableContainer,
[id$="Table"] {
  max-width: 100%;
  overflow-x: auto;
}

#tableContainer table,
[id$="Table"] table {
  min-width: 920px;
}

body.density-compact .form-card {
  padding: 14px 16px;
}

body.density-compact .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

body.density-compact .crm-kpis.grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

body.density-compact .crm-split {
  grid-template-columns: minmax(0, 2.9fr) minmax(320px, 1fr);
  gap: 12px;
}

body.density-compact .table-tools input {
  max-width: 420px;
}

body.density-compact table {
  font-size: 11.5px;
  line-height: 1.2;
}

body.density-compact th,
body.density-compact td {
  padding: 4px 6px;
}

body.density-compact #tableContainer table,
body.density-compact [id$="Table"] table {
  min-width: 980px;
}

/* BDT Hipotecas: vista compacta específica */
#hipotecaBdtPanel .section-head h3 {
  font-size: 20px;
}

#hipotecaBdtPanel .section-head .muted {
  font-size: 12px;
}

#hipotecaBdtPanel .crm-actions {
  gap: 6px;
}

#hipotecaBdtPanel .crm-actions input,
#hipotecaBdtPanel .crm-actions select,
#hipotecaBdtPanel .crm-actions button {
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 10px;
}

#hipotecaBdtPanel .crm-actions select#hipotecaBdtVincularSelect {
  min-width: 220px !important;
  max-width: 360px !important;
}

#hipotecaBdtPanel table {
  font-size: 11px;
  line-height: 1.2;
}

#hipotecaBdtPanel th,
#hipotecaBdtPanel td {
  padding: 4px 6px;
}

#hipotecaBdtPanel th {
  font-size: 9px;
}

#hipotecaBdtPanel table input,
#hipotecaBdtPanel table select {
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 7px;
}

#hipotecaBdtPanel table button {
  font-size: 11px;
  padding: 5px 9px;
}

#hipotecaBdtTable table {
  min-width: 860px;
}

#hipotecaBdtPanel .company-badge {
  padding: 2px 6px;
  gap: 5px;
  font-size: 11px;
}

#hipotecaBdtPanel .company-logo,
#hipotecaBdtPanel .company-initials {
  width: 15px;
  height: 15px;
}

#hipotecaBdtPanel .company-initials {
  font-size: 8px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink);
}

.status span {
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  display: inline-block;
}

.hero {
  display: grid;
  gap: 12px;
}

#homeSection.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 0%, rgba(60, 110, 113, 0.15), transparent 46%),
    radial-gradient(circle at 95% 100%, rgba(95, 122, 97, 0.2), transparent 52%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.88) 0%, rgba(244, 249, 246, 0.95) 100%);
}

#homeSection.hero::before {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(60, 110, 113, 0.12) 0%, rgba(60, 110, 113, 0) 70%);
  pointer-events: none;
}

.hero h2 {
  margin-bottom: 4px;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.app-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  width: min(var(--layout-max), calc(100% - (var(--layout-gutter) * 2)));
  margin: 0 auto;
  padding: 16px 0 28px;
  color: var(--muted);
  font-size: 12px;
}

.app-footer img {
  height: 20px;
  width: auto;
  opacity: 0.7;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  .meta {
    text-align: left;
    justify-items: start;
  }

  main {
    padding: 20px;
  }

  .tabs {
    gap: 6px;
    padding: 6px;
  }

  .tab {
    padding: 8px 12px;
    font-size: 11px;
  }

  .dashboard-charts {
    grid-template-columns: 1fr;
  }

  .chart-card {
    min-height: 280px;
  }

  .chart-card canvas {
    height: 220px;
  }

  #fincasDashboardSection .chart-card {
    min-height: 320px;
  }

  #fincasDashboardSection .chart-card canvas {
    height: 250px;
  }

  .density-toggle {
    flex-wrap: wrap;
  }

  .alert {
    width: calc(100% - 40px);
  }

  .crm-split {
    grid-template-columns: 1fr;
  }

  #crmInmuebleSearch,
  #crmInmuebleSearchMirror {
    min-width: 0;
    width: 100%;
  }

  #tableContainer table,
  [id$="Table"] table {
    min-width: 680px;
  }

  .workspace-list-item,
  .workspace-module-card,
  .workspace-launcher-card,
  .workspace-health-score-card,
  .workspace-client-hero,
  .workspace-client-card,
  .workspace-gestoria-card,
  .workspace-mini-kpi,
  .workspace-billing-row,
  .workspace-summary-row,
  .workspace-document-row,
  .workspace-check-item,
  .workspace-module-health-row {
    padding: 12px;
    border-radius: 14px;
  }

  .workspace-list-meta,
  .workspace-billing-meta,
  .workspace-summary-metrics,
  .workspace-document-meta,
  .workspace-module-health-meta {
    width: 100%;
  }

  .workspace-billing-meta > *,
  .workspace-summary-metrics > *,
  .workspace-document-meta > * {
    width: 100%;
  }

  .workspace-billing-meta button,
  .workspace-billing-meta .secondary,
  .workspace-billing-meta .button-inline {
    width: 100%;
    justify-content: center;
  }

  .workspace-client-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .workspace-client-toolbar button,
  .workspace-client-toolbar .secondary {
    width: 100%;
  }

  .workspace-client-actions > * {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .form-grid.inmo-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2 {
    grid-column: auto;
  }

  .crm-actions,
  .section-head {
    align-items: stretch;
  }

  .section-head .ghost,
  .section-head .secondary,
  .crm-actions > * {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 560px) {
  main {
    padding: 16px;
  }

  section {
    padding: 16px;
    border-radius: 20px;
  }

  .workspace-kpis .kpi-grid,
  .crm-kpis .kpi-grid,
  .workspace-mini-kpis,
  .workspace-gestoria-grid {
    grid-template-columns: 1fr;
  }

  .workspace-health-score-card {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .workspace-health-ring {
    width: 64px;
    height: 64px;
  }

  .crm-workspace-tabs {
    gap: 8px;
    padding: 6px;
    border-radius: 16px;
  }

  .crm-workspace-tabs .tab {
    min-width: 112px;
    padding: 9px 12px;
  }

  .workspace-document-head {
    align-items: flex-start;
  }

  .workspace-chip,
  .workspace-client-card,
  .workspace-gestoria-card {
    padding: 12px;
  }
}

@media (max-width: 420px) {
  header {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand {
    gap: 12px;
  }

  .brand img {
    width: 60px;
    height: 60px;
  }

  .brand h1 {
    font-size: 22px;
    letter-spacing: 0.6px;
  }

  .brand p {
    font-size: 12px;
    line-height: 1.25;
  }
}

@media (max-width: 720px) {
  /* iOS Safari: evita zoom al enfocar inputs <16px */
  input,
  select,
  textarea {
    font-size: 16px;
  }
}

@media (min-width: 1500px) {
  .crm-split {
    grid-template-columns: minmax(0, 2.7fr) minmax(360px, 1fr);
  }

  body.density-compact .crm-split {
    grid-template-columns: minmax(0, 3fr) minmax(360px, 1fr);
  }
}

body.auth-locked {
  overflow: hidden;
}

.auth-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(24px + var(--safe-top))
    calc(24px + var(--safe-right))
    calc(24px + var(--safe-bottom))
    calc(24px + var(--safe-left));
  background:
    radial-gradient(circle at 12% 0%, rgba(242, 193, 78, 0.18), transparent 46%),
    radial-gradient(circle at 85% 8%, rgba(56, 189, 248, 0.14), transparent 48%),
    radial-gradient(circle at 72% 100%, rgba(34, 197, 94, 0.12), transparent 52%),
    rgba(245, 247, 251, 0.92);
  backdrop-filter: blur(6px);
}

.auth-login-overlay.hidden {
  display: none !important;
}

.ui-error-toast {
  position: fixed;
  right: calc(18px + var(--safe-right));
  bottom: calc(18px + var(--safe-bottom));
  width: min(520px, calc(100vw - 36px));
  max-height: min(60vh, 520px);
  overflow: auto;
  z-index: 10000;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(130, 76, 69, 0.28);
  box-shadow: 0 20px 60px rgba(43, 43, 43, 0.18);
  color: var(--ink);
}

.ui-error-toast.hidden {
  display: none !important;
}

.ui-error-toast pre {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}

.auth-login-card {
  width: min(460px, 100%);
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  padding: 22px 22px 18px;
  box-shadow: 0 20px 60px rgba(43, 43, 43, 0.12);
}

.auth-brand {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.auth-brand img {
  width: min(260px, 100%);
  height: auto;
  display: block;
}

.auth-brand p {
  margin: 0;
  font-size: 13px;
}

.auth-login-card h2 {
  margin: 0 0 8px;
}

.auth-login-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.auth-login-form label {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.auth-input-wrap input {
  width: 100%;
  padding-right: 48px;
}

.auth-pass-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(245, 245, 245, 0.86);
  color: var(--ink);
  box-shadow: none;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.auth-pass-toggle:hover {
  background: rgba(235, 235, 235, 0.92);
}

.auth-pass-toggle:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.4);
  outline-offset: 2px;
}

.auth-pass-toggle svg {
  display: block;
  width: 18px;
  height: 18px;
}

.auth-pass-toggle[aria-pressed="true"] .icon-eye {
  display: none;
}

.auth-pass-toggle[aria-pressed="false"] .icon-eye-off {
  display: none;
}

.auth-login-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.auth-login-actions .muted {
  min-height: 1.2em;
}

.auth-login-card .success {
  color: #22C55E;
  font-weight: 600;
}

@media (max-width: 760px) {
  .brand img {
    width: 190px;
    height: 46px;
  }
}

body.theme-operativa {
  --gold: #0f766e;
  --gold-deep: #155e75;
  --gold-soft: #dff5ef;
  --black: #10212b;
  --charcoal: #10212b;
  --ink: #10212b;
  --ink-soft: #355060;
  --paper: #f4f3ee;
  --cream: #ece8de;
  --cloud: rgba(255, 255, 255, 0.9);
  --line: rgba(28, 70, 78, 0.14);
  --muted: #5f716f;
  --sage: #237a6a;
  --shadow: rgba(16, 33, 43, 0.14);
  background:
    radial-gradient(circle at top left, rgba(16, 185, 129, 0.16), transparent 28%),
    radial-gradient(circle at 100% 0%, rgba(14, 116, 144, 0.18), transparent 32%),
    radial-gradient(circle at 50% 100%, rgba(202, 138, 4, 0.08), transparent 34%),
    linear-gradient(180deg, #f3efe4 0%, #edf1ee 45%, #f7f7f3 100%);
}

body.theme-operativa::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 70%);
  opacity: 0.3;
}

body.theme-operativa header {
  width: min(calc(100% - (var(--layout-gutter) * 2)), var(--layout-max));
  margin: 18px auto 0;
  padding: 28px clamp(18px, 2.6vw, 38px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 30px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(16, 33, 43, 0.18);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.22), transparent 30%),
    linear-gradient(135deg, #0f172a 0%, #123247 34%, #155e75 62%, #15803d 100%);
}

body.theme-operativa header::before,
body.theme-operativa header::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

body.theme-operativa header::before {
  width: 320px;
  height: 320px;
  right: -120px;
  top: -140px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, transparent 68%);
}

body.theme-operativa header::after {
  width: 220px;
  height: 220px;
  left: 35%;
  bottom: -120px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.18) 0%, transparent 72%);
}

body.theme-operativa .brand,
body.theme-operativa .meta {
  position: relative;
  z-index: 1;
}

body.theme-operativa .brand {
  gap: 20px;
}

body.theme-operativa .brand img {
  width: 92px;
  height: 92px;
  padding: 14px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

body.theme-operativa .brand-copy {
  display: grid;
  gap: 6px;
  max-width: 700px;
}

body.theme-operativa .brand-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(247, 244, 238, 0.82);
}

body.theme-operativa .brand h1 {
  font-size: clamp(30px, 4vw, 52px);
  line-height: 0.96;
  letter-spacing: -0.03em;
}

body.theme-operativa .brand p {
  max-width: 58ch;
  margin-top: 0;
  font-size: 15px;
  line-height: 1.45;
  color: rgba(247, 244, 238, 0.84);
}

body.theme-operativa .meta {
  gap: 8px;
  padding: 16px 18px;
  min-width: min(100%, 320px);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
}

body.theme-operativa .meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

body.theme-operativa .meta .pill,
body.theme-operativa #authSessionPill {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.18);
}

body.theme-operativa .density-toggle {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

body.theme-operativa .density-btn.active {
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
}

body.theme-operativa .ui-context-bar {
  width: min(calc(100% - (var(--layout-gutter) * 2)), var(--layout-max));
  margin: 14px auto 0;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 18px 48px rgba(16, 33, 43, 0.08);
  backdrop-filter: blur(16px);
  top: 12px;
}

body.theme-operativa main {
  gap: 26px;
  padding-top: 18px;
}

body.theme-operativa section {
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-top: 1px solid rgba(255, 255, 255, 0.76);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.72)),
    linear-gradient(135deg, rgba(16, 185, 129, 0.04), rgba(14, 116, 144, 0.05));
  box-shadow:
    0 22px 60px rgba(16, 33, 43, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  position: relative;
  overflow: hidden;
}

/* En la zona de workspaces (holdingSection) hay módulos con listas largas (RRHH, etc). */
body.theme-operativa #holdingSection {
  overflow: visible;
}

body.theme-operativa section::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08), transparent 70%);
  pointer-events: none;
}

body.theme-operativa h2 {
  font-size: clamp(28px, 3.4vw, 44px);
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

body.theme-operativa h3 {
  letter-spacing: -0.02em;
}

body.theme-operativa .hero {
  padding: clamp(22px, 3vw, 34px);
  background:
    radial-gradient(circle at top right, rgba(14, 116, 144, 0.12), transparent 34%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96) 0%, rgba(17, 66, 72, 0.95) 48%, rgba(21, 128, 61, 0.84) 100%);
  color: #f5f7f6;
}

body.theme-operativa #homeSection.hero::before {
  width: 260px;
  height: 260px;
  top: -120px;
  right: -40px;
  left: auto;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 68%);
}

body.theme-operativa .hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.9fr);
  gap: 22px;
  align-items: stretch;
}

body.theme-operativa .hero-copy {
  display: grid;
  gap: 14px;
  align-content: start;
  position: relative;
  z-index: 1;
}

body.theme-operativa .hero h2,
body.theme-operativa .hero h3,
body.theme-operativa .hero p,
body.theme-operativa .hero .muted {
  color: inherit;
}

body.theme-operativa .hero p {
  max-width: 58ch;
  font-size: 16px;
  line-height: 1.55;
  color: rgba(245, 247, 246, 0.86);
}

body.theme-operativa .hero .toolbar {
  width: fit-content;
  margin-bottom: 0;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

body.theme-operativa .hero .toolbar select {
  min-width: 120px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.9);
}

body.theme-operativa .hero-aside {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  position: relative;
  z-index: 1;
}

body.theme-operativa .hero-badge {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.18;
}

body.theme-operativa .hero-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body.theme-operativa .hero-metric {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

body.theme-operativa .hero-metric strong {
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1;
}

body.theme-operativa .hero-metric span {
  font-size: 12px;
  line-height: 1.4;
  color: rgba(245, 247, 246, 0.8);
}

body.theme-operativa .home-block {
  position: relative;
  z-index: 1;
  margin-top: 24px;
}

body.theme-operativa .pill {
  background: rgba(16, 185, 129, 0.1);
  color: #d8fff6;
  border-color: rgba(216, 255, 246, 0.18);
}

body.theme-operativa section:not(.hero) .pill {
  background: rgba(16, 185, 129, 0.08);
  color: var(--ink-soft);
  border-color: rgba(16, 185, 129, 0.16);
}

body.theme-operativa .section-head {
  margin-bottom: 16px;
}

body.theme-operativa .card,
body.theme-operativa .form-card,
body.theme-operativa .data-card,
body.theme-operativa .dashboard-card,
body.theme-operativa .company-summary,
body.theme-operativa .crm-header,
body.theme-operativa .company-card,
body.theme-operativa .inline-row,
body.theme-operativa .renta-detail-card,
body.theme-operativa .agenda-side {
  border: 1px solid rgba(18, 50, 71, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 249, 248, 0.9)),
    linear-gradient(135deg, rgba(16, 185, 129, 0.03), rgba(14, 116, 144, 0.03));
  box-shadow:
    0 16px 42px rgba(16, 33, 43, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.theme-operativa .card:hover,
body.theme-operativa .form-card:hover,
body.theme-operativa .data-card:hover,
body.theme-operativa .dashboard-card:hover,
body.theme-operativa .company-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 24px 54px rgba(16, 33, 43, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

body.theme-operativa .grid {
  gap: 18px;
}

body.theme-operativa .company-card {
  border-top: 1px solid rgba(18, 50, 71, 0.08);
  padding: 20px;
}

body.theme-operativa .company-card button,
body.theme-operativa .company-card .card-link,
body.theme-operativa .toolbar button,
body.theme-operativa .form-actions button,
body.theme-operativa .inline-row button {
  background: linear-gradient(135deg, #0f766e 0%, #155e75 100%);
  color: #f4fbf9;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.18);
}

body.theme-operativa button.secondary,
body.theme-operativa .btn.secondary,
body.theme-operativa .toolbar button.secondary,
body.theme-operativa .crm-actions .secondary,
body.theme-operativa .inline-row button.secondary {
  background: rgba(16, 33, 43, 0.04);
  color: var(--ink);
  border: 1px solid rgba(18, 50, 71, 0.14);
  box-shadow: none;
}

body.theme-operativa .toolbar button.ghost,
body.theme-operativa .section-head .ghost,
body.theme-operativa #authLogoutBtn {
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  border: 1px solid rgba(18, 50, 71, 0.16);
}

body.theme-operativa .tabs,
body.theme-operativa .tab-group {
  gap: 10px;
  padding: 10px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 38px rgba(16, 33, 43, 0.06);
}

body.theme-operativa .tab {
  min-height: 42px;
  border-radius: 14px;
  border-color: transparent;
  background: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.theme-operativa .tab.active {
  background: linear-gradient(135deg, #0f172a 0%, #14532d 100%);
  color: #f5f7f6;
  box-shadow: 0 12px 24px rgba(16, 33, 43, 0.18);
}

body.theme-operativa input,
body.theme-operativa select,
body.theme-operativa textarea {
  border-radius: 14px;
  border: 1px solid rgba(18, 50, 71, 0.12);
  background: rgba(255, 255, 255, 0.88);
}

body.theme-operativa .toolbar {
  gap: 10px;
}

body.theme-operativa .toolbar select,
body.theme-operativa .toolbar input {
  border-radius: 999px;
  min-height: 42px;
}

body.theme-operativa .dashboard,
body.theme-operativa #fincasDashboardSection,
body.theme-operativa #dashboardSection,
body.theme-operativa #finDashboardSection {
  display: grid;
  gap: 16px;
}

body.theme-operativa .dashboard-head {
  padding: 8px 2px;
}

body.theme-operativa .dashboard-kpis .card,
body.theme-operativa .crm-kpis .card,
body.theme-operativa .crm-kpis .kpi-card {
  position: relative;
  overflow: hidden;
}

body.theme-operativa .dashboard-kpis .card::before,
body.theme-operativa .crm-kpis .card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #0f766e 0%, #16a34a 50%, #eab308 100%);
}

body.theme-operativa .kpi-value {
  font-size: clamp(28px, 3vw, 38px);
  color: #0f172a;
}

body.theme-operativa .company-summary,
body.theme-operativa .crm-header {
  padding: 20px 22px;
  border-radius: 22px;
}

body.theme-operativa .crm-pipeline {
  gap: 10px;
}

body.theme-operativa .crm-pipeline button {
  border-radius: 999px;
  border: 1px solid rgba(18, 50, 71, 0.08);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  box-shadow: none;
}

body.theme-operativa .crm-pipeline button.active {
  background: linear-gradient(135deg, #0f766e 0%, #155e75 100%);
  color: #f4fbf9;
  box-shadow: 0 14px 24px rgba(15, 118, 110, 0.2);
}

body.theme-operativa .crm-kanban-column {
  border-radius: 22px;
  border: 1px solid rgba(18, 50, 71, 0.08);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

body.theme-operativa .crm-kanban-card,
body.theme-operativa .admin-user-item,
body.theme-operativa .crm-recent-item,
body.theme-operativa .crm-mini-card,
body.theme-operativa .renta-card,
body.theme-operativa .agenda-day {
  border: 1px solid rgba(18, 50, 71, 0.08);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(16, 33, 43, 0.06);
}

body.theme-operativa .data-table,
body.theme-operativa .ui-table tr,
body.theme-operativa .ui-table-scroll {
  border-radius: 18px;
}

body.theme-operativa .data-table th {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.12), rgba(14, 116, 144, 0.08));
  color: #123247;
}

body.theme-operativa .footer,
body.theme-operativa .ui-table-meta,
body.theme-operativa .company-summary-meta,
body.theme-operativa .muted {
  color: #617472;
}

body.theme-operativa .alert {
  width: min(calc(100% - (var(--layout-gutter) * 2)), var(--layout-max));
  margin-top: 12px;
  border-radius: 22px;
  border: 1px solid rgba(18, 50, 71, 0.14);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(224, 247, 240, 0.76));
  box-shadow: 0 18px 40px rgba(16, 33, 43, 0.08);
}

body.theme-operativa .auth-login-overlay {
  background:
    radial-gradient(circle at 15% 10%, rgba(16, 185, 129, 0.18), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(14, 116, 144, 0.18), transparent 42%),
    rgba(244, 243, 238, 0.92);
}

body.theme-operativa .auth-login-card {
  border-radius: 28px;
  padding: 24px 24px 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 249, 248, 0.92)),
    linear-gradient(135deg, rgba(16, 185, 129, 0.04), rgba(14, 116, 144, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: 0 26px 64px rgba(16, 33, 43, 0.14);
}

@media (max-width: 980px) {
  .inmueble-profile {
    grid-template-columns: 1fr;
  }

  body.theme-operativa header {
    width: calc(100% - 28px);
    border-radius: 24px;
  }

  body.theme-operativa .hero-shell {
    grid-template-columns: 1fr;
  }

  body.theme-operativa .meta-badges {
    justify-content: flex-start;
  }

  body.theme-operativa .ui-context-bar {
    width: calc(100% - 28px);
  }
}

@media (max-width: 760px) {
  body.theme-operativa .brand {
    align-items: flex-start;
  }

  body.theme-operativa .brand img {
    width: 74px;
    height: 74px;
  }

  body.theme-operativa .meta {
    width: 100%;
    min-width: 0;
    border-radius: 20px;
  }

  body.theme-operativa main {
    padding-left: 14px;
    padding-right: 14px;
  }

  body.theme-operativa section {
    border-radius: 22px;
  }

  body.theme-operativa .hero {
    padding: 20px 18px;
  }

  body.theme-operativa .hero-metrics {
    grid-template-columns: 1fr;
  }

  body.theme-operativa .hero .toolbar {
    width: 100%;
    border-radius: 18px;
  }

  body.theme-operativa .hero .toolbar select {
    width: 100%;
  }
}

body.theme-operativa {
  --gold: #c7a24a;
  --gold-deep: #a88327;
  --gold-soft: #f4ecd5;
  --black: #1d241f;
  --charcoal: #1d241f;
  --ink: #213129;
  --ink-soft: #4f6a5f;
  --paper: #f5f1e7;
  --cream: #ece6d8;
  --cloud: rgba(255, 251, 243, 0.9);
  --line: rgba(112, 131, 102, 0.18);
  --muted: #68776e;
  --sage: #73986f;
  --shadow: rgba(33, 49, 41, 0.16);
  background:
    radial-gradient(circle at top left, rgba(199, 162, 74, 0.2), transparent 26%),
    radial-gradient(circle at 100% 0%, rgba(115, 152, 111, 0.16), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(147, 168, 103, 0.12), transparent 34%),
    linear-gradient(180deg, #f7f3e8 0%, #eef2ea 46%, #f7f7f2 100%);
}

body.theme-operativa header {
  background:
    radial-gradient(circle at top left, rgba(247, 240, 214, 0.15), transparent 32%),
    radial-gradient(circle at 80% 12%, rgba(199, 162, 74, 0.22), transparent 20%),
    linear-gradient(135deg, #1b211d 0%, #34483d 28%, #6f8f68 66%, #c7a24a 100%);
}

body.theme-operativa .brand img {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    radial-gradient(circle at top left, rgba(199, 162, 74, 0.24), transparent 62%);
}

body.theme-operativa .brand-kicker {
  background: rgba(247, 240, 214, 0.1);
  border-color: rgba(247, 240, 214, 0.16);
  color: rgba(255, 248, 236, 0.82);
}

body.theme-operativa .brand h1 {
  text-shadow: 0 10px 30px rgba(18, 24, 21, 0.24);
}

body.theme-operativa .brand-system {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 0 0;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.04em;
  color: rgba(231, 240, 227, 0.84);
}

body.theme-operativa .brand-system::before {
  content: "";
  width: 40px;
  height: 1px;
  margin-right: 12px;
  background: linear-gradient(90deg, rgba(199, 162, 74, 0.95), rgba(115, 152, 111, 0.7));
}

body.theme-operativa .meta {
  background:
    linear-gradient(180deg, rgba(255, 252, 245, 0.12), rgba(255, 255, 255, 0.05)),
    rgba(26, 34, 29, 0.18);
}

body.theme-operativa .meta .pill,
body.theme-operativa #authSessionPill {
  background: rgba(255, 247, 228, 0.12);
  color: rgba(255, 248, 236, 0.92);
  border-color: rgba(255, 232, 179, 0.22);
}

body.theme-operativa .density-toggle {
  background: rgba(255, 248, 236, 0.08);
  border-color: rgba(255, 232, 179, 0.18);
}

body.theme-operativa .ui-context-bar {
  background:
    linear-gradient(135deg, rgba(255, 251, 242, 0.72), rgba(241, 246, 238, 0.62)),
    rgba(255, 255, 255, 0.58);
}

body.theme-operativa section {
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.9), rgba(255, 255, 255, 0.72)),
    linear-gradient(135deg, rgba(199, 162, 74, 0.05), rgba(115, 152, 111, 0.06));
}

body.theme-operativa section::before {
  background: radial-gradient(circle, rgba(199, 162, 74, 0.08), transparent 70%);
}

body.theme-operativa .hero {
  background:
    radial-gradient(circle at 82% 18%, rgba(199, 162, 74, 0.34), transparent 20%),
    radial-gradient(circle at top left, rgba(255, 244, 217, 0.14), transparent 28%),
    linear-gradient(135deg, #1b211d 0%, #385044 34%, #76946d 68%, #c7a24a 100%);
}

body.theme-operativa .hero::after {
  content: "";
  position: absolute;
  inset: auto 28px 26px auto;
  width: 160px;
  height: 160px;
  border-radius: 28px;
  opacity: 0.18;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.02)),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.22),
      rgba(255, 255, 255, 0.22) 2px,
      transparent 2px,
      transparent 12px
    );
  pointer-events: none;
}

body.theme-operativa .hero .pill {
  background: rgba(255, 244, 217, 0.14);
  color: #fff6df;
  border-color: rgba(255, 244, 217, 0.16);
}

body.theme-operativa .hero-aside {
  background:
    linear-gradient(180deg, rgba(255, 249, 236, 0.12), rgba(255, 255, 255, 0.04)),
    rgba(26, 34, 29, 0.16);
  border-color: rgba(255, 244, 217, 0.18);
}

body.theme-operativa .hero-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(255, 244, 217, 0.12);
  border: 1px solid rgba(255, 244, 217, 0.16);
  color: rgba(255, 248, 236, 0.88);
}

body.theme-operativa .hero-badge {
  color: #fff8ea;
  text-wrap: balance;
}

body.theme-operativa .hero-metric {
  background:
    linear-gradient(180deg, rgba(255, 249, 236, 0.12), rgba(255, 255, 255, 0.05)),
    rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 244, 217, 0.14);
}

body.theme-operativa .hero-metric strong {
  color: #fff4d6;
}

body.theme-operativa section:not(.hero) .pill {
  background: rgba(199, 162, 74, 0.08);
  color: #4f6a5f;
  border-color: rgba(199, 162, 74, 0.18);
}

body.theme-operativa .card,
body.theme-operativa .form-card,
body.theme-operativa .data-card,
body.theme-operativa .dashboard-card,
body.theme-operativa .company-summary,
body.theme-operativa .crm-header,
body.theme-operativa .company-card,
body.theme-operativa .inline-row,
body.theme-operativa .renta-detail-card,
body.theme-operativa .agenda-side {
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.94), rgba(247, 249, 245, 0.9)),
    linear-gradient(135deg, rgba(199, 162, 74, 0.04), rgba(115, 152, 111, 0.04));
}

body.theme-operativa .company-card,
body.theme-operativa .crm-header,
body.theme-operativa .company-summary {
  position: relative;
  overflow: hidden;
}

body.theme-operativa .company-card::before,
body.theme-operativa .crm-header::before,
body.theme-operativa .company-summary::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #c7a24a 0%, #73986f 100%);
  opacity: 0.9;
}

body.theme-operativa .company-card button,
body.theme-operativa .company-card .card-link,
body.theme-operativa .toolbar button,
body.theme-operativa .form-actions button,
body.theme-operativa .inline-row button,
body.theme-operativa .crm-pipeline button.active {
  background: linear-gradient(135deg, #c7a24a 0%, #73986f 100%);
  color: #fffdf7;
  box-shadow: 0 14px 26px rgba(138, 135, 67, 0.2);
}

body.theme-operativa .toolbar button.secondary,
body.theme-operativa .crm-actions .secondary,
body.theme-operativa .inline-row button.secondary,
body.theme-operativa button.secondary,
body.theme-operativa .btn.secondary {
  background: rgba(104, 119, 110, 0.06);
  color: #284237;
  border-color: rgba(115, 152, 111, 0.18);
}

body.theme-operativa .tabs,
body.theme-operativa .tab-group {
  background:
    linear-gradient(135deg, rgba(255, 251, 242, 0.8), rgba(242, 247, 238, 0.72)),
    rgba(255, 255, 255, 0.66);
}

body.theme-operativa .tab {
  background: rgba(255, 254, 249, 0.72);
  color: #375044;
}

body.theme-operativa .tab.active {
  background: linear-gradient(135deg, #263a30 0%, #73986f 55%, #c7a24a 100%);
  color: #fffdf5;
}

body.theme-operativa .dashboard-kpis .card::before,
body.theme-operativa .crm-kpis .card::before {
  background: linear-gradient(90deg, #c7a24a 0%, #93a867 40%, #73986f 100%);
}

body.theme-operativa .kpi-value {
  color: #24352d;
}

body.theme-operativa .crm-pipeline button {
  background: rgba(255, 253, 247, 0.92);
  color: #375044;
}

body.theme-operativa .data-table th {
  background: linear-gradient(180deg, rgba(199, 162, 74, 0.12), rgba(115, 152, 111, 0.08));
  color: #355046;
}

body.theme-operativa .alert {
  background: linear-gradient(135deg, rgba(255, 250, 239, 0.84), rgba(236, 245, 234, 0.78));
}

body.theme-operativa .auth-login-overlay {
  background:
    radial-gradient(circle at 15% 10%, rgba(199, 162, 74, 0.18), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(115, 152, 111, 0.18), transparent 42%),
    rgba(245, 241, 231, 0.92);
}

body.theme-operativa .auth-login-card {
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(247, 249, 245, 0.92)),
    linear-gradient(135deg, rgba(199, 162, 74, 0.04), rgba(115, 152, 111, 0.04));
}

/* Home contrast fix: keep the landing section readable regardless of theme block order. */
body.theme-operativa #homeSection.hero {
  background:
    radial-gradient(circle at 8% 0%, rgba(199, 162, 74, 0.12), transparent 30%),
    radial-gradient(circle at 92% 20%, rgba(115, 152, 111, 0.12), transparent 24%),
    linear-gradient(135deg, rgba(255, 252, 246, 0.96) 0%, rgba(241, 246, 242, 0.94) 52%, rgba(250, 248, 241, 0.96) 100%);
  color: #213129;
}

body.theme-operativa #homeSection.hero::before {
  background: radial-gradient(circle, rgba(199, 162, 74, 0.1), transparent 70%);
}

body.theme-operativa #homeSection .hero-copy h2,
body.theme-operativa #homeSection .home-block h3,
body.theme-operativa #homeSection .company-card h3 {
  color: #213129;
}

body.theme-operativa #homeSection .hero-copy p,
body.theme-operativa #homeSection .home-block .muted,
body.theme-operativa #homeSection .company-meta {
  color: #4b5f55;
}

body.theme-operativa #homeSection .hero .pill {
  background: rgba(199, 162, 74, 0.12);
  color: #5f4b1d;
  border-color: rgba(199, 162, 74, 0.22);
}

body.theme-operativa #homeSection .hero .toolbar {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(115, 152, 111, 0.16);
}

body.theme-operativa #homeSection .hero .toolbar select {
  background: rgba(255, 255, 255, 0.96);
  color: #213129;
  border-color: rgba(115, 152, 111, 0.2);
}

body.theme-operativa #homeSection .hero-aside {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(248, 249, 244, 0.76)),
    rgba(255, 255, 255, 0.72);
  border-color: rgba(115, 152, 111, 0.16);
}

body.theme-operativa #homeSection .hero-chip {
  background: rgba(199, 162, 74, 0.1);
  color: #6c5620;
  border-color: rgba(199, 162, 74, 0.18);
}

body.theme-operativa #homeSection .hero-badge {
  color: #4b5f55;
}

body.theme-operativa #homeSection .hero-metric {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(115, 152, 111, 0.14);
}

body.theme-operativa #homeSection .hero-metric strong {
  color: #6c5620;
}

body.theme-operativa #homeSection .hero-metric span {
  color: #4b5f55;
}

body.theme-operativa #homeSection .company-card {
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(247, 249, 245, 0.92)),
    rgba(255, 255, 255, 0.9);
  border-color: rgba(115, 152, 111, 0.14);
}

body.theme-operativa .meta {
  justify-items: start;
  text-align: left;
  gap: 10px;
  min-width: 220px;
  padding: 14px 16px;
  border-radius: 20px;
}

body.theme-operativa .meta-user {
  display: grid;
  gap: 6px;
  width: 100%;
  color: rgba(255, 248, 236, 0.92);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.theme-operativa .meta-user select {
  width: 100%;
  min-width: 0;
  background: rgba(255, 252, 245, 0.94);
  color: #213129;
  border-color: rgba(199, 162, 74, 0.18);
}

body.theme-operativa #authLogoutBtn {
  justify-self: start;
  color: rgba(255, 248, 236, 0.92);
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
}

body.theme-operativa #authLogoutBtn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.38);
}

body.theme-operativa .meta-status {
  min-height: 18px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255, 248, 236, 0.86);
}

body.theme-operativa .meta-status .status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body.theme-operativa .meta-status .status span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d8b15b;
  box-shadow: 0 0 0 4px rgba(216, 177, 91, 0.16);
}
