html {
  font-size: 14px;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  min-height: 100vh;
  margin-bottom: 0;
  background:
    linear-gradient(90deg, rgba(3, 24, 52, .76), rgba(3, 24, 52, .34) 42%, rgba(3, 24, 52, .12)),
    linear-gradient(180deg, rgba(3, 24, 52, .18), rgba(244, 247, 251, .18) 45%, rgba(244, 247, 251, .52)),
    url("/images/fondoturistica.png");
  background-position: center center, center center, center center;
  background-size: auto, auto, cover;
  background-attachment: fixed, fixed, fixed;
  background-repeat: no-repeat, no-repeat, no-repeat;
  color: #182230;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: rgba(255, 255, 255, .10);
  backdrop-filter: saturate(1.08);
  z-index: -1;
}

.app-navbar {
  background: rgba(7, 59, 114, .82);
  backdrop-filter: blur(10px);
}

.app-shell {
  max-width: 1320px;
  padding-top: 1rem;
  flex: 1 0 auto;
}

.footer {
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(10px);
  position: static;
  flex-shrink: 0;
  line-height: 1.4;
  padding: .85rem 0;
}

.content-panel,
.tourist-form,
.confirmation-panel {
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(216, 225, 236, .78);
  border-radius: 8px;
  padding: clamp(1rem, 4vw, 2rem);
  box-shadow: 0 18px 48px rgba(3, 24, 52, .18);
  backdrop-filter: blur(12px);
}

.home-hero h1,
.tourist-form h1,
.content-panel h1,
.confirmation-panel h1 {
  font-weight: 800;
  letter-spacing: 0;
}

.home-hero {
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 1rem;
  align-items: stretch;
  padding: clamp(1rem, 3vw, 1.75rem);
  background: rgba(255, 255, 255, .80);
  border: 1px solid rgba(216, 225, 236, .72);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(3, 24, 52, .20);
  backdrop-filter: blur(12px);
}

.home-copy {
  display: grid;
  align-content: center;
  min-height: 360px;
  padding: clamp(.5rem, 2vw, 1rem);
}

.home-language {
  margin-bottom: 1.25rem;
}

.home-eyebrow {
  color: #0b5ed7;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .04em;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.home-copy h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  margin-bottom: .85rem;
}

.home-copy .lead {
  max-width: 760px;
  color: #475467;
  margin-bottom: 1.25rem;
}

.home-ops {
  background: rgba(7, 59, 114, .86);
  color: #fff;
  border-radius: 10px;
  padding: 1.25rem;
  display: grid;
  align-content: center;
  gap: .85rem;
}

.home-ops-header {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 900;
  line-height: .9;
  color: rgba(255, 255, 255, .18);
}

.home-step {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  padding: .8rem;
  font-weight: 700;
}

.home-step span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #fff;
  color: #073b72;
  font-weight: 900;
  flex: 0 0 auto;
}

.home-ops p {
  color: rgba(255, 255, 255, .82);
  margin: .35rem 0 0;
}

.tourist-form-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding-bottom: 1rem;
}

.tourist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(7, 59, 114, .90);
  color: #fff;
  padding: .9rem 1rem;
  border-radius: 12px 12px 0 0;
  font-weight: 700;
  gap: .75rem;
}

.brand-mark {
  letter-spacing: 0;
}

.language-selector {
  flex-shrink: 0;
}

.language-selector .btn {
  min-width: 2.4rem;
}

.tourist-form {
  border-top: 0;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 18px 48px rgba(3, 24, 52, .22);
  padding: clamp(.9rem, 2.2vw, 1.35rem);
}

.report-hero {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.report-hero.compact {
  display: block;
  margin-bottom: .65rem;
}

.report-hero h1 {
  margin-bottom: .25rem;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
}

.report-hero p {
  color: #475467;
  margin-bottom: 0;
  font-size: 1rem;
}

.report-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff1f3;
  color: #c1121f;
  border: 1px solid #fecdd3;
  font-size: 2rem;
  font-weight: 900;
}

.form-section {
  background: rgba(248, 250, 252, .76);
  border: 1px solid rgba(229, 237, 246, .72);
  border-radius: 10px;
  padding: .85rem;
  margin: 0;
}

.form-label {
  color: #344054;
  font-weight: 700;
}

.form-control,
.form-select {
  border-color: #cfd8e3;
  min-height: 42px;
  background-color: rgba(255, 255, 255, .90);
}

textarea.form-control {
  min-height: 92px;
}

.location-status {
  background: rgba(234, 243, 255, .84);
  border-left: 4px solid #0b5ed7;
  padding: .55rem .7rem;
  margin: .7rem 0;
  border-radius: 8px;
  color: #073b72;
}

.location-status strong,
.location-status span {
  display: block;
}

.location-status span {
  color: #475467;
  margin-top: .12rem;
  font-size: .9rem;
}

.location-ok {
  background: rgba(236, 253, 243, .86);
  border-left-color: #198754;
  color: #087f5b;
}

.location-warning {
  background: rgba(255, 248, 225, .88);
  border-left-color: #f59f00;
  color: #8a5a00;
}

.file-picker {
  width: 100%;
}

.file-picker .btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
}

.file-picker .file-name {
  color: #667085;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, .90);
}

.submit-bar {
  margin-top: .85rem;
}

.submit-bar .btn {
  min-height: 50px;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(193, 18, 31, .22);
}

.optional-details {
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(216, 225, 236, .76);
  border-radius: 8px;
  padding: .7rem .8rem;
}

.optional-details summary {
  cursor: pointer;
  color: #0b5ed7;
  font-weight: 800;
}

.validation-summary ul {
  margin-bottom: .65rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}

.dashboard-heading {
  margin-bottom: 1rem;
}

.dashboard-heading h1 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  margin-bottom: .25rem;
  color: #fff;
  text-shadow: 0 2px 10px rgba(3, 24, 52, .45);
}

.dashboard-heading p {
  color: rgba(255, 255, 255, .86);
  margin-bottom: 0;
  text-shadow: 0 2px 10px rgba(3, 24, 52, .35);
}

.metric {
  background: rgba(255, 255, 255, .84);
  border: 1px solid rgba(216, 225, 236, .76);
  border-radius: 8px;
  padding: 1rem;
  backdrop-filter: blur(10px);
}

.metric span {
  color: #667085;
  display: block;
}

.metric strong {
  font-size: 2rem;
  line-height: 1;
}

.metric.critical strong,
.priority-High {
  color: #c1121f;
}

.metric.success strong,
.priority-Low {
  color: #087f5b;
}

.priority-Medium {
  color: #b7791f;
}

.filters {
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(216, 225, 236, .76);
  border-radius: 8px;
  padding: .75rem;
  backdrop-filter: blur(10px);
}

.ops-map {
  height: 520px;
  min-height: 55vh;
  border-radius: 8px;
  border: 1px solid #d8e1ec;
  background: rgba(219, 231, 243, .82);
}

.detail-map {
  height: 280px;
  border-radius: 8px;
  border: 1px solid #d8e1ec;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
}

.evidence-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #d8e1ec;
}

.folio-box {
  font-size: clamp(1.4rem, 6vw, 2.6rem);
  font-weight: 800;
  color: #073b72;
  background: rgba(234, 243, 255, .88);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  margin: 1rem 0;
  word-break: break-word;
}

.confirmation-panel {
  max-width: 560px;
  margin: 10vh auto;
}

.timeline-item {
  border-left: 3px solid #0b5ed7;
  padding-left: .75rem;
  margin-bottom: 1rem;
}

.report-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
}

.report-detail-header h1 {
  margin-bottom: .2rem;
}

.followup-panel h2,
.timeline-panel h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: .85rem;
}

.status-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
}

.status-action {
  min-height: 62px;
  border: 1px solid #d8e1ec;
  border-radius: 8px;
  background: rgba(255, 255, 255, .88);
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem;
  cursor: pointer;
  color: #344054;
  font-weight: 800;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.status-action:hover {
  border-color: #0b5ed7;
  box-shadow: 0 8px 20px rgba(16, 24, 40, .08);
  transform: translateY(-1px);
}

.status-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #eef4ff;
  color: #0b5ed7;
  font-size: .82rem;
  font-weight: 900;
  flex: 0 0 auto;
}

.btn-check:checked + .status-action {
  border-color: #0b5ed7;
  background: #eef4ff;
  box-shadow: inset 0 0 0 1px #0b5ed7;
}

.btn-check:checked + .status-Received,
.btn-check:checked + .status-InReview {
  border-color: #f59f00;
  background: #fff8e1;
  box-shadow: inset 0 0 0 1px #f59f00;
}

.btn-check:checked + .status-Assigned,
.btn-check:checked + .status-PatrolOnWay {
  border-color: #0d6efd;
  background: #eef4ff;
  box-shadow: inset 0 0 0 1px #0d6efd;
}

.btn-check:checked + .status-Attended {
  border-color: #198754;
  background: #ecfdf3;
  box-shadow: inset 0 0 0 1px #198754;
}

.btn-check:checked + .status-Closed,
.btn-check:checked + .status-Discarded,
.btn-check:checked + .status-Duplicate {
  border-color: #667085;
  background: #f2f4f7;
  box-shadow: inset 0 0 0 1px #667085;
}

.priority-action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45rem;
}

.priority-action {
  border: 1px solid #d8e1ec;
  border-radius: 8px;
  padding: .55rem .35rem;
  text-align: center;
  background: rgba(255, 255, 255, .88);
  cursor: pointer;
  font-weight: 800;
  color: #344054;
}

.btn-check:checked + .priority-action {
  border-color: #0b5ed7;
  background: #eef4ff;
  color: #0b5ed7;
}

.btn-check:checked + .priority-High {
  border-color: #c1121f;
  background: #fff1f3;
  color: #c1121f;
}

.btn-check:checked + .priority-Medium {
  border-color: #b7791f;
  background: #fff8e1;
  color: #8a5a00;
}

.btn-check:checked + .priority-Low {
  border-color: #087f5b;
  background: #ecfdf3;
  color: #087f5b;
}

.timeline-panel {
  max-height: calc(100vh - 96px);
  overflow: auto;
}

.followup-panel textarea.form-control {
  min-height: 76px;
}

.badge.status-Received,
.badge.status-InReview {
  background: #ffc107;
  color: #1f2937;
}

.badge.status-Assigned,
.badge.status-PatrolOnWay {
  background: #0d6efd;
}

.badge.status-Attended {
  background: #198754;
}

.badge.status-Closed,
.badge.status-Discarded,
.badge.status-Duplicate {
  background: #6c757d;
}

.admin-users-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.admin-user-form,
.admin-user-list {
  padding: 1.25rem;
}

.admin-user-form h2,
.admin-user-list h2 {
  font-size: 1.25rem;
  font-weight: 800;
}

.admin-users-table {
  margin-bottom: 0;
}

.admin-users-table thead th {
  color: #475467;
  font-size: .82rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.admin-users-table tbody td {
  vertical-align: middle;
}

.admin-users-table td:first-child span {
  color: #667085;
  display: block;
  font-size: .9rem;
}

@media (max-width: 767px) {
  body {
    background-position: center center, center center, center center;
    background-size: auto, auto, cover;
    background-attachment: scroll, scroll, scroll;
    background-repeat: no-repeat, no-repeat, no-repeat;
  }

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

  .app-shell {
    padding-inline: .65rem;
    padding-top: .65rem;
  }

  .home-hero {
    grid-template-columns: 1fr;
    padding: .85rem;
  }

  .home-copy {
    min-height: auto;
  }

  .home-ops {
    padding: 1rem;
  }

  .tourist-header {
    align-items: stretch;
    flex-direction: column;
  }

  .language-selector {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }

  .language-selector .btn {
    border-radius: 0;
  }

  .language-selector .btn:first-child {
    border-radius: 4px 0 0 4px;
  }

  .language-selector .btn:last-child {
    border-radius: 0 4px 4px 0;
  }

  .tourist-form {
    padding: 1rem;
  }

  .report-hero {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: .75rem;
  }

  .report-icon {
    width: 44px;
    height: 44px;
    font-size: 1.55rem;
  }

  .form-section {
    padding: .85rem;
  }

  .file-picker {
    display: block;
  }

  .file-picker .btn,
  .file-picker .file-name {
    width: 100%;
    border-radius: 6px !important;
  }

  .file-picker .file-name {
    margin-top: .5rem;
  }

  .submit-bar {
    position: sticky;
    bottom: .65rem;
    z-index: 10;
    padding: .55rem;
    margin: 1rem -.55rem -.55rem;
    background: rgba(255, 255, 255, .88);
    border: 1px solid #e5edf6;
    border-radius: 10px;
    backdrop-filter: blur(8px);
  }

  .footer {
    font-size: .85rem;
    white-space: normal;
    text-align: center;
  }

  .status-action-grid {
    grid-template-columns: 1fr;
  }

  .timeline-panel {
    max-height: none;
  }

  .report-detail-header {
    display: block;
  }

  .admin-users-layout {
    grid-template-columns: 1fr;
  }

  .admin-users-table {
    min-width: 720px;
  }
}
