/* Navegación contextual · Viajario 0.4.0 */
.page-tools {
  min-height: 42px;
  margin: -14px 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.breadcrumbs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #8790a8;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}

.breadcrumbs a,
.breadcrumbs span[aria-current="page"] {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumbs a {
  color: #69738f;
  font-weight: 700;
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: #eb6255;
}

.breadcrumbs span[aria-current="page"] {
  color: #061857;
  font-weight: 750;
}

.breadcrumb-separator {
  color: #b9becc;
}

.page-tool-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-button {
  min-height: 38px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #061857;
  background: #fff;
  border: 1px solid rgba(6, 24, 87, 0.12);
  border-radius: 11px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(6, 24, 87, 0.04);
}

.tool-button:hover {
  color: #eb6255;
  border-color: rgba(235, 98, 85, 0.34);
}

.budget-tool {
  color: #fff;
  background: #061857;
  border-color: #061857;
}

.budget-tool:hover {
  color: #fff;
  background: #10296f;
  border-color: #10296f;
}

/* Visor privado de documentos */
.document-head {
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: none;
}

.document-head-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 17px;
}

.document-file-icon {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #eb6255;
  border-radius: 17px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.document-head h1 {
  max-width: 680px;
  margin: 5px 0 4px;
  overflow: hidden;
  color: #061857;
  font-size: clamp(21px, 3vw, 31px);
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-head p {
  margin: 0;
  color: #69738f;
  font-size: 13px;
}

.document-viewer {
  min-height: 68vh;
  margin-top: 18px;
  padding: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #e9ebf1;
  box-shadow: none;
}

.document-viewer iframe {
  width: 100%;
  height: 72vh;
  background: #fff;
  border: 0;
  border-radius: 11px;
}

.document-viewer img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(6, 24, 87, 0.14);
}

.document-footer-actions {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* Presupuesto y gastos */
.budget-hero {
  min-height: 215px;
  padding: clamp(30px, 5vw, 52px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  position: relative;
  color: #fff;
  background:
    radial-gradient(circle at 88% -20%, rgba(235, 98, 85, 0.42), transparent 18rem),
    linear-gradient(125deg, #061857, #10296f);
  border-radius: 28px;
}

.budget-hero .eyebrow {
  color: #ff9c92;
}

.budget-hero h1 {
  margin: 8px 0 8px;
  color: #fff;
  font-size: clamp(42px, 6vw, 64px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.budget-hero p {
  max-width: 650px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.6;
}

.budget-settings .popover-form {
  color: #061857;
}

.budget-setting-grid {
  grid-template-columns: 1.4fr 0.8fr;
}

.form-help {
  margin: 0 0 18px;
  color: #69738f;
  font-size: 12px;
}

.budget-summary {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(170px, 0.65fr) minmax(170px, 0.65fr);
  gap: 14px;
}

.budget-main-card,
.budget-stat {
  padding: 22px;
  box-shadow: none;
}

.budget-main-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.budget-main-top small,
.budget-main-top strong,
.budget-stat small,
.budget-stat strong {
  display: block;
}

.budget-main-top small,
.budget-stat small {
  color: #69738f;
  font-size: 12px;
  font-weight: 700;
}

.budget-main-top strong {
  margin-top: 5px;
  font-size: clamp(25px, 4vw, 36px);
  letter-spacing: -0.035em;
}

.budget-main-top > span {
  padding: 6px 9px;
  color: #061857;
  background: #fff0ee;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
}

.budget-progress {
  height: 9px;
  margin-top: 18px;
  overflow: hidden;
  background: #edf0f5;
  border-radius: 99px;
}

.budget-progress span {
  height: 100%;
  display: block;
  background: linear-gradient(90deg, #eb6255, #ff9489);
  border-radius: inherit;
}

.budget-balance {
  margin-top: 10px;
  color: #69738f;
  font-size: 12px;
}

.budget-balance.over {
  color: #c43f3f;
}

.budget-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.budget-stat > span {
  width: 35px;
  height: 35px;
  margin-bottom: 14px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-weight: 900;
}

.budget-stat.paid > span {
  color: #176840;
  background: #dff4e9;
}

.budget-stat.planned > span {
  color: #8a5918;
  background: #fff0d7;
}

.budget-stat strong {
  margin-top: 5px;
  font-size: 22px;
}

.budget-content-grid {
  margin-top: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(270px, 0.75fr);
  gap: 22px;
  align-items: start;
}

.budget-expenses-column {
  min-width: 0;
}

.expense-list {
  display: grid;
  gap: 11px;
}

.expense-card {
  padding: 18px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: start;
  gap: 14px;
  box-shadow: none;
}

.expense-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  color: #061857;
  background: #fff0ee;
  border-radius: 13px;
  font-size: 19px;
  font-weight: 900;
}

.expense-icon.category-transport {
  color: #3c5d8f;
  background: #e7eef9;
}

.expense-icon.category-accommodation {
  color: #765092;
  background: #f0e8f7;
}

.expense-icon.category-food {
  color: #995b14;
  background: #fff0d7;
}

.expense-copy {
  min-width: 0;
}

.expense-category {
  color: #eb6255;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.expense-copy h3 {
  margin: 4px 0 7px;
  overflow-wrap: anywhere;
  font-size: 17px;
}

.expense-copy p {
  margin: 9px 0 0;
  font-size: 12px;
  white-space: pre-line;
}

.expense-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #69738f;
  font-size: 11px;
}

.expense-status {
  padding: 4px 7px;
  border-radius: 99px;
  font-weight: 800;
}

.expense-status.paid {
  color: #176840;
  background: #dff4e9;
}

.expense-status.planned {
  color: #8a5918;
  background: #fff0d7;
}

.expense-amount {
  padding-top: 13px;
  color: #061857;
  font-size: 17px;
  white-space: nowrap;
}

.expense-menu {
  padding-top: 7px;
}

.expense-panel {
  width: min(620px, calc(100vw - 44px));
}

.money-input {
  position: relative;
}

.money-input input {
  padding-right: 42px;
}

.money-input > span {
  position: absolute;
  right: 15px;
  top: 50%;
  color: #69738f;
  font-weight: 800;
  transform: translateY(-50%);
}

.budget-breakdown {
  position: sticky;
  top: 20px;
  padding: 24px;
  box-shadow: none;
}

.budget-breakdown h2 {
  margin: 5px 0 24px;
  font-size: 25px;
  letter-spacing: -0.03em;
}

.category-row {
  padding: 13px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  border-bottom: 1px solid rgba(6, 24, 87, 0.08);
}

.category-row:last-child {
  border-bottom: 0;
}

.category-row > div:first-child {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-row > div:first-child > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: #eb6255;
  background: #fff0ee;
  border-radius: 8px;
}

.category-row strong {
  font-size: 12px;
}

.category-bar {
  height: 5px;
  grid-column: 1 / -1;
  overflow: hidden;
  background: #edf0f5;
  border-radius: 99px;
}

.category-bar span {
  height: 100%;
  display: block;
  background: #eb6255;
  border-radius: inherit;
}

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

  .budget-main-card {
    grid-column: 1 / -1;
  }

  .budget-content-grid {
    grid-template-columns: 1fr;
  }

  .budget-breakdown {
    position: static;
  }
}

@media (max-width: 760px) {
  .page-tools {
    min-height: 38px;
    margin: -5px 0 17px;
    align-items: flex-start;
  }

  .breadcrumbs {
    padding-top: 10px;
  }

  .breadcrumbs a,
  .breadcrumbs span[aria-current="page"] {
    max-width: 105px;
  }

  .page-tool-actions {
    gap: 6px;
  }

  .tool-button {
    width: 39px;
    min-height: 39px;
    padding: 0;
    font-size: 0;
  }

  .tool-button span {
    font-size: 18px;
  }

  .document-head {
    padding: 18px;
    align-items: stretch;
    flex-direction: column;
  }

  .document-head-copy {
    align-items: flex-start;
  }

  .document-file-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .document-head h1 {
    max-width: calc(100vw - 120px);
    font-size: 20px;
  }

  .document-head .button {
    width: 100%;
  }

  .document-viewer {
    min-height: 62vh;
    padding: 7px;
    border-radius: 14px;
  }

  .document-viewer iframe {
    height: 67vh;
  }

  .document-footer-actions {
    flex-direction: column;
  }

  .document-footer-actions .button {
    width: 100%;
  }

  .budget-hero {
    min-height: 245px;
    padding: 28px 23px;
    align-items: stretch;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 22px;
  }

  .budget-hero h1 {
    font-size: 45px;
  }

  .budget-hero .action-details,
  .budget-hero .action-details > summary {
    width: 100%;
  }

  .budget-setting-grid,
  .budget-summary {
    grid-template-columns: 1fr;
  }

  .budget-main-card {
    grid-column: auto;
  }

  .budget-stat {
    min-height: 125px;
  }

  .budget-content-grid {
    margin-top: 42px;
  }

  .budget-expenses-column .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .budget-expenses-column .action-details,
  .budget-expenses-column .action-details > summary {
    width: 100%;
  }

  .expense-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 15px 13px;
    gap: 11px;
  }

  .expense-amount {
    grid-column: 2 / 3;
    padding-top: 0;
  }

  .expense-menu {
    grid-column: 3;
    grid-row: 1;
  }

  .expense-panel {
    position: fixed;
    z-index: 90;
    top: 76px;
    right: 14px;
    left: 14px;
    width: auto;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
  }
}
