:root {
  --color-primary:       #FFB6C1;
  --color-primary-dark:  #E8879A;
  --color-primary-light: #FFE4EC;
  --color-accent:        #C9184A;
  --color-bg:            #FFF9FB;
  --color-surface:       #FFFFFF;
  --color-border:        #F2C6D0;
  --color-text:          #3D1A24;
  --color-text-muted:    #9A6E7C;
  --color-success-bg:    #D4EDDA;
  --color-success-text:  #155724;
  --color-error-bg:      #FFADAD;
  --color-error-text:    #6B0000;
  --radius-sm:           6px;
  --radius-md:           12px;
  --radius-lg:           20px;
  --shadow-card:         0 2px 12px rgba(200, 100, 130, 0.12);
  --shadow-modal:        0 8px 32px rgba(200, 100, 130, 0.22);
  --font-base:           'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font-base);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

/* ── NAV ── */
.nav {
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(200, 100, 130, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.nav-logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.nav-logo svg { flex-shrink: 0; }

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  align-items: center;
  justify-content: center;
}

.nav-end {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--color-primary-light);
  color: var(--color-accent);
}

/* ── PAGE WRAPPER ── */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1.5rem;
}

/* ── PAGE TITLE ROW ── */
.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.page-title-row .page-title { margin-bottom: 0; }

/* ── CLIENT SEARCH ── */
.client-search-bar {
  margin-bottom: 1rem;
}

.client-search-bar input {
  width: 100%;
  max-width: 360px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-size: 0.95rem;
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.client-search-bar input:focus {
  border-color: var(--color-primary-dark);
  box-shadow: 0 0 0 3px rgba(232, 135, 154, 0.15);
}

/* ── CLIENT SEARCH WRAP (procedure form) ── */
.client-search-wrap {
  position: relative;
}

.client-search-wrap input[type="text"] {
  width: 100%;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-size: 0.95rem;
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.client-search-wrap input[type="text"]:focus {
  border-color: var(--color-primary-dark);
  box-shadow: 0 0 0 3px rgba(232, 135, 154, 0.15);
}

.client-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-modal);
  list-style: none;
  z-index: 50;
  max-height: 220px;
  overflow-y: auto;
}

.client-dropdown li {
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--color-text);
  transition: background 0.12s;
}

.client-dropdown li:hover {
  background: var(--color-primary-light);
  color: var(--color-accent);
}

/* ── PROCEDURE GRID ── */
.proc-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.proc-chip {
  padding: 0.45rem 0.9rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-base);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.proc-chip:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary-dark);
  color: var(--color-accent);
}

.proc-chip.active {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: white;
}

.proc-chip--other {
  border-style: dashed;
}

.treatment-custom-input {
  display: none;
  width: 100%;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-size: 0.95rem;
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  margin-top: 0.5rem;
}

.treatment-custom-input:focus {
  border-color: var(--color-primary-dark);
  box-shadow: 0 0 0 3px rgba(232, 135, 154, 0.15);
}

/* ── FORM ROW (date + time + duration) ── */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
}

/* ── FORM ACTIONS ── */
.form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}

/* ── PROCEDURE PAGE LAYOUT ── */
.proc-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 800px) {
  .proc-layout {
    grid-template-columns: 1fr;
  }
}

/* ── CONFLICT PANEL ── */
.conflict-panel {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 1rem 1.25rem;
  position: sticky;
  top: 76px;
}

.conflict-panel__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.conflict-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.conflict-item {
  background: var(--color-primary-light);
  border-left: 3px solid var(--color-primary-dark);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.conflict-item__time {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-accent);
}

.conflict-item__name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
}

.conflict-item__proc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ── HERO / DASHBOARD ── */
.hero {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-accent);
  margin-bottom: 0.4rem;
}

.hero p {
  color: var(--color-text-muted);
  font-size: 1rem;
  margin-bottom: 2.5rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-decoration: none;
  color: var(--color-text);
  box-shadow: var(--shadow-card);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(200, 100, 130, 0.18);
  border-color: var(--color-primary-dark);
}

.card-icon {
  width: 56px;
  height: 56px;
  background: var(--color-primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.card h2 {
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
}

.card p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-align: center;
  line-height: 1.5;
}

/* ── STATS BAR ── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.stat-card--accent { border-color: var(--color-primary-dark); }

.stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

@media (max-width: 500px) {
  .stats-bar { grid-template-columns: 1fr; }
}

/* ── FORM ── */
.form-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 2rem;
  max-width: 600px;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-size: 0.95rem;
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--color-primary-dark);
  box-shadow: 0 0 0 3px rgba(232, 135, 154, 0.15);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.form-group .field-error {
  display: none;
  color: var(--color-accent);
  font-size: 0.78rem;
  margin-top: 0.3rem;
}

.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
  border-color: var(--color-accent);
}

.form-group.has-error .field-error { display: block; }

.phone-input-row {
  display: flex;
  gap: 0.5rem;
}
.phone-input-row .phone-prefix-select {
  width: auto;
  flex-shrink: 0;
}
.phone-input-row input {
  flex: 1;
  width: auto;
}

/* ── SWATCHES ── */
.swatches {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s;
  outline: none;
}

.swatch:hover { transform: scale(1.15); }

.swatch.active {
  border-color: var(--color-accent);
  transform: scale(1.1);
  box-shadow: 0 0 0 2px white, 0 0 0 4px var(--color-accent);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-base);
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--color-primary-dark);
  color: white;
}

.btn-primary:hover { background: var(--color-accent); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1.5px solid var(--color-border);
}

.btn-ghost:hover {
  background: var(--color-primary-light);
  color: var(--color-accent);
  border-color: var(--color-primary-dark);
}

/* ── TOAST ── */
.toast {
  position: fixed;
  top: 4.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  padding: 1rem 1.75rem;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 600;
  box-shadow: var(--shadow-modal);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  max-width: 480px;
  width: max-content;
  text-align: center;
}

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

.toast.success { background: var(--color-success-bg); color: var(--color-success-text); }
.toast.error   { background: var(--color-error-bg);   color: var(--color-error-text); }

/* ── CALENDAR ── */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.calendar-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
}

.calendar-nav-btn {
  background: var(--color-primary-light);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.calendar-nav-btn:hover { background: var(--color-primary); }

.calendar-grid {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.calendar-day-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--color-primary-light);
}

.calendar-day-headers span {
  text-align: center;
  padding: 0.6rem 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar-cells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-cell {
  min-height: 90px;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 0.35rem;
  vertical-align: top;
  position: relative;
  background: var(--color-surface);
  transition: background 0.12s;
  cursor: pointer;
}

.cal-cell:hover { background: #FFF0F4; }

.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:nth-last-child(-n+7) { border-bottom: none; }

.cal-cell.other-month { background: #FDF3F6; }
.cal-cell.today { background: var(--color-primary-light); }

.cal-cell.today .day-num {
  background: var(--color-accent);
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-num {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
  line-height: 1;
}

.other-month .day-num { color: #D4A5B8; }

.chips { display: flex; flex-direction: column; gap: 2px; }

.chip {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  background: var(--color-primary-light);
  color: var(--color-accent);
  border: 1px solid var(--color-border);
  transition: filter 0.12s, transform 0.1s;
  user-select: none;
}

.chip-time {
  font-size: 0.62rem;
  font-weight: 700;
  opacity: 0.75;
  flex-shrink: 0;
}

.chip:hover { filter: brightness(0.92); transform: scale(1.02); }

.chip .chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.chip.next-procedure {
  border-width: 1.5px;
  border-color: rgba(0,0,0,0.2);
}

.next-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  color: white;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  animation: pulse-badge 1.8s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* ── LEGEND ── */
.calendar-legend {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
  width: 200px;
  flex-shrink: 0;
}

.legend-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.8rem;
}

.legend-items { display: flex; flex-direction: column; gap: 0.5rem; }

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--color-text);
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.1);
}

.legend-empty {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-style: italic;
}

/* ── MODAL ── */
dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  padding: 0;
  max-width: 420px;
  width: 90vw;
}

dialog::backdrop {
  background: rgba(61, 26, 36, 0.35);
  backdrop-filter: blur(2px);
}

.modal-inner {
  padding: 1.75rem;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}

.modal-close {
  background: var(--color-primary-light);
  border: none;
  border-radius: var(--radius-sm);
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}

.modal-close:hover { background: var(--color-primary); color: var(--color-accent); }

.modal-color-bar {
  height: 5px;
  border-radius: 3px;
  margin-bottom: 1rem;
}

.modal-rows { display: flex; flex-direction: column; gap: 0.7rem; }

.modal-footer { margin-top: 1.25rem; display: flex; justify-content: flex-end; }

.modal-row {
  display: flex;
  gap: 0.5rem;
}

.modal-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 80px;
}

.modal-value {
  font-size: 0.9rem;
  color: var(--color-text);
  flex: 1;
}

.modal-next-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--color-accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* ── LOADING ── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  gap: 0.6rem;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--color-border);
  border-top-color: var(--color-primary-dark);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  .cal-cell { min-height: 60px; }
  .chip { font-size: 0.62rem; padding: 2px 4px; }

  .nav-inner {
    grid-template-columns: 1fr auto;
    height: auto;
    padding: 0.75rem 1rem;
    row-gap: 0.25rem;
  }
  .nav-logo  { grid-column: 1; grid-row: 1; }
  .nav-end   { grid-column: 2; grid-row: 1; }
  .nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
    flex-wrap: wrap;
    padding-bottom: 0.35rem;
  }
  .nav-links a { padding: 0.4rem 0.6rem; font-size: 0.82rem; }
}

.nav-logout {
  font-size: 0.85rem;
  padding: 0.4rem 0.85rem;
  height: auto;
  background: transparent;
  border: 1px solid var(--color-border);
  cursor: pointer;
}
.nav-logout:hover { background: var(--color-hover, rgba(0,0,0,.05)); }

/* ── DATA TABLE ── */
.table-wrap {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

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

.data-table th {
  background: var(--color-primary-light);
  color: var(--color-accent);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  text-align: left;
}

.data-table td {
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
  color: var(--color-text);
  vertical-align: middle;
}

.data-table tbody tr:hover td { background: var(--color-bg); }

.table-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.table-actions { display: flex; gap: 0.5rem; }

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-danger {
  background: transparent;
  color: var(--color-accent);
  border: 1.5px solid var(--color-border);
}
.btn-danger:hover { background: var(--color-error-bg); border-color: var(--color-accent); }

.client-link {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
}
.client-link:hover { text-decoration: underline; }

/* ── CLIENT DETAIL ── */
.detail-back { margin-bottom: 1.25rem; }

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.info-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.75rem;
}

.info-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.info-item { display: flex; flex-direction: column; gap: 0.2rem; }
.info-item--full { grid-column: 1 / -1; }

.info-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-value {
  font-size: 0.95rem;
  color: var(--color-text);
  white-space: pre-wrap;
}

.color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.1);
  margin-right: 0.4rem;
  vertical-align: middle;
}

.notes-cell {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-text-muted);
}

/* ── DAY VIEW MODAL ── */
#day-modal {
  max-width: 600px;
  width: 95vw;
}

.day-modal-inner {
  display: flex;
  flex-direction: column;
  max-height: 82vh;
}

.day-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.75rem 1rem;
  border-bottom: 2px solid var(--color-border);
  flex-shrink: 0;
}

.day-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
}

.day-modal-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.day-empty {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  font-style: italic;
}

.day-untimed {
  padding: 0.85rem 1.25rem;
  border-bottom: 2px solid var(--color-border);
  background: #FDF3F6;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.day-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.1rem;
}

/* ── TIMELINE ── */
.day-timeline { }

.tl-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  min-height: 52px;
  border-bottom: 1px solid var(--color-border);
}

.tl-row:last-child { border-bottom: none; }

.tl-hour {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-text-muted);
  padding: 0.55rem 0.4rem 0 0.75rem;
  border-right: 2px solid var(--color-border);
  line-height: 1;
  flex-shrink: 0;
  white-space: nowrap;
}

.tl-row--busy .tl-hour {
  color: var(--color-accent);
}

.tl-events {
  padding: 0.4rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* ── EVENT CARD ── */
.ev-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: var(--color-surface);
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}

.ev-time {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-accent);
  min-width: 34px;
  flex-shrink: 0;
  padding-top: 2px;
}

.ev-info { flex: 1; min-width: 0; }

.ev-delete { margin-left: auto; flex-shrink: 0; align-self: center; }

.ev-client {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ev-procedure {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 0.1rem;
}

.ev-duration {
  color: var(--color-accent);
  font-weight: 600;
}

@media (max-width: 480px) {
  .day-modal-header { padding: 1.1rem 1.1rem 0.85rem; }
  .tl-row { grid-template-columns: 44px 1fr; }
  .tl-hour { font-size: 0.62rem; padding-left: 0.4rem; }
  .tl-events { padding: 0.35rem 0.5rem; }
}
