/* ============================================================
   OKY — Flagged emails page
   Pixel implementation of Figma "Flagged emails"
   (file VxR2FoxDAz96FLDaEVdReR).

   Threats-only: there is no "Safe" tab and clean mail is never
   shown. Reuses the redesign palette (--d-* / --font-mont) and the
   shared .ov-pill verdict chip; everything else is scoped under
   .pg-email so it can't leak into other views.
   ============================================================ */

.pg-email {
  max-width: 980px;
}

/* ---- header ------------------------------------------------- */
.pg-email-head { margin-bottom: 22px; }
.pg-email-title {
  font-family: var(--font-mont);
  font-weight: 700; font-size: 28px; line-height: 34px;
  letter-spacing: -0.5px; color: var(--d-ink);
  margin: 0 0 6px;
}
.pg-email-sub {
  font-family: var(--font-body);
  font-weight: 400; font-size: 14px; line-height: 19px;
  color: var(--d-muted); margin: 0;
}

/* ---- filter tabs + search ----------------------------------- */
.pg-email-tabs {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 18px;
}
.pg-email-tab {
  appearance: none; cursor: pointer;
  border: none; background: none;
  height: 30px; padding: 0 12px; border-radius: 8px;
  font-family: var(--font-body); font-weight: 500; font-size: 13px;
  color: var(--d-muted);
  transition: background 0.12s, color 0.12s;
}
.pg-email-tab:hover { color: var(--d-ink); }
.pg-email-tab.active {
  background: #eef3ff; color: var(--d-blue); font-weight: 600;
}

/* search pushes to the right edge of the tab row */
.pg-email-search {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 12px;
  background: var(--d-card);
  border: 1px solid var(--d-line-2); border-radius: 9px;
  color: var(--d-faint);
  min-width: 200px;
}
.pg-email-search input {
  border: none; outline: none; background: none; width: 100%;
  font-family: var(--font-body); font-size: 13px; color: var(--d-ink);
}
.pg-email-search input::placeholder { color: var(--d-faint); }

/* ---- two-column layout -------------------------------------- */
.pg-email-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 22px;
  align-items: start;
}

/* ---- list card ---------------------------------------------- */
.pg-email-list {
  background: var(--d-card);
  border: 1px solid var(--d-line);
  border-radius: 16px;
  box-shadow: var(--d-shadow-card);
  padding: 8px;
  overflow: hidden;
}

.pg-email-row {
  display: flex; align-items: center; gap: 14px; width: 100%;
  text-align: left; cursor: pointer;
  border: none; background: none;
  padding: 13px 12px; border-radius: 11px;
  transition: background 0.12s;
}
.pg-email-row + .pg-email-row { box-shadow: inset 0 1px 0 var(--d-line); }
.pg-email-row:hover { background: var(--d-canvas); }
.pg-email-row.selected { background: #f5f8ff; box-shadow: none; }
.pg-email-row.selected + .pg-email-row { box-shadow: none; }

.pg-email-row-mark {
  flex: 0 0 auto;
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--d-line-2); background: var(--d-card);
}

.pg-email-row-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pg-email-row-sender {
  font-family: var(--font-body); font-weight: 600; font-size: 13.5px;
  line-height: 18px; color: var(--d-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pg-email-row-subject {
  font-family: var(--font-body); font-weight: 400; font-size: 12.5px;
  line-height: 16px; color: var(--d-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* verdict pill — sized down a touch from the global .ov-pill 110px */
.pg-email-row-pill { flex: 0 0 auto; width: auto; padding: 0 12px; }

.pg-email-row-score {
  flex: 0 0 auto; width: 24px; text-align: right;
  font-family: var(--font-body); font-weight: 400; font-size: 12px;
  color: var(--d-faint);
}

/* ---- detail card -------------------------------------------- */
.pg-email-detail {
  background: var(--d-card);
  border: 1px solid var(--d-line);
  border-radius: 16px;
  box-shadow: var(--d-shadow-card);
  padding: 18px;
  min-height: 240px;
}

.pg-email-detail-head {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px;
}
.pg-email-detail-ic {
  flex: 0 0 auto;
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.pg-email-detail-ic.malicious  { background: var(--d-danger-bg); color: var(--d-danger-ink); }
.pg-email-detail-ic.suspicious { background: var(--d-warn-bg);   color: var(--d-warn-ink); }

.pg-email-detail-meta { min-width: 0; padding-top: 1px; }
.pg-email-detail-subject {
  font-family: var(--font-mont); font-weight: 700; font-size: 15px;
  line-height: 20px; color: var(--d-ink); margin-bottom: 3px;
}
.pg-email-detail-from {
  font-family: var(--font-body); font-weight: 400; font-size: 13px;
  line-height: 17px; color: var(--d-muted);
  word-break: break-all;
}

/* verdict card — score circle + label + one-line reason */
.pg-email-verdict {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; border-radius: 12px; margin-bottom: 18px;
}
.pg-email-verdict.malicious  { background: var(--d-danger-bg); }
.pg-email-verdict.suspicious { background: var(--d-warn-bg); }

.pg-email-verdict-score {
  flex: 0 0 auto;
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--d-card);
  font-family: var(--font-mont); font-weight: 700; font-size: 15px;
}
.pg-email-verdict.malicious  .pg-email-verdict-score { color: var(--d-danger-ink); }
.pg-email-verdict.suspicious .pg-email-verdict-score { color: var(--d-warn-ink); }

.pg-email-verdict-text { min-width: 0; }
.pg-email-verdict-label {
  font-family: var(--font-mont); font-weight: 700; font-size: 14px;
  line-height: 18px; margin-bottom: 2px;
}
.pg-email-verdict.malicious  .pg-email-verdict-label { color: var(--d-danger-ink); }
.pg-email-verdict.suspicious .pg-email-verdict-label { color: var(--d-warn-ink); }
.pg-email-verdict-reason {
  font-family: var(--font-body); font-weight: 400; font-size: 12.5px;
  line-height: 17px; color: var(--d-ink-soft);
}

/* "WHY IT WAS FLAGGED" */
.pg-email-why-label {
  font-family: var(--font-body); font-weight: 700; font-size: 10.5px;
  letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--d-faint); margin-bottom: 10px;
}
.pg-email-why {
  list-style: none; margin: 0 0 20px; padding: 0;
  display: flex; flex-direction: column; gap: 9px;
}
.pg-email-why li {
  position: relative; padding-left: 16px;
  font-family: var(--font-body); font-weight: 400; font-size: 13px;
  line-height: 17px; color: var(--d-ink-soft);
}
.pg-email-why li::before {
  content: ''; position: absolute; left: 2px; top: 6px;
  width: 5px; height: 5px; border-radius: 50%;
  background: #e5484d;
}

/* actions */
.pg-email-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pg-email-btn {
  appearance: none; cursor: pointer;
  height: 36px; padding: 0 16px; border-radius: 9px;
  border: 1px solid var(--d-line-2); background: var(--d-card);
  font-family: var(--font-body); font-weight: 600; font-size: 13px;
  color: var(--d-ink);
  transition: background 0.12s, border-color 0.12s;
}
.pg-email-btn:hover { background: var(--d-canvas); }
.pg-email-btn.primary {
  background: var(--d-blue-600); border-color: var(--d-blue-600); color: #fff;
}
.pg-email-btn.primary:hover { background: var(--d-blue); border-color: var(--d-blue); }

/* ---- empty / placeholder / loading states ------------------- */
.pg-email-loading, .pg-email-error {
  padding: 30px; text-align: center;
  font-family: var(--font-body); font-size: 13px; color: var(--d-muted);
}
.pg-email-error { color: var(--d-danger-ink); }

.pg-email-empty, .pg-email-placeholder {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 4px; padding: 48px 24px;
}
.pg-email-empty-ic, .pg-email-placeholder-ic {
  display: inline-flex; margin-bottom: 6px; color: var(--d-faint);
}
.pg-email-empty h4, .pg-email-placeholder h4 {
  font-family: var(--font-mont); font-weight: 700; font-size: 15px;
  color: var(--d-ink); margin: 0;
}
.pg-email-empty p, .pg-email-placeholder p {
  font-family: var(--font-body); font-size: 13px; line-height: 18px;
  color: var(--d-muted); margin: 0; max-width: 240px;
}

/* ---- responsive: stack the two columns ---------------------- */
@media (max-width: 880px) {
  .pg-email-grid { grid-template-columns: 1fr; }
  .pg-email-search { min-width: 0; }
}
