/* Recurring routine inspections. Loaded after the shared polish layer so the
   checklist can retain its sheet-like desktop view and compact mobile cards. */

#screen-daily-checklist-form .dc-schedule-fields {
  position: relative;
  /* No overflow:hidden here — the floating "Inspection schedule" label
     below straddles the top border via translateY(-50%), so clipping
     overflow on this element would cut the label's upper half off. */
  margin-top: 8px;
  padding-top: 24px !important;
  border-color: #cfe0eb;
  background: linear-gradient(135deg, #f8fcff, var(--surface)) !important;
}

#screen-daily-checklist-form .dc-schedule-fields::before {
  content: 'Inspection schedule';
  position: absolute;
  top: 0;
  left: auto;
  right: auto;
  inset-inline-start: 18px;
  padding: 0 8px;
  color: var(--navy);
  background: var(--surface);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  transform: translateY(-50%);
}

#screen-daily-checklist-form .dc-field-help {
  min-height: 18px;
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.dc-frequency-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .035em;
  line-height: 1;
  white-space: nowrap;
}
.dc-frequency-daily { color: #166375; background: #e4f7fb; }
.dc-frequency-monthly { color: #315a96; background: #e9efff; }
.dc-frequency-quarterly { color: #7a4d13; background: #fff4dc; }
.dc-frequency-annual { color: #755033; background: #f6eadf; }

#screen-daily-checklist-templates .dc-routine-template-card,
#screen-project-detail .dc-project-checklist-card {
  position: relative;
  overflow: hidden;
}
#screen-daily-checklist-templates .dc-routine-template-card::before,
#screen-project-detail .dc-project-checklist-card::before {
  content: '';
  position: absolute;
  inset: 0 auto;
  inset-inline-start: 0;
  width: 4px;
  background: var(--navy);
}
#screen-daily-checklist-templates .dc-checklist-schedule,
#screen-project-detail .dc-checklist-schedule {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin: 12px 0 8px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}
#screen-daily-checklist-templates .dc-checklist-schedule span + span::before,
#screen-project-detail .dc-checklist-schedule span + span::before {
  content: '\2022';
  margin-right: 0;
  margin-inline-end: 12px;
  color: var(--coral);
}

#screen-daily-checklist-run .dc-routine-shell { gap: 16px; }
#screen-daily-checklist-run .dc-routine-titlebar {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(0, 1.5fr);
  gap: 22px;
  align-items: stretch;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #183752 0%, #2a587d 100%);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-card);
  box-shadow: 0 18px 34px rgba(34, 70, 101, .2);
}
#screen-daily-checklist-run .dc-routine-titlebar__brand {
  display: grid;
  align-content: center;
  gap: 9px;
  min-width: 0;
  padding: 25px;
  background: rgba(8, 29, 49, .22);
}
#screen-daily-checklist-run .dc-routine-kicker {
  color: rgba(255,255,255,.7);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
}
#screen-daily-checklist-run .dc-routine-titlebar__brand strong {
  overflow: hidden;
  color: #fff;
  font-size: clamp(19px, 2.3vw, 30px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  text-overflow: ellipsis;
}
#screen-daily-checklist-run .dc-routine-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 8px;
}
#screen-daily-checklist-run .dc-routine-meta > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
#screen-daily-checklist-run .dc-routine-meta > div:nth-last-child(-n+2) { border-bottom: 0; }
#screen-daily-checklist-run .dc-routine-meta dt {
  color: rgba(255,255,255,.62);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
#screen-daily-checklist-run .dc-routine-meta dd {
  margin: 0;
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#screen-daily-checklist-run .dc-inspection-sheet {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
#screen-daily-checklist-run .dc-inspection-sheet__head {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 132px 42px;
  align-items: center;
  min-height: 46px;
  padding: 0 17px;
  color: var(--navy);
  background: #eaf2f8;
  border-bottom: 1px solid #d3e2ec;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .075em;
  text-transform: uppercase;
}
#screen-daily-checklist-run .dc-inspection-sheet__head span:first-child { grid-column: 1 / 3; }
#screen-daily-checklist-run .dc-inspection-sheet__head span:nth-child(2) { grid-column: 3; }
#screen-daily-checklist-run .dc-inspection-sheet__head span:nth-child(3) { grid-column: 4; justify-self: center; }
#screen-daily-checklist-run #dcr-items { gap: 0; margin: 0; padding: 0; }
#screen-daily-checklist-run .dc-group-header {
  margin: 0;
  padding: 14px 18px 8px;
  color: var(--navy);
  background: #fbfdfe;
  border-bottom: 1px solid var(--line);
}
#screen-daily-checklist-run .dc-item-row {
  grid-template-columns: 42px minmax(0, 1fr) 120px 38px !important;
  align-items: center;
  gap: 12px;
  padding: 14px 17px;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
#screen-daily-checklist-run .dc-item-row:last-child { border-bottom: 0 !important; }
#screen-daily-checklist-run .dc-item-row:hover { background: #fbfdfe; }
#screen-daily-checklist-run .dc-item-main { gap: 4px; }
#screen-daily-checklist-run .dc-item-status {
  justify-self: start;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}
#screen-daily-checklist-run .dc-status-unchecked { color: #637386; background: #eef2f5; }
#screen-daily-checklist-run .dc-status-checked { color: #13734c; background: #e6f6ed; }
#screen-daily-checklist-run .dc-status-issue { color: #b34836; background: #fff0eb; }
#screen-daily-checklist-run .dc-item-row.dc-item-issue {
  border-left: 0 !important;
  border-inline-start: 3px solid var(--coral) !important;
}

#screen-daily-checklist-run .dc-signoff-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #f8fbfd, #fff);
  border: 1px solid #d8e5ed;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
#screen-daily-checklist-run .dc-signoff-card > div:first-child { display: grid; gap: 4px; min-width: 0; }
#screen-daily-checklist-run .dc-signoff-card__label,
#screen-daily-checklist-run .dc-signoff-card__summary > span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
#screen-daily-checklist-run .dc-signoff-card strong { color: var(--ink); font-size: 14px; font-weight: 800; }
#screen-daily-checklist-run .dc-signoff-card small { color: var(--ink-soft); font-size: 11px; }
#screen-daily-checklist-run .dc-signoff-card__summary {
  display: grid;
  gap: 5px;
  min-width: 130px;
  padding-left: 0;
  padding-inline-start: 18px;
  border-left: 0;
  border-inline-start: 1px solid var(--line);
  text-align: end;
}
#screen-daily-checklist-my .dc-my-checklist-cycle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 10px;
  margin: -2px 0 12px;
  color: var(--ink-soft);
  font-size: 11px;
}

@media (max-width: 720px) {
  #screen-daily-checklist-run .dc-routine-titlebar { grid-template-columns: 1fr; gap: 0; }
  #screen-daily-checklist-run .dc-routine-titlebar__brand { padding: 20px; }
  #screen-daily-checklist-run .dc-routine-meta { grid-template-columns: 1fr 1fr; padding: 5px; }
  #screen-daily-checklist-run .dc-routine-meta > div { padding: 12px 10px; }
  #screen-daily-checklist-run .dc-routine-meta dd { font-size: 12px; }
  #screen-daily-checklist-run .dc-inspection-sheet__head { display: none; }
  #screen-daily-checklist-run .dc-item-row {
    grid-template-columns: 42px minmax(0, 1fr) 38px !important;
    gap: 10px;
    padding: 13px;
  }
  #screen-daily-checklist-run .dc-item-status { grid-column: 2; grid-row: 2; }
  #screen-daily-checklist-run .dc-item-flag-btn { grid-column: 3; grid-row: 1; }
  #screen-daily-checklist-run .dc-signoff-card { align-items: flex-start; flex-direction: column; gap: 14px; }
  #screen-daily-checklist-run .dc-signoff-card__summary { width: 100%; min-width: 0; padding: 13px 0 0; border-top: 1px solid var(--line); border-inline-start: 0; text-align: start; }
  #screen-daily-checklist-templates .dc-checklist-schedule span + span::before,
  #screen-project-detail .dc-checklist-schedule span + span::before { display: none; }
}

/* ── Equipment Selection & Interactive Maintenance Schedule Load Calendar ── */
#dcf-equipment-select-group {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(37, 99, 235, 0.01));
  border: 1px dashed rgba(37, 99, 235, 0.3);
  padding: 14px;
  border-radius: var(--r-md, 8px);
}

.dc-calendar-wrap {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius-card, 12px);
  padding: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.dc-cal-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  color: var(--ink-soft, #64748b);
  font-size: 13px;
}

.dc-cal-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dc-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line, #e2e8f0);
}

.dc-cal-month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dc-cal-month-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink, #1e293b);
  min-width: 170px;
  text-align: center;
}

.dc-cal-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--ink-soft, #64748b);
}

.dc-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dc-cal-grid-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft, #64748b);
  padding-bottom: 4px;
}

.dc-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.dc-cal-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  padding: 6px 2px;
  background: var(--surface-subtle, #f8fafc);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.dc-cal-day:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  transform: translateY(-1px);
}

.dc-cal-day.today {
  border-color: #2563eb;
}

.dc-cal-day.selected {
  background: #2563eb !important;
  color: #fff !important;
  border-color: #1d4ed8 !important;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.3);
}

.dc-cal-day.selected .dc-cal-day-num {
  color: #fff !important;
}

.dc-cal-day-empty {
  min-height: 48px;
  background: transparent;
  border: 0;
  cursor: default;
}

.dc-cal-day-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink, #1e293b);
}

.dc-cal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.dc-cal-badge-none {
  background: #f1f5f9;
  color: #94a3b8;
}

.dc-cal-badge-low {
  background: #dcfce7;
  color: #15803d;
}

.dc-cal-badge-med {
  background: #fef9c3;
  color: #a16207;
}

.dc-cal-badge-high {
  background: #fee2e2;
  color: #b91c1c;
}

.dc-cal-day.selected .dc-cal-badge {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #fff !important;
}

.dc-cal-details-card {
  margin-top: 8px;
  padding: 12px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
}

.dc-cal-details-empty {
  margin-top: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 12px;
  color: #475569;
}

.dc-cal-details-title {
  font-size: 12px;
  font-weight: 700;
  color: #166534;
  margin-bottom: 6px;
}

.dc-cal-details-list {
  margin: 0;
  padding-left: 18px;
  padding-inline-start: 18px;
  font-size: 12px;
  color: #1e293b;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dc-wo-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 10px;
  font-weight: 700;
}

/* ── Multi-equipment routine navigator (batch run screen) ──────────── */
#screen-daily-checklist-run .dc-batch-nav {
  background: linear-gradient(135deg, var(--navy-dark, #0f2438), var(--navy, #16324f));
  border-radius: var(--r-lg, 16px);
  padding: 14px 16px;
  margin-bottom: 12px;
  color: #fff;
}
.dc-batch-nav__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
}
#dcr-batch-name { font-weight: 800; font-size: 15px; margin-inline-end: auto; }
#dcr-batch-progress { color: rgba(255, 255, 255, .7); font-size: 12px; }
#btn-dcr-batch-report {
  background: rgba(255, 255, 255, .1) !important;
  color: #fff !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 8px !important;
}
#btn-dcr-batch-report:hover { background: rgba(255, 255, 255, .2) !important; }
.dc-batch-nav__tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.dc-batch-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .82);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.dc-batch-tab.active {
  background: #fff;
  color: var(--navy, #16324f);
  border-color: #fff;
}
.dc-batch-tab.is-done:not(.active) {
  border-color: rgba(52, 211, 153, .5);
  color: #6ee7b7;
}
.dc-batch-tab svg { flex-shrink: 0; }

.dc-batch-next {
  margin-top: 12px;
}
.dc-batch-next .btn { width: 100%; }

.dc-batch-done-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 26, 38, .6);
  backdrop-filter: blur(6px);
}
.dc-batch-done-card {
  width: min(92vw, 380px);
  text-align: center;
  padding: 32px 26px 26px;
  background: var(--surface, #fff);
  border-radius: 20px;
  box-shadow: 0 30px 70px rgba(20, 40, 60, .3);
}
.dc-batch-done-card svg { color: #16a34a; margin-bottom: 14px; }
.dc-batch-done-card h2 { margin: 0 0 8px; font-size: 20px; font-weight: 800; color: var(--navy, #16324f); }
.dc-batch-done-card p { margin: 0 0 20px; font-size: 13.5px; color: var(--ink-soft, #6b7c8c); line-height: 1.5; }
.dc-batch-done-card .btn { width: 100%; }
