* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #1a73e8;
  --primary-light: #e8f0fe;
  --danger: #d93025;
  --danger-light: #fce8e6;
  --success: #1e8e3e;
  --success-light: #e6f4ea;
  --warning: #f9ab00;
  --warning-light: #fef7e0;
  --text: #202124;
  --text-secondary: #5f6368;
  --border: #dadce0;
  --bg: #f8f9fa;
  --white: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
.report-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.report-tabs .tab-btn { border: 1px solid var(--border); background: var(--white); border-radius: 999px; padding: 8px 14px; cursor: pointer; color: var(--text-secondary); }
.report-tabs .tab-btn.active { background: var(--primary); border-color: var(--primary); color: var(--white); }
.report-tab-panel { display: none; }
.report-tab-panel.active { display: block; }

.leader-report-panel { border-top: 3px solid var(--primary); }
.leader-report-panel .panel-header { align-items: center; }
.leader-report-panel .panel-header span { color: var(--text-secondary); font-size: 13px; }
.leader-report-toolbar { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.leader-report-toolbar > div { display: flex; flex-direction: column; }
.leader-report-toolbar span { color: var(--text-secondary); font-size: 13px; }
.leader-report-source { padding: 10px 12px; margin-bottom: 14px; border: 1px solid #c9dcfb; border-radius: var(--radius); background: var(--primary-light); color: #174ea6; font-size: 13px; }
.leader-report-editor .data-table input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.report-preview-heading { text-align: center; margin-bottom: 18px; }
.report-preview-heading h3 { margin: 8px 0 2px; font-size: 20px; }
.report-preview-heading p { color: var(--text-secondary); font-size: 13px; }

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

/* Unifound-style top navigation for safety information */
.uf-header {
  height: 46px;
  background: #1958d4;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 44px;
  box-shadow: var(--shadow);
}

.uf-header-left,
.uf-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.uf-logo {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -1px;
}

.uf-title {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  border-left: 1px solid rgba(255,255,255,.35);
  padding-left: 14px;
}

.uf-title strong { font-size: 15px; }
.uf-title span { font-size: 10px; opacity: .78; }
.uf-header-right { font-size: 13px; opacity: .95; }
.uf-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.uf-module-nav {
  min-height: 142px;
  padding: 18px 44px 14px;
  background: linear-gradient(105deg, #eef8ff 0%, #f7fbff 45%, #eef7ff 100%);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 1px solid #e8eef7;
}

.uf-module-group {
  min-width: 214px;
}

.uf-module-group h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1f2d3d;
  margin: 0 0 8px;
}

.uf-module-items {
  display: flex;
  background: rgba(255,255,255,.92);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(31, 45, 61, .08);
  overflow: visible;
}

.uf-module-card {
  width: 78px;
  height: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #4b5563;
  font-size: 13px;
  cursor: default;
  position: relative;
}

.uf-module-card.active {
  color: #1a73e8;
  font-weight: 600;
}

.uf-module-card.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -18px;
  width: 12px;
  height: 12px;
  border-left: 2px solid #111827;
  border-bottom: 2px solid #111827;
  transform: translateX(-50%) rotate(135deg);
  background: transparent;
}

.uf-module-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eaf3ff;
  color: #1a73e8;
  font-size: 17px;
}

.uf-module-card.muted .uf-module-icon {
  color: #777;
  background: #f0f0f0;
}

.uf-more {
  width: 48px;
  height: 78px;
  margin-top: 26px;
  border-radius: 8px;
  background: rgba(255,255,255,.95);
  box-shadow: 0 2px 10px rgba(31, 45, 61, .08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #4b5563;
}

.safety-info-body .content {
  padding-top: 20px;
}

/* Header */
.app-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-left .logo {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 18px;
}

.header-left h1 {
  font-size: 18px;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.notification-badge {
  position: relative;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: background 0.2s;
}

.notification-badge:hover { background: var(--bg); }

.notification-badge .badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--danger);
  color: white;
  font-size: 11px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--bg);
  font-size: 14px;
}

/* Main Layout */
.app-body {
  display: flex;
  flex: 1;
}

/* Sidebar */
.sidebar {
  width: 220px;
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 8px;
}

.sidebar-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  padding: 8px 20px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.nav-parent {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.nav-parent .icon {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

.nav-parent-toggle {
  cursor: pointer;
  padding-bottom: 10px;
  transition: background .15s, color .15s;
}

.nav-parent-toggle:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-chevron {
  margin-left: auto;
  font-size: 16px;
  transition: transform .2s;
}

.nav-parent-toggle[aria-expanded="false"] .nav-chevron {
  transform: rotate(-90deg);
}

.nav-submenu {
  overflow: hidden;
  max-height: 200px;
  transition: max-height .2s ease;
}

.nav-submenu.collapsed {
  max-height: 0;
}

.nav-item--child {
  padding-left: 50px;
  font-size: 13px;
}

.nav-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 500;
}

.nav-item .icon {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
}

/* Content */
.content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 600;
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* Cards & Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
}

.stat-card .stat-value.danger { color: var(--danger); }
.stat-card .stat-value.success { color: var(--success); }
.stat-card .stat-value.warning { color: var(--warning); }
.stat-card .stat-value.primary { color: var(--primary); }

/* Panel */
.panel {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.panel-body {
  padding: 20px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover { background: #1557b0; }

.btn-success {
  background: var(--success);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-outline {
  background: white;
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover { background: var(--bg); }

.btn-sm { padding: 5px 10px; font-size: 12px; }

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.data-table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 13px;
}

.data-table tr:hover td { background: var(--primary-light); }

.knowledge-summary {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--primary-light);
  font-size: 14px;
}

.pha-table {
  min-width: 1600px;
}

.pha-table th,
.pha-table td {
  vertical-align: top;
  line-height: 1.5;
}

.pha-table td:nth-child(3),
.pha-table td:nth-child(4),
.pha-table td:nth-child(5),
.pha-table td:nth-child(7),
.pha-table td:nth-child(8),
.pha-table td:nth-child(9) {
  min-width: 220px;
}

.safety-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: start;
}

.safety-sub-sidebar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 0;
  box-shadow: var(--shadow);
}

.safety-sub-sidebar .nav-item {
  border-left-width: 3px;
}

.safety-main {
  min-width: 0;
}

.safety-basic-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 22px;
  align-items: start;
}

.safety-lab-image {
  height: 140px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e8f0fe, #b7d2ff);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: inset 0 0 30px rgba(255,255,255,.7);
}

.safety-lab-info h3 {
  display: inline-block;
  margin-right: 10px;
  font-size: 20px;
}

.safety-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px 48px;
  margin-top: 14px;
  font-size: 14px;
}

.safety-field-grid label {
  color: var(--text-secondary);
  font-weight: 600;
}

.safety-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.safety-tab-content {
  width: 100%;
  max-width: calc(100vw - 320px);
  overflow-x: auto;
}

.safety-info-body {
  width: 100%;
  overflow-x: hidden;
}

.safety-info-body .content {
  min-width: 0;
}

.hazard-doc-card,
.hazard-one-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  background: var(--white);
}

.hazard-one-card {
  box-shadow: var(--shadow);
}

.hazard-doc-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.hazard-doc-title strong {
  margin-right: 10px;
}

.hazard-summary {
  margin-left: 10px;
  color: var(--text-secondary);
  font-size: 13px;
}

.hazard-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.hazard-tab-btn {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 13px;
}

.hazard-tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.hazard-tab-panel {
  display: none;
}

.hazard-tab-panel.active {
  display: block;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.doc-box {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 13px;
}

.doc-box h4 {
  color: var(--primary);
  margin-bottom: 6px;
}

.doc-box small {
  display: block;
  color: var(--text-secondary);
  margin-top: 8px;
}

.hazard-form-section {
  margin-top: 14px;
}

.hazard-form-section h4 {
  display: inline-flex;
  align-items: center;
  padding-left: 10px;
  margin-bottom: 8px;
  border-left: 3px solid var(--primary);
  color: var(--text);
  font-size: 15px;
}

.compact-table th {
  width: 160px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.compact-table td {
  white-space: normal;
}

.access-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.scl-form-card {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
}

.scl-form-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--primary);
  color: var(--white);
}

.scl-form-title h3 {
  font-size: 22px;
  letter-spacing: 1px;
}

.scl-form-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.scl-form-table th,
.scl-form-table td {
  padding: 7px 8px;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.scl-form-table th:nth-child(1),
.scl-form-table td:nth-child(1) { width: 5%; }
.scl-form-table th:nth-child(2),
.scl-form-table td:nth-child(2) { width: 9%; }
.scl-form-table th:nth-child(3),
.scl-form-table td:nth-child(3) { width: 10%; }
.scl-form-table th:nth-child(4),
.scl-form-table td:nth-child(4) { width: 18%; }
.scl-form-table th:nth-child(5),
.scl-form-table td:nth-child(5) { width: 22%; }
.scl-form-table th:nth-child(6),
.scl-form-table td:nth-child(6) { width: 9%; }
.scl-form-table th:nth-child(7),
.scl-form-table td:nth-child(7) { width: 16%; }
.scl-form-table th:nth-child(8),
.scl-form-table td:nth-child(8) { width: 7%; }
.scl-form-table th:nth-child(9),
.scl-form-table td:nth-child(9) { width: 6%; }

.scl-form-table input,
.scl-form-table select,
.scl-form-table textarea,
.scl-add-area input,
.scl-add-area select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 13px;
}

.scl-form-table textarea {
  min-height: 64px;
  resize: vertical;
}

.scl-add-area {
  border-top: 1px solid var(--border);
  padding: 16px;
  background: var(--bg);
}

.scl-add-area h4 {
  margin-bottom: 12px;
}

.basic-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
  max-width: 1080px;
}

.basic-form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.basic-form-field span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  font-weight: 600;
  color: var(--text);
}

.required-mark {
  color: var(--danger);
  font-style: normal;
  font-weight: 700;
}

.basic-form-field input,
.basic-form-field select,
.basic-form-field textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.basic-form-field input:focus,
.basic-form-field select:focus,
.basic-form-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.basic-form-field textarea {
  min-height: 108px;
  resize: vertical;
}

.basic-form-field:has(textarea) {
  grid-column: span 2;
}

/* Tags / Badges */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.tag-urgent { background: var(--danger-light); color: var(--danger); }
.tag-normal { background: var(--primary-light); color: var(--primary); }
.tag-success { background: var(--success-light); color: var(--success); }
.tag-warning { background: var(--warning-light); color: #b06000; }
.tag-info { background: #e8eaed; color: var(--text-secondary); }

/* Status Dot */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.status-dot.active { background: var(--success); }
.status-dot.pending { background: var(--warning); }
.status-dot.ended { background: var(--text-secondary); }

/* Filters */
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-bar input,
.filter-bar select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.filter-bar input:focus,
.filter-bar select:focus {
  border-color: var(--primary);
}

.activity-page {
  overflow-x: auto;
}

.activity-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fbfdff;
}

.activity-filters label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
}

.activity-filters input,
.activity-filters select {
  min-width: 128px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}

.basic-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
  gap: 12px;
}

.basic-toolbar label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  font-weight: 600;
  color: var(--text);
}

.basic-toolbar input,
.basic-toolbar select {
  width: 100%;
  min-width: 0;
}

.toolbar-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
}

.activity-toolbar {
  margin-bottom: 12px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inline-options {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  min-height: 36px;
  align-items: center;
}

.inline-options label,
.switch-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-weight: 400;
}

.inline-options input,
.switch-line input {
  width: auto;
}

.hidden {
  display: none !important;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.show,
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--white);
  border-radius: 12px;
  width: 90%;
  max-width: 980px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 18px; }

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
}

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Form */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-group textarea { min-height: 80px; resize: vertical; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.activity-form {
  max-width: 620px;
}

.activity-form--wide {
  max-width: 720px;
}

.form-line {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.form-line > label {
  justify-self: end;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.form-line.required > label::before {
  content: "*";
  color: var(--danger);
  margin-right: 2px;
}

.form-line input[type="text"],
.form-line input[type="date"],
.form-line select {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

.date-range,
.inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-range input,
.date-range select {
  max-width: 150px;
}

.inline-actions select {
  max-width: 220px;
}

.person-chips {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.person-chips span {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 82px;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: #fff;
}

.person-chips button {
  border: none;
  background: none;
  color: var(--danger);
  font-size: 18px;
  cursor: pointer;
}

.form-line--textarea {
  align-items: start;
}

.editor-box {
  border: 1px solid var(--border);
  min-height: 230px;
}

.editor-toolbar {
  min-height: 34px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  background: #fff;
}

.editor-box textarea {
  width: 100%;
  min-height: 190px;
  border: none;
  resize: vertical;
  padding: 10px;
  font-family: inherit;
}

.inspection-form {
  max-width: 720px;
}

.check-item-list {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
}

.check-item-card + .check-item-card {
  border-top: 1px solid var(--border);
}

.check-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.check-item-head strong {
  display: block;
  margin-bottom: 4px;
}

.check-item-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.check-item-toggle {
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
}

.check-item-body {
  padding: 0 12px 12px;
}

.compact-line {
  grid-template-columns: 72px minmax(0, 1fr);
  margin: 10px 0 0;
}

.compact-line textarea {
  min-height: 56px;
}

/* Timeline */
.timeline {
  padding: 16px 0;
}

.timeline-item {
  display: flex;
  gap: 12px;
  padding-bottom: 20px;
  position: relative;
}

.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.timeline-content {
  flex: 1;
}

.timeline-content .time {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Charts placeholder */
.chart-container {
  padding: 20px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-bar-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chart-bar-label {
  width: 100px;
  font-size: 13px;
  text-align: right;
  color: var(--text-secondary);
}

.chart-bar-track {
  flex: 1;
  height: 24px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.chart-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 12px;
  color: white;
  font-weight: 500;
}

.chart-bar-fill.primary { background: var(--primary); }
.chart-bar-fill.danger { background: var(--danger); }
.chart-bar-fill.success { background: var(--success); }
.chart-bar-fill.warning { background: var(--warning); }

/* Progress */
.progress-ring {
  display: flex;
  align-items: center;
  gap: 16px;
}

.progress-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  position: relative;
}

/* Detail view */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-item {
  padding: 8px 0;
}

.detail-item .label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.detail-item .value {
  font-size: 14px;
  font-weight: 500;
}

/* Photo placeholder */
.photo-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.photo-thumb {
  width: 80px;
  height: 80px;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 12px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* View toggle */
.view-section { display: none; }
.view-section.active { display: block; }

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.tab-item {
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}

.tab-item:hover { color: var(--primary); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); }
