.panel,
.dashboard-grid > * {
  min-width: 0;
  max-width: 100%;
}

body {
  overflow-x: hidden;
}

.email-list {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.mail-workspace {
  display: grid;
  grid-template-columns: 145px minmax(270px, .76fr) minmax(0, 1.48fr);
  min-height: 590px;
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid #d6e1e4;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.mail-folders {
  padding: 19px 12px;
  border-right: 1px solid #d6e1e4;
  background: #f0f6f5;
}

.mail-folders > strong {
  display: block;
  padding: 0 10px 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mail-folder {
  display: block;
  padding: 10px;
  border-radius: 8px;
  color: #34505e;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.mail-folder:hover,
.mail-folder:focus-visible,
.mail-folder.active {
  background: #dcefeb;
  color: var(--teal);
}

.mail-search {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.mail-search label {
  flex: 1;
}

.mail-search input {
  width: 100%;
}

.mail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.mail-attachments {
  padding: 0 34px 24px;
}

.mail-attachments > strong {
  display: block;
  margin-bottom: 9px;
  color: var(--navy);
  font-size: 13px;
}

.mail-attachments > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mail-attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid #cfe0e1;
  border-radius: 9px;
  background: #f7faf9;
  color: var(--navy);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.mail-attachment small {
  color: var(--muted);
  font-weight: 500;
}

.mail-compose {
  margin: 0 34px 30px;
  padding: 22px;
  border-color: #b9d8d7;
  box-shadow: none;
}

.mail-compose-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.mail-compose-head h2 {
  margin: 0;
  font: 700 22px/1.2 Georgia, serif;
}

.mail-compose-head > a {
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.compose-form {
  display: grid;
  gap: 13px;
}

.compose-form > label:not(.send-confirm) {
  display: grid;
  gap: 6px;
}

.compose-form label > span {
  color: #415b68;
  font-size: 13px;
  font-weight: 750;
}

.compose-form input,
.compose-form textarea {
  width: 100%;
}

.send-confirm {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 8px;
  background: #edf7f4;
}

.send-confirm input {
  width: auto;
  margin-top: 3px;
}

.compose-form button {
  justify-self: start;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mail-list-pane {
  min-width: 0;
  border-right: 1px solid #d6e1e4;
  background: #f7faf9;
}

.mail-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 18px;
  border-bottom: 1px solid #d6e1e4;
  background: #eef6f4;
}

.mail-list-head strong {
  color: var(--navy);
  font: 700 18px/1.2 Georgia, serif;
}

.mail-list-head span,
.mail-row time {
  color: var(--muted);
  font-size: 12px;
}

.mail-list {
  max-height: 535px;
  overflow-y: auto;
}

.mail-row {
  position: relative;
  display: block;
  padding: 17px 18px 16px;
  border-bottom: 1px solid #e0e8e9;
  color: inherit;
  text-decoration: none;
  transition: background .16s ease, box-shadow .16s ease;
}

.mail-row:hover,
.mail-row:focus-visible {
  background: #edf7f4;
}

.mail-row:focus-visible {
  z-index: 1;
  outline: 3px solid rgba(0, 135, 147, .22);
  outline-offset: -3px;
}

.mail-row.selected {
  background: #e5f3f0;
  box-shadow: inset 4px 0 0 var(--teal);
}

.mail-row.unread::after {
  position: absolute;
  top: 21px;
  right: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  content: "";
}

.mail-row-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-right: 13px;
}

.mail-row-meta strong,
.mail-row h3,
.mail-row p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-row-meta strong {
  color: var(--ink);
  font-size: 13px;
}

.mail-row h3 {
  margin: 7px 0 5px;
  color: var(--navy);
  font: 700 15px/1.3 Georgia, serif;
}

.mail-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.mail-reading-pane {
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: #fff;
}

.mail-reading-head {
  padding: 30px 34px 22px;
  border-bottom: 1px solid #e0e8e9;
}

.mail-eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.mail-reading-head h2 {
  margin: 0 0 20px;
  color: var(--navy);
  font: 700 25px/1.25 Georgia, serif;
}

.mail-addresses {
  display: grid;
  gap: 8px;
  margin: 0;
}

.mail-addresses > div {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
}

.mail-addresses dt,
.mail-addresses dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.mail-addresses dt {
  color: var(--muted);
  font-weight: 750;
}

.mail-addresses dd {
  overflow-wrap: anywhere;
  color: var(--ink);
}

.mail-message-body {
  flex: 1;
  max-height: 370px;
  padding: 28px 34px 36px;
  overflow: auto;
  color: #294454;
  font-size: 15px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.mail-list-empty {
  padding: 36px 20px;
  color: var(--muted);
  text-align: center;
}

.mail-reading-empty {
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--muted);
  text-align: center;
}

.mail-reading-empty span {
  display: block;
  margin-bottom: 10px;
  color: var(--teal);
  font-size: 32px;
}

.mail-reading-empty h2 { margin: 0 0 6px; color: var(--navy); }
.mail-reading-empty p { margin: 0; }

.email-card {
  position: relative;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.email-card.unread {
  border-left: 4px solid var(--teal);
}

.email-connect-panel {
  width: min(100%, 560px);
  margin: 20px auto;
}

.email-connect-panel > p {
  color: var(--muted);
}

.email-card h3 {
  margin: 8px 0 6px;
  font: 700 17px/1.25 Georgia, serif;
}

.email-card p,
.email-security p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.email-security p + p {
  margin-top: 8px;
}

.email-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--ink);
  font-size: 12px;
}

.email-meta time,
.mailbox-address {
  color: var(--muted);
}

.notice.email-demo {
  background: #fff7e9;
  color: #8a5a23;
  border: 1px solid #efd9ae;
}

.training-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.training-stat {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.training-stat span,
.training-stat strong {
  display: block;
}

.training-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.training-stat strong {
  margin-top: 10px;
  color: var(--navy);
  font: 700 30px/1 Georgia, serif;
}

.training-stat.overdue {
  border-left: 4px solid #b74a4a;
}

.training-stat.due-soon {
  border-left: 4px solid #d89a2b;
}

.training-stat.complete {
  border-left: 4px solid var(--teal);
}

.status-form {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 235px;
}

.status-form select {
  min-width: 135px;
  padding: 8px 9px;
  font-size: 12px;
}

.status-form button {
  padding: 8px 11px;
  white-space: nowrap;
}

.js .status-form button {
  display: none;
}

.js .status-form {
  min-width: 150px;
}

.dashboard-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.dashboard-toolbar h2 {
  margin: 0;
  font: 700 27px/1.15 Georgia, serif;
}

.dashboard-toolbar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-actions {
  display: flex;
  gap: 8px;
}

.ops-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.ops-kpi,
.ops-card {
  border: 1px solid #d8e3e5;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(5, 47, 72, .06);
}

.ops-kpi {
  padding: 15px;
}

.ops-kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.ops-kpi-head span {
  color: #435b69;
  font-size: 12px;
  font-weight: 800;
}

.ops-kpi-head b {
  color: var(--navy);
  font: 700 28px/1 Georgia, serif;
}

.ops-kpi-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.ops-kpi-breakdown span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px 6px;
  border-radius: 7px;
  background: #edf7f4;
  color: #637783;
  font-size: 9px;
}

.ops-kpi-breakdown strong {
  color: var(--navy);
  font-size: 15px;
}

.ops-kpi-breakdown .danger { background: #fff0ef; }
.ops-kpi-breakdown .danger strong { color: #b13e3e; }
.ops-kpi-breakdown .warning { background: #fff7df; }
.ops-kpi-breakdown .warning strong { color: #a66a00; }
.ops-kpi-breakdown .good strong { color: #16804c; }

.ops-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ops-card {
  min-width: 0;
  padding: 17px;
}

.ops-card.span-two {
  grid-column: span 2;
}

.ops-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.ops-card-head p {
  margin: 0 0 3px;
  color: var(--teal);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.ops-card-head h3 {
  margin: 0;
  font: 700 17px/1.2 Georgia, serif;
}

.ops-card-head a {
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
}

.compact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.compact-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.compact-list li:last-child { border-bottom: 0; }
.compact-list li > div { display: grid; gap: 3px; min-width: 0; flex: 1; }
.compact-list li strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-list li span { color: var(--muted); }
.schedule-list li > time { min-width: 72px; color: var(--navy); font-weight: 800; }
.schedule-list li > time small { display: block; margin-top: 3px; color: var(--muted); font-weight: 500; }
.schedule-list li > em { color: var(--teal); font-style: normal; font-weight: 800; }
.training-list li > time { color: #a66a00; font-weight: 800; }

.pipeline {
  display: grid;
  gap: 13px;
  padding-top: 15px;
}

.pipeline-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 8px;
  font-size: 10px;
}

.pipeline-row > div {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7efef;
}

.pipeline-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--lime));
}

.compact-activity {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 20px;
}

.compact-activity li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  padding: 10px 0;
}

.compact-activity li strong { font-size: 11px; }
.compact-activity li span { font-size: 10px; }
.compact-activity li time { grid-column: 2; grid-row: 1 / span 2; align-self: center; }

@media (max-width: 1100px) {
  .mail-workspace { grid-template-columns: 120px minmax(250px, .8fr) minmax(0, 1.25fr); }
  .ops-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .email-meta {
    display: grid;
    gap: 4px;
  }

  .mail-workspace {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .mail-folders {
    display: flex;
    gap: 6px;
    padding: 10px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid #d6e1e4;
  }

  .mail-folders > strong {
    display: none;
  }

  .mail-folder {
    flex: 0 0 auto;
    padding: 8px 11px;
  }

  .mail-search {
    flex-wrap: wrap;
  }

  .mail-search label {
    flex-basis: 100%;
  }

  .mail-list-pane {
    border-right: 0;
    border-bottom: 1px solid #d6e1e4;
  }

  .mail-list {
    max-height: 320px;
  }

  .mail-reading-head,
  .mail-message-body,
  .mail-attachments {
    padding-left: 20px;
    padding-right: 20px;
  }

  .mail-compose {
    margin: 0 12px 18px;
    padding: 17px;
  }

  .mail-message-body {
    max-height: none;
    min-height: 260px;
  }

  .training-summary {
    grid-template-columns: 1fr;
  }

  .dashboard-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-actions,
  .dashboard-actions .button {
    width: 100%;
  }

  .ops-kpis,
  .ops-board {
    grid-template-columns: 1fr;
  }

  .ops-card.span-two {
    grid-column: auto;
  }

  .compact-activity {
    grid-template-columns: 1fr;
  }
}
