:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --panel: #fffdf9;
  --panel-soft: #fff7ed;
  --text: #292621;
  --muted: #6f6960;
  --line: #e6ded3;
  --orange: #c9752d;
  --orange-dark: #8f531f;
  --orange-soft: #f1d7ba;
  --green: #3f735f;
  --blue: #4b668c;
  --danger: #9d332b;
  --shadow: 0 18px 40px rgba(54, 46, 35, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Cambria, Georgia, "Times New Roman", serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 7px;
  background: var(--orange);
  color: white;
  cursor: pointer;
  font-weight: 800;
  min-height: 42px;
  padding: 0 18px;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

button:hover {
  background: var(--orange-dark);
}

button:disabled {
  background: #ddd8cf;
  color: #8d8980;
  cursor: not-allowed;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  min-height: 42px;
  overflow-wrap: anywhere;
  padding: 10px 12px;
}

#client-search {
  margin-bottom: 8px;
}

textarea {
  line-height: 1.35;
  min-height: 70px;
  resize: vertical;
}

textarea[readonly] {
  background: #fbf7f1;
  cursor: default;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--orange);
  outline: 3px solid rgba(201, 120, 47, 0.18);
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 18px;
}

legend {
  color: var(--orange-dark);
  font-size: 13px;
  font-weight: 900;
  padding: 0 8px;
  text-transform: uppercase;
}

.hidden,
.app-view {
  display: none !important;
}

.active-view {
  display: block !important;
}

.app-shell {
  min-height: 100vh;
}

.login-view {
  display: grid;
  background: #f5f1e9;
  grid-template-columns: minmax(0, 1.12fr) minmax(380px, 480px);
  min-height: 100vh;
  padding: 0;
}

.login-hero {
  background: #272017;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

.login-hero-image {
  height: 100%;
  inset: 0;
  object-fit: cover;
  object-position: center;
  position: absolute;
  width: 100%;
}

.login-hero-overlay {
  background:
    linear-gradient(90deg, rgba(35, 28, 20, 0.76) 0%, rgba(35, 28, 20, 0.38) 54%, rgba(35, 28, 20, 0.18) 100%),
    rgba(30, 25, 18, 0.12);
  inset: 0;
  position: absolute;
}

.login-hero-accent {
  background: rgba(201, 117, 45, 0.82);
  bottom: 0;
  height: 9px;
  left: 0;
  position: absolute;
  right: 0;
  z-index: 1;
}

.login-hero-content {
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100vh;
  min-width: 0;
  padding: clamp(30px, 5vw, 70px);
  position: relative;
  z-index: 1;
}

.login-hero-content h1 {
  font-size: clamp(42px, 6vw, 76px);
  line-height: 1;
  margin: 18px 0 12px;
  max-width: 720px;
}

.login-hero-content .eyebrow {
  color: #ffe0bd;
  grid-column: 2;
  margin-top: 0;
}

.login-hero-content .intro {
  color: #fff8ee;
}

.hero-brand-lockup {
  align-items: center;
  display: grid;
  gap: 8px 22px;
  grid-template-columns: clamp(132px, 14vw, 190px) minmax(0, 1fr);
  margin-bottom: clamp(38px, 8vh, 82px);
  max-width: 620px;
}

.hero-brand-lockup strong {
  color: #ffffff;
  display: block;
  font-size: clamp(31px, 3.4vw, 42px);
  grid-column: 2;
  line-height: 1;
  margin-top: 4px;
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  height: auto;
  object-fit: contain;
}

.brand-logo-hero {
  filter: drop-shadow(0 12px 18px rgba(38, 29, 18, 0.36));
  grid-row: span 2;
  width: clamp(132px, 14vw, 190px);
}

.brand-logo-small {
  width: 42px;
}

.intro {
  color: var(--muted);
  font-size: 19px;
  line-height: 1.55;
  max-width: 540px;
  overflow-wrap: anywhere;
}

.eyebrow {
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.login-card,
.client-portal-card,
.worker-portal-card,
.form-panel,
.list-panel,
.calendar-panel,
.bel-panel,
.hero-panel,
.metric-card,
.dashboard-work-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.access-column {
  align-self: center;
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.96), rgba(255, 248, 239, 0.98)),
    #fffaf4;
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: center;
  min-height: 100vh;
  min-width: 0;
  padding: clamp(26px, 4vw, 58px);
}

.access-heading {
  display: grid;
  gap: 10px;
}

.access-heading h2 {
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1;
  margin: 0;
}

.access-logo-row {
  border-left: 4px solid var(--orange);
  display: grid;
  gap: 4px;
  padding-left: 14px;
}

.login-card,
.client-portal-card,
.worker-portal-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 22px;
}

.login-card {
  border-left: 5px solid var(--orange);
}

.client-portal-card {
  background: #ffffff;
}

.client-access-card {
  border-left: 0;
}

.worker-portal-card {
  background: #fffdf9;
  border-color: #eadfd2;
}

.worker-portal-card button {
  width: 100%;
}

.portal-access-card {
  align-items: start;
  border-color: rgba(201, 117, 45, 0.22);
  box-shadow: 0 14px 32px rgba(58, 47, 34, 0.08);
  grid-template-columns: 1fr;
}

.portal-access-card form,
.portal-access-card button,
.portal-access-card .public-result {
  grid-column: 1 / -1;
}

.login-card-header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.login-card label,
.client-portal-card label,
.worker-portal-card label {
  gap: 6px;
}

.login-card input,
.client-portal-card input,
.worker-portal-card input {
  min-height: 40px;
}

#public-lookup-form {
  display: grid;
  gap: 12px;
}

.login-card h2,
.client-portal-card h2,
.worker-portal-card h2,
.access-heading h2,
.topbar h2,
.section-heading h3,
.calendar-header h3,
.hero-panel h3 {
  margin: 0;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.error-message {
  color: var(--danger);
  font-size: 14px;
  font-weight: 800;
  min-height: 18px;
  margin: 0;
}

.error-message:empty {
  display: none;
}

.portal-entry {
  display: grid;
  gap: 14px;
}

.portal-home-entry {
  gap: 16px;
}

.portal-entry-button {
  width: 100%;
}

.portal-access-card .portal-entry {
  align-items: start;
  grid-column: 1 / -1;
  grid-template-columns: 1fr;
}

.portal-access-card .portal-entry form {
  grid-column: 1 / -1;
}

.public-result {
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.public-result:empty {
  display: none;
}

.public-result h3,
.portal-profile h3 {
  color: var(--text);
  font-size: 20px;
  margin: 0;
}

.portal-profile {
  display: grid;
  gap: 16px;
}

.portal-profile-header {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.portal-profile-header p:not(.eyebrow) {
  margin: 5px 0 0;
}

.portal-card-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-info-card {
  background: #fffaf2;
  border: 1px solid var(--orange-soft);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
}

.portal-info-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.portal-info-card strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.portal-section {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding-top: 14px;
}

.portal-section h4 {
  color: var(--text);
  font-size: 16px;
  margin: 0;
}

.portal-section p {
  color: var(--muted);
  margin: 4px 0 0;
}

.portal-document-section {
  align-items: center;
  background: #fffaf2;
  border: 1px solid var(--orange-soft);
  border-radius: 8px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 16px;
}

.public-result dl,
.portal-section dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.public-result dl div,
.portal-section dl div {
  align-items: flex-start;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-top: 9px;
}

.portal-section dl div:first-child {
  border-top: 0;
  padding-top: 0;
}

.public-result dt,
.portal-section dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.public-result dd,
.portal-section dd {
  color: var(--text);
  font-weight: 800;
  margin: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.portal-samples {
  display: grid;
  gap: 8px;
}

.portal-samples details {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.portal-samples summary {
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
  list-style-position: inside;
  padding: 10px 12px;
}

.portal-samples details[open] summary {
  border-bottom: 1px solid var(--line);
}

.portal-samples dl {
  padding: 10px 12px 12px;
}

.portal-message {
  display: grid;
  gap: 8px;
}

.portal-message-error {
  color: var(--danger);
}

.system-view {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

.client-profile-view {
  background: var(--bg);
  min-height: 100vh;
  padding: 24px clamp(18px, 4vw, 54px);
}

.client-profile-header {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 6px solid var(--orange);
  border-radius: 8px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 auto 22px;
  max-width: 1120px;
  padding: 16px 18px;
}

.client-profile-content {
  margin: 0 auto;
  max-width: 1120px;
}

.profile-page {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 30px);
}

.profile-page-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.profile-page .portal-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.client-code-entry {
  display: grid;
  gap: 22px;
  margin: 0 auto;
  max-width: 760px;
}

.client-code-hero {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding-bottom: 18px;
}

.client-code-hero h3 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1;
  margin: 0;
}

.client-code-hero p:not(.eyebrow) {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
  margin: 0;
  max-width: 620px;
}

.client-code-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) max-content;
}

.client-code-form button {
  min-width: 170px;
}

.sidebar {
  background: #fffdf9;
  border-right: 1px solid var(--line);
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  position: relative;
}

.sidebar::before {
  background: var(--orange);
  content: "";
  inset: 0 auto 0 0;
  position: absolute;
  width: 6px;
}

.brand-row {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-row span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 3px;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  min-height: 46px;
  text-align: left;
}

.nav-button.active,
.nav-button:hover {
  background: var(--panel-soft);
  border-color: var(--orange-soft);
  color: var(--orange-dark);
}

.nav-button[data-view="bel-view"] {
  align-items: center;
  display: flex;
  gap: 8px;
}

.bel-nav-logo {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.bel-nav-logo img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.secondary-button {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--text);
}

.secondary-button:hover {
  background: var(--panel-soft);
  color: var(--orange-dark);
}

.sidebar-action {
  text-align: left;
}

.workspace {
  min-width: 0;
  padding: 26px;
}

.topbar {
  align-items: center;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 22px;
  padding: 14px 16px;
}

.topbar-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.user-chip {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  gap: 2px;
  min-width: 180px;
  padding: 9px 14px;
}

.user-chip span {
  color: var(--text);
  font-weight: 900;
}

.user-chip small {
  color: var(--muted);
}

.sync-status-panel {
  align-items: center;
  background: #fffaf2;
  border: 1px solid var(--orange-soft);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  margin: -8px 0 22px;
  padding: 14px 16px;
}

.sync-status-panel.hidden {
  display: none;
}

.sync-status-main {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.sync-status-main strong {
  color: var(--text);
  display: block;
  font-size: 17px;
}

.sync-status-main p,
.sync-status-side span {
  color: var(--muted);
  margin: 2px 0 0;
}

.sync-status-side {
  display: grid;
  gap: 8px;
}

.sync-spinner {
  border: 3px solid #f5d4ae;
  border-top-color: var(--orange);
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  height: 26px;
  width: 26px;
}

.sync-status-loading .sync-spinner {
  animation: sync-spin 0.9s linear infinite;
}

.sync-status-ready {
  background: #fbfff8;
  border-color: #cfe6bd;
}

.sync-status-ready .sync-spinner {
  border-color: #9fca84;
}

.sync-status-error {
  background: #fff6f3;
  border-color: #e8b6a7;
}

.sync-status-error .sync-spinner {
  border-color: #c46e57;
}

.sync-progress {
  background: #f2dfc8;
  border-radius: 999px;
  height: 7px;
  overflow: hidden;
}

.sync-progress span {
  background: var(--orange);
  border-radius: inherit;
  display: block;
  height: 100%;
  width: 44%;
}

.sync-status-loading .sync-progress span {
  animation: sync-progress 1.35s ease-in-out infinite;
}

.sync-status-ready .sync-progress span {
  background: #88b96a;
  width: 100%;
}

.sync-status-error .sync-progress span {
  background: #c46e57;
  width: 100%;
}

@keyframes sync-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes sync-progress {
  0% {
    transform: translateX(-120%);
  }

  100% {
    transform: translateX(240%);
  }
}

.overview-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hero-panel {
  align-items: center;
  border-left: 5px solid var(--orange);
  display: grid;
  gap: 24px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 420px);
  overflow: hidden;
  padding: 24px;
}

.hero-panel h3 {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  margin-top: 10px;
  max-width: 780px;
}

.hero-panel p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
  max-width: 680px;
}

.hero-panel-copy {
  min-width: 0;
}

.dashboard-hero {
  background: #2e261d;
  border-left: 0;
  color: #ffffff;
  min-height: 330px;
  padding: clamp(26px, 4vw, 44px);
  position: relative;
}

.dashboard-hero-bg,
.dashboard-hero-shade {
  inset: 0;
  position: absolute;
}

.dashboard-hero-bg {
  height: 100%;
  object-fit: cover;
  object-position: center;
  width: 100%;
}

.dashboard-hero-shade {
  background:
    linear-gradient(90deg, rgba(32, 25, 18, 0.86) 0%, rgba(32, 25, 18, 0.62) 48%, rgba(32, 25, 18, 0.22) 100%),
    linear-gradient(0deg, rgba(201, 117, 45, 0.18), rgba(201, 117, 45, 0.18));
}

.dashboard-hero-copy {
  max-width: 760px;
  position: relative;
  z-index: 1;
}

.dashboard-brand,
.dashboard-bel-heading {
  border-left: 4px solid rgba(255, 210, 158, 0.82);
  display: grid;
  gap: 4px;
  padding-left: 14px;
}

.dashboard-brand {
  margin-bottom: 24px;
}

.dashboard-brand strong {
  display: block;
  font-size: 18px;
  margin-top: 3px;
}

.dashboard-hero h3 {
  color: #ffffff;
  font-size: clamp(30px, 4vw, 54px);
  max-width: 760px;
}

.dashboard-hero p:not(.eyebrow) {
  color: #fff5e8;
  font-size: 17px;
  max-width: 650px;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.dashboard-actions .secondary-button {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.7);
}

.hero-panel-photo {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  height: auto;
  object-fit: cover;
  width: 100%;
}

.metric-card {
  box-shadow: none;
  min-height: 126px;
  padding: 20px;
  position: relative;
}

.metric-card::before {
  background: var(--orange);
  border-radius: 8px 8px 0 0;
  content: "";
  height: 5px;
  inset: 0 0 auto;
  position: absolute;
}

.metric-card:nth-of-type(3)::before {
  background: var(--blue);
}

.metric-card:nth-of-type(4)::before {
  background: var(--green);
}

.metric-card:nth-of-type(5)::before {
  background: var(--orange-dark);
}

.metric-card span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.metric-card strong {
  color: var(--orange-dark);
  display: block;
  font-size: 42px;
  line-height: 1;
}

.dashboard-work-card {
  box-shadow: none;
  display: grid;
  gap: 12px;
  grid-column: span 1;
  min-width: 0;
  padding: 20px;
}

.dashboard-work-card h3 {
  font-size: 22px;
  margin: 0;
}

.dashboard-work-card p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.dashboard-work-card button {
  justify-self: start;
}

.dashboard-bel-card {
  border-color: rgba(63, 115, 95, 0.24);
  grid-column: span 2;
}

.dashboard-bel-heading img {
  height: 46px;
  object-fit: contain;
  width: 46px;
}

.form-panel,
.list-panel,
.calendar-panel,
.bel-panel {
  box-shadow: none;
  padding: 24px;
}

.form-panel {
  max-width: 1120px;
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.45;
  margin: 7px 0 0;
}

.form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.form-tab {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--muted);
  min-height: 36px;
  padding: 0 14px;
}

.form-tab:hover,
.form-tab.active {
  background: var(--panel-soft);
  border-color: var(--orange-soft);
  color: var(--orange-dark);
}

.form-section {
  display: none;
}

.form-section.active-form-section {
  display: block;
}

.sample-tools {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(180px, 240px) max-content;
  margin-bottom: 16px;
}

.parameter-import-panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 14px;
}

.parameter-import-grid {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: max-content max-content;
}

.file-button {
  align-items: center;
  background: #fff7ee;
  border: 1px solid var(--orange-soft);
  border-radius: 8px;
  color: var(--orange-dark);
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
}

.file-button input {
  display: none;
}

.client-import-panel {
  gap: 14px;
}

.client-import-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.client-import-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.client-import-summary {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.client-import-summary span {
  background: #fff7ee;
  border: 1px solid var(--orange-soft);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  gap: 3px;
  padding: 10px;
}

.client-import-summary strong {
  color: var(--text);
  font-size: 22px;
}

.client-import-preview-list {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow: auto;
}

.client-import-search-form,
.client-import-pager {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) max-content max-content;
}

.client-import-pager {
  align-items: center;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
}

.client-import-pager span {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.client-import-pager button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.client-import-pager-bottom {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.client-import-row {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 10px;
}

.client-import-row strong,
.client-import-row small {
  overflow-wrap: anywhere;
}

.client-import-row small {
  color: var(--muted);
}

.client-import-warnings {
  color: #8a5d26;
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.client-import-confirm-row.hidden {
  display: none;
}

.registry-search-panel {
  background: #fffdf9;
  border-color: var(--orange-soft);
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.registry-search-toolbar {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) max-content;
}

.client-directory-toolbar,
.client-directory-pager {
  align-items: end;
  display: grid;
  gap: 10px;
}

.client-directory-toolbar {
  grid-template-columns: minmax(0, 1fr) max-content;
}

.client-directory-pager {
  align-items: center;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
}

.client-directory-pager span {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.client-directory-pager button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.helper-text {
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0 0;
}

.sample-list {
  display: grid;
  gap: 14px;
}

.sample-item {
  background: #fffaf2;
  border: 1px solid var(--orange-soft);
  border-radius: 8px;
  min-width: 0;
  padding: 16px;
}

.sample-item-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sample-item-header strong {
  color: var(--orange-dark);
  font-size: 16px;
}

.sample-context-menu {
  background: #ffffff;
  border: 1px solid var(--orange-soft);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(87, 50, 16, 0.16);
  min-width: 220px;
  padding: 6px;
  position: fixed;
  z-index: 1000;
}

.sample-context-menu button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--orange-dark);
  cursor: pointer;
  font-family: Cambria, Georgia, serif;
  font-size: 14px;
  font-weight: 700;
  min-height: 36px;
  padding: 8px 10px;
  text-align: left;
  width: 100%;
}

.sample-context-menu button:hover {
  background: #fff3e6;
}

.sample-grid,
.sample-params {
  display: grid;
  gap: 14px;
}

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

.sample-params {
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
  padding-top: 14px;
}

.wide-field {
  grid-column: 1 / -1;
}

.field-params {
  margin-top: 14px;
}

.registry-panel {
  margin-top: 18px;
}

.client-list-panel {
  margin-top: 18px;
}

.production-panel {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.production-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.backup-reminder {
  background: #fffaf2;
  border: 1px solid var(--orange-soft);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
}

.backup-reminder strong {
  color: var(--orange-dark);
}

.backup-reminder p {
  color: var(--muted);
  margin: 0;
}

.production-status {
  display: grid;
  gap: 12px;
}

.production-summary,
.production-check {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  padding: 12px;
}

.production-summary {
  align-items: center;
  justify-content: space-between;
}

.production-summary span,
.production-check p {
  color: var(--muted);
  margin: 0;
}

.production-check-list {
  display: grid;
  gap: 8px;
}

.production-check span {
  border-radius: 999px;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  min-width: 84px;
  padding: 5px 9px;
  text-align: center;
}

.production-check strong {
  display: block;
  margin-bottom: 3px;
}

.production-ok {
  background: #f0f7f3;
  border-color: #c9dfd1;
}

.production-ok span,
.production-ok > span {
  background: #dbeee3;
  color: var(--green);
}

.production-warning,
.production-pending {
  background: #fff8ed;
  border-color: #f0d7b7;
}

.production-warning span,
.production-warning > span,
.production-pending span,
.production-pending > span {
  background: #f8ead5;
  color: var(--orange-dark);
}

.production-error {
  background: #fff1ef;
  border-color: #f0c4bf;
}

.production-error span,
.production-error > span {
  background: #f7d7d3;
  color: var(--danger);
}

.records-search {
  margin: 12px 0 16px;
  max-width: 460px;
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  text-align: left;
  vertical-align: top;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: var(--panel-soft);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.status-pill {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 900;
  padding: 5px 9px;
}

.status-pendiente {
  background: #f8ead5;
  color: #7b5624;
}

.status-en-proceso {
  background: #edf2f8;
  color: var(--blue);
}

.status-completado {
  background: #e9f3ee;
  color: var(--green);
}

.empty-state {
  color: var(--muted);
  margin: 18px 0 0;
}

.calendar-header,
.calendar-controls,
.weekday-row,
.lot-detail-content > dl > div {
  display: flex;
}

.calendar-header {
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.calendar-header h3 {
  margin-top: 4px;
}

.calendar-controls {
  align-items: center;
  gap: 8px;
}

.calendar-controls strong {
  min-width: 150px;
  text-align: center;
}

.icon-button {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 36px;
  padding: 0;
  width: 36px;
}

.secondary-button.compact {
  min-height: 36px;
  padding: 0 12px;
}

.calendar-layout {
  display: block;
}

.calendar-wrap {
  min-width: 0;
  width: 100%;
}

.weekday-row {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.weekday-row span {
  color: var(--orange-dark);
  flex: 1 1 0;
  font-size: 12px;
  font-weight: 900;
  padding: 10px;
  text-align: center;
  text-transform: uppercase;
}

.calendar-grid {
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-day {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-height: 122px;
  padding: 8px;
}

.calendar-day.muted-day {
  background: #faf9f6;
}

.day-number {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 7px;
}

.calendar-lot {
  background: #fbf3e8;
  border: 1px solid var(--orange-soft);
  color: var(--text);
  display: block;
  font-size: 12px;
  line-height: 1.25;
  margin-bottom: 6px;
  min-height: 0;
  padding: 7px;
  text-align: left;
  width: 100%;
}

.calendar-lot:hover,
.calendar-lot.selected {
  background: var(--orange-dark);
  border-color: var(--orange-dark);
  color: white;
}

.calendar-lot span,
.calendar-lot small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-lot span {
  font-weight: 900;
}

.calendar-lot small {
  opacity: 0.82;
}

.calendar-lot-actor {
  color: inherit;
  font-size: 11px;
  margin-top: 3px;
  opacity: 0.72;
}

.more-lots {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-top: 6px;
}

.lot-detail-modal {
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 26px 70px rgba(66, 43, 19, 0.22);
  display: grid;
  gap: 16px;
  max-height: min(92vh, 860px);
  max-width: 980px;
  overflow: auto;
  padding: 22px;
  width: min(100%, 980px);
}

.lot-detail-modal-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding-bottom: 14px;
}

.lot-detail-modal-header h3 {
  font-size: 28px;
  margin: 2px 0 6px;
}

.lot-detail-modal-header .hint {
  margin: 0;
}

.lot-detail-content {
  color: var(--muted);
  display: grid;
  gap: 14px;
  line-height: 1.5;
}

.lot-detail-content > h4 {
  color: var(--text);
  font-size: 22px;
  margin: 0;
}

.lot-detail-content > p {
  margin: 0;
}

.lot-detail-content > dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.lot-detail-content > dl > div {
  align-items: flex-start;
  border-top: 1px solid var(--line);
  gap: 12px;
  justify-content: space-between;
  padding-top: 10px;
}

.lot-detail-content > dl > div:first-child,
.lot-detail-content > dl > div:nth-child(2) {
  border-top: 0;
}

.lot-detail-content > dl dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.lot-detail-content > dl dd {
  color: var(--text);
  font-weight: 800;
  margin: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.lot-detail-modal .detail-actions {
  background: #fff7ee;
  border: 1px solid var(--orange-soft);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 12px;
}

.lot-detail-modal .time-editor {
  margin-top: 0;
}

.sample-summary {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
}

.sample-summary h5 {
  color: var(--text);
  font-size: 16px;
  margin: 0;
}

.sample-summary details {
  background: #fffaf2;
  border: 1px solid var(--orange-soft);
  border-radius: 8px;
  min-width: 0;
  padding: 0;
}

.sample-summary summary {
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
  list-style-position: inside;
  padding: 10px 12px;
}

.sample-summary details[open] summary {
  border-bottom: 1px solid var(--line);
}

.sample-summary dl {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px 12px 12px;
}

.sample-summary dl div {
  border-top: 0;
  display: grid;
  gap: 4px;
  padding-top: 0;
}

.sample-summary dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.sample-summary dd {
  color: var(--text);
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.download-button {
  width: 100%;
}

.detail-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.modal-backdrop {
  align-items: center;
  background: rgba(34, 27, 20, 0.38);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 2000;
}

.sample-document-modal {
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 26px 70px rgba(66, 43, 19, 0.22);
  display: grid;
  gap: 16px;
  max-height: min(92vh, 820px);
  max-width: 780px;
  overflow: auto;
  padding: 22px;
  width: min(100%, 780px);
}

.sample-document-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding-bottom: 14px;
}

.sample-document-header h3 {
  font-size: 28px;
  margin: 2px 0 6px;
}

.sample-document-header .hint,
.sample-document-quick .helper-text {
  margin: 0;
}

.sample-document-quick {
  display: grid;
  gap: 8px;
}

.sample-document-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sample-document-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0;
  max-height: 360px;
  overflow: auto;
}

.sample-document-option {
  align-items: flex-start;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(84px, auto) minmax(0, 1fr);
  margin: 0;
  padding: 12px;
}

.sample-document-option:last-child {
  border-bottom: 0;
}

.sample-document-option:hover {
  background: #fff7ee;
}

.sample-document-option input {
  min-height: auto;
  width: auto;
}

.sample-document-number {
  color: var(--orange-dark);
  font-weight: 900;
  white-space: nowrap;
}

.sample-document-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.sample-document-copy strong,
.sample-document-copy small {
  overflow-wrap: anywhere;
}

.sample-document-copy small {
  color: var(--muted);
  line-height: 1.35;
}

.sample-document-summary {
  color: var(--muted);
  font-weight: 700;
  margin: 0;
}

.sample-document-summary.warning {
  color: #9d332b;
}

.time-editor {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
}

.danger-button {
  background: #9d332b;
  color: white;
  width: 100%;
}

.danger-button.compact {
  min-height: 36px;
  padding: 0 12px;
  width: auto;
}

.danger-button:hover {
  background: #7f281f;
}

.bel-panel {
  display: grid;
  gap: 18px;
  max-width: 1120px;
}

.bel-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding-bottom: 18px;
}

.bel-identity {
  align-items: center;
  display: flex;
  gap: 16px;
  min-width: 0;
}

.bel-logo {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  height: 86px;
  justify-content: center;
  width: 86px;
}

.bel-logo img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.bel-header h3 {
  font-size: 34px;
  line-height: 1;
  margin: 6px 0;
}

.bel-header p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
  max-width: 620px;
}

.bel-counter {
  background: var(--panel-soft);
  border: 1px solid var(--orange-soft);
  border-radius: 8px;
  min-width: 150px;
  padding: 14px;
  text-align: center;
}

.bel-counter span {
  color: var(--orange-dark);
  display: block;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.bel-counter small {
  color: var(--muted);
  display: block;
  font-weight: 800;
  margin-top: 5px;
}

.bel-counter #bel-ai-status {
  border-top: 1px solid var(--orange-soft);
  color: var(--orange-dark);
  font-size: 12px;
  margin-top: 10px;
  padding-top: 8px;
}

.bel-messages {
  background: #fbfaf7;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  max-height: 420px;
  min-height: 220px;
  overflow: auto;
  padding: 16px;
}

.bel-message {
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: min(760px, 100%);
  padding: 13px 15px;
}

.bel-message strong {
  align-items: center;
  color: var(--orange-dark);
  display: flex;
  gap: 8px;
  margin-bottom: 5px;
}

.bel-message p {
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
}

.bel-message-bot {
  background: white;
}

.bel-message-thinking {
  border-color: var(--orange-soft);
  box-shadow: 0 8px 18px rgba(207, 119, 33, 0.08);
}

.bel-message-thinking p {
  align-items: center;
  display: flex;
  gap: 9px;
}

.bel-message-thinking p::before {
  animation: belThinkingPulse 1.1s ease-in-out infinite;
  background: var(--orange-dark);
  border-radius: 999px;
  content: "";
  flex: 0 0 auto;
  height: 8px;
  width: 8px;
}

@keyframes belThinkingPulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

.bel-message-user {
  background: var(--panel-soft);
  justify-self: end;
}

.bel-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.bel-form textarea {
  min-height: 88px;
}

.bel-form button {
  min-width: 150px;
}

.bel-suggestions {
  display: grid;
  gap: 10px;
}

.bel-suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bel-suggestion {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--text);
  min-height: 36px;
  padding: 0 12px;
}

.bel-suggestion:hover {
  background: var(--panel-soft);
  color: var(--orange-dark);
}

@media (max-height: 760px) and (min-width: 921px) {
  .access-column {
    padding: 18px clamp(30px, 4vw, 46px);
  }

  .access-heading h2 {
    font-size: 34px;
  }

  .login-card,
  .client-portal-card,
  .worker-portal-card {
    gap: 11px;
    padding: 18px;
  }

  .login-card h2,
  .client-portal-card h2,
  .worker-portal-card h2 {
    font-size: 25px;
  }

  .hint {
    line-height: 1.35;
  }
}

@media (max-width: 1040px) {
  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-page .portal-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

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

@media (max-width: 920px) {
  .login-view,
  .system-view {
    grid-template-columns: 1fr;
  }

  .login-hero,
  .login-hero-content {
    min-height: 430px;
  }

  .access-column {
    min-height: auto;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    min-height: 380px;
  }

  .sidebar {
    gap: 18px;
  }

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

  .calendar-layout {
    flex-direction: column;
  }

  .lot-detail {
    flex-basis: auto;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
    width: 100%;
  }

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

  .client-profile-header,
  .portal-profile-header,
  .portal-document-section,
  .lot-detail-modal-header,
  .bel-header,
  .bel-form {
    align-items: flex-start;
    flex-direction: column;
  }

  .bel-form {
    display: flex;
  }

  .bel-form button,
  .client-code-form button,
  .bel-counter {
    width: 100%;
  }

  .client-code-form {
    grid-template-columns: 1fr;
  }

  .bel-logo {
    height: 62px;
    width: 62px;
  }
}

@media (max-width: 620px) {
  .workspace {
    padding: 18px;
  }

  .login-hero,
  .login-hero-content {
    min-height: 360px;
  }

  .login-hero-content {
    padding: 24px;
  }

  .login-hero-content h1 {
    font-size: 42px;
  }

  .login-hero-content .intro {
    font-size: 17px;
    line-height: 1.45;
    max-width: 100%;
  }

  .access-column {
    padding: 20px;
  }

  .hero-brand-lockup,
  .access-logo-row,
  .dashboard-brand,
  .dashboard-bel-heading {
    align-items: flex-start;
  }

  .hero-brand-lockup {
    gap: 12px;
    grid-template-columns: clamp(108px, 30vw, 132px) minmax(0, 1fr);
    margin-bottom: 38px;
  }

  .brand-logo-hero {
    width: clamp(108px, 30vw, 132px);
  }

  .portal-access-card,
  .portal-access-card .portal-entry {
    grid-template-columns: 1fr;
  }

  .dashboard-actions,
  .dashboard-work-card button {
    width: 100%;
  }

  .dashboard-actions button {
    width: 100%;
  }

  .dashboard-bel-card {
    grid-column: span 1;
  }

  .overview-grid,
  .form-grid,
  .portal-card-grid,
  .client-import-summary,
  .client-import-search-form,
  .client-import-pager,
  .registry-search-toolbar,
  .client-directory-toolbar,
  .client-directory-pager,
  .lot-detail-content > dl,
  .lot-detail-modal .detail-actions,
  .sample-grid,
  .sample-params,
  .sample-tools,
  .parameter-import-grid,
  nav {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column-reverse;
  }

  .actions button {
    width: 100%;
  }

  .calendar-header,
  .calendar-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-controls {
    display: grid;
    grid-template-columns: 36px 1fr 36px;
  }

  .calendar-controls .compact {
    grid-column: 1 / -1;
  }

  .calendar-grid {
    min-width: 720px;
  }

  .calendar-wrap {
    overflow-x: auto;
  }

  .sample-document-modal {
    padding: 18px;
  }

  .sample-document-header,
  .sample-document-option {
    grid-template-columns: 1fr;
  }

  .sample-document-header {
    flex-direction: column;
  }

  .sample-document-option {
    gap: 8px;
  }
}

@media (max-width: 420px) {
  .hero-brand-lockup {
    grid-template-columns: 104px minmax(0, 1fr);
    margin-bottom: 30px;
  }

  .brand-logo-hero {
    width: 104px;
  }

  .login-hero-content h1 {
    font-size: 38px;
  }

  .login-hero-content .intro {
    font-size: 16px;
  }
}
