/* ─── Appointment Mode ─────────────────────────────────────── */

#appointment-mode-btn .label {
  display: block;
}

#appointment-mode-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: rgba(15, 23, 42, 0.72);
  z-index: 20000;
}

#appointment-mode-overlay.hidden {
  display: none !important;
}

#appointment-mode-overlay .appointment-mode-shell {
  width: 100%;
  height: 100%;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
}

#appointment-mode-overlay .appointment-mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid #dbe3ee;
  flex-shrink: 0;
}

#appointment-mode-overlay .appointment-mode-kicker {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.35rem;
}

#appointment-mode-overlay .appointment-mode-header h2 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 700;
  color: #0f172a;
}

#exit-appointment-mode-btn {
  border: none;
  border-radius: 10px;
  padding: 0.8rem 1.15rem;
  background: #dc2626;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}

#exit-appointment-mode-btn:hover {
  background: #b91c1c;
}

#appointment-mode-overlay .appointment-mode-body {
  flex: 1;
  min-height: 0;
  padding: 1.5rem;
  overflow: hidden;
}

#appointment-mode-overlay .appointment-mode-layout {
  display: grid;
  grid-template-columns: minmax(320px, 34%) minmax(0, 1fr);
  gap: 1.5rem;
  width: 100%;
  height: 100%;
  min-height: 0;
}

#appointment-mode-overlay .appointment-mode-sidebar {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

#appointment-mode-overlay .appointment-client-details-panel {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #dbe3ee;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

#appointment-mode-overlay .appointment-client-details-header {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-shrink: 0;
}

#appointment-mode-overlay .appointment-client-details-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

#appointment-mode-overlay .appointment-client-details-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.1rem 1.25rem;
}

#appointment-mode-overlay .appointment-detail-section + .appointment-detail-section {
  margin-top: 1.25rem;
}

#appointment-mode-overlay .appointment-detail-section h4 {
  margin: 0 0 0.7rem 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

#appointment-mode-overlay .appointment-profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

#appointment-mode-overlay .appointment-profile-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
}

#appointment-mode-overlay .appointment-profile-item-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 0.22rem;
}

#appointment-mode-overlay .appointment-profile-item-value {
  display: block;
  font-size: 0.96rem;
  color: #0f172a;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

#appointment-mode-overlay .appointment-call-card,
#appointment-mode-overlay .appointment-note-card {
  background: #ffffff;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  padding: 0.9rem;
}

#appointment-mode-overlay .appointment-call-card + .appointment-call-card,
#appointment-mode-overlay .appointment-note-card + .appointment-note-card {
  margin-top: 0.85rem;
}

#appointment-mode-overlay .appointment-card-date {
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 0.45rem;
}

#appointment-mode-overlay .appointment-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.4rem;
}

#appointment-mode-overlay .appointment-card-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
}

#appointment-mode-overlay .appointment-note-documents {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.55rem;
}

#appointment-mode-overlay .appointment-note-document {
  display: block;
  text-decoration: none;
  background: #f8fafc;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  color: #0f172a;
}

#appointment-mode-overlay .appointment-note-document:hover {
  background: #eef4ff;
}

#appointment-mode-overlay .appointment-note-document-name {
  font-size: 0.93rem;
  font-weight: 700;
  color: #0f172a;
  word-break: break-word;
}

#appointment-mode-overlay .appointment-note-document-meta {
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 0.2rem;
}

#appointment-mode-overlay .appointment-empty-state {
  color: #64748b;
  font-size: 0.94rem;
}

#appointment-mode-overlay .appointment-mode-workspace {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

#appointment-mode-overlay .appointment-workspace-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #ffffff;
  border: 1px solid #dbe3ee;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#appointment-mode-overlay .appointment-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-shrink: 0;
}

#appointment-mode-overlay .appointment-workspace-kicker {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.2rem;
}

#appointment-mode-overlay .appointment-workspace-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

#complete-appointment-btn {
  border: none;
  border-radius: 10px;
  padding: 0.8rem 1.15rem;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}

#complete-appointment-btn:hover {
  background: #1d4ed8;
}

#appointment-mode-overlay .appointment-workspace-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.15rem 1.2rem;
}

#appointment-mode-overlay .appointment-workspace-section + .appointment-workspace-section {
  margin-top: 1.3rem;
}

#appointment-mode-overlay .appointment-workspace-section h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

#appointment-mode-overlay .appointment-dropzone {
  border: 2px dashed #93c5fd;
  border-radius: 14px;
  background: #eff6ff;
  padding: 1.2rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

#appointment-mode-overlay .appointment-dropzone:hover,
#appointment-mode-overlay .appointment-dropzone:focus {
  background: #dbeafe;
  border-color: #60a5fa;
  outline: none;
}

#appointment-mode-overlay .appointment-dropzone.drag-active {
  background: #dbeafe;
  border-color: #2563eb;
  transform: scale(1.01);
}

#appointment-mode-overlay .appointment-dropzone-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

#appointment-mode-overlay .appointment-dropzone-subtitle {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  color: #475569;
}

#appointment-mode-overlay .appointment-upload-status,
#appointment-mode-overlay .appointment-mini-note-status {
  margin-top: 0.7rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  background: #ecfeff;
  color: #155e75;
  border: 1px solid #a5f3fc;
}

#appointment-mode-overlay .appointment-upload-status.hidden,
#appointment-mode-overlay .appointment-mini-note-status.hidden {
  display: none;
}

#appointment-mode-overlay .appointment-uploaded-files {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.6rem;
}

#appointment-mode-overlay .appointment-uploaded-file-card {
  background: #f8fafc;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
}

#appointment-mode-overlay .appointment-uploaded-file-name {
  font-size: 0.94rem;
  font-weight: 700;
  color: #0f172a;
  word-break: break-word;
}

#appointment-mode-overlay .appointment-uploaded-file-meta {
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: #64748b;
}

#appointment-mode-overlay .appointment-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1rem;
}

#appointment-mode-overlay .appointment-field-block {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

#appointment-mode-overlay .appointment-field-block-full {
  grid-column: 1 / -1;
}

#appointment-mode-overlay .appointment-field-block label {
  font-size: 0.92rem;
  font-weight: 700;
  color: #334155;
}

#appointment-mode-overlay .appointment-inline-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

#appointment-mode-overlay .appointment-inline-options label {
  font-size: 0.92rem;
  font-weight: 600;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

#appointment-mode-overlay .appointment-field-block input[type="text"],
#appointment-mode-overlay .appointment-field-block select,
#appointment-mode-overlay .appointment-field-block textarea,
#appointment-mini-note-input,
#appointment-conclusion-notes-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.72rem 0.85rem;
  font-size: 0.95rem;
  color: #0f172a;
  box-sizing: border-box;
  background: #fff;
}

#appointment-mode-overlay .appointment-field-block textarea,
#appointment-conclusion-notes-input {
  resize: vertical;
  min-height: 84px;
}

#appointment-mode-overlay .appointment-field-block input[type="text"]:focus,
#appointment-mode-overlay .appointment-field-block select:focus,
#appointment-mode-overlay .appointment-field-block textarea:focus,
#appointment-mini-note-input:focus,
#appointment-conclusion-notes-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

#appointment-mode-overlay .appointment-mini-note-instructions {
  margin-bottom: 0.65rem;
  font-size: 0.9rem;
  color: #64748b;
}

#appointment-mini-note-input {
  margin-bottom: 0.75rem;
}

#appointment-mode-overlay .appointment-mini-notes-list {
  display: grid;
  gap: 0.6rem;
}

#appointment-mode-overlay .appointment-mini-note-card {
  background: #ffffff;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
}

#appointment-mode-overlay .appointment-mini-note-date {
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 0.3rem;
}

#appointment-mode-overlay .appointment-mini-note-text {
  font-size: 0.94rem;
  color: #0f172a;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Conclusion modal */
#appointment-conclusion-modal {
  position: fixed;
  inset: 0;
  z-index: 21000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
}

#appointment-conclusion-modal.hidden {
  display: none !important;
}

#appointment-conclusion-modal .appointment-conclusion-modal-content {
  width: min(720px, calc(100vw - 32px));
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}

#appointment-conclusion-modal .appointment-conclusion-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid #e2e8f0;
}

#appointment-conclusion-modal .appointment-conclusion-modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #0f172a;
}

#close-appointment-conclusion-modal {
  border: none;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #475569;
}

#appointment-conclusion-modal .appointment-conclusion-modal-body {
  padding: 1rem 1.1rem;
}

#appointment-conclusion-modal .appointment-conclusion-modal-body label {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #334155;
}

#appointment-conclusion-modal .appointment-conclusion-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0 1.1rem 1.1rem;
}

#cancel-appointment-conclusion-btn,
#save-appointment-conclusion-btn {
  border: none;
  border-radius: 10px;
  padding: 0.78rem 1rem;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
}

#cancel-appointment-conclusion-btn {
  background: #e2e8f0;
  color: #0f172a;
}

#save-appointment-conclusion-btn {
  background: #2563eb;
  color: #ffffff;
}

#save-appointment-conclusion-btn:hover {
  background: #1d4ed8;
}
