/* ═══════════════════════════════════════════════════════════════════════════
   PropertyDesk — Recurring Schedules   (pd-sc-*)
   Phase 9 — mirrors pd-vp-* (Vendor Directory) visual identity.
   ═══════════════════════════════════════════════════════════════════════════ */

.pd-sc-wrap { max-width: 100%; margin: 0 0 40px; font-family: inherit; }

/* ── Sub-header ───────────────────────────────────────────────────────────── */
.pd-sc-subhdr {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
}
.pd-sc-subhdr__meta { font-size: 13px; color: #64748b; font-weight: 500; }
.pd-sc-subhdr__acts { display: flex; gap: 8px; align-items: center; }

.pd-sc-btn-primary, .pd-sc-btn-secondary, .pd-sc-btn-danger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 6px; font-size: 13px; font-weight: 500;
  text-decoration: none !important; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.pd-sc-btn-primary { background: #2e8b57; color: #fff !important; border-color: #2e8b57; }
.pd-sc-btn-primary:hover { background: #267a4c; border-color: #267a4c; color: #fff !important; }
.pd-sc-btn-secondary { background: #fff; color: #374151 !important; border-color: #d1d5db; padding: 7px 14px; font-size: 12px; }
.pd-sc-btn-secondary:hover { background: #f3f4f6; border-color: #9ca3af; }
.pd-sc-btn-danger { background: #fff; color: #b91c1c !important; border-color: #fecaca; padding: 7px 14px; font-size: 12px; }
.pd-sc-btn-danger:hover { background: #fee2e2; border-color: #fca5a5; }

/* ── KPI strip ────────────────────────────────────────────────────────────── */
.pd-sc-kpis {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-bottom: 16px;
}
.pd-sc-kpi {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 14px 16px; position: relative; overflow: hidden;
}
.pd-sc-kpi::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: #cbd5e1;
}
.pd-sc-kpi--good::before { background: #2e8b57; }
.pd-sc-kpi--bad::before  { background: #dc2626; }
.pd-sc-kpi--info::before { background: #0ea5e9; }
.pd-sc-kpi--neutral::before { background: #cbd5e1; }
.pd-sc-kpi__label { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.pd-sc-kpi__value { font-size: 26px; font-weight: 700; color: #111827; margin-top: 4px; }
.pd-sc-kpi__sub   { font-size: 12px; color: #6b7280; margin-top: 2px; }

/* ── Filter bar ───────────────────────────────────────────────────────────── */
.pd-sc-filters {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
  padding: 12px 14px; background: #f8fafc;
  border: 1px solid #e5e7eb; border-radius: 8px 8px 0 0; border-bottom: none;
}
.pd-sc-fg { display: flex; flex-direction: column; gap: 3px; }
.pd-sc-fg label { font-size: 11px; color: #6b7280; font-weight: 500; }
.pd-sc-fsel, .pd-sc-finput {
  padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 5px;
  font-size: 13px; background: #fff; color: #374151; min-width: 140px;
}
.pd-sc-fsel:focus, .pd-sc-finput:focus {
  outline: none; border-color: #2e8b57; box-shadow: 0 0 0 2px rgba(46,139,87,.12);
}
.pd-sc-apply-btn {
  padding: 7px 16px; background: #2e8b57; color: #fff;
  border: 1px solid #2e8b57; border-radius: 5px;
  font-size: 13px; font-weight: 500; cursor: pointer;
}
.pd-sc-apply-btn:hover { background: #267a4c; }
.pd-sc-reset-btn {
  padding: 7px 12px; color: #6b7280 !important; font-size: 12px;
  text-decoration: none !important;
}
.pd-sc-reset-btn:hover { color: #374151 !important; }

/* ── Table ────────────────────────────────────────────────────────────────── */
.pd-sc-main {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 0 0 8px 8px;
  overflow: hidden;
}
.pd-sc-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.pd-sc-tbl thead th {
  background: #f8fafc; color: #374151; font-weight: 600; text-align: left;
  padding: 10px 12px; border-bottom: 1px solid #e5e7eb;
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
}
.pd-sc-tbl tbody tr:nth-child(odd)  { background: #fff; }
.pd-sc-tbl tbody tr:nth-child(even) { background: #f9fafb; }
.pd-sc-tbl tbody tr:hover           { background: #f1f5f9; }
.pd-sc-tbl tbody td {
  padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle;
  color: #374151;
}
.pd-sc-link { color: #2e8b57; text-decoration: none; }
.pd-sc-link:hover { text-decoration: underline; }
.pd-sc-link-strong { font-weight: 600; }
.pd-sc-muted { color: #94a3b8; }

/* Next-due cell color cues */
.pd-sc-due { font-variant-numeric: tabular-nums; }
.pd-sc-due--over { color: #b91c1c; font-weight: 600; }
.pd-sc-due--soon { color: #b45309; font-weight: 600; }

/* Status chip */
.pd-sc-st {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  border: 1px solid transparent;
}
.pd-sc-st__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pd-sc-st--active { color: #15803d; background: #dcfce7; border-color: #bbf7d0; }
.pd-sc-st--paused { color: #6b7280; background: #f3f4f6; border-color: #e5e7eb; }

/* Action buttons */
.pd-sc-actions { display: flex; gap: 6px; align-items: center; }
.pd-sc-act {
  display: inline-block; padding: 4px 10px; border-radius: 4px;
  font-size: 11px; font-weight: 500; text-decoration: none !important; cursor: pointer;
  border: 1px solid transparent; background: transparent; color: #374151;
}
.pd-sc-act--toggle { background: #f1f5f9; color: #334155; border-color: #e2e8f0; }
.pd-sc-act--toggle:hover { background: #e2e8f0; }
.pd-sc-act--edit   { background: #fff; color: #2e8b57 !important; border-color: #bbf7d0; }
.pd-sc-act--edit:hover { background: #f0fdf4; }
.pd-sc-act--delete { background: #fff; color: #b91c1c !important; border-color: #fecaca; }
.pd-sc-act--delete:hover { background: #fee2e2; }

/* Empty state */
.pd-sc-empty {
  text-align: center; padding: 48px 24px; background: #fff;
}
.pd-sc-empty__icon { font-size: 32px; margin-bottom: 8px; }
.pd-sc-empty__msg  { color: #6b7280; margin-bottom: 16px; font-size: 14px; }
.pd-sc-empty__cta {
  display: inline-block; padding: 8px 18px; background: #2e8b57; color: #fff !important;
  border-radius: 6px; font-size: 13px; font-weight: 500; text-decoration: none !important;
}
.pd-sc-empty__cta:hover { background: #267a4c; }

/* ── Form (add/edit) ──────────────────────────────────────────────────────── */
.pd-sc-form fieldset.pd-form-section {
  border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 14px 18px 18px; margin: 0 0 16px;
  background: #fff;
}
.pd-sc-form fieldset.pd-form-section > legend {
  font-size: 13px; font-weight: 600; color: #166534;
  padding: 0 6px; text-transform: uppercase; letter-spacing: .04em;
}
.pd-sc-form .pd-form-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px;
}
.pd-sc-form label { font-size: 12.5px; font-weight: 600; color: #374151; }
.pd-sc-form input[type="text"],
.pd-sc-form input[type="number"],
.pd-sc-form input[type="search"],
.pd-sc-form input[type="date"],
.pd-sc-form select,
.pd-sc-form textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 5px;
  font-size: 13px; background: #fff; color: #374151; box-sizing: border-box;
}
.pd-sc-form input:focus, .pd-sc-form select:focus, .pd-sc-form textarea:focus {
  outline: none; border-color: #2e8b57; box-shadow: 0 0 0 2px rgba(46,139,87,.12);
}
.pd-sc-form .description { font-size: 11.5px; color: #6b7280; margin-top: 3px; }
.pd-sc-form .pd-form-grid .form-item:has(textarea.pd-full-width),
.pd-sc-form .pd-form-grid .form-item:has(input.pd-full-width) { grid-column: 1 / -1; }
.pd-sc-form .form-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.pd-sc-form .form-actions .pd-sc-btn-primary { margin-left: auto; }

/* Autocomplete dropdown for scope picker */
.pd-sc-scope-wrap { position: relative; }
.pd-sc-scope-dd {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 50;
  background: #fff; border: 1px solid #d1d5db; border-radius: 0 0 6px 6px;
  max-height: 240px; overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.pd-sc-scope-item {
  padding: 8px 12px; cursor: pointer; font-size: 13px; color: #374151;
  border-bottom: 1px solid #f1f5f9;
}
.pd-sc-scope-item:hover, .pd-sc-scope-item.is-active { background: #f0fdf4; color: #166534; }
.pd-sc-scope-empty { padding: 8px 12px; color: #9ca3af; font-size: 12px; }

/* ── Ticket-detail "born from schedule" hint ──────────────────────────────── */
.pdmnt-sched-hint {
  margin: 8px 0 14px; padding: 8px 12px;
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 6px;
  font-size: 12.5px; color: #166534; display: flex; align-items: center; gap: 8px;
}
.pdmnt-sched-hint a { color: #166534; font-weight: 600; text-decoration: none; }
.pdmnt-sched-hint a:hover { text-decoration: underline; }

/* RTL */
html[dir="rtl"] .pd-sc-form .form-actions .pd-sc-btn-primary {
  margin-left: 0; margin-right: auto;
}
html[dir="rtl"] .pd-sc-kpi::before { left: auto; right: 0; }
