: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;
  }
}

* {
  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;
  }
}

/* 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;
}

.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);
}

.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;
  }
}
