/* Fizva Terapist Portalı — sade */
:root {
  --brand: #002060;
  --brand-soft: rgba(0, 32, 96, 0.07);
  --accent: #007aff;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --text: #111827;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --border: #e6e8ec;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 10px 36px rgba(15, 23, 42, 0.07);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 248px;
  --topbar-h: 64px;
  --font: 'Inter', system-ui, sans-serif;
  --font-display: 'Plus Jakarta Sans', var(--font);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; }

@media (min-width: 1920px) { html { font-size: 17px; } }
@media (min-width: 2400px) { html { font-size: 18px; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

[hidden] { display: none !important; }

/* ——— Login ——— */
.login-root {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}

.login-bg {
  position: absolute;
  inset: 0;
  background: var(--bg);
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
}

.login-logo-img {
  width: auto;
  height: 56px;
  max-width: 160px;
  object-fit: contain;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 24px;
}

.sidebar-logo-img {
  width: auto;
  height: 36px;
  max-width: 120px;
  object-fit: contain;
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  margin: 0;
}

.login-sub {
  margin: 4px 0 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.login-form { display: flex; flex-direction: column; gap: 16px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.field input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--surface-2);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(10, 74, 122, 0.12);
}

.form-error {
  margin: 0;
  font-size: 0.875rem;
  color: var(--danger);
}

.login-footer {
  margin: 24px 0 0;
  text-align: center;
  font-size: 0.875rem;
}

.login-footer a {
  color: var(--brand);
  text-decoration: none;
}

.auth-panel[hidden] { display: none !important; }

.auth-links,
.auth-switch,
.auth-policy-links {
  margin: 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.auth-links { margin-top: 4px; }

.auth-switch { margin-top: 16px; }

.auth-links a,
.auth-switch a,
.auth-policy-links a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
}

.auth-links-sep { margin: 0 6px; opacity: 0.5; }

.auth-panel-hint,
.consent-hint {
  margin: 0 0 12px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.auth-form-scroll {
  max-height: min(58vh, 520px);
  overflow-y: auto;
  padding-right: 4px;
}

.field select {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--surface);
  color: var(--text);
}

.consent-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.4;
  cursor: pointer;
}

.consent-check input { margin-top: 3px; flex-shrink: 0; }

.form-section-title {
  margin: 0 0 4px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 32, 96, 0.18);
}

.btn-primary:hover:not(:disabled) {
  background: #001a4d;
  box-shadow: 0 4px 14px rgba(0, 32, 96, 0.22);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn-danger {
  background: var(--danger, #dc2626);
  color: #fff;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover:not(:disabled) { background: #b91c1c; }

.btn-block { width: 100%; }

.btn-sm { padding: 7px 12px; font-size: 0.8125rem; }

.btn-icon {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text);
  transition: background 0.2s;
}

.btn-icon:hover { background: var(--surface-2); }

.btn-ok, .btn-no {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: transform 0.15s;
}

.btn-ok { background: var(--success); color: #fff; }
.btn-no { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-ok:hover, .btn-no:hover { transform: scale(1.05); }

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ——— App shell ——— */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  transition: transform 0.3s var(--ease);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--brand);
}

.sidebar-brand img { border-radius: 6px; }

.sidebar-nav {
  flex: 1;
  padding: 4px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-group-label {
  margin: 14px 10px 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.nav-group-label:first-child { margin-top: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }

.nav-item:hover { background: var(--surface-2); color: var(--text); }

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.logout-btn { color: var(--danger) !important; width: 100%; }

.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-title h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0;
  font-weight: 700;
}

.topbar-sub {
  margin: 1px 0 0;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8125rem;
}

.main-content {
  padding: 28px clamp(16px, 2.4vw, 44px) 40px;
  flex: 1;
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.view { display: none; }
.view.active { display: block; }

.view-calendar.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 10px;
  /* Fit month + day detail in the viewport; detail scrolls internally if needed */
  max-height: calc(100vh - var(--topbar-h, 64px) - 48px);
  overflow: hidden;
}

.main-content:has(.view-calendar.active) {
  padding-top: 16px;
  padding-bottom: 16px;
}

.sidebar-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
}

.sidebar-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

.topbar-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.user-meta strong { font-size: 0.8125rem; }
.user-meta span { font-size: 0.6875rem; color: var(--text-tertiary); }

/* ——— Dashboard ——— */
.period-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  width: fit-content;
  box-shadow: var(--shadow-sm);
}

.period-tab {
  padding: 8px 18px;
  border: none;
  border-radius: 999px;
  background: none;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.period-tab.active {
  background: var(--brand);
  color: #fff;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  box-shadow: var(--shadow-sm);
}

.kpi-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.kpi-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--brand);
  letter-spacing: -0.02em;
}

.kpi-value.accent-warn { color: var(--warning); }

.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(230px, 1fr);
  align-items: stretch;
  gap: 14px;
  margin-bottom: 14px;
}

.chart-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.chart-head h3 {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 650;
  margin: 0;
}

.chart-meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.chart-body { position: relative; min-height: 200px; }

.dash-lists {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 18px;
  align-items: start;
}

@media (min-width: 1440px) {
  .dash-lists { grid-template-columns: 1fr 1fr; }
  .chart-grid { grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr); }
}

@media (min-width: 1920px) {
  .main-content { max-width: 1960px; }
  .donut { width: min(180px, 100%); }
  .donut-center { inset: 22px; }
}

@media (min-width: 2400px) {
  .main-content { max-width: 2200px; }
}

/* Randevu dağılımı (halka) */
.donut-wrap {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px 24px;
  padding-top: 4px;
}

.donut {
  position: relative;
  flex: 0 0 auto;
  width: min(150px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #eef1f5;
  transition: background 0.4s var(--ease);
}

.donut-center {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.donut-center strong {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--brand);
}

.donut-center span {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.donut-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1 1 150px;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.donut-legend li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.donut-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.donut-legend-label { flex: 1; }
.donut-legend strong { color: var(--text); font-weight: 600; }

/* Haftalık seanslar */
.chart-head:has(.week-nav) {
  flex-wrap: wrap;
  gap: 8px 12px;
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.week-nav .chart-meta { margin-right: 6px; white-space: nowrap; }
.week-nav .btn { white-space: nowrap; }
.week-nav-btn { width: 30px; height: 30px; font-size: 1.1rem; }

.week-grid-wrap { flex: 1; display: flex; flex-direction: column; container-type: inline-size; }

.wa-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.wa-day {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px 5px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid transparent;
  min-width: 0;
}

.wa-day.is-today { background: var(--brand-soft); border-color: rgba(0, 32, 96, 0.14); }
.wa-day.is-past { opacity: 0.6; }

.wa-day-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 0 2px;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.wa-day-head:hover strong { text-decoration: underline; }

.wa-day-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.wa-day-meta {
  font-size: 0.65rem;
  line-height: 1.3;
  color: var(--text-tertiary);
}

.wa-day-meta > * { white-space: nowrap; }
.wa-day-meta b { font-weight: 600; color: #15803d; }

.wa-day-head .wa-day-title span {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}

.wa-day-head strong {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text);
}

.wa-day.is-today .wa-day-head strong { color: var(--brand); }

.wa-day.is-today .wa-day-title span { color: var(--brand); }

.wa-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.18) transparent;
}

.wa-list::-webkit-scrollbar { width: 4px; }
.wa-list::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, 0.18); border-radius: 4px; }

.wa-item {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 1px;
  width: 100%;
  min-width: 0;
  padding: 4px 6px 4px 7px;
  border: none;
  border-left: 3px solid var(--accent);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}

.wa-item:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.wa-line {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: break-word;
  font-size: 0.78rem;
  line-height: 1.25;
}

.wa-time {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.wa-name {
  font-weight: 600;
  color: var(--text);
}

.wa-type {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.6875rem;
  line-height: 1.25;
  color: var(--text-tertiary);
}

.wa-pending { border-left-color: var(--warning); }
.wa-pending .wa-time,
.wa-pending .wa-type { color: #b45309; }
.wa-completed { border-left-color: var(--success); }
.wa-completed .wa-time { color: var(--success); }

.wa-empty {
  padding: 2px;
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

@container (max-width: 620px) {
  .wa-grid { grid-template-columns: 1fr; gap: 6px; }
  .wa-day {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: start;
    padding: 8px 10px;
  }
  .wa-day-head { padding-top: 2px; }
  .wa-list { flex-direction: row; flex-wrap: wrap; max-height: none; }
  .wa-item { width: auto; max-width: 100%; }
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.panel-head h3 {
  font-family: var(--font-display);
  font-size: 0.975rem;
  font-weight: 650;
  margin: 0;
  flex: 1;
}

.panel-tag {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.panel-lead {
  margin: -6px 0 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.badge {
  background: rgba(217, 119, 6, 0.12);
  color: var(--warning);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.appt-list { display: flex; flex-direction: column; gap: 0; }

.appt-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  animation: rowIn 0.4s var(--ease) backwards;
}

.appt-row:first-child { border-top: none; padding-top: 0; }

@keyframes rowIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.appt-time strong {
  display: block;
  font-size: 0.9375rem;
}

.appt-time span {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.appt-body {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.appt-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
  overflow: hidden;
}

.appt-avatar.has-img { background: transparent; }

.appt-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.appt-body-text { min-width: 0; }
.appt-body-text strong,
.appt-body strong { display: block; font-size: 0.9375rem; }
.appt-body-text span,
.appt-body span { font-size: 0.8125rem; color: var(--text-secondary); }

.appt-actions { display: flex; gap: 8px; }

.empty-hint {
  color: var(--text-tertiary);
  font-size: 0.875rem;
  text-align: center;
  padding: 24px;
  margin: 0;
}

/* ——— Calendar ——— */
.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 0;
  flex-shrink: 0;
}

.calendar-toolbar h3 {
  font-family: var(--font-display);
  margin: 0;
  min-width: 160px;
  text-align: center;
  font-size: 1.05rem;
}

#btnOpenCalendarSync {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sync-feed-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
}

.calendar-workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
}

.cal-drawer {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
}

.cal-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.16);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.cal-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 92vw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -16px 0 40px rgba(15, 23, 42, 0.14);
  transform: translateX(100%);
  transition: transform 0.26s var(--ease);
}

.cal-drawer.is-open { pointer-events: auto; }
.cal-drawer.is-open .cal-drawer-backdrop { opacity: 1; }
.cal-drawer.is-open .cal-drawer-panel { transform: none; }

.cal-drawer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  width: 32px;
  height: 32px;
  font-size: 1.25rem;
}

.cal-drawer .calendar-detail {
  flex: 1;
  height: auto;
  max-height: none;
  padding: 20px 20px 28px;
  border: none;
  border-radius: 0;
}

.cal-drawer .cd-head { padding-right: 40px; }

.cd-session.is-focus {
  box-shadow: 0 0 0 2px var(--brand), 0 6px 18px rgba(0, 32, 96, 0.12);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(34px, 1fr);
  gap: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.cal-dow {
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 2px 0;
  align-self: end;
}

.cal-day {
  min-height: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 3px 5px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2px;
  transition: border-color 0.2s, background 0.2s;
  font: inherit;
  color: inherit;
}

.cal-day:hover:not(:disabled) {
  border-color: var(--brand);
}

.cal-day.other { opacity: 0.35; }
.cal-day.today { border-color: var(--accent); background: rgba(0, 122, 255, 0.06); }
.cal-day.selected { background: rgba(10, 74, 122, 0.12); border-color: var(--brand); }

.cal-day-num {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.cal-dots {
  display: flex;
  gap: 2px;
  margin-top: auto;
  flex-wrap: wrap;
}

.cal-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.cal-dot.appt { background: var(--brand); }
.cal-dot.avail { background: var(--success); }

.calendar-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
}

.cal-detail-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin: 0 0 12px;
}

.cal-slot-list { display: flex; flex-direction: column; gap: 8px; }

.cal-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  gap: 10px;
}

.cal-slot-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.cal-slot-name {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
}

.cal-slot-name:hover { text-decoration: underline; }

.cd-head {
  padding-bottom: 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.cd-head .cal-detail-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0;
  font-size: 1.05rem;
}

.cd-today {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-family: var(--font);
  font-size: 0.6875rem;
  font-weight: 600;
}

.cd-section { padding: 14px 0 4px; }

.cd-section h5 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.cd-section h5 span {
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 0.6875rem;
  text-align: center;
  letter-spacing: 0;
}

.cd-empty,
.cd-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

.cd-hint { margin-top: 10px; font-size: 0.75rem; }

.cd-sessions { display: flex; flex-direction: column; gap: 8px; }

.cd-session {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.cd-session.cd-pending { border-left-color: var(--warning); }
.cd-session.cd-completed { border-left-color: var(--success); }

.cd-session-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.cd-session-time {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cd-session .cal-slot-name {
  max-width: 100%;
  font-size: 0.9375rem;
  text-align: left;
  color: var(--text);
  overflow-wrap: break-word;
}

.cd-session-type {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.cd-session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.cd-ranges {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cd-ranges li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(34, 197, 94, 0.07);
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.cd-ranges em {
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 600;
  color: #15803d;
}

.cd-range-actions {
  display: flex;
  gap: 6px;
  margin: 10px 0;
}

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

.cd-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.cd-chip.is-free {
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
  color: #15803d;
}

.cd-chip.is-busy {
  padding: 5px 11px;
  background: var(--surface-2);
  color: var(--text-secondary);
}

.cd-chip-main,
.cd-chip-x {
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.cd-chip-main { padding: 5px 4px 5px 11px; font-weight: 600; }
.cd-chip-x { padding: 5px 9px 5px 4px; opacity: 0.55; font-size: 0.9rem; line-height: 1; }
.cd-chip-x:hover { opacity: 1; }
.cd-chip.is-free:hover { background: rgba(34, 197, 94, 0.14); }

.cal-view-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.cal-view-tab {
  padding: 5px 14px;
  border: none;
  border-radius: 999px;
  background: none;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.cal-view-tab.active { background: var(--brand); color: #fff; }

/* Haftalık takvim (saat ızgarası) */
.calendar-grid.is-week {
  display: block;
  padding: 0;
  overflow: hidden;
}

.cw {
  --cw-axis: 56px;
  --cw-col-min: 120px;
  --cw-cols: var(--cw-axis) repeat(7, minmax(var(--cw-col-min), 1fr));
  position: relative;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
}

.cw-head,
.cw-body { min-width: calc(var(--cw-axis) + 7 * var(--cw-col-min)); }

.cw-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.cw-days,
.cw-night {
  display: grid;
  grid-template-columns: var(--cw-cols);
}

.cw-night {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.cw-night-label {
  position: sticky;
  left: 0;
  z-index: 1;
  padding: 8px 10px 8px 0;
  background: var(--surface-2);
  text-align: right;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-tertiary);
}

.cw-night-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 6px 4px;
  border-left: 1px solid var(--border);
}

.cw-chip {
  display: flex;
  gap: 5px;
  min-width: 0;
  padding: 3px 7px;
  border: none;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: #eaf2ff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: #0b3a82;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.cw-chip span { font-variant-numeric: tabular-nums; opacity: 0.8; }
.cw-chip.cw-pending { background: #fff5e6; border-left-color: var(--warning); color: #8a4b00; }
.cw-chip.cw-completed { background: #e9f8ef; border-left-color: var(--success); color: #14532d; }

.cw-corner {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
}

.cw-dayhead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px 8px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  position: relative;
}

.cw-dayhead span {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}

.cw-dayhead strong {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 1rem;
}

.cw-dayhead:hover strong { background: var(--surface-2); }
.cw-dayhead.is-today strong { background: var(--brand); color: #fff; }
.cw-dayhead.is-selected { border-bottom-color: var(--brand); }

.cw-dayhead small {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.cw-dayhead small.is-free { color: #15803d; }
.cw-dayhead.is-past span,
.cw-dayhead.is-past strong,
.cw-dayhead.is-past small { opacity: 0.55; }

.cw-body {
  position: relative;
  display: grid;
  grid-template-columns: var(--cw-cols);
  margin: 10px 0 12px;
  box-sizing: content-box;
}

.cw-axis {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--surface);
}

.cw-axis span {
  position: absolute;
  right: 10px;
  transform: translateY(-50%);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.cw-col {
  position: relative;
  border-left: 1px solid var(--border);
  background-image:
    repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px var(--cw-hour)),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--cw-hour) / 2), #f1f4f8 calc(var(--cw-hour) / 2) calc(var(--cw-hour) / 2 + 1px), transparent calc(var(--cw-hour) / 2 + 1px) var(--cw-hour));
  cursor: pointer;
}

.cw-col:last-child { border-right: 1px solid var(--border); }
.cw-col.is-today { background-color: rgba(0, 122, 255, 0.035); }
.cw-col.is-selected { background-color: rgba(0, 32, 96, 0.045); }
.cw-col.is-past { cursor: default; }
.cw-col.is-past .cw-ev { opacity: 0.72; }

.cw-busy {
  position: absolute;
  left: 0;
  right: 0;
  background: repeating-linear-gradient(135deg, rgba(148, 163, 184, 0.12) 0 6px, rgba(148, 163, 184, 0.04) 6px 12px);
  cursor: default;
}

.cw-busy span {
  display: block;
  padding: 4px 8px;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.cw-ev {
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 5px 6px 5px 7px;
  border: none;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: #eaf2ff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  font: inherit;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.12s var(--ease), transform 0.12s var(--ease);
}

.cw-ev:hover { z-index: 2; box-shadow: var(--shadow-sm); transform: translateY(-1px); }

.cw-ev > * {
  flex-shrink: 0;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cw-ev > .cw-ev-status { flex-shrink: 1; min-height: 0; }

.cw-ev-time {
  font-size: 0.6875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.cw-ev strong {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #0b3a82;
}

.cw-ev:not(.is-short) strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  overflow-wrap: break-word;
}

.cw-break {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(135deg, rgba(100, 116, 139, 0.09) 0 5px, rgba(100, 116, 139, 0.03) 5px 10px);
  border-top: 1px dashed rgba(100, 116, 139, 0.25);
  border-bottom: 1px dashed rgba(100, 116, 139, 0.25);
  cursor: default;
}

.cw-break span {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
}

.cw-night-toggle {
  position: sticky;
  left: 0;
  display: inline-block;
  padding: 5px 12px;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
}

.cw-night-toggle:hover { color: var(--brand); }

.cw-ev-status { font-size: 0.6875rem; color: #3b5a8c; }

.cw-ev.is-short { gap: 1px; padding: 5px 8px; }

.cw-ev.is-short strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 0.78rem;
}

.cw-group { background: #eef0ff; border-left-color: #6366f1; }
.cw-group .cw-ev-time,
.cw-group .cw-ev-status { color: #4f46e5; }
.cw-group strong { color: #312e81; }

.cw-pending { background: #fff5e6; border-left-color: var(--warning); }
.cw-pending strong { color: #8a4b00; }
.cw-pending .cw-ev-time,
.cw-pending .cw-ev-status { color: #b45309; }
.cw-completed { background: #e9f8ef; border-left-color: var(--success); }
.cw-completed strong { color: #14532d; }
.cw-completed .cw-ev-time,
.cw-completed .cw-ev-status { color: #15803d; }

.cw-hover {
  position: absolute;
  left: 3px;
  right: 3px;
  height: var(--cw-hour);
  display: grid;
  place-items: center;
  border: 1.5px dashed var(--accent);
  border-radius: 8px;
  background: rgba(0, 122, 255, 0.05);
  pointer-events: none;
}

.cw-hover[hidden] { display: none; }

.cw-hover span {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.cw-now {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  height: 2px;
  background: #ef4444;
  pointer-events: none;
}

.cw-now::before {
  content: '';
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
}

.calendar-sync-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.calendar-sync-overlay[hidden] {
  display: none !important;
}

.calendar-sync-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.calendar-sync-sheet {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(88vh, 640px);
  overflow-y: auto;
  margin: 0;
  box-shadow: var(--shadow-md);
}

.calendar-sync-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-sync { margin-bottom: 0; }

.sync-hint {
  margin: 0 0 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.sync-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.sync-form input[type="url"],
.sync-form input[type="text"] {
  flex: 1;
  min-width: 180px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--surface-2);
}

.sync-import { margin-bottom: 12px; }

.file-label {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--brand);
  cursor: pointer;
}

.feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feed-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
}

.feed-list .feed-meta { color: var(--text-tertiary); font-size: 0.75rem; }

.sync-status {
  margin: 12px 0 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.live-badge {
  margin-left: auto;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--success);
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
}

.cal-dot.blocked { background: #64748b; }

.status-blocked { background: rgba(100, 116, 139, 0.15); color: #475569; }

.status-pill {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-pending { background: rgba(245,158,11,0.15); color: var(--warning); }
.status-approved { background: rgba(0,122,255,0.12); color: var(--accent); }
.status-completed { background: rgba(34,197,94,0.12); color: var(--success); }
.status-cancelled { background: rgba(239,68,68,0.1); color: var(--danger); }
.status-rejected { background: rgba(148,163,184,0.18); color: #64748b; }

/* ——— Appointments board ——— */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-chip {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.filter-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.appts-board {
  padding: 0;
  overflow: hidden;
}

.appts-board .panel-head {
  padding: 18px 20px 0;
  margin-bottom: 0;
}

.appts-head-sub {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.appts-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(160px, 0.9fr) auto;
  gap: 10px;
  align-items: center;
  padding: 14px 20px 0;
}

.appts-search,
.appts-patient-filter {
  display: block;
  min-width: 0;
}

.appts-search input,
.appts-patient-filter select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font: inherit;
  font-size: 0.875rem;
  color: var(--text);
}

.appts-search input:focus,
.appts-patient-filter select:focus {
  outline: 2px solid rgba(10, 74, 122, 0.25);
  outline-offset: 1px;
  border-color: var(--brand);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.appts-filters {
  padding: 14px 20px 4px;
  margin-bottom: 0;
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(to bottom, var(--surface) 70%, rgba(255,255,255,0));
}

@media (max-width: 720px) {
  .appts-toolbar {
    grid-template-columns: 1fr;
  }
}

.appts-list {
  padding: 8px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.appts-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 4px 10px;
}

.appts-day-head h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
}

.appts-day-head span {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.appts-day-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.appts-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: rowIn 0.35s var(--ease) backwards;
}

.appts-card-when strong {
  display: block;
  font-size: 1.05rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.appts-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.appts-card-text {
  min-width: 0;
}

.appts-card-text strong {
  display: block;
  font-size: 0.9375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.appts-card-text span {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.appts-card-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
}

.appts-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.appts-card-actions .btn-xs {
  margin: 0;
}

.appts-no-actions {
  color: var(--text-tertiary);
  font-size: 0.8125rem;
}

.btn.danger,
.btn-xs.danger {
  color: var(--danger);
}

@media (max-width: 720px) {
  .appts-card {
    grid-template-columns: 56px 1fr;
    grid-template-areas:
      "when main"
      "side side";
  }
  .appts-card-when { grid-area: when; }
  .appts-card-main { grid-area: main; }
  .appts-card-side {
    grid-area: side;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  .appts-card-actions { justify-content: flex-start; }
}

/* legacy table (unused) */
.appt-table-wrap { overflow-x: auto; }

.appt-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.appt-table th,
.appt-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.appt-table th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.appt-table tr {
  transition: background 0.15s;
}

.appt-table tbody tr:hover {
  background: rgba(10, 74, 122, 0.03);
}

/* ——— Account ——— */
.account-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.account-profile-card .panel-head {
  align-items: center;
}

.account-profile-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.account-profile-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: start;
}

.account-profile-card.is-editing .account-profile-split {
  grid-template-columns: minmax(240px, 0.95fr) minmax(280px, 1.15fr);
  gap: 18px;
}

.account-profile-edit {
  border-left: 1px solid var(--border);
  padding-left: 18px;
  min-width: 0;
}

.account-profile-edit[hidden] {
  display: none !important;
}

.account-settings-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

@media (max-width: 1100px) {
  .account-settings-row {
    grid-template-columns: 1fr 1fr;
  }
  .account-settings-row .account-setting-card:last-child {
    grid-column: 1 / -1;
  }
}

.account-setting-card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.account-setting-card .panel-head {
  margin-bottom: 8px;
}

.account-setting-card .panel-head h3 {
  font-size: 0.95rem;
}

.info-list-compact {
  gap: 8px;
}

.info-list-compact > div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
  align-items: baseline;
}

.info-list-compact dt {
  margin: 0;
  font-size: 0.7rem;
}

.info-list-compact dd {
  margin: 0;
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.profile-edit-form-side {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  gap: 10px;
}

.profile-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

.profile-edit-span {
  grid-column: 1 / -1;
}

.profile-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 2px;
}

.profile-edit-form-side .field-input {
  padding: 9px 12px;
}

.profile-edit-form-side .field-input.textarea {
  min-height: 64px;
  resize: vertical;
}

.password-compact-form {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  gap: 10px;
}

.password-compact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 1200px) {
  .password-compact-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.password-compact-form .field-input {
  padding: 9px 12px;
}

.password-compact-form .btn {
  align-self: stretch;
  width: 100%;
  justify-content: center;
}

.session-price-block strong {
  font-size: 1.25rem;
  margin: 4px 0 10px;
}

.cancel-window-block strong {
  font-size: 0.95rem;
  margin: 4px 0 10px;
}

.cancel-window-chips {
  margin-bottom: 10px;
  gap: 6px;
}

.cancel-chip {
  padding: 7px 11px;
  font-size: 0.8125rem;
}

.session-price-form {
  margin-top: 0;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.session-price-form .field-label {
  width: 100%;
  margin-bottom: 0;
}

.session-price-form .field-input {
  flex: 1;
  min-width: 100px;
  padding: 9px 12px;
}

.session-price-form .btn {
  flex-shrink: 0;
}

.price-intro-static {
  display: none;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  align-items: start;
}

.account-grid .panel-card { margin-bottom: 0; }

.patients-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 18px;
  align-items: start;
}

.patients-layout .panel-card { margin-bottom: 0; }

.panel-wide { grid-column: 1 / -1; }

.info-list {
  margin: 0;
  display: grid;
  gap: 12px;
}

.info-list dt {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.info-list dd {
  margin: 2px 0 0;
  font-size: 0.9375rem;
}

/* ——— Wallet card ——— */
.wallet-card .panel-head {
  margin-bottom: 4px;
}

.wallet-hero {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(10, 74, 122, 0.12) 0%, rgba(0, 122, 255, 0.08) 100%),
    var(--surface);
  border: 1px solid rgba(10, 74, 122, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.wallet-hero-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--brand) 0%, var(--brand-light) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(10, 74, 122, 0.28);
}

.wallet-hero-icon svg {
  width: 24px;
  height: 24px;
}

.wallet-hero-body {
  min-width: 0;
}

.wallet-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.wallet-balance {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--brand);
  letter-spacing: -0.02em;
}

.wallet-hint {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  line-height: 1.4;
}

.withdraw-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.wallet-withdraw-btn {
  margin-top: 4px;
  padding: 13px 18px;
  font-weight: 600;
  border-radius: 12px;
}

.input-money {
  display: flex;
  align-items: stretch;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.1);
  overflow: hidden;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.input-money:hover {
  border-color: rgba(10, 74, 122, 0.2);
}

.input-money:focus-within {
  border-color: rgba(0, 122, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.input-money-prefix {
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--brand);
  background: rgba(10, 74, 122, 0.06);
  border-right: 1px solid var(--border);
}

.field-input-money {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding-left: 12px !important;
}

.field-input-money::-webkit-outer-spin-button,
.field-input-money::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.field-input-money[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.finance-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.finance-stat {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.finance-stat:hover {
  border-color: rgba(10, 74, 122, 0.15);
  box-shadow: var(--shadow-sm);
}

.finance-stat-highlight {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(10, 74, 122, 0.06), rgba(0, 122, 255, 0.04));
  border-color: rgba(10, 74, 122, 0.14);
}

.finance-stat-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

.finance-stat-value {
  display: block;
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.finance-stat-value-sm {
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--font);
}

/* ——— Form fields (account) ——— */
.field-input {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.field-input:hover {
  background: var(--surface);
  border-color: rgba(15, 23, 42, 0.14);
}

.field-input:focus {
  outline: none;
  background: var(--surface);
  border-color: rgba(0, 122, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.field-input::placeholder {
  color: var(--text-tertiary);
}

.field-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.field-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.field-hint {
  margin: -4px 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

.profile-loc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.profile-loc-coords {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  flex: 1;
  min-width: 160px;
}

.profile-edit-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.profile-edit-form .btn {
  align-self: flex-start;
  margin-top: 4px;
  border-radius: 10px;
}

.session-price-block {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.session-price-block strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--brand);
  display: block;
  margin: 8px 0;
}

.cancel-window-block {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.cancel-window-block strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--brand);
  display: block;
  margin: 8px 0 16px;
  line-height: 1.4;
}

.cancel-window-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.cancel-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease);
}

.cancel-chip:hover {
  border-color: rgba(0, 122, 255, 0.45);
}

.cancel-chip.is-active {
  border-color: var(--accent);
  background: rgba(0, 122, 255, 0.1);
  color: var(--accent);
}

#cancelWindowSaveBtn {
  border-radius: 10px;
}

.price-intro {
  font-size: 0.8125rem;
  line-height: 1.55;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--brand) 0%, var(--brand-light) 100%);
  color: #fff;
}

.price-current-label {
  margin: 0 0 4px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.session-price-form {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session-price-form .field-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 8px;
}

.session-price-quote {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(10, 74, 122, 0.06);
  border: 1px solid rgba(10, 74, 122, 0.15);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text);
}

.session-price-quote p {
  margin: 0 0 6px;
  color: var(--text);
}

.session-price-quote p:last-child {
  margin-bottom: 0;
}

.session-price-quote .quote-meta {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.session-price-form .btn-sm {
  align-self: flex-start;
  margin-top: 8px;
}

/* ——— Toast ——— */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 200;
  transition: transform 0.35s var(--ease), opacity 0.35s;
  opacity: 0;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ——— Portal features: messages, notifications, modals ——— */
.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-item { position: relative; }
.nav-item .nav-badge { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }

.messages-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 18px;
  min-height: 560px;
}

.messages-sidebar,
.messages-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.messages-sidebar { padding: 12px; display: flex; flex-direction: column; gap: 6px; }

.msg-partner {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--text);
}

.msg-partner:hover { background: var(--surface-2); }
.msg-partner.active { background: var(--brand-soft); color: var(--brand); }

.msg-partner-avatar,
.person-avatar,
.chat-head-avatar,
.patient-row-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  overflow: hidden;
}

.msg-partner-avatar.has-img,
.person-avatar.has-img,
.chat-head-avatar.has-img,
.patient-row-avatar.has-img {
  background: transparent;
}

.msg-partner-avatar img,
.person-avatar img,
.chat-head-avatar img,
.patient-row-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.msg-partner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.msg-partner-text strong {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-partner-text span,
.msg-partner span { font-size: 0.75rem; color: var(--text-secondary); }

.messages-main { display: flex; flex-direction: column; }
.chat-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.chat-head-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.chat-head-sub { display: block; font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }
.chat-messages { flex: 1; padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; min-height: 380px; max-height: 520px; }
.chat-bubble { max-width: 78%; padding: 10px 12px; border-radius: 16px; }
.chat-bubble.mine { align-self: flex-end; background: rgba(0, 122, 255, 0.14); border-bottom-right-radius: 6px; }
.chat-bubble.theirs { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.chat-text { font-size: 0.9375rem; white-space: pre-wrap; word-break: break-word; }
.chat-media { margin: 0; }
.chat-media img {
  display: block;
  max-width: min(280px, 100%);
  max-height: 320px;
  width: auto;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
  cursor: zoom-in;
}
.chat-bubble.mine .chat-media img { border-bottom-right-radius: 4px; }
.chat-bubble.theirs .chat-media img { border-bottom-left-radius: 4px; }
.price-intro-static {
  margin: 0 0 12px;
  padding: 0 4px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.45;
}
.chat-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.chat-time { font-size: 0.6875rem; color: var(--text-tertiary); }
.chat-read { font-size: 0.6875rem; color: var(--brand); font-weight: 600; }
.chat-compose { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat-compose input { flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; }

.notif-list { display: flex; flex-direction: column; }
.notif-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.notif-row.read { opacity: 0.65; }
.notif-kind { display: block; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--brand); margin-bottom: 2px; }
.notif-main strong { display: block; font-size: 0.9375rem; }
.notif-main p { margin: 4px 0 0; font-size: 0.8125rem; color: var(--text-secondary); }
.notif-time { display: block; margin-top: 6px; font-size: 0.75rem; color: var(--text-tertiary); }

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); }

.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.modal-card.avail-modal {
  max-width: 560px;
}

.confirm-root { z-index: 2100; animation: confirm-fade 0.15s var(--ease); }
.confirm-card { max-width: 420px; animation: confirm-pop 0.18s var(--ease); }

.confirm-body {
  display: flex;
  gap: 14px;
  padding: 22px 22px 18px;
}

.confirm-body h3 {
  margin: 2px 0 6px;
  font-family: var(--font-display);
  font-size: 1.0625rem;
}

.confirm-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  font-size: 1.05rem;
}

.confirm-icon.is-danger { background: #fee2e2; color: #dc2626; }

@keyframes confirm-fade { from { opacity: 0; } }
@keyframes confirm-pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } }

.avail-modal-sub {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.avail-modal-body {
  gap: 18px !important;
  max-height: min(70vh, 640px);
  overflow-y: auto;
}

.avail-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.avail-section-head h4 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 650;
  font-family: var(--font-display);
}

.avail-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.avail-quick-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.avail-quick-btn:hover {
  border-color: rgba(0, 32, 96, 0.25);
  color: var(--brand);
}

.avail-cal {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px;
}

.avail-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.avail-cal-nav h5 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: capitalize;
  text-align: center;
  flex: 1;
}

.avail-cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.avail-cal-dow span {
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 2px 0;
}

.avail-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.avail-cal-cell {
  aspect-ratio: 1;
  min-height: 36px;
  max-height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  color: inherit;
}

.avail-cal-cell.other {
  pointer-events: none;
}

.avail-cal-day {
  background: var(--surface);
  border-color: var(--border);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.avail-cal-day:hover:not(:disabled) {
  border-color: rgba(0, 32, 96, 0.35);
}

.avail-cal-day.today {
  border-color: var(--accent);
}

.avail-cal-day.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 3px 10px rgba(0, 32, 96, 0.2);
}

.avail-cal-day.past,
.avail-cal-day:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: transparent;
}

.avail-cal-num {
  font-size: 0.8125rem;
  font-weight: 650;
  font-family: var(--font-display);
}

.avail-cal-selected {
  margin: 10px 0 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.avail-step-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.avail-step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-right: 2px;
}

.avail-step-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.avail-step-btn:hover {
  border-color: rgba(0, 32, 96, 0.3);
  color: var(--brand);
}

.avail-step-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.avail-times {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}

.avail-time-chip {
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.avail-time-chip:hover:not(:disabled) {
  border-color: rgba(0, 32, 96, 0.3);
}

.avail-time-chip.active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}

.avail-time-chip.taken,
.avail-time-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  text-decoration: line-through;
}

.avail-summary {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.875rem;
  font-weight: 600;
}

.avail-modal-block .avail-cal-day.active {
  background: #475569;
  border-color: #475569;
  box-shadow: 0 3px 10px rgba(71, 85, 105, 0.25);
}

.avail-modal-block .avail-time-chip.active {
  background: rgba(71, 85, 105, 0.12);
  border-color: #475569;
  color: #334155;
}

.avail-modal-block .avail-summary {
  background: rgba(71, 85, 105, 0.1);
  color: #334155;
}

.avail-modal-foot {
  padding: 16px 20px 20px !important;
  border-top: 1px solid var(--border);
  margin-top: 0;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-head h3 { margin: 0; font-family: var(--font-display); font-size: 1.125rem; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 20px 20px; }
.modal-hint { margin: 0; font-size: 0.875rem; color: var(--text-secondary); }
.modal-close { font-size: 1.5rem; line-height: 1; }

.session-code-box { padding: 16px; border-radius: var(--radius-sm); background: var(--surface-2); text-align: center; }
.session-code { font-size: 2rem; letter-spacing: 0.2em; color: var(--brand); }
.session-code-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}
.patients-list { display: flex; flex-direction: column; gap: 8px; }
.patient-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
}
.patient-row:hover { background: var(--surface-2); }
.patient-row-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}
.patient-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.patient-row-main strong { font-size: 0.95rem; }
.patient-row-main span { font-size: 0.75rem; color: var(--text-secondary); }
.patients-invite-box { padding: 4px 0 8px; }
.patient-history-title {
  margin: 18px 0 10px;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}
.patient-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(42vh, 320px);
  overflow-y: auto;
}
.patient-history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
}
.patient-history-row:hover { background: var(--surface-2); }
.patient-history-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.patient-history-main strong {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.patient-history-main span {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.invite-panel-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}
.invite-qr-wrap {
  background: #fff;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.invite-qr-wrap img { display: block; }
.invite-copy-wrap { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 720px) {
  .invite-panel-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; }
}

.field-input.textarea {
  min-height: 88px;
  resize: vertical;
}
.profile-photo-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.profile-photo-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.profile-photo-img,
.profile-photo-placeholder,
.user-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-photo-placeholder,
.user-avatar:not(.has-img) {
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.5rem;
}

.user-avatar.has-img {
  background: none;
  padding: 0;
  overflow: hidden;
}

.profile-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.appt-actions-cell { white-space: nowrap; }
.appt-actions-cell .btn-xs { margin: 2px 2px 2px 0; }
.btn-xs { padding: 4px 8px; font-size: 0.75rem; }
.btn.danger { color: var(--danger); }

.modal-info { margin: 0; }

/* ——— Patient detail ——— */
.pd-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}
.pd-breadcrumb #pdCrumbName { color: var(--text); font-weight: 600; }
.pd-crumb-link,
.pd-link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
}
.pd-crumb-link:hover,
.pd-link:hover { text-decoration: underline; }
.pd-link { font-size: 0.8125rem; font-weight: 600; }

.pd-header {
  display: flex;
  align-items: center;
  gap: 16px;
}
.pd-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  flex-shrink: 0;
  overflow: hidden;
}
.pd-avatar.has-img { background: transparent; }
.pd-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-header-main { flex: 1; min-width: 0; }
.pd-header-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pd-header-title h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}
.pd-header-meta { margin: 2px 0 0; font-size: 0.8125rem; color: var(--text-secondary); }
.pd-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pd-status {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-secondary);
}
.pd-status.is-active { background: rgba(22, 163, 74, 0.12); color: var(--success); }

.pd-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 18px;
  overflow-x: auto;
}
.pd-tab {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.pd-tab:hover { background: var(--surface-2); }
.pd-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.pd-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}
.pd-grid .panel-card { margin-bottom: 0; }
.pd-col { display: flex; flex-direction: column; gap: 18px; }

.pd-info { margin: 0; display: grid; gap: 10px; }
.pd-info > div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  font-size: 0.875rem;
}
.pd-info dt { color: var(--text-secondary); }
.pd-info dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.pd-info-block {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.8125rem;
}
.pd-info-block span { font-weight: 600; color: var(--text-secondary); }
.pd-info-block p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.pd-info-block.is-warning { background: rgba(217, 119, 6, 0.08); }
.pd-info-block.is-warning span { color: var(--warning); }
.pd-info-foot { margin: 14px 0 0; }

.pd-header-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pd-header-tags:empty { display: none; }
.pd-chip.is-brand { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.pd-chip.is-warning { background: rgba(217, 119, 6, 0.1); border-color: transparent; color: var(--warning); }
.pd-header-tags .pd-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

.pd-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pd-form-row > div { display: flex; flex-direction: column; gap: 6px; }
.pd-form-buttons { display: flex; gap: 8px; flex-shrink: 0; }

.pd-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pd-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.pd-stat strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--brand);
}
.pd-stat span { font-size: 0.75rem; color: var(--text-secondary); }
.pd-stat.is-success strong { color: var(--success); }
.pd-stat.is-accent strong { color: var(--accent); }
.pd-stat.is-danger strong { color: var(--danger); }

.pd-note-date { font-size: 0.75rem; color: var(--text-tertiary); white-space: nowrap; }
.pd-form { display: flex; flex-direction: column; gap: 6px; }
.pd-form .field-label { margin-top: 6px; }
.pd-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}
.pd-form-hint { font-size: 0.75rem; color: var(--text-tertiary); }

.pd-survey {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}
.pd-survey strong { color: var(--brand); }
.pd-survey p { flex-basis: 100%; margin: 2px 0 0; font-style: italic; }

.pd-chart-body { position: relative; height: 240px; }
.pd-chart-body .empty-hint { margin: 0; }
#pdPainTrend.is-better { background: rgba(22, 163, 74, 0.12); color: var(--success); }
#pdPainTrend.is-worse { background: rgba(220, 38, 38, 0.1); color: var(--danger); }

.pd-tab-body .patient-history-list { max-height: none; overflow: visible; }
.patient-history-row.is-selected { border-color: var(--accent); background: rgba(0, 122, 255, 0.05); }
.pd-row-tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.pd-chip {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}

.pd-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.pd-timeline-item {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
}
.pd-timeline-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pd-timeline-head strong { font-size: 0.875rem; }
.pd-timeline-head span { flex: 1; font-size: 0.75rem; color: var(--text-secondary); }
.pd-timeline-note { margin: 8px 0 0; font-size: 0.875rem; white-space: pre-wrap; }
.pd-timeline-hw {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.8125rem;
}
.pd-timeline-hw strong { margin-left: 6px; }
.pd-timeline-hw p { margin: 6px 0 0; white-space: pre-wrap; }
.pd-timeline-hw a { display: inline-block; margin-top: 6px; color: var(--accent); word-break: break-all; }

.pd-plan {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.pd-plan:first-child { padding-top: 0; }
.pd-plan:last-child { border-bottom: none; padding-bottom: 0; }
.pd-plan-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pd-plan p { margin: 6px 0 0; font-size: 0.875rem; color: var(--text-secondary); white-space: pre-wrap; }
.pd-plan-meta { display: block; margin-top: 6px; font-size: 0.75rem; color: var(--text-tertiary); }
.pd-progress {
  height: 6px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.pd-progress span { display: block; height: 100%; background: var(--success); border-radius: inherit; }
.pd-progress.is-accent span { background: var(--accent); }

/* Son değerlendirme */
.pd-assess-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.pd-assess-cell {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.pd-assess-label { font-size: 0.75rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-assess-value { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; }
.pd-assess-value strong { font-size: 1.5rem; font-weight: 700; color: var(--brand); line-height: 1; }
.pd-assess-value strong small { font-size: 0.8125rem; font-weight: 600; color: var(--text-tertiary); }
.pd-assess-cell .pd-progress { margin-top: 0; }
.pd-spark { width: 80px; height: 32px; color: var(--danger); flex-shrink: 0; }
.pd-status-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.pd-status-chip.is-success { background: rgba(22, 163, 74, 0.12); color: var(--success); }
.pd-status-chip.is-accent { background: rgba(0, 122, 255, 0.1); color: var(--accent); }
.pd-status-chip.is-danger { background: rgba(220, 38, 38, 0.1); color: var(--danger); }

.pd-assess-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.pd-assess-row:first-child { padding-top: 0; }
.pd-assess-row:last-child { border-bottom: none; padding-bottom: 0; }
.pd-assess-row-main { flex: 1; min-width: 0; }
.pd-assess-row-main strong { font-size: 0.875rem; }
.pd-assess-metrics { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; font-size: 0.8125rem; color: var(--text-secondary); }
.pd-assess-metrics b { color: var(--text); }
.pd-assess-row-main p { margin: 6px 0 0; font-size: 0.8125rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.pd-row-delete { color: var(--text-tertiary); font-size: 1.125rem; flex-shrink: 0; }
.pd-row-delete:hover { color: var(--danger); }
.pd-range { width: 100%; accent-color: var(--brand); }
.field-label output { margin-left: 6px; font-weight: 700; color: var(--brand); }

/* Egzersiz fotoğrafı (hover'da başlangıç → bitiş pozu) */
.pd-ex-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}
.pd-ex-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.35s ease;
}
.pd-ex-photo.has-motion img:nth-child(2) { opacity: 0; }
.pd-ex-card:hover .pd-ex-photo.has-motion img:nth-child(2),
.pd-lib-card:hover .pd-ex-photo.has-motion img:nth-child(2),
.pd-ex-mini:hover .pd-ex-photo.has-motion img:nth-child(2) {
  animation: pdExMotion 1.6s ease-in-out infinite;
}
@keyframes pdExMotion {
  0%, 20% { opacity: 0; }
  50%, 70% { opacity: 1; }
  100% { opacity: 0; }
}
.pd-ex-photo.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-soft);
}
.pd-ex-photo.is-empty span { font-size: 1.75rem; font-weight: 700; color: var(--brand); }

/* Genel bakış: egzersiz şeridi */
.pd-ex-strip-card { margin-bottom: 18px; }
.pd-ex-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.pd-ex-mini {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  border: none;
  background: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.pd-ex-mini strong { margin-top: 6px; font-size: 0.8125rem; color: var(--text); }
.pd-ex-mini span { font-size: 0.75rem; color: var(--text-secondary); }

/* Program kartları */
.pd-ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.pd-ex-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}
.pd-ex-card .pd-ex-photo { border-radius: 0; }
.pd-ex-body { padding: 12px 12px 4px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pd-ex-body strong { font-size: 0.9375rem; }
.pd-ex-dose { font-size: 0.875rem; font-weight: 700; color: var(--brand); }
.pd-ex-meta { font-size: 0.75rem; color: var(--text-secondary); }
.pd-ex-body p { margin: 4px 0 0; font-size: 0.8125rem; color: var(--text-secondary); white-space: pre-wrap; }
.pd-ex-actions { display: flex; gap: 6px; padding: 8px 12px 12px; }
.btn.is-danger { color: var(--danger); }

/* Kütüphane */
.pd-lib-filters { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 10px; margin-bottom: 10px; }
.pd-lib-regions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pd-filter-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}
.pd-filter-chip:hover { background: var(--surface-2); }
.pd-filter-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pd-lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.pd-lib-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.pd-lib-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pd-lib-body strong { font-size: 0.8125rem; }
.pd-lib-body span { font-size: 0.75rem; color: var(--text-secondary); }

/* Egzersiz modalı */
.pd-ex-form-head { display: grid; grid-template-columns: 140px 1fr; gap: 14px; margin-bottom: 6px; }
.pd-ex-form-head strong { font-size: 0.9375rem; }
.pd-ex-form-head ol { margin: 6px 0 0; padding-left: 18px; font-size: 0.8125rem; color: var(--text-secondary); }
.pd-ex-form-head li + li { margin-top: 3px; }
.pd-form-row-3 { grid-template-columns: repeat(3, 1fr); }
.pd-check { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; margin-top: 4px; }

/* Dosyalar */
.pd-file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.pd-file-row:first-child { padding-top: 0; }
.pd-file-row:last-child { border-bottom: none; padding-bottom: 0; }
.pd-file-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 800;
  flex-shrink: 0;
}
.pd-file-icon.is-pdf { background: rgba(220, 38, 38, 0.1); color: var(--danger); }
.pd-file-icon.is-img { background: rgba(0, 122, 255, 0.1); color: var(--accent); }
.pd-file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pd-file-main strong { font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-file-main span { font-size: 0.75rem; color: var(--text-secondary); }
.pd-file-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

@media (max-width: 1024px) {
  .pd-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .pd-assess-grid { grid-template-columns: 1fr; }
  .pd-lib-filters { grid-template-columns: 1fr; }
  .pd-form-row-3 { grid-template-columns: repeat(3, 1fr); }
  .pd-ex-form-head { grid-template-columns: 1fr; }
  .pd-file-row { flex-wrap: wrap; }
}
@media (max-width: 720px) {
  .pd-header { flex-wrap: wrap; }
  .pd-header-actions { width: 100%; }
  .pd-stats { grid-template-columns: repeat(2, 1fr); }
  .pd-form-row { grid-template-columns: 1fr; }
  .pd-info > div { grid-template-columns: 110px 1fr; }
  .pd-info > div { grid-template-columns: 100px 1fr; }
}

/* ——— Responsive ——— */
@media (max-width: 1024px) {
  .patients-layout { grid-template-columns: 1fr; }
  .calendar-workspace {
    grid-template-columns: 1fr;
  }
  .view-calendar.active {
    max-height: none;
    overflow: visible;
  }
  .calendar-grid {
    height: auto;
    min-height: 300px;
    grid-auto-rows: minmax(38px, auto);
  }
  .calendar-grid.is-week { height: 68vh; min-height: 420px; }
  .calendar-detail {
    height: auto;
    max-height: 36vh;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-md);
  }

  .main-wrap { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .user-meta { display: none; }
  .finance-stats { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
  .account-settings-row { grid-template-columns: 1fr; }
  .account-profile-card.is-editing .account-profile-split {
    grid-template-columns: 1fr;
  }
  .account-profile-edit {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-top: 4px;
  }
  .profile-edit-grid { grid-template-columns: 1fr; }
  .messages-layout { grid-template-columns: 1fr; }
  .messages-sidebar { max-height: 200px; overflow-y: auto; }
  .appt-row { grid-template-columns: 60px 1fr; }
  .appt-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .main-content { padding: 18px 16px 28px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .view-calendar.active {
    max-height: none;
    overflow: visible;
  }
  .calendar-workspace {
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .calendar-grid {
    height: auto;
    grid-auto-rows: minmax(40px, auto);
  }
  .calendar-grid.is-week { height: 64vh; }
  .cw { --cw-axis: 46px; --cw-col-min: 84px; }
  .calendar-detail {
    height: auto;
    max-height: 40vh;
  }
}

.packages-list .package-row,
.package-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.packages-list .package-row:last-child,
.package-row:last-child {
  border-bottom: none;
}
.package-row-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
  flex-wrap: wrap;
}
.package-edit-card {
  padding: 12px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.package-edit-card:last-child {
  border-bottom: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
