/* data-safety.css — Data safety page (backup + unified trash) Phase 2
   Redesigned to match customer/reminder design system
   Full-width, white header card, GP blue, 12-16px radii, compact typography */

/* ── Page shell (full-width, matches workspace bg) ── */
.data-safety-page {
  display: none;
  padding: 18px;
  overflow: auto;
  background: #f5f7fb;
}
.data-safety-page.active {
  display: block;
}

/* ── Header card (matches rc-header pattern) ── */
.ds-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border: 1px solid #dfe6f1;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(15, 23, 42, .04);
  margin-bottom: 16px;
}
.ds-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.ds-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #eef4ff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0B63F6;
  font-size: 22px;
  flex-shrink: 0;
}
.ds-header-text .ds-kicker {
  color: #0B63F6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ds-header-text h1 {
  margin: 3px 0 2px;
  color: #0f172a;
  font-size: 20px;
  font-weight: 700;
}
.ds-header-text p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}
.ds-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Tabs (pill chips, matches customer filter chips) ── */
.ds-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.ds-tab {
  padding: 7px 18px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ds-tab:hover {
  border-color: #0B63F6;
  color: #0B63F6;
}
.ds-tab.active {
  background: #0B63F6;
  color: #fff;
  border-color: #0B63F6;
}

/* ── KPI grid (status cards) ── */
.ds-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.ds-kpi {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid #dfe6f1;
  border-radius: 12px;
  background: #fff;
  color: #64748b;
}
.ds-kpi > i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #eef4ff;
  color: #0B63F6;
  font-size: 16px;
  flex-shrink: 0;
}
.ds-kpi > span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ds-kpi b {
  color: #172033;
  font-size: 18px;
  font-weight: 700;
}
.ds-kpi small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: #64748b;
}
.ds-kpi.success > i { background: #f0fdf4; color: #16a34a; }
.ds-kpi.warning > i { background: #fff7e8; color: #d97706; }
.ds-kpi.danger > i { background: #fff0f0; color: #dc2626; }

/* ── Alerts section ── */
.ds-alerts {
  margin-bottom: 16px;
}
.ds-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}
.ds-alert.critical {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}
.ds-alert.warning {
  background: #fff7e8;
  border: 1px solid #fde68a;
  color: #a16207;
}
.ds-alert i {
  font-size: 18px;
  flex-shrink: 0;
}
.ds-alert.critical i { color: #dc2626; }
.ds-alert.warning i { color: #d97706; }

/* ── Storage bar ── */
.ds-storage-bar-wrap {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #dfe6f1;
  border-radius: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ds-storage-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #64748b;
}
.ds-storage-label strong {
  color: #0f172a;
  font-size: 13px;
}
.ds-storage-bar {
  height: 6px;
  border-radius: 3px;
  background: #e8ecf2;
  overflow: hidden;
}
.ds-storage-fill {
  height: 100%;
  border-radius: 3px;
  background: #0B63F6;
  transition: width .3s;
}
.ds-storage-fill.warning { background: #d97706; }
.ds-storage-fill.danger { background: #dc2626; }

/* ── Buttons ── */
.ds-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #d9e2ef;
  border-radius: 9px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.ds-btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.ds-btn.primary {
  background: #0B63F6;
  border-color: #0B63F6;
  color: #fff;
  font-weight: 700;
}
.ds-btn.primary:hover { background: #0851D4; }
.ds-btn.danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  font-weight: 600;
}
.ds-btn.danger:hover { background: #b91c1c; }
.ds-btn.warn {
  background: #ea580c;
  border-color: #ea580c;
  color: #fff;
  font-weight: 600;
}
.ds-btn.warn:hover { background: #c2410c; }
.ds-btn:disabled { opacity: .45; cursor: not-allowed; }
.ds-btn.ds-btn-sm {
  min-height: 28px;
  padding: 0 10px;
  font-size: 11px;
  border-radius: 7px;
}

/* ── Config section (legacy, kept for modal compatibility) ── */
.ds-config-section {
  background: #fff;
  border: 1px solid #dfe6f1;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.ds-config-section h3 {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}
.ds-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.ds-config-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ds-config-field > span {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}
.ds-config-field input,
.ds-config-field select {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  font-size: 13px;
  color: #0f172a;
  background: #fff;
}
.ds-config-field input[type="number"] {
  width: 80px;
}
.ds-config-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.ds-config-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
}

/* ── Config card (redesigned) ── */
.ds-config-card {
  background: #fff;
  border: 1px solid #dfe6f1;
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}

/* Auto-backup control row */
.ds-config-auto-row {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #edf0f5;
  background: #fafbfc;
}
.ds-config-auto-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ds-config-auto-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.ds-config-auto-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #0B63F6;
  cursor: pointer;
  flex-shrink: 0;
}
.ds-config-auto-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}
.ds-config-auto-desc {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
  padding-left: 28px;
}

/* Groups container — 3 equal columns on desktop */
.ds-config-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.ds-config-group {
  padding: 16px 20px;
  border-right: 1px solid #edf0f5;
}
.ds-config-group:last-child {
  border-right: none;
}
.ds-config-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.ds-config-group-title i {
  font-size: 14px;
  color: #0B63F6;
}

/* Field label (shared) */
.ds-config-field-label {
  display: block;
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 4px;
}

/* Shared input styling for config card */
.ds-config-time-field input,
.ds-config-ret-field input,
.ds-config-storage-field input {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  font-size: 13px;
  color: #0f172a;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}

/* Time composite */
.ds-config-time-composite {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.ds-config-time-field {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.ds-config-time-field .ds-config-field-label {
  margin-bottom: 4px;
}
.ds-config-time-sep {
  font-size: 20px;
  font-weight: 700;
  color: #94a3b8;
  padding-bottom: 8px;
  flex-shrink: 0;
}

/* Retention mini-grid — 3 columns */
.ds-config-retention-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.ds-config-ret-field {
  display: flex;
  flex-direction: column;
}
.ds-config-ret-field .ds-config-field-label {
  margin-bottom: 4px;
}

/* Storage body */
.ds-config-storage-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ds-config-storage-field {
  display: flex;
  flex-direction: column;
}
.ds-config-storage-field .ds-config-field-label {
  margin-bottom: 4px;
}
.ds-config-storage-field input {
  max-width: 120px;
}

/* Checkbox inside groups */
.ds-config-group .ds-config-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
}
.ds-config-group .ds-config-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #0B63F6;
  cursor: pointer;
  flex-shrink: 0;
}

/* Footer */
.ds-config-footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 20px;
  border-top: 1px solid #edf0f5;
  background: #fafbfc;
}

/* ── Responsive: config card ── */
@media (max-width: 900px) {
  .ds-config-groups {
    grid-template-columns: 1fr 1fr;
  }
  .ds-config-group:nth-child(2) {
    border-right: none;
  }
  .ds-config-group:nth-child(3) {
    grid-column: 1 / -1;
    border-top: 1px solid #edf0f5;
  }
}
@media (max-width: 600px) {
  .ds-config-groups {
    grid-template-columns: 1fr;
  }
  .ds-config-group {
    border-right: none;
    border-bottom: 1px solid #edf0f5;
  }
  .ds-config-group:last-child {
    border-bottom: none;
  }
  .ds-config-retention-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .ds-config-auto-row {
    padding: 14px 16px;
  }
  .ds-config-group {
    padding: 14px 16px;
  }
  .ds-config-footer {
    padding: 10px 16px;
  }
}

/* ── Table shell (white rounded card) ── */
.ds-table-shell {
  border: 1px solid #dfe6f1;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  margin-bottom: 16px;
}
.ds-table-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #edf0f5;
  background: #fafbfc;
}
.ds-table-toolbar .ds-btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
}
.ds-table-wrap {
  overflow-x: auto;
}
.ds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.ds-table th {
  text-align: left;
  padding: 9px 14px;
  background: #f8fafd;
  color: #64748b;
  font-weight: 500;
  font-size: 11px;
  border-bottom: 1px solid #edf0f5;
  white-space: nowrap;
}
.ds-table td {
  padding: 9px 14px;
  border-bottom: 1px solid #f8fafd;
  white-space: nowrap;
  color: #334155;
}
.ds-table tr:last-child td { border-bottom: none; }
.ds-table tbody tr:hover td { background: #f8faff; }

/* ── Status badges ── */
.ds-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .02em;
}
.ds-badge-success { background: #dcfce7; color: #16a34a; }
.ds-badge-failed  { background: #fef2f2; color: #dc2626; }
.ds-badge-progress { background: #fef3c7; color: #d97706; }
.ds-badge-manual  { background: #eef4ff; color: #0B63F6; }
.ds-badge-auto    { background: #f3e8ff; color: #7c3aed; }
.ds-badge-pre     { background: #fff7ed; color: #ea580c; }
.ds-badge-locked  { background: #fef2f2; color: #dc2626; }

/* ── Empty state ── */
.ds-empty {
  text-align: center;
  padding: 48px 20px;
  color: #94a3b8;
}
.ds-empty i {
  font-size: 40px;
  display: block;
  margin-bottom: 10px;
}

/* ── Trash filters ── */
.ds-trash-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}
.ds-trash-filters input {
  min-height: 36px;
  min-width: 200px;
  padding: 6px 10px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  font-size: 13px;
  color: #0f172a;
  background: #fff;
}

/* ── Trash type filter chips ── */
.ds-type-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.ds-type-chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.ds-type-chip:hover {
  border-color: #0B63F6;
  color: #0B63F6;
}
.ds-type-chip.active {
  background: #0B63F6;
  color: #fff;
  border-color: #0B63F6;
}

/* ── Days remaining colors ── */
.days-ok     { color: #16a34a; }
.days-warn   { color: #d97706; font-weight: 600; }
.days-danger { color: #dc2626; font-weight: 700; }

/* ── Password modal ── */
.ds-password-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(2px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ds-password-modal {
  background: #fff;
  border-radius: 15px;
  padding: 24px;
  width: 380px;
  max-width: 95vw;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .25);
}
.ds-password-modal h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: #dc2626;
}
.ds-password-modal p {
  margin: 0 0 16px;
  font-size: 13px;
  color: #64748b;
}
.ds-password-modal input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  box-sizing: border-box;
}
.ds-password-modal .ds-pm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.ds-pm-error {
  color: #dc2626;
  font-size: 12px;
  margin-bottom: 12px;
}

/* ── Confirm dialog ── */
.ds-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(2px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ds-confirm-box {
  background: #fff;
  border-radius: 15px;
  padding: 24px;
  width: 400px;
  max-width: 95vw;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .25);
}
.ds-confirm-box h3 {
  margin: 0 0 8px;
  font-size: 16px;
}
.ds-confirm-box p {
  margin: 0 0 20px;
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
  white-space: pre-line;
}
.ds-confirm-box .ds-cb-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Preview panel ── */
.ds-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(2px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ds-preview-panel {
  background: #fff;
  border-radius: 15px;
  padding: 24px;
  width: 560px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .25);
}
.ds-preview-panel h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: #0f172a;
}
.ds-preview-panel .ds-preview-meta {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 16px;
}
.ds-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.ds-preview-item {
  padding: 10px 12px;
  border: 1px solid #edf0f5;
  border-radius: 8px;
  background: #fafbfc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.ds-preview-item .label {
  color: #64748b;
  font-size: 11px;
}
.ds-preview-item .value {
  color: #0f172a;
  font-weight: 600;
}
.ds-preview-delta {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 600;
}
.ds-preview-delta.pos { color: #16a34a; }
.ds-preview-delta.neg { color: #dc2626; }
.ds-preview-delta.zero { color: #94a3b8; }
.ds-preview-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid #e5eaf2;
}

/* ── Loading ── */
.ds-loading {
  text-align: center;
  padding: 48px 20px;
  color: #94a3b8;
}
.ds-loading .spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e2e8f0;
  border-top-color: #0B63F6;
  border-radius: 50%;
  animation: ds-spin .6s linear infinite;
  margin: 0 auto 12px;
}
@keyframes ds-spin { to { transform: rotate(360deg); } }

/* ── Size formatting ── */
.ds-size {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 12px;
}

/* ── Table inline actions ── */
.ds-table td .ds-btn {
  min-height: 28px;
  padding: 0 8px;
  font-size: 11px;
  border-radius: 7px;
}
.ds-table td .ds-btn + .ds-btn { margin-left: 3px; }

/* ── Pagination ── */
.ds-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid #edf0f5;
  font-size: 13px;
  color: #64748b;
  background: #fafbfc;
  border-radius: 0 0 12px 12px;
}
.ds-pager button {
  min-height: 30px;
  padding: 0 14px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  cursor: pointer;
}
.ds-pager button:hover { border-color: #0B63F6; color: #0B63F6; }

/* ════════════════════════════════════════════════════════════════════
   Phase 2 — Trash tab redesign
   ════════════════════════════════════════════════════════════════════ */

/* ── Trash summary cards ── */
.ds-trash-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.ds-trash-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #dfe6f1;
  border-radius: 12px;
  background: #fff;
  color: #64748b;
}
.ds-trash-card > i {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #eef4ff;
  color: #0B63F6;
  font-size: 17px;
  flex-shrink: 0;
}
.ds-trash-card > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ds-trash-card b {
  color: #172033;
  font-size: 18px;
  font-weight: 700;
}
.ds-trash-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: #64748b;
}
.ds-trash-card-warn > i {
  background: #fff7e8;
  color: #d97706;
}

/* ── Enhanced filter bar inputs ── */
.ds-filter-search {
  min-width: 180px !important;
}
.ds-filter-input {
  min-width: 120px !important;
}
.ds-filter-date {
  min-width: 130px !important;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  font-size: 13px;
  color: #0f172a;
  background: #fff;
}
.ds-filter-num {
  min-width: 80px !important;
}
.ds-trash-filters .ds-filter-date,
.ds-trash-filters .ds-filter-num {
  min-height: 36px;
  max-height: 36px;
}

/* ── Batch action bar ── */
.ds-batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid #dfe6f1;
  border-radius: 12px;
  background: #fff;
  margin-bottom: 12px;
  opacity: .5;
  pointer-events: none;
  transition: all .2s;
}
.ds-batch-bar.active {
  opacity: 1;
  pointer-events: auto;
  border-color: #0B63F6;
  background: #eef4ff;
}
.ds-batch-count {
  font-size: 13px;
  font-weight: 600;
  color: #0B63F6;
  padding-right: 14px;
  border-right: 1px solid #cbd5e1;
  margin-right: 4px;
}

/* ── Select-all row ── */
.ds-select-all-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid #edf0f5;
  background: #fafbfc;
}
.ds-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #475569;
  cursor: pointer;
  font-weight: 500;
}
.ds-visible-count {
  font-size: 11px;
  color: #94a3b8;
}

/* ── Checkbox ── */
.ds-checkbox {
  width: 16px;
  height: 16px;
  accent-color: #0B63F6;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Trash row selected state ── */
.ds-trash-row.selected td {
  background: #eef4ff;
}

/* ── Days badges (Phase 2) ── */
.ds-days-ok {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  background: #dcfce7;
  color: #16a34a;
  font-size: 11px;
  font-weight: 600;
}
.ds-days-warn {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  background: #fef3c7;
  color: #d97706;
  font-size: 11px;
  font-weight: 600;
}
.ds-days-expired {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 11px;
  font-weight: 700;
}

/* ── Type tag in table ── */
.ds-type-tag {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
}

/* ── Trash name column ── */
.ds-trash-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Trash actions column ── */
.ds-trash-actions {
  white-space: nowrap;
}

/* ── Related badge ── */
.ds-related-badge {
  font-size: 11px;
  color: #64748b;
}

/* ── Reason text ── */
.ds-reason-text {
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
}

/* ── Dialog overlay (for batch dialogs) ── */
.ds-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(2px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ds-dialog-panel {
  background: #fff;
  border-radius: 15px;
  padding: 24px;
  width: 520px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .25);
}
.ds-dialog-panel h3 {
  margin: 0 0 8px;
  font-size: 16px;
}
.ds-dialog-panel p {
  margin: 0 0 16px;
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
}

/* ── Batch dialog item list ── */
.ds-dialog-items {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid #edf0f5;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 14px;
  background: #fafbfc;
}
.ds-dialog-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  font-size: 12px;
  border-bottom: 1px solid #f0f2f5;
}
.ds-dialog-item:last-child { border-bottom: none; }
.ds-dialog-item-type {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 8px;
  background: #eef4ff;
  color: #0B63F6;
  font-size: 10px;
  font-weight: 600;
  min-width: 60px;
  text-align: center;
}
.ds-dialog-item-id {
  color: #334155;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 11px;
}

/* ── Dialog password field ── */
.ds-dialog-pw {
  margin-bottom: 16px;
}
.ds-dialog-pw input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}

/* ── Dialog results ── */
.ds-dialog-results {
  margin-bottom: 16px;
  border: 1px solid #edf0f5;
  border-radius: 8px;
  padding: 12px;
  background: #fafbfc;
}
.ds-result-summary {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.ds-result-ok { color: #16a34a; }
.ds-result-err { color: #dc2626; }
.ds-result-details {
  max-height: 120px;
  overflow-y: auto;
}
.ds-result-item {
  font-size: 11px;
  padding: 3px 0;
  color: #64748b;
}
.ds-result-item.fail { color: #dc2626; }
.ds-backup-id {
  font-size: 11px;
  color: #64748b;
  font-family: "SF Mono", "Fira Code", monospace;
  margin-bottom: 6px;
}

/* ── Dialog actions ── */
.ds-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid #e5eaf2;
}

/* ── Safety notice ── */
.ds-safety-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: #fff7e8;
  color: #a16207;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 14px;
}
.ds-safety-notice i {
  font-size: 16px;
  color: #d97706;
  flex-shrink: 0;
}

/* ── Responsive: filter wrap on small screens ── */
@media (max-width: 768px) {
  .ds-trash-filters {
    flex-direction: column;
    align-items: stretch;
  }
  .ds-trash-filters input {
    min-width: 0 !important;
    width: 100%;
  }
  .ds-trash-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  .ds-batch-bar {
    flex-wrap: wrap;
  }
  .ds-header-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .ds-header-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .ds-trash-summary {
    grid-template-columns: 1fr;
  }
  .ds-dialog-panel {
    padding: 16px;
  }
}
