/* =============================================================
   Alert Page — 360eDash
   Themed per 360eDash Design System (guide_theme.pdf)
============================================================= */

:root {
  /* ---- Brand ---- */
  --al-primary: #0f6a71;        /* Primary Teal — tombol primary, active nav, ikon aksen, link */
  --al-primary-dark: #0b4f54;   /* Primary Dark — hover / pressed state dari primary */
  --al-primary-soft: #e4f1f1;   /* Primary Soft — tint bg untuk hover/active item */
  --al-header-teal: #6dc3bb;    /* Header Teal — dipakai di master header, referensi saja */
  --al-accent-orange: #fa891a;  /* Accent Orange — satu titik aksen saja, tidak untuk tombol/elemen berulang */

  /* ---- Status / Semantik (solid + soft) ---- */
  --al-success: #2f9e6e;
  --al-success-soft: #e3f5ec;
  --al-warning: #e3a21a;
  --al-warning-soft: #fcf1dc;
  --al-danger: #d64545;
  --al-danger-soft: #fbe9e9;
  --al-info: #3e7cb1;
  --al-info-soft: #e8effa;

  /* ---- Netral & Permukaan ---- */
  --al-ink: #25343f;
  --al-muted: #7c8b8d;
  --al-border: #e7edee;
  --al-surface: #ffffff;
  --al-page-bg: #f4f7f7;
}

/* ---------- Alert filter panel ---------- */
.alert-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.alert-stat-card {
  background: var(--al-surface);
  border: 1px solid var(--al-border);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.alert-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.alert-stat-icon-total { background: var(--al-primary-soft); color: var(--al-primary); }
.alert-stat-icon-high { background: var(--al-danger-soft); color: var(--al-danger); }
.alert-stat-icon-medium { background: var(--al-warning-soft); color: var(--al-warning); }
.alert-stat-icon-low { background: var(--al-success-soft); color: var(--al-success); }

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

.alert-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--al-muted);
}

.alert-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--al-ink);
}

.alert-page-wrap {
  max-width: 1320px;
  margin: 0 auto;
}

.alert-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.alert-panel {
  background: var(--al-surface);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(11, 79, 84, 0.06);
  margin-bottom: 20px;
}

.alert-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.alert-panel-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--al-ink);
  margin-bottom: 4px;
}

.alert-panel-subtitle {
  font-size: 13px;
  color: var(--al-muted);
  font-weight: 400;
}

.alert-add-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--al-primary);
  border: 1px solid var(--al-primary);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.alert-add-btn:hover {
  background: var(--al-primary-dark);
  border-color: var(--al-primary-dark);
}

.alert-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.alert-filters .alert-add-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.alert-search {
  flex: 2;
  min-width: 220px;
  position: relative;
}
.alert-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--al-muted);
  font-size: 13px;
}
.alert-search input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border-radius: 10px;
  border: 1px solid var(--al-border);
  background: #fbfcfc;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--al-ink);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.alert-search input::placeholder {
  color: var(--al-muted);
}
.alert-search input:focus {
  border-color: var(--al-primary);
  background: #fff;
}

.alert-sort-wrap {
  flex: 1;
  min-width: 180px;
  position: relative;
  display: flex;
  align-items: center;
}
.alert-sort-wrap i.fa-arrow-up-wide-short,
.alert-sort-wrap i.fa-sort {
  position: absolute;
  left: 14px;
  color: var(--al-muted);
  font-size: 12px;
  pointer-events: none;
}
.alert-sort-wrap i.fa-chevron-down {
  position: absolute;
  right: 14px;
  color: var(--al-muted);
  font-size: 11px;
  pointer-events: none;
}
.alert-sort {
  width: 100%;
  padding: 10px 14px;
  padding-left: 34px;
  border-radius: 10px;
  border: 1px solid var(--al-border);
  background: #fbfcfc;
  color: var(--al-ink);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

/* ---------- Table card ---------- */
.alert-table-card {
  background: var(--al-surface);
  border: 1px solid var(--al-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(11, 79, 84, 0.05);
}

.alert-table-scroll {
  overflow-x: auto;
}

table.alert-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.alert-table thead th {
  text-align: left;
  padding: 14px 20px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--al-muted);
  background: #f8fafa;
  border-bottom: 1px solid var(--al-border);
  white-space: nowrap;
}

.alert-table tbody td {
  padding: 14px 20px;
  font-size: 13.5px;
  color: var(--al-ink);
  border-bottom: 1px solid var(--al-border);
  vertical-align: middle;
}

.alert-table tbody tr:last-child td {
  border-bottom: none;
}

.alert-table tbody tr:hover {
  background: #fbfdfd;
}

.alert-type-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.alert-type-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--al-primary-soft);
  color: var(--al-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.count-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--al-primary-soft);
  color: var(--al-primary-dark);
  font-size: 10.5px;
  font-weight: 600;
  flex-shrink: 0;
}

.severity-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.severity-badge.high {
  background: var(--al-danger-soft);
  color: var(--al-danger);
}
.severity-badge.medium {
  background: var(--al-warning-soft);
  color: #96700f;
}
.severity-badge.low {
  background: var(--al-success-soft);
  color: #1f7a54;
}
.severity-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.alert-main-cell {
  max-width: 300px;
}
.alert-main-title {
  font-weight: 600;
  color: var(--al-ink);
  margin-bottom: 2px;
}
.alert-desc-cell {
  color: var(--al-muted);
  font-weight: 400;
  font-size: 12.5px;
  line-height: 1.5;
}

.alert-date-cell {
  white-space: nowrap;
}
.alert-date-cell .date-main {
  font-weight: 500;
}
.alert-date-cell .date-sub {
  display: block;
  font-size: 11.5px;
  color: var(--al-muted);
  margin-top: 2px;
}

.alert-actions-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--al-border);
  background: #fff;
  color: var(--al-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.alert-action-btn:hover {
  background: var(--al-danger-soft);
  color: var(--al-danger);
  border-color: var(--al-danger-soft);
}

.alert-action-btn.edit-btn:hover {
  background: var(--al-primary-soft);
  color: var(--al-primary-dark);
  border-color: var(--al-primary-soft);
}

/* ---------- Pagination footer ---------- */
.alert-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--al-border);
  flex-wrap: wrap;
}

.pg-info {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--al-muted);
}

.pg-controls {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}

.pg-btn {
  height: 30px; min-width: 30px; padding: 0 8px;
  border-radius: 8px; border: 1px solid var(--al-border);
  background: #fff; color: var(--al-ink); font-family: inherit;
  font-size: 12px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.pg-btn:hover:not(:disabled) { background: var(--al-primary-soft); border-color: var(--al-primary-soft); color: var(--al-primary-dark); }
.pg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pg-page {
  height: 30px; min-width: 30px; padding: 0 8px;
  border-radius: 8px; border: 1px solid var(--al-primary);
  background: var(--al-primary); color: #fff; font-family: inherit;
  font-size: 12px; font-weight: 500; display: inline-flex;
  align-items: center; justify-content: center;
}

/* ---------- Alert detail modal (read-only) ---------- */
.detail-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.detail-category {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--al-muted);
  background: var(--al-page-bg);
  border: 1px solid var(--al-border);
  border-radius: 999px;
  padding: 4px 10px;
}

.detail-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--al-border);
}

.detail-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.detail-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--al-muted);
}

.detail-value {
  font-size: 14px;
  color: var(--al-ink);
}

.detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-chips .chip {
  background: var(--al-primary-soft);
  color: var(--al-primary-dark);
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
}

/* Rows are clickable to open the detail modal */
.alert-table tbody tr {
  cursor: pointer;
}
.alert-table tbody tr:hover {
  background: var(--al-page-bg);
}
.alert-actions-cell {
  cursor: default;
}

/* ---------- Add / Edit Alert modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(13, 32, 35, 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--al-surface);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(11, 79, 84, 0.28);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.18s ease;
  max-height: calc(100vh - 40px);
  /* Clip children (incl. the inner scrollbar) to the rounded corners.
     overflow-y:auto used to live here directly, which on Windows/Firefox
     paints the scrollbar track as a hard rectangle over the corner —
     that's what caused the "square right side" look. Scrolling now
     happens on .modal-scroll instead, one level in. */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-backdrop.is-open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 26px 26px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: -24px;
  margin: -24px -26px 18px;
  padding: 24px 26px 0;
  background: var(--al-surface);
  z-index: 2;
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--al-ink);
}
.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--al-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}
.modal-close:hover {
  background: var(--al-danger-soft);
  color: var(--al-danger);
}

/* ---- Section eyebrow (groups fields inside the modal) ---- */
.modal-section-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--al-muted);
  margin: 22px 0 12px;
  padding-top: 14px;
  border-top: 1px solid var(--al-border);
}
.modal-section-label:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.modal-section-hint {
  font-size: 11.5px;
  color: var(--al-muted);
  margin: -8px 0 12px;
  line-height: 1.5;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.modal-field[hidden] {
  display: none;
}

.title-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.title-input-row .modal-input {
  flex: 1;
}
.video-call-toggle {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid var(--al-border);
  background: #fbfcfc;
  color: var(--al-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.video-call-toggle:hover {
  border-color: var(--al-primary);
  color: var(--al-primary);
}
.video-call-toggle.is-active {
  background: var(--al-primary);
  border-color: var(--al-primary);
  color: #fff;
}
.video-call-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--al-muted);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.video-call-toggle.is-active .video-call-badge {
  background: var(--al-danger);
}
.modal-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--al-muted);
}

.modal-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-input,
.modal-select,
.modal-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--al-border);
  background: #fbfcfc;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--al-ink);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.modal-input::placeholder,
.modal-textarea::placeholder {
  color: #b6c2c3;
}
.modal-input:focus,
.modal-select:focus,
.modal-textarea:focus {
  border-color: var(--al-primary);
  background: #fff;
}
.modal-input:disabled,
.modal-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.modal-select-wrap {
  position: relative;
}
.modal-select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  cursor: pointer;
}
.modal-select-wrap select:invalid {
  color: #8a9698;
}
.modal-select-wrap i {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--al-muted);
  font-size: 11px;
  pointer-events: none;
}

.modal-textarea {
  resize: vertical;
  min-height: 70px;
  line-height: 1.5;
}

/* ---- Multi-select w/ search (Select Project) ---- */
.ms-control {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--al-border);
  background: #fbfcfc;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.ms-control:hover {
  border-color: var(--al-primary);
}
.ms-control.is-open {
  border-color: var(--al-primary);
  background: #fff;
}
.ms-chips {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ms-placeholder {
  font-size: 13.5px;
  color: #b6c2c3;
  padding: 3px 2px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: var(--al-primary-soft);
  color: var(--al-primary-dark);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.chip-remove {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: rgba(11, 79, 84, 0.14);
  color: var(--al-primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  cursor: pointer;
  flex-shrink: 0;
}
.chip-remove:hover {
  background: var(--al-primary-dark);
  color: #fff;
}
.ms-trigger {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--al-muted);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ms-panel {
  margin-top: 8px;
  border: 1px solid var(--al-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(11, 79, 84, 0.08);
  overflow: hidden;
}
.ms-panel[hidden] { display: none; }

.ms-search {
  position: relative;
  padding: 8px;
  border-bottom: 1px solid var(--al-border);
}
.ms-search i {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--al-muted);
  font-size: 12px;
}
.ms-search input {
  width: 100%;
  padding: 8px 10px 8px 30px;
  border-radius: 8px;
  border: 1px solid var(--al-border);
  background: #fbfcfc;
  font-family: inherit;
  font-size: 13px;
  color: var(--al-ink);
  outline: none;
}
.ms-search input:focus {
  border-color: var(--al-primary);
}

.ms-options,
.checklist-box {
  max-height: 168px;
  overflow-y: auto;
  padding: 6px;
}
.checklist-box {
  border: 1px solid var(--al-border);
  border-radius: 10px;
  background: #fbfcfc;
}

.ms-option,
.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--al-ink);
  transition: background 0.12s ease;
}
.ms-option:hover,
.checklist-item:hover {
  background: var(--al-primary-soft);
}
.ms-option input[type="checkbox"],
.checklist-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--al-primary);
  flex-shrink: 0;
  cursor: pointer;
}
.ms-option-empty,
.checklist-empty {
  padding: 14px 10px;
  text-align: center;
  font-size: 12.5px;
  color: var(--al-muted);
}

/* ---- System type — compact toggle chip grid ---- */
.chip-toggle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--al-border);
  background: #fbfcfc;
  color: var(--al-muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.chip-toggle i {
  font-size: 11px;
}
.chip-toggle:hover {
  border-color: var(--al-primary);
  color: var(--al-primary-dark);
}
.chip-toggle.is-active {
  background: var(--al-primary);
  border-color: var(--al-primary);
  color: #fff;
}

/* ---- Toggle switch (All day) ---- */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #d7e0e1;
  border-radius: 999px;
  transition: background 0.15s ease;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--al-primary);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
}
.toggle-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--al-ink);
}

/* ---- Small hint / summary text under a field ---- */
.field-hint {
  font-size: 11px;
  color: var(--al-muted);
  margin-top: 4px;
  line-height: 1.4;
}

/* ---- Travel time / Reminder "Custom…" inline row ---- */
.custom-inline-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.custom-inline-row[hidden] {
  display: none;
}
.custom-inline-row .modal-select-wrap {
  flex: 1;
}
.repeat-interval-input {
  width: 68px;
  text-align: center;
  flex-shrink: 0;
}

/* ---- Custom recurrence popover (Weekly / Monthly / Yearly) ---- */
.repeat-popover {
  position: relative;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--al-border);
  border-radius: 12px;
  background: #fbfcfc;
  box-shadow: 0 8px 20px rgba(11, 79, 84, 0.08);
}
.repeat-popover-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--al-ink);
  margin-bottom: 12px;
}
.repeat-popover .modal-field {
  margin-bottom: 12px;
}

.repeat-sub {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
/* [hidden] has the same CSS specificity as a class selector, so without
   this explicit override the display:flex above wins and the panel stays
   visible — that's what caused Weekly/Monthly/Yearly to show at once. */
.repeat-sub[hidden] {
  display: none;
}

.repeat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.repeat-row span {
  font-size: 13px;
  color: var(--al-ink);
  font-weight: 500;
  flex-shrink: 0;
}
.repeat-end-row .modal-select-wrap {
  flex: 1;
  min-width: 110px;
}

/* Weekly: day-of-week pills */
.repeat-days {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.day-pill {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--al-border);
  background: #fff;
  color: var(--al-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.day-pill:hover {
  border-color: var(--al-primary);
}
.day-pill.is-active {
  background: var(--al-primary);
  border-color: var(--al-primary);
  color: #fff;
}

/* Monthly: mini calendar grid */
/* Monthly "Each" vs "On the", Yearly "On the" toggle rows */
.repeat-radio-row,
.repeat-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--al-ink);
  cursor: pointer;
}
.repeat-radio-row input[type="radio"],
.repeat-checkbox-row input[type="checkbox"] {
  accent-color: var(--al-primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}
.repeat-onthe-row {
  padding-left: 23px;
}
.repeat-onthe-row .modal-select-wrap {
  flex: 1;
}
.modal-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #eef2f2;
}

.repeat-calendar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--al-muted);
}
.repeat-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  transition: opacity 0.15s ease;
}
.repeat-calendar.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}
.repeat-calendar .cal-weekday {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--al-muted);
  padding-bottom: 4px;
}
.repeat-calendar .cal-day {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--al-ink);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.repeat-calendar .cal-day:hover {
  border-color: var(--al-primary);
}
.repeat-calendar .cal-day.is-active {
  background: var(--al-primary);
  color: #fff;
}
.repeat-calendar .cal-day.is-empty {
  cursor: default;
  pointer-events: none;
}

/* Yearly: month grid */
.repeat-months {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.repeat-months .month-pill {
  padding: 8px 4px;
  border-radius: 8px;
  border: 1px solid var(--al-border);
  background: #fff;
  color: var(--al-ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.repeat-months .month-pill:hover {
  border-color: var(--al-primary);
}
.repeat-months .month-pill.is-active {
  background: var(--al-primary);
  border-color: var(--al-primary);
  color: #fff;
}

.repeat-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--al-border);
}
.repeat-popover-actions .modal-btn {
  width: auto;
  padding: 8px 16px;
  font-size: 12.5px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}
.modal-actions .modal-btn {
  width: auto;
  padding: 11px 22px;
}
.modal-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.modal-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.modal-btn-primary {
  background: var(--al-primary);
  color: #fff;
  border-color: var(--al-primary);
}
.modal-btn-primary:hover {
  background: var(--al-primary-dark);
  border-color: var(--al-primary-dark);
}
.modal-btn-secondary {
  background: #fff;
  color: var(--al-muted);
  border-color: var(--al-border);
}
.modal-btn-secondary:hover {
  background: #f5f8f8;
  color: var(--al-ink);
}
.modal-btn-danger {
  background: var(--al-danger);
  color: #fff;
  border-color: var(--al-danger);
}
.modal-btn-danger:hover {
  background: #b93636;
  border-color: #b93636;
}
.modal-btn-danger-ghost {
  background: transparent;
  color: var(--al-danger);
  border-color: var(--al-danger-soft);
}
.modal-btn-danger-ghost:hover {
  background: var(--al-danger-soft);
}

/* ---------- Delete confirmation modal ---------- */
.confirm-card {
  max-width: 360px;
  text-align: center;
  padding: 28px 26px 26px;
}
.confirm-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--al-danger-soft);
  color: var(--al-danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin: 0 auto 16px;
}
.confirm-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--al-ink);
  margin-bottom: 8px;
}
.confirm-text {
  font-size: 13px;
  color: var(--al-muted);
  line-height: 1.5;
  margin-bottom: 4px;
}
.confirm-text strong {
  color: var(--al-ink);
  font-weight: 600;
}
.confirm-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.confirm-actions .modal-btn {
  width: auto;
  flex: 1;
}

@media (max-width: 1100px) {
  .alert-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .alert-stats-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .alert-page-head {
    flex-direction: column;
    align-items: stretch;
  }
  .alert-panel-header {
    flex-direction: column;
    align-items: stretch;
  }
  .alert-add-btn {
    justify-content: center;
  }
  .modal-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .modal-actions .modal-btn {
    width: 100%;
  }
  .modal-actions-right {
    flex-direction: column-reverse;
    align-items: stretch;
    width: 100%;
    margin-left: 0;
  }
  .modal-grid-2 {
    grid-template-columns: 1fr;
  }
}
/* ---------- Notification-focus highlight ----------
   Applied briefly to a table row when the user arrives here from
   the header notification bell, so the exact alert it was about
   is easy to spot among all the others. */
tr.row-flash-highlight {
  animation: alertRowFlash 2.4s ease;
}
@keyframes alertRowFlash {
  0%   { background: var(--al-primary-soft); box-shadow: inset 3px 0 0 var(--al-primary); }
  70%  { background: var(--al-primary-soft); box-shadow: inset 3px 0 0 var(--al-primary); }
  100% { background: transparent; box-shadow: inset 3px 0 0 transparent; }
}