:root {
  color-scheme: light;
  --nav: #121b26;
  --nav-2: #182638;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f4f6f8;
  --panel: #ffffff;
  --blue: #0756b8;
  --blue-soft: #eaf2ff;
  --green: #179560;
  --green-soft: #e8f8ef;
  --amber: #d99012;
  --amber-soft: #fff4dc;
  --red: #d83b4c;
  --red-soft: #fde8eb;
  --gold: #b38a58;
  --gold-soft: #f6efe6;
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.09);
  --shadow-strong: 0 24px 70px rgba(15, 23, 42, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgba(7, 86, 184, 0.08), transparent 28%),
    linear-gradient(315deg, rgba(179, 138, 88, 0.12), transparent 32%),
    var(--soft);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body:not(.is-authenticated) .app-shell {
  display: none;
}

body.is-authenticated .login-screen {
  display: none;
}

.login-screen {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 430px);
  align-items: center;
  gap: 42px;
  min-height: 100vh;
  padding: 48px;
  background:
    linear-gradient(135deg, rgba(13, 20, 29, 0.82), rgba(13, 20, 29, 0.94)),
    radial-gradient(circle at 22% 22%, rgba(179, 138, 88, 0.32), transparent 28%),
    radial-gradient(circle at 70% 78%, rgba(7, 86, 184, 0.22), transparent 30%),
    #101820;
  color: #fff;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  pointer-events: none;
}

.login-brand {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.login-brand img {
  width: min(260px, 60vw);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.login-brand h1 {
  margin: 16px 0 0;
  font-size: 44px;
  letter-spacing: 0.04em;
}

.login-brand p {
  margin: 0;
  color: #dbe4ee;
  font-size: 18px;
  text-transform: uppercase;
}

.login-card {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.97);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--red));
}

.login-card h2 {
  margin-bottom: 0;
  font-size: 25px;
}

.login-card p,
.login-card small {
  margin: 0;
  color: var(--muted);
}

body.inspector-mode .office-only {
  display: none;
}

.logout-btn {
  min-height: 34px;
  padding: 0 10px;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 82px minmax(0, 1fr);
}

body.sidebar-collapsed .brand div,
body.sidebar-collapsed .nav-item {
  font-size: 0;
}

body.sidebar-collapsed .nav-item {
  justify-content: center;
}

body.sidebar-collapsed .nav-item span:first-child {
  font-size: 17px;
}

body.sidebar-collapsed .nav-item i,
body.sidebar-collapsed .sidebar-footer span {
  display: none;
}

body.sidebar-collapsed .collapse-btn {
  transform: rotate(180deg);
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 18%),
    linear-gradient(165deg, #162438 0%, var(--nav) 58%, #0b121a 100%);
  color: #f8fafc;
  box-shadow: 12px 0 34px rgba(15, 23, 42, 0.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 17px;
  letter-spacing: 0.03em;
}

.brand span {
  color: #b9c5d4;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.brand-logo {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.seal {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border: 2px solid #d6a1a1;
  border-radius: 50%;
  background: #fff;
  color: #20242a;
  font-size: 8px;
  font-weight: 900;
  box-shadow: inset 0 0 0 5px #fff, inset 0 0 0 6px #ece2e2;
}

.seal-ring {
  position: absolute;
  top: 9px;
}

.arrow {
  position: absolute;
  bottom: 12px;
  width: 14px;
  height: 22px;
  clip-path: polygon(50% 0, 100% 45%, 70% 45%, 70% 100%, 30% 100%, 30% 45%, 0 45%);
}

.arrow.up {
  left: 15px;
  background: #59b447;
}

.arrow.down {
  right: 14px;
  background: #e2352f;
  transform: rotate(180deg);
}

.nav-list {
  display: grid;
  gap: 5px;
  padding: 16px 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d6dee9;
  text-align: left;
  font-weight: 700;
}

.nav-item span:first-child {
  display: grid;
  place-items: center;
  width: 22px;
  color: #ffffff;
}

.nav-item:hover,
.nav-item.active {
  background: linear-gradient(90deg, #22364e, rgba(34, 54, 78, 0.72));
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--gold);
}

.nav-item i,
.notice-btn i {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-style: normal;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding: 18px;
  color: #d7e1ea;
}

.collapse-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 24px;
}

main {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.menu-btn,
.notice-btn,
.icon-btn {
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #1f2937;
}

.menu-btn {
  width: 38px;
  height: 38px;
  font-size: 22px;
}

.topbar-spacer {
  flex: 1;
}

.notice-btn {
  position: relative;
  width: 38px;
  height: 38px;
}

.notice-btn i {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  font-size: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid #e6eaf0;
  border-radius: 999px;
  background: #fff;
  color: #1f2937;
}

.user-chip strong,
.user-chip span {
  display: block;
}

.user-chip strong {
  font-size: 13px;
}

.user-chip span {
  color: var(--muted);
  font-size: 12px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #243b55);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.view {
  display: none;
  padding: 26px;
}

.view.active {
  display: block;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding: 18px 20px;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.86)),
    linear-gradient(90deg, rgba(7, 86, 184, 0.08), rgba(179, 138, 88, 0.1));
  box-shadow: var(--shadow);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.page-heading p,
.panel-heading p,
.metric small,
.report-meta,
.timeline small,
.building-card p,
.simple-view p {
  color: var(--muted);
}

.page-heading p {
  margin-bottom: 0;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-picker,
.search,
.filters {
  display: flex;
  align-items: center;
  gap: 9px;
}

.date-picker,
.search {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

input,
select,
textarea {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: #8bb9ef;
  box-shadow: 0 0 0 3px rgba(7, 86, 184, 0.12);
}

input,
select {
  padding: 0 10px;
}

textarea {
  padding: 10px;
  resize: vertical;
}

.date-picker input,
.search input {
  border: 0;
  outline: 0;
  padding: 0;
}

.primary-btn,
.secondary-btn,
.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 6px;
  padding: 0 14px;
  font-weight: 800;
}

.primary-btn {
  border: 1px solid #064a9e;
  background: linear-gradient(180deg, #1266cf, var(--blue));
  color: #fff;
  box-shadow: 0 10px 18px rgba(7, 86, 184, 0.18);
}

.secondary-btn,
.link-btn {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f8fafc);
  color: #1f2937;
}

.link-btn {
  min-height: 34px;
  color: var(--blue);
  font-size: 13px;
}

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

.metric,
.panel,
.pdf-shell,
.simple-view {
  min-width: 0;
  border: 1px solid rgba(203, 213, 225, 0.76);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fbfcfe);
  box-shadow: var(--shadow);
}

.metric {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon value"
    "icon link";
  column-gap: 14px;
  padding: 20px;
}

.metric-action {
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 0;
  background: transparent;
}

.metric::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--gold));
  opacity: 0.34;
}

.metric-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 6px;
  font-size: 27px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.metric span {
  grid-area: label;
  align-self: end;
  font-size: 13px;
  font-weight: 800;
}

.metric strong {
  grid-area: value;
  font-size: 34px;
  line-height: 1;
}

.metric small {
  grid-area: link;
  color: var(--blue);
  font-weight: 700;
}

.metric.blue .metric-icon {
  background: var(--blue-soft);
  color: var(--blue);
}

.metric.green .metric-icon {
  background: var(--green-soft);
  color: var(--green);
}

.metric.amber .metric-icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.metric.red .metric-icon {
  background: var(--red-soft);
  color: var(--red);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 18px;
}

.panel,
.simple-view {
  padding: 20px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.inspection-list,
.report-list,
.timeline,
.card-grid {
  display: grid;
  gap: 12px;
}

.inspection-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.inspection-item:last-child {
  border-bottom: 1px solid transparent;
}

.date-tile {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid #d8dee8;
  background: #fff;
  font-weight: 900;
}

.date-tile span {
  display: block;
  width: 100%;
  padding: 2px 0;
  background: linear-gradient(180deg, #e44855, var(--red));
  color: #fff;
  text-align: center;
  font-size: 10px;
}

.date-tile strong {
  font-size: 19px;
}

.time {
  color: var(--blue);
  font-weight: 800;
  white-space: nowrap;
}

.report-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.review-report-item {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

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

.review-actions .primary-btn,
.review-actions .secondary-btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.return-report-btn {
  border-color: #fecaca;
  color: #991b1b;
}

.empty-state,
.empty-report-preview {
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  background: #fbfcfe;
  color: #64748b;
}

.empty-state h3,
.empty-report-preview h3 {
  margin-bottom: 6px;
  color: #1f2937;
}

.report-item {
  cursor: pointer;
}

.report-item:hover,
.report-item.selected {
  border-color: rgba(7, 86, 184, 0.28);
  background: #f8fbff;
  box-shadow: 0 12px 26px rgba(7, 86, 184, 0.1);
}

.report-item:last-child {
  border-bottom: 1px solid transparent;
}

.doc-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(180deg, #f2fbf6, var(--green-soft));
  color: var(--green);
  font-weight: 900;
}

.report-item h3 {
  margin: 0 0 3px;
  font-size: 14px;
}

.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-passed,
.status-pass {
  background: var(--green-soft);
  color: var(--green);
}

.status-due-soon,
.status-passed-with-violations {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-fail,
.status-overdue,
.status-deficiency {
  background: var(--red-soft);
  color: var(--red);
}

.code-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid #d9e5f8;
  border-radius: 8px;
  background:
    linear-gradient(90deg, #f7fbff, #fffaf4),
    #f7fbff;
  color: #334155;
  box-shadow: var(--shadow);
}

.code-strip span {
  padding: 5px 9px;
  border-radius: 999px;
  background: #eaf2ff;
  color: #164b94;
  font-size: 13px;
  font-weight: 800;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 8px;
  background: #fff;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid #edf1f5;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f8fafc;
  color: #4b5563;
  font-size: 12px;
  font-weight: 900;
}

tbody tr:hover {
  background: #fbfdff;
}

.clickable-row,
.clickable-card {
  cursor: pointer;
}

.clickable-row:hover,
.clickable-card:hover {
  outline: 1px solid rgba(7, 86, 184, 0.26);
  outline-offset: -1px;
  background: #f8fbff;
}

.id-link {
  color: var(--blue);
  font-weight: 900;
}

.filters {
  justify-content: space-between;
  margin-bottom: 14px;
}

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

.building-card {
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(180deg, #fff, #fbfcfe);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.building-card h3 {
  margin-bottom: 6px;
}

.inspection-panel {
  max-width: 950px;
  border-top: 4px solid var(--blue);
}

.stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}

.step {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.step::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--line));
  z-index: 0;
}

.step i {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, #e5e7eb);
  color: #374151;
  font-style: normal;
  font-weight: 900;
}

.step.active i {
  background: linear-gradient(180deg, #1672df, var(--blue));
  color: #fff;
  box-shadow: 0 8px 18px rgba(7, 86, 184, 0.25);
}

.step {
  cursor: pointer;
}

.step.completed i {
  background: linear-gradient(180deg, #26a66d, var(--green));
  color: #fff;
}

.step.completed span {
  color: #1f2937;
  font-weight: 800;
}

.inspection-step {
  display: none;
}

.inspection-step.active {
  display: block;
}

.inspection-form h2 {
  margin: 24px 0 14px;
  font-size: 16px;
  color: #1f2937;
}

.step-helper {
  margin: -4px 0 16px;
  color: var(--muted);
}

.affidavit-section,
.category-five-section,
.hydraulic-pressure-section {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #d7e4f5;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfdff, #f7fbff);
}

.affidavit-section[hidden],
.hydraulic-pressure-section[hidden] {
  display: none;
}

.affidavit-section p,
.category-five-section p,
.hydraulic-pressure-section p {
  margin-bottom: 14px;
  color: var(--muted);
}

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

label {
  display: grid;
  gap: 6px;
  color: #374151;
  font-size: 13px;
  font-weight: 800;
}

.checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.4;
}

.checkbox-line input {
  min-height: auto;
  margin-top: 2px;
}

.criteria-fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid #d7e4f5;
  border-radius: 4px;
  background: #fbfcfe;
}

.criteria-fieldset legend {
  padding: 0 6px;
  color: #1f2937;
  font-size: 13px;
  font-weight: 900;
}

.criteria-fieldset label {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12px;
  line-height: 1.3;
}

.criteria-fieldset input {
  min-height: auto;
  margin-top: 2px;
}

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

.inspection-actions,
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.violation-builder {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
  border: 1px solid #d7e4f5;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbff, #fff);
}

.add-task-btn {
  align-self: end;
  justify-self: start;
}

.task-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(203, 213, 225, 0.85);
  border-left: 4px solid var(--red);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.task-card h3 {
  margin-bottom: 5px;
  font-size: 14px;
}

.task-card p {
  margin-bottom: 6px;
  color: #4b5563;
}

.task-card small {
  display: block;
  color: var(--muted);
}

.review-box {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #d7e4f5;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbff, #fff);
}

.review-box h3 {
  margin-bottom: 12px;
}

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

.review-grid span {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid #e5edf8;
  border-radius: 6px;
  background: #fff;
  color: #334155;
}

.review-grid strong {
  color: #111827;
  font-size: 12px;
  text-transform: uppercase;
}

.remove-task {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--red);
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid #c6d7ef;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2937;
  font-size: 14px;
  font-weight: 800;
  box-shadow: var(--shadow-strong);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.reports-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.8fr);
  gap: 18px;
}

#reviewView {
  display: none;
  grid-template-columns: minmax(360px, 0.95fr) minmax(360px, 0.8fr);
  gap: 18px;
}

#reviewView.active {
  display: grid;
}

#reviewView .page-heading {
  grid-column: 1 / -1;
}

.review-preview-shell {
  align-self: start;
}

.pdf-shell {
  overflow: hidden;
  background: linear-gradient(180deg, #111827, #263445);
  box-shadow: var(--shadow-strong);
}

.pdf-toolbar {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 44px;
  padding: 0 14px;
  color: #fff;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pdf-page {
  width: 8.5in;
  height: 11in;
  margin: 0 auto 14px;
  padding: 0.2in;
  overflow: hidden;
  background: #fff;
  color: #111827;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.customer-report-copy {
  border: 2px solid #111827;
  height: 10.6in;
  min-height: 0;
  padding: 0.12in;
  overflow: hidden;
  background: linear-gradient(180deg, #fff, #fff 78%, #fbfbfb);
}

/* Full-sheet landscape version used by Print, Download PDF, and Share. */
.pdf-page.landscape-output {
  width: 11in;
  height: 8.5in;
  padding: 0.18in;
  box-sizing: border-box;
}

.pdf-page.landscape-output .customer-report-copy {
  width: 100%;
  height: 8.14in;
  padding: 0.12in;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.pdf-page.landscape-output .pdf-header { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; }
.pdf-page.landscape-output .report-logo { width: 72px; height: 72px; }
.pdf-page.landscape-output .report-title h2 { font-size: 21px; }
.pdf-page.landscape-output .report-number { font-size: 11px; }
.pdf-page.landscape-output .report-contact { font-size: 11px; }
.pdf-page.landscape-output .report-contact { width: calc(100% + 88px); margin-left: -88px; margin-right: 0; }
.pdf-page.landscape-output .form-copy-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pdf-page.landscape-output .form-copy-cell { min-height: 27px; padding: 4px 6px; font-size: 11px; }
.pdf-page.landscape-output .form-copy-cell.wide { grid-column: span 2; }
.pdf-page.landscape-output .form-copy-cell strong { font-size: 9.5px; }
.pdf-page.landscape-output .form-copy-cell small { font-size: 8.8px; }
.pdf-page.landscape-output .choice-box { font-size: 9.3px; }
.pdf-page.landscape-output .inspection-result-summary { font-size: 10.5px; }
.pdf-page.landscape-output .pdf-section h3 { font-size: 11px; }
.pdf-page.landscape-output .violation-code-boxes { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.pdf-page.landscape-output .violation-code-box { font-size: 9px; }
.pdf-page.landscape-output .pdf-table th,
.pdf-page.landscape-output .pdf-table td { padding: 1px 3px; font-size: 8.4px; line-height: 1.06; }
.pdf-page.landscape-output .report-main-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; flex: 1 1 auto; min-height: 1.55in; overflow: hidden; }
.pdf-page.landscape-output .report-main-grid.with-affidavit { grid-template-columns: minmax(0, 1.7fr) minmax(285px, 0.8fr); }
.pdf-page.landscape-output .violations-section { display: flex; min-height: 0; height: 100%; flex-direction: column; overflow: hidden; }
.pdf-page.landscape-output .violations-section .pdf-table { flex: 1 1 auto; height: 100%; }
.pdf-page.landscape-output .violations-section .pdf-table tbody tr { height: 11.11%; }
.pdf-page.landscape-output .violation-code-box { min-height: 13px; padding: 1px 2px; font-size: 8px; }
.pdf-page.landscape-output .empty-violation-row td { color: #64748b; }
.pdf-page.landscape-output .report-approval-footer { flex: 0 0 auto; margin-top: auto; border-top: 1px solid #111827; }
.pdf-page.landscape-output .report-recipient-section { display: grid; grid-template-columns: minmax(0, 2fr) minmax(150px, 0.7fr) minmax(190px, 0.8fr); gap: 8px; flex: 0 0 auto; padding: 5px 4px; border: 1px solid #111827; }
.pdf-page.landscape-output .report-recipient-section div { font-size: 9.5px; }
.pdf-page.landscape-output .report-recipient-section strong { display: block; margin-bottom: 2px; font-size: 8px; text-transform: uppercase; }
.pdf-page.landscape-output .report-comments-section { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 6px; min-height: 25px; padding: 3px 4px; flex: 0 0 auto; border: 1px solid #111827; font-size: 8.5px; }
.pdf-page.landscape-output .report-comments-section > strong { font-size: 7.5px; text-transform: uppercase; }
.pdf-page.landscape-output .construction-affidavit-report { height: 100%; padding: 5px; border: 1px solid #111827; overflow: hidden; }
.pdf-page.landscape-output .construction-affidavit-report h3 { margin-bottom: 2px; }
.pdf-page.landscape-output .affidavit-statement { margin: 2px 0 5px; font-size: 7.5px; line-height: 1.08; }
.pdf-page.landscape-output .affidavit-field-grid { gap: 3px 6px; }
.pdf-page.landscape-output .affidavit-field { min-height: 22px; font-size: 8px; }
.pdf-page.landscape-output .affidavit-field strong { font-size: 6.8px; }
.pdf-page.landscape-output .escalator-results-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.pdf-page.landscape-output .escalator-results-grid div { min-height: 32px; font-size: 9px; }
.pdf-page.landscape-output .escalator-results-grid strong { font-size: 7.5px; }
.pdf-page.landscape-output .approval-footer-grid { grid-template-columns: minmax(0, 2fr) minmax(240px, 0.8fr); gap: 10px; }
.pdf-page.landscape-output .cei-criteria-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pdf-page.landscape-output .inspector-details-card { padding: 7px 9px; }
.pdf-page.landscape-output .signature-line { font-size: 10px; }
.pdf-page.landscape-output .signature-line strong { font-size: 8.7px; }
.pdf-page.landscape-output .cei-criteria-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pdf-page.landscape-output .criteria-choice { font-size: 8.5px; line-height: 1.12; }
.pdf-page.landscape-output .cei-criteria p { font-size: 8.5px; }
.pdf-page.landscape-output .cert-line { font-size: 8.8px; }

.approval-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(190px, 0.8fr);
  gap: 8px;
  align-items: stretch;
}

.report-main-grid {
  display: grid;
  gap: 6px;
}

.report-main-grid.with-affidavit {
  grid-template-columns: minmax(0, 1.7fr) minmax(250px, 0.8fr);
}

.construction-affidavit-report {
  padding: 6px;
  border: 1px solid #111827;
}

.affidavit-statement {
  margin: 3px 0 6px;
  font-size: 8px;
  line-height: 1.15;
}

.affidavit-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
}

.affidavit-field {
  min-height: 25px;
  padding: 2px 0;
  border-bottom: 1px solid #111827;
  font-size: 8.5px;
}

.affidavit-field strong {
  display: block;
  margin-bottom: 2px;
  font-size: 7px;
  text-transform: uppercase;
}

.report-comments-section {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 6px;
  padding: 4px;
  border: 1px solid #111827;
  font-size: 8.5px;
}

.approval-footer-grid .cei-criteria { margin-top: 0; }

.inspector-details-card {
  padding: 5px 7px;
  border: 1px solid #111827;
  background: #fff;
}

.inspector-details-card h3 {
  margin-bottom: 6px;
  font-size: 9px;
  text-transform: uppercase;
}

.inspector-details-card .inspector-name {
  display: block;
  min-height: 23px;
  margin-bottom: 5px;
  padding-bottom: 4px;
  border-bottom: 1px solid #111827;
  font-size: 10px;
}

.inspector-details-card > div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 5px;
  padding: 3px 0;
  font-size: 8.5px;
}

.inspector-details-card span { color: #374151; font-size: 7.6px; font-weight: 800; text-transform: uppercase; }

.escalator-results-section {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

.escalator-results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid #111827;
  border-left: 1px solid #111827;
}

.escalator-results-grid div {
  min-height: 28px;
  padding: 3px 5px;
  border-right: 1px solid #111827;
  border-bottom: 1px solid #111827;
  font-size: 8.5px;
}

.escalator-results-grid strong {
  display: block;
  margin-bottom: 2px;
  font-size: 7.3px;
  text-transform: uppercase;
}

.report-recipient-section {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr 0.9fr;
  gap: 6px;
}

.report-recipient-section div { font-size: 8.5px; }
.report-recipient-section strong { display: block; font-size: 7.4px; text-transform: uppercase; }

.pdf-header {
  position: relative;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding-bottom: 5px;
  border-bottom: 2px solid #111827;
}

.report-contact {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  justify-content: center;
  align-items: center;
  gap: 4px 14px;
  margin: 3px auto 0;
  color: #334155;
  font-size: 9.4px;
  font-weight: 700;
  text-align: center;
}

.report-contact span:last-child {
  grid-column: auto;
}

.report-contact span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
}

.report-contact i {
  display: grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #eef5ff;
  color: #0756b8;
  font-size: 8px;
  font-style: normal;
}

.report-logo {
  width: 62px;
  height: 62px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
}

.pdf-page .seal {
  width: 82px;
  height: 82px;
}

.pdf-page .seal-ring {
  top: 16px;
  font-size: 11px;
}

.pdf-page .arrow {
  bottom: 20px;
  width: 21px;
  height: 32px;
}

.pdf-page .arrow.up {
  left: 24px;
}

.pdf-page .arrow.down {
  right: 22px;
}

.pdf-page h2 {
  font-size: 17px;
}

.report-title {
  display: grid;
  place-items: center;
  padding-right: 94px;
  margin-bottom: 3px;
  text-align: center;
}

.report-title h2 {
  margin: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 950;
}

.report-number {
  position: absolute;
  top: 4px;
  right: 0;
  padding: 3px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  color: #334155;
  font-size: 9.5px;
  font-weight: 900;
}

.pdf-section {
  padding: 4px 0;
  border-bottom: 1px solid #e5e7eb;
}

.pdf-section h3 {
  margin-bottom: 3px;
  font-size: 9.4px;
  text-transform: uppercase;
}

.pdf-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
  padding: 4px 0;
  font-size: 13px;
}

.pdf-row strong {
  color: #374151;
}

.form-copy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid #111827;
  border-left: 1px solid #111827;
}

.form-copy-cell {
  min-height: 24px;
  padding: 3px 5px;
  border-right: 1px solid #111827;
  border-bottom: 1px solid #111827;
  font-size: 9px;
  line-height: 1.15;
}

.form-copy-cell.wide {
  grid-column: 1 / -1;
}

.form-copy-cell strong {
  display: block;
  margin-bottom: 2px;
  color: #111827;
  font-size: 7.8px;
  text-transform: uppercase;
}

.inspection-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px 4px;
  margin-top: 2px;
}

.device-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  margin: 2px 0;
}

.form-copy-cell small {
  display: block;
  color: #4b5563;
  font-size: 7.7px;
}

.inspection-result-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  width: min(360px, 100%);
  margin: 4px 0 0 auto;
  padding: 4px 7px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.inspection-result-summary span {
  min-width: 76px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff;
  text-align: center;
  letter-spacing: 0;
}

.compact-report-section {
  padding: 3px 0;
}

.hydraulic-report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid #111827;
  border-left: 1px solid #111827;
}

.hydraulic-report-grid div {
  min-height: 21px;
  padding: 3px 5px;
  border-right: 1px solid #111827;
  border-bottom: 1px solid #111827;
  font-size: 8.5px;
}

.hydraulic-report-grid strong {
  display: block;
  margin-bottom: 2px;
  font-size: 7.3px;
  text-transform: uppercase;
}

.choice-box {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 7.9px;
}

.choice-box::before {
  content: "";
  width: 8px;
  height: 8px;
  border: 1px solid #111827;
  border-radius: 50%;
}

.choice-box.selected::before {
  background: radial-gradient(circle at center, #111827 0 42%, transparent 45%);
}

.violation-code-boxes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  margin-top: 2px;
}

.violation-code-box {
  min-height: 15px;
  padding: 2px 3px;
  border: 1px solid #111827;
  font-size: 8px;
  text-align: center;
}

.signature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 4px;
}

.signature-line {
  min-height: 27px;
  padding: 3px;
  border-bottom: 1px solid #111827;
  font-size: 8.6px;
}

.signature-line strong {
  display: block;
  color: #374151;
  font-size: 7.2px;
  text-transform: uppercase;
}

.cei-criteria {
  margin-top: 4px;
  padding: 4px;
  border: 1px solid #111827;
  background: #fff;
}

.cei-criteria h3 {
  margin-bottom: 2px;
  font-size: 8.2px;
}

.cei-criteria p {
  margin-bottom: 3px;
  color: #111827;
  font-size: 7.1px;
  font-style: italic;
  font-weight: 800;
}

.cei-criteria-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 7px;
}

.criteria-choice {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  font-size: 6.9px;
  line-height: 1.08;
}

.criteria-choice::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 1px;
  border: 1px solid #111827;
}

.criteria-choice.selected::before {
  background: #111827;
  box-shadow: inset 0 0 0 2px #fff;
}

.cert-line {
  margin-top: 4px;
  color: #991b1b;
  font-size: 7.5px;
  font-weight: 800;
  line-height: 1.14;
}

.pdf-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border: 1px solid #d1d5db;
  border-collapse: collapse;
}

.pdf-table th,
.pdf-table td {
  padding: 2px 3px;
  border: 1px solid #d1d5db;
  font-size: 7.4px;
  line-height: 1.08;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.pdf-table th {
  background: #f3f4f6;
}

.violations-section {
  padding-top: 4px;
}

.violations-section .pdf-table th:nth-child(1),
.violations-section .pdf-table td:nth-child(1) {
  width: 14%;
}

.violations-section .pdf-table th:nth-child(2),
.violations-section .pdf-table td:nth-child(2) {
  width: 22%;
}

.violations-section .pdf-table th:nth-child(3),
.violations-section .pdf-table td:nth-child(3) {
  width: 64%;
}

.comments-section {
  padding: 3px 0;
}

.comments-section h3 {
  margin-bottom: 3px;
}

.comments-box {
  min-height: 20px;
  max-height: 42px;
  padding: 3px 4px;
  border: 1px solid #d1d5db;
  background: #fff;
  font-size: 7.8px;
  line-height: 1.08;
  overflow: hidden;
  white-space: pre-wrap;
}

.timeline-item {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

dialog {
  width: min(820px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.32);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.58);
}

#reportForm {
  padding: 22px;
}

.dialog-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.dialog-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 22px;
}

/* Reference-style polish: closer to the provided All Rise dashboard mockup. */
body {
  background:
    linear-gradient(90deg, rgba(8, 13, 21, 0.84), rgba(8, 13, 21, 0.64)),
    url("assets/login-industrial-background.png") left center / cover fixed no-repeat,
    #101820;
}

.login-screen {
  grid-template-columns: minmax(360px, 1fr) minmax(330px, 405px);
  gap: 32px;
  align-items: center;
  min-height: 100vh;
  padding: 78px 48px 48px;
  background:
    linear-gradient(90deg, rgba(7, 12, 19, 0.5), rgba(7, 12, 19, 0.72)),
    linear-gradient(180deg, rgba(8, 13, 21, 0.18), rgba(8, 13, 21, 0.42)),
    url("assets/login-industrial-background.png") left center / cover no-repeat,
    #101820;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 46px auto 44px 46px;
  width: min(660px, calc(52vw - 56px));
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(8, 13, 21, 0.18), rgba(8, 13, 21, 0.04) 44%, rgba(8, 13, 21, 0.42)),
    repeating-linear-gradient(90deg, transparent 0 54px, rgba(255, 255, 255, 0.045) 55px, transparent 57px);
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.35), 0 24px 70px rgba(0, 0, 0, 0.18);
  opacity: 0.8;
  pointer-events: none;
}

.login-screen::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 54px;
  background: rgba(8, 13, 21, 0.84);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.login-title {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 2;
  color: #f8fafc;
  text-align: center;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.login-brand {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: start;
  width: min(610px, 100%);
  padding: 26px 34px;
  justify-items: start;
  text-align: left;
}

.login-brand img {
  justify-self: center;
  width: min(210px, 48vw);
  border: 6px solid #fff;
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.4);
}

.login-brand h1 {
  justify-self: center;
  margin-top: 18px;
  font-size: 38px;
  letter-spacing: 0;
}

.login-brand p {
  justify-self: center;
  font-size: 18px;
  letter-spacing: 0.02em;
}

.login-contact-list {
  display: grid;
  gap: 13px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  color: #f8fafc;
  font-size: 14px;
  font-weight: 700;
}

.login-contact-list li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-contact-list span {
  display: grid;
  place-items: center;
  width: 20px;
  color: #ffffff;
}

.login-card {
  z-index: 1;
  align-self: center;
  justify-self: start;
  width: 100%;
  border: 1px solid #dfe3e8;
  background: #fff;
  box-shadow: 0 20px 54px rgba(16, 24, 40, 0.18);
}

.login-card::before {
  display: none;
}

.login-card h2 {
  font-size: 24px;
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.remember-line {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
}

.remember-line input {
  min-height: auto;
}

.forgot-link {
  border: 0;
  background: transparent;
  color: #0756b8;
  font-size: 12px;
  font-weight: 800;
}

.app-shell {
  grid-template-columns: 248px minmax(0, 1fr);
  background:
    linear-gradient(90deg, rgba(15, 23, 33, 0.12), rgba(244, 246, 248, 0.88) 24%, rgba(244, 246, 248, 0.94)),
    transparent;
}

main {
  background: rgba(244, 246, 248, 0.9);
  backdrop-filter: blur(2px);
}

.sidebar {
  background: linear-gradient(180deg, #111b26, #0f1721);
  box-shadow: 4px 0 14px rgba(15, 23, 42, 0.16);
}

.brand {
  min-height: 70px;
  background: #111b26;
}

.brand-logo {
  width: 50px;
  height: 50px;
}

.nav-list {
  gap: 3px;
  padding: 13px 8px;
}

.nav-item {
  min-height: 40px;
  border-radius: 4px;
  color: #d8e0ea;
  font-size: 12px;
}

.nav-item:hover,
.nav-item.active {
  background: #1c2f46;
  box-shadow: inset 3px 0 0 #2f80ed;
}

.topbar {
  height: 55px;
  background: #111922;
  border-bottom: 0;
  color: #fff;
}

.menu-btn,
.notice-btn {
  color: #e8edf3;
}

.user-chip {
  min-height: 38px;
  border-color: rgba(255, 255, 255, 0.1);
  background: #172331;
  color: #fff;
}

.user-chip span {
  color: #aab7c6;
}

.logout-btn {
  display: inline-flex;
  position: relative;
  z-index: 2;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  border-color: rgba(255, 255, 255, 0.22);
  background: #d83b4c;
  color: #fff;
  font-weight: 900;
  opacity: 1;
  visibility: visible;
}

.topbar .logout-btn {
  height: 38px;
  min-width: 88px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: #d83b4c !important;
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(216, 59, 76, 0.24);
}

.admin-panel {
  display: grid;
  gap: 14px;
}

.admin-table {
  display: grid;
  gap: 10px;
}

.personnel-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dbe5f2;
  border-radius: 6px;
  background: #fbfdff;
}

.admin-user-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(180px, 260px) auto;
  gap: 14px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
}

.admin-user-row strong,
.admin-user-row span {
  display: block;
}

.admin-user-row span,
.admin-note {
  color: var(--muted);
  font-size: 13px;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.save-password-btn {
  min-height: 38px;
}

.remove-personnel-btn {
  border-color: #fecaca;
  color: #991b1b;
}

.view {
  padding: 21px 24px 24px;
}

.page-heading {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

h1 {
  font-size: 27px;
}

.date-picker,
.search,
.filters select,
input,
select,
textarea {
  border-color: #dfe4ea;
  border-radius: 4px;
}

.primary-btn,
.secondary-btn,
.link-btn {
  border-radius: 4px;
}

.primary-btn {
  background: #0756b8;
  border-color: #064a9e;
}

.secondary-btn,
.link-btn {
  background: #fff;
}

.metric-grid {
  gap: 12px;
}

.metric,
.panel,
.pdf-shell,
.simple-view {
  border-color: #e4e8ee;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.06);
}

.metric {
  min-height: 108px;
  padding: 16px;
  column-gap: 13px;
}

.metric::after {
  display: none;
}

.metric-icon {
  width: 46px;
  height: 46px;
  border-radius: 4px;
  font-size: 24px;
}

.metric strong {
  font-size: 29px;
}

.dashboard-grid {
  gap: 12px;
}

.panel {
  padding: 15px;
}

.panel-heading {
  margin-bottom: 12px;
  padding-bottom: 10px;
}

.inspection-item,
.report-item,
.timeline-item,
.building-card,
.task-card {
  border-color: #e8ecf1;
  border-radius: 4px;
  box-shadow: none;
}

.inspection-item,
.report-item {
  padding: 10px;
}

.date-tile {
  width: 45px;
  height: 45px;
}

.report-meta {
  font-size: 11px;
}

table {
  border-color: #e6eaf0;
  border-radius: 4px;
}

th,
td {
  padding: 12px 10px;
  font-size: 12px;
}

th {
  background: #f7f8fa;
}

.inspection-panel {
  max-width: 960px;
  border-top: 0;
}

.stepper {
  padding-bottom: 14px;
  border-bottom: 1px solid #edf0f4;
}

.step::before {
  background: #d7dde6;
}

.step.active i {
  background: #0756b8;
}

.affidavit-section,
.category-five-section,
.hydraulic-pressure-section,
.violation-builder,
.review-box {
  border-radius: 4px;
  background: #fbfcfe;
}

.pdf-shell {
  background: #1b2531;
  border: 0;
}

.pdf-toolbar {
  min-height: 40px;
  background: #111820;
}

.pdf-page {
  margin: 0 12px 12px;
  padding: 28px;
}

dialog {
  border-radius: 6px;
}

@page {
  size: letter;
  margin: 0;
}

@media print {
  body {
    background: #fff !important;
  }

  .login-screen,
  .sidebar,
  .topbar,
  .page-heading,
  .reports-grid > .panel,
  .pdf-toolbar {
    display: none !important;
  }

  .app-shell,
  main,
  .view,
  .reports-grid,
  .pdf-shell {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  .pdf-page {
    width: 8.5in !important;
    height: 11in !important;
    margin: 0 !important;
    padding: 0.18in !important;
    overflow: hidden !important;
    box-shadow: none !important;
  }

  .customer-report-copy {
    height: 10.64in !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
}

.login-brand img,
.brand-logo,
.report-logo {
  display: block;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  object-fit: contain;
  object-position: center;
}

.login-brand img {
  width: min(235px, 50vw);
}

.brand-logo {
  width: 54px;
  height: 54px;
}

.report-logo {
  width: 104px;
  height: 104px;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .brand div,
  .nav-item {
    font-size: 0;
  }

  .nav-item {
    justify-content: center;
  }

  .nav-item span:first-child {
    font-size: 16px;
  }

  .nav-item i,
  .sidebar-footer span {
    display: none;
  }

  .brand {
    justify-content: center;
    padding: 14px 10px;
  }

  .brand-logo {
    width: 50px;
    height: 50px;
  }

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

@media (max-width: 760px) {
  .login-screen {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px 18px;
  }

  .login-brand img {
    width: 160px;
  }

  .login-brand h1 {
    font-size: 32px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
  }

  body:not(.sidebar-open) .nav-list {
    display: none;
  }

  .brand,
  .sidebar-footer {
    display: none;
  }

  .nav-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 8px;
  }

  .nav-item {
    min-height: 38px;
    padding: 0;
  }

  .topbar {
    height: 58px;
    padding: 0 14px;
  }

  .view {
    padding: 16px 14px;
  }

  .page-heading,
  .filters,
  .panel-heading,
  .timeline-item,
  .report-item {
    display: grid;
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .dashboard-grid,
  .reports-grid,
  .card-grid,
  .form-grid,
  .violation-builder,
  .stepper {
    grid-template-columns: 1fr;
  }

  .reports-grid {
    display: block;
  }

  .pdf-shell {
    margin-top: 16px;
  }

  .pdf-page {
    min-height: 0;
    padding: 22px;
  }

  .search,
  .date-picker,
  select {
    width: 100%;
  }
}
.record-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.mini-action-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  border-radius: 0.45rem;
  padding: 0.35rem 0.6rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.mini-action-btn:hover { background: #f1f5f9; }
.mini-action-btn.danger { color: #b42318; border-color: #f0b4ae; }
.mini-action-btn.danger:hover { background: #fff1f0; }

.report-file-controls {
  display: flex;
  align-items: end;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.report-file-controls label { display: grid; gap: 0.35rem; font-size: 0.78rem; font-weight: 800; color: #475569; }
.report-file-controls select { min-width: 160px; }
.report-file-controls span { margin-left: auto; align-self: center; color: #64748b; font-weight: 700; }
.report-file-group { display: grid; gap: 0.6rem; }
.report-file-group > header { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0.7rem; border-radius: 0.5rem; background: #eaf0f7; color: #1e3a5f; }
.report-file-group > header span { color: #64748b; font-size: 0.82rem; }
.report-delivery-toolbar { display: flex; gap: 0.55rem; align-items: center; flex-wrap: wrap; }
.report-delivery-toolbar > strong { margin-right: auto; }

@media print {
  html,
  body.printing-customer-report { width: 11in !important; height: 8.5in !important; min-height: 0 !important; overflow: hidden !important; }
  body.printing-customer-report * { visibility: hidden !important; }
  body.printing-customer-report main > .view:not(#reportsView),
  body.printing-customer-report #reportsView > *:not(.reports-grid),
  body.printing-customer-report .reports-grid > *:not(.pdf-shell),
  body.printing-customer-report .pdf-shell > *:not(#pdfPreview) { display: none !important; }
  body.printing-customer-report .app-shell,
  body.printing-customer-report main,
  body.printing-customer-report #reportsView,
  body.printing-customer-report .reports-grid,
  body.printing-customer-report .pdf-shell { display: block !important; position: static !important; width: 0 !important; height: 0 !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; }
  body.printing-customer-report #pdfPreview,
  body.printing-customer-report #pdfPreview * { visibility: visible !important; }
  body.printing-customer-report #pdfPreview { position: fixed !important; top: 0 !important; left: 0 !important; min-height: 0 !important; margin: 0 !important; box-shadow: none !important; background: #fff !important; transform: scale(var(--report-print-scale, 1)); transform-origin: top left; }
  @page { size: letter landscape; margin: 0.35in; }
}

@media (max-width: 760px) {
  .report-file-controls { display: grid; grid-template-columns: 1fr; align-items: stretch; }
  .report-file-controls span { margin-left: 0; }
}
