:root {
  --app-bg: #f4f8fa;
  --app-ink: #1c2b33;
  --app-muted: #64748b;
  --app-line: #d6e1e7;
  --app-primary: #07576a;
  --app-primary-2: #0ea5c6;
  --app-accent: #f2a719;
}

body {
  background:
    linear-gradient(180deg, rgba(14, 165, 198, .08), rgba(244, 248, 250, 0) 260px),
    var(--app-bg);
  color: var(--app-ink);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.navbar {
  border-bottom: 1px solid var(--app-line);
  box-shadow: 0 8px 24px rgba(7, 87, 106, .06);
}

.content-wrap {
  max-width: 1180px;
}

.brand-logo {
  width: 190px;
  height: 48px;
  object-fit: contain;
  object-position: left center;
}

.brand-logo-login {
  display: block;
  width: min(100%, 320px);
  height: auto;
  margin: 0 auto 1rem;
}

.app-footer {
  border-top: 1px solid var(--app-line);
  background: rgba(255, 255, 255, .82);
  margin-top: auto;
}

.panel {
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(28, 43, 51, .06);
}

.muted {
  color: var(--app-muted);
}

.btn-primary {
  --bs-btn-bg: var(--app-primary);
  --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: #06495a;
  --bs-btn-hover-border-color: #06495a;
  --bs-btn-active-bg: #053f4e;
  --bs-btn-active-border-color: #053f4e;
}

.btn-outline-primary {
  --bs-btn-color: var(--app-primary);
  --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-primary);
  --bs-btn-hover-border-color: var(--app-primary);
}

.nav-link {
  color: #38515c;
  font-weight: 500;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--app-primary-2);
}

.login-panel {
  border-top: 4px solid var(--app-primary-2);
}

.login-panel .input-group-text {
  background: #eef7fa;
  color: var(--app-primary);
  font-weight: 700;
}

.search-panel {
  border-top: 3px solid var(--app-primary-2);
}

.search-heading {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  margin-bottom: .9rem;
}

.search-heading h2 {
  font-size: 1.12rem;
  margin: 0;
}

.search-heading p {
  color: var(--app-muted);
  font-size: .92rem;
  margin: .15rem 0 0;
}

.section-kicker {
  color: var(--app-primary);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: .75rem;
}

.page-actions {
  align-items: center;
  display: flex;
  gap: .5rem;
}

.btn-action {
  align-items: center;
  display: inline-flex;
  gap: .4rem;
  min-height: 38px;
  padding-inline: .8rem;
}

.btn-action svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  width: 18px;
}

.delete-summary {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: .75rem .9rem;
}

.delete-summary strong,
.delete-summary span {
  display: block;
}

.delete-summary span {
  color: var(--app-muted);
  font-size: .9rem;
  margin-top: .15rem;
}

.dynamic-fieldset {
  background: #f8fbfc;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  padding: 1rem;
}

.dynamic-fieldset-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .85rem;
}

.dynamic-row {
  align-items: end;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: .65rem;
  margin-bottom: .65rem;
}

.dynamic-row:last-child {
  margin-bottom: 0;
}

.dynamic-row [data-remove-row] {
  min-width: 42px;
}

.table td,
.table th {
  vertical-align: middle;
}

.attachment-thumb {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--app-line);
  background: #fff;
}

.attachment-image-btn {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--app-primary);
  display: inline-flex;
  flex-direction: column;
  gap: .35rem;
  padding: 0;
  text-align: center;
}

.attachment-image-btn span {
  font-size: .75rem;
  font-weight: 700;
}

.attachment-image-btn:hover .attachment-thumb,
.attachment-image-btn:focus .attachment-thumb {
  border-color: var(--app-primary-2);
  box-shadow: 0 8px 24px rgba(14, 165, 198, .28);
}

.lightbox-content {
  background: #0b1f27;
  border: 0;
  color: #fff;
}

.lightbox-content .modal-header {
  border-bottom-color: rgba(255, 255, 255, .14);
}

.lightbox-content .btn-close {
  filter: invert(1) grayscale(100%);
}

.lightbox-body {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 50vh;
  padding: 1rem;
}

.lightbox-body img {
  background: #fff;
  border-radius: 6px;
  max-height: calc(100vh - 160px);
  max-width: 100%;
  object-fit: contain;
}

.field-label {
  font-size: .82rem;
  color: var(--app-muted);
  margin-bottom: .2rem;
}

.record-title {
  word-break: break-word;
}

.license-list {
  display: grid;
  gap: .45rem;
}

.license-pill {
  align-items: center;
  background: #f7fafc;
  border: 1px solid #e3ebef;
  border-radius: 7px;
  display: flex;
  gap: .75rem;
  justify-content: space-between;
  padding: .55rem .7rem;
}

.license-pill strong {
  color: var(--app-primary);
}

.license-pill span {
  color: var(--app-muted);
  font-size: .9rem;
}

.record-list {
  display: grid;
  gap: .75rem;
}

.record-card {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(320px, 2fr) auto;
  gap: 1rem;
  align-items: center;
  background: #fff;
  border: 1px solid var(--app-line);
  border-left: 4px solid var(--app-primary-2);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 10px 26px rgba(28, 43, 51, .055);
}

.record-card:hover {
  border-left-color: var(--app-accent);
  box-shadow: 0 14px 34px rgba(28, 43, 51, .09);
  transform: translateY(-1px);
  transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease;
}

.record-address {
  color: var(--app-primary);
  display: inline-block;
  font-size: 1.03rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  word-break: break-word;
}

.record-address:hover,
.record-address:focus {
  color: var(--app-primary-2);
  text-decoration: underline;
  text-underline-offset: .18em;
}

.record-subtitle {
  color: var(--app-muted);
  font-size: .9rem;
  margin-top: .25rem;
}

.record-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5rem;
}

.record-meta div {
  background: #f7fafc;
  border: 1px solid #e3ebef;
  border-radius: 7px;
  min-height: 54px;
  padding: .45rem .6rem;
}

.record-meta span {
  color: var(--app-muted);
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.record-meta strong {
  color: var(--app-ink);
  display: block;
  font-size: .95rem;
  font-weight: 700;
  margin-top: .1rem;
  word-break: break-word;
}

.record-actions {
  display: flex;
  gap: .45rem;
  justify-content: flex-end;
}

@media (max-width: 767.98px) {
  .table-responsive-cards thead {
    display: none;
  }

  .table-responsive-cards tr {
    display: block;
    border-bottom: 1px solid var(--app-line);
    padding: .75rem 0;
  }

  .table-responsive-cards td {
    display: grid;
    grid-template-columns: 9rem 1fr;
    border: 0;
    padding: .25rem 0;
  }

  .table-responsive-cards td::before {
    content: attr(data-label);
    color: var(--app-muted);
    font-weight: 600;
  }

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

  .record-card {
    grid-template-columns: 1fr;
    gap: .85rem;
    padding: .95rem;
  }

  .record-meta {
    grid-template-columns: 1fr;
  }

  .record-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .page-actions {
    align-self: stretch;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .btn-action {
    justify-content: center;
  }

  .dynamic-row {
    grid-template-columns: 1fr;
  }
}
