:root {
  color-scheme: light;
  --bg: #f2f1ed;
  --surface: #ffffff;
  --surface-2: #f7f6f3;
  --ink: #031b3a;
  --muted: #627189;
  --line: #d7d2c9;
  --soft-line: #e8e3da;
  --brand: #061d3e;
  --brand-2: #6d7f9c;
  --cream: #f3f0eb;
  --rail: #f7f7f6;
  --salmon: #f3d5cf;
  --salmon-line: #e4a89f;
  --teal: #127c77;
  --gold: #a47722;
  --red: #9a2d24;
  --green: #256241;
  --shadow: 0 12px 30px rgba(28, 31, 36, 0.08);
  --radius: 8px;
  --surida-icon-bg: #f1f0ed;
  --surida-icon-bg-hover: #e7e8e6;
  --surida-icon-border: #d7d2ca;
  --surida-icon-border-hover: #bfc4c9;
  --surida-icon-danger-bg: #f8ece9;
  --surida-icon-danger-border: #e0b9ae;
  --surida-icon-danger-color: #9c3f32;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.architecture-note {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr;
  gap: 14px;
  align-items: start;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(18, 69, 84, 0.16);
  border-radius: 14px;
  background: rgba(219, 239, 238, 0.52);
  color: var(--ink, #173941);
}

.architecture-note code {
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.8);
}

.fiscal-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(360px, 0.95fr);
  gap: 14px;
}

.fiscal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.fiscal-form label {
  display: grid;
  gap: 6px;
  color: var(--muted, #61747a);
  font-size: 0.78rem;
  font-weight: 700;
}

.fiscal-form button {
  align-self: end;
}

.comparison-cards {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.comparison-cards article {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid rgba(18, 69, 84, 0.14);
  border-radius: 14px;
  background: #f8fbfb;
}

.comparison-cards span,
.comparison-cards small {
  color: var(--muted, #61747a);
}

.comparison-cards strong {
  color: var(--ink, #173941);
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.recommendation {
  padding: 16px;
  border-left: 4px solid #2c7a69;
  border-radius: 10px;
  background: #e8f6f1;
}

.recommendation.is-autonomous {
  border-left-color: #b78327;
  background: #fff6e5;
}

.recommendation p {
  margin: 6px 0 0;
}

.warning-note,
.legal-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 9px;
  color: #6b511e;
  background: #fff6e5;
  font-size: 0.82rem;
}

.legal-note {
  color: var(--muted, #61747a);
  background: #f3f6f6;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 12px 0 0;
  font-size: 0.78rem;
}

.source-links a {
  color: #145f67;
  font-weight: 700;
}

.panel-heading-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
}

.panel-heading-row h2,
.panel-heading-row p {
  margin: 0;
}

.panel-heading-row label {
  display: grid;
  gap: 5px;
  min-width: 150px;
  color: var(--muted, #61747a);
  font-size: 0.75rem;
  font-weight: 700;
}

@media (max-width: 1050px) {
  .fiscal-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .architecture-note,
  .fiscal-form {
    grid-template-columns: 1fr;
  }

  .panel-heading-row {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Ayuda contextual de HORADIA */
.view-help-bar {
  display: flex;
  justify-content: flex-end;
  min-height: 34px;
  margin: 0 0 8px;
}

.view-help-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid #bfd8dc;
  border-radius: 999px;
  background: #f2fafb;
  color: #145f67;
  font-size: 0.78rem;
  font-weight: 850;
  box-shadow: 0 4px 12px rgba(18, 69, 84, 0.06);
}

.view-help-button:hover,
.view-help-button:focus-visible {
  border-color: #72aeb5;
  background: #e6f5f6;
  outline: none;
}

.view-help-button span,
.help-callout-icon,
.help-card-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.view-help-button svg,
.help-callout-icon svg,
.help-card-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.help-dialog-content {
  display: grid;
  gap: 20px;
}

.help-dialog-content p,
.help-dialog-content h3 {
  margin: 0;
}

.help-callout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid #b9dadd;
  border-radius: 14px;
  background: #eef9fa;
  color: #174c54;
}

.help-callout-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  color: #14656d;
}

.help-callout p,
.help-card p,
.help-flow-step p,
.help-system-summary > p:last-child,
.help-permissions p {
  margin-top: 5px;
  color: #526973;
  line-height: 1.55;
}

.help-section {
  display: grid;
  gap: 8px;
}

.help-section h3,
.help-system-summary h3 {
  color: #17364a;
  font-size: 1.08rem;
}

.help-steps {
  display: grid;
  gap: 8px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.help-steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid #e0e8eb;
  border-radius: 10px;
  background: #ffffff;
}

.help-steps li > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  background: #e7f5f2;
  color: #167167;
}

.help-steps svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}

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

.help-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid #d9e6e8;
  border-radius: 12px;
  background: #f8fbfb;
}

.help-card.is-warning {
  border-color: #eed9b8;
  background: #fff9ef;
}

.help-card-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #e8f5f6;
  color: #17656d;
  font-weight: 900;
}

.help-card.is-warning .help-card-icon {
  background: #fbe9c9;
  color: #89520a;
}

.system-guide {
  gap: 16px;
}

.help-system-summary {
  padding: 16px;
  border-left: 4px solid #17656d;
  border-radius: 0 12px 12px 0;
  background: #f4f8f8;
}

.help-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.help-flow-step {
  display: flex;
  gap: 12px;
  padding: 13px;
  border: 1px solid #e0e7e9;
  border-radius: 12px;
  background: #ffffff;
}

.help-flow-step > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  background: #174c54;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 900;
}

.help-permissions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.help-permissions article {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 142px;
  padding: 14px;
  border: 1px solid #e0e7e9;
  border-radius: 12px;
  background: #ffffff;
}

.help-permissions .pill {
  justify-self: start;
}

@media (max-width: 760px) {
  .view-help-button strong,
  .help-header > span:not(.header-icon) {
    display: none;
  }

  .help-two-columns,
  .help-flow,
  .help-permissions {
    grid-template-columns: 1fr;
  }

  .help-permissions article {
    min-height: 0;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.layout {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  grid-template-rows: 64px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 60;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 84px 46px minmax(0, 1fr) auto;
  align-items: center;
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(16px);
}

.header-mark {
  display: grid;
  place-items: center;
  height: 64px;
  border-right: 1px solid var(--line);
  background: #fafafa;
}

.header-mark .brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: none;
}

.hamburger {
  width: 38px;
  height: 38px;
  margin-left: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  color: var(--ink);
  font-size: 1.28rem;
  font-weight: 900;
  line-height: 1;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
  padding-left: 36px;
}

.header-brand .brand-name {
  margin: 0;
  color: var(--brand-2);
  font-size: 2.08rem;
  font-weight: 860;
  letter-spacing: 0.24em;
  line-height: 1;
  text-transform: uppercase;
}

.header-brand .brand-subtitle {
  margin: 0;
  color: #233857;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-right: 22px;
}

.header-pill,
.header-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  padding: 8px 13px;
  font-weight: 850;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.header-icon {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 26px;
  border-radius: 8px;
  background: var(--cream);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
}

.header-plus {
  width: 48px;
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
  font-size: 1.2rem;
}

.user-pill {
  color: #667080;
}

.sidebar {
  position: sticky;
  top: 64px;
  z-index: 20;
  grid-column: 1;
  grid-row: 2;
  width: 84px;
  height: calc(100vh - 64px);
  overflow-x: hidden;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--rail);
  box-shadow: none;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 304px;
  min-height: 66px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand-logo {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.09);
}

.brand-copy,
.nav-button span:not(.nav-icon),
.nav-group-title {
  display: none;
}

.brand-name {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: 0;
}

.brand-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.nav {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 84px;
  padding: 76px 0 18px;
}

.nav-group {
  display: grid;
  gap: 4px;
  margin: 4px 0 8px;
}

.nav-group-title {
  height: 18px;
  padding: 0 10px;
  color: #8493a3;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 18px;
  text-transform: uppercase;
}

.nav-button {
  display: grid;
  place-items: center;
  width: 58px;
  min-height: 54px;
  padding: 0;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #667080;
  font-weight: 760;
  text-align: center;
}

.nav-button:hover,
.nav-button.is-active {
  border-color: #d4d8de;
  background: #e9ecef;
  color: var(--brand);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: #eef2f5;
  color: #526070;
  font-size: 0.74rem;
  font-weight: 900;
}

.nav-button.is-active .nav-icon {
  background: var(--brand);
  color: #ffffff;
}

.main {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  padding: 22px 24px 56px;
  background: var(--bg);
}

.top-strip {
  display: grid;
  grid-template-columns: max-content repeat(4, minmax(128px, auto)) minmax(180px, 1fr);
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.top-strip-title {
  margin-right: 4px;
  color: var(--brand);
  font-size: 1.12rem;
  font-weight: 920;
}

.strip-item,
.user-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: none;
  text-decoration: none;
}

.strip-item:hover {
  border-color: #c6c0b7;
  background: #ffffff;
}

.strip-item strong {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 9px;
  background: #e6edf3;
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 920;
}

.strip-item span,
.user-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 780;
}

.strip-item.is-primary {
  border-color: #223243;
  background: #223243;
  color: #ffffff;
}

.strip-item.is-primary strong {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.user-chip {
  justify-content: flex-end;
  color: var(--muted);
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.topbar p {
  margin: 6px 0 0;
  max-width: 820px;
  color: var(--muted);
}

.page-tools {
  margin: 0 0 14px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.page-tools-main {
  display: grid;
  grid-template-columns: minmax(270px, 0.7fr) minmax(420px, 1.3fr) max-content;
  gap: 12px;
  align-items: center;
  min-height: 70px;
  padding: 10px 14px;
}

.page-title-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.page-title {
  color: var(--brand);
  font-size: 1.18rem;
  font-weight: 930;
  white-space: nowrap;
}

.page-export {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.page-search-form {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 48px max-content;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.page-search {
  position: relative;
  display: block;
  min-width: 0;
}

.page-search input {
  min-height: 50px;
  padding-left: 54px;
  border-color: transparent;
  border-radius: 8px;
  background: #efeeee;
  color: var(--ink);
  font-weight: 820;
}

.page-search input::placeholder {
  color: #78879a;
  font-weight: 850;
}

.search-glyph {
  position: absolute;
  left: 14px;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  color: #66798f;
  font-size: 0.72rem;
  font-weight: 930;
}

.page-filter-menu {
  position: relative;
}

.page-filter-menu summary {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #efeeee;
  color: #526070;
  font-size: 0.72rem;
  font-weight: 930;
  list-style: none;
  cursor: pointer;
}

.page-filter-menu summary::-webkit-details-marker {
  display: none;
}

.page-filter-menu[open] summary,
.page-filter-menu summary:hover {
  border-color: #c7bfb5;
  background: #ffffff;
  color: var(--brand);
}

.page-filter-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: min(520px, calc(100vw - 132px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

.page-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
}

.page-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.page-submit {
  min-height: 48px;
}

.page-tools-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: max-content;
}

.result-count {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 760;
  white-space: nowrap;
}

.page-refresh {
  min-width: 44px;
  min-height: 44px;
  color: var(--brand);
  font-weight: 930;
}

.page-subbar {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  background: #fbfaf8;
}

.subbar-result {
  color: var(--muted);
  font-weight: 720;
  white-space: nowrap;
}

.subbar-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
}

.toolbar-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #d7e3ec;
  border-radius: 999px;
  background: #f5f8fb;
  color: #405368;
  font-size: 0.78rem;
  font-weight: 780;
  white-space: nowrap;
}

.toolbar-chip strong {
  color: var(--brand);
  font-weight: 920;
}

.subbar-pager {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #3a4b61;
  font-weight: 850;
  white-space: nowrap;
}

.page-size,
.page-number {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.page-number {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 1.42rem;
  line-height: 1.18;
}

h2 {
  margin: 0 0 14px;
  font-size: 1.08rem;
}

h3 {
  margin: 0 0 10px;
  font-size: 0.96rem;
}

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

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: none;
  font-weight: 850;
  text-decoration: none;
}

.icon-button {
  width: 38px;
  padding: 0;
}

.button:hover,
.icon-button:hover {
  border-color: #c8c0b7;
  background: #ffffff;
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.button.primary:hover {
  border-color: #162331;
  background: #162331;
}

.button.secondary {
  color: var(--brand);
}

.button.danger {
  border-color: #e7aaa1;
  background: #fff1ee;
  color: var(--red);
}

.button.warn {
  border-color: #efd393;
  background: #fff7db;
  color: #73500b;
}

.button.mini {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 0.78rem;
}

.grid {
  display: grid;
  gap: 14px;
}

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

.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel,
.stat,
.mini-card,
.list-row,
.candidate-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 14px;
}

.panel.flat {
  box-shadow: none;
  background: rgba(255, 255, 255, 0.72);
}

.stat {
  min-height: 110px;
  padding: 16px;
}

.stat-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 720;
}

.stat-value {
  margin: 10px 0 0;
  color: var(--brand);
  font-size: 1.62rem;
  font-weight: 920;
}

.stat-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.module-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 102px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
}

.module-card:hover {
  border-color: #b9c8d4;
  background: #f8fafc;
}

.module-card strong {
  font-size: 0.95rem;
}

.module-card span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.project-workspace {
  display: grid;
  gap: 18px;
  align-items: start;
}

.project-list-panel {
  padding: 0;
  overflow: hidden;
}

.project-table {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.project-table table {
  min-width: 1080px;
}

.project-table tr.is-selected td {
  background: #fbf7f1;
}

.record-number {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--brand);
  font-weight: 930;
}

.record-number span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #e7eff6;
  color: var(--brand);
  font-size: 0.76rem;
}

.record-number:hover,
.project-table tr.is-selected .record-number {
  border-color: #cbd7e3;
  background: #eef4f9;
}

.ag-detail-page {
  --ag-red: var(--brand);
  --ag-bg: #f3f2ef;
  --ag-band: #ded7c9;
  --ag-band-soft: #eeeae3;
  --ag-border: #ddd9d2;
  --ag-dark: #071834;
  background: var(--ag-bg);
  margin: -8px -6px 0;
  padding: 6px 0 26px;
  color: #17212b;
}

.ag-record-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.ag-record-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.08rem;
  line-height: 1.2;
  min-width: 0;
}

.ag-record-name strong {
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 900;
}

.ag-record-symbol {
  display: block;
  width: 19px;
  height: 26px;
  flex: 0 0 19px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
}

.ag-warn-dot {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid #9aa1a8;
  border-radius: 50%;
  background: #ffffff;
  color: #7a828a;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.ag-warn-dot:hover,
.ag-warn-dot:focus-visible {
  border-color: #f59e0b;
  color: #b45309;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
  outline: 0;
}

.ag-record-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  width: min(100%, 1035px);
}

.ag-status-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  padding: 6px;
  border: 1px solid #ded9cf;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.ag-status-step {
  flex: 1 1 0;
  min-width: 112px;
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  background: #f4f5f6;
  color: #667384;
  padding: 0 14px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
  box-shadow: none;
}

.ag-status-step.is-active {
  background: #ffde83;
  color: #5d4707;
  box-shadow: inset 0 0 0 1px rgba(180, 125, 0, 0.12);
}

.ag-status-step.status-pending.is-active {
  background: #f4d7d2 !important;
  color: #8a2d25 !important;
  border-color: #d99b90 !important;
}

.ag-status-step.status-reviewed.is-active {
  background: #f8e8bb !important;
  color: #6b520d !important;
  border-color: #dcc06f !important;
}

.ag-status-step.status-processing.is-active {
  background: #dfead7 !important;
  color: #3f633e !important;
  border-color: #b8cda9 !important;
}

.ag-status-step.status-incident.is-active {
  background: #eadff1 !important;
  color: #5d3f78 !important;
  border-color: #c7afd8 !important;
}

.ag-status-step.status-completed.is-active {
  background: #e6ebf2 !important;
  color: #2e4666 !important;
  border-color: #c1ccda !important;
}

.ag-status-step.status-cancelled.is-active {
  background: #eceff3 !important;
  color: #59616d !important;
  border-color: #cfd5dd !important;
}

.ag-detail-back-button {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--surida-icon-border);
  border-radius: 9px;
  background: var(--surida-icon-bg);
  color: var(--brand);
  cursor: pointer;
  box-shadow: none;
}

.ag-detail-back-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ag-detail-back-button:hover,
.ag-detail-back-button:focus-visible {
  border-color: var(--surida-icon-border-hover);
  background: var(--surida-icon-bg-hover);
  color: var(--brand);
  outline: 0;
}

.ag-record-card {
  border: 1px solid var(--ag-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  overflow: visible;
}

.ag-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-height: 48px;
  padding: 8px;
  border-bottom: 0;
  background: transparent;
}

.ag-tab,
.ag-tab-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid #dfe4ea;
  border-radius: 6px;
  background: #ffffff;
  color: #26323f;
  padding: 0 18px;
  font-size: 0.93rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  box-shadow: none;
}

.ag-tab.is-active {
  background: #eef1f5;
  color: #1f2937;
  border-color: #d6dde5;
}

.ag-tab-body {
  min-height: 330px;
}

.ag-form {
  padding: 18px 20px 30px;
}

.ag-ficha-grid,
.ag-form-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 18px 26px;
  align-items: end;
}

.ag-ficha-grid label,
.ag-form-row label {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: #111827;
  font-size: 0.9rem;
  font-weight: 620;
}

.ag-ficha-grid input,
.ag-ficha-grid select,
.ag-ficha-grid textarea,
.ag-form-row input,
.ag-form-row select,
.ag-form-row textarea {
  font-weight: 450;
}

.ag-side-meta {
  grid-column: span 2;
  justify-self: end;
  align-self: start;
  line-height: 2.15;
  color: #58616c;
}

.ag-form input,
.ag-form select,
.ag-form textarea,
.ag-table input,
.ag-table select,
.ag-table textarea {
  width: 100%;
  min-height: 33px;
  border: 1px solid #cfd8e3;
  border-radius: 4px;
  background: #fff;
  color: #243244;
  padding: 6px 9px;
}

.ag-form input:read-only,
.ag-form textarea:read-only {
  background: #fff;
}

.ag-form input:disabled,
.ag-form select:disabled {
  background: #ececec;
  color: #4b5563;
}

.ag-form textarea {
  min-height: 134px;
  resize: vertical;
}

.ag-form-row .wide {
  grid-column: span 3;
}

.ag-band,
.ag-subsection-title {
  margin: 28px -20px 16px;
  background: var(--ag-band);
  color: #111827;
  padding: 11px 15px;
  font-size: 1.12rem;
  font-weight: 500;
}

.ag-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ag-subsection-title {
  margin: 18px 0 12px;
  background: var(--ag-band-soft);
}

.ag-billing-figure-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #111827;
  font-size: 0.94rem;
  font-weight: 720;
}

.ag-billing-figure-field span {
  white-space: nowrap;
}

.ag-billing-figure-field select {
  width: auto;
  min-width: 190px;
  min-height: 32px;
  padding: 4px 34px 4px 10px;
  border-radius: 4px;
  font-weight: 620;
}

.ag-action-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--ag-border);
}

.ag-action-left,
.ag-action-right {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ag-action-right {
  justify-content: flex-end;
  margin-left: auto;
}

.ag-dark-btn.is-danger {
  border: 1px solid #f2c8c2;
  background: #fff7f5;
  color: #b3392e;
}

.ag-dark-btn.is-danger:hover,
.ag-dark-btn.is-danger:focus-visible {
  background: #fee9e5;
}

.ag-top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 14px 18px;
}

.project-tab-actions {
  align-items: center;
  justify-content: space-between;
}

.ag-table-block {
  padding: 18px 14px 26px;
}

.ag-table-block h2 {
  margin: 0 0 16px;
  font-size: 1.2rem;
  font-weight: 500;
}

.ag-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.ag-table th,
.ag-table td {
  border: 1px solid var(--line);
  padding: 10px;
  vertical-align: middle;
}

.ag-table th {
  background: #eeeeec;
  color: var(--brand);
  font-weight: 900;
}

.ag-table td {
  background: #fff;
}

.ag-table td small {
  display: block;
  margin-top: 4px;
  color: #627189;
}

.ag-empty {
  padding: 12px;
  color: #4b5563;
  text-align: center;
}

.ag-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ag-row-actions.is-icon-group {
  flex-wrap: nowrap;
}

.ag-icon-button {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #d9d5cd;
  border-radius: 8px;
  background: #f3f0eb;
  color: var(--brand);
  cursor: pointer;
}

.ag-icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ag-icon-button:hover,
.ag-icon-button:focus-visible {
  border-color: #c7bfb5;
  background: #ffffff;
  outline: 0;
}

.ag-icon-button.is-danger {
  border-color: #f2c8c2;
  background: #fff7f5;
  color: #b3392e;
}

.ag-icon-button.is-danger:hover,
.ag-icon-button.is-danger:focus-visible {
  background: #fee9e5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ag-followups {
  width: min(890px, 100%);
  margin-top: 18px;
  border: 1px solid var(--ag-border);
  border-radius: 4px;
  background: #fff;
}

.ag-followups > summary {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  color: #17212b;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

.ag-followups > summary::-webkit-details-marker {
  display: none;
}

.ag-followups > summary::after {
  content: "+";
  margin-left: auto;
  color: var(--brand);
  font-size: 1.1rem;
}

.ag-followups[open] > summary {
  border-bottom: 1px solid #edf0f3;
}

.ag-followups[open] > summary::after {
  content: "-";
}

.ag-followups-input,
.ag-followups-count {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid #edf0f3;
}

.ag-followups-input input {
  flex: 1;
  min-height: 34px;
  border: 1px solid #cfd8e3;
  border-radius: 4px;
  padding: 6px 9px;
}

.ag-followups-count {
  justify-content: flex-end;
  border-bottom: 0;
  color: #6b7280;
}

.ag-followups-list {
  display: grid;
}

.ag-followup-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 34px;
  align-items: start;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid #edf0f3;
}

.ag-followup-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #6b7280;
  font-size: 0.84rem;
}

.ag-followup-meta strong {
  color: #17212b;
}

.ag-followup-item p {
  margin: 5px 0 0;
  white-space: pre-wrap;
}

.ag-followup-delete {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #f2c8c2;
  border-radius: 6px;
  background: #fff7f5;
  color: #b3392e;
  font-size: 0.72rem;
  font-weight: 930;
  cursor: pointer;
}

.ag-followup-delete:hover {
  background: #fee9e5;
}

.ag-avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #243244;
  color: #fff;
  font-weight: 900;
}

.ag-avatar.small {
  width: 30px;
  height: 30px;
  font-size: 0.78rem;
}

.ag-dark-btn {
  border: 0;
  border-radius: 4px;
  background: var(--ag-dark);
  color: #fff;
  min-height: 32px;
  padding: 6px 11px;
  font-weight: 800;
}

.ag-action-footer {
  align-items: center;
  gap: 12px;
}

.ag-action-footer .ag-dark-btn,
.ag-action-footer .button.secondary.mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  height: 36px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--surida-icon-border);
  border-radius: 8px;
  background: var(--surida-icon-bg);
  color: var(--brand);
  box-shadow: none;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  box-sizing: border-box;
}

.ag-action-footer .ag-dark-btn:hover,
.ag-action-footer .ag-dark-btn:focus-visible,
.ag-action-footer .button.secondary.mini:hover,
.ag-action-footer .button.secondary.mini:focus-visible {
  border-color: var(--surida-icon-border-hover);
  background: var(--surida-icon-bg-hover);
  color: var(--brand);
  filter: none;
}

.ag-action-footer .ag-dark-btn.is-danger {
  min-width: 104px;
  height: 36px;
  min-height: 36px;
  border-color: var(--surida-icon-danger-border);
  background: var(--surida-icon-danger-bg);
  color: var(--surida-icon-danger-color);
}

.ag-action-footer .ag-dark-btn.is-danger:hover,
.ag-action-footer .ag-dark-btn.is-danger:focus-visible {
  border-color: #d79d8e;
  background: #f3ded8;
  color: #833326;
}

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

.toolbar form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #cdd5de;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
}

textarea {
  min-height: 94px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: #7d90ad;
  box-shadow: 0 0 0 3px rgba(109, 127, 156, 0.18);
}

.main-search {
  min-width: min(420px, 100%);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 11px 12px;
  border-right: 1px solid var(--soft-line);
  border-bottom: 1px solid var(--soft-line);
  text-align: left;
  vertical-align: top;
}

th:last-child,
td:last-child {
  border-right: 0;
}

th {
  background: #eeeeec;
  color: #23334d;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: none;
}

tr:last-child td {
  border-bottom: 0;
}

td strong {
  display: block;
  color: var(--brand);
  font-weight: 920;
}

td small,
.muted {
  color: var(--muted);
}

td > small {
  display: block;
  margin-top: 3px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.pill.active,
.pill.paid,
.pill.ok {
  border-color: #ccd8d0;
  background: #eef3ef;
  color: #3e5550;
}

.pill.pending,
.pill.warn {
  border-color: var(--salmon-line);
  background: var(--salmon);
  color: #8f1f18;
}

.pill.paused {
  border-color: #d7e3ec;
  background: #edf4f8;
  color: #365268;
}

.pill.plan-free {
  border-color: #d7e3ec;
  background: #f5f8fb;
  color: #365268;
}

.pill.plan-premium,
.pill.plan-personalizado {
  border-color: #b8ddd7;
  background: #eef9f7;
  color: #0f625e;
}

.pill.cancelled,
.pill.overdue,
.pill.danger {
  border-color: var(--salmon-line);
  background: var(--salmon);
  color: var(--red);
}

.split {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(0, 1.58fr);
  gap: 16px;
}

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

.list-row {
  width: 100%;
  min-height: 78px;
  padding: 12px;
  text-align: left;
  box-shadow: none;
}

.list-row:hover,
.list-row.is-active {
  border-color: #c7bfb5;
  background: #f7f5f0;
}

.list-row strong {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.list-row span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.mini-card {
  min-height: 76px;
  padding: 12px;
  box-shadow: none;
}

.mini-card span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-card strong,
.mini-card a {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-weight: 820;
  overflow-wrap: anywhere;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-height: 72px;
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--soft-line);
  background: #ffffff;
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 900;
  text-transform: uppercase;
}

.tab.is-active {
  border-color: #d6dde5;
  background: #e7ecf2;
  color: var(--ink);
}

.tab:hover {
  border-color: #c8c0b7;
  background: #f8f7f4;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f5f1;
}

.segment {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #3e5264;
  font-size: 0.8rem;
  font-weight: 820;
}

.segment.is-active,
.segment:hover {
  border-color: #c8c0b7;
  background: #ffffff;
  color: var(--brand);
}

.period-filter {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(120px, 150px) minmax(110px, 140px) max-content;
  gap: 10px;
  align-items: end;
}

.stats-tools .page-tools-main {
  grid-template-columns: minmax(250px, 0.48fr) minmax(460px, 1fr) max-content;
}

.stats-tools .period-filter {
  min-width: 0;
}

.secret-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.secret-value {
  padding: 5px 8px;
  border: 1px solid #cfdbe5;
  border-radius: 8px;
  background: #f7fafc;
  color: var(--brand);
  font-weight: 850;
}

.pin-overlay,
.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(19, 34, 53, 0.36);
}

.pin-card,
.record-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 42px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 31, 45, 0.28);
}

.pin-card {
  width: min(560px, calc(100vw - 28px));
  padding: 20px;
}

.pin-number {
  display: block;
  width: 100%;
  margin: 14px 0;
  padding: 16px;
  border: 1px solid #cfdbe5;
  border-radius: 8px;
  background: #f7fafc;
  color: var(--brand);
  font-size: 1.8rem;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.12em;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.dialog-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.dialog-body {
  padding: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

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

.span-3 {
  grid-column: 1 / -1;
}

.dialog-section {
  margin-top: 4px;
  padding: 10px 0 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-top: 1px solid var(--line);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.empty {
  margin: 0;
  padding: 16px;
  border: 1px dashed #cfdbe5;
  border-radius: 8px;
  color: var(--muted);
  background: #f8fafc;
}

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

.candidate-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.18fr) minmax(220px, 1fr) minmax(180px, 0.8fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  box-shadow: none;
}

.candidate-row strong {
  font-size: 1rem;
}

.candidate-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.notice {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 5px solid #d9d3c6;
  border-radius: 8px;
  background: #f8f6f1;
  color: #314356;
}

.notice strong {
  color: var(--brand);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  max-width: 420px;
  padding: 12px 14px;
  border: 1px solid #cfdbe5;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 46px rgba(15, 31, 45, 0.2);
  color: var(--ink);
  font-weight: 780;
}

.file-input {
  max-width: 280px;
}

.compact-table table {
  min-width: 0;
}

.compact-table th {
  width: 190px;
}

@media (max-width: 1180px) {
  .app-header {
    grid-template-columns: 84px 46px minmax(0, 1fr) auto;
  }

  .header-brand .brand-subtitle {
    display: none;
  }

  .header-actions .header-pill:not(.user-pill) {
    min-width: 44px;
    padding: 8px 10px;
  }

  .cols-4,
  .module-grid,
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split,
  .cols-2 {
    grid-template-columns: 1fr;
  }

  .top-strip,
  .page-tools-main,
  .stats-tools .page-tools-main,
  .page-subbar,
  .period-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-title-actions,
  .page-tools-right {
    justify-content: flex-start;
  }

  .page-search-form {
    grid-template-columns: minmax(220px, 1fr) 48px max-content;
  }

  .page-filter-panel {
    right: auto;
    left: 0;
    width: min(520px, calc(100vw - 120px));
  }
}

@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .app-header {
    position: static;
    grid-template-columns: 58px 42px minmax(0, 1fr);
    height: auto;
    min-height: 58px;
  }

  .header-mark {
    width: 58px;
    height: 58px;
  }

  .header-mark .brand-logo {
    width: 34px;
    height: 34px;
  }

  .hamburger {
    margin-left: 0;
  }

  .header-brand {
    padding-left: 10px;
  }

  .header-brand .brand-name {
    font-size: 1.35rem;
    letter-spacing: 0.18em;
  }

  .header-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding: 6px 8px 8px;
    overflow-x: auto;
  }

  .sidebar {
    grid-column: 1;
    grid-row: 2;
    position: static;
    width: 100%;
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar:hover,
  .sidebar:focus-within {
    width: 100%;
  }

  .nav {
    width: 100%;
  }

  .nav {
    grid-template-columns: repeat(6, minmax(42px, 1fr));
    padding: 8px;
    gap: 6px;
  }

  .nav-group {
    margin: 0;
  }

  .nav-group-title {
    display: none;
  }

  .nav-button {
    width: 100%;
    min-height: 46px;
  }

  .main {
    grid-column: 1;
    grid-row: 3;
    padding: 14px 12px 36px;
  }

  .topbar,
  .toolbar,
  .page-title-actions,
  .page-tools-right,
  .ag-record-name,
  .dialog-header {
    align-items: stretch;
    flex-direction: column;
  }

  .actions,
  .form-actions {
    justify-content: flex-start;
  }

  .cols-3,
  .cols-4,
  .module-grid,
  .detail-grid,
  .top-strip,
  .page-tools-main,
  .stats-tools .page-tools-main,
  .page-search-form,
  .page-filter-grid,
  .page-subbar,
  .ag-record-status-row,
  .period-filter,
  .ag-ficha-grid,
  .ag-form-row,
  .form-grid,
  .candidate-row {
    grid-template-columns: 1fr;
  }

  .ag-side-meta,
  .ag-form-row .wide {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .ag-status-stepper,
  .ag-tabs,
  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .ag-band,
  .project-tab-actions,
  .ag-action-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .ag-action-right,
  .ag-row-actions {
    justify-content: flex-start;
  }

  .page-filter-panel {
    position: static;
    width: 100%;
    margin-top: 8px;
  }

  .subbar-pager {
    justify-content: flex-start;
  }

  .span-2,
  .span-3 {
    grid-column: 1 / -1;
  }
}

/* Asistente HORADIA */
.assistant-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.assistant-health-card,
.assistant-control-card {
  display: flex;
  min-height: 176px;
  align-items: center;
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.assistant-health-card {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 88% 18%, rgba(82, 196, 183, 0.3), transparent 34%),
    linear-gradient(135deg, #061d3e 0%, #123e55 100%);
  box-shadow: 0 18px 38px rgba(6, 29, 62, 0.18);
}

.assistant-health-card .eyebrow,
.assistant-health-card p {
  color: rgba(255, 255, 255, 0.72);
}

.assistant-health-card h2,
.assistant-control-card h2 {
  margin: 4px 0 8px;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.assistant-score-ring {
  position: relative;
  display: grid;
  width: 112px;
  min-width: 112px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#61d4c2 calc(var(--assistant-score) * 1%), rgba(255, 255, 255, 0.16) 0);
}

.assistant-score-ring::before {
  position: absolute;
  width: 82px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #0c304a;
  content: "";
}

.assistant-score-ring span,
.assistant-score-ring small {
  position: relative;
  z-index: 1;
}

.assistant-score-ring span {
  align-self: end;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.assistant-score-ring small {
  align-self: start;
  color: rgba(255, 255, 255, 0.62);
  font-weight: 700;
}

.assistant-control-card {
  justify-content: space-between;
  background: linear-gradient(135deg, #fff 0%, #f4f7f6 100%);
}

.assistant-control-card > div {
  max-width: 620px;
}

.assistant-control-card > label {
  display: grid;
  min-width: 230px;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.assistant-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
  gap: 14px;
  margin: 14px 0;
  align-items: start;
}

.assistant-priority-panel,
.assistant-chat-panel,
.assistant-project-panel,
.assistant-activity-panel {
  border-radius: 14px;
}

.assistant-count {
  display: grid;
  min-width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.assistant-action-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.assistant-action {
  padding: 16px 16px 14px;
  border: 1px solid var(--soft-line);
  border-left: 4px solid #6d7f9c;
  border-radius: 10px;
  background: #fff;
}

.assistant-action.priority-critical { border-left-color: #b33a31; background: #fff9f8; }
.assistant-action.priority-high { border-left-color: #c27a1e; background: #fffaf2; }
.assistant-action.priority-medium { border-left-color: #2c7a79; }
.assistant-action.priority-low { border-left-color: #7a8797; }

.assistant-action-topline,
.assistant-action-footer,
.assistant-message footer,
.assistant-project-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.assistant-action-topline {
  flex-wrap: wrap;
}

.assistant-priority,
.assistant-category {
  padding: 4px 8px;
  border-radius: 999px;
  background: #e9eef2;
  color: #29465f;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.priority-critical .assistant-priority { background: #f7dcd8; color: #8d2820; }
.priority-high .assistant-priority { background: #f8e5c5; color: #80500f; }

.assistant-action h3 {
  margin: 10px 0 6px;
  font-size: 1rem;
}

.assistant-action > p,
.assistant-recommendation span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.assistant-recommendation {
  display: grid;
  gap: 3px;
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2);
}

.assistant-recommendation strong {
  color: var(--ink);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.assistant-action-footer {
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--soft-line);
}

.assistant-action-footer > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.assistant-empty-state {
  display: grid;
  min-height: 230px;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.assistant-empty-state > span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: #e2f2ec;
  color: var(--green);
}

.assistant-empty-state svg,
.topbar .actions svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.assistant-online-dot {
  width: 10px;
  height: 10px;
  border: 3px solid #d8eee7;
  border-radius: 50%;
  background: #2b8a66;
  box-sizing: content-box;
}

.assistant-question-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
  background: var(--surface-2);
}

.assistant-question-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.assistant-question-form textarea {
  min-height: 104px;
  resize: vertical;
}

.assistant-conversation {
  display: grid;
  max-height: 640px;
  gap: 12px;
  margin-top: 14px;
  overflow-y: auto;
}

.assistant-message {
  padding: 14px;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
}

.assistant-message-question,
.assistant-message-answer {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
}

.assistant-message-question p,
.assistant-message-answer p {
  margin: 0 0 10px;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.assistant-message-answer {
  padding-top: 10px;
  border-top: 1px solid var(--soft-line);
}

.assistant-message-answer > strong { color: var(--teal); }

.assistant-message footer {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.66rem;
}

.assistant-message footer span + span::before,
.assistant-message footer time::before {
  margin-right: 8px;
  content: "\00b7";
}

.assistant-project-panel,
.assistant-activity-panel {
  margin-top: 14px;
}

.assistant-project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.assistant-project-card {
  padding: 16px;
  border: 1px solid var(--soft-line);
  border-top: 3px solid #6d7f9c;
  border-radius: 10px;
  background: #fff;
}

.assistant-project-card.tone-good { border-top-color: #2c8164; }
.assistant-project-card.tone-warning { border-top-color: #b27924; }
.assistant-project-card.tone-danger { border-top-color: #aa3d35; }

.assistant-project-heading {
  justify-content: space-between;
  align-items: flex-start;
}

.assistant-project-heading span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.assistant-project-heading h3 {
  margin: 4px 0 0;
  font-size: 0.98rem;
}

.assistant-project-heading > strong {
  font-size: 1.45rem;
}

.assistant-project-heading small {
  color: var(--muted);
  font-size: 0.64rem;
}

.assistant-progress {
  height: 6px;
  margin: 14px 0;
  overflow: hidden;
  border-radius: 99px;
  background: #e6e9ec;
}

.assistant-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #164b61, #38a38c);
}

.assistant-project-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0 0 14px;
}

.assistant-project-card dl > div {
  padding: 8px;
  border-radius: 7px;
  background: var(--surface-2);
}

.assistant-project-card dt {
  color: var(--muted);
  font-size: 0.66rem;
}

.assistant-project-card dd {
  margin: 2px 0 0;
  font-size: 0.82rem;
  font-weight: 800;
}

.assistant-activity-list {
  display: grid;
  gap: 0;
  margin-top: 14px;
}

.assistant-activity-list article {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--soft-line);
}

.assistant-activity-marker {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(18, 124, 119, 0.12);
}

.assistant-activity-list p,
.assistant-activity-list time {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.assistant-activity-list time {
  font-size: 0.66rem;
}

@media (max-width: 1120px) {
  .assistant-main-grid,
  .assistant-hero {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .assistant-health-card,
  .assistant-control-card {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .assistant-control-card > label {
    width: 100%;
    min-width: 0;
  }

  .assistant-main-grid,
  .assistant-project-grid {
    grid-template-columns: 1fr;
  }

  .assistant-action-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .assistant-action-footer > div {
    justify-content: flex-start;
  }

  .assistant-message-question,
  .assistant-message-answer {
    grid-template-columns: 1fr;
  }
}

/* Marco global copiado del lenguaje SURIDA: cabecera, rail, listados y controles. */
:root {
  --bg: #f3f2ef;
  --surface: #ffffff;
  --surface-2: #f8f7f4;
  --ink: #1d2630;
  --muted: #6d7379;
  --line: #ddd9d2;
  --soft-line: #ece9e4;
  --brand: #071834;
  --brand-2: #576e91;
  --cream: #f1f0ed;
  --rail: #f8f8f7;
  --shadow: 0 6px 16px rgba(24, 31, 38, 0.07);
}

html,
body,
#app {
  background: var(--bg);
}

body {
  color: var(--ink);
  font-size: 16px;
}

.layout {
  grid-template-columns: 84px minmax(0, 1fr);
  grid-template-rows: 60px minmax(0, 1fr);
  background: var(--bg);
}

.app-header {
  height: 60px;
  grid-template-columns: 84px 58px minmax(0, 1fr) auto;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
  backdrop-filter: none;
}

.header-mark {
  height: 60px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.header-mark .brand-logo {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
}

.hamburger {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 46px;
  margin-left: 22px;
  border: 1px solid var(--surida-icon-border);
  border-radius: 10px;
  background: var(--surida-icon-bg);
  color: var(--brand);
  box-shadow: none;
}

.hamburger svg,
.header-pill svg,
.header-plus svg,
.nav-icon svg,
.search-glyph svg,
.page-filter-menu summary svg,
.page-refresh svg,
.icon-button svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-brand {
  gap: 20px;
  padding-left: 28px;
}

.header-brand .brand-name {
  color: var(--brand-2);
  font-size: 2.02rem;
  font-weight: 860;
  letter-spacing: 0.24em;
}

.header-brand .brand-subtitle {
  color: #263856;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.header-actions {
  gap: 10px;
  padding-right: 24px;
}

.header-pill,
.header-plus {
  min-height: 48px;
  border: 1px solid var(--surida-icon-border);
  border-radius: 12px;
  background: #ffffff;
  color: var(--brand);
  box-shadow: none;
  padding: 0 12px;
  font-size: 0.92rem;
  font-weight: 900;
}

.header-pill .header-icon {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--surida-icon-bg);
  color: var(--brand);
}

.header-pill.is-count {
  min-width: 70px;
}

.header-pill.is-count strong {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--surida-icon-bg);
  color: var(--brand);
  font-size: 0.82rem;
}

.header-plus {
  width: 58px;
  min-width: 58px;
  gap: 5px;
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
  padding: 0 7px;
}

.header-plus span,
.header-plus strong {
  display: inline-grid;
  place-items: center;
}

.header-plus span {
  width: 20px;
}

.header-plus strong {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--brand);
  font-size: 1.02rem;
}

.user-pill {
  color: #68727f;
}

.sidebar {
  top: 60px;
  width: 84px;
  height: calc(100vh - 60px);
  overflow-x: hidden;
  border-right: 1px solid var(--line);
  background: var(--rail);
  transition: width 0.16s ease, box-shadow 0.16s ease;
  z-index: 45;
}

.sidebar:hover,
.sidebar:focus-within {
  width: 278px;
  box-shadow: 16px 0 34px rgba(24, 31, 38, 0.12);
}

.nav {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: 84px;
  padding: 78px 0 18px;
  transition: width 0.16s ease, padding 0.16s ease;
}

.sidebar:hover .nav,
.sidebar:focus-within .nav {
  justify-items: stretch;
  width: 278px;
  padding-inline: 12px;
}

.compact-nav .nav-group {
  display: grid;
  justify-items: center;
  width: 100%;
  gap: 6px;
  margin: 0;
}

.compact-nav .nav-group-title {
  display: block;
  width: 100%;
  height: 18px;
  margin: 8px 0 2px;
  padding: 0 12px;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  white-space: nowrap;
}

.sidebar:hover .compact-nav .nav-group,
.sidebar:focus-within .compact-nav .nav-group {
  justify-items: stretch;
}

.sidebar:hover .nav-group-title,
.sidebar:focus-within .nav-group-title {
  display: block;
  visibility: visible;
  opacity: 1;
  height: auto;
  margin: 8px 0 2px;
  padding: 0 12px;
  color: #8493a3;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  width: 58px;
  min-height: 54px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #596574;
  text-align: left;
  transition: width 0.16s ease, background 0.16s ease, border-color 0.16s ease, padding 0.16s ease;
}

.sidebar:hover .nav-button,
.sidebar:focus-within .nav-button {
  justify-items: start;
  width: 100%;
  padding: 0 12px;
  gap: 12px;
}

.nav-button > span:not(.nav-icon) {
  display: block;
  width: 0;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  color: #405064;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  transition: opacity 0.12s ease, max-width 0.16s ease;
}

.sidebar:hover .nav-button > span:not(.nav-icon),
.sidebar:focus-within .nav-button > span:not(.nav-icon) {
  width: auto;
  max-width: 180px;
  opacity: 1;
}

.nav-button:hover,
.nav-button.is-active {
  border-color: #d4d8de;
  background: #e9ecef;
  color: var(--brand);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: #eef2f5;
  color: #526070;
}

.nav-icon svg {
  width: 21px;
  height: 21px;
}

.nav-button:hover .nav-icon,
.nav-button.is-active .nav-icon {
  background: var(--brand);
  color: #ffffff;
}

.main {
  padding: 18px 18px 56px;
  background: var(--bg);
}

.project-summary-grid {
  margin: 0 0 14px;
}

.project-tab-button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.page-tools {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.page-tools-main {
  grid-template-columns: minmax(300px, 0.7fr) minmax(420px, 1.3fr) max-content;
  min-height: 74px;
  padding: 10px 18px;
}

.page-title {
  color: var(--brand);
  font-size: 1.35rem;
  font-weight: 900;
}

.page-export .button,
.button.mini {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 900;
}

.page-search-form {
  grid-template-columns: minmax(260px, 1fr) 48px max-content;
  gap: 8px;
}

.page-search input {
  min-height: 50px;
  padding-left: 54px;
  border: 0;
  border-radius: 8px;
  background: #efeeee;
  color: #26384d;
  box-shadow: none;
  font-size: 0.94rem;
  font-weight: 760;
}

.page-search input::placeholder {
  color: #6f7f91;
  font-weight: 760;
}

.search-glyph {
  left: 18px;
  color: #6c7a8c;
}

.search-glyph svg {
  width: 18px;
  height: 18px;
}

.page-filter-menu summary {
  width: 48px;
  height: 48px;
  min-height: 48px;
  border: 1px solid var(--surida-icon-border);
  border-radius: 10px;
  background: var(--surida-icon-bg);
  color: #687789;
  box-shadow: none;
  font-size: 0;
}

.page-filter-menu summary svg {
  width: 18px;
  height: 18px;
}

.page-filter-menu[open] summary,
.page-filter-menu summary:hover {
  border-color: var(--surida-icon-border-hover);
  background: #ffffff;
  color: var(--brand);
}

.page-filter-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}

.page-submit {
  min-height: 48px;
}

.page-tools-right {
  gap: 10px;
}

.result-count {
  font-size: 0.84rem;
  font-weight: 760;
}

.button,
.icon-button,
.ag-icon-button {
  border-color: var(--surida-icon-border);
  background: var(--surida-icon-bg);
  color: var(--brand);
  box-shadow: none;
  font-weight: 900;
}

.button:hover,
.icon-button:hover,
.ag-icon-button:hover {
  border-color: var(--surida-icon-border-hover);
  background: var(--surida-icon-bg-hover);
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.icon-button.page-refresh {
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  border-radius: 10px;
}

.icon-button.page-refresh svg {
  width: 18px;
  height: 18px;
}

.page-subbar {
  min-height: 54px;
  padding: 8px 18px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.subbar-result {
  color: var(--muted);
  font-weight: 760;
}

.toolbar-chip,
.segment {
  min-height: 34px;
  border-color: #d7e3ec;
  background: #f5f8fb;
  color: #405368;
  font-size: 0.78rem;
  font-weight: 780;
}

.segmented {
  border-color: #d7e3ec;
  background: #f5f8fb;
}

.page-size,
.page-number {
  min-width: 54px;
  height: 48px;
  border-radius: 10px;
  font-size: 0.98rem;
  font-weight: 900;
}

.subbar-pager {
  gap: 12px;
  color: #27384d;
  font-size: 1rem;
  font-weight: 900;
}

.panel,
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.panel {
  padding: 0;
  overflow: hidden;
}

.stat {
  border-radius: 10px;
  background: #ffffff;
}

th {
  background: #eeeeec;
  color: #172235;
  font-size: 0.82rem;
  font-weight: 900;
}

td {
  color: #071834;
  font-size: 0.96rem;
}

td strong {
  color: var(--brand);
  font-weight: 900;
}

.record-number {
  border-radius: 10px;
  color: var(--brand);
  font-size: 0.95rem;
  font-weight: 900;
}

.record-number span {
  width: 34px;
  height: 34px;
  background: #eef4f9;
  color: var(--brand);
}

.topbar {
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.ag-detail-page {
  margin: -18px -18px 0;
  background: var(--bg);
}

.ticket-table table {
  min-width: 1480px;
}

.ticket-priority {
  font-weight: 900;
}

.ticket-priority.priority-urgente {
  border-color: #d99b90;
  background: #f4d7d2;
  color: #8a2d25;
}

.ticket-priority.priority-alta {
  border-color: #dcc06f;
  background: #f8e8bb;
  color: #6b520d;
}

.ticket-priority.priority-normal {
  border-color: #c1ccda;
  background: #e6ebf2;
  color: #2e4666;
}

.ticket-priority.priority-baja {
  border-color: #c2d4bf;
  background: #dce8da;
  color: #2f5b43;
}

.ticket-integration.integration-sin-preparar {
  border-color: #d7d2c8;
  background: #f4f0e9;
  color: #566273;
}

.ticket-integration.integration-preparado,
.ticket-integration.integration-codex-pendiente {
  border-color: #c5d7e6;
  background: #e7f1f9;
  color: #163e5e;
}

.ticket-integration.integration-issue-creada,
.ticket-integration.integration-codex-en-curso {
  border-color: #dfc36d;
  background: #fff1bd;
  color: #704f00;
}

.ticket-integration.integration-pr-abierta,
.ticket-integration.integration-integrado {
  border-color: #c7d6c6;
  background: #e7f2e0;
  color: #254f2d;
}

.ticket-record-symbol {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--brand);
}

.ticket-record-symbol svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ticket-record-card {
  overflow: hidden;
}

.ticket-detail-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(520px, 1.18fr);
  gap: 0;
  min-height: 600px;
}

.ticket-info-panel,
.ticket-chat-panel {
  min-width: 0;
  background: #ffffff;
}

.ticket-info-panel {
  border-right: 1px solid var(--line);
}

.ticket-info-panel > .ag-band {
  margin: 28px 0 16px;
}

.ticket-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.ticket-fields label {
  display: grid;
  gap: 7px;
  color: #071834;
  font-size: 0.88rem;
  font-weight: 800;
}

.ticket-description {
  margin: 0 18px 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf8;
}

.ticket-description strong,
.ticket-chat-head strong {
  color: var(--brand);
  font-weight: 900;
}

.ticket-description p {
  margin: 8px 0 0;
  color: #43546a;
  line-height: 1.45;
}

.ticket-integration-panel {
  margin: 0 18px 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f7f4;
}

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

.ticket-integration-head strong {
  color: var(--brand);
  font-weight: 900;
}

.ticket-integration-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ticket-integration-grid label {
  display: grid;
  gap: 7px;
  color: #071834;
  font-size: 0.82rem;
  font-weight: 800;
}

.ticket-integration-grid .wide {
  grid-column: 1 / -1;
}

.ticket-integration-link {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
  background: #ffffff;
}

.ticket-integration-panel p {
  margin: 12px 0 0;
  color: #55667d;
  font-size: 0.86rem;
  line-height: 1.45;
}

.ticket-integration-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.ticket-chat-panel {
  display: grid;
  grid-template-rows: auto minmax(280px, 1fr) auto;
}

.ticket-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #f8f7f4;
}

.ticket-chat-head span {
  display: block;
  margin-top: 3px;
  color: #657286;
  font-size: 0.82rem;
  font-weight: 700;
}

.ticket-message-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  overflow: auto;
  background: #f3f2ef;
}

.ticket-message {
  max-width: min(680px, 82%);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(24, 31, 38, 0.04);
}

.ticket-message.is-support {
  align-self: flex-end;
  border-color: #c1ccda;
  background: #eaf0f7;
}

.ticket-message.is-client {
  align-self: flex-start;
}

.ticket-message.is-internal {
  align-self: center;
  max-width: min(760px, 92%);
  border-color: #dcc06f;
  background: #fff7dc;
}

.ticket-message-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.ticket-message-meta strong {
  color: var(--brand);
  font-size: 0.86rem;
  font-weight: 900;
}

.ticket-message-meta span {
  color: #647287;
  font-size: 0.74rem;
  font-weight: 700;
  text-align: right;
}

.ticket-message p {
  margin: 0;
  color: #1d2630;
  line-height: 1.45;
}

.ticket-compose {
  display: grid;
  gap: 10px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.ticket-compose-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
}

.ticket-compose textarea {
  min-height: 86px;
  resize: vertical;
}

@media (max-width: 760px) {
  .layout {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .app-header {
    height: auto;
    min-height: 60px;
  }

  .header-mark {
    height: 60px;
  }

  .main {
    padding: 14px 12px 36px;
  }

  .page-tools-main,
  .page-search-form,
  .page-subbar {
    grid-template-columns: 1fr;
  }

  .page-tools-right,
  .page-title-actions,
  .header-actions {
    justify-content: flex-start;
  }

  .ticket-detail-grid,
  .ticket-fields,
  .ticket-integration-grid,
  .ticket-compose-tools {
    grid-template-columns: 1fr;
  }

  .ticket-info-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .ticket-message {
    max-width: 100%;
  }
}

/* Identidad oficial HORADIA */
:root {
  --brand: #124554;
  --brand-2: #124554;
  --gold: #d1a238;
}

.header-mark {
  overflow: hidden;
  background: #f7f5f1;
}

.header-mark .brand-logo {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 12px;
  background: #f7f5f1;
  object-fit: cover;
  object-position: center;
}

.header-brand {
  gap: 18px;
  overflow: hidden;
}

.header-brand .brand-wordmark {
  display: block;
  width: 210px;
  height: 56px;
  flex: 0 0 auto;
  background: #f7f5f1;
  object-fit: cover;
  object-position: center;
  mix-blend-mode: multiply;
}

.header-brand .brand-subtitle {
  color: var(--brand);
  letter-spacing: 0.07em;
}

.ag-record-symbol {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
  border-radius: 7px;
  background: #f7f5f1;
  object-fit: cover;
  object-position: center;
}

.brand-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 112px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f5f1;
  padding: 10px 18px;
}

.brand-preview img {
  display: block;
  background: #f7f5f1;
  object-fit: cover;
  object-position: center;
  mix-blend-mode: multiply;
}

.brand-preview-logo {
  width: min(52%, 310px);
  height: 92px;
}

.brand-preview-signature {
  width: min(38%, 230px);
  height: 82px;
}

@media (max-width: 760px) {
  .header-mark .brand-logo {
    width: 40px;
    height: 40px;
  }

  .header-brand .brand-wordmark {
    width: 142px;
    height: 52px;
  }

  .brand-preview {
    align-items: stretch;
    flex-direction: column;
    gap: 2px;
  }

  .brand-preview-logo,
  .brand-preview-signature {
    width: 100%;
    max-width: 300px;
    height: 78px;
    margin: 0 auto;
  }
}

/* Conector central de proyectos */
.connector-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 14px;
  padding: 13px 16px;
  border: 1px solid #dfc36d;
  border-radius: 14px;
  background: #fff8df;
  box-shadow: 0 8px 22px rgba(18, 69, 84, 0.06);
}

.connector-toolbar.is-ready {
  border-color: #bad4c5;
  background: #f0f8f3;
}

.connector-status-copy,
.connector-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.connector-status-copy > div {
  display: grid;
  gap: 3px;
}

.connector-status-copy strong {
  color: var(--brand);
  font-size: 0.94rem;
  font-weight: 900;
}

.connector-status-copy small {
  color: #5f6c79;
  font-size: 0.78rem;
  font-weight: 700;
}

.connector-status-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-radius: 50%;
  background: #d1a238;
  box-shadow: 0 0 0 5px rgba(209, 162, 56, 0.16);
}

.connector-toolbar.is-ready .connector-status-dot {
  background: #2f7654;
  box-shadow: 0 0 0 5px rgba(47, 118, 84, 0.14);
}

.connector-dialog-help {
  display: grid;
  grid-template-columns: max-content repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f5f1;
}

.connector-dialog-help strong {
  color: var(--brand);
}

.connector-dialog-help code {
  padding: 7px 8px;
  border: 1px solid #d9d5cc;
  border-radius: 7px;
  background: #ffffff;
  color: #314356;
  font-size: 0.78rem;
  text-align: center;
}

.connector-dialog-help p {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: #5d6b78;
  font-size: 0.82rem;
}

.connector-checkbox {
  display: flex !important;
  grid-template-columns: none !important;
  flex-direction: row;
  align-items: center;
  gap: 10px !important;
}

.connector-checkbox input {
  width: 18px;
  height: 18px;
}

.connector-security-note {
  margin: 0;
  color: #5d6b78;
  font-size: 0.8rem;
  line-height: 1.45;
}

.report-table table {
  min-width: 1320px;
}

.report-table td:nth-child(2) {
  min-width: 320px;
}

.report-table td code {
  color: #405267;
  font-size: 0.75rem;
}

.report-severity.severity-critica {
  border-color: #d79b96;
  background: #fbe4e1;
  color: #8f2923;
}

.report-severity.severity-alta {
  border-color: #e3b888;
  background: #fff0dc;
  color: #8a4c11;
}

.report-severity.severity-media {
  border-color: #dfc36d;
  background: #fff4c9;
  color: #735600;
}

.report-severity.severity-baja,
.report-severity.severity-info {
  border-color: #bdd5df;
  background: #eaf4f7;
  color: #245168;
}

.report-payload {
  position: relative;
}

.report-payload summary {
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.report-payload pre {
  width: 360px;
  max-height: 220px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8fa;
  color: #26384a;
  font: 0.72rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 760px) {
  .connector-toolbar,
  .connector-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .connector-actions .button {
    width: 100%;
  }

  .connector-dialog-help {
    grid-template-columns: 1fr;
  }

  .connector-dialog-help p {
    grid-column: auto;
  }
}

/* Ultima capa responsive: evita que el marco de escritorio vuelva a imponerse
   por las capas de estilo heredadas que aparecen antes en este archivo. */
@media (max-width: 760px) {
  html,
  body,
  #app {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    width: 100%;
    min-width: 0;
  }

  .app-header {
    position: static;
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: 56px 54px minmax(0, 1fr);
    width: 100%;
    height: auto;
    min-height: 58px;
  }

  .header-mark {
    width: 56px;
    height: 58px;
  }

  .hamburger {
    width: 44px;
    height: 44px;
    margin-left: 5px;
  }

  .header-brand {
    gap: 0;
    min-width: 0;
    padding-left: 6px;
  }

  .header-brand .brand-wordmark {
    width: min(142px, 100%);
    height: 52px;
  }

  .header-brand .brand-subtitle {
    display: none;
  }

  .header-actions {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
    padding: 6px 8px 8px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .header-pill,
  .header-plus {
    min-width: 48px;
    min-height: 42px;
    padding: 4px 7px;
  }

  .header-pill > span:not(.header-icon),
  .user-pill > span:last-child {
    display: none;
  }

  .sidebar,
  .sidebar:hover,
  .sidebar:focus-within {
    position: static;
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    height: auto;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: none;
  }

  .nav,
  .sidebar:hover .nav,
  .sidebar:focus-within .nav {
    display: flex;
    width: max-content;
    min-width: 100%;
    justify-content: flex-start;
    gap: 6px;
    padding: 8px;
  }

  .nav-button,
  .sidebar:hover .nav-button,
  .sidebar:focus-within .nav-button {
    display: grid;
    grid-template-columns: 1fr;
    width: 48px;
    min-width: 48px;
    min-height: 46px;
    padding: 0;
  }

  .nav-button > span:not(.nav-icon),
  .sidebar:hover .nav-button > span:not(.nav-icon),
  .sidebar:focus-within .nav-button > span:not(.nav-icon) {
    display: none;
  }

  .main {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    min-width: 0;
    padding: 12px 10px 32px;
    overflow: hidden;
  }

  .topbar,
  .page-tools,
  .panel,
  .grid,
  .fiscal-layout {
    min-width: 0;
    max-width: 100%;
  }

  .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
  }
}

/* ========================================================================== */
/* HORADIA 2026 · Soft Bento Dashboard                                      */
/* Capa visual final: conserva la lógica existente y unifica todas las vistas. */
/* ========================================================================== */

:root {
  --bg: #f3eee5;
  --surface: #fffdf8;
  --surface-2: #f8f3ea;
  --ink: #173b3d;
  --muted: #6d7b77;
  --line: rgba(34, 76, 72, 0.12);
  --soft-line: rgba(34, 76, 72, 0.08);
  --brand: #174f4f;
  --brand-2: #2e6a67;
  --cream: #f8f1e5;
  --rail: rgba(255, 253, 248, 0.86);
  --salmon: #edc4b2;
  --salmon-line: #d9957a;
  --teal: #2c7771;
  --gold: #d1a238;
  --red: #a54b40;
  --green: #39745b;
  --sage: #dce7da;
  --sand: #eadcc5;
  --peach: #f0d1bd;
  --sky: #dbe9e6;
  --shadow: 0 18px 44px rgba(43, 66, 59, 0.08);
  --shadow-soft: 0 9px 24px rgba(43, 66, 59, 0.065);
  --shadow-hover: 0 22px 48px rgba(43, 66, 59, 0.13);
  --radius: 24px;
  --radius-small: 16px;
  --radius-large: 32px;
  --surida-icon-bg: rgba(23, 79, 79, 0.07);
  --surida-icon-bg-hover: rgba(23, 79, 79, 0.12);
  --surida-icon-border: rgba(23, 79, 79, 0.12);
  --surida-icon-border-hover: rgba(23, 79, 79, 0.25);
  font-family: "Segoe UI Variable", "Aptos", "Avenir Next", Inter, ui-sans-serif, system-ui, sans-serif;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--bg);
}

body,
#app {
  min-height: 100%;
  background:
    radial-gradient(circle at 8% 4%, rgba(237, 196, 178, 0.34), transparent 28rem),
    radial-gradient(circle at 92% 12%, rgba(220, 231, 218, 0.7), transparent 32rem),
    var(--bg);
}

body {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.48;
  text-rendering: optimizeLegibility;
}

::selection {
  color: #fff;
  background: var(--brand-2);
}

:focus-visible {
  outline: 3px solid rgba(209, 162, 56, 0.42);
  outline-offset: 3px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 78px 76px minmax(0, 1fr);
  min-height: 100vh;
  background: transparent;
}

/* Cabecera fija, ligera y sin barreras visuales. */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-columns: 72px minmax(260px, 1fr) auto;
  align-items: center;
  width: 100%;
  height: 78px;
  padding: 0 24px;
  border: 0;
  background: rgba(255, 253, 248, 0.84);
  box-shadow: 0 1px 0 rgba(23, 79, 79, 0.07);
  backdrop-filter: blur(22px) saturate(1.15);
}

.header-mark {
  width: 56px;
  height: 56px;
  overflow: hidden;
  border: 1px solid rgba(23, 79, 79, 0.1);
  border-radius: 19px;
  background: #fffaf2;
  box-shadow: var(--shadow-soft);
}

.header-mark .brand-logo {
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 16px;
  background: transparent;
}

.hamburger {
  display: none;
}

.header-brand {
  gap: 20px;
  min-width: 0;
  padding: 0 12px;
}

.header-brand .brand-wordmark {
  width: 190px;
  height: 58px;
  background: transparent;
  mix-blend-mode: multiply;
}

.header-brand .brand-subtitle {
  max-width: 360px;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 780;
  letter-spacing: 0.115em;
}

.header-actions {
  gap: 8px;
  padding: 0;
}

.header-pill,
.header-plus {
  min-height: 46px;
  border: 1px solid rgba(23, 79, 79, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--brand);
  box-shadow: none;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.header-pill:hover,
.header-plus:hover {
  transform: translateY(-2px);
  border-color: rgba(23, 79, 79, 0.2);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.header-pill .header-icon,
.header-pill.is-count strong {
  border-radius: 12px;
  background: rgba(23, 79, 79, 0.07);
}

.header-plus {
  border-color: transparent;
  background: var(--brand);
  color: #fff;
}

.header-plus strong {
  border-radius: 10px;
  color: var(--brand);
}

.help-header .header-icon {
  color: #8a6520;
  background: rgba(209, 162, 56, 0.14);
}

/* Navegación superior modular: permanece accesible al hacer scroll. */
.sidebar,
.sidebar:hover,
.sidebar:focus-within {
  position: sticky;
  top: 78px;
  z-index: 90;
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  height: 76px;
  overflow: hidden;
  border: 0;
  background: linear-gradient(to bottom, rgba(243, 238, 229, 0.96), rgba(243, 238, 229, 0.78));
  box-shadow: none;
  backdrop-filter: blur(18px);
}

.nav,
.sidebar:hover .nav,
.sidebar:focus-within .nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: calc(100% - 48px);
  max-width: 1580px;
  height: 64px;
  margin: 0 auto;
  padding: 9px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 8px;
  border: 1px solid rgba(23, 79, 79, 0.09);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: var(--shadow-soft);
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.compact-nav .nav-group,
.sidebar:hover .compact-nav .nav-group,
.sidebar:focus-within .compact-nav .nav-group {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  width: auto;
  gap: 5px;
  margin: 0;
}

.compact-nav .nav-group + .nav-group::before {
  width: 1px;
  height: 28px;
  margin: 0 5px;
  background: rgba(23, 79, 79, 0.1);
  content: "";
}

.compact-nav .nav-group-title,
.sidebar:hover .nav-group-title,
.sidebar:focus-within .nav-group-title {
  display: none;
}

.nav-button,
.sidebar:hover .nav-button,
.sidebar:focus-within .nav-button {
  display: inline-flex;
  grid-template-columns: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 42px;
  min-height: 42px;
  padding: 5px 11px 5px 6px;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 15px;
  color: #54706e;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.nav-button > span:not(.nav-icon),
.sidebar:hover .nav-button > span:not(.nav-icon),
.sidebar:focus-within .nav-button > span:not(.nav-icon) {
  display: block;
  width: auto;
  max-width: 190px;
  overflow: visible;
  opacity: 1;
  color: inherit;
  font-size: 0.77rem;
  font-weight: 760;
  line-height: 1;
}

.nav-icon {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: rgba(23, 79, 79, 0.065);
  color: currentColor;
}

.nav-icon svg {
  width: 17px;
  height: 17px;
}

.nav-button:hover {
  transform: translateY(-1px);
  border-color: rgba(23, 79, 79, 0.08);
  background: var(--cream);
  color: var(--brand);
}

.nav-button.is-active,
.nav-button.is-active:hover {
  border-color: transparent;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 9px 20px rgba(23, 79, 79, 0.19);
}

.nav-button.is-active .nav-icon,
.nav-button:hover .nav-icon {
  background: rgba(255, 255, 255, 0.14);
  color: inherit;
}

/* Lienzo y scroll modular. */
.main {
  grid-column: 1;
  grid-row: 3;
  width: 100%;
  max-width: 1600px;
  min-width: 0;
  margin: 0 auto;
  padding: 22px 28px 88px;
  overflow: visible;
  background: transparent;
}

.main > * {
  scroll-margin-top: 176px;
  animation: bento-reveal 360ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.main > *:nth-child(2) { animation-delay: 35ms; }
.main > *:nth-child(3) { animation-delay: 70ms; }
.main > *:nth-child(4) { animation-delay: 105ms; }

@keyframes bento-reveal {
  from { opacity: 0; transform: translateY(8px) scale(0.995); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.view-help-bar {
  min-height: 38px;
  margin: 0 2px 10px;
}

.view-help-button {
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid rgba(23, 79, 79, 0.11);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.74);
  color: var(--brand-2);
  box-shadow: none;
  backdrop-filter: blur(12px);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.view-help-button:hover,
.view-help-button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(23, 79, 79, 0.18);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

/* Cabeceras de vista como primera pieza Bento. */
.topbar {
  position: relative;
  min-height: 148px;
  margin: 0 0 20px;
  padding: 28px 30px;
  overflow: hidden;
  border: 1px solid rgba(23, 79, 79, 0.08);
  border-radius: var(--radius-large);
  background:
    radial-gradient(circle at 88% 18%, rgba(237, 196, 178, 0.62), transparent 23rem),
    linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(239, 244, 235, 0.96));
  box-shadow: var(--shadow);
}

.topbar::after {
  position: absolute;
  right: -46px;
  bottom: -78px;
  width: 210px;
  height: 170px;
  border: 1px solid rgba(23, 79, 79, 0.08);
  border-radius: 48% 52% 38% 62%;
  background: rgba(255, 255, 255, 0.22);
  content: "";
  pointer-events: none;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.topbar h1 {
  margin: 4px 0 8px;
  color: var(--ink);
  font-size: clamp(1.8rem, 3vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.topbar p {
  max-width: 780px;
  color: var(--muted);
  font-size: 0.96rem;
}

.eyebrow {
  color: var(--brand-2);
  font-size: 0.69rem;
  font-weight: 850;
  letter-spacing: 0.14em;
}

/* Contenedores, bloques y herramientas. */
.page-tools,
.top-strip,
.panel,
.table-wrap,
.connector-toolbar,
.architecture-note,
.help-callout,
.comparison-cards article {
  border-color: rgba(23, 79, 79, 0.1);
  box-shadow: var(--shadow);
}

.page-tools,
.top-strip,
.panel,
.table-wrap {
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.92);
}

.page-tools {
  margin-bottom: 20px;
  overflow: visible;
}

.page-tools-main {
  min-height: 82px;
  padding: 14px 18px;
}

.page-title {
  color: var(--ink);
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.page-subbar {
  min-height: 58px;
  padding: 10px 18px;
  border-color: var(--soft-line);
  border-radius: 0 0 var(--radius) var(--radius);
  background: rgba(248, 243, 234, 0.72);
}

.page-search input,
input,
select,
textarea {
  border: 1px solid rgba(23, 79, 79, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.page-search input {
  border: 1px solid transparent;
  border-radius: 16px;
  background: rgba(23, 79, 79, 0.055);
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(23, 79, 79, 0.2);
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(23, 79, 79, 0.42);
  outline: 0;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(23, 79, 79, 0.08);
}

.button,
.icon-button,
.ag-icon-button,
.page-filter-menu summary,
.segment,
.toolbar-chip {
  border-color: rgba(23, 79, 79, 0.11);
  border-radius: 14px;
  background: rgba(23, 79, 79, 0.065);
  color: var(--brand);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.button:hover,
.icon-button:hover,
.ag-icon-button:hover,
.page-filter-menu summary:hover,
.segment:hover,
.toolbar-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(23, 79, 79, 0.2);
  background: rgba(23, 79, 79, 0.105);
  box-shadow: 0 8px 16px rgba(43, 66, 59, 0.07);
}

.button.primary,
.button.primary:hover {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.button.primary:hover {
  background: #0f4242;
  box-shadow: 0 10px 24px rgba(23, 79, 79, 0.22);
}

.button.danger {
  border-color: rgba(165, 75, 64, 0.15);
  background: rgba(237, 196, 178, 0.42);
}

.button.warn {
  border-color: rgba(209, 162, 56, 0.22);
  background: rgba(209, 162, 56, 0.13);
}

.stat,
.mini-card,
.module-card,
.list-row,
.candidate-row {
  border-color: rgba(23, 79, 79, 0.09);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.stat:hover,
.mini-card:hover,
.module-card:hover,
.list-row:hover,
.candidate-row:hover,
.assistant-project-card:hover,
.assistant-action:hover {
  transform: translateY(-3px);
  border-color: rgba(23, 79, 79, 0.15);
  box-shadow: var(--shadow-hover);
}

.stat {
  min-height: 124px;
  padding: 19px;
}

.grid > .stat:nth-child(4n + 1) { background: #eef3ea; }
.grid > .stat:nth-child(4n + 2) { background: #fbf1e6; }
.grid > .stat:nth-child(4n + 3) { background: #f5e8e1; }
.grid > .stat:nth-child(4n + 4) { background: #e9f1ef; }

.stat-value {
  color: var(--ink);
  font-size: 1.85rem;
  letter-spacing: -0.04em;
}

.module-card {
  min-height: 124px;
  padding: 18px;
}

/* Tablas: densas pero amables, dentro de una pieza Bento. */
.table-wrap {
  overflow: auto;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th {
  height: 54px;
  border-color: var(--soft-line);
  background: #eee9df;
  color: #355957;
  font-size: 0.72rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

td {
  height: 62px;
  border-color: var(--soft-line);
  color: #244946;
  font-size: 0.9rem;
}

tbody tr {
  transition: background 150ms ease;
}

tbody tr:hover td {
  background: rgba(220, 231, 218, 0.28);
}

.record-number {
  border-radius: 14px;
}

.record-number span {
  border-radius: 12px;
  background: rgba(23, 79, 79, 0.075);
}

/* Asistente: Bento principal y tarjetas de operación. */
.assistant-hero {
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 20px;
  margin-bottom: 20px;
}

.assistant-health-card,
.assistant-control-card {
  min-height: 212px;
  padding: 28px;
  border-radius: var(--radius-large);
}

.assistant-health-card {
  border: 0;
  background:
    radial-gradient(circle at 88% 10%, rgba(209, 162, 56, 0.32), transparent 17rem),
    radial-gradient(circle at 10% 100%, rgba(109, 154, 139, 0.25), transparent 18rem),
    linear-gradient(145deg, #123f40, #1f625f);
  box-shadow: 0 22px 48px rgba(23, 79, 79, 0.2);
}

.assistant-control-card {
  border-color: rgba(23, 79, 79, 0.09);
  background:
    radial-gradient(circle at 95% 0%, rgba(237, 196, 178, 0.48), transparent 18rem),
    #fffdf8;
  box-shadow: var(--shadow);
}

.assistant-score-ring {
  width: 126px;
  min-width: 126px;
  background: conic-gradient(#e3b65b calc(var(--assistant-score) * 1%), rgba(255, 255, 255, 0.14) 0);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.assistant-score-ring::before {
  width: 92px;
  background: #174c4c;
}

.assistant-main-grid {
  gap: 20px;
  margin: 20px 0;
}

.assistant-priority-panel,
.assistant-chat-panel,
.assistant-project-panel,
.assistant-activity-panel {
  border-radius: var(--radius-large);
}

.assistant-count {
  border-radius: 14px;
  background: var(--brand);
}

.assistant-action-list {
  gap: 12px;
}

.assistant-action {
  padding: 18px;
  border: 1px solid rgba(23, 79, 79, 0.09);
  border-left-width: 4px;
  border-radius: 20px;
  background: #fffdf9;
  box-shadow: 0 6px 18px rgba(43, 66, 59, 0.045);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.assistant-action.priority-critical { background: #fff7f4; }
.assistant-action.priority-high { background: #fff9ef; }
.assistant-action.priority-medium { background: #f5faf8; }

.assistant-recommendation,
.assistant-question-form {
  border-color: rgba(23, 79, 79, 0.08);
  border-radius: 16px;
  background: rgba(220, 231, 218, 0.32);
}

.assistant-project-grid {
  gap: 14px;
}

.assistant-project-card {
  padding: 18px;
  border-color: rgba(23, 79, 79, 0.09);
  border-top-width: 1px;
  border-radius: 22px;
  background: #fffdf8;
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.assistant-project-card.tone-good { background: #edf5ee; }
.assistant-project-card.tone-warning { background: #fbf2e5; }
.assistant-project-card.tone-danger { background: #f8ece7; }

.assistant-project-card dl > div {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
}

.assistant-progress {
  height: 8px;
  background: rgba(23, 79, 79, 0.09);
}

.assistant-progress span {
  background: linear-gradient(90deg, var(--brand), #78a995);
}

.assistant-activity-list article {
  padding: 13px 2px;
  border-color: var(--soft-line);
}

/* Fichas, conectores, ayudas y diálogos. */
.connector-toolbar {
  border-radius: 22px;
  background: #fbf1dc;
}

.connector-toolbar.is-ready {
  background: #edf5ee;
}

.architecture-note,
.help-callout,
.comparison-cards article,
.connector-dialog-help {
  border-radius: 20px;
}

.architecture-note,
.help-callout {
  background: rgba(219, 235, 229, 0.62);
}

.dialog-backdrop {
  background: rgba(24, 49, 47, 0.34);
  backdrop-filter: blur(10px);
}

.dialog,
.modal {
  border: 1px solid rgba(23, 79, 79, 0.1);
  border-radius: 30px;
  background: #fffdf8;
  box-shadow: 0 34px 90px rgba(24, 49, 47, 0.22);
}

.dialog-header {
  border-color: var(--soft-line);
  background: linear-gradient(135deg, #fffdf8, #edf3eb);
}

.toast {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: var(--brand);
  box-shadow: 0 18px 40px rgba(23, 79, 79, 0.24);
}

/* Detalles de proyecto y tickets heredan el mismo lenguaje orgánico. */
.ag-detail-page {
  margin: 0;
  background: transparent;
}

.ag-band,
.ag-record-header,
.ticket-info-panel,
.ticket-conversation-panel,
.ticket-integration-panel {
  border-color: rgba(23, 79, 79, 0.1);
}

.ag-band,
.ag-record-header {
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
}

.ag-tabs,
.tabs,
.segmented {
  border-radius: 16px;
  background: rgba(23, 79, 79, 0.055);
}

/* Adaptación progresiva de la navegación. */
@media (max-width: 1320px) {
  .app-header {
    padding-inline: 18px;
  }

  .header-brand .brand-subtitle {
    display: none;
  }

  .nav,
  .sidebar:hover .nav,
  .sidebar:focus-within .nav {
    width: calc(100% - 32px);
  }

  .nav-button,
  .sidebar:hover .nav-button,
  .sidebar:focus-within .nav-button {
    padding-right: 9px;
  }

  .nav-button > span:not(.nav-icon),
  .sidebar:hover .nav-button > span:not(.nav-icon),
  .sidebar:focus-within .nav-button > span:not(.nav-icon) {
    font-size: 0.72rem;
  }
}

@media (max-width: 1040px) {
  .layout {
    grid-template-rows: 74px 70px minmax(0, 1fr);
  }

  .app-header {
    height: 74px;
  }

  .sidebar,
  .sidebar:hover,
  .sidebar:focus-within {
    top: 74px;
    height: 70px;
  }

  .nav,
  .sidebar:hover .nav,
  .sidebar:focus-within .nav {
    height: 58px;
  }

  .header-actions .header-pill > span:not(.header-icon),
  .user-pill > span:last-child {
    display: none;
  }

  .header-pill,
  .header-plus {
    min-width: 46px;
    padding: 5px 7px;
  }

  .main {
    padding-inline: 20px;
  }

  .assistant-hero,
  .assistant-main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  html,
  body,
  #app {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 68px 66px minmax(0, 1fr);
    width: 100%;
  }

  .app-header {
    position: sticky;
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: 52px minmax(120px, 1fr) auto;
    width: 100%;
    height: 68px;
    min-height: 68px;
    padding: 0 10px;
  }

  .header-mark {
    width: 46px;
    height: 46px;
    border-radius: 15px;
  }

  .header-mark .brand-logo {
    width: 42px;
    height: 42px;
  }

  .header-brand {
    min-width: 0;
    padding: 0 4px;
  }

  .header-brand .brand-wordmark {
    width: min(142px, 100%);
    height: 48px;
  }

  .header-actions {
    grid-column: 3;
    width: auto;
    gap: 5px;
    padding: 0;
    overflow: visible;
  }

  .header-actions > .header-pill[data-view="stats"]:not(.user-pill),
  .header-actions > .header-pill[data-view="payments"],
  .header-actions > .header-pill[data-view="expenses"],
  .header-actions > .user-pill {
    display: none;
  }

  .header-pill,
  .header-plus {
    min-width: 40px;
    width: 40px;
    min-height: 40px;
    height: 40px;
    padding: 3px;
    border-radius: 13px;
  }

  .header-pill .header-icon {
    width: 30px;
    min-width: 30px;
    height: 30px;
  }

  .header-actions > .header-pill.is-count strong {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    width: auto;
    height: 18px;
    padding: 0 4px;
    border: 2px solid #fffaf2;
    border-radius: 999px;
    background: var(--gold);
    color: #fff;
    font-size: 0.61rem;
  }

  .header-actions > .header-pill.is-count {
    position: relative;
  }

  .header-plus strong {
    display: none;
  }

  .sidebar,
  .sidebar:hover,
  .sidebar:focus-within {
    position: sticky;
    top: 68px;
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    height: 66px;
    overflow: hidden;
    border: 0;
    background: rgba(243, 238, 229, 0.9);
  }

  .nav,
  .sidebar:hover .nav,
  .sidebar:focus-within .nav {
    display: flex;
    width: calc(100% - 16px);
    min-width: 0;
    height: 56px;
    margin: 0 8px;
    padding: 7px;
    overflow-x: auto;
    gap: 5px;
    border-radius: 18px;
  }

  .compact-nav .nav-group,
  .sidebar:hover .compact-nav .nav-group,
  .sidebar:focus-within .compact-nav .nav-group {
    display: flex;
    width: auto;
    min-width: max-content;
    gap: 4px;
  }

  .compact-nav .nav-group + .nav-group::before {
    height: 24px;
    margin: 0 3px;
  }

  .nav-button,
  .sidebar:hover .nav-button,
  .sidebar:focus-within .nav-button {
    display: inline-flex;
    grid-template-columns: none;
    width: auto;
    min-width: 40px;
    min-height: 40px;
    padding: 4px;
    border-radius: 13px;
  }

  .nav-button > span:not(.nav-icon),
  .sidebar:hover .nav-button > span:not(.nav-icon),
  .sidebar:focus-within .nav-button > span:not(.nav-icon) {
    display: none;
  }

  .nav-icon {
    width: 31px;
    height: 31px;
  }

  .main {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    min-width: 0;
    padding: 14px 10px 52px;
    overflow: visible;
  }

  .view-help-bar {
    margin-right: 1px;
  }

  .view-help-button strong {
    display: none;
  }

  .view-help-button {
    width: 40px;
    min-height: 40px;
    padding: 0;
    justify-content: center;
  }

  .topbar {
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 20px;
    padding: 22px 20px;
    border-radius: 26px;
  }

  .topbar h1 {
    font-size: clamp(1.65rem, 8vw, 2.15rem);
  }

  .topbar .actions,
  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .topbar .actions .button,
  .form-actions .button {
    width: 100%;
  }

  .page-tools,
  .panel,
  .table-wrap,
  .assistant-health-card,
  .assistant-control-card,
  .assistant-priority-panel,
  .assistant-chat-panel,
  .assistant-project-panel,
  .assistant-activity-panel {
    max-width: 100%;
    border-radius: 24px;
  }

  .page-tools-main,
  .page-search-form,
  .page-subbar {
    grid-template-columns: 1fr;
  }

  .page-title-actions,
  .page-tools-right,
  .actions {
    align-items: stretch;
    justify-content: flex-start;
  }

  .page-export {
    flex-wrap: wrap;
  }

  .assistant-health-card,
  .assistant-control-card {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
    padding: 22px;
  }

  .assistant-score-ring {
    width: 108px;
    min-width: 108px;
  }

  .assistant-score-ring::before {
    width: 79px;
  }

  .assistant-project-grid {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Estado de persistencia: confirmacion visible de cada guardado. */
.header-save-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 6px 12px 6px 7px;
  border: 1px solid rgba(23, 79, 79, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.header-save-status:hover {
  transform: translateY(-2px);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.header-save-status > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 11px;
  background: rgba(57, 116, 91, 0.12);
}

.header-save-status svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.header-save-status.is-saving > span,
.header-save-status.is-pending > span {
  color: #876318;
  background: rgba(209, 162, 56, 0.18);
}

.header-save-status.is-error {
  color: var(--red);
  border-color: rgba(165, 75, 64, 0.22);
  background: rgba(237, 196, 178, 0.32);
}

.header-save-status.is-error > span {
  background: rgba(165, 75, 64, 0.11);
}

@media (max-width: 1320px) {
  .header-actions > .header-pill[data-view="stats"]:not(.user-pill),
  .header-actions > .header-pill[data-view="payments"],
  .header-actions > .header-pill[data-view="expenses"] {
    display: none;
  }
}

@media (max-width: 760px) {
  .header-save-status {
    position: relative;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 3px;
    border-radius: 13px;
  }

  .header-save-status > span {
    width: 30px;
    height: 30px;
  }

  .header-save-status > strong {
    display: none;
  }
}

/* ========================================================================== */
/* HORADIA 2026 · Retro Executive                                             */
/* Paleta sobria inspirada en archivos, despachos y herramientas duraderas.   */
/* ========================================================================== */

:root {
  --bg: #d8d0c1;
  --surface: #f2ecdf;
  --surface-2: #e6dece;
  --ink: #272b29;
  --muted: #68665f;
  --line: rgba(54, 52, 45, 0.22);
  --soft-line: rgba(54, 52, 45, 0.12);
  --brand: #283d39;
  --brand-2: #405a54;
  --cream: #eee6d7;
  --rail: rgba(240, 234, 222, 0.94);
  --salmon: #87504a;
  --salmon-line: #70413d;
  --teal: #405f59;
  --gold: #9a7335;
  --red: #773d38;
  --green: #50634f;
  --sage: #b8b9a4;
  --sand: #cdbda3;
  --peach: #b88469;
  --sky: #aab9b5;
  --shadow: 0 13px 28px rgba(42, 39, 33, 0.13);
  --shadow-soft: 0 6px 16px rgba(42, 39, 33, 0.1);
  --shadow-hover: 0 15px 30px rgba(42, 39, 33, 0.17);
  --radius: 18px;
  --radius-small: 12px;
  --radius-large: 24px;
  --surida-icon-bg: rgba(40, 61, 57, 0.09);
  --surida-icon-bg-hover: rgba(40, 61, 57, 0.15);
  --surida-icon-border: rgba(40, 61, 57, 0.16);
  --surida-icon-border-hover: rgba(40, 61, 57, 0.3);
}

html {
  background: var(--bg);
}

body,
#app {
  background:
    linear-gradient(rgba(242, 236, 223, 0.18), rgba(216, 208, 193, 0.1)),
    repeating-linear-gradient(0deg, rgba(63, 57, 47, 0.022) 0, rgba(63, 57, 47, 0.022) 1px, transparent 1px, transparent 5px),
    var(--bg);
}

body {
  color: var(--ink);
}

::selection {
  color: #f5eee1;
  background: var(--brand);
}

:focus-visible {
  outline-color: rgba(154, 115, 53, 0.62);
}

.topbar h1,
.page-title,
.panel-heading-row h2,
.assistant-health-card h2,
.assistant-control-card h2,
.assistant-project-heading h3,
.ag-record-header h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.app-header {
  border-bottom: 1px solid rgba(54, 52, 45, 0.2);
  background: rgba(237, 230, 217, 0.94);
  box-shadow: 0 4px 15px rgba(42, 39, 33, 0.09);
  backdrop-filter: blur(18px) saturate(0.92);
}

.header-mark {
  border-color: rgba(54, 52, 45, 0.22);
  border-radius: 14px;
  background: #e8dfcf;
  box-shadow: 0 4px 12px rgba(42, 39, 33, 0.12);
}

.header-mark .brand-logo {
  border-radius: 12px;
}

.header-brand .brand-wordmark {
  filter: saturate(0.68) contrast(1.08);
}

.header-brand .brand-subtitle {
  color: #666259;
}

.header-pill,
.header-save-status,
.header-plus {
  border-color: rgba(54, 52, 45, 0.2);
  border-radius: 11px;
  background: #eee7da;
  color: var(--brand);
}

.header-pill:hover,
.header-save-status:hover,
.header-plus:hover {
  border-color: rgba(54, 52, 45, 0.32);
  background: #f6f0e5;
}

.header-pill .header-icon,
.header-pill.is-count strong,
.header-save-status > span {
  border-radius: 8px;
  background: rgba(40, 61, 57, 0.1);
}

.header-plus,
.header-plus:hover {
  border-color: #20332f;
  background: var(--brand);
  color: #f4ecdf;
}

.header-plus strong {
  color: var(--brand);
  background: #c6b48f;
}

.help-header .header-icon {
  color: #755623;
  background: rgba(154, 115, 53, 0.16);
}

.sidebar,
.sidebar:hover,
.sidebar:focus-within {
  border-bottom: 1px solid rgba(54, 52, 45, 0.12);
  background: linear-gradient(to bottom, rgba(216, 208, 193, 0.98), rgba(216, 208, 193, 0.88));
  backdrop-filter: blur(14px) saturate(0.85);
}

.nav,
.sidebar:hover .nav,
.sidebar:focus-within .nav {
  border-color: rgba(54, 52, 45, 0.22);
  border-radius: 15px;
  background: rgba(241, 234, 221, 0.96);
  box-shadow: 0 5px 14px rgba(42, 39, 33, 0.11);
}

.compact-nav .nav-group + .nav-group::before {
  background: rgba(54, 52, 45, 0.2);
}

.nav-button,
.sidebar:hover .nav-button,
.sidebar:focus-within .nav-button {
  border-radius: 10px;
  color: #596762;
}

.nav-icon {
  border-radius: 8px;
  background: rgba(40, 61, 57, 0.09);
}

.nav-button:hover {
  border-color: rgba(54, 52, 45, 0.17);
  background: #ded4c3;
  color: #273e39;
}

.nav-button.is-active,
.nav-button.is-active:hover {
  border-color: #1f322e;
  background: var(--brand);
  color: #f4ecdf;
  box-shadow: 0 6px 13px rgba(40, 61, 57, 0.25);
}

.view-help-button {
  border-color: rgba(54, 52, 45, 0.2);
  border-radius: 10px;
  background: rgba(239, 232, 218, 0.9);
  color: var(--brand);
}

.view-help-button:hover,
.view-help-button:focus-visible {
  border-color: rgba(54, 52, 45, 0.32);
  background: #f5eee2;
}

.topbar {
  border-color: rgba(54, 52, 45, 0.24);
  border-left: 6px solid var(--gold);
  background:
    linear-gradient(105deg, rgba(244, 238, 226, 0.98), rgba(226, 217, 202, 0.98));
  box-shadow: var(--shadow);
}

.topbar::after {
  right: -36px;
  bottom: -96px;
  width: 224px;
  height: 224px;
  border: 24px solid rgba(112, 65, 61, 0.07);
  border-radius: 50%;
  background: transparent;
}

.topbar h1,
.page-title {
  color: #242927;
}

.topbar p,
.stat-label,
.stat-note {
  color: var(--muted);
}

.eyebrow {
  color: #765923;
}

.page-tools,
.top-strip,
.panel,
.table-wrap,
.connector-toolbar,
.architecture-note,
.help-callout,
.comparison-cards article,
.ag-band,
.ag-record-header {
  border-color: rgba(54, 52, 45, 0.22);
  box-shadow: var(--shadow);
}

.page-tools,
.top-strip,
.panel,
.table-wrap,
.ag-band,
.ag-record-header {
  background: rgba(243, 237, 225, 0.97);
}

.page-subbar {
  border-color: rgba(54, 52, 45, 0.14);
  background: rgba(225, 216, 200, 0.62);
}

.page-search input,
input,
select,
textarea {
  border-color: rgba(54, 52, 45, 0.24);
  border-radius: 9px;
  background: #ede5d7;
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(42, 39, 33, 0.06);
}

.page-search input {
  border-color: rgba(54, 52, 45, 0.14);
  border-radius: 10px;
  background: rgba(40, 61, 57, 0.07);
}

input:hover,
select:hover,
textarea:hover,
input:focus,
select:focus,
textarea:focus {
  background: #f7f1e6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(40, 61, 57, 0.58);
  box-shadow: 0 0 0 3px rgba(40, 61, 57, 0.1);
}

.button,
.icon-button,
.ag-icon-button,
.page-filter-menu summary,
.segment,
.toolbar-chip {
  border-color: rgba(54, 52, 45, 0.23);
  border-radius: 9px;
  background: #e3dacb;
  color: var(--brand);
}

.button:hover,
.icon-button:hover,
.ag-icon-button:hover,
.page-filter-menu summary:hover,
.segment:hover,
.toolbar-chip:hover {
  border-color: rgba(54, 52, 45, 0.34);
  background: #d9cebc;
  box-shadow: 0 5px 11px rgba(42, 39, 33, 0.11);
}

.button.primary,
.button.primary:hover {
  border-color: #20332f;
  background: var(--brand);
  color: #f4ecdf;
}

.button.primary:hover {
  background: #1f332f;
  box-shadow: 0 7px 17px rgba(40, 61, 57, 0.25);
}

.button.danger {
  border-color: rgba(119, 61, 56, 0.3);
  background: rgba(135, 80, 74, 0.15);
  color: #6b3632;
}

.button.warn {
  border-color: rgba(154, 115, 53, 0.38);
  background: rgba(154, 115, 53, 0.14);
  color: #6f511f;
}

.stat,
.mini-card,
.module-card,
.list-row,
.candidate-row {
  border-color: rgba(54, 52, 45, 0.2);
  border-radius: 15px;
  background: #eee7da;
  box-shadow: var(--shadow-soft);
}

.stat:hover,
.mini-card:hover,
.module-card:hover,
.list-row:hover,
.candidate-row:hover,
.assistant-project-card:hover,
.assistant-action:hover {
  border-color: rgba(54, 52, 45, 0.31);
  box-shadow: var(--shadow-hover);
}

.grid > .stat:nth-child(4n + 1) { background: #d4d4c2; }
.grid > .stat:nth-child(4n + 2) { background: #dfd2bd; }
.grid > .stat:nth-child(4n + 3) { background: #d8c2b7; }
.grid > .stat:nth-child(4n + 4) { background: #c8d1cd; }

.stat-value {
  color: #252a28;
}

.table-wrap {
  border-radius: 16px;
}

th {
  border-color: rgba(238, 231, 218, 0.13);
  background: #354844;
  color: #f0e7d8;
}

td {
  border-color: rgba(54, 52, 45, 0.13);
  color: #303633;
}

tbody tr:nth-child(even) td {
  background: rgba(99, 87, 66, 0.035);
}

tbody tr:hover td,
tbody tr:nth-child(even):hover td {
  background: rgba(154, 115, 53, 0.11);
}

.record-number span {
  border-radius: 8px;
  background: rgba(40, 61, 57, 0.1);
}

.assistant-health-card,
.assistant-control-card {
  border-radius: var(--radius-large);
}

.assistant-health-card {
  border: 1px solid #1e302d;
  background:
    radial-gradient(circle at 88% 8%, rgba(154, 115, 53, 0.22), transparent 18rem),
    linear-gradient(145deg, #253a36, #344c47);
  box-shadow: 0 15px 30px rgba(31, 47, 43, 0.24);
}

.assistant-control-card {
  border-color: rgba(54, 52, 45, 0.23);
  border-top: 5px solid var(--salmon-line);
  background: #eee7da;
  box-shadow: var(--shadow);
}

.assistant-score-ring {
  background: conic-gradient(#b58b47 calc(var(--assistant-score) * 1%), rgba(244, 236, 223, 0.14) 0);
}

.assistant-score-ring::before {
  background: #2c433e;
}

.assistant-priority-panel,
.assistant-chat-panel,
.assistant-project-panel,
.assistant-activity-panel {
  border-radius: var(--radius-large);
}

.assistant-count {
  border-radius: 8px;
  background: var(--brand);
}

.assistant-action {
  border-color: rgba(54, 52, 45, 0.2);
  border-left-width: 4px;
  border-radius: 13px;
  background: #eee7da;
  box-shadow: 0 4px 11px rgba(42, 39, 33, 0.08);
}

.assistant-action.priority-critical { background: #e6d7d1; }
.assistant-action.priority-high { background: #eadfc9; }
.assistant-action.priority-medium { background: #dbe2dc; }
.assistant-action.priority-low { background: #e2dfd7; }

.assistant-recommendation,
.assistant-question-form {
  border-color: rgba(54, 52, 45, 0.16);
  border-radius: 10px;
  background: rgba(79, 98, 79, 0.09);
}

.assistant-project-card {
  border-color: rgba(54, 52, 45, 0.2);
  border-radius: 15px;
  background: #eee7da;
  box-shadow: var(--shadow-soft);
}

.assistant-project-card.tone-good { background: #d8dfd3; }
.assistant-project-card.tone-warning { background: #e5dac5; }
.assistant-project-card.tone-danger { background: #dfcdc6; }

.assistant-project-card dl > div {
  border-radius: 8px;
  background: rgba(246, 240, 229, 0.55);
}

.assistant-progress {
  background: rgba(40, 61, 57, 0.13);
}

.assistant-progress span {
  background: linear-gradient(90deg, #2e4943, #8a8054);
}

.connector-toolbar {
  background: #e4d6ba;
}

.connector-toolbar.is-ready {
  background: #d5ddd1;
}

.architecture-note,
.help-callout {
  background: rgba(181, 185, 164, 0.48);
}

.dialog-backdrop {
  background: rgba(35, 38, 34, 0.5);
  backdrop-filter: blur(7px);
}

.dialog,
.modal {
  border-color: rgba(54, 52, 45, 0.29);
  border-radius: 19px;
  background: #f1eadf;
  box-shadow: 0 28px 70px rgba(34, 33, 28, 0.32);
}

.dialog-header {
  border-color: rgba(54, 52, 45, 0.16);
  background: linear-gradient(135deg, #eee6d8, #d8d7c6);
}

.toast {
  border-color: rgba(238, 230, 216, 0.2);
  border-radius: 11px;
  background: var(--brand);
  box-shadow: 0 14px 30px rgba(31, 47, 43, 0.27);
}

.ag-tabs,
.tabs,
.segmented {
  border-radius: 10px;
  background: rgba(40, 61, 57, 0.08);
}

.header-save-status.is-saving > span,
.header-save-status.is-pending > span {
  color: #74551f;
  background: rgba(154, 115, 53, 0.2);
}

.header-save-status.is-error {
  color: var(--red);
  border-color: rgba(119, 61, 56, 0.36);
  background: #e2d2ca;
}

.header-save-status.is-error > span {
  background: rgba(119, 61, 56, 0.14);
}

@media (max-width: 760px) {
  .topbar {
    border-left-width: 4px;
    border-radius: 19px;
  }

  .page-tools,
  .panel,
  .table-wrap,
  .assistant-health-card,
  .assistant-control-card,
  .assistant-priority-panel,
  .assistant-chat-panel,
  .assistant-project-panel,
  .assistant-activity-panel {
    border-radius: 16px;
  }
}

/* Ejecuciones reales del operador: ciclo, evidencia y validación. */
.assistant-operation-explainer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(54, 52, 45, 0.2);
  border-left: 4px solid var(--gold);
  border-radius: 11px;
  background: #e4dccd;
}

.assistant-operation-explainer strong {
  margin-right: 6px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

.assistant-operation-explainer span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4f5753;
  font-size: 0.75rem;
  font-weight: 800;
}

.assistant-operation-explainer span + span::before {
  color: var(--gold);
  content: "→";
}

.assistant-execution-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.assistant-execution-card {
  padding: 17px;
  border: 1px solid rgba(54, 52, 45, 0.22);
  border-top: 4px solid #6a7363;
  border-radius: 14px;
  background: #ede6d8;
  box-shadow: var(--shadow-soft);
}

.assistant-execution-card.is-running {
  border-top-color: var(--gold);
}

.assistant-execution-card.is-awaiting_approval {
  border-top-color: var(--salmon-line);
}

.assistant-execution-card.is-completed {
  border-top-color: var(--green);
}

.assistant-execution-card.is-failed {
  border-top-color: var(--red);
}

.assistant-execution-card > header,
.assistant-execution-card > footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.assistant-execution-card > header span {
  color: #755923;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assistant-execution-card h3 {
  margin: 4px 0 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.25;
}

.assistant-execution-card > header > strong {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(40, 61, 57, 0.1);
  color: var(--brand);
  font-size: 0.69rem;
}

.assistant-execution-phase {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
  color: #4e5b56;
  font-size: 0.78rem;
  font-weight: 850;
}

.assistant-execution-phase > span {
  width: 9px;
  height: 9px;
  border: 2px solid #e8dfd0;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(154, 115, 53, 0.17);
}

.assistant-execution-card ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.assistant-execution-card li {
  display: grid;
  grid-template-columns: minmax(115px, 0.38fr) minmax(0, 1fr);
  gap: 10px;
  padding: 8px 9px;
  border-radius: 8px;
  background: rgba(246, 240, 229, 0.58);
  color: var(--muted);
  font-size: 0.74rem;
}

.assistant-execution-card li strong {
  color: var(--brand);
}

.assistant-execution-card li.is-failed strong {
  color: var(--red);
}

.assistant-execution-card > footer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(54, 52, 45, 0.12);
  color: var(--muted);
  font-size: 0.7rem;
}

@media (max-width: 920px) {
  .assistant-execution-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .assistant-operation-explainer span + span::before {
    content: "·";
  }

  .assistant-execution-card li {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}
