body {
  min-height: 100vh;
}

.card {
  border-radius: 0.75rem;
}

.table > :not(caption) > * > * {
  padding: 0.85rem 1rem;
}

.image-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.navbar-brand {
  letter-spacing: .1px;
}

.report-editor {
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

.report-readonly {
  white-space: pre-wrap;
  line-height: 1.65;
  min-height: 80px;
}


.app-footer {
  flex-shrink: 0;
}

.about-icon {
  width: 52px;
  height: 52px;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bs-dark);
  color: #fff;
  font-size: 1.4rem;
}

/* Booking availability calendar */
.calendar-scroll {
  overflow-x: auto;
  background: #fff;
}

.booking-calendar {
  display: grid;
  grid-template-columns: 72px repeat(7, minmax(150px, 1fr));
  min-width: 1120px;
  position: relative;
}

.calendar-time-heading,
.calendar-day-heading {
  position: sticky;
  top: 0;
  z-index: 6;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  border-right: 1px solid #dee2e6;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.calendar-day-heading.selected-day {
  background: #e9ecef;
}

.calendar-time-column,
.calendar-day-column {
  position: relative;
  border-right: 1px solid #dee2e6;
}

.calendar-time-label {
  border-bottom: 1px solid #edf0f2;
  padding: 4px 8px 0 0;
  text-align: right;
  color: #6c757d;
  font-size: .75rem;
  box-sizing: border-box;
}

.calendar-day-column.selected-day-bg {
  background: rgba(33, 37, 41, .025);
}

.calendar-slot {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #edf0f2;
  background: transparent;
  padding: 0;
  cursor: pointer;
  box-sizing: border-box;
}

.calendar-slot:hover,
.calendar-slot.slot-selected {
  background: rgba(13, 110, 253, .08);
  outline: 1px solid rgba(13, 110, 253, .3);
  outline-offset: -1px;
}

.calendar-slot-past,
.calendar-slot-past:hover {
  cursor: not-allowed !important;
  opacity: .28;
  background: repeating-linear-gradient(135deg, rgba(108, 117, 125, .12), rgba(108, 117, 125, .12) 6px, rgba(108, 117, 125, .04) 6px, rgba(108, 117, 125, .04) 12px) !important;
  outline: none;
}

.calendar-appointment {
  position: absolute;
  left: 3px;
  right: 3px;
  z-index: 4;
  border-radius: .35rem;
  padding: 3px 6px;
  overflow: hidden;
  text-decoration: none;
  font-size: .72rem;
  line-height: 1.15;
  background: #343a40;
  color: white;
  border-left: 4px solid #212529;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
}

.calendar-appointment:hover {
  color: white;
  filter: brightness(.95);
  z-index: 5;
}

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

.calendar-appointment.status-arrived,
.calendar-appointment.status-in_progress {
  background: #0d6efd;
  border-left-color: #084298;
}

.calendar-appointment.status-completed {
  background: #198754;
  border-left-color: #0f5132;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 1px 2px rgba(0,0,0,.12);
}

.calendar-appointment.status-completed::after {
  content: 'COMPLETED';
  position: absolute;
  right: 4px;
  bottom: 3px;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .03em;
  opacity: .9;
}

.calendar-appointment.status-no_show {
  background: #6c757d;
  border-left-color: #495057;
}

.calendar-legend {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  background: #343a40;
}

.calendar-legend.arrived {
  background: #0d6efd;
}

.calendar-legend.completed {
  background: #198754;
}

/* Side-by-side overlap support for the booking calendar */
.calendar-appointment.calendar-appointment-overlap {
  padding-left: 4px;
  padding-right: 4px;
  border-left-width: 3px;
  min-width: 0;
}

.calendar-appointment.calendar-appointment-overlap strong,
.calendar-appointment.calendar-appointment-overlap span,
.calendar-appointment.calendar-appointment-overlap small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 1200px) {
  .booking-calendar {
    grid-template-columns: 72px repeat(7, minmax(180px, 1fr));
    min-width: 1332px;
  }
}

/* Move Appointment calendar: clearly identify the appointment being moved. */
.calendar-current-appointment {
  outline: 3px solid #ffc107;
  outline-offset: -2px;
  box-shadow: 0 0 0 1px rgba(33,37,41,.35), 0 2px 5px rgba(0,0,0,.18);
  cursor: default;
  z-index: 5;
}

.calendar-legend.current {
  background: #ffc107;
  border: 1px solid #8a6d00;
}

/* Dashboard */
.dashboard-kpi {
  position: relative;
  transition: transform .15s ease, box-shadow .15s ease;
}

.dashboard-kpi:has(.stretched-link):hover {
  transform: translateY(-2px);
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.10) !important;
}

.dashboard-alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 0;
  border-bottom: 1px solid var(--bs-border-color);
  color: inherit;
  text-decoration: none;
}

.dashboard-alert-row:last-child {
  border-bottom: 0;
}

a.dashboard-alert-row:hover {
  color: var(--bs-primary);
}

/* About */
.about-workflow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem;
}

.about-workflow span {
  padding: .45rem .75rem;
  border: 1px solid var(--bs-border-color);
  border-radius: .5rem;
  background: var(--bs-light);
  font-size: .875rem;
  font-weight: 600;
}

.about-feature {
  display: flex;
  gap: .9rem;
  height: 100%;
  padding: 1rem;
  border: 1px solid var(--bs-border-color);
  border-radius: .75rem;
  background: var(--bs-body-bg);
}

.about-feature > i {
  flex: 0 0 auto;
  font-size: 1.35rem;
}

.about-feature strong,
.about-feature span,
.about-security-item strong,
.about-security-item span {
  display: block;
}

.about-feature span,
.about-security-item span {
  margin-top: .2rem;
  color: var(--bs-secondary-color);
  font-size: .875rem;
}

.about-security-item {
  height: 100%;
  padding-left: .9rem;
  border-left: 3px solid var(--bs-border-color);
}

.about-system-list dt,
.about-system-list dd {
  padding-top: .35rem;
  padding-bottom: .35rem;
  margin-bottom: 0;
}

/* System health visibility */
.app-health-link {
  white-space: nowrap;
  opacity: .95;
}

.app-health-link:hover {
  opacity: 1;
}

.app-health-dot {
  width: .62rem;
  height: .62rem;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  box-shadow: 0 0 0 .16rem rgba(255,255,255,.08);
}

.app-health-checking { background: #adb5bd; }
.app-health-ok { background: #20c997; }
.app-health-bad { background: #dc3545; }
.app-health-unknown { background: #ffc107; }

.health-card {
  transition: transform .12s ease, box-shadow .12s ease;
}

.health-card:hover {
  transform: translateY(-1px);
}

.health-icon {
  width: 2.65rem;
  height: 2.65rem;
  border-radius: .8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.health-icon-ok { background: rgba(25,135,84,.10); color: #198754; }
.health-icon-bad { background: rgba(220,53,69,.10); color: #dc3545; }
.health-icon-warn { background: rgba(255,193,7,.16); color: #997404; }
.health-icon-muted { background: rgba(108,117,125,.10); color: #6c757d; }
.health-icon-info { background: rgba(13,110,253,.10); color: #0d6efd; }

.health-details dt,
.health-details dd {
  padding-top: .3rem;
  padding-bottom: .3rem;
}
