/* =====================================================
   EQUIPMENT MODULE
===================================================== */

.equipment-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.equipment-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.equipment-dashboard-grid {
  display: grid;

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

  gap: 18px;
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.metric-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ct-muted);
}

.metric-value {
  font-size: 34px;
  font-weight: 700;
  color: var(--ct-ink);
}

/* Dashboard */
.dashboard-page { padding-top: 2px; }
.dash-greet { margin-bottom: 22px; }
.dash-greet h1 {
  font-family: 'DM Serif Display', serif;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--text1);
  margin-bottom: 6px;
}
.dash-greet p { font-size: 13.5px; color: var(--text3); }
.dashboard-attention-count {
  color: var(--orange);
  font-weight: 700;
  white-space: nowrap;
}
.ask-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.ask-bar:focus-within { border-color: rgba(52, 187, 192, 0.35); box-shadow: 0 0 0 3px rgba(52, 187, 192, 0.08); }
.ask-bar input { flex: 1; border: none; outline: none; background: transparent; font-size: 14.5px; color: var(--text1); }
.ask-bar input::placeholder { color: var(--text3); }
.ask-submit {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.ask-submit:hover { background: #e87630; }
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.pulse-card {
  background: #faf9f7;
  border-radius: var(--r-xl);
  padding: 0;
  display: grid;
  grid-template-columns: minmax(320px, 1.25fr) minmax(0, 1fr) minmax(220px, 0.78fr);
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07),0 1px 4px rgba(0,0,0,0.04);
  border: 0.5px solid rgba(0,0,0,0.06);
  min-height: 200px;
}
.pulse-zone { padding: 24px 26px; display: flex; flex-direction: column; justify-content: space-between; }
.pulse-zone + .pulse-zone { border-left: 1px solid rgba(0,0,0,0.07); }
.pulse-lbl, .pulse-zone-title {
  font-size: 9.5px;
  font-weight: 600;
  color: #a0a4ae;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.pulse-body { display: flex; align-items: center; gap: 18px; flex: 1; }
.pulse-ring-wrap { position: relative; width: 112px; height: 112px; flex-shrink: 0; }
.pulse-ring-wrap svg {
  width: 112px;
  height: 112px;
  transform: rotate(-90deg);
  position: absolute;
  inset: 0;
  z-index: 1;
}
.ring-bg { fill: none; stroke: rgba(0,0,0,0.07); stroke-width: 7; }
.ring-fill { fill: none; stroke: var(--teal); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 263; transition: stroke-dashoffset .5s ease; }
.ring-label {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  transform: translateY(-1px);
}
.ring-num { font-family: 'DM Serif Display', serif; font-size: 36px; color: var(--text1); line-height: 1; letter-spacing: -1.2px; }
.ring-denom { font-size: 10px; color: #b0b4bc; margin-top: -1px; }
.pulse-status { font-size: 18px; font-weight: 500; color: var(--teal2); margin-bottom: 6px; letter-spacing: -0.2px; }
.pulse-desc { font-size: 12.5px; color: #6b7280; line-height: 1.65; }
.pulse-link {
  font-size: 11.5px;
  color: var(--teal2);
  margin-top: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  opacity: 0.85;
}
.pulse-link:hover { opacity: 1; }
.cat-bars { display: flex; flex-direction: column; gap: 11px; flex: 1; }
.cat-bar-row { display: flex; align-items: center; gap: 10px; }
.cat-bar-name { font-size: 12px; color: #4a5568; width: 120px; flex-shrink: 0; }
.cat-bar-track { flex: 1; height: 4px; background: rgba(0,0,0,0.07); border-radius: 3px; overflow: hidden; }
.cat-bar-fill { height: 100%; border-radius: 3px; transition: width .45s ease; }
.cat-bar-pct { font-size: 11.5px; font-weight: 600; width: 30px; text-align: right; flex-shrink: 0; }
.cat-bar-pct.g { color: var(--green); }
.cat-bar-pct.a { color: var(--amber); }
.alert-rows { display: flex; flex-direction: column; gap: 0; flex: 1; }
.alert-row { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-bottom: 1px solid rgba(0,0,0,0.08); transition: opacity .12s; }
.alert-row:first-child { padding-top: 0; }
.alert-row:last-child { border-bottom: none; padding-bottom: 0; }
.alert-row:hover { opacity: .75; }
.alert-dot-wrap { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.alert-dot-wrap.r { background: var(--red); }
.alert-dot-wrap.a { background: var(--amber); }
.alert-dot-wrap.g { background: var(--green); }
.alert-dot-wrap.t { background: var(--teal); }
.alert-row-body { flex: 1; }
.alert-row-title { font-size: 13px; font-weight: 500; color: var(--text1); margin-bottom: 2px; }
.alert-row-sub { font-size: 11.5px; color: var(--text3); }
.alert-row-cta { font-size: 11px; color: var(--teal2); margin-top: 3px; font-weight: 500; display: flex; align-items: center; gap: 3px; }
.alert-row-cta svg { width: 9px; height: 9px; transition: transform .12s; }
.alert-row:hover .alert-row-cta svg { transform: translateX(2px); }
.mods-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.mod-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; cursor: pointer; transition: all .13s; }
.mod-card:hover { border-color: rgba(52,187,192,0.3); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.mod-ic { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; margin-bottom: 13px; }
.mod-ic svg { width: 17px; height: 17px; }
.mod-ic.tl { background: var(--teal-soft); color: var(--teal2); }
.mod-ic.am { background: var(--amber-soft); color: var(--amber); }
.mod-ic.gn { background: var(--green-soft); color: var(--green); }
.mod-ic.nv { background: rgba(26,38,56,0.07); color: var(--navy); }
.mod-name { font-size: 13.5px; font-weight: 600; color: var(--text1); margin-bottom: 3px; }
.mod-desc { font-size: 12px; color: var(--text3); line-height: 1.4; margin-bottom: 11px; }
.mod-stat { font-size: 11px; font-weight: 500; margin-bottom: 11px; }
.mod-stat.r { color: var(--red); }
.mod-stat.a { color: var(--amber); }
.mod-stat.g { color: var(--green); }
.mod-stat.n { color: var(--text3); }
.mod-open { font-size: 12px; color: var(--teal); display: inline-flex; align-items: center; gap: 3px; font-weight: 500; }
.mod-open svg { width: 10px; height: 10px; transition: transform .12s; }
.mod-card:hover .mod-open svg { transform: translateX(3px); }
.insight-bar { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 13px 18px; display: flex; align-items: center; gap: 11px; margin-top: 16px; }
.ins-ic { width: 30px; height: 30px; border-radius: 8px; background: var(--teal-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ins-ic svg { width: 14px; height: 14px; color: var(--teal2); }
.ins-lbl { font-size: 11.5px; font-weight: 600; color: var(--teal); white-space: nowrap; }
.ins-txt { font-size: 13px; color: var(--text2); }
.ins-sp { flex: 1; }
.ins-cta { font-size: 12px; color: var(--teal); display: inline-flex; align-items: center; gap: 3px; font-weight: 500; cursor: pointer; white-space: nowrap; }

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

  .pulse-zone + .pulse-zone {
    border-left: none;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
  }

  .mods-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .dash-greet h1 {
    font-size: 24px;
  }

  .ask-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .ask-submit {
    width: 100%;
  }

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

  .insight-bar {
    flex-wrap: wrap;
  }
}

/* =====================================================
   EQUIPMENT MODULE
===================================================== */

.equipment-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.equipment-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.equipment-dashboard-grid {

  display: grid;

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

  gap: 18px;

}

.metric-card {

  display: flex;
  flex-direction: column;
  gap: 10px;

}

.metric-label {

  font-size: 13px;
  font-weight: 600;
  color: var(--ct-muted);

}

.metric-value {

  font-size: 34px;
  font-weight: 700;
  color: var(--ct-ink);

}

/* =====================================================
   EQUIPMENT ENTRY
===================================================== */

.equipment-entry-card {
  gap: 28px;
}

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

.module-card-title {
  margin: 6px 0 0;
  font-size: 28px;
  line-height: 1.2;
}

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

.equipment-add-btn {
    height: 42px;
    padding: 0 16px;
    border: none;
    border-radius: 10px;
    background: #0f172a;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

.equipment-entry-grid {

  display: grid;

  grid-template-columns:
    repeat(auto-fit, minmax(240px, 1fr));

  gap: 18px;

}

.equipment-entry-actions {

  display: flex;
  align-items: center;
  gap: 16px;

}

.clairety-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 24px;
}

.equipment-modal {
    width: 1100px;
    max-width: 95vw;
    max-height: 92vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 18px;
    box-shadow:
        0 20px 60px rgba(0,0,0,0.18);
}

.equipment-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid #e5e7eb;
}

.equipment-modal-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}

.equipment-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 28px;
    border-top: 1px solid #e5e7eb;
    background: #fafafa;
}

.modal-close-btn {
    border: none;
    background: transparent;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.equipment-entry-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.equipment-notes-field {
    grid-column: span 2;
}

.equipment-notes-field textarea {
    min-height: 140px;
    resize: vertical;
}

.equipment-modal .system-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.equipment-modal .system-field label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.equipment-modal .system-field input,
.equipment-modal .system-field select,
.equipment-modal .system-field textarea {
    width: 100%;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    background: #fff;
}

.equipment-modal .system-field input:focus,
.equipment-modal .system-field select:focus,
.equipment-modal .system-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow:
        0 0 0 3px rgba(37,99,235,0.12);
}

@media (max-width: 900px) {

    .equipment-entry-grid {
        grid-template-columns: 1fr;
    }

    .equipment-notes-field {
        grid-column: span 1;
    }

    .equipment-modal {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
}

/* =====================================================
   EQUIPMENT DIRECTORY
===================================================== */

.equipment-directory-card {
  gap: 24px;
}

.equipment-directory-toolbar {

  display: grid;

  grid-template-columns:
    minmax(260px, 1fr)
    220px
    220px;

  gap: 18px;

}

.equipment-table-wrapper {
  overflow-x: auto;
}

.equipment-table {

  width: 100%;
  border-collapse: collapse;

}

.equipment-table thead th {

  text-align: left;

  padding: 14px 16px;

  font-size: 13px;
  font-weight: 700;

  color: var(--ct-muted);

  border-bottom:
    1px solid var(--ct-line);

}

.equipment-table tbody td {

  padding: 18px 16px;

  border-bottom:
    1px solid var(--ct-line);

  vertical-align: middle;

}

.equipment-name {

  font-weight: 700;
  color: var(--ct-ink);

}

.equipment-subline {

  margin-top: 4px;

  font-size: 13px;

  color: var(--ct-muted);

}

.equipment-pill,
.equipment-status {

  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 32px;

  padding: 0 12px;

  border-radius: 999px;

  font-size: 13px;
  font-weight: 700;

}

.alerts-page {
  border-radius: 12px;
  padding: 24px;
  background: #fff;
}

.equipment-pill.ok {

  background:
    rgba(34, 197, 94, 0.12);

  color:
    #15803d;

}

.equipment-pill.warning {

  background:
    rgba(245, 158, 11, 0.14);

  color:
    #b45309;

}

.equipment-pill.danger {

  background:
    rgba(239, 68, 68, 0.14);

  color:
    #b91c1c;

}

.equipment-status.active {

  background:
    rgba(33, 124, 126, 0.14);

  color:
    var(--ct-teal-dark);

}

.equipment-status.warning {
  background: #fef3c7;
  color: #92400e;
}

.equipment-status.danger {
  background: #fee2e2;
  color: #991b1b;
}

/* =====================================================
   COLLAPSIBLE MODULES
===================================================== */

.collapsible-header {

  cursor: pointer;
  user-select: none;

  padding: 14px 16px;

  margin: -8px;

  border-radius: 12px;

  transition:
    background 0.18s ease,
    transform 0.18s ease;

}

.collapsible-header:hover {

  background:
    rgba(33, 124, 126, 0.06);

}

.user-expand-cell .collapsible-header:hover {

  background: none; 

}

.collapsible-header:active {

  transform: scale(0.995);

}

.collapse-icon {

  display: flex;
  align-items: center;
  justify-content: center;

  width: 36px;
  height: 36px;

  border-radius: 999px;

  background:
    rgba(33, 124, 126, 0.08);

  color:
    var(--ct-teal-dark);

  transition:
    transform 0.22s ease,
    background 0.18s ease;

}

.collapsible-header:hover
.collapse-icon {

  background:
    rgba(33, 124, 126, 0.14);

}

.module-card-helper {

  margin-top: 6px;

  font-size: 13px;

  color:
    var(--ct-muted);

}

.metric-subtext {
  margin-top: 8px;
  font-size: 12px;
  color: #7b8190;
  line-height: 1.4;
}

.metric-value.warning {
  color: #d97706;
}

.metric-value.danger {
  color: #dc2626;
}

/* =====================================================
   EQUIPMENT DETAIL PANEL
===================================================== */

.equipment-row {
  cursor: pointer;
  transition: background 0.2s ease;
}

.equipment-row:hover {
  background: rgba(15, 23, 42, 0.03);
}

.equipment-detail-row.hidden {
  display: none;
}

.equipment-detail-panel {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 24px;
}

.equipment-detail-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.equipment-detail-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.equipment-detail-label, .equipment-status-label {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.equipment-detail-value {
  font-size: 15px;
  color: #0f172a;
  font-weight: 600;
}

.equipment-maintenance-section {
  margin-top: 24px;
}

.equipment-section-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  color: #0f172a;
}

.equipment-maintenance-empty {
  color: #64748b;
  font-size: 14px;
}

.equipment-maintenance-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.equipment-maintenance-form select,
.equipment-maintenance-form input {
  min-width: 180px;
}

.equipment-maintenance-form textarea {
  min-width: 500px;
  min-height: 45px;
  resize: vertical;
}

.equipment-entry-card.collapsed
.collapse-icon {

  transform: rotate(-90deg);

}

.equipment-entry-content {

  display: flex;
  flex-direction: column;
  gap: 24px;

}

/* =====================================================
   EQUIPMENT TOOLBAR
===================================================== */

.equipment-toolbar {
  display: flex;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.equipment-search-input {
  min-width: 280px;
}

.equipment-toolbar select {
  min-width: 180px;
}

.equipment-search-input,
.equipment-toolbar select,
.equipmentStatusSelect {
  border-radius: 8px;
  padding: 6px;
  border: 1px solid var(--ct-line);
  background: #fff;
}



.equipment-entry-card.collapsed
.equipment-entry-content {

  display: none;

}

.equipment-entry-card.collapsed
.equipment-entry-actions {

  display: none;

}

/* =====================================================
   MAINTENANCE TABLE
===================================================== */

.maintenance-history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.maintenance-history-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.maintenance-history-table td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  color: #334155;
}

.maintenance-history-table tr:last-child td {
  border-bottom: none;
}

/* =====================================================
   ALERTS CENTER
===================================================== */

.alerts-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.alerts-section-header {
  margin-bottom: 22px;
}

.alerts-section-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.alert-row {
  display: flex;
  gap: 16px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid transparent;
}

.alert-row.warning {
  background: #fffbeb;
  border-color: #fde68a;
}

/* =====================================================
   INCIDENTS MODULE
===================================================== */

.incident-header.page-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.incident-header.page-hdr h2 {
  margin: 0 0 3px;
  font-family: "DM Serif Display", serif;
  font-size: 24px;
  font-weight: 400;
  color: var(--text1, #1a2638);
}

.incident-header.page-hdr p {
  margin: 0;
  color: var(--text3, #8a909e);
  font-size: 13px;
}

.incident-stats {
  margin-bottom: 20px;
}

.incident-directory-card {
  overflow: hidden;
}

.incident-table-head,
.inc-row-cols {
  display: grid;
  grid-template-columns: 120px 150px 1.3fr 120px 1.6fr 100px 100px;
  gap: 0;
  align-items: center;
}

.incident-table-head {
  padding: 14px 18px 10px;
  border-bottom: 1px solid #e8edf3;
}

.incident-row {
  cursor: pointer;
}

.incident-row:hover {
  background: #f8fbff;
}

.incident-row > div {
  min-width: 0;
}

.incident-employee-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.incident-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  font-size: 10px;
  letter-spacing: 0.02em;
}

.incident-employee-text,
.incident-description-cell {
  min-width: 0;
}

.incident-description-main {
  font-size: 12px;
  color: var(--text1, #1a2638);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.incident-description-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text3, #8a909e);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incident-empty-row {
  padding: 24px 18px;
  text-align: center;
  color: var(--text3, #8a909e);
  font-size: 13px;
}

.incident-modal {
  width: 1120px;
  max-width: 95vw;
  max-height: 92vh;
  background: #fff;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.incident-modal-header,
.incident-modal-footer {
  display: flex;
  gap: 12px;
  padding: 22px 28px;
}

.incident-modal-header {
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
}

.incident-modal-header h2 {
  margin: 0 0 4px;
  color: var(--text1, #1a2638);
  font-family: "DM Serif Display", serif;
  font-size: 26px;
  font-weight: 400;
}

.incident-modal-header p {
  margin: 0;
  color: var(--text3, #8a909e);
  font-size: 13px;
}

.incident-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

.incident-modal-footer {
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid #e5e7eb;
}

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

.incident-modal .system-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.incident-modal .system-field label {
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}

.incident-modal .system-field input,
.incident-modal .system-field select,
.incident-modal .system-field textarea {
  width: 100%;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14px;
  background: #fff;
}

.incident-modal .system-field textarea {
  min-height: 116px;
  resize: vertical;
}

.incident-modal .system-field input:focus,
.incident-modal .system-field select:focus,
.incident-modal .system-field textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.incident-code-field,
.incident-description-field,
.incident-corrective-field,
.incident-notes-field {
  grid-column: span 2;
}

.incident-resolved-date-field,
.incident-followup-field,
.incident-resolved-field {
  grid-column: span 1;
}

.incident-modal .credential-save-status {
  margin-right: auto;
}

@media (max-width: 1180px) {
  .incident-table-head,
  .inc-row-cols {
    grid-template-columns: 112px 140px 1.1fr 110px 1.4fr 92px 92px;
  }
}

@media (max-width: 920px) {
  .incident-header.page-hdr {
    flex-direction: column;
  }

  .incident-form-grid {
    grid-template-columns: 1fr;
  }

  .incident-code-field,
  .incident-description-field,
  .incident-corrective-field,
  .incident-notes-field,
  .incident-resolved-date-field,
  .incident-followup-field,
  .incident-resolved-field {
    grid-column: span 1;
  }

  .incident-modal {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .incident-table-head,
  .inc-row-cols {
    min-width: 980px;
  }
}

/* Mockup-aligned equipment layout */
.equipment-page {
  gap: 20px;
}

.equip-2col,
.equipment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.equip-2col > .card,
.equipment-layout > .card {
  width: 100%;
  min-width: 0;
}

.equipment-header.page-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.equipment-header.page-hdr h2 {
  margin: 0 0 3px;
  font-family: "DM Serif Display", serif;
  font-size: 24px;
  font-weight: 400;
  color: var(--text1, #1a2638);
}

.equipment-header.page-hdr p {
  margin: 0;
  color: var(--text3, #8a909e);
  font-size: 13px;
}

.equipment-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  min-height: 104px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.07));
  border-radius: 14px;
  background: #fff;
  padding: 16px 18px;
}

.metric-value {
  font-family: "DM Serif Display", serif;
  font-size: 30px;
  font-weight: 400;
  color: var(--text1, #1a2638);
}

.equipment-directory-card {
  border: 1px solid var(--border, rgba(0, 0, 0, 0.07));
  border-radius: 14px;
  background: #fff;
  padding: 0;
  overflow: hidden;
}

.equipment-maintenance-log-card {
  border: 1px solid var(--border, rgba(0, 0, 0, 0.07));
  border-radius: 14px;
  background: #fff;
  padding: 0;
  overflow: hidden;
}

.equipment-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 180px;
  gap: 9px;
  margin: 0;
  padding: 14px 18px 16px;
}

.equipment-table-wrapper {
  overflow-x: auto;
}

.mnt-row-cols {
  grid-template-columns:
    minmax(0, 1.8fr)
    minmax(0, 1.2fr)
    minmax(0, 0.8fr)
    minmax(0, 0.8fr);
  gap: 12px;
}

.equipment-maintenance-log-card .tbl-hdr {
  padding: 8px 18px;
}

.equipment-maintenance-log-card .tbl-th {
  min-width: 0;
  white-space: nowrap;
}

.equipment-maintenance-feed-row {
  min-height: 0;
  cursor: pointer;
  transition: background 0.12s ease;
}

.equipment-maintenance-feed-row:hover {
  background: rgba(15, 23, 42, 0.03);
}

.equipment-maintenance-feed-row > div {
  min-width: 0;
}

@media (max-width: 900px) {

  .equip-2col,
  .equipment-layout {
    grid-template-columns: 1fr;
  }

}

.equipment-table thead th {
  padding: 8px 16px;
  background: var(--bg, #f5f4f0);
  color: var(--text3, #8a909e);
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.equipment-table tbody td {
  padding: 12px 16px;
}

.alert-row.danger {
  background: #fef2f2;
  border-color: #fecaca;
}

.alert-icon {
  font-size: 22px;
}

.alert-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.alert-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.alert-description {
  font-size: 14px;
  color: #64748b;
}

/* =====================================================
   CREDENTIALS MODULE
===================================================== */

.compliance-nav-badge {
  min-width: 18px;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.compliance-nav-badge.danger {
  background: var(--red, #dc2626);
}

.compliance-nav-badge.warning {
  background: var(--amber, #d97706);
}

.credentials-page {
  gap: 20px;
}

.credentials-directory-card {
  border: 1px solid var(--border, rgba(0, 0, 0, 0.07));
  border-radius: var(--r-lg, 14px);
  background: var(--white, #ffffff);
  overflow: hidden;
}

.tbl-hdr,
.tbl-row {
  display: grid;
  align-items: center;
}

.tbl-hdr {
  padding: 8px 18px;
  background: var(--bg, #f5f4f0);
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.07));
}

.tbl-th {
  color: var(--text3, #8a909e);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.tbl-row {
  min-height: 54px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.07));
  transition: background 0.12s ease;
}

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

.tbl-row:hover {
  background: var(--bg, #f5f4f0);
}

.credential-row {
  cursor: pointer;
}

.cr-row-cols {
  grid-template-columns: 1.4fr 1.6fr 1.4fr 1fr 0.9fr 1fr 1.6fr;
  gap: 12px;
}

.credential-employee-cell,
.credential-main-cell {
  min-width: 0;
  display: flex;
}

.credential-employee-cell {
  align-items: center;
  gap: 8px;
  color: var(--text1, #1a2638);
  font-size: 13px;
}

.credential-main-cell {
  flex-direction: column;
  gap: 2px;
  color: var(--text2, #4a5568);
  font-size: 13px;
}

.credential-main-cell span,
.credential-muted-cell {
  color: var(--text3, #8a909e);
  font-size: 12px;
}

.credential-main-cell div,
.credential-employee-cell span,
.credential-muted-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.av {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(52, 187, 192, 0.1);
  color: var(--teal2, #0c6e70);
  font-size: 10px;
  font-weight: 700;
}

.days-red,
.days-amber,
.days-green,
.days-neutral {
  font-size: 13px;
  font-weight: 600;
}

.days-red {
  color: var(--red, #dc2626);
}

.days-amber {
  color: var(--amber, #d97706);
}

.days-green {
  color: var(--green, #16a34a);
}

.days-neutral {
  color: var(--text3, #8a909e);
}

.credential-empty-row {
  padding: 28px 18px;
  color: var(--text3, #8a909e);
  font-size: 13px;
  text-align: center;
}

.credential-notes-cell {
  min-width: 0;
  color: var(--text2, #475569);
  font-size: 13px;
  line-height: 1.45;
}

.credential-notes-cell span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.credential-modal {
  width: 980px;
  max-width: 95vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.credential-modal-header,
.credential-modal-footer {
  display: flex;
  gap: 12px;
  padding: 22px 28px;
}

.credential-modal-header {
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
}

.credential-modal-header h2 {
  margin: 0 0 4px;
  color: var(--text1, #1a2638);
  font-family: "DM Serif Display", serif;
  font-size: 24px;
  font-weight: 400;
}

.credential-modal-header p {
  margin: 0;
  color: var(--text3, #8a909e);
  font-size: 13px;
}

.credential-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

.credential-modal-footer {
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
}

.credential-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.credential-modal .system-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.credential-modal .system-field label,
.credential-alert-options legend {
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}

.credential-modal .system-field input,
.credential-modal .system-field select,
.credential-modal .system-field textarea {
  width: 100%;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  padding: 12px 14px;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
}

.credential-modal .system-field textarea {
  min-height: 120px;
  resize: vertical;
}

.credential-modal .system-field input:focus,
.credential-modal .system-field select:focus,
.credential-modal .system-field textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.credential-alert-options,
.credential-notes-field {
  grid-column: span 2;
}

.credential-alert-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  padding: 16px;
}

.credential-alert-options legend {
  padding: 0 6px;
}

.credential-alert-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text2, #4a5568);
  font-size: 13px;
}

.credential-save-status {
  margin-right: auto;
  color: var(--text3, #8a909e);
  font-size: 13px;
}

.credential-save-status.error {
  color: var(--red, #dc2626);
}

/* =====================================================
   TASK TRACKER MODULE
===================================================== */

.task-page {
  gap: 20px;
}

.comp-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
}

.task-category-card,
.task-directory-card {
  border: 1px solid var(--border, rgba(0, 0, 0, 0.07));
  border-radius: var(--r-lg, 14px);
  background: var(--white, #ffffff);
  overflow: hidden;
}

.task-category-body {
  padding: 8px 16px 14px;
}

.comp-bar-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.07));
}

.comp-bar-row:last-child {
  border-bottom: 0;
}

.comp-bar-name {
  width: 126px;
  flex-shrink: 0;
  color: var(--text1, #1a2638);
  font-size: 12.5px;
}

.comp-bar-track {
  flex: 1;
  height: 5px;
  background: var(--bg2, #eceae5);
  border-radius: 999px;
  overflow: hidden;
}

.comp-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.comp-pct {
  width: 34px;
  flex-shrink: 0;
  text-align: right;
  font-size: 11px;
  font-weight: 600;
}

.comp-pct.g {
  color: var(--green, #16a34a);
}

.comp-pct.a {
  color: var(--amber, #d97706);
}

.ct-row-cols {
  grid-template-columns: 2.3fr 1fr 1.2fr 1fr 0.9fr;
  gap: 12px;
}

.task-directory-body {
  overflow-x: auto;
}

.task-row {
  cursor: pointer;
}

.task-row:hover {
  background: var(--bg, #f5f4f0);
}

.task-main-cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.task-main-cell div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text1, #1a2638);
  font-size: 13px;
  font-weight: 600;
}

.task-main-cell span,
.task-muted-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text3, #8a909e);
  font-size: 12px;
}

.task-empty-row {
  padding: 28px 18px;
  color: var(--text3, #8a909e);
  font-size: 13px;
  text-align: center;
}

.task-modal {
  width: 1040px;
  max-width: 95vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.task-modal-header,
.task-modal-footer {
  display: flex;
  gap: 12px;
  padding: 22px 28px;
}

.task-modal-header {
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
}

.task-modal-header h2 {
  margin: 0 0 4px;
  color: var(--text1, #1a2638);
  font-family: "DM Serif Display", serif;
  font-size: 24px;
  font-weight: 400;
}

.task-modal-header p {
  margin: 0;
  color: var(--text3, #8a909e);
  font-size: 13px;
}

.task-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

.task-modal-footer {
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
}

.task-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.task-modal .system-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-modal .system-field label {
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}

.task-modal .system-field input,
.task-modal .system-field select,
.task-modal .system-field textarea {
  width: 100%;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  padding: 12px 14px;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
}

.task-modal .system-field textarea {
  min-height: 120px;
  resize: vertical;
}

.task-modal .system-field input:focus,
.task-modal .system-field select:focus,
.task-modal .system-field textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.task-notes-field {
  grid-column: span 2;
}

.task-modal .credential-save-status {
  margin-right: auto;
}

@media (max-width: 900px) {

  .cr-row-cols {
    grid-template-columns: minmax(160px, 1.2fr) minmax(180px, 1.35fr) minmax(130px, 1fr) 90px 80px 96px minmax(160px, 1.2fr);
  }

  .credentials-directory-card {
    overflow-x: auto;
  }

  .tbl-hdr,
  .tbl-row {
    min-width: 860px;
  }

  .credential-form-grid,
  .credential-alert-options {
    grid-template-columns: 1fr;
  }

  .credential-alert-options,
  .credential-notes-field {
    grid-column: span 1;
  }

  .credential-modal {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .comp-layout {
    grid-template-columns: 1fr;
  }

  .ct-row-cols {
    min-width: 840px;
  }

  .task-form-grid {
    grid-template-columns: 1fr;
  }

  .task-notes-field {
    grid-column: span 1;
  }

  .task-modal {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

}

/* =====================================================
   VENDORS MODULE
===================================================== */

.vendor-page {
  gap: 20px;
}

.vendor-directory-card {
  border: 1px solid var(--border, rgba(0, 0, 0, 0.07));
  border-radius: var(--r-lg, 14px);
  background: var(--white, #ffffff);
  overflow: hidden;
}

.ven-row-cols {
  grid-template-columns: 2fr 1.25fr 1.25fr 1fr 0.9fr 0.8fr 0.95fr;
}

.vendor-directory-body {
  display: flex;
  flex-direction: column;
}

.vendor-row {
  cursor: pointer;
}

.vendor-row:hover {
  background: rgba(52, 187, 192, 0.04);
}

.vendor-status-sub {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--text3, #8a909e);
}

.vendor-empty-row {
  padding: 18px;
  color: var(--text3, #8a909e);
  font-size: 13px;
}

.vendor-modal {
  max-width: 1040px;
}

.vendor-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 14px;
}

.vendor-modal-grid .system-field {
  min-width: 0;
}

.vendor-toggle-field {
  display: flex;
  align-items: flex-end;
}

.vendor-toggle-field label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: var(--text2, #4a5568);
}

.vendor-toggle-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.vendor-notes-field {
  grid-column: 1 / -1;
}

.vendor-modal .credential-save-status {
  margin-top: 4px;
}

.vendor-validation-status {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.18);
  font-size: 13px;
  font-weight: 600;
}

.vendor-field-error {
  margin-top: 6px;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.35;
}

.vendor-modal .field-error {
  border-color: rgba(239, 68, 68, 0.55) !important;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.15);
}

/* =====================================================
   AUDIT READINESS MODULE
===================================================== */

.audit-page {
  gap: 20px;
}

.audit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 20px;
  align-items: start;
}

.audit-readiness-card,
.audit-records-card {
  border: 1px solid var(--border, rgba(0, 0, 0, 0.07));
  border-radius: var(--r-lg, 14px);
  background: var(--white, #ffffff);
  overflow: hidden;
}

.audit-type-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 18px 18px;
}

.audit-type-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.82fr) minmax(0, 1.6fr) 54px;
  gap: 12px;
  align-items: center;
}

.audit-type-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text1, #111827);
}

.audit-type-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}

.audit-type-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.2s ease;
}

.audit-type-score {
  justify-self: end;
  font-size: 13px;
  font-weight: 700;
  color: var(--text3, #8a909e);
}

.audit-type-row.osha .audit-type-fill { background: linear-gradient(90deg, #d97706, #f59e0b); }
.audit-type-row.osha .audit-type-score { color: #d97706; }
.audit-type-row.hipaa .audit-type-fill { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.audit-type-row.hipaa .audit-type-score { color: #2563eb; }
.audit-type-row.radiation .audit-type-fill { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.audit-type-row.radiation .audit-type-score { color: #7c3aed; }
.audit-type-row.infection .audit-type-fill { background: linear-gradient(90deg, #0f766e, #2dd4bf); }
.audit-type-row.infection .audit-type-score { color: #0f766e; }
.audit-type-row.dea .audit-type-fill { background: linear-gradient(90deg, #dc2626, #f87171); }
.audit-type-row.dea .audit-type-score { color: #dc2626; }
.audit-type-row.facility .audit-type-fill { background: linear-gradient(90deg, #16a34a, #4ade80); }
.audit-type-row.facility .audit-type-score { color: #16a34a; }
.audit-type-row.generic .audit-type-fill { background: linear-gradient(90deg, #64748b, #94a3b8); }
.audit-type-row.generic .audit-type-score { color: #64748b; }

.audit-row-cols {
  grid-template-columns: 1.2fr 1fr 0.8fr 2.2fr 1.3fr;
}

.audit-directory-body {
  display: flex;
  flex-direction: column;
}

.audit-row {
  cursor: pointer;
}

.audit-row:hover {
  background: rgba(52, 187, 192, 0.04);
}

.audit-empty-row {
  padding: 18px;
  color: var(--text3, #8a909e);
  font-size: 13px;
}

.audit-modal {
  max-width: 1080px;
}

.audit-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 14px;
}

.audit-modal-grid .system-field {
  min-width: 0;
}

.audit-notes-field {
  grid-column: 1 / -1;
}

.audit-validation-status {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.18);
  font-size: 13px;
  font-weight: 600;
}

.audit-field-error {
  margin-top: 6px;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.35;
}

.audit-modal .field-error {
  border-color: rgba(239, 68, 68, 0.55) !important;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.15);
}

@media (max-width: 900px) {
  .vendor-modal-grid {
    grid-template-columns: 1fr;
  }

  .vendor-notes-field {
    grid-column: auto;
  }

  .audit-layout {
    grid-template-columns: 1fr;
  }

  .audit-type-row {
    grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.6fr) 56px;
  }

  .audit-modal-grid {
    grid-template-columns: 1fr;
  }

  .audit-notes-field {
    grid-column: auto;
  }

  .audit-records-card {
    overflow-x: auto;
  }

  .audit-row-cols,
  .audit-row {
    min-width: 920px;
  }
}
