:root {
  color-scheme: light;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f4f6f9;
  color: #1f2937;
}

body {
  margin: 0;
  min-height: 100vh;
}

body.app {
  background-color: #f4f6f9;
}

body.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f2937, #3b82f6);
}

.auth-layout {
  width: 100%;
  max-width: 360px;
  padding: 2.25rem 1.25rem;
}

.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-card {
  background: #ffffff;
  padding: 1.75rem 1.5rem;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
  width: 100%;
  position: relative;
  min-height: 300px;
}

.auth-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.12);
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
}

.auth-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  color: #1f2937;
}

.auth-subtitle {
  text-align: center;
  color: #6b7280;
  margin: 0.5rem 0 2rem 0;
}

.auth-credential-hint {
 background: #f8fafc;
 border: 1px solid #e5e7eb;
 border-radius: 12px;
 padding: 0.75rem 1rem;
 margin: 0.5rem 0 0 0;
 font-size: 0.85rem;
 color: #334155;
}

.auth-credential-hint--outside {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e0e7ff;
}

.auth-credential-hint--outside .auth-credential-hint__block {
  border-top-color: rgba(148, 163, 184, 0.4);
}


.auth-credential-hint__title {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.auth-credential-hint__block {
  padding-top: 0.5rem;
  margin-top: 0.5rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.6);
}

.auth-credential-hint__block:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0.25rem;
}

.auth-credential-hint__role {
  font-weight: 600;
  margin-bottom: 0.2rem;
}


.auth-credential-hint__row {
  display: flex;
  gap: 0.35rem;
}

.auth-footer {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: #e0e7ff;
  width: 100%;
}

.auth-form .form-group {
  margin-bottom: 1.2rem;
}

.auth-timezone {
  position: absolute;
  right: 0.75rem;
  bottom: 0.65rem;
  font-size: 0.65rem;
  color: #94a3b8;
  text-align: right;
  line-height: 1.2;
}

.auth-timezone__title {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.15rem;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
}

.sidebar {
  width: 190px;
  background-color: #1f2937;
  color: #f9fafb;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
}

.brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
  margin-bottom: 2rem;
  display: inline-block;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  color: #e5e7eb;
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
  background-color: rgba(59, 130, 246, 0.2);
  color: #ffffff;
}

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

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 2rem;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.report-actions {
  gap: 0.6rem;
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.report-actions .btn-primary,
.report-actions .btn-secondary,
.report-actions .btn-tertiary {
  align-self: flex-start;
}

.report-actions .btn-primary,
.report-actions .btn-secondary,
.report-actions .btn-tertiary {
  font-size: 0.78rem;
  padding: 0.5rem 0.8rem;
  line-height: 1;
}

.header-title {
  font-size: 1.25rem;
  font-weight: 600;
  white-space: nowrap;
}

.header-title--primary {
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 1.35rem;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #1f2937;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  cursor: pointer;
}

.theme-toggle__label {
  font-weight: 600;
}

.theme-toggle__track {
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: #e5e7eb;
  position: relative;
  transition: background 0.2s ease;
}

.theme-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #111827;
  transition: transform 0.2s ease;
}

.theme-toggle[aria-pressed="true"] .theme-toggle__track {
  background: #111827;
}

.theme-toggle[aria-pressed="true"] .theme-toggle__thumb {
  transform: translateX(16px);
  background: #f9fafb;
}

.user-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.85rem;
  color: #4b5563;
}

.user-id {
  font-weight: 600;
  color: #1f2937;
}

.user-role {
  font-size: 0.75rem;
  color: #6366f1;
}

.logout-form {
  margin: 0;
}

.app-content {
  padding: 2rem;
  flex: 1;
}

body.theme-dark {
  background: #0f172a;
  color: #e2e8f0;
}

body.theme-dark .sidebar {
  background: #0b1220;
  color: #e2e8f0;
  border-right: 1px solid #1f2937;
}

body.theme-dark .nav-item {
  color: #cbd5f5;
}

body.theme-dark .nav-item:hover,
body.theme-dark .nav-item.active {
  background-color: rgba(59, 130, 246, 0.2);
  color: #ffffff;
}

body.theme-dark .app-header {
  background: #0b1220;
  border-bottom-color: #1f2937;
}

body.theme-dark .app-main {
  background: #0f172a;
}

body.theme-dark .app-content {
  background: #0f172a;
}

body.theme-dark .app-footer {
  background: #0b1220;
  border-top: 1px solid #1f2937;
  color: #94a3b8;
}

body.theme-dark .card,
body.theme-dark .table-card,
body.theme-dark .data-table,
body.theme-dark .detail-section .card {
  background: #0b1220;
  color: #e2e8f0;
  border-color: #1f2937;
}

body.theme-dark .card-header,
body.theme-dark .card-header h3 {
  color: #e2e8f0;
}

body.theme-dark .user-id {
  color: #e2e8f0;
}

body.theme-dark .user-role {
  color: #93c5fd;
}

body.theme-dark .btn-tertiary {
  border-color: #334155;
  color: #e2e8f0;
  background: #0b1220;
}

body.theme-dark .btn-tertiary:hover {
  background: #111827;
  border-color: #475569;
}

body.theme-dark .theme-toggle {
  border-color: #334155;
  background: #0b1220;
  color: #e2e8f0;
}

body.theme-dark .theme-toggle__track {
  background: #334155;
}

body.theme-dark .btn-primary {
  background: #2563eb;
  border-color: #1d4ed8;
}

body.theme-dark .btn-secondary {
  background: #1f2937;
  border-color: #374151;
  color: #e2e8f0;
}

body.theme-dark .data-table {
  color: #e2e8f0;
}

body.theme-dark .data-table thead {
  background: #111827;
  color: #e2e8f0;
}

body.theme-dark .data-table th,
body.theme-dark .data-table td {
  border-color: #1f2937;
}

body.theme-dark .data-table tbody tr:hover {
  background: rgba(148, 163, 184, 0.1);
}

body.theme-dark .status-banner {
  background: #111827;
  border-color: #1f2937;
  color: #e2e8f0;
}

body.theme-dark .form-control,
body.theme-dark select,
body.theme-dark textarea {
  background: #0b1220;
  color: #e2e8f0;
  border-color: #1f2937;
}

body.theme-dark .form-control::placeholder,
body.theme-dark textarea::placeholder {
  color: #94a3b8;
}

body.theme-dark .form-control:focus,
body.theme-dark select:focus,
body.theme-dark textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

body.theme-dark .report-body--plain,
body.theme-dark .report-body,
body.theme-dark .report-body--plain p {
  color: #e2e8f0;
}

body.theme-dark .person-card,
body.theme-dark .person-card__details,
body.theme-dark .person-card__detail {
  background: #0b1220;
  color: #e2e8f0;
  border-color: #1f2937;
}

body.theme-dark .person-card__chip {
  background: #111827;
  color: #e2e8f0;
}

body.theme-dark .linked-report-card,
body.theme-dark .attachment-card {
  background: #0b1220;
  border-color: #1f2937;
  color: #e2e8f0;
}

body.theme-dark .linked-report-card__title {
  color: #93c5fd;
}

body.theme-dark .linked-report-card__title:hover,
body.theme-dark .linked-report-card__title:focus-visible {
  color: #bfdbfe;
}

body.theme-dark .attachment-card__badge {
  background: #111827;
  color: #e2e8f0;
}

body.theme-dark .history-modal__dialog,
body.theme-dark .linked-modal__dialog,
body.theme-dark .calendar-note-modal__card {
  background: #0b1220;
  color: #e2e8f0;
  border-color: #1f2937;
}

.app-footer {
  padding: 1.25rem 2rem;
  font-size: 0.85rem;
  color: #6b7280;
  text-align: right;
}

.page-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  max-width: none;
  margin-right: auto;
}

.page-container.compact-ui {
  gap: 0.4rem;
  margin-top: -1.35rem;
  margin-bottom: 1.55rem;
}

.compact-ui .section-header {
  padding-bottom: 0.2rem;
}

.compact-ui .section-header {
  gap: 0.4rem;
  margin-top: 0;
}

.compact-ui .actions {
  gap: 0.6rem;
}

.compact-ui .btn-primary,
.compact-ui .btn-secondary,
.compact-ui .btn-tertiary {
  font-size: 0.78rem;
  padding: 0.5rem 0.8rem;
  line-height: 1;
}

.compact-ui .form-label {
  font-size: 0.7rem;
  margin-bottom: 0.2rem;
}

.compact-ui .form-control {
  height: 28px;
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
  line-height: 1.15;
}

.compact-ui .detail-list dt {
  font-size: 0.7rem;
}

.compact-ui .detail-list dd {
  font-size: 0.85rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.section-header h2,
.section-header h1 {
  margin: 0;
}

.section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section--tight {
  gap: 0.35rem;
}

.page-container .section + .section {
  margin-top: 1.5rem;
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.detail-section__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}

.detail-section--a4 {
  max-width: 100%;
}

.detail-section--involved {
  width: 1050px;
  max-width: 1050px;
}

.detail-section--involved .card {
  width: 1050px;
  max-width: 1050px;
}

.grid {
  display: grid;
  gap: 1.25rem;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.category-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  background: #ffffff;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.card--compact {
  padding: 0.85rem 1rem;
}

.card--compact h2 {
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-card h3 {
  margin: 0;
  font-size: 0.95rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-value {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
}

.category-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.card-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.badge {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.card-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 0;
}

.card-metrics div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.card-metrics dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #9ca3af;
}

.card-metrics dd {
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
}

.table-card {
  overflow-x: auto;
  padding: 0;
}

.report-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  padding: 1.25rem;
}

.report-chart__header h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}

.report-chart__body {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin-top: 0.6rem;
}

.report-chart__canvas {
  position: relative;
  width: 176px;
  height: 176px;
  display: grid;
  place-items: center;
}

.report-chart__canvas canvas {
  width: 176px;
  height: 176px;
}

.report-chart__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  color: #6b7280;
  text-align: center;
  padding: 1rem;
}

.report-chart__empty[hidden] {
  display: none;
}

.report-chart__legend {
  display: grid;
  gap: 0.4rem;
  min-width: 160px;
  font-size: 0.9rem;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.legend-value {
  margin-left: auto;
  font-weight: 600;
}

.legend-total {
  margin-top: 0.35rem;
  font-weight: 700;
}

.legend-swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  display: inline-block;
}

.legend-swatch--daily {
  background: #2563eb;
}

.legend-swatch--incident {
  background: #f97316;
}

.legend-swatch--visitor {
  background: #22c55e;
}

@media (max-width: 720px) {
  .report-chart__body {
    flex-direction: column;
    align-items: flex-start;
  }

  .report-chart__canvas {
    width: 144px;
    height: 144px;
  }

  .report-chart__canvas canvas {
    width: 144px;
    height: 144px;
  }
}

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

.data-table thead {
  background: #f3f4f6;
  text-transform: none;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

.data-table th,
.data-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.status-pill--open {
  background: #d1fae5;
  color: #065f46;
}

.status-pill--pending {
  background: #fef3c7;
  color: #92400e;
}

.status-pill--closed {
  background: #fee2e2;
  color: #991b1b;
}

body.theme-dark .status-pill--open {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

body.theme-dark .status-pill--pending {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}

body.theme-dark .status-pill--closed {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.data-table--compact {
  font-size: 0.78rem;
}

.data-table--compact th,
.data-table--compact td {
  padding: 0.55rem 0.85rem;
}

.data-table--patrons th,
.data-table--patrons td {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.data-table--reports {
  font-size: 0.85rem;
  table-layout: fixed;
}

.data-table--reports th,
.data-table--reports td {
  padding: 0.35rem 0.6rem;
  font-size: 0.82rem;
}

.data-table--reports td {
  vertical-align: top;
  word-break: break-word;
}

.data-table--reports th:nth-child(1) {
  width: 18%;
}

.data-table--reports th:nth-child(2),
.data-table--reports th:nth-child(9) {
  width: 10%;
}

.data-table--reports .cell-title {
  margin-bottom: 0.15rem;
  line-height: 1.2;
}

.data-table--reports .report-snippet {
  margin-top: 0.05rem;
  line-height: 1.2;
}

.data-table--reports .report-snippet > div + div {
  margin-top: 0.1rem;
}

.data-table--reports tbody tr.report-row--pending {
  background-color: #fff8d0;
}

.data-table--reports tbody tr.report-row--pending:hover {
  background-color: #fff2b0;
}

.data-table--reports tbody tr.report-row--closed {
  background-color: #f1f3f5;
}

.data-table--reports tbody tr.report-row--closed:hover {
  background-color: #e2e6ea;
}

body.theme-dark .data-table--reports tbody tr.report-row--pending {
  background-color: rgba(245, 158, 11, 0.12);
}

body.theme-dark .data-table--reports tbody tr.report-row--pending:hover {
  background-color: rgba(245, 158, 11, 0.18);
}

body.theme-dark .data-table--reports tbody tr.report-row--closed {
  background-color: rgba(148, 163, 184, 0.1);
}

body.theme-dark .data-table--reports tbody tr.report-row--closed:hover {
  background-color: rgba(148, 163, 184, 0.16);
}

body.theme-dark .data-table--handover tbody tr:nth-child(even) {
  background-color: rgba(148, 163, 184, 0.06);
}

body.theme-dark .data-table--handover tbody tr:nth-child(odd) {
  background-color: transparent;
}

.handover-shift-cell {
  text-align: center;
  font-weight: 600;
}

.data-table--handover th:nth-child(1),
.data-table--handover td:nth-child(1) {
  width: 28%;
}

.data-table--handover th:nth-child(2),
.data-table--handover td:nth-child(2),
.data-table--handover th:nth-child(5),
.data-table--handover td:nth-child(5) {
  width: 18%;
}

.data-table--handover th:nth-child(3),
.data-table--handover td:nth-child(3),
.data-table--handover th:nth-child(4),
.data-table--handover td:nth-child(4) {
  width: 18%;
}

.data-table--visitor th:nth-child(1),
.data-table--visitor td:nth-child(1) {
  width: 18%;
}

.data-table--visitor th:nth-child(2),
.data-table--visitor td:nth-child(2),
.data-table--visitor th:nth-child(3),
.data-table--visitor td:nth-child(3) {
  width: 16%;
}

.data-table--visitor th:nth-child(4),
.data-table--visitor td:nth-child(4),
.data-table--visitor th:nth-child(5),
.data-table--visitor td:nth-child(5) {
  width: 16%;
}

.data-table--visitor th:nth-child(6),
.data-table--visitor td:nth-child(6),
.data-table--visitor th:nth-child(7),
.data-table--visitor td:nth-child(7) {
  width: 17%;
}

.data-table--handover td {
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: #f9fafb;
}

body.theme-dark .data-table tbody tr:hover {
  background: rgba(148, 163, 184, 0.12);
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.78rem;
}

.table-pagination__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table-pagination .disabled {
  opacity: 0.5;
  pointer-events: none;
}

.split-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.split-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

@media (max-width: 1100px) {
  .split-section {
    grid-template-columns: 1fr;
  }
}

.patron-avatar {
  width: 75px;
  height: 75px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.patron-avatar img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center;
  background: transparent;
  display: block;
}

.patron-avatar a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.patron-avatar__placeholder {
  font-weight: 600;
  font-size: 1.1rem;
  color: #4b5563;
}

.profile-avatar {
  width: 96px;
  height: 96px;
}

.patron-member-name {
  font-weight: 600;
  word-break: break-word;
}

.data-table--patrons tbody tr.patron-row--banned {
  background: #fdeaea;
}

.data-table--patrons tbody tr.patron-row--banned:hover {
  background: #f9dede;
}

.patron-card--banned {
  background: #fdeaea;
}

.patron-ban-flag {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b91c1c;
}

.patron-name-line {
  display: block;
  line-height: 1.2;
}

.patron-photo-cell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
  padding-left: 0.25rem;
}

.employee-photo-cell {
  width: auto;
}

.employee-avatar {
  width: 75px;
  height: 75px;
}

.employee-row--terminated {
  background: #9ca3af;
  color: #374151;
  position: relative;
}

.employee-row--terminated td {
  color: #374151;
}

.employee-row--terminated a {
  color: #374151;
}

.employee-row--terminated .terminated-flag {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.employee-card--terminated {
  background: #d1d5db;
  color: #374151;
}

.employee-card--terminated .muted {
  color: #6b7280;
}

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

.photo-input {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.photo-input__controls {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.photo-choice {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.profile-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.cell-title a {
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
}

.cell-title a:hover {
  text-decoration: underline;
}

.report-snippet {
  margin-top: 0.15rem;
  color: #6b7280;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.muted {
  font-size: 0.8rem;
  color: #9ca3af;
}

.table-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.table-actions--pager {
  margin-top: 0.75rem;
  justify-content: center;
}

.pager-page {
  min-width: 0.4rem;
  padding-left: 0.1rem;
  padding-right: 0.1rem;
}

.pager-page.is-active {
  background: #e5e7eb;
  color: #111827;
  cursor: default;
  pointer-events: none;
}

.empty {
  text-align: center;
  color: #6b7280;
}

.btn-primary,
.btn-secondary,
.btn-tertiary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
}

.btn-xs {
  padding: 0.3rem 0.6rem;
  font-size: 0.7rem;
  border-radius: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
  background: #111827;
  color: #ffffff;
}

.btn-tertiary {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.btn-tertiary:hover,
.btn-primary:hover {
  opacity: 0.9;
}

.link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.link:hover {
  text-decoration: underline;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.02em;
  color: #6b7280;
  display: block;
  margin-bottom: 0.35rem;
}

.form-control,
select,
textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  color: #1f2937;
  box-sizing: border-box;
}

select.form-control:has(option:checked[value=""]) {
  color: #9ca3af;
  font-size: 0.8rem;
}

select.form-control:has(option:checked:not([value=""])) {
  color: #1f2937;
  font-size: 0.95rem;
}

.form-control:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(37, 99, 235, 0.2);
  border-color: #2563eb;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.person-linker {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.person-linker__title {
  font-weight: 600;
  font-size: 0.95rem;
}

.person-linker__intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.person-linker__question {
  font-size: 0.8rem;
  color: #6b7280;
}

.person-linker__selected-summary {
  font-size: 0.75rem;
  color: #9ca3af;
}

.person-summary-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.person-card__details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 0.6rem !important;
  row-gap: 0.3rem;
  justify-content: start;
}

.person-card__detail {
  display: grid;
  gap: 0.15rem;
  font-size: 0.75rem;
  color: #6b7280;
  min-width: 0;
  word-break: break-word;
  align-content: start;
}

.person-card__detail span:first-child {
  font-size: 0.7rem;
  color: #9ca3af;
  min-width: 110px;
  display: inline-block;
}

.person-card__detail span:last-child {
  white-space: pre-wrap;
}

.person-card__detail--span-2 {
  grid-column: span 2;
}

.person-card__detail--span-3 {
  grid-column: span 3;
}

.person-card__detail--span-4 {
  grid-column: span 4;
}

.person-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
  width: 100%;
  justify-content: flex-start;
}

.person-card__chip {
  background: #e5e7eb;
  border-radius: 9999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.65rem;
  display: inline-flex;
  align-items: center;
  color: #374151;
}

.person-card__notes {
  white-space: pre-wrap;
  color: #374151;
}

.person-card--summary .person-card__action .btn-tertiary {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
}

.person-linker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.person-linker__grid[hidden] {
  display: none !important;
}

.people-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

.people-modal.open {
  display: flex;
}

.people-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
}

.people-modal__dialog {
  position: relative;
  background: #ffffff;
  border-radius: 1rem;
  width: min(720px, 92vw);
  max-height: 85vh;
  padding: 1.1rem;
  display: grid;
  gap: 0.85rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
  overflow: auto;
}

.people-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.people-modal__title {
  font-weight: 700;
  font-size: 1rem;
}

.people-modal__close {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
}

.people-modal__tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.people-tab {
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  color: #374151;
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.people-tab.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.people-modal__section {
  display: grid;
  gap: 0.5rem;
}

.people-modal__section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #4b5563;
}

.person-panel {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.75rem;
  background: #ffffff;
  display: grid;
  gap: 0.6rem;
}

.person-panel__header {
  display: grid;
  gap: 0.5rem;
}

.person-panel__title {
  font-weight: 600;
  font-size: 0.9rem;
}

.person-panel__results,
.person-panel__selected {
  display: grid;
  gap: 0.5rem;
}

.person-empty {
  font-size: 0.75rem;
  color: #9ca3af;
}

.person-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.5rem;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
}

.person-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #6b7280;
  overflow: hidden;
}

.person-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-card.person-card--summary .person-card__avatar img {
  object-fit: contain;
  background: #f3f4f6;
}

.person-card__info {
  min-width: 0;
}

.person-card__title {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.1rem;
}

.person-card__status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.1rem;
}

.person-card__flag {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: #f3f4f6;
  color: #374151;
}

.person-card__flag--ban {
  background: #fdeaea;
  color: #b91c1c;
}

.person-card__flag--terminated {
  background: #e5e7eb;
  color: #374151;
}

.person-card__meta {
  font-size: 0.7rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-card__action {
  display: flex;
  align-items: center;
  justify-self: end;
}

.person-card--banned {
  background: #fdeaea;
}

.person-card--terminated {
  background: #e5e7eb;
}

.person-card.person-card--summary {
  grid-template-columns: 85px 90px minmax(0, 1fr) max-content;
  align-items: start;
  column-gap: 0.35rem;
  padding-right: 0.1rem;
}

.person-card.person-card--summary .person-card__avatar {
  width: 90px;
  height: 90px;
  border-radius: 12px;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.person-card__role {
  display: flex;
  align-items: center;
  align-self: center;
}

.person-card__role .form-control {
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  width: 85px;
}

.person-role-select {
  font-size: 0.7rem;
  padding: 0.3rem 0.5rem;
}

.compact-ui .person-role-select {
  font-size: 0.6rem;
  padding: 0.2rem 0.35rem;
  height: 26px;
}

.person-role-display {
  font-size: 0.85rem;
}

.person-card.person-card--summary .person-card__info {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
  justify-self: start;
  width: 100%;
}

.person-card.person-card--summary .person-card__action .btn-tertiary {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
}

.person-list {
  display: grid;
  gap: 0.5rem;
}

.person-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 0.5rem;
  padding: 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #ffffff;
  align-items: center;
}

.person-item__avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #6b7280;
  overflow: hidden;
}

.person-item__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-item__info {
  min-width: 0;
}

.person-item__name {
  font-weight: 600;
  font-size: 0.85rem;
}

.person-item__meta {
  font-size: 0.7rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.remember-row {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.form-check-input {
  width: 1rem;
  height: 1rem;
}

.filter-form {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.filter-grid--directory .filter-field--search {
  max-width: 200px;
}

.filter-grid--directory .filter-field--search .form-control {
  width: 100%;
  max-width: 200px;
  height: 34.52px;
}

.filter-grid--directory-inline {
  grid-template-columns: max-content max-content;
  align-items: end;
  justify-content: flex-start;
  column-gap: 0.5rem;
}

.filter-grid--directory-inline .filter-field--search {
  max-width: 220px;
}

.filter-grid--directory-inline .filter-field--search .form-control {
  max-width: 220px;
}

.filter-grid--directory-inline .filter-actions--inline {
  margin-bottom: 0.05rem;
}

.filter-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(140px, max-content));
  justify-content: flex-start;
  align-items: end;
  row-gap: 0.5rem;
  column-gap: 1rem;
}

.filter-grid--logs {
  grid-template-columns: repeat(auto-fit, minmax(140px, max-content));
  align-items: end;
  column-gap: 1rem;
  row-gap: 0.5rem;
}

.filter-grid--logs .filter-field--range .form-control {
  width: 180px;
  max-width: 180px;
  height: 34.52px;
}

.filter-grid--logs .incident-datetime-input {
  width: 180px;
  min-width: 180px;
  font-size: 0.85rem;
  padding-left: 0.55rem;
  padding-right: 2rem;
}

.filter-grid--logs .filter-field--search {
  margin-left: -38px;
}

.filter-grid--logs .filter-field--search .form-control {
  width: 200px;
  max-width: 200px;
  height: 34.52px;
  margin-right: 0;
}

.filter-grid--logs select.form-control {
  max-width: 140px;
}

.filter-grid--logs .filter-field--status {
  width: 102px;
  max-width: 102px;
  min-height: auto;
}

.filter-grid--logs .filter-field--status .form-label {
  width: 102px;
  height: auto;
  line-height: normal;
}

.filter-grid--logs select[name="Status"] {
  width: 102px;
  max-width: 102px;
  height: 34.52px;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.incident-grid {
  display: grid;
  gap: 0.75rem;
}

.incident-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(140px, max-content));
  align-items: end;
}

.incident-grid--wide {
  grid-template-columns: repeat(auto-fit, minmax(150px, max-content));
  align-items: end;
}

.incident-status {
  width: 102px;
  max-width: 102px;
}

.incident-row {
  display: grid;
  gap: 0.75rem;
  align-items: end;
}

.incident-row--two {
  grid-template-columns: minmax(220px, 1fr) minmax(140px, max-content);
}

.incident-row--five {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  column-gap: 0.5rem;
  row-gap: 0.35rem;
}

.incident-meta__header {
  margin-bottom: 0.35rem;
}

.incident-meta__header--aligned {
  grid-template-columns: repeat(4, 170px);
  align-items: center;
}

.incident-meta__primary {
  display: grid;
  grid-template-columns: repeat(4, 170px);
  gap: 1rem;
  align-items: end;
}

.incident-meta__primary:not(.incident-meta__primary--daily) {
  grid-template-columns: repeat(4, 170px);
}

.incident-meta__primary--daily {
  grid-template-columns: repeat(3, 170px);
}

.incident-meta {
  font-size: 0.85rem;
}

.incident-meta .form-label {
  font-size: 0.7rem;
  margin-bottom: 0.2rem;
}

.incident-meta .form-control {
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
  line-height: 1.15;
  height: 28px;
  width: 170px;
}

.incident-meta select.form-control,
.incident-meta select.form-control:has(option:checked[value=""]),
.incident-meta select.form-control:has(option:checked:not([value=""])) {
  font-size: 0.85rem;
}

.incident-meta .handover-title-display,
.incident-meta .incident-status-input {
  height: 28px;
}

.incident-meta .visitor-department-field,
.incident-meta .visitor-department-field .form-control {
  width: 170px;
  max-width: 170px;
}

.incident-meta .visitor-department-field .form-control {
  min-width: 170px;
}

.incident-meta__header {
  margin-bottom: 0.2rem;
  gap: 0.5rem;
}

.incident-meta__primary {
  gap: 0.5rem;
}

.incident-row--visitor-three {
  grid-template-columns: repeat(3, 170px);
  gap: 0.5rem 0.5rem;
}

.incident-row--visitor-four {
  grid-template-columns: repeat(4, 170px);
  gap: 0.5rem 0.5rem;
}

.incident-row--visitor-two {
  grid-template-columns: repeat(2, 170px);
  gap: 0.5rem 0.5rem;
}

.incident-meta--visitor .form-control,
.incident-meta--visitor .handover-title-display {
  width: 170px;
  max-width: 170px;
  color: #1f2937;
}

.incident-meta--visitor .datetime-field {
  width: 170px;
  max-width: 170px;
}

.report-form--compact .incident-meta--visitor .form-control {
  height: 28px;
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
  line-height: 1.15;
}

.incident-field-stack {
  gap: 0.35rem;
}

.incident-field-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.incident-meta__secondary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  column-gap: 0.85rem;
  row-gap: 0.35rem;
  align-items: end;
  margin-top: 0.35rem;
}

.incident-row--daily-header {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.incident-status .incident-status-input {
  width: 102px;
  max-width: 102px;
  height: 28px;
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}

.incident-field--narrow .form-control {
  width: 170px;
  max-width: none;
  min-width: 170px;
  height: 28px;
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}

.incident-field--area .form-control,
.incident-field--location .form-control {
  width: 170px;
  max-width: none;
  min-width: 170px;
}

.incident-daily-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  grid-template-areas:
    "start end category"
    "area location .";
  column-gap: 1rem;
  row-gap: 0.75rem;
  align-items: end;
}

.incident-daily-grid--daily-log {
  grid-template-columns: repeat(4, 170px);
  column-gap: 0.5rem;
  grid-template-areas: "start end category location";
}

.incident-daily-field--start {
  grid-area: start;
}

.incident-daily-field--end {
  grid-area: end;
}

.incident-daily-field--category {
  grid-area: category;
}

.incident-daily-field--area {
  grid-area: area;
}

.incident-daily-field--location {
  grid-area: location;
}

.incident-daily-grid .incident-category-input {
  width: 100%;
  max-width: none;
}

.daily-log-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  column-gap: 0.75rem;
  row-gap: 0.5rem;
  align-items: end;
}

.daily-log-meta .form-group--compact {
  min-width: 200px;
}

.daily-log-location .form-control {
  max-width: none;
  width: 100%;
}

.incident-category-input {
  width: 170px;
  max-width: 170px;
  height: 28px;
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
}

.datetime-field {
  position: relative;
  width: 100%;
}

.incident-datetime-input {
  width: 100%;
  min-width: 160px;
  height: 34.52px;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  padding-right: 2.5rem;
  font-size: 0.85rem;
  color: #1f2937;
}

.incident-meta__primary .incident-datetime-input {
  width: 160px;
  max-width: 160px;
}

.incident-meta__primary .datetime-field {
  width: 160px;
  max-width: 160px;
}

.incident-datetime-input::placeholder {
  font-size: 0.75rem;
  color: #9ca3af;
}

.visitor-datetime-field {
  width: 170px;
  max-width: 170px;
}

.visitor-datetime-field .incident-datetime-input {
  width: 170px;
  max-width: 170px;
  min-width: 170px;
}

.visitor-datetime-field .incident-datetime-input::placeholder {
  font-size: 0.75rem;
}

.datetime-picker-trigger {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #9ca3af;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  height: 1.5rem;
  width: 1.5rem;
}

.datetime-picker-trigger:hover,
.datetime-picker-trigger:focus-visible {
  color: #2563eb;
}

.datetime-picker-trigger__icon {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.date-time-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  width: 260px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
  padding: 0.75rem;
  display: none;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 30;
}

.date-time-panel.is-open {
  display: flex;
}

.date-time-panel__row,
.date-time-panel__time-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.date-time-panel__time-row {
  align-items: flex-end;
}

.date-time-panel__label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.date-time-panel__date {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.45rem 0.5rem;
  font-size: 0.9rem;
}

.date-time-panel__date:focus,
.date-time-panel__time-input:focus {
  outline: 3px solid rgba(37, 99, 235, 0.25);
  border-color: #2563eb;
}

.date-time-panel__time-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.date-time-panel__time-input {
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.4rem 0.45rem;
  text-align: center;
  font-size: 0.95rem;
  width: 100%;
}

.date-time-panel__separator {
  font-weight: 600;
  padding-bottom: 0.4rem;
  color: #4b5563;
}

.date-time-panel__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.date-time-panel__button {
  border: none;
  border-radius: 0.6rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: #e5e7eb;
  color: #374151;
}

.date-time-panel__button--apply {
  background: #2563eb;
  color: #ffffff;
}

.date-time-panel__button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.3);
  outline-offset: 2px;
}

.filter-actions {
  display: flex;
  gap: 0.75rem;
}

.filter-actions--logs {
  align-self: end;
  margin: 0;
  gap: 0.5rem;
}

.filter-actions .btn-primary,
.filter-actions .btn-tertiary {
  height: 34.52px;
  max-height: 34.52px;
  min-height: 34.52px;
  padding-top: 0;
  padding-bottom: 0;
}

.filter-actions--inline {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.filter-form--compact .filter-date-field {
  max-width: 180px;
}

.filter-form--compact .form-group {
  margin-bottom: 0.15rem;
}

.filter-form--compact .filter-field {
  min-width: 0;
}

.filter-form--compact .filter-field--range .form-control {
  max-width: 180px;
}

.filter-form--compact .filter-field--search .form-control {
  min-width: 200px;
}

.filter-grid--compact .filter-field--range .form-control {
  width: 180px;
  max-width: 180px;
  height: 34.52px;
}

.filter-grid--compact .filter-field--search .form-control {
  width: 200px;
  max-width: 200px;
  height: 34.52px;
}

.filter-date-field {
  position: relative;
  display: block;
}

.filter-date-field .form-control {
  width: 100%;
  font-size: 0.85rem;
  color: #1f2937;
}

.filter-date-field .form-control::placeholder {
  font-size: 0.75rem;
  color: #9ca3af;
}

.filter-field--search .form-control {
  font-size: 0.85rem;
  color: #1f2937;
}

.filter-field--search .form-control::placeholder {
  font-size: 0.75rem;
  color: #9ca3af;
}

.filter-date-field--picker .form-control {
  padding-right: 2.85rem;
}

.filter-date-field--picker .date-picker-trigger {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  border-radius: 999px;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease, transform 0.15s ease;
}

.filter-date-field--picker .date-picker-trigger:hover,
.filter-date-field--picker .date-picker-trigger:focus {
  color: #1d4ed8;
  transform: translateY(-50%) scale(1.05);
}

.filter-date-field--picker .datetime-picker-trigger {
  transform: translateY(-50%);
}

.filter-date-field--picker .date-picker-trigger:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.3);
  outline-offset: 2px;
}

.date-picker-trigger__icon {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.date-picker-native {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  border: 0;
  padding: 0;
  margin: 0;
}

.btn-tertiary:focus,
.btn-primary:focus {
  outline: 3px solid rgba(37, 99, 235, 0.3);
  outline-offset: 2px;
}

@media (max-width: 960px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nav-item {
    flex: 1 0 45%;
    text-align: center;
  }

  .app-content {
    padding: 1.5rem;
  }
}


.text-danger {
  color: #dc2626;
  font-size: 0.85rem;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
}

.form-subheading {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.detail-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.detail-list div {
  display: grid;
  gap: 0.25rem;
}

.detail-list dt {
  font-size: 0.75rem;
  text-transform: none;
  color: #9ca3af;
  margin: 0;
}

.detail-list dd {
  margin: 0;
  font-weight: 600;
}

.detail-list--inline {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.detail-list--inline dt {
  font-size: 0.95rem;
  color: #4b5563;
}

.detail-list--inline dd {
  font-size: 1.1rem;
}

.handover-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
  gap: 1.1rem;
  align-items: flex-start;
}

.handover-layout--edge {
  grid-template-columns: minmax(0, 1fr);
}

.handover-layout--edge .handover-main {
  grid-column: 1;
  grid-row: 1;
  padding-right: 170px;
}

.handover-layout--edge .handover-history {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
}

.handover-main > * + * {
  margin-top: 1.5rem;
}

.handover-history {
  position: sticky;
  top: 1.25rem;
}

.history-panel {
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.detail-list--incharge dt {
  text-transform: none;
}

.handover-meta {
  margin-top: 0.1rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.handover-meta span {
  font-weight: 600;
  text-transform: none;
}

.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-list--compact .history-entry {
  padding: 0.75rem 0.85rem;
}

.history-entry {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  background: #f9fafb;
  text-align: left;
  cursor: pointer;
  transition: border 0.2s ease, background 0.2s ease;
}

.history-entry:hover {
  border-color: #94a3b8;
}

.history-entry.active {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
}

.history-entry__action {
  margin: 0;
  font-weight: 600;
}

.history-entry__time {
  font-size: 0.85rem;
  color: #6b7280;
}

.history-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.history-modal.open {
  display: flex;
}

.history-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.history-modal__dialog {
  position: relative;
  background: #ffffff;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.25);
  width: min(760px, 90vw);
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.history-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6b7280;
}

.history-modal__timestamp {
  font-size: 0.9rem;
  color: #6b7280;
}

.history-modal__body {
  background: transparent;
  color: #111827;
  padding: 0;
  border-radius: 0;
  white-space: pre-wrap;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.export-range {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.export-range__quick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem 0.75rem;
  font-size: 0.95rem;
}

.export-range__quick label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.export-range__custom {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.export-range__actions {
  margin-top: 0.75rem;
}

@media (max-width: 960px) {
  .handover-layout {
    grid-template-columns: 1fr;
  }

  .handover-history {
    position: static;
  }

  .handover-main > * + * {
    margin-top: 1.25rem;
  }
}

.entity-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.announcement-list {
  gap: 0.6rem;
}

.announcement-list--scroll {
  max-height: none;
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.25rem;
  scrollbar-gutter: stable;
}

.announcement-index {
  margin-right: 0.4rem;
  color: #6b7280;
  font-weight: 600;
}

.announcement-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: stretch;
}

.announcement-left {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 100%;
}

.announcement-calendar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: -2.1rem;
  height: 100%;
}

.calendar-card .calendar-header,
.calendar-note-list__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.calendar-card {
  margin-top: -0.35rem;
}

.calendar-header {
  margin-top: -0.25rem;
  align-items: center;
}

.calendar-header__left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calendar-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calendar-months {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.calendar-month__title {
  font-weight: 600;
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  font-size: 0.55rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.calendar-weekdays span {
  text-align: center;
}

.calendar-grid {
  gap: 0.15rem;
}

.calendar-cell {
  border-radius: 0.4rem;
  background: #f9fafb;
  padding: 0.15rem;
  min-height: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  border: 1px solid #e5e7eb;
  cursor: pointer;
}

.calendar-cell--muted {
  background: #f3f4f6;
  color: #9ca3af;
}

.calendar-cell--today {
  border-color: #3b82f6;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.calendar-cell--active {
  background: #e0e7ff;
  border-color: #4f46e5;
}

.calendar-cell--noted {
  background: #fff7ed;
  border-color: #fb923c;
}

.calendar-date {
  font-size: 0.6rem;
  font-weight: 600;
}

.calendar-note-dot {
  font-size: 0.55rem;
  background: #2563eb;
  color: #fff;
  border-radius: 999px;
  padding: 0 0.35rem;
  line-height: 1.3;
}

.calendar-note-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-note-modal[hidden] {
  display: none !important;
}

.calendar-note-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.calendar-note-modal__card {
  position: relative;
  background: #fff;
  border-radius: 0.75rem;
  padding: 1rem;
  width: min(360px, 90vw);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  z-index: 1;
}

.calendar-note-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.calendar-note-modal__body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.calendar-note-modal__item {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.5rem;
  background: #f9fafb;
}

.calendar-note-modal__by {
  margin-top: 0.35rem;
  font-size: 0.7rem;
  color: #6b7280;
}
.calendar-note-list__items {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.calendar-note-actions {
  display: flex;
  justify-content: flex-end;
}

.calendar-note-list__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calendar-note-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.5rem;
}

.calendar-note-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.calendar-note-item__date {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 600;
}

.announcement-item {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #f9fafb;
  overflow: hidden;
  width: 100%;
}

.announcement-toggle {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.announcement-toggle:hover {
  background: #eef2ff;
}

.announcement-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.announcement-title {
  font-weight: 600;
  color: #111827;
}

.announcement-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  color: #6b7280;
  font-size: 0.56rem;
  justify-content: flex-end;
}

.announcement-meta__line {
  white-space: nowrap;
}

.announcement-content {
  border-top: 1px solid #e5e7eb;
  padding: 0.75rem 0.9rem;
  background: #ffffff;
}

.announcement-body {
  white-space: pre-wrap;
  font-size: 0.85rem;
  color: #374151;
}

.announcement-create {
  border-style: dashed;
}

.announcement-create textarea.form-control {
  height: auto;
  min-height: 120px;
}

.announcement-actions {
  margin-top: 0.6rem;
  display: flex;
  justify-content: flex-end;
}

.announcement-edit {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed #e5e7eb;
}

.announcement-past {
  padding: 1rem;
  width: 100%;
  display: block;
  box-sizing: border-box;
  margin-top: -0.4rem;
}

.announcement-past__summary {
  padding: 0;
  cursor: pointer;
  font-weight: 600;
  color: #374151;
  font-size: 0.85rem;
  margin-bottom: 0.45rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.announcement-past__summary::-webkit-details-marker {
  display: none;
}

.report-body {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 0.75rem;
  white-space: pre-wrap;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
}

.report-body--plain {
  background: transparent;
  color: #111827;
  padding: 0;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  white-space: normal;
  font-size: 14px;
  line-height: 1.5;
}

.report-body--plain p {
  margin: 0 0 0.7rem 0;
}

.report-body--plain ul,
.report-body--plain ol {
  margin: 0.5rem 0 0.5rem 1.25rem;
  padding-left: 1rem;
}

.report-body--plain table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 12px;
}

.report-body--plain table th,
.report-body--plain table td {
  border: 1px solid #d1d5db;
  padding: 0.4rem 0.5rem;
  text-align: left;
}

.handover-editor {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.handover-editor__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  background: #f1f5f9;
  border: 1px solid #cbd5f5;
  border-radius: 0.65rem;
  padding: 0.4rem 0.5rem;
}

.handover-editor__toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.handover-editor__select {
  border: 1px solid #cbd5f5;
  border-radius: 0.5rem;
  padding: 0.15rem 0.35rem;
  font-size: 0.78rem;
  background: #fff;
  color: #1f2937;
  min-width: 70px;
  max-width: 110px;
}

.handover-editor__select--font {
  flex: 0 0 85px;
  max-width: 85px;
}

.handover-editor__select--size {
  flex: 0 0 50px;
  max-width: 50px;
}

.handover-editor__button {
  border: 1px solid #cbd5f5;
  border-radius: 0.5rem;
  padding: 0.2rem 0.4rem;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1f2937;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 28px;
}

.handover-editor__button:hover,
.handover-editor__button:focus-visible {
  border-color: #818cf8;
  color: #1d4ed8;
  outline: none;
}

.handover-editor__color-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.handover-editor__color-toggle {
  border: 1px solid #cbd5f5;
  border-radius: 0.5rem;
  padding: 0.2rem 0.5rem;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1f2937;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 28px;
}

.handover-editor__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.handover-editor__icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.handover-editor__color-panel {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  display: none;
  grid-template-columns: repeat(3, 32px);
  gap: 0.25rem;
  background: #fff;
  border: 1px solid #cbd5f5;
  border-radius: 0.5rem;
  padding: 0.35rem;
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.12);
  z-index: 25;
  min-width: 120px;
}

.handover-editor__color-picker.is-open .handover-editor__color-panel {
  display: grid;
}

.handover-editor__color-option {
  width: 32px;
  height: 28px;
  border: 1px solid #cbd5f5;
  border-radius: 0.35rem;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.handover-editor__color-option--text {
  display: flex;
  align-items: center;
  justify-content: center;
}

.handover-editor__color-option--block {
  width: 32px;
  padding: 0;
  display: inline-flex;
}

.handover-editor__color-option--clear {
  background: repeating-linear-gradient(45deg, #e2e8f0 0, #e2e8f0 6px, #fff 6px, #fff 12px);
}

.handover-editor__color-option:hover,
.handover-editor__color-option:focus-visible,
.handover-editor__color-toggle:hover,
.handover-editor__color-toggle:focus-visible {
  border-color: #818cf8;
  color: #1d4ed8;
  outline: none;
}

.handover-editor__surface {
  min-height: 360px;
  border: 1px solid #cbd5f5;
  border-radius: 0.75rem;
  padding: 0.75rem;
  background: #fff;
  line-height: 1.6;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  color: #111827;
  overflow-y: auto;
}

.handover-editor__surface:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.handover-editor__input {
  display: none !important;
}

.handover-editor-table {
  width: auto;
  max-width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  display: inline-block;
  resize: both;
  overflow: auto;
}

.handover-editor-table td {
  border: 1px solid #d1d5db;
  padding: 0.35rem 0.5rem;
}

.handover-editor__surface table {
  max-width: 100%;
  display: inline-block;
  resize: both;
  overflow: auto;
}

textarea[data-rich-editor="handover"] {
  display: none !important;
}

.card h2 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.actions {
  display: flex;
  gap: 0.75rem;
}

.actions .action--right {
  margin-left: auto;
}

.actions > form {
  margin: 0;
  display: inline-flex;
}

.export-icons {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  color: #374151;
  background: #ffffff;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
}

.btn-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.btn-icon:hover {
  border-color: #cbd5f5;
  background: #f7f9ff;
}

.btn-icon--sm {
  padding: 0.2rem 0.35rem;
  font-size: 0.7rem;
}

.btn-icon--sm svg {
  width: 14px;
  height: 14px;
}

.section-header--simple {
  justify-content: flex-start;
}

.section-header--tight {
  margin-top: -0.8rem;
  margin-bottom: 0.1rem;
}

.compact-ui .filter-form {
  padding-top: 0.9rem;
  margin-top: 0;
}

.section-header--stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.section-header__top,
.section-header__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.section-header--stacked .section-header__body {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.section-header__actions {
  justify-content: flex-start;
}

.section-header__spacer {
  flex: 1;
}

.section-header__top {
  margin-top: -0.2rem;
  margin-bottom: 0;
}

.section-header--simple .actions {
  margin-left: 0;
}

.text-danger:empty {
  display: none;
}

@media (max-width: 640px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .announcement-grid {
    grid-template-columns: 1fr;
  }

  .calendar-months {
    grid-template-columns: 1fr;
  }
}


.status-banner {
  margin-bottom: 1.5rem;
  padding: 0.85rem 1.25rem;
  border-radius: 0.75rem;
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  font-weight: 600;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.handover-attachments {
  grid-column: 1 / -1;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 0.7rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.handover-attachments__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.handover-attachments__hint {
  margin: 0.3rem 0 0 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.handover-attachments__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

.attachment-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 110px));
  gap: 0.2rem;
  justify-content: flex-start;
  margin-top: 0.15rem;
}

.attachment-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.6rem;
  border-radius: 0.85rem;
  border: 1px dashed #cbd5f5;
  background: #fff;
  box-shadow: 0 5px 15px rgba(15, 23, 42, 0.04);
}

.attachment-card__actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.btn-chip {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #1f2937;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.btn-chip:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.linked-report-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.linked-report-card {
  border: 1px solid #d1d5db;
  border-radius: 0.65rem;
  padding: 0.3rem 0.55rem;
  background: #ffffff;
  box-shadow: none;
  flex: 0 1 auto;
  font-size: 0.67rem;
  line-height: 1.2;
}

.linked-report-card__header {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.linked-report-card__title {
  font-weight: 600;
  color: #111827;
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  line-height: 1.2;
}

.linked-report-card__title:hover,
.linked-report-card__title:focus-visible {
  color: #1d4ed8;
}

.linked-report-card__title:focus-visible {
  outline: 2px solid #bfdbfe;
  outline-offset: 2px;
}

.linked-report-card__action {
  border: none;
  background: transparent;
  color: #2563eb;
  font-weight: 500;
  text-decoration: none;
  padding: 0;
  line-height: 1.2;
  white-space: nowrap;
}

.linked-report-card__action:hover {
  text-decoration: underline;
}

.linked-report-card__action:focus-visible {
  text-decoration: underline;
  outline: 2px solid #bfdbfe;
  outline-offset: 1px;
  border-radius: 0.35rem;
}

.linked-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2500;
}

.linked-modal.open {
  display: flex;
}

.linked-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.linked-modal__dialog {
  position: relative;
  background: #ffffff;
  border-radius: 1rem;
  padding: 1.5rem;
  width: min(600px, 90vw);
  box-shadow: 0 35px 80px rgba(15, 23, 42, 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 90vh;
  overflow-y: auto;
}

.linked-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
}

.linked-modal__timestamp {
  color: #6b7280;
  font-size: 0.85rem;
}

.linked-modal__meta {
  color: #374151;
  font-weight: 600;
}

.linked-modal__body {
  background: #f9fafb;
  border-radius: 0.75rem;
  padding: 1rem;
  white-space: pre-wrap;
  color: #111827;
  min-height: 120px;
}

.attachment-card__preview {
  width: 60px;
  height: 60px;
  border-radius: 0.85rem;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.attachment-card__preview--file {
  border: 1px dashed #d1d5db;
}

.attachment-card__preview-link {
  display: block;
}

.attachment-card__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-preview-grid--contain .attachment-card__preview {
  background: #f3f4f6;
}

.attachment-preview-grid--contain .attachment-card__preview img {
  object-fit: contain;
}

.attachment-card__badge {
  font-weight: 700;
  font-size: 0.9rem;
  color: #1d4ed8;
}

.attachment-card__name {
  font-weight: 600;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.65rem;
}

.attachment-card__name--top {
  font-size: 0.7rem;
}

.attachment-card__subline {
  font-size: 0.6rem;
  color: #6b7280;
}

.handover-attachments .attachment-card__name {
  font-size: 0.65rem !important;
}

.handover-attachments .attachment-card__subline {
  font-size: 0.6rem !important;
}

.photo-attachments .attachment-card__preview {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 0.85rem;
}

.photo-attachments .attachment-card__preview a {
  display: block;
  width: 100%;
  height: 100%;
}

.photo-attachments .attachment-card__preview img {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  display: block;
}

.attachment-card__remove {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 3;
}

.attachment-card__remove:hover {
  color: #ef4444;
}

.attachment-card--image .attachment-card__preview {
  border: none;
  padding: 0;
}

.attachment-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 1.25rem;
  border: 1px dashed #cbd5f5;
  border-radius: 0.85rem;
  color: #6b7280;
  background: rgba(59, 130, 246, 0.05);
}

.handover-hidden-inputs {
  display: none;
}

.handover-link-summary {
  grid-column: 1 / -1;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.25rem 0.45rem;
  background: #fafbff;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.handover-link-summary__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.handover-link-summary__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.handover-link-summary__empty {
  padding: 0.2rem 0.4rem;
  border: 1px dashed #c7d2fe;
  border-radius: 0.75rem;
  color: #5b21b6;
  font-size: 0.75rem;
}

.link-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.45rem;
  border-radius: 0.65rem;
  background: #eef2ff;
  color: #312e81;
  font-size: 0.72rem;
  border: 1px solid #c7d2fe;
  min-width: 0;
}

.link-chip__title {
  font-weight: 600;
  font-size: 0.75rem;
  color: #312e81;
  text-align: left;
  cursor: pointer;
  line-height: 1.1;
}

.link-chip__title:focus-visible {
  outline: 2px solid #a5b4fc;
  outline-offset: 1px;
}

.link-chip__remove {
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0;
}

.link-chip__remove:hover {
  color: #ef4444;
}

.handover-link-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2100;
}

.handover-link-modal.open {
  display: flex;
}

.handover-link-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
}

.handover-link-modal__dialog {
  position: relative;
  background: #ffffff;
  border-radius: 1rem;
  width: min(720px, 95vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  box-shadow: 0 35px 80px rgba(15, 23, 42, 0.45);
  overflow: hidden;
}

.handover-link-modal__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.handover-link-modal__header h3 {
  margin: 0;
}

.handover-link-modal__header p {
  margin: 0.25rem 0 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.handover-link-modal__close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
}

.handover-link-modal__search {
  position: relative;
}

.handover-link-modal__list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-right: 0.25rem;
}

.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.85rem;
  padding: 0.75rem 1rem;
  background: #f9fafb;
}

.link-row__info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.link-row__title {
  font-weight: 600;
  color: #111827;
}

.link-row__meta {
  color: #6b7280;
  font-size: 0.85rem;
}

.screenshot-overlay[hidden] {
  display: none;
}

.screenshot-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 2000;
}

.screenshot-overlay img {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(100%, 100vw);
  height: min(100%, 100vh);
  object-fit: contain;
  border-radius: 0.85rem;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.4);
  user-select: none;
  pointer-events: auto;
  display: none;
}

.screenshot-overlay img[data-ready="true"] {
  display: block;
  cursor: crosshair;
}

.screenshot-overlay__selection {
  position: fixed;
  border: 2px dashed #3b82f6;
  background: rgba(59, 130, 246, 0.15);
  pointer-events: none;
}

.screenshot-overlay__toolbar {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1rem;
  background: rgba(15, 23, 42, 0.85);
  color: #f3f4f6;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.screenshot-overlay__note {
  font-size: 0.9rem;
  white-space: nowrap;
}

body.screenshot-overlay-open {
  overflow: hidden;
}

.handover-link-modal-open {
  overflow: hidden;
}

.form-group--compact {
  min-width: 0;
  margin-bottom: 0;
}

.form-group--compact .form-control {
  min-width: 0;
}

.handover-title-display {
  width: min(26ch, 100%);
  min-width: 20ch;
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
  line-height: 1.3;
}

.handover-date-display {
  width: min(18ch, 100%);
  min-width: 14ch;
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
}

.handover-shift-select {
  width: min(9ch, 100%);
  min-width: 7ch;
  padding: 0.4rem 0.55rem;
  font-size: 0.85rem;
}

.report-form--compact input.form-control,
.report-form--compact select.form-control {
  height: 34.52px;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  font-size: 0.95rem;
}

.report-form--compact .handover-title-display,
.report-form--compact .handover-date-display,
.report-form--compact .handover-shift-select {
  height: 34.52px;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  font-size: 0.85rem;
}

.handover-title-group,
.handover-date-group,
.handover-shift-group {
  margin-right: 0;
}

.handover-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.handover-meta .form-group {
  margin-bottom: 0;
}

.handover-meta--inline {
  width: 100%;
}

@media (min-width: 768px) {
  .handover-meta--inline {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) minmax(160px, auto) minmax(120px, auto);
    gap: 0.75rem;
    align-items: end;
  }

  .handover-meta--inline .handover-title-display,
  .handover-meta--inline .handover-date-display,
  .handover-meta--inline .handover-shift-select {
    width: 100%;
    min-width: 0;
  }

  .handover-meta--inline .handover-title-group {
    width: 100%;
    margin-right: 0;
  }

  .handover-meta--inline .handover-date-group,
  .handover-meta--inline .handover-shift-group {
    margin-right: 0;
  }
}

.form-group--body textarea {
  min-height: 320px;
}

.form-hint {
  margin-top: 0.15rem;
  font-size: 0.7rem;
  color: #9ca3af;
}

.handover-link-modal-open {
  overflow: hidden;
}
.form-group--compact {
  min-width: 0;
}

.form-group--compact .form-control {
  min-width: 0;
}
.form-group--body textarea {
  min-height: 320px;
}

.form-section__title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px 16px;
}

.checkbox-item,
.radio-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #1f2937;
}

.period-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
    gap: 16px;
}

.period-grid__quick,
.period-grid__custom {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.date-input--compact {
    max-width: 220px;
}

.dropdown-order-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.dropdown-order-item {
    display: grid;
    grid-template-columns: 1fr 90px 90px;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
}

.dropdown-order-actions {
    display: flex;
    gap: 0.35rem;
    justify-self: end;
}

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

.dropdown-admin-block {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dropdown-order-input {
    width: 70px;
}

.dropdown-order-add {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.dropdown-order-add .form-control {
    min-width: 0;
}

.dropdown-admin-card {
    width: 100%;
    min-width: 240px;
}

.dropdown-admin-form {
    width: 100%;
}
