:root {
  --teal-950: #004c4d;
  --teal-900: #007f80;
  --teal-800: #006f70;
  --teal-700: #007f80;
  --teal-600: #129394;
  --teal-500: #2ba9aa;
  --teal-100: #d9f2f2;
  --teal-50: #eefafa;
  --red-700: #b42318;
  --red-600: #d92d20;
  --red-100: #fee4e2;
  --red-50: #fff5f4;
  --amber-700: #b54708;
  --amber-500: #f79009;
  --amber-100: #fef0c7;
  --green-700: #067647;
  --green-100: #d1fadf;
  --blue-700: #175cd3;
  --blue-100: #dbeafe;
  --gray-950: #101828;
  --gray-900: #1d2939;
  --gray-700: #344054;
  --gray-600: #475467;
  --gray-500: #667085;
  --gray-400: #98a2b3;
  --gray-300: #d0d5dd;
  --gray-200: #e4e7ec;
  --gray-100: #f2f4f7;
  --gray-50: #f8fafb;
  --white: #fff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, .08);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --sidebar-width: 208px;
  --topbar-height: 68px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  color: var(--gray-900);
  background: #f8fafc;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 50;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 22px 14px 18px;
  color: rgba(255, 255, 255, .78);
  background:
    radial-gradient(circle at 18% 0, rgba(25, 150, 142, .18), transparent 32%),
    linear-gradient(180deg, #006b6c 0%, #005556 48%, #003f40 100%);
  box-shadow: 8px 0 24px rgba(0, 63, 64, .08);
  transition: transform .28s ease, box-shadow .28s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 7px 22px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, .12);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  color: var(--white);
  font-size: 14px;
  letter-spacing: .035em;
}

.brand span {
  margin-top: 1px;
  color: rgba(255, 255, 255, .55);
  font-size: 9px;
}

.sidebar-nav {
  display: grid;
  gap: 5px;
}

.nav-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  min-height: 43px;
  padding: 10px 11px;
  border-radius: 9px;
  color: rgba(255, 255, 255, .69);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  transition: .2s ease;
}

.nav-item:hover {
  color: var(--white);
  background: rgba(255, 255, 255, .07);
}

.nav-item.active {
  color: var(--white);
  background: linear-gradient(90deg, rgba(43, 169, 170, .3), rgba(43, 169, 170, .1));
  box-shadow: inset 3px 0 var(--teal-500);
}

.nav-icon,
[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg,
[data-icon] svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.support-icon-image {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(35%) sepia(30%) saturate(1100%) hue-rotate(125deg) brightness(88%);
}

.kpi-card.neutral .support-icon-image {
  filter: brightness(0) saturate(100%) invert(38%) sepia(87%) saturate(1700%) hue-rotate(199deg) brightness(96%);
}

.kpi-card.good .support-icon-image {
  filter: brightness(0) saturate(100%) invert(31%) sepia(43%) saturate(1080%) hue-rotate(104deg) brightness(88%);
}

.kpi-card.warning .support-icon-image {
  filter: brightness(0) saturate(100%) invert(43%) sepia(92%) saturate(1740%) hue-rotate(15deg) brightness(96%);
}

.kpi-card.critical .support-icon-image {
  filter: brightness(0) saturate(100%) invert(22%) sepia(84%) saturate(3110%) hue-rotate(353deg) brightness(91%);
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.sidebar-footer {
  display: grid;
  gap: 14px;
  margin-top: auto;
  padding: 14px 7px 0;
  border-top: 1px solid rgba(255, 255, 255, .09);
  color: rgba(255, 255, 255, .42);
}

.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.system-status strong,
.system-status small {
  display: block;
}

.system-status strong {
  color: rgba(255, 255, 255, .8);
  font-size: 10px;
}

.system-status small {
  margin-top: 1px;
  font-size: 9px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-radius: 50%;
  background: #32d583;
  box-shadow: 0 0 0 3px rgba(50, 213, 131, .13);
}

.main-content {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding-top: var(--topbar-height);
  transition: margin-left .28s ease;
}

body.sidebar-collapsed .sidebar {
  transform: translateX(-100%);
  box-shadow: none;
}

body.sidebar-collapsed .main-content {
  margin-left: 0;
}

body.sidebar-collapsed .topbar {
  left: 0;
}

body.sidebar-collapsed .page-container {
  width: 100%;
  max-width: none;
}

.topbar {
  position: fixed;
  z-index: 40;
  top: 0;
  right: 0;
  left: var(--sidebar-width);
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  padding: 9px 24px;
  border-bottom: 1px solid var(--gray-200);
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 1px 8px rgba(16, 24, 40, .04);
  transition: left .28s ease;
  backdrop-filter: blur(14px);
}

.topbar-title,
.topbar-actions,
.updated-at {
  display: flex;
  align-items: center;
}

.topbar-title {
  gap: 11px;
  min-width: 0;
}

.topbar-title > div {
  min-width: 0;
}

.topbar h1 {
  margin: 1px 0 0;
  color: var(--gray-950);
  font-size: 19px;
  line-height: 1.2;
}

.eyebrow {
  margin: 0;
  color: var(--teal-700);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.topbar-actions {
  gap: 10px;
}

.updated-at {
  gap: 7px;
  padding-right: 11px;
  border-right: 1px solid var(--gray-200);
}

.updated-at > span {
  color: var(--teal-700);
}

.updated-at small,
.updated-at strong {
  display: block;
}

.updated-at small {
  color: var(--gray-500);
  font-size: 9px;
}

.updated-at strong {
  font-size: 10px;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  color: var(--gray-600);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: .2s ease;
}

.icon-button:hover {
  color: var(--teal-700);
  border-color: var(--teal-500);
}

.icon-button.danger {
  color: var(--red-600);
  border-color: var(--red-100);
  background: var(--red-50);
}

.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-button.loading svg {
  animation: spin .8s linear infinite;
}

.notif-bell {
  position: relative;
  display: inline-flex;
}

.notif-bell-btn {
  position: relative;
}

.notif-bell-btn .notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red-600);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--white);
  pointer-events: none;
}

.notif-bell-btn .notif-badge.hidden {
  display: none;
}

.notif-bell-btn.has-new .notif-badge {
  animation: notif-pulse 1.6s ease-in-out infinite;
}

@keyframes notif-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 12px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notif-dropdown.hidden {
  display: none;
}

.notif-dropdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--gray-900);
}

.notif-link {
  background: none;
  border: none;
  color: var(--teal-700);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
}

.notif-link:hover {
  background: var(--teal-50);
}

.notif-nrp-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.notif-nrp-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 13px;
  color: var(--gray-900);
  background: var(--white);
}

.notif-nrp-input:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(43, 169, 170, .15);
}

.btn-small {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--teal-700);
  border-radius: 8px;
  background: var(--teal-700);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex: 0 0 auto;
}

.btn-small:hover {
  background: var(--teal-800);
}

.notif-nrp-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--gray-700);
  padding: 8px 10px;
  background: var(--gray-50);
  border-radius: 8px;
}

.notif-nrp-current.hidden {
  display: none;
}

.notif-nrp-current strong {
  color: var(--gray-900);
}

.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notif-list li {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notif-list li:hover {
  border-color: var(--teal-500);
  background: var(--teal-50);
}

.notif-list li.is-new {
  border-color: var(--teal-500);
  background: var(--teal-50);
}

.notif-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 6px;
}

.notif-item-meta {
  font-size: 12px;
  color: var(--gray-500);
}

.notif-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.notif-pill.waiting { background: var(--amber-100); color: var(--amber-700); }
.notif-pill.approved { background: var(--green-100); color: var(--green-700); }
.notif-pill.picked { background: var(--blue-100); color: var(--blue-700); }
.notif-pill.rejected { background: var(--red-100); color: var(--red-700); }

.notif-empty {
  margin: 0;
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--gray-500);
}

.notif-empty.hidden {
  display: none;
}

.empty-state .spinner {
  width: 28px;
  height: 28px;
  border-width: 2px;
  margin-bottom: 4px;
}

.menu-toggle {
  display: grid;
  align-content: center;
}

.menu-toggle span {
  width: 18px;
  height: 18px;
}

.page-container {
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: 28px 32px 48px;
}

.page-section {
  display: none;
  min-width: 0;
  max-width: 100%;
  animation: page-in .25s ease;
}

.page-section.active {
  display: block;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 3px 0 4px;
  color: var(--gray-950);
  font-size: 25px;
  letter-spacing: -.025em;
}

.section-heading p:not(.eyebrow) {
  margin: 0;
  color: var(--gray-500);
}

.module-breadcrumb {
  margin: 0 0 4px !important;
  color: var(--teal-700) !important;
  font-size: 10px;
  font-weight: 750;
}

.module-breadcrumb span {
  padding: 0 4px;
  color: var(--gray-400);
}

.heading-actions,
.table-tools {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  transition: .2s ease;
}

.button svg {
  width: 17px;
  height: 17px;
}

.button.primary {
  color: var(--white);
  border-color: var(--teal-700);
  background: var(--teal-700);
  box-shadow: 0 3px 8px rgba(20, 107, 100, .2);
}

.button.primary:hover {
  background: var(--teal-800);
}

.button.secondary {
  color: var(--gray-700);
  border-color: var(--gray-300);
  background: var(--white);
}

.button.secondary:hover {
  color: var(--teal-700);
  border-color: var(--teal-500);
}

.button.large {
  min-height: 50px;
  padding: 12px 22px;
  font-size: 14px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: .6;
}

label {
  display: grid;
  gap: 6px;
}

label > span {
  color: var(--gray-600);
  font-size: 11px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  outline: none;
  background: var(--white);
  transition: border-color .2s, box-shadow .2s;
}

input,
select {
  min-height: 40px;
  padding: 8px 10px;
}

textarea {
  min-height: 104px;
  padding: 10px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(32, 163, 151, .12);
}

input::placeholder,
textarea::placeholder {
  color: var(--gray-400);
}

.compact-field {
  min-width: 112px;
}

.compact-field select {
  min-height: 37px;
}

.safety-filter-actions .compact-field {
  min-width: 116px;
  display: none;
}

.safety-filter-actions .compact-field:nth-child(2) {
  min-width: 148px;
  display: none;
}

.compact-field.inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-grid-five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.kpi-card {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.kpi-card::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--teal-500);
  content: "";
}

.kpi-card.warning::after { background: var(--amber-500); }
.kpi-card.critical::after { background: var(--red-600); }
.kpi-card.good::after { background: #12b76a; }
.kpi-card.neutral::after { background: #2e90fa; }

.kpi-card.critical {
  border-color: var(--red-100);
  background: var(--red-50);
}

.kpi-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.kpi-label {
  color: var(--gray-500);
  font-size: 11px;
  font-weight: 650;
}

.kpi-label-wrap {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.metric-info {
  position: relative;
  display: inline-grid;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  color: #475569;
  background: #f8fafc;
  cursor: help;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.metric-info:focus-visible {
  outline: 2px solid #2ba9aa;
  outline-offset: 2px;
}

.metric-tooltip {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 50%;
  width: max-content;
  max-width: 220px;
  padding: 7px 9px;
  border-radius: 7px;
  color: #fff;
  background: #0f172a;
  box-shadow: 0 4px 10px rgba(15, 23, 42, .18);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, -3px);
  transition: opacity .16s ease, transform .16s ease;
}

.safety-incident-grid .metric-tooltip {
  width: 280px;
  max-width: min(280px, calc(100vw - 48px));
  text-align: left;
}

.metric-tooltip::before {
  position: absolute;
  bottom: 100%;
  left: 50%;
  border-right: 5px solid transparent;
  border-bottom: 5px solid #0f172a;
  border-left: 5px solid transparent;
  content: "";
  transform: translateX(-50%);
}

.metric-info:hover .metric-tooltip,
.metric-info:focus .metric-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.kpi-icon {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 9px;
  color: var(--teal-700);
  background: var(--teal-50);
}

.warning .kpi-icon { color: var(--amber-700); background: #fffaeb; }
.critical .kpi-icon { color: var(--red-600); background: var(--red-50); }
.good .kpi-icon { color: var(--green-700); background: #ecfdf3; }
.neutral .kpi-icon { color: var(--blue-700); background: #eff8ff; }

.kpi-value {
  margin-top: 13px;
  color: var(--gray-950);
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
}

.kpi-value.has-unit {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 7px;
}

.kpi-value-unit {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}

.kpi-card.neutral .kpi-value { color: var(--blue-700); }
.kpi-card.warning .kpi-value { color: var(--amber-700); }
.kpi-card.good .kpi-value { color: var(--green-700); }
.kpi-card.critical .kpi-value { color: var(--red-700); }

.kpi-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  color: var(--gray-500);
  font-size: 10px;
}

.kpi-progress {
  height: 5px;
  overflow: hidden;
  margin-top: 9px;
  border-radius: 10px;
  background: var(--gray-100);
}

.kpi-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: currentColor;
}

.kpi-card.good .kpi-progress { color: #12b76a; }
.kpi-card.warning .kpi-progress { color: var(--amber-500); }
.kpi-card.critical .kpi-progress { color: var(--red-600); }

.kpi-progress-text {
  margin-top: 5px;
  color: var(--gray-500);
  font-size: 9px;
}

.kpi-card.has-progress {
  min-height: 158px;
}

.inspection-kpi-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.safety-metric-groups {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.safety-metric-group {
  padding: 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: #f8fafc;
  box-shadow: var(--shadow-sm);
}

.safety-group-heading {
  display: flex;
  min-height: 38px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.safety-group-heading .eyebrow {
  margin-bottom: 2px;
}

.safety-group-heading h3 {
  margin: 0;
  color: var(--gray-700);
  font-size: 11px;
  font-weight: 600;
}

.safety-metric-group .kpi-grid {
  margin-bottom: 0;
}

.safety-incident-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.safety-manpower-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.safety-performance-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.incident-simulation-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.incident-drag-hint {
  color: var(--gray-500);
  font-size: 9px;
  white-space: nowrap;
}

.incident-drag-hint b {
  color: var(--teal-700);
  font-size: 12px;
}

.incident-simulation-reset {
  padding: 5px 8px;
  border: 1px solid var(--gray-200);
  border-radius: 7px;
  color: var(--gray-600);
  background: var(--white);
  font-size: 9px;
  font-weight: 650;
}

.incident-simulation-reset:hover {
  color: var(--teal-800);
  border-color: var(--teal-200);
  background: var(--teal-50);
}

#safetyIncidentChart {
  touch-action: none;
}

.performance-comparison-card {
  position: relative;
  min-width: 0;
  min-height: 164px;
  padding: 15px 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1);
}

.performance-comparison-card.critical {
  border-color: var(--gray-200);
  background: #fff;
}

.performance-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.performance-card-header h4 {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--gray-500);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.safety-performance-grid .metric-tooltip {
  left: 0;
  width: 330px;
  max-width: min(330px, calc(100vw - 48px));
  padding: 11px 13px;
  border-radius: 9px;
  box-shadow: 0 9px 24px rgba(15, 23, 42, .24);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
  text-align: left;
  transform: translate(-22%, -3px);
}

.safety-performance-grid .metric-tooltip::before {
  left: 22%;
}

.safety-performance-grid .metric-info:hover .metric-tooltip,
.safety-performance-grid .metric-info:focus .metric-tooltip {
  transform: translate(-22%, 0);
}

.performance-header-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 9px;
  color: var(--blue-700);
  background: #eff8ff;
}

.performance-header-icon svg {
  width: 17px;
  height: 17px;
}

.performance-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--blue-700);
  background: #eff8ff;
  font-size: 8.5px;
  font-weight: 700;
  white-space: nowrap;
}

.performance-status svg {
  width: 13px;
  height: 13px;
}

.performance-comparison-card.good .performance-status {
  color: var(--green-700);
  background: #ecfdf3;
}

.performance-comparison-card.critical .performance-status {
  color: var(--red-700);
  background: var(--red-50);
}

.performance-comparison-card.warning .performance-status {
  color: #b54708;
  background: #fffaeb;
}

.performance-value-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.performance-value-block {
  min-width: 0;
  padding-right: 12px;
}

.performance-value-block.target {
  padding-right: 0;
  padding-left: 14px;
  border-left: 1px solid var(--gray-200);
}

.performance-value-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gray-600);
  font-size: 10px;
  font-weight: 700;
}

.performance-value-label svg {
  width: 15px;
  height: 15px;
  color: currentColor;
}

.performance-comparison-card .performance-number {
  min-height: 34px;
  margin-top: 6px;
  color: var(--blue-700);
  font-size: 31px;
  font-weight: 750;
}

.performance-comparison-card.good .performance-number {
  color: var(--green-700);
}

.performance-comparison-card.critical .performance-number {
  color: var(--red-700);
}

.performance-comparison-card .target-number,
.performance-comparison-card.good .target-number,
.performance-comparison-card.critical .target-number {
  color: var(--blue-700);
}

.performance-value-meta {
  display: block;
  margin-top: 2px;
  color: var(--gray-500);
  font-size: 10px;
}

.performance-impact-card .performance-value-grid {
  margin-top: 14px;
}

.performance-impact-card .impact-number {
  color: var(--blue-700);
}

.performance-impact-card .performance-value-label {
  min-height: 0;
  align-items: center;
  line-height: normal;
  letter-spacing: 0;
  text-transform: none;
}

.performance-impact-card .performance-value-meta {
  max-width: 145px;
  font-size: 10px;
  line-height: 1.35;
}

.performance-impact-card .performance-status {
  text-transform: none;
}

.safety-metric-group .kpi-card {
  min-height: 132px;
  overflow: visible;
  padding: 17px;
  background: #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1);
}

.safety-metric-group .kpi-value {
  min-height: 34px;
  margin-top: 12px;
  color: #1e3a8a;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.05;
}

.safety-metric-group .kpi-value.has-unit {
  min-width: 0;
}

.safety-metric-group .kpi-value-unit {
  max-width: 112px;
  font-size: 11px;
}

.safety-metric-group .kpi-card.neutral .kpi-value {
  color: #1e3a8a;
}

.safety-metric-group .kpi-card.good .kpi-value {
  color: #166534;
}

.safety-metric-group .kpi-card.warning .kpi-value {
  color: #1e3a8a;
}

.safety-metric-group .kpi-card.critical .kpi-value {
  color: #991b1b;
}

.safety-metric-group .kpi-icon {
  width: 32px;
  height: 32px;
}

.skeleton {
  position: relative;
  width: min(68%, 160px);
  min-width: 96px;
  overflow: hidden;
  border-radius: 7px;
  color: transparent !important;
  background: #e2e8f0;
  user-select: none;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, .68) 48%,
    transparent 100%
  );
  content: "";
  transform: translateX(-100%);
  animation: skeleton-shimmer 1.25s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  100% {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton::after {
    animation: none;
  }
}

.safety-trend-grid .chart-wrap {
  height: 255px;
}

.safety-incident-trend-panel {
  grid-column: 1 / -1;
}

.safety-incident-trend-panel .chart-wrap {
  height: 310px;
}

.content-grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel,
.filter-panel {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.panel {
  min-width: 0;
  margin-bottom: 18px;
}

.content-grid .panel {
  margin-bottom: 0;
}

.panel-header {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--gray-100);
}

.panel-header h3 {
  margin: 0;
  color: var(--gray-900);
  font-size: 13px;
}

.panel-header p {
  margin: 3px 0 0;
  color: var(--gray-500);
  font-size: 10px;
}

.legend-pill {
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 800;
}

.legend-pill.teal {
  color: var(--teal-700);
  background: var(--teal-100);
}

.legend-pill.red {
  color: var(--red-700);
  background: var(--red-100);
}

.legend-pill.threshold-warning {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--red-700);
  background: var(--red-50);
  font-weight: 800;
}

.legend-pill.threshold-warning svg {
  width: 13px;
  height: 13px;
}

.chart-wrap {
  position: relative;
  height: 275px;
  padding: 17px;
}

.chart-wrap.chart-large {
  height: 320px;
}

.inspection-secondary-chart-grid .chart-wrap {
  height: 255px;
}

@media (max-width: 1199px) {
  .inspection-secondary-chart-grid {
    grid-template-columns: 1fr;
  }
}

.chart-filter-hint {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 16px;
  color: var(--gray-500);
  background: var(--gray-100);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.chart-filter-hint.active {
  cursor: pointer;
  color: var(--white);
  background: var(--teal-700);
}

.panel.chart-filter-active {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 2px rgba(43, 169, 170, .13), var(--shadow-sm);
}

.panel.chart-filter-active .panel-header {
  background: var(--teal-50);
}

.filter-panel {
  margin-bottom: 18px;
  padding: 15px 18px 18px;
}

.filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.filter-collapse-toggle {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  color: var(--gray-700);
  background: transparent;
  text-align: left;
}

.filter-collapse-toggle strong {
  font-size: 12px;
  white-space: nowrap;
}

.desktop-filter-summary {
  color: var(--gray-500);
  font-size: 10px;
  font-weight: 500;
}

.filter-chevron {
  display: grid;
  width: 26px;
  height: 26px;
  margin-left: 2px;
  place-items: center;
  border-radius: 7px;
  color: var(--teal-700);
  background: var(--teal-50);
}

.filter-chevron svg {
  width: 15px;
  height: 15px;
}

.filter-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-heading > div {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-700);
  font-size: 12px;
}

.filter-collapsible-content {
  display: grid;
  grid-template-rows: auto auto;
  opacity: 1;
  transition: opacity .18s ease;
}

.inspection-filter-panel.desktop-collapsed,
.safety-filter-panel.desktop-collapsed,
.spip-filter-panel.desktop-collapsed,
.sop-filter-panel.desktop-collapsed {
  padding-bottom: 15px;
}

.inspection-filter-panel.desktop-collapsed .filter-heading,
.safety-filter-panel.desktop-collapsed .filter-heading,
.spip-filter-panel.desktop-collapsed .filter-heading,
.sop-filter-panel.desktop-collapsed .filter-heading {
  margin-bottom: 0;
}

.inspection-filter-panel.desktop-collapsed .filter-collapsible-content,
.safety-filter-panel.desktop-collapsed .filter-collapsible-content,
.spip-filter-panel.desktop-collapsed .filter-collapsible-content,
.sop-filter-panel.desktop-collapsed .filter-collapsible-content {
  display: none;
  opacity: 0;
}

.text-button {
  padding: 4px;
  color: var(--teal-700);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 10px;
}

.date-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.date-presets button {
  padding: 6px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 7px;
  color: var(--gray-600);
  background: var(--white);
  font-size: 10px;
  font-weight: 700;
}

.date-presets button:hover {
  color: var(--teal-700);
  border-color: var(--teal-500);
}

.date-presets button.active {
  color: var(--white);
  border-color: var(--teal-700);
  background: var(--teal-700);
}

.mobile-filter-toolbar,
.filter-sheet-backdrop,
.filter-sheet-handle,
.filter-sheet-close,
.apply-filter-button {
  display: none;
}

.overdue-alert {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 11px;
  margin-bottom: 18px;
  padding: 13px 14px;
  border: 1px solid var(--red-100);
  border-left: 3px solid var(--red-600);
  border-radius: 9px;
  color: var(--red-700);
  background: var(--red-50);
}

.overdue-alert-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: var(--red-100);
}

.overdue-alert p {
  margin: 0;
  font-size: 11px;
}

.overdue-detail-button,
.overdue-dismiss {
  color: var(--red-700);
  background: transparent;
  font-weight: 750;
}

.overdue-detail-button {
  font-size: 10px;
}

.overdue-dismiss {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  font-size: 19px;
}

.overdue-dismiss:hover {
  background: var(--red-100);
}

.overdue-days {
  color: var(--red-700);
}

.chart-empty {
  display: grid;
  min-height: 240px;
  place-items: center;
  color: var(--gray-500);
  font-size: 11px;
}

.spip-filter-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.spip-population-panel,
.spip-type-panel {
  align-self: start;
}

.spip-type-scroll {
  height: 275px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: rgba(0, 127, 128, .35) transparent;
  scrollbar-width: thin;
}

.spip-type-scroll::-webkit-scrollbar {
  width: 6px;
}

.spip-type-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.spip-type-scroll::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: rgba(0, 127, 128, .35);
}

.spip-type-scroll .chart-wrap {
  min-height: 275px;
}

.search-box {
  position: relative;
  display: block;
  width: min(300px, 100%);
}

.search-box > span {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 10px;
  color: var(--gray-400);
  transform: translateY(-50%);
}

.search-box input {
  padding-left: 35px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.spip-table-wrap {
  overflow: visible;
}

.spip-detail-table {
  width: 100%;
  table-layout: fixed;
  white-space: normal;
}

.spip-detail-table thead th {
  position: sticky;
  z-index: 10;
  top: var(--topbar-height);
  background: var(--gray-50);
  box-shadow: inset 0 -1px 0 var(--gray-200);
}

.spip-detail-table th,
.spip-detail-table td {
  padding: 10px 9px;
  overflow-wrap: anywhere;
  text-align: center;
  vertical-align: middle;
  white-space: normal;
}

.spip-sort-button {
  display: inline-flex;
  width: 100%;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: 1.25;
  text-transform: inherit;
}

.spip-sort-button:hover,
.spip-sort-button:focus-visible {
  color: var(--teal-700);
}

.spip-sort-button:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--teal-300);
  outline-offset: 2px;
}

.spip-sort-indicator {
  position: relative;
  width: 8px;
  height: 12px;
  flex: 0 0 8px;
  color: var(--gray-400);
}

.spip-sort-indicator::before,
.spip-sort-indicator::after {
  position: absolute;
  left: 1px;
  width: 0;
  height: 0;
  border-right: 3px solid transparent;
  border-left: 3px solid transparent;
  content: "";
}

.spip-sort-indicator::before {
  top: 1px;
  border-bottom: 4px solid currentColor;
}

.spip-sort-indicator::after {
  bottom: 1px;
  border-top: 4px solid currentColor;
}

.spip-sort-button[data-sort-order="asc"] .spip-sort-indicator,
.spip-sort-button[data-sort-order="desc"] .spip-sort-indicator {
  color: var(--teal-700);
}

.spip-sort-button[data-sort-order="asc"] .spip-sort-indicator::after,
.spip-sort-button[data-sort-order="desc"] .spip-sort-indicator::before {
  opacity: .25;
}

.spip-detail-table th:nth-child(1) { width: 9%; }
.spip-detail-table th:nth-child(2) { width: 19%; }
.spip-detail-table th:nth-child(3) { width: 10%; }
.spip-detail-table th:nth-child(4) { width: 19%; }
.spip-detail-table th:nth-child(5) { width: 13%; }
.spip-detail-table th:nth-child(6) { width: 9%; }
.spip-detail-table th:nth-child(7) { width: 9%; }
.spip-detail-table th:nth-child(8) { width: 12%; }

.spip-detail-table .cell-main {
  max-width: none;
  text-align: center;
  white-space: normal;
}

.spip-detail-table .cell-sub {
  text-align: center;
}

.spip-detail-table .spip-type-name {
  color: var(--teal-700);
  font-size: 12px;
  font-weight: 800;
}

.spip-detail-table .spip-technical-value {
  font-size: 10px;
}

.spip-detail-table .spip-status-cell {
  text-align: center;
}

.spip-detail-table .spip-status-cell .badge {
  justify-content: center;
  white-space: normal;
}

.spip-detail-table .spip-note-cell {
  color: var(--gray-600);
  line-height: 1.35;
  text-align: center;
}

.spip-detail-table .spip-group-row td {
  padding: 9px 12px;
  border-top: 1px solid rgba(0, 127, 128, .2);
  border-bottom: 1px solid rgba(0, 127, 128, .16);
  color: var(--teal-800);
  background: linear-gradient(90deg, rgba(0, 127, 128, .12), rgba(0, 127, 128, .035));
  text-align: left;
}

.spip-detail-table .spip-group-row td span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: capitalize;
}

.spip-detail-table .spip-group-row td small {
  margin-left: 8px;
  color: var(--teal-600);
  font-size: 9px;
  font-weight: 700;
}

.spip-detail-table .spip-group-row:hover {
  background: transparent;
}

@media (min-width: 1200px) {
  body:not(.sidebar-collapsed) .spip-detail-table th,
  body:not(.sidebar-collapsed) .spip-detail-table td {
    padding-right: 6px;
    padding-left: 6px;
  }

  body:not(.sidebar-collapsed) .spip-detail-table th {
    font-size: 8px;
  }

  body:not(.sidebar-collapsed) .spip-detail-table td {
    font-size: 10px;
  }
}

@media (max-width: 767px) {
  .spip-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .spip-detail-table {
    min-width: 880px;
    table-layout: auto;
  }

  .spip-detail-table thead th:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 11;
    background: var(--gray-50);
    box-shadow: inset 0 -1px 0 var(--gray-200), inset -1px 0 0 var(--gray-200);
  }

  .spip-detail-table tbody tr:not(.spip-group-row) td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 5;
    background: var(--white);
    box-shadow: inset -1px 0 0 var(--gray-200);
  }
}

.inspection-detail-table {
  width: 100%;
  table-layout: fixed;
}

.inspection-detail-table th,
.inspection-detail-table td {
  padding-top: 10px;
  padding-bottom: 10px;
  padding-right: 9px;
  padding-left: 9px;
  overflow-wrap: break-word;
}

.inspection-detail-table th {
  white-space: normal;
}

.inspection-detail-table th:nth-child(1) { width: 8.5%; }
.inspection-detail-table th:nth-child(2) { width: 6%; }
.inspection-detail-table th:nth-child(3) { width: 7%; }
.inspection-detail-table th:nth-child(4) { width: 17%; }
.inspection-detail-table th:nth-child(5) { width: 7%; }
.inspection-detail-table th:nth-child(6) { width: 16%; }
.inspection-detail-table th:nth-child(7) { width: 9.5%; }
.inspection-detail-table th:nth-child(8) { width: 6.5%; }
.inspection-detail-table th:nth-child(9) { width: 6.5%; }
.inspection-detail-table th:nth-child(10) { width: 7%; }
.inspection-detail-table th:nth-child(11) { width: 9%; }

.inspection-detail-table td:nth-child(1),
.inspection-detail-table td:nth-child(2),
.inspection-detail-table td:nth-child(3),
.inspection-detail-table td:nth-child(4),
.inspection-detail-table td:nth-child(6),
.inspection-detail-table td:nth-child(7),
.inspection-detail-table td:nth-child(8),
.inspection-detail-table td:nth-child(9),
.inspection-detail-table td:nth-child(11) {
  white-space: normal;
}

.inspection-detail-table td:nth-child(4) .cell-main {
  max-width: none;
  white-space: normal;
}

.inspection-detail-table td:nth-child(1),
.inspection-detail-table td:nth-child(3),
.inspection-detail-table td:nth-child(8),
.inspection-detail-table td:nth-child(9),
.inspection-detail-table td:nth-child(10),
.inspection-detail-table td:nth-child(11) {
  word-break: normal;
}

.inspection-detail-table th:nth-child(7),
.inspection-detail-table th:nth-child(10),
.inspection-evidence-cell,
.inspection-status-cell,
.inspection-evidence-action {
  text-align: center;
}

.inspection-status-cell .badge {
  justify-content: center;
  white-space: nowrap;
}

.inspection-evidence-cell .evidence-upload-button,
.inspection-evidence-action .evidence-upload-button {
  width: 100%;
  max-width: 110px;
  min-height: 38px;
  margin-inline: auto;
  padding: 7px 9px;
  white-space: normal;
}

.inspection-evidence-cell .inspection-thumbnail,
.inspection-evidence-cell .inspection-photo-placeholder {
  margin-inline: auto;
}

.inspection-evidence-action .evidence-done {
  justify-content: center;
  white-space: nowrap;
}

@media (min-width: 1200px) {
  body:not(.sidebar-collapsed) .page-container {
    width: 100%;
    max-width: none;
    padding-right: 20px;
    padding-left: 20px;
  }

  body:not(.sidebar-collapsed) #inspectionDetailPanel .inspection-detail-table th,
  body:not(.sidebar-collapsed) #inspectionDetailPanel .inspection-detail-table td {
    padding-right: 7px;
    padding-left: 7px;
  }

  body:not(.sidebar-collapsed) #inspectionDetailPanel .inspection-detail-table th {
    font-size: 8px;
  }

  body:not(.sidebar-collapsed) #inspectionDetailPanel .inspection-detail-table td {
    font-size: 10px;
  }

  body:not(.sidebar-collapsed) #inspectionDetailPanel .inspection-thumbnail,
  body:not(.sidebar-collapsed) #inspectionDetailPanel .inspection-photo-placeholder {
    width: min(72px, 100%);
    height: 54px;
  }

  body:not(.sidebar-collapsed) #inspectionDetailPanel .evidence-upload-button {
    padding: 7px 6px;
    font-size: 8px;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--gray-100);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--gray-500);
  background: var(--gray-50);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}

td {
  color: var(--gray-700);
  font-size: 11px;
}

tbody tr:hover {
  background: #fcfdfd;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.cell-main,
.cell-sub {
  display: block;
}

.cell-main {
  max-width: 260px;
  overflow: hidden;
  color: var(--gray-900);
  font-weight: 650;
  text-overflow: ellipsis;
}

.cell-sub {
  margin-top: 2px;
  color: var(--gray-500);
  font-size: 9px;
}

.recommendation-cell {
  display: block;
  max-width: 280px;
  color: var(--gray-700);
  line-height: 1.45;
  white-space: normal;
}

.inspection-detail-table td:nth-child(1),
.inspection-detail-table td:nth-child(2),
.inspection-detail-table td:nth-child(3),
.inspection-detail-table td:nth-child(4) {
  color: var(--gray-700);
  font-weight: 400;
  line-height: 1.45;
}

.inspection-detail-table td:nth-child(1) .cell-main,
.inspection-detail-table td:nth-child(3) .cell-main,
.inspection-detail-table td:nth-child(4) .cell-main {
  color: var(--gray-700);
  font-weight: 400;
  line-height: 1.45;
}

.inspection-thumbnail,
.inspection-photo-placeholder {
  position: relative;
  display: grid;
  width: min(82px, 100%);
  height: 60px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: var(--gray-100);
}

.inspection-thumbnail {
  color: var(--white);
  box-shadow: 0 2px 7px rgba(16, 24, 40, .08);
}

.inspection-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .2s ease;
}

.thumbnail-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--white);
  background: rgba(4, 56, 57, .48);
  opacity: 0;
  transition: opacity .18s ease;
}

.thumbnail-overlay svg {
  width: 21px;
  height: 21px;
}

a:hover .inspection-thumbnail img {
  transform: scale(1.04);
}

a:hover .thumbnail-overlay {
  opacity: 1;
}

.inspection-thumbnail.image-error::after {
  color: var(--gray-500);
  font-size: 9px;
  font-weight: 700;
  content: "Gagal dimuat";
}

.inspection-photo-placeholder {
  gap: 3px;
  align-content: center;
  color: var(--gray-400);
  border-style: dashed;
  background: var(--gray-50);
}

.inspection-photo-placeholder.evidence {
  color: var(--teal-500);
  background: var(--teal-50);
}

.inspection-photo-placeholder svg {
  width: 18px;
  height: 18px;
}

.inspection-photo-placeholder small {
  font-size: 8px;
  font-weight: 700;
}

.evidence-upload-button,
.evidence-done {
  display: inline-flex;
  min-width: 0;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 9px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
}

.evidence-upload-button {
  color: var(--white);
  background: var(--teal-700);
  box-shadow: 0 3px 8px rgba(0, 127, 128, .16);
}

.evidence-upload-button:hover {
  background: var(--teal-800);
  transform: translateY(-1px);
}

.evidence-upload-button:disabled {
  cursor: wait;
  opacity: .72;
  transform: none;
}

.evidence-upload-button svg,
.evidence-done svg {
  width: 14px;
  height: 14px;
}

.evidence-done {
  min-width: auto;
  min-height: auto;
  padding: 5px 9px;
  color: var(--green-700);
  background: #ecfdf3;
}

.mini-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, .36);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 750;
}

.badge::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.badge.green { color: var(--green-700); background: #ecfdf3; }
.badge.red { color: var(--red-700); background: var(--red-50); }
.badge.amber { color: var(--amber-700); background: #fffaeb; }
.badge.blue { color: var(--blue-700); background: #eff8ff; }
.badge.gray { color: var(--gray-600); background: var(--gray-100); }

.table-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 8px;
  color: var(--teal-700);
  font-size: 10px;
  font-weight: 700;
}

.table-link:hover {
  text-decoration: underline;
}

.table-link svg {
  width: 14px;
  height: 14px;
}

.empty-state {
  display: grid;
  min-height: 240px;
  place-items: center;
  align-content: center;
  padding: 30px;
  color: var(--gray-500);
  text-align: center;
}

.empty-state > span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  color: var(--teal-700);
  background: var(--teal-50);
}

.empty-state h3 {
  margin: 12px 0 2px;
  color: var(--gray-800);
  font-size: 14px;
}

.empty-state p {
  margin: 0;
  font-size: 11px;
}

.alert {
  position: relative;
  z-index: 35;
  margin: 14px 32px 0;
  padding: 11px 14px;
  border: 1px solid var(--red-100);
  border-radius: 9px;
  color: var(--red-700);
  background: var(--red-50);
  font-size: 12px;
}

.alert.success {
  color: var(--green-700);
  border-color: var(--green-100);
  background: #ecfdf3;
}

.alert.warning {
  color: var(--amber-700);
  border-color: var(--amber-100);
  background: #fffaeb;
}

.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.demo-banner button {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 7px;
  color: var(--amber-700);
  background: transparent;
  font-size: 19px;
}

.demo-banner button:hover {
  background: var(--amber-100);
}

.loading-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  color: var(--gray-600);
  background: rgba(248, 250, 251, .84);
  backdrop-filter: blur(4px);
}

.spinner {
  width: 35px;
  height: 35px;
  border: 3px solid var(--teal-100);
  border-top-color: var(--teal-700);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.loading-overlay p {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 650;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.mobile-nav {
  display: none;
}

.toast-container {
  position: fixed;
  z-index: 250;
  top: 18px;
  right: 18px;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  min-width: 250px;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border: 1px solid var(--green-100);
  border-radius: 10px;
  color: var(--green-700);
  background: var(--white);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(-10px);
  transition: .2s ease;
}

.toast.error {
  color: var(--red-700);
  border-color: var(--red-100);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast strong {
  font-size: 11px;
}

/* Input inspection page */
.input-page {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--gray-50);
}

.field-header {
  background: var(--teal-900);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.field-header-inner {
  display: flex;
  width: calc(100vw - 36px);
  max-width: 1480px;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  padding: 12px 0;
}

.field-heading-lockup {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.field-header-logo {
  display: block;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: contain;
}

.connection-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, .7);
  font-size: 10px;
}

.field-main {
  width: calc(100vw - 36px);
  max-width: 1480px;
  min-width: 0;
  margin: 0 auto;
  padding: 12px 0 64px;
}

.field-intro {
  margin: 0;
  color: rgba(255, 255, 255, .72);
}

.field-intro .eyebrow {
  margin: 0;
  color: #77d6cc;
  font-size: 9px;
}

.field-intro h1 {
  margin: 4px 0 0;
  color: var(--white);
  font-size: 24px;
  letter-spacing: -.035em;
  line-height: 1.1;
}

.input-page .alert {
  width: 100%;
  margin: 0 0 12px;
}

.input-form-alert {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  border-radius: 8px;
}

.input-alert-icon {
  flex: 0 0 18px;
}

.input-alert-icon svg {
  width: 17px;
  height: 17px;
}

.input-alert-copy {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 5px;
  line-height: 1.35;
}

.input-alert-copy strong {
  color: inherit;
  font-size: 11px;
  font-weight: 750;
}

.input-alert-copy span {
  color: var(--gray-600);
  font-size: 10.5px;
}

.form-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-bottom: 14px;
  padding: 20px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.form-card-header,
.form-section-heading,
.finding-card-header {
  display: flex;
  align-items: center;
}

.form-card-header {
  gap: 12px;
  margin-bottom: 16px;
}

.form-section-heading {
  gap: 12px;
}

.findings-header {
  justify-content: space-between;
}

.step-number {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 9px;
  color: var(--white);
  background: var(--teal-700);
  font-size: 11px;
  font-weight: 800;
}

.form-section-heading-copy h2 {
  margin: 0;
  color: var(--gray-950);
  font-size: 17px;
  font-weight: 750;
}

.form-section-heading-copy p {
  margin: 3px 0 0;
  color: var(--gray-600);
  font-size: 10.5px;
  font-weight: 400;
}

.findings-count {
  padding: 4px 8px;
  border-radius: 20px;
  color: var(--teal-700);
  background: var(--teal-50);
  font-size: 9px;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}

.form-grid > * {
  min-width: 0;
}

#inspectionForm,
.input-page input,
.input-page select,
.input-page textarea {
  max-width: 100%;
  min-width: 0;
}

.form-grid label > span:first-child {
  color: var(--gray-800);
  font-size: 11.5px;
  font-weight: 750;
}

.input-general-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.input-primary-field input {
  font-size: 12px;
  font-weight: 600;
}

.finding-input-card {
  padding: 14px;
}

.finding-table-wrap {
  width: 100%;
  margin-bottom: 8px;
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
}

.finding-input-table {
  min-width: 1160px;
  table-layout: fixed;
  white-space: normal;
}

.finding-input-table th {
  padding: 9px 7px;
  color: var(--white);
  background: var(--teal-700);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .015em;
  line-height: 1.35;
  text-align: center;
}

.finding-input-table th:nth-child(1) { width: 8.5%; }
.finding-input-table th:nth-child(2) { width: 11%; }
.finding-input-table th:nth-child(3) { width: 17%; }
.finding-input-table th:nth-child(4) { width: 10%; }
.finding-input-table th:nth-child(5) { width: 17%; }
.finding-input-table th:nth-child(6) { width: 8.5%; }
.finding-input-table th:nth-child(7) { width: 9.5%; }
.finding-input-table th:nth-child(8) { width: 12%; }
.finding-input-table th:nth-child(9) { width: 6.5%; }

.finding-input-table td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
  white-space: normal;
}

.finding-input-table input,
.finding-input-table select,
.finding-input-table textarea {
  width: 100%;
  font-size: 10px;
}

.finding-input-table textarea {
  height: 34px;
  min-height: 34px;
  padding: 7px 8px;
  overflow-y: auto;
  line-height: 1.35;
  resize: vertical;
}

.finding-input-table input,
.finding-input-table select {
  height: 34px;
  min-height: 34px;
  padding: 5px 7px;
}

.compact-file-field {
  position: relative;
  display: grid;
  gap: 1px;
}

.compact-file-field input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.compact-file-button {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 7px;
  border: 1px solid var(--teal-300);
  border-radius: 8px;
  cursor: pointer;
  color: var(--teal-700);
  background: var(--teal-50);
  font-size: 9.5px;
  transition: .2s ease;
}

.compact-file-button:hover,
.compact-file-button:focus-within {
  border-color: var(--teal-600);
  background: var(--teal-100);
}

.compact-file-button svg {
  width: 14px;
  height: 14px;
}

.compact-file-field small {
  color: var(--gray-500);
  font-size: 8px;
  line-height: 1.15;
  text-align: center;
}

.compact-file-field.has-photo .compact-file-button,
.compact-file-field.has-photo .compact-file-note {
  display: none;
}

.compact-photo-preview-wrap {
  position: relative;
  display: block;
  width: 100%;
  height: 34px;
  overflow: hidden;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  cursor: pointer;
  background: var(--gray-100);
}

.compact-photo-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compact-photo-change {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border-radius: 6px;
  color: var(--white);
  background: rgba(16, 24, 40, .72);
  font-size: 8px;
  font-weight: 750;
  backdrop-filter: blur(4px);
}

.compact-photo-change svg {
  width: 11px;
  height: 11px;
}

.button.danger {
  color: var(--white);
  background: var(--red-600);
}

.button.danger:hover {
  background: var(--red-700);
}

.finding-input-table .remove-finding {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--red-100);
  border-radius: 8px;
  color: var(--red-600);
  background: var(--red-50);
  transition: .2s ease;
}

.finding-input-table .remove-finding:hover {
  color: var(--white);
  border-color: var(--red-600);
  background: var(--red-600);
}

.finding-input-table .remove-finding svg {
  width: 14px;
  height: 14px;
}

.finding-input-table td:last-child {
  text-align: center;
}

.existing-findings-section {
  margin-top: 34px;
}

.existing-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.existing-section-header .eyebrow {
  color: var(--teal-700);
}

.existing-section-header h2 {
  margin: 3px 0;
  color: var(--gray-950);
  font-size: 22px;
}

.existing-section-header p:last-child {
  margin: 0;
  color: var(--gray-500);
  font-size: 11px;
}

.existing-section-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
}

.existing-findings-panel {
  overflow: hidden;
}

.input-existing-table {
  width: 100%;
  table-layout: fixed;
  white-space: normal;
}

.input-existing-table th {
  padding: 11px 7px;
  color: var(--white);
  background: var(--teal-700);
  font-size: 8px;
  text-align: center;
}

.input-existing-table td {
  padding: 10px 7px;
  font-size: 9px;
  line-height: 1.4;
  text-align: center;
  vertical-align: middle;
  white-space: normal;
}

.input-existing-table td > strong,
.input-existing-table td > small {
  display: block;
}

.input-existing-table td > small {
  margin-top: 2px;
  color: var(--gray-500);
}

.input-existing-table .inspection-thumbnail,
.input-existing-table .inspection-photo-placeholder {
  display: flex;
  width: 72px;
  height: 54px;
  margin-right: auto;
  margin-left: auto;
}

.input-existing-table .evidence-upload-button {
  width: 100%;
  min-height: 42px;
  padding: 7px;
  margin-right: auto;
  margin-left: auto;
}

.form-grid label > small,
.inspector-cache-field small {
  display: block;
  margin-top: 5px;
  color: var(--gray-500);
  font-size: 9px;
  line-height: 1.4;
}

.inspector-cache-field small {
  color: var(--gray-600);
  font-weight: 550;
}

.form-grid label.required > span:first-child::after {
  margin-left: 3px;
  color: var(--red-600);
  content: "*";
}

.form-grid input,
.form-grid select {
  min-height: 45px;
}

.full-width {
  grid-column: 1 / -1;
}

.finding-card {
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid var(--gray-200);
  border-top: 4px solid var(--teal-700);
  border-radius: 12px;
  background: #fdfefe;
}

.finding-card-header {
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--gray-100);
}

.finding-card-header .finding-index,
.finding-card-header small {
  display: block;
}

.finding-card-header .finding-index {
  color: var(--teal-800);
  font-size: 13px;
  font-weight: 800;
}

.finding-entry-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
}

.finding-date,
.finding-location,
.finding-area,
.finding-category,
.finding-risk,
.finding-pic {
  grid-column: span 2;
}

.finding-due {
  grid-column: span 2;
}

.finding-description,
.finding-recommendation {
  grid-column: span 5;
}

.finding-note,
.finding-photo,
.finding-evidence {
  grid-column: span 4;
}

.finding-entry-grid textarea {
  min-height: 112px;
  resize: vertical;
}

.optional-label {
  display: inline;
  margin-left: 5px;
  padding: 2px 5px;
  border-radius: 10px;
  color: var(--gray-500);
  background: var(--gray-100);
  font-size: 8px;
  font-weight: 700;
}

.finding-card-header small {
  margin-top: 2px;
  color: var(--gray-500);
  font-size: 9px;
}

.photo-field input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.photo-dropzone {
  position: relative;
  display: grid;
  min-height: 132px;
  place-items: center;
  align-content: center;
  overflow: hidden;
  padding: 18px;
  border: 1.5px dashed var(--gray-300);
  border-radius: 10px;
  cursor: pointer;
  background: var(--gray-50);
  text-align: center;
  transition: .2s;
}

.photo-dropzone:hover {
  border-color: var(--teal-500);
  background: var(--teal-50);
}

.photo-dropzone .photo-icon {
  width: 38px;
  height: 38px;
  margin-bottom: 8px;
  border-radius: 50%;
  color: var(--teal-700);
  background: var(--teal-100);
}

.photo-dropzone strong {
  color: var(--gray-700);
  font-size: 11px;
}

.photo-dropzone small {
  margin-top: 3px;
  color: var(--gray-500);
  font-size: 9px;
}

.photo-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.add-finding-button {
  width: auto;
  min-height: 36px;
  padding: 7px 12px;
  color: var(--white);
  border: 1px solid var(--teal-700);
  background: var(--teal-700);
  font-size: 10px;
  font-weight: 750;
  box-shadow: var(--shadow-sm);
}

.add-finding-button:hover {
  border-color: var(--teal-800);
  background: var(--teal-800);
}

.form-submit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.submit-summary strong,
.submit-summary small {
  display: block;
}

.submit-summary strong {
  font-size: 11px;
}

.submit-summary small {
  margin-top: 2px;
  color: var(--gray-500);
  font-size: 9px;
}

.form-submit-bar .button.large {
  font-size: 12px;
}

.modal {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 45, 43, .74);
  backdrop-filter: blur(7px);
}

.modal-card {
  width: min(100%, 430px);
  padding: 32px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .22);
  text-align: center;
}

.success-icon {
  display: grid;
  width: 60px;
  height: 60px;
  margin: 0 auto 17px;
  place-items: center;
  border-radius: 50%;
  color: var(--green-700);
  background: var(--green-100);
}

.success-icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.4;
}

.modal-card h2 {
  margin: 0;
  font-size: 21px;
}

.modal-card p {
  margin: 7px 0 14px;
  color: var(--gray-500);
}

.pica-export-modal-card {
  width: min(100%, 620px);
  padding: 0;
  overflow: hidden;
  text-align: left;
}

.pica-export-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--gray-200);
}

.pica-export-modal-header h2 {
  margin-top: 3px;
}

.pica-export-modal-header p {
  margin-bottom: 0;
  font-size: 11px;
}

.pica-modal-close {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 9px;
  color: var(--gray-600);
  background: var(--gray-100);
}

.pica-modal-close:hover {
  color: var(--red-600);
  background: var(--red-50);
}

.pica-modal-close svg {
  width: 18px;
  height: 18px;
}

.pica-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  padding: 22px 26px 18px;
}

.pica-filter-grid label > span {
  color: var(--gray-700);
  font-size: 11px;
  font-weight: 700;
}

.pica-filter-wide {
  grid-column: 1 / -1;
}

.pica-export-summary {
  margin: 0 26px;
  padding: 10px 12px;
  border: 1px solid var(--teal-100);
  border-radius: 9px;
  color: var(--teal-800);
  background: var(--teal-50);
  font-size: 11px;
  font-weight: 700;
}

.pica-export-summary.warning {
  color: var(--amber-700);
  border-color: var(--amber-100);
  background: #fffaeb;
}

.pica-export-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 26px 24px;
}

.submitted-ids {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 20px;
}

.submitted-ids span {
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--teal-700);
  background: var(--teal-50);
  font-size: 10px;
  font-weight: 700;
}

@media (max-width: 1250px) {
  .kpi-grid-five {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .three-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .three-columns .panel:last-child {
    grid-column: 1 / -1;
  }

  .filter-grid {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }

  .inspection-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .safety-incident-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .safety-performance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .performance-impact-card {
    grid-column: 1 / -1;
    min-height: 170px;
  }

  .performance-impact-card .performance-value-grid {
    margin-top: 18px;
  }

  .safety-manpower-grid {
    grid-template-columns: 1fr;
  }

  .finding-entry-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .finding-date,
  .finding-location,
  .finding-area,
  .finding-category,
  .finding-risk,
  .finding-pic,
  .finding-due {
    grid-column: span 2;
  }

  .finding-description,
  .finding-recommendation,
  .finding-note,
  .finding-photo,
  .finding-evidence {
    grid-column: span 3;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  :root {
    --sidebar-width: 64px;
  }

  .sidebar {
    width: var(--sidebar-width);
    overflow: visible;
    padding: 20px 8px;
  }

  .brand {
    justify-content: center;
    padding: 0 0 24px;
  }

  .brand > div:last-child,
  .nav-item > span:last-child,
  .system-status > div,
  .sidebar-footer > small {
    display: none;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .nav-item {
    position: relative;
    justify-content: center;
    gap: 0;
    min-height: 46px;
    padding: 12px;
  }

  .nav-item:hover::after {
    position: absolute;
    z-index: 90;
    left: calc(100% + 10px);
    padding: 7px 9px;
    border-radius: 7px;
    color: var(--white);
    background: var(--gray-950);
    box-shadow: var(--shadow-md);
    content: attr(data-tooltip);
    font-size: 10px;
    font-weight: 650;
    white-space: nowrap;
  }

  .sidebar-footer {
    justify-items: center;
    padding: 16px 0 0;
  }

  .system-status {
    justify-content: center;
  }

  .main-content {
    margin-left: var(--sidebar-width);
  }

  body.sidebar-collapsed .main-content {
    margin-left: 0;
  }

  #inspectionDetailPanel .table-wrap {
    overflow-x: hidden;
    padding: 12px;
    background: var(--gray-50);
  }

  .inspection-detail-table,
  .inspection-detail-table tbody {
    display: block;
    width: 100%;
  }

  .inspection-detail-table thead {
    display: none;
  }

  .inspection-detail-table tbody {
    display: grid;
    gap: 12px;
  }

  .inspection-detail-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
    padding: 16px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
  }

  .inspection-detail-table td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    white-space: normal;
  }

  .inspection-detail-table td::before {
    display: block;
    margin-bottom: 5px;
    color: var(--gray-500);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
  }

  .inspection-detail-table td:nth-child(1)::before { content: "Inspection ID"; }
  .inspection-detail-table td:nth-child(2)::before { content: "Tanggal"; }
  .inspection-detail-table td:nth-child(3)::before { content: "Lokasi"; }
  .inspection-detail-table td:nth-child(4)::before { content: "Keterangan Temuan"; }
  .inspection-detail-table td:nth-child(5)::before { content: "Foto Temuan"; }
  .inspection-detail-table td:nth-child(6)::before { content: "Rekomendasi"; }
  .inspection-detail-table td:nth-child(7)::before { content: "Foto Evidence"; }
  .inspection-detail-table td:nth-child(8)::before { content: "Due Date"; }
  .inspection-detail-table td:nth-child(9)::before { content: "PIC"; }
  .inspection-detail-table td:nth-child(10)::before { content: "Status"; }
  .inspection-detail-table td:nth-child(11)::before { content: "Catatan"; }

  .inspection-detail-table td:nth-child(4),
  .inspection-detail-table td:nth-child(6),
  .inspection-detail-table td:nth-child(11) {
    grid-column: 1 / -1;
  }

  .inspection-thumbnail,
  .inspection-photo-placeholder {
    width: 112px;
    height: 76px;
  }

  .evidence-upload-button {
    width: auto;
    min-width: 112px;
  }
}

.evidence-dropzone {
  border-color: var(--teal-300);
  background: var(--teal-50);
}

@media (max-width: 1023px) {
  .inspection-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  :root {
    --topbar-height: 73px;
  }

  .sidebar {
    width: 280px;
    padding: 24px 16px 20px;
    transform: translateX(-100%);
    transition: transform .2s ease-out;
  }

  body.sidebar-collapsed .sidebar.open,
  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 45;
    inset: 0;
    display: none;
    background: rgba(16, 24, 40, .4);
  }

  .sidebar-backdrop.show {
    display: block;
  }

  .main-content {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
  }

  .topbar {
    left: 0;
  }

  .menu-toggle {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .topbar-title {
    flex: 1 1 auto;
  }

  .topbar-title h1 {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .topbar-actions {
    flex: 0 0 auto;
  }

  .page-container {
    width: 100%;
    max-width: 100%;
    padding: 24px 22px 40px;
  }

  .topbar {
    width: 100%;
    max-width: 100%;
    padding: 12px 22px;
  }

  .mobile-filter-toolbar {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
  }

  .mobile-filter-toolbar > .button {
    min-height: 40px;
    white-space: nowrap;
  }

  .filter-count {
    display: grid;
    min-width: 18px;
    height: 18px;
    place-items: center;
    border-radius: 10px;
    color: var(--white);
    background: var(--teal-700);
    font-size: 9px;
  }

  .active-filter-chips {
    display: flex;
    min-width: 0;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .active-filter-chips::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    padding: 7px 9px;
    border-radius: 18px;
    color: var(--teal-700);
    background: var(--teal-50);
    font-size: 9px;
    font-weight: 700;
  }

  .filter-chip span {
    font-size: 14px;
    line-height: 1;
  }

  .filter-sheet-backdrop {
    position: fixed;
    z-index: 105;
    inset: 0;
    background: rgba(16, 24, 40, .48);
    opacity: 0;
    transition: opacity .2s ease;
  }

  .filter-sheet-backdrop.show {
    display: block;
    opacity: 1;
  }

.inspection-filter-panel,
.safety-filter-panel,
.spip-filter-panel,
.sop-filter-panel {
  position: fixed;
  z-index: 110;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  max-height: 88vh;
  overflow-y: auto;
  margin: 0;
  padding: 12px 18px max(20px, env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -18px 50px rgba(16, 24, 40, .18);
  transform: translateY(105%);
  transition: transform .22s ease-out;
}

.inspection-filter-panel.desktop-collapsed .filter-collapsible-content,
.safety-filter-panel.desktop-collapsed .filter-collapsible-content,
.spip-filter-panel.desktop-collapsed .filter-collapsible-content,
.sop-filter-panel.desktop-collapsed .filter-collapsible-content {
  display: grid;
  opacity: 1;
}

.inspection-filter-panel.desktop-collapsed .filter-heading,
.safety-filter-panel.desktop-collapsed .filter-heading,
.spip-filter-panel.desktop-collapsed .filter-heading,
.sop-filter-panel.desktop-collapsed .filter-heading {
  margin-bottom: 12px;
}

.filter-collapse-toggle {
    pointer-events: none;
  }

  .desktop-filter-summary,
  .filter-chevron {
    display: none;
  }

  .inspection-filter-panel.open,
  .safety-filter-panel.open,
  .spip-filter-panel.open,
  .sop-filter-panel.open {
    transform: translateY(0);
  }

  .filter-sheet-handle {
    display: block;
    width: 42px;
    height: 4px;
    margin: 0 auto 14px;
    border-radius: 4px;
    background: var(--gray-300);
  }

  .filter-sheet-close {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 8px;
    color: var(--gray-600);
    background: var(--gray-100);
    font-size: 19px;
  }

  .apply-filter-button {
    display: inline-flex;
    width: 100%;
    margin-top: 16px;
  }

  body.filter-sheet-open {
    overflow: hidden;
  }

  .overdue-alert {
    grid-template-columns: auto 1fr auto;
    min-width: 0;
  }

  .overdue-detail-button {
    grid-column: 2;
    justify-self: start;
  }

  .overdue-dismiss {
    grid-column: 3;
    grid-row: 1;
  }

  .toast-container {
    right: 12px;
    left: 12px;
  }

  .toast {
    min-width: 0;
    width: 100%;
  }

  #inspectionDetailPanel .table-wrap {
    overflow-x: hidden;
    padding: 10px;
    background: var(--gray-50);
  }

  #inspectionDetailPanel .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  #inspectionDetailPanel .search-box {
    width: 100%;
  }

  .inspection-detail-table,
  .inspection-detail-table tbody {
    display: block;
    width: 100%;
  }

  .inspection-detail-table thead {
    display: none;
  }

  .inspection-detail-table tbody {
    display: grid;
    gap: 10px;
  }

  .inspection-detail-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 15px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
  }

  .inspection-detail-table td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    white-space: normal;
  }

  .inspection-detail-table td::before {
    display: block;
    margin-bottom: 5px;
    color: var(--gray-500);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
  }

  .inspection-detail-table td:nth-child(1)::before { content: "Inspection ID"; }
  .inspection-detail-table td:nth-child(2)::before { content: "Tanggal"; }
  .inspection-detail-table td:nth-child(3)::before { content: "Lokasi"; }
  .inspection-detail-table td:nth-child(4)::before { content: "Keterangan Temuan"; }
  .inspection-detail-table td:nth-child(5)::before { content: "Foto Temuan"; }
  .inspection-detail-table td:nth-child(6)::before { content: "Rekomendasi"; }
  .inspection-detail-table td:nth-child(7)::before { content: "Foto Evidence"; }
  .inspection-detail-table td:nth-child(8)::before { content: "Due Date"; }
  .inspection-detail-table td:nth-child(9)::before { content: "PIC"; }
  .inspection-detail-table td:nth-child(10)::before { content: "Status"; }
  .inspection-detail-table td:nth-child(11)::before { content: "Catatan"; }

  .inspection-detail-table td:nth-child(4),
  .inspection-detail-table td:nth-child(6),
  .inspection-detail-table td:nth-child(11) {
    grid-column: 1 / -1;
  }

  .inspection-thumbnail,
  .inspection-photo-placeholder {
    width: 100%;
    max-width: 132px;
    height: 82px;
  }

  .evidence-upload-button {
    width: 100%;
    max-width: 132px;
  }

  .inspection-detail-table .inspection-evidence-cell,
  .inspection-detail-table .inspection-status-cell {
    text-align: left;
  }

  .inspection-detail-table .inspection-evidence-cell::before,
  .inspection-detail-table .inspection-status-cell::before {
    text-align: left;
  }

  .inspection-evidence-cell .inspection-thumbnail,
  .inspection-evidence-cell .inspection-photo-placeholder,
  .inspection-evidence-cell .evidence-upload-button {
    margin-inline: 0;
  }

  .inspection-status-cell .badge {
    justify-content: flex-start;
  }

}

@media (max-width: 760px) {
  body {
    font-size: 13px;
  }

  .finding-table-wrap,
  .existing-findings-panel .table-wrap {
    overflow-x: hidden;
    border: 0;
    background: transparent;
  }

  .finding-input-table,
  .finding-input-table tbody,
  .input-existing-table,
  .input-existing-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .finding-input-table thead,
  .input-existing-table thead {
    display: none;
  }

  .finding-input-table tbody,
  .input-existing-table tbody {
    display: grid;
    gap: 12px;
  }

  .finding-input-table tr,
  .input-existing-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    padding: 10px;
    border: 1px solid var(--gray-200);
    border-top: 4px solid var(--teal-700);
    border-radius: 12px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
  }

  .finding-input-table td,
  .input-existing-table td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    white-space: normal;
  }

  .finding-input-table td::before,
  .input-existing-table td::before {
    display: block;
    margin-bottom: 5px;
    color: var(--gray-700);
    content: attr(data-label);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-align: center;
    text-transform: uppercase;
  }

  .finding-input-table td,
  .finding-input-table td::before {
    text-align: left;
  }

  .finding-input-table td::before {
    width: 100%;
    box-sizing: border-box;
    padding-left: 7px;
  }

  .finding-input-table td:nth-child(3),
  .finding-input-table td:nth-child(4),
  .finding-input-table td:nth-child(5),
  .finding-input-table td:nth-child(8) {
    grid-column: 1 / -1;
  }

  .finding-input-table textarea {
    height: 38px;
    min-height: 38px;
  }

  .compact-photo-preview-wrap {
    width: 100%;
    max-width: 180px;
    height: 38px;
  }

  .finding-input-table td:last-child {
    display: grid;
    justify-items: start;
  }

  .finding-input-table .remove-finding {
    width: 34px;
    height: 34px;
  }

  .existing-section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .existing-section-actions {
    align-self: flex-start;
  }

  .input-existing-table td:nth-child(4),
  .input-existing-table td:nth-child(6),
  .input-existing-table td:nth-child(12) {
    grid-column: 1 / -1;
  }

  .input-existing-table tr,
  .input-existing-table td,
  .input-existing-table td::before {
    text-align: left;
  }

  .input-existing-table .inspection-thumbnail,
  .input-existing-table .inspection-photo-placeholder,
  .input-existing-table .badge {
    margin-inline: 0;
  }

  .input-existing-table .evidence-upload-button {
    width: auto;
    max-width: 132px;
    min-height: 34px;
    margin: 3px 0 0 2px;
    padding: 6px 9px;
    font-size: 9px;
    white-space: nowrap;
  }

  .topbar h1 {
    font-size: 16px;
  }

  .topbar .eyebrow {
    display: none;
  }

  .updated-at {
    display: none;
  }

  .page-container {
    padding: 19px 15px 40px;
  }

  .topbar {
    padding: 10px 15px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .section-heading h2 {
    font-size: 21px;
  }

  .heading-actions {
    width: 100%;
  }

  .heading-actions .button {
    flex: 1;
  }

  .kpi-grid,
  .kpi-grid-five {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .safety-incident-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .safety-performance-grid,
  .safety-manpower-grid {
    grid-template-columns: 1fr;
  }

  .inspection-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-card {
    min-height: 121px;
    padding: 14px;
  }

  .kpi-value {
    font-size: 23px;
  }

  .two-columns,
  .three-columns {
    grid-template-columns: 1fr;
  }

  .three-columns .panel:last-child {
    grid-column: auto;
  }

  .filter-grid,
  .spip-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inspection-filter-panel .filter-grid,
  .safety-filter-panel .filter-grid,
  .spip-filter-panel .spip-filter-grid,
  .sop-filter-panel .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .responsive-panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .table-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .table-tools .search-box {
    grid-column: 1 / -1;
    width: 100%;
  }

  .alert {
    width: calc(100vw - 30px);
    margin-right: 15px;
    margin-left: 15px;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finding-entry-grid > * {
    grid-column: span 1;
  }

  .finding-entry-grid .finding-description,
  .finding-entry-grid .finding-recommendation,
  .finding-entry-grid .finding-note,
  .finding-entry-grid .finding-photo,
  .finding-entry-grid .finding-evidence {
    grid-column: 1 / -1;
  }

  .field-main {
    width: calc(100vw - 26px);
    padding-top: 18px;
  }

  .field-header-inner {
    width: calc(100vw - 26px);
  }

  .form-card {
    padding: 16px;
  }

  .finding-card {
    padding: 16px;
  }
}

@media (max-width: 520px) {
  #page-safety .heading-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #page-safety .compact-field {
    min-width: 0;
  }

  #page-safety .heading-actions .button {
    grid-column: 1 / -1;
    width: 100%;
    padding-right: 10px;
    padding-left: 10px;
  }

  .finding-input-table tr,
  .input-existing-table tr {
    grid-template-columns: 1fr;
  }

  .finding-input-table td:nth-child(3),
  .finding-input-table td:nth-child(4),
  .finding-input-table td:nth-child(5),
  .finding-input-table td:nth-child(8),
  .input-existing-table td:nth-child(4),
  .input-existing-table td:nth-child(6),
  .input-existing-table td:nth-child(12) {
    grid-column: auto;
  }

  .inspection-detail-table tr {
    grid-template-columns: 1fr;
  }

  .inspection-detail-table td:nth-child(4),
  .inspection-detail-table td:nth-child(6),
  .inspection-detail-table td:nth-child(11) {
    grid-column: auto;
  }

  .kpi-grid,
  .kpi-grid-five {
    grid-template-columns: 1fr 1fr;
  }

  .safety-metric-group {
    padding: 11px;
  }

  .safety-incident-grid,
  .safety-performance-grid,
  .safety-manpower-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    min-height: 115px;
  }

  .kpi-label {
    max-width: 100px;
  }

  .safety-metric-group .kpi-label {
    max-width: none;
  }

  .performance-comparison-card {
    min-height: 215px;
    padding: 15px;
  }

  .performance-card-header {
    flex-direction: column;
  }

  .performance-status {
    align-self: flex-start;
  }

  .performance-comparison-card .performance-number {
    font-size: 29px;
  }

  .kpi-icon {
    width: 31px;
    height: 31px;
  }

  .chart-wrap,
  .chart-wrap.chart-large {
    height: 260px;
    padding: 12px;
  }

  .panel-header {
    padding: 13px 14px;
  }

  .safety-incident-trend-panel .panel-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .incident-simulation-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .chart-filter-hint:not(.active) {
    display: none;
  }

  .chart-filter-hint.active {
    overflow: hidden;
    max-width: 120px;
    text-overflow: ellipsis;
  }

  .filter-panel {
    padding: 14px;
  }

  .filter-grid,
  .spip-filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .search-box {
    width: 170px;
  }

  .panel-header .search-box input {
    font-size: 10px;
  }

  .field-intro h1 {
    font-size: 21px;
  }

  .field-heading-lockup {
    gap: 9px;
  }

  .field-header-logo {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .findings-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .findings-count {
    align-self: flex-end;
  }

  .form-section-heading {
    align-items: flex-start;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .finding-entry-grid > *,
  .finding-entry-grid .finding-description,
  .finding-entry-grid .finding-recommendation,
  .finding-entry-grid .finding-note,
  .finding-entry-grid .finding-photo,
  .finding-entry-grid .finding-evidence {
    grid-column: auto;
  }

  .full-width {
    grid-column: auto;
  }

  .form-card-header.findings-header {
    align-items: flex-start;
  }

  .input-alert-copy {
    display: block;
  }

  .input-alert-copy strong,
  .input-alert-copy span {
    display: block;
  }

  .add-finding-button {
    width: 100%;
  }

  .existing-section-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .existing-section-actions .button {
    width: 100%;
    padding-right: 10px;
    padding-left: 10px;
  }

  .pica-export-modal-card {
    padding: 0;
  }

  .pica-export-modal-header,
  .pica-filter-grid,
  .pica-export-modal-actions {
    padding-right: 20px;
    padding-left: 20px;
  }

  .pica-filter-grid {
    grid-template-columns: 1fr;
  }

  .pica-filter-wide {
    grid-column: auto;
  }

  .pica-export-summary {
    margin-right: 20px;
    margin-left: 20px;
  }

  .pica-export-modal-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .pica-export-modal-actions .button {
    width: 100%;
  }

  .form-submit-bar {
    position: static;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .form-submit-bar .button {
    width: 100%;
  }

  .submit-summary {
    text-align: center;
  }

  .modal-card {
    padding: 28px 20px;
  }

}

@media print {
  .sidebar,
  .topbar,
  .mobile-nav,
  .filter-panel,
  .heading-actions,
  .export-button {
    display: none !important;
  }

  .main-content {
    margin: 0;
    padding-top: 0;
  }

  .page-container {
    padding: 0;
  }

  .panel,
  .kpi-card {
    break-inside: avoid;
    box-shadow: none;
  }
}
