[hidden] {
  display: none !important;
}

:root {
  --ink: #173c25;
  --muted: #526057;
  --line: #d7ded8;
  --bg: #f4f6f2;
  --blue: #315f3b;
  --shadow: 0 10px 35px rgba(26, 59, 34, .09);
}

.hero {
  background: linear-gradient(125deg, #173c25, #315f3b);
}

.login-page {
  background: linear-gradient(125deg, #173c25 0, #315f3b 55%, #244f30 55%);
}

.brand-mark {
  overflow: hidden;
  border-radius: 12px 4px 12px 4px;
  background: #fff;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.brand-logo-frame {
  width: 230px;
  color: #fff;
}

.brand-logo-frame img {
  width: 210px;
  height: 72px;
  display: block;
  object-fit: cover;
  overflow: hidden;
  border-radius: 16px 5px 16px 5px;
  background: #fff;
}

.brand-logo-frame span {
  display: block;
  margin-top: 7px;
  padding-left: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 12px;
}

.login-divider::before,
.login-divider::after {
  height: 1px;
  flex: 1;
  content: "";
  background: var(--line);
}

.button.public-action {
  color: #fff;
  background: #315f3b;
}

.button.public-action:hover {
  background: #173c25;
}

.public-help {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.occurrence-fields {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.occurrence-fields:disabled {
  opacity: .55;
}

.applicant-result {
  margin-top: 20px;
}

.first-access-note {
  margin: 4px 0 16px;
  padding: 12px 14px;
  border-left: 3px solid var(--orange);
  border-radius: 7px;
  color: var(--ink);
  background: #fff7ef;
}

.inline-feedback {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  color: #176747;
  background: #eaf8f1;
  font-size: 13px;
}

.inline-feedback.error {
  color: #9c3028;
  background: #fff0ef;
}

.lookup-item .lot-variety,
.selected-record .lot-variety {
  margin-top: 5px;
  color: var(--blue);
  font-weight: 700;
}

.attachment-list {
  display: grid;
  gap: 7px;
  margin: -7px 0 18px;
}

.attachment-list > div {
  min-width: 0;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}

.attachment-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-list span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

input[readonly] {
  color: var(--muted);
  background: #f2f5f2;
}

.lot-actions .scanner-button {
  flex: 0 0 46px;
  border-radius: 0 8px 8px 0;
  color: #fff;
  background: #315f3b;
}

.lot-actions .secondary {
  border-radius: 0;
}

.qr-scanner {
  margin: 3px 0 18px;
  padding: 18px;
  border-radius: 13px;
  background: #e8f0e9;
  text-align: center;
}

.qr-scanner video {
  width: 100%;
  max-height: 430px;
  display: block;
  border-radius: 11px;
  background: #111;
  object-fit: contain;
}

.qr-scanner p {
  margin: 12px 0;
  color: var(--ink);
  font-weight: 700;
}

.confirmation-card {
  max-width: 650px;
  margin: 55px auto;
  text-align: center;
}

.confirmation-card h1 {
  margin-bottom: 10px;
}

.confirmation-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 18px 6px 18px 6px;
  color: #fff;
  background: #315f3b;
  font-size: 30px;
  font-weight: 800;
}

.protocol-number {
  display: block;
  margin: 14px 0 20px;
  color: var(--orange);
  font-size: 26px;
}

.confirmation-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.input-action input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.grid > *,
.section-body {
  min-width: 0;
}

.detail-grid,
.detail-main,
.detail-main > .card,
.timeline,
.timeline article,
.timeline article > div,
.timeline header,
.attachments-card {
  min-width: 0;
  max-width: 100%;
}

.attachments-card {
  overflow: hidden;
}

.status-summary {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.classification {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.classification.procedente {
  color: var(--green);
}

.classification.improcedente {
  color: #9c3028;
}

.generate-pdf {
  margin-top: 18px;
}

.timeline-meta {
  width: min(480px, 100%);
  min-width: 0;
  max-width: 100%;
  display: grid;
  flex: 0 1 480px;
  justify-items: end;
  gap: 6px;
}

.timeline-files {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.timeline-files a {
  max-width: 220px;
  overflow: hidden;
  padding: 6px;
  border-radius: 6px;
  color: var(--blue);
  background: #f2f5f2;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-file {
  width: 180px;
  flex: 0 0 180px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  text-align: left;
}

.timeline-file img,
.timeline-file .file-type {
  width: 48px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: #dfe9e1;
  object-fit: cover;
  font-size: 10px;
  font-weight: 900;
}

.timeline-file > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.carousel-controls {
  display: flex;
  gap: 7px;
}

.carousel-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.carousel-button:hover {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.attachment-carousel {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 3px 2px 12px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.attachment-slide {
  min-width: 210px;
  max-width: 210px;
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8faf8;
  scroll-snap-align: start;
}

.attachment-preview {
  height: 125px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #e8f0e9;
}

.attachment-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.document-type {
  color: var(--blue);
  font-size: 24px;
  font-weight: 900;
}

.attachment-slide strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-slide small {
  margin: 0;
}

body.modal-open {
  overflow: hidden;
}

.attachment-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.attachment-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 31, 18, .78);
  backdrop-filter: blur(3px);
}

.attachment-modal-panel {
  position: relative;
  width: min(1050px, 96vw);
  height: min(780px, 92vh);
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}

.attachment-modal-panel > header {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.attachment-modal-panel header > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.attachment-modal-panel header small {
  color: var(--muted);
}

.attachment-modal-panel header strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-modal-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: #eef2ef;
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
}

.attachment-viewer {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  background: #17231b;
}

.attachment-viewer iframe,
.attachment-viewer video {
  width: 100%;
  height: 100%;
  border: 0;
}

.attachment-viewer video {
  max-width: 100%;
  max-height: 100%;
}

.modal-image {
  max-width: 100%;
  max-height: 100%;
  transform-origin: center;
  transition: transform .15s ease;
}

.zoom-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.zoom-controls button {
  min-width: 44px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.attachment-fallback {
  max-width: 430px;
  padding: 35px;
  color: #fff;
  text-align: center;
}

.attachment-fallback strong {
  width: 90px;
  height: 90px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: var(--blue);
  background: #fff;
  font-size: 22px;
}

@media (min-width: 801px) {
  .login-shell {
    grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr);
  }

  .login-intro,
  .login-card {
    min-width: 0;
  }

  .filters input {
    min-width: 180px;
  }

  .filters select {
    flex: 0 0 260px;
    width: 260px;
  }

  .filters .button {
    flex: 0 0 auto;
  }
}

@media (min-width: 801px) and (max-width: 1250px) {
  .nav {
    gap: 14px;
    font-size: 13px;
  }

  .user-name {
    display: none;
  }
}

@media (max-width: 600px) {
  .brand-logo-frame {
    width: 190px;
  }

  .brand-logo-frame img {
    width: 180px;
    height: 62px;
  }

  .lot-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .confirmation-actions {
    display: grid;
  }

  .status-summary,
  .timeline-meta {
    justify-items: start;
  }

  .timeline-meta {
    width: 100%;
    margin-top: 6px;
  }

  .timeline-files {
    width: 100%;
    max-width: 100%;
  }

  .attachment-modal {
    padding: 8px;
  }

  .attachment-modal-panel {
    width: 100%;
    height: 96vh;
  }

  .attachment-modal-panel > header {
    padding: 10px;
  }

  .attachment-modal-actions .button {
    padding: 9px 11px;
  }
}
