/* ── Base ─────────────────────────────────────────────────── */
* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  background: #111827;
  color: #f9fafb;
}

/* ── Inputs ───────────────────────────────────────────────── */
.input {
  width: 100%;
  background: #374151;
  border: 1.5px solid #4b5563;
  border-radius: 8px;
  color: #f9fafb;
  font-size: 0.95rem;
  margin-top: 4px;
  padding: 0.6rem 0.75rem;
  transition: border-color 0.15s;
}
.input:focus {
  border-color: #f59e0b;
  outline: none;
}
.input option { background: #374151; }

label {
  color: #d1d5db;
  font-size: 0.875rem;
  font-weight: 600;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  border-radius: 8px;
  font-weight: 700;
  padding: 0.6rem 1.25rem;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  border: none;
  font-size: 0.95rem;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: #f59e0b; color: #111827; }
.btn-primary:hover { background: #d97706; }
.btn-danger  { background: #ef4444; color: #fff; }
.btn-danger:hover  { background: #dc2626; }
.btn-success { background: #10b981; color: #fff; }
.btn-success:hover { background: #059669; }
.btn-ghost   { background: #374151; color: #f9fafb; }
.btn-ghost:hover   { background: #4b5563; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: #1f2937;
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid #374151;
}

/* ── Schedule row ─────────────────────────────────────────── */
.schedule-row {
  background: #374151;
  border-radius: 8px;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr;
  padding: 0.75rem 1rem;
  align-items: center;
}
@media (min-width: 640px) {
  .schedule-row { grid-template-columns: 1.5fr 1fr 1fr 0.8fr auto; }
}

/* ── Chat ─────────────────────────────────────────────────── */
.chat-area {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 4px; }

.msg-bubble {
  max-width: 80%;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 0.9rem;
  word-break: break-word;
}

.msg-bot {
  background: #374151;
  color: #f9fafb;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.msg-user {
  background: #d97706;
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

.chat-input-area {
  padding: 0.75rem 1rem;
  border-top: 1px solid #374151;
  display: flex;
  gap: 0.5rem;
  background: #1f2937;
}

.chat-input {
  flex: 1;
  background: #374151;
  border: 1.5px solid #4b5563;
  border-radius: 24px;
  color: #f9fafb;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  outline: none;
}
.chat-input:focus { border-color: #f59e0b; }

.chat-send-btn {
  background: #f59e0b;
  border: none;
  border-radius: 50%;
  color: #111827;
  cursor: pointer;
  font-size: 1.1rem;
  height: 40px;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.chat-send-btn:hover { background: #d97706; }

.typing-indicator span {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #9ca3af;
  animation: bounce 1.2s infinite;
  margin: 0 2px;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
}

/* ── Quick action chips ───────────────────────────────────── */
.chip {
  background: #374151;
  border: 1px solid #4b5563;
  border-radius: 16px;
  color: #d1d5db;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0.3rem 0.75rem;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.chip:hover { background: #f59e0b; color: #111827; border-color: #f59e0b; }

/* ── Toast ────────────────────────────────────────────────── */
.toast {
  bottom: 1.25rem;
  left: 50%;
  max-width: 90vw;
  position: fixed;
  transform: translateX(-50%);
  z-index: 100;
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  display: none;
}

/* ── Status badge ─────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.3rem 0.9rem;
}
.status-open   { background: #065f4633; color: #34d399; border: 1px solid #065f46; }
.status-closed { background: #7f1d1d33; color: #f87171; border: 1px solid #7f1d1d; }
.status-away   { background: #78350f33; color: #fbbf24; border: 1px solid #78350f; }

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}
.sidebar-link:hover, .sidebar-link.active {
  background: #374151;
  color: #f59e0b;
}

/* ── Auth page ────────────────────────────────────────────── */
.auth-tab {
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #6b7280;
  transition: all 0.15s;
}
.auth-tab.active { background: #f59e0b; color: #111827; }

/* ── Form grid ────────────────────────────────────────────── */
.form-grid {
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .form-grid-2 { grid-template-columns: 1fr 1fr; }
}

/* ── Appointment item ─────────────────────────────────────── */
.appt-item {
  background: #374151;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
