/* ========================================
   一知运康康复系统 - 全局样式
   ======================================== */

:root {
  --primary: #39b54a;
  --primary-dark: #2d9a3e;
  --primary-light: #e8f5e9;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-muted: #999999;
  --bg-body: #f5f5f5;
  --bg-white: #ffffff;
  --border-color: #e0e0e0;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  --shadow-light: 0 1px 4px rgba(0, 0, 0, 0.08);
  --radius: 8px;
  --sidebar-width: 220px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-body);
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ========================================
   Auth Pages (Login / Register)
   ======================================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
}

.auth-card {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 48px 40px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.auth-card h1 {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: normal;
  margin-bottom: 4px;
}

.auth-card h2 {
  font-size: 24px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  height: 42px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--primary);
}

.form-group .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}

.form-group.has-label .icon {
  top: calc(50% + 10px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  height: 42px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  text-decoration: none;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
  text-decoration: none;
}

.btn-sm {
  height: 32px;
  padding: 0 16px;
  font-size: 13px;
}

.btn-danger {
  background: #f44336;
  color: #fff;
}

.btn-danger:hover {
  background: #d32f2f;
}

.btn-block {
  width: 100%;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--primary);
  margin-left: 4px;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.form-row label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

/* ========================================
   Layout (Sidebar + Main)
   ======================================== */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 24px 20px 16px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.sidebar-logo .logo-text {
  font-size: 18px;
  font-weight: 600;
}

.sidebar-date {
  font-size: 12px;
  opacity: 0.7;
  padding-left: 46px;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.2s;
  gap: 10px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.nav-item .nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-footer .nav-item {
  padding: 12px 0;
}

/* Main content area */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  background: var(--bg-body);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-header-left h1 {
  font-size: 18px;
  font-weight: 600;
}

.page-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.doctor-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.doctor-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--primary);
  overflow: hidden;
}

.doctor-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doctor-name {
  font-size: 14px;
  font-weight: 500;
}

.doctor-title {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-icon {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  transition: background 0.2s;
}

.btn-icon:hover {
  background: var(--primary-light);
}

.back-btn {
  font-size: 22px;
  cursor: pointer;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
}

.back-btn:hover {
  color: var(--primary);
  text-decoration: none;
}

/* ========================================
   Page Content
   ======================================== */
.page-body {
  padding: 24px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.search-input {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  width: 240px;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--primary);
}

/* ========================================
   Patient Table
   ======================================== */
.patient-table {
  width: 100%;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-light);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.patient-table thead {
  background: #f8f9fa;
}

.patient-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.patient-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
  white-space: nowrap;
}

.patient-table tbody tr:last-child td {
  border-bottom: none;
}

.patient-table tbody tr:hover {
  background: var(--primary-light);
}

.patient-name-cell {
  font-weight: 500;
  font-size: 14px;
}

.patient-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

/* Report sub-rows */
.report-sub-row td {
  padding: 8px 16px;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
}

.report-sub-row:hover td {
  background: #f0f7f0;
}

.report-name {
  font-size: 13px;
  color: var(--text-primary);
}

.report-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 12px;
}

.report-actions {
  display: flex;
  gap: 6px;
}

.report-count-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ========================================
   Patient Detail Page
   ======================================== */
.detail-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.detail-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-light);
  padding: 24px 28px;
  flex: 0 0 380px;
}

.detail-row {
  display: flex;
  padding: 12px 0;
  font-size: 15px;
  border-bottom: 1px solid #f5f5f5;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: var(--text-muted);
  width: 80px;
  flex-shrink: 0;
}

.detail-value {
  color: var(--text-primary);
}

.text-placeholder {
  color: var(--text-muted);
}

.detail-reports-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-report-item {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-light);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.detail-report-main {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.diagnosis-edit {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
  width: 100%;
}

.diagnosis-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.diagnosis-field label {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.diagnosis-field select {
  width: 100px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  background: var(--bg-white);
}

.diagnosis-field select:focus {
  border-color: var(--primary);
}

.diagnosis-readonly {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
  width: 100%;
}

.diagnosis-tag {
  display: inline-block;
  background: #f5f5f5;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

.detail-report-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.detail-report-date {
  font-size: 14px;
  color: var(--text-muted);
}

/* ========================================
   Modal
   ======================================== */
.modal-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 24px;
  width: 480px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  transition: transform 0.2s;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal h3 {
  font-size: 18px;
  margin-bottom: 20px;
}

.modal .form-group input,
.modal .form-group textarea {
  padding-left: 12px;
}

.modal .form-group textarea {
  width: 100%;
  min-height: 60px;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  resize: vertical;
  font-family: inherit;
}

.modal .form-group textarea:focus {
  border-color: var(--primary);
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.modal-actions .btn {
  width: auto;
  min-width: 80px;
}

/* ========================================
   Report View Page
   ======================================== */
.report-content {
  padding: 24px;
}

.report-images {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.report-image-item {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-light);
  overflow: hidden;
}

.report-image-item img {
  width: 100%;
  max-height: 600px;
  object-fit: contain;
  cursor: pointer;
  display: block;
  background: #f9f9f9;
}

.report-image-info {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f0f0f0;
}

.report-image-info .filename {
  font-size: 13px;
  color: var(--text-secondary);
}

.report-footer {
  text-align: center;
  padding: 24px;
}

/* ========================================
   Lightbox
   ======================================== */
.lightbox {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
}

/* ========================================
   Upload area
   ======================================== */
.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 16px;
}

.upload-area:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-area .upload-icon {
  font-size: 36px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.upload-area .upload-text {
  color: var(--text-secondary);
  font-size: 14px;
}

.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.upload-preview-item {
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.upload-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-preview-item .remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(244, 67, 54, 0.8);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================
   Toast notifications
   ======================================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.3s ease;
  max-width: 360px;
}

.toast.success {
  background: var(--primary);
}

.toast.error {
  background: #f44336;
}

.toast.info {
  background: #2196f3;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ========================================
   Loading spinner
   ======================================== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   Detail Page - Xray List & Diagnosis
   ======================================== */
.xray-list-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.xray-list-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: #fcfcfc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.xray-list-item:hover {
  background: #fff;
  box-shadow: var(--shadow-light);
}

.xray-preview-box {
  width: 120px;
  height: 120px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  background: #eee;
  cursor: pointer;
  flex-shrink: 0;
}

.xray-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.xray-date {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  text-align: center;
}

.xray-info-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.xray-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.diagnosis-edit-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.diag-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.diag-group label {
  font-size: 12px;
  color: var(--text-secondary);
}

.edit-input-sm {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 13px;
  outline: none;
  background: #fff;
}

.diag-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.diag-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 4px;
  font-size: 13px;
  margin-right: 8px;
}

.diagnosis-readonly {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Slide Upload */
.slide-upload-card {
  margin-top: 24px;
}

.slide-list {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.slide-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.slide-icon {
  font-size: 24px;
}

.slide-info {
  flex: 1;
  overflow: hidden;
}

.slide-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slide-actions {
  display: flex;
  gap: 6px;
}


.detail-reports-header {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0 4px 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 4px;
}

/* Editable info card */
.edit-row {
  align-items: flex-start;
  padding: 10px 0;
}

.edit-row .detail-label {
  padding-top: 8px;
}

.edit-input {
  flex: 1;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.edit-input:focus {
  border-color: var(--primary);
}

.edit-textarea {
  height: auto;
  min-height: 60px;
  padding: 8px 10px;
  resize: vertical;
}

.edit-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

/* Modal header/footer */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  line-height: 1;
}

.modal-close:hover { color: var(--text-primary); }

.modal-body { margin-bottom: 20px; }

.modal-body .form-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-body .form-row label {
  flex-shrink: 0;
  width: 80px;
  padding-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

/* ========================================
   X-Ray Section
   ======================================== */
.xray-section {
  margin-top: 0;
}

.xray-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.xray-item {
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #f9f9f9;
  transition: box-shadow 0.2s, transform 0.1s;
}

.xray-item:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.xray-thumb {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.xray-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.xray-overlay {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.2s;
}

.xray-item:hover .xray-overlay { opacity: 1; }

.xray-name {
  padding: 6px 8px 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xray-meta {
  padding: 0 8px 8px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Upload label as button */
.xray-upload-label {
  cursor: pointer;
  user-select: none;
}

/* X-Ray Preview Modal */
.xray-preview-modal {
  background: #1a1a1a;
  border-radius: 12px;
  width: 720px;
  max-width: 96vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.xray-preview-modal .modal-header {
  padding: 16px 20px;
  background: #2a2a2a;
  color: #fff;
  margin-bottom: 0;
  border-radius: 12px 12px 0 0;
}

.xray-preview-modal .modal-close { color: #aaa; }
.xray-preview-modal .modal-close:hover { color: #fff; }

.xray-preview-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.xray-preview-body img {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 6px;
  background: #000;
}

.xray-preview-note { width: 100%; margin-top: 8px; }

/* Patient sidebar user block */
.patient-sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 12px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  margin-bottom: 4px;
}

.patient-avatar {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.patient-name {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
}

/* Detail layout responsive */
@media (max-width: 768px) {
  .detail-layout {
    flex-direction: column;
  }
  .detail-card {
    flex: none;
    width: 100%;
  }
}

