:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --border: #e8edf3;
  --border-strong: #d5dde8;
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #243163;
  --primary-hover: #1e2a5e;
  --primary-soft: #e8ecf6;
  --success: #059669;
  --success-soft: #ecfdf5;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warning: #d97706;
  --warning-soft: #fff7ed;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 14px;
  --sidebar-width: 260px;
}

* { box-sizing: border-box; }

html,
button,
input,
select,
textarea {
  font-family: "Inter", system-ui, sans-serif;
}

body.erp-body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* App shell */
.erp-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

.erp-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.erp-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 20px;
  text-decoration: none;
  color: inherit;
}

.erp-brand-logo {
  display: block;
  height: 36px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.erp-brand-logo--login {
  height: 120px;
  margin: 0 auto 12px;
}

.erp-sidebar-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.erp-sidebar-brand-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.erp-sidebar-brand-role {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.erp-nav-group {
  margin-bottom: 6px;
}

.erp-nav-group__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px 6px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.erp-nav-group__toggle:hover {
  background: var(--bg);
  color: var(--text);
}

.erp-nav-group__toggle span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.erp-nav-group__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.erp-nav-group__chevron .lucide {
  width: 14px;
  height: 14px;
}

.erp-nav-group.is-collapsed .erp-nav-group__chevron {
  transform: rotate(-90deg);
}

.erp-nav-group__items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  max-height: 480px;
  transition: max-height 0.22s ease, opacity 0.18s ease;
  opacity: 1;
}

.erp-nav-group.is-collapsed .erp-nav-group__items {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.erp-sidebar-section {
  padding: 8px 12px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.erp-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-right: 2px;
}

.erp-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  min-width: 0;
}

.erp-nav-link > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.erp-nav-link:hover {
  background: var(--bg);
  color: var(--text);
}

.erp-nav-link.is-active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.erp-nav-link--disabled {
  opacity: 0.45;
  pointer-events: none;
}

.erp-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.erp-nav-icon .lucide {
  width: 18px;
  height: 18px;
}

.erp-sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.erp-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  margin-bottom: 8px;
}

.erp-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.erp-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.erp-user-role {
  font-size: 11px;
  color: var(--text-muted);
}

.erp-signout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

.erp-signout:hover {
  background: var(--bg);
  color: var(--text);
}

/* Main */
.erp-main {
  padding: 28px 32px 40px;
  min-width: 0;
}

.erp-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.erp-page-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.erp-page-stack-item {
  margin-top: 24px;
}

.erp-page-title {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.erp-page-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.erp-page-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.erp-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}

.erp-back-link:hover {
  color: var(--primary);
}

.erp-form-page {
  max-width: 760px;
}

.erp-form-page--full {
  max-width: none;
}

.erp-hint--inline {
  margin: 0 0 12px;
}

.erp-slot-banner {
  margin-bottom: 24px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.erp-slot-banner__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.erp-slot-banner__value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.erp-slot-banner__meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Cards */
.erp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.erp-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.erp-card-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.erp-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.erp-card-toolbar {
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.erp-form-body {
  padding: 24px;
}

.erp-form-group + .erp-form-group {
  margin-top: 16px;
}

.erp-hint {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.erp-field-error,
.erp-form-error {
  margin-top: 6px;
  font-size: 12px;
  color: var(--danger);
}

.erp-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.erp-form-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 20px;
}

.erp-form-grid .erp-form-group + .erp-form-group {
  margin-top: 0;
}

.erp-form-group--full {
  grid-column: 1 / -1;
}

.erp-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.erp-input,
.erp-textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  padding: 11px 14px;
  font: inherit;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.erp-input:focus,
.erp-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(36, 49, 99, 0.12);
}

.erp-textarea {
  resize: vertical;
}

.erp-time-range {
  display: flex;
  align-items: center;
  gap: 10px;
}

.erp-time-range .erp-input {
  flex: 1;
}

.erp-time-sep {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.erp-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.erp-form-actions--start {
  justify-content: flex-start;
}

.erp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.erp-btn:hover {
  background: var(--bg);
}

.erp-btn--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.erp-btn--primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}

.erp-btn--danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.erp-btn--danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

.erp-btn--block {
  width: 100%;
}

.erp-btn--sm {
  padding: 6px 12px;
  font-size: 12px;
}

.erp-thumb {
  display: block;
  margin-top: 10px;
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.erp-thumb--round {
  width: 72px;
  height: 72px;
  border-radius: 50%;
}

.erp-split {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}

.erp-split--bookings {
  grid-template-columns: minmax(320px, 400px) 1fr;
}

.erp-split--diagnostic {
  grid-template-columns: 360px 1fr;
}

/* Metric cards */
.erp-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.erp-metric-card {
  padding: 16px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafbfd;
}

.erp-metric-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.erp-metric-icon--blue {
  background: #e8ecf6;
  color: var(--primary);
}

.erp-metric-icon--green {
  background: var(--success-soft);
  color: var(--success);
}

.erp-metric-icon--navy {
  background: var(--primary-soft);
  color: var(--primary);
}

.erp-metric-val {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.erp-metric-lbl {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.erp-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.erp-stat-box {
  text-align: center;
  padding: 14px;
  background: #fafbfd;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.erp-stat-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}

.erp-stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* QR */
.erp-qr-wrap {
  text-align: center;
  padding: 12px 0 8px;
}

.erp-qr {
  width: 220px;
  height: 220px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.erp-qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
}

/* Tables */
.erp-table-wrap {
  overflow-x: auto;
}

.erp-table {
  width: 100%;
  border-collapse: collapse;
}

.erp-table th,
.erp-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.erp-table--spaced tbody tr td {
  padding-top: 16px;
  padding-bottom: 16px;
}

.erp-table thead th {
  background: #fafbfd;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.erp-table tbody tr:hover {
  background: #fafbfd;
}

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

.erp-cell-strong {
  font-weight: 600;
}

.erp-cell-muted {
  color: var(--text-muted);
  font-size: 13px;
}

.erp-mono {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.erp-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 32px;
}

.erp-empty-state {
  padding: 56px 32px;
  text-align: center;
}

.erp-empty-state__icon {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--primary);
}

.erp-empty-state h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.erp-empty-state p {
  margin: 0 0 20px;
  color: var(--text-muted);
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.erp-time-badge {
  display: inline-block;
  padding: 4px 10px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

.erp-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: #f1f5f9;
  color: var(--text-muted);
}

.erp-badge--success {
  background: var(--success-soft);
  color: var(--success);
}

.erp-badge--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.erp-badge--muted {
  background: transparent;
  color: var(--text-muted);
}

.erp-badge--live {
  background: var(--success-soft);
  color: var(--success);
}

.erp-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.erp-search-input {
  flex: 1;
  min-width: 220px;
  margin-bottom: 0;
}

.erp-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.erp-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  background: #fff;
}

.erp-filter-chip.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.erp-table tbody tr.is-attended {
  background: #f0fdf4;
}

.erp-table tbody tr.is-awaiting {
  background: #fffbeb;
}

.btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-with-icon .lucide {
  width: 14px;
  height: 14px;
}

.col-actions {
  width: 140px;
  text-align: center;
}

.col-actions--wide {
  width: 200px;
}

.erp-action-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.erp-pay-method-group {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.erp-pay-method-group .erp-label {
  margin-bottom: 8px;
}

.erp-pay-options {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.erp-pay-options li {
  margin: 0;
  padding: 0;
}

.erp-pay-options label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
}

.erp-pay-options label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.erp-pay-options input[type="radio"] {
  margin: 0;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* legacy wrapper support */
.erp-pay-methods ul {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.erp-pay-methods li {
  margin: 0;
}

.erp-pay-methods label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
}

.erp-pay-methods label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.erp-pay-methods input[type="radio"] {
  margin: 0;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.erp-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  color: var(--text-muted);
}

.erp-icon-btn .lucide {
  width: 16px;
  height: 16px;
}

.erp-icon-btn--danger:hover {
  border-color: #fca5a5;
  color: var(--danger);
  background: var(--danger-soft);
}

.inline-form {
  display: inline;
}

/* Pillars */
.erp-pillar-list {
  padding: 16px;
}

.erp-pillar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
  background: #fff;
}

.erp-pillar-item.is-unlocked {
  border-color: #a7f3d0;
  background: #f0fdf4;
}

.erp-pillar-item.is-current {
  border-color: #c5cee8;
  background: var(--primary-soft);
}

.erp-pillar-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.erp-pillar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}

.erp-pillar-icon .lucide {
  width: 20px;
  height: 20px;
}

.erp-pillar-name {
  font-weight: 600;
  font-size: 14px;
}

.erp-pillar-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* Messages */
.erp-messages {
  margin-bottom: 16px;
}

.erp-message {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.erp-message--success {
  border-color: #a7f3d0;
  background: var(--success-soft);
  color: var(--success);
}

.erp-message--error {
  border-color: #fecaca;
  background: var(--danger-soft);
  color: var(--danger);
}

/* Login */
.erp-body--login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: linear-gradient(160deg, #e8ecf6 0%, var(--bg) 55%);
}

.erp-login-wrap {
  width: min(420px, calc(100vw - 32px));
}

.erp-login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.erp-login-header {
  padding: 32px 24px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.erp-login-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.erp-login-card .erp-form-body {
  padding: 24px;
}

.erp-login-card .erp-message {
  margin: 16px 24px 0;
}

/* OPD Calendar */
.erp-opd-calendar {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 24px;
  align-items: start;
}

.erp-opd-calendar__nav {
  display: flex;
  gap: 8px;
}

.erp-opd-calendar__grid-wrap {
  padding: 16px 20px 24px;
}

.erp-opd-calendar__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.erp-opd-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.erp-opd-day {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  border: 1px solid transparent;
}

.erp-opd-day--empty {
  min-height: 42px;
}

.erp-opd-day.is-muted {
  color: #cbd5e1;
}

.erp-opd-day.has-open:hover,
.erp-opd-day.is-booked:hover {
  background: var(--bg);
}

.erp-opd-day.is-selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.erp-opd-day__dot {
  position: absolute;
  bottom: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.erp-opd-day__dot--open {
  background: var(--success);
}

.erp-opd-day__dot--booked {
  background: var(--warning);
}

.erp-opd-day.is-selected .erp-opd-day__dot--open,
.erp-opd-day.is-selected .erp-opd-day__dot--booked {
  background: #fff;
}

.erp-opd-slot-list {
  max-height: 520px;
  overflow-y: auto;
  padding: 12px 16px 16px;
}

.erp-opd-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
  background: #fff;
}

.erp-opd-slot__main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.erp-opd-slot__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
  background: var(--success);
}

.erp-opd-slot--booked .erp-opd-slot__dot {
  background: var(--warning);
}

.erp-opd-slot--blocked .erp-opd-slot__dot {
  background: var(--danger);
}

.erp-opd-slot__time {
  font-weight: 700;
  font-size: 14px;
}

.erp-opd-slot__meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.erp-opd-slot--blocked {
  background: #fffafa;
  border-color: #fecaca;
}

.erp-opd-slot--booked {
  background: #fffdf8;
}

@media (max-width: 1024px) {
  .erp-shell {
    grid-template-columns: 1fr;
  }

  .erp-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .erp-sidebar-footer {
    margin-top: 12px;
  }

  .erp-main {
    padding: 20px 16px 32px;
  }

  .erp-form-grid,
  .erp-split,
  .erp-metric-grid,
  .erp-form-grid--3,
  .erp-opd-calendar {
    grid-template-columns: 1fr;
  }

  .erp-page-header {
    flex-direction: column;
  }

  .erp-page-title {
    font-size: 24px;
  }
}

/* Delete confirmation modal */
.erp-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.erp-modal[hidden] {
  display: none;
}

.erp-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.erp-modal__dialog {
  position: relative;
  width: min(100%, 420px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  padding: 28px 28px 24px;
  text-align: center;
  animation: erp-modal-in 0.18s ease-out;
}

@keyframes erp-modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.erp-modal__icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
}

.erp-modal__icon {
  width: 22px;
  height: 22px;
}

.erp-modal__title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.erp-modal__message {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
}

.erp-modal__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.erp-modal__actions .erp-btn {
  min-width: 110px;
}
