/* Retention page — cards, tier bars, sliders, summary, Synology-style timeline. Tokens from auth.css. */

.card { background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.card-title { font-size: 14.5px; font-weight: 600; margin: 0; letter-spacing: -0.005em; }
.card-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card.accent { border-color: var(--accent); }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.pill-accent { background: var(--accent-soft); color: var(--accent-text); }

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

/* Policy search box in the list card header */
.ret-search { max-width: 240px; }

/* Read-only policy row */
.ret-policy { border: 1px solid var(--border-strong); background: var(--surface); padding: 16px; display: flex; flex-direction: column; gap: 14px; cursor: pointer; text-align: left; width: 100%; }
.ret-policy:hover { border-color: var(--text-2); }
.ret-policy.static { cursor: default; }
.ret-policy.static:hover { border-color: var(--border-strong); }
.ret-policy-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ret-policy-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ret-policy-shield { color: var(--muted); flex-shrink: 0; }
.ret-policy-name { font-weight: 600; font-size: 14px; text-align: left; }
.ret-policy-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.ret-tier-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.ret-tier-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.ret-tier-label { font-size: 11.5px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.ret-tier-val { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ret-tier-off { color: var(--muted-2); }
@media (max-width: 760px) { .ret-tier-grid { grid-template-columns: repeat(2, 1fr); } }

/* Editor tier steppers (chevron buttons + value, per the design) */
.retention-tiers { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border); }
.retention-tier { display: flex; flex-direction: column; gap: 6px; }
.retention-tier-head { display: grid; grid-template-columns: 90px auto 1fr; align-items: center; gap: 12px; }
.retention-tier-label { font-size: 13px; font-weight: 500; color: var(--text); }
.retention-tier-unit { font-size: 12.5px; color: var(--muted); }
.retention-stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--border-strong); background: var(--surface); }
.retention-step-btn { width: 28px; display: grid; place-items: center; color: var(--text-2); background: var(--surface); transition: background 0.12s, color 0.12s; }
.retention-step-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.retention-step-btn:disabled { color: var(--muted-2); cursor: not-allowed; opacity: 0.6; }
.retention-tier-val { min-width: 44px; text-align: center; font-size: 13.5px; font-weight: 600; border-left: 1px solid var(--border); border-right: 1px solid var(--border); padding: 5px 8px; font-variant-numeric: tabular-nums; }
.retention-bar { height: 5px; background: var(--surface-3); border-radius: 3px; overflow: hidden; display: flex; }
.retention-bar-seg { height: 100%; transition: width 0.2s, background 0.2s; }
.retention-tier-floor { font-size: 11.5px; color: var(--muted); line-height: 1.4; padding-left: 102px; }
@media (max-width: 700px) { .retention-tier-head { grid-template-columns: 72px auto 1fr; gap: 8px; } .retention-tier-floor { padding-left: 0; } }

/* Summary */
.retention-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); }
.retention-summary > div { display: flex; flex-direction: column; gap: 4px; }
.retention-summary-label { font-size: 10.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.retention-summary-val { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.retention-summary-sub { font-size: 11.5px; color: var(--muted); }

.ret-editor-actions { border-top: 1px solid var(--border); padding-top: 14px; display: flex; justify-content: flex-end; gap: 8px; }

/* Timeline (Synology-style restore points) */
.timeline { display: flex; flex-direction: column; gap: 10px; padding: 24px 28px 20px; background: var(--surface); border: 1px solid var(--border); }
.timeline-head { display: flex; justify-content: space-between; align-items: baseline; }
.timeline-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
.timeline-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline-empty { font-size: 12.5px; color: var(--muted); padding: 12px 0; }
.timeline-track { position: relative; height: 56px; margin: 14px 0 8px; border-bottom: 1px solid var(--border-strong); }
.timeline-dot { position: absolute; top: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transform: translate(-50%, -50%); cursor: pointer; transition: transform 0.1s, background 0.1s; }
.timeline-dot:hover { background: var(--accent-text); transform: translate(-50%, -50%) scale(1.5); z-index: 3; }
/* Hover tooltip showing the restore point's age */
.timeline-dot::after {
  content: attr(data-age);
  position: absolute; bottom: 160%; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  font-size: 11px; font-weight: 500; padding: 3px 7px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.1s; z-index: 4;
}
.timeline-dot:hover::after { opacity: 1; }
.timeline-dot.no-tip::after { content: none; }
.timeline-now { position: absolute; bottom: 4px; transform: translateX(-50%); font-size: 10.5px; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.timeline-axis { position: relative; height: 16px; }
.timeline-tick { position: absolute; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Differential / PITR coverage controls */
.cov-grid { display: flex; flex-direction: column; gap: 10px; }
.cov-row { display: flex; align-items: center; gap: 10px; }
.cov-label { min-width: 140px; font-size: 13.5px; }
.cov-input { max-width: 90px; }

/* PITR / Differential coverage overlay on the restore-point timeline */
.timeline-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 11.5px; color: var(--text-2); }
.timeline-legend span { display: inline-flex; align-items: center; gap: 6px; }
.timeline-legend i { width: 16px; height: 4px; border-radius: 2px; flex-shrink: 0; }
.timeline-legend i.diff { background: #3b82f6; }
.timeline-legend i.incremental { background: #f59e0b; }
.timeline-legend i.pitr { background: #22c55e; }
.timeline-cover { position: absolute; height: 4px; border-radius: 2px; z-index: 2; }
.timeline-cover::before { content: ""; position: absolute; left: -2px; top: -2px; width: 8px; height: 8px; border-radius: 50%; }
.timeline-cover.cover-diff { top: 6px; background: #3b82f6; }
.timeline-cover.cover-diff::before { background: #3b82f6; }
.timeline-cover.cover-incremental { top: 16px; background: #f59e0b; }
.timeline-cover.cover-incremental::before { background: #f59e0b; }
.timeline-cover.cover-pitr { top: 26px; background: #22c55e; }
.timeline-cover.cover-pitr::before { background: #22c55e; }
