/* ============================================================
 *  VISIT ONLINE — v12
 *  جدید: استایل مودال پرونده کاربر + دکمه history
 * ============================================================ */
:root {
  --vo-primary: #4CAF50;
  --vo-primary-dark: #388E3C;
  --vo-primary-darker: #2E7D32;
  --vo-primary-light: #E8F5E9;
  --vo-radius: 10px;
  --vo-shadow: 0 2px 10px rgba(0,0,0,0.08);
  --vo-shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
}

.vo-wrap *, .vo-vet-app *, .vo-modal * { box-sizing: border-box; }
.vo-sidebar-toggle, #vo-sidebar-toggle, .vo-vet-overlay, #vo-vet-overlay { display: none !important; }

/* FULL-WIDTH */
body.vo-has-vet-panel #main-content,
body.vo-has-vet-panel .wd-content-layout,
body.vo-has-vet-panel .content-layout-wrapper,
body.vo-has-vet-panel .container,
body.vo-has-vet-panel .wd-content-area,
body.vo-has-vet-panel .site-content,
body.vo-has-vet-panel .entry-content,
body.vo-has-vet-panel article.entry-content {
  max-width: 100% !important; width: 100% !important;
  padding-left: 0 !important; padding-right: 0 !important;
  margin-left: 0 !important; margin-right: 0 !important;
  overflow-x: visible !important;
}
body.vo-has-vet-panel .entry-content > .vo-wrap { max-width: 800px !important; margin: 20px auto !important; padding: 20px !important; }
body.vo-has-vet-panel .entry-content > .vo-vet-fullwidth { width: 100% !important; max-width: 100% !important; margin: 20px 0 !important; padding: 0 !important; }
.wrap.vo-admin-fullwidth { margin: 0 !important; padding: 10px !important; max-width: none !important; width: 100%; }

/* BUTTONS */
body .vo-btn, body button.vo-btn, body a.vo-btn, body .vo-btn:visited {
  background-color: #4CAF50 !important; background-image: none !important;
  color: #fff !important; -webkit-text-fill-color: #fff !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15) !important;
  border: none !important; box-shadow: 0 2px 8px rgba(76,175,80,0.35) !important;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 24px; border-radius: 8px; font-family: inherit;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: all .2s; text-decoration: none; line-height: 1.4; min-height: 42px;
}
body .vo-btn:hover { background-color: #388E3C !important; color: #fff !important; box-shadow: 0 4px 12px rgba(76,175,80,0.45) !important; }
body .vo-btn.vo-prev { background-color: #757575 !important; }
body .vo-btn.vo-prev:hover { background-color: #424242 !important; }
body .vo-btn:disabled { background-color: #9E9E9E !important; opacity: 0.7 !important; cursor: not-allowed; }
body .vo-btn-ghost, body a.vo-btn-ghost { background-color: rgba(0,0,0,0.2) !important; color: #fff !important; border: 1px solid rgba(255,255,255,0.35) !important; box-shadow: none !important; font-weight: 600; }
body .vo-btn-ghost:hover { background-color: rgba(0,0,0,0.35) !important; border-color: #fff !important; }
body .vo-search-btn { background-color: #4CAF50 !important; color: #fff !important; border: none !important; font-weight: 700; }
body .vo-search-btn:hover { background-color: #388E3C !important; }

/* SIDEBAR */
body .vo-vet-sidebar { background: #388E3C !important; background-image: linear-gradient(180deg, #2E7D32 0%, #388E3C 100%) !important; color: #fff !important; display: flex; flex-direction: column; padding: 20px 0; }
body .vo-vet-brand-title, body .vo-vet-brand-sub { color: #fff !important; -webkit-text-fill-color: #fff !important; }
body .vo-vet-nav { display: flex; flex-direction: column; gap: 6px; padding: 10px; flex: 1; }
body .vo-vet-nav .vo-nav-item {
  background-color: rgba(255,255,255,0.12) !important; color: #fff !important; -webkit-text-fill-color: #fff !important;
  border: 1px solid rgba(255,255,255,0.08) !important; text-shadow: 0 1px 1px rgba(0,0,0,0.15);
  display: flex; align-items: center; justify-content: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 9px; font-family: inherit; font-size: 13.5px;
  font-weight: 600; text-align: right; cursor: pointer; transition: all .2s;
  width: 100%; min-height: 44px; white-space: nowrap; overflow: hidden;
}
body .vo-vet-nav .vo-nav-item span:not(.vo-nav-badge) { flex: 1; min-width: 0; text-overflow: ellipsis; overflow: hidden; }
body .vo-vet-sidebar .vo-nav-item:hover { background-color: rgba(255,255,255,0.22) !important; color: #fff !important; }
body .vo-vet-sidebar .vo-nav-item.active { background-color: rgba(255,255,255,0.3) !important; color: #fff !important; box-shadow: inset 3px 0 0 #fff !important; }
body .vo-vet-sidebar .vo-nav-item svg { flex-shrink: 0; stroke: currentColor !important; color: #fff !important; }
body .vo-nav-badge { background-color: #FF5252 !important; color: #fff !important; margin-right: auto; font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: bold; flex-shrink: 0; }
body .vo-nav-badge:empty { display: none; }
body .vo-vet-sidebar-footer { padding: 10px; border-top: 1px solid rgba(255,255,255,0.2); margin-top: auto; }

/* ACTION BUTTONS */
body .vo-action-btn, body button.vo-action-btn, body a.vo-action-btn,
body .vo-action-btn:hover, body .vo-action-btn:focus, body .vo-action-btn:active, body .vo-action-btn:visited, body .vo-action-btn * {
  color: #fff !important; -webkit-text-fill-color: #fff !important;
  text-decoration: none !important; text-shadow: 0 1px 1px rgba(0,0,0,0.15) !important;
}
body .vo-action-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 6px 12px; font-size: 12px; font-weight: 700; border-radius: 6px;
  cursor: pointer; border: none; font-family: inherit; background-color: #4CAF50;
  transition: all .2s; margin: 2px; white-space: nowrap; line-height: 1.4;
}
body .vo-action-btn:hover { background-color: #388E3C; }
body .vo-action-btn.secondary { background-color: #546E7A; }
body .vo-action-btn.secondary:hover { background-color: #37474F; }
body .vo-action-btn.info { background-color: #00897B; }
body .vo-action-btn.info:hover { background-color: #00695C; }
body .vo-action-btn.danger { background-color: #E53935; }
body .vo-action-btn.danger:hover { background-color: #C62828; }
/* 🔥 دکمه پرونده — بنفش */
body .vo-action-btn.history { background-color: #7B1FA2; }
body .vo-action-btn.history:hover { background-color: #4A148C; }
body .vo-action-btn svg { flex-shrink: 0; stroke: currentColor; }

/* BASE */
.vo-wrap { direction: rtl; text-align: right; max-width: 800px; margin: 20px auto; padding: 20px; background: #fff; border-radius: var(--vo-radius); box-shadow: var(--vo-shadow); }
.vo-wrap h3 { margin-top: 0; color: var(--vo-primary-dark); }
.vo-steps { display: flex; gap: 6px; margin-bottom: 25px; flex-wrap: wrap; }
.vo-step { flex: 1; min-width: 80px; padding: 10px 6px; text-align: center; background: #f0f0f0; border-radius: var(--vo-radius); color: #666; font-size: 13px; transition: all .2s; }
.vo-step.active { background: var(--vo-primary); color: #fff; font-weight: bold; }
.vo-panel { display: none; }
.vo-panel.active { display: block; }

.vo-field { margin-bottom: 16px; }
.vo-field label { display: block; margin-bottom: 6px; font-weight: 600; color: #333; }
.vo-field label span { color: #e53935; }
.vo-field input[type=text], .vo-field input[type=tel], .vo-field input[type=date],
.vo-field input[type=file], .vo-field select, .vo-field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px;
  font-family: inherit; font-size: 14px; background-color: #fff; color: #333; transition: border .2s;
}
.vo-field input:focus, .vo-field select:focus, .vo-field textarea:focus { outline: none; border-color: var(--vo-primary); box-shadow: 0 0 0 3px rgba(76,175,80,0.1); }
.vo-hint { display: block; margin-top: 6px; color: #888; font-size: 12px; font-weight: 600; transition: color .2s; }
.vo-hint[style*="#e53935"] { color: #e53935 !important; }
.vo-hint[style*="#388E3C"] { color: #388E3C !important; }
.vo-field select option:disabled { color: #bbb; background: #f5f5f5; text-decoration: line-through; }

.vo-nav { display: flex; justify-content: space-between; margin-top: 20px; gap: 10px; }
.vo-alert { padding: 14px 18px; border-radius: var(--vo-radius); margin-bottom: 16px; border-right: 4px solid; }
.vo-alert-info { background: #E3F2FD; border-color: #2196F3; color: #0D47A1; }
.vo-alert-success { background: #E8F5E9; border-color: #4CAF50; color: #1B5E20; }
.vo-alert-error { background: #FFEBEE; border-color: #F44336; color: #B71C1C; }
.vo-code { font-size: 22px; letter-spacing: 2px; color: var(--vo-primary-dark); }
.vo-step-msg { background: #FFF8E1; padding: 10px 14px; border-right: 3px solid #FFC107; border-radius: 6px; margin-bottom: 16px; color: #795548; }
.vo-summary { background: #FAFAFA; padding: 16px; border-radius: var(--vo-radius); margin-bottom: 16px; line-height: 1.9; }
.vo-summary div { display: flex; justify-content: space-between; border-bottom: 1px dashed #eee; padding: 4px 0; }
.vo-price { background: var(--vo-primary-light); padding: 14px; border-radius: var(--vo-radius); font-size: 16px; text-align: center; margin-bottom: 16px; }
.vo-price strong { color: var(--vo-primary-dark); font-size: 18px; }

/* TABLE */
.vo-table-wrap { width: 100%; max-width: 100%; overflow-x: visible; border-radius: var(--vo-radius); box-shadow: var(--vo-shadow); }
.vo-table { width: 100%; min-width: 100%; border-collapse: collapse; background: #fff; table-layout: auto; }
.vo-table th { background: var(--vo-primary); color: #fff !important; padding: 12px 10px; font-size: 13px; text-align: right; font-weight: 600; white-space: nowrap; }
.vo-table td { padding: 12px 10px; border-bottom: 1px solid #f0f0f0; font-size: 13px; text-align: right; vertical-align: middle; }
.vo-table tbody tr:hover td { background: #FAFAFA; }
.vo-table tbody tr.vo-row-completed td { background: #E8F5E9; }
.vo-table tbody tr.vo-row-completed:hover td { background: #C8E6C9; }
.vo-table tbody tr.vo-row-completed td:first-child strong { color: var(--vo-primary-dark); }
.vo-table th:last-child, .vo-table td:last-child { min-width: 220px; width: auto; white-space: nowrap; }

.vo-status { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.vo-status-pending, .vo-status-awaiting_payment { background: #FFF3E0; color: #E65100; }
.vo-status-confirmed { background: #E3F2FD; color: #0D47A1; }
.vo-status-completed { background: #4CAF50; color: #fff; }
.vo-status-cancelled { background: #FFEBEE; color: #B71C1C; }

/* کاربران: شمارنده‌ها */
.vo-user-count { display: inline-block; min-width: 28px; padding: 3px 8px; border-radius: 12px; font-size: 12px; font-weight: 700; text-align: center; background: #ECEFF1; color: #455A64; }
.vo-user-count-green { background: #E8F5E9; color: #1B5E20; }
.vo-user-count-orange { background: #FFF3E0; color: #E65100; }
.vo-user-count-blue { background: #E3F2FD; color: #0D47A1; }
.vo-user-count-red { background: #FFEBEE; color: #B71C1C; }

/* VET LAYOUT */
.vo-vet-app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 700px; background: #F5F7FA; box-shadow: var(--vo-shadow-lg); max-width: 100%; margin: 0; }
.vo-vet-brand { display: flex; align-items: center; gap: 12px; padding: 0 20px 20px; margin-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.2); }
.vo-vet-logo { width: 42px; height: 42px; background: rgba(255,255,255,0.22); border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vo-vet-brand-title { font-size: 15px; font-weight: 700; }
.vo-vet-brand-sub { font-size: 11px; opacity: 0.85; margin-top: 2px; }
.vo-vet-main { padding: 0; min-width: 0; display: flex; flex-direction: column; }
.vo-vet-header { display: flex; align-items: center; gap: 12px; padding: 18px 24px; background: #fff; border-bottom: 1px solid #eaeef2; flex-wrap: wrap; }
.vo-page-title { margin: 0; font-size: 18px; color: #2c3e50; font-weight: 700; flex: 1; min-width: 120px; }
.vo-header-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.vo-btn-export { display: inline-flex; align-items: center; gap: 5px; padding: 8px 14px; border-radius: 8px; border: none; font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .2s; color: #fff !important; -webkit-text-fill-color: #fff !important; text-shadow: 0 1px 1px rgba(0,0,0,0.15); }
.vo-btn-excel { background-color: #1D6F42 !important; }
.vo-btn-excel:hover { background-color: #155531 !important; }
.vo-btn-pdf { background-color: #C62828 !important; }
.vo-btn-pdf:hover { background-color: #8E0000 !important; }

.vo-vet-body { padding: 20px 24px; flex: 1; min-width: 0; }
.vo-search-top { display: flex; gap: 10px; margin-bottom: 18px; padding: 12px; background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.vo-search-input-wrap { flex: 1; position: relative; min-width: 0; }
.vo-search-input-wrap input { width: 100%; padding: 10px 14px; padding-left: 34px; border: 1px solid #e0e0e0; border-radius: 8px; font-family: inherit; font-size: 13px; background: #FAFAFA; color: #333; }
.vo-search-input-wrap input:focus { outline: none; border-color: var(--vo-primary); background: #fff; }
.vo-search-clear { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); background: #ddd; color: #555; border: none; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.vo-search-clear:hover { background: #ccc; }
.vo-search-btn { padding: 10px 20px; border: none; border-radius: 8px; font-family: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; flex-shrink: 0; }
.vo-tabs-container { min-width: 0; }
.vo-vet-content { display: none; min-width: 0; }
.vo-vet-content.active { display: block; }
.vo-search-results { margin-top: 18px; min-width: 0; }

.vo-loading { text-align: center; padding: 40px 20px; color: #999; font-size: 14px; }
.vo-loading::after { content: ''; display: inline-block; width: 14px; height: 14px; border: 2px solid #ccc; border-top-color: var(--vo-primary); border-radius: 50%; animation: vo-spin 0.8s linear infinite; margin-right: 8px; vertical-align: middle; }
@keyframes vo-spin { to { transform: rotate(360deg); } }
.vo-empty { text-align: center; padding: 50px 20px; color: #999; font-size: 14px; background: #fff; border-radius: 10px; }
.vo-empty::before { content: '📭'; display: block; font-size: 44px; margin-bottom: 12px; }

/* FILES GRID */
.vo-files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; padding: 6px; }
.vo-file-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 12px; padding: 12px; text-align: center; transition: all .2s; display: flex; flex-direction: column; }
.vo-file-card:hover { border-color: var(--vo-primary); box-shadow: 0 6px 20px rgba(76,175,80,0.2); transform: translateY(-2px); }
.vo-file-preview { width: 100%; height: 130px; background: #f0f0f0; border-radius: 8px; overflow: hidden; margin-bottom: 10px; display: flex; align-items: center; justify-content: center; cursor: zoom-in; position: relative; }
.vo-file-preview::after { content: '🔍'; position: absolute; bottom: 6px; left: 6px; font-size: 14px; background: rgba(0,0,0,0.5); color: #fff; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; }
.vo-file-preview:hover::after { opacity: 1; }
.vo-file-preview img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .3s; }
.vo-file-preview:hover img { transform: scale(1.05); }
.vo-file-icon { font-size: 44px; margin: 12px 0 10px; line-height: 1; }
.vo-file-name { font-size: 12px; color: #555; margin-bottom: 12px; word-break: break-all; min-height: 32px; line-height: 1.4; }
.vo-file-actions { display: flex; gap: 6px; justify-content: center; margin-top: auto; }
.vo-file-actions .vo-action-btn { flex: 1; }

/* ============================================================
 *  🔥 HISTORY MODAL (پرونده)
 * ============================================================ */
.vo-history-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.vo-history-stat {
  background: #F5F7FA;
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
  border: 1px solid #e0e0e0;
}
.vo-history-stat span { display: block; font-size: 11px; color: #666; margin-bottom: 4px; font-weight: 600; }
.vo-history-stat strong { display: block; font-size: 22px; color: #2c3e50; font-weight: 800; }
.vo-history-stat-green strong { color: #1B5E20; }
.vo-history-stat-blue strong { color: #0D47A1; }
.vo-history-stat-orange strong { color: #E65100; }
.vo-history-stat-purple strong { color: #6A1B9A; }

.vo-history-list { display: flex; flex-direction: column; gap: 12px; }
.vo-history-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  transition: all .2s;
}
.vo-history-card:hover {
  border-color: var(--vo-primary);
  box-shadow: 0 4px 12px rgba(76,175,80,0.15);
}
.vo-history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #F5F7FA;
  border-bottom: 1px solid #eaeef2;
  flex-wrap: wrap;
  gap: 8px;
}
.vo-history-code {
  font-weight: 700;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.vo-history-date {
  font-size: 12px;
  color: #666;
  direction: rtl;
  font-weight: 600;
}
.vo-history-card-body { padding: 14px 16px; }
.vo-history-pet {
  font-size: 13px;
  color: #555;
  margin-bottom: 10px;
  padding: 4px 10px;
  background: #E8F5E9;
  border-radius: 6px;
  display: inline-block;
  font-weight: 600;
}
.vo-history-prescription {
  background: #FAFAFA;
  border-right: 3px solid #4CAF50;
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 8px;
}
.vo-history-presc-title {
  font-size: 13px;
  font-weight: 700;
  color: #388E3C;
  margin-bottom: 8px;
}
.vo-history-presc-text {
  font-size: 13px;
  color: #333;
  line-height: 1.8;
  background: #fff;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  border: 1px solid #e0e0e0;
  white-space: pre-wrap;
  word-break: break-word;
}
.vo-history-presc-file {
  display: inline-block;
  padding: 6px 14px;
  background: #4CAF50;
  color: #fff !important;
  border-radius: 6px;
  text-decoration: none !important;
  font-size: 12px;
  font-weight: 700;
  transition: background .2s;
  text-shadow: 0 1px 1px rgba(0,0,0,0.15);
}
.vo-history-presc-file:hover { background: #388E3C; color: #fff !important; }
.vo-history-no-presc {
  font-size: 12px;
  color: #999;
  font-style: italic;
  padding: 8px 0;
  text-align: center;
}

/* LIGHTBOX */
.vo-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 999999; display: flex; align-items: center; justify-content: center; padding: 50px; cursor: zoom-out; animation: vo-fade-in 0.15s; }
@keyframes vo-fade-in { from { opacity: 0; } to { opacity: 1; } }
.vo-lightbox img { max-width: 100%; max-height: 100%; box-shadow: 0 10px 60px rgba(0,0,0,0.6); border-radius: 4px; animation: vo-zoom-in 0.2s; cursor: default; }
@keyframes vo-zoom-in { from { transform: scale(0.85); } to { transform: scale(1); } }
.vo-lightbox-close { position: absolute; top: 18px; right: 18px; color: #fff; font-size: 34px; cursor: pointer; line-height: 1; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,0.15); transition: background 0.2s; font-family: Arial, sans-serif; z-index: 1; }
.vo-lightbox-close:hover { background: rgba(255,255,255,0.3); }

/* MODAL */
.vo-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 10px; backdrop-filter: blur(2px); }
.vo-modal-content { background: #fff; border-radius: 14px; max-width: 700px; width: 100%; max-height: 92vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.vo-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: var(--vo-primary); color: #fff !important; border-radius: 14px 14px 0 0; font-weight: 600; font-size: 15px; position: sticky; top: 0; z-index: 1; }
.vo-modal-header span { color: #fff !important; -webkit-text-fill-color: #fff !important; }
.vo-modal-body { padding: 20px; }

body .vo-close-modal {
  background: #E53935 !important; background-color: #E53935 !important; background-image: none !important;
  border: none !important; color: #ffffff !important; -webkit-text-fill-color: #ffffff !important;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; padding: 0; box-shadow: 0 2px 8px rgba(229,57,53,0.4);
}
body .vo-close-modal svg { stroke: #ffffff !important; color: #ffffff !important; width: 18px; height: 18px; display: block; }
body .vo-close-modal svg line { stroke: #ffffff !important; }
body .vo-close-modal:hover { background: #C62828 !important; background-color: #C62828 !important; transform: scale(1.08); box-shadow: 0 4px 12px rgba(229,57,53,0.55); }
body .vo-close-modal:hover svg, body .vo-close-modal:hover svg line { stroke: #ffffff !important; }
body .vo-close-modal:active { transform: scale(0.95); }

body .vo-chat-header .vo-close-modal {
  background: rgba(255,255,255,0.15) !important; background-color: rgba(255,255,255,0.15) !important;
  box-shadow: none; border: 1px solid rgba(255,255,255,0.3) !important;
}
body .vo-chat-header .vo-close-modal:hover {
  background: #E53935 !important; background-color: #E53935 !important;
  border-color: #E53935 !important; transform: scale(1.08);
}

/* CHAT */
.vo-chat-box { max-width: 540px; display: flex; flex-direction: column; height: 82vh; padding: 0; overflow: hidden; border-radius: 16px; }
.vo-chat-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: linear-gradient(135deg, #2E7D32, #388E3C); color: #fff; flex-shrink: 0; gap: 12px; }
.vo-chat-user { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.vo-chat-avatar { width: 48px; height: 48px; border-radius: 50%; background: #1B5E20; border: 2px solid rgba(255,255,255,0.7); display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 2px 10px rgba(0,0,0,0.35); }
.vo-chat-avatar svg { stroke: #ffffff !important; color: #ffffff !important; stroke-width: 2.5; }
.vo-chat-user-info { line-height: 1.35; min-width: 0; flex: 1; }
.vo-chat-name { font-weight: 700; font-size: 14px; color: #fff !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vo-chat-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; font-size: 11px; }
.vo-chat-meta span { background: rgba(0,0,0,0.3); color: rgba(255,255,255,0.95); padding: 2px 8px; border-radius: 10px; white-space: nowrap; font-weight: 500; }
.vo-chat-meta span:empty { display: none; }
.vo-chat-status { font-size: 11px; opacity: 0.9; display: flex; align-items: center; gap: 5px; color: #fff; margin-top: 4px; }
.vo-chat-online-dot { width: 7px; height: 7px; background: #4ADE80; border-radius: 50%; box-shadow: 0 0 8px #4ADE80; animation: vo-pulse 2s infinite; }
@keyframes vo-pulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }

.vo-chat-messages {
  flex: 1; padding: 20px 16px; overflow-y: auto; background: #F0F2F5;
  background-image: radial-gradient(circle at 20% 50%, rgba(76,175,80,0.04) 0%, transparent 50%), radial-gradient(circle at 80% 80%, rgba(76,175,80,0.04) 0%, transparent 50%);
  display: flex; flex-direction: column; gap: 6px; scroll-behavior: smooth;
}
.vo-msg-row { display: flex; animation: vo-msg-in 0.25s ease-out; }
.vo-msg-row.me { justify-content: flex-start; }
.vo-msg-row.other { justify-content: flex-end; }
@keyframes vo-msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.vo-msg { max-width: 78%; padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.55; word-wrap: break-word; position: relative; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.vo-msg.me { background: linear-gradient(135deg, #4CAF50, #388E3C); color: #fff !important; border-bottom-right-radius: 6px; }
.vo-msg.other { background: #fff; color: #333; border-bottom-left-radius: 6px; }
.vo-msg-content img { max-width: 100%; border-radius: 10px; display: block; margin: 2px 0; cursor: zoom-in; }
.vo-msg-content audio { max-width: 100%; height: 40px; display: block; margin: 2px 0; }
.vo-msg-time { font-size: 10px; opacity: 0.7; margin-top: 4px; text-align: left; direction: ltr; }
.vo-msg.me .vo-msg-time { text-align: right; }

.vo-typing-indicator {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; background: #F0F2F5;
  border-top: 1px solid rgba(0,0,0,0.04);
  min-height: 34px; height: 34px;
  visibility: hidden; opacity: 0;
  transition: opacity 0.2s, visibility 0.2s;
  flex-shrink: 0;
}
.vo-typing-indicator.visible { visibility: visible; opacity: 1; }
.vo-typing-dots { display: flex; gap: 3px; align-items: center; }
.vo-typing-dots span { width: 7px; height: 7px; border-radius: 50%; background: #4CAF50; display: block; animation: vo-typing-bounce 1.4s infinite ease-in-out; }
.vo-typing-dots span:nth-child(1) { animation-delay: 0s; }
.vo-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.vo-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes vo-typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-6px); opacity: 1; } }
.vo-typing-text { font-size: 12px; font-weight: 600; color: #4CAF50; }

.vo-chat-input-area { border-top: 1px solid #e0e0e0; background: #fff; padding: 10px 12px; flex-shrink: 0; }
.vo-chat-tools { display: flex; gap: 8px; margin-bottom: 8px; }

body .vo-chat-tool, body button.vo-chat-tool {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid #4CAF50 !important;
  background: #E8F5E9 !important; background-color: #E8F5E9 !important; background-image: none !important;
  color: #2E7D32 !important; -webkit-text-fill-color: #2E7D32 !important;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .2s; padding: 0; box-shadow: 0 1px 3px rgba(76,175,80,0.2);
}
body .vo-chat-tool svg, body button.vo-chat-tool svg {
  width: 20px !important; height: 20px !important;
  stroke: #2E7D32 !important; color: #2E7D32 !important;
  stroke-width: 2.2 !important; flex-shrink: 0; display: block;
}
body .vo-chat-tool svg *, body button.vo-chat-tool svg * { stroke: #2E7D32 !important; fill: none !important; }
body .vo-chat-tool svg circle, body button.vo-chat-tool svg circle { fill: #2E7D32 !important; stroke: #2E7D32 !important; }
body .vo-chat-tool:hover, body button.vo-chat-tool:hover {
  background: #4CAF50 !important; background-color: #4CAF50 !important;
  border-color: #388E3C !important; transform: scale(1.08);
  box-shadow: 0 3px 10px rgba(76,175,80,0.4);
}
body .vo-chat-tool:hover svg, body button.vo-chat-tool:hover svg { stroke: #ffffff !important; color: #ffffff !important; }
body .vo-chat-tool:hover svg *, body button.vo-chat-tool:hover svg * { stroke: #ffffff !important; }
body .vo-chat-tool:hover svg circle, body button.vo-chat-tool:hover svg circle { fill: #ffffff !important; stroke: #ffffff !important; }
body .vo-chat-tool:active, body button.vo-chat-tool:active { transform: scale(0.95); }
body .vo-chat-tool.recording, body button.vo-chat-tool.recording {
  background: #F44336 !important; background-color: #F44336 !important;
  border-color: #C62828 !important;
  color: #fff !important; -webkit-text-fill-color: #fff !important;
  animation: vo-rec-pulse 1s infinite;
}
body .vo-chat-tool.recording svg, body .vo-chat-tool.recording svg *, body button.vo-chat-tool.recording svg { stroke: #ffffff !important; color: #ffffff !important; }
body .vo-chat-tool.recording svg circle, body button.vo-chat-tool.recording svg circle { fill: #ffffff !important; stroke: #ffffff !important; }
@keyframes vo-rec-pulse { 0%,100%{box-shadow:0 0 0 0 rgba(244,67,54,0.7);} 50%{box-shadow:0 0 0 8px rgba(244,67,54,0);} }

.vo-chat-text-wrap { display: flex; gap: 8px; align-items: center; background: #F5F7FA; border-radius: 22px; padding: 4px 4px 4px 12px; border: 1px solid #e0e0e0; transition: border-color .2s; }
.vo-chat-text-wrap:focus-within { border-color: var(--vo-primary); }
.vo-chat-text-wrap input[type=text] { flex: 1; padding: 8px 6px; border: none; outline: none; background: transparent; font-family: inherit; font-size: 14px; color: #333; }
body .vo-chat-send { width: 36px; height: 36px; border-radius: 50%; background-color: #4CAF50 !important; color: #fff !important; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .2s; flex-shrink: 0; padding: 0; }
body .vo-chat-send:hover { background-color: #388E3C !important; transform: scale(1.05); }
.vo-chat-send svg { stroke: currentColor; }

.vo-file-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: #F5F5F5; border-radius: 6px; margin-top: 6px; font-size: 13px; }
.vo-tracking-form { margin-bottom: 20px; }

/* RESPONSIVE */
@media (max-width: 900px) {
  body.vo-has-vet-panel .entry-content > .vo-wrap { padding: 16px !important; }
  .vo-vet-app { grid-template-columns: 1fr; }
  body .vo-vet-sidebar { position: relative; padding: 8px !important; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; border-radius: 0; gap: 4px; }
  .vo-vet-brand { display: none; }
  body .vo-vet-nav { flex-direction: row !important; padding: 0 !important; gap: 4px; flex: 1; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  body .vo-vet-nav::-webkit-scrollbar { height: 4px; }
  body .vo-vet-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.4); border-radius: 2px; }
  body .vo-vet-sidebar .vo-nav-item { flex: 1 1 0 !important; min-width: 0 !important; padding: 8px 6px !important; font-size: 11.5px !important; border-radius: 6px; margin-bottom: 0 !important; background-color: rgba(255,255,255,0.15) !important; justify-content: center !important; text-align: center !important; min-height: 38px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; gap: 4px; }
  body .vo-vet-sidebar .vo-nav-item span:not(.vo-nav-badge) { flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  body .vo-vet-sidebar .vo-nav-item svg { display: none; }
  body .vo-nav-badge { margin-right: 0 !important; margin-left: 0 !important; flex-shrink: 0; font-size: 10px; padding: 1px 6px; }
  body .vo-vet-sidebar-footer { padding: 0 !important; border: none !important; margin-right: 0; display: flex; flex-direction: row; gap: 4px; flex-shrink: 0; }
  body .vo-vet-sidebar-footer .vo-btn-ghost { padding: 8px 10px !important; font-size: 11px !important; white-space: nowrap; }
  body .vo-vet-sidebar-footer .vo-btn-ghost svg { display: none; }
  .vo-vet-header { padding: 12px 16px; }
  .vo-vet-body { padding: 12px; }
  .vo-page-title { font-size: 15px; }
  .vo-header-tools { width: 100%; justify-content: flex-start; order: 3; }
  .vo-btn-export { flex: 1; justify-content: center; }
  .vo-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .vo-table-wrap::-webkit-scrollbar { height: 6px; }
  .vo-table-wrap::-webkit-scrollbar-thumb { background: #bbb; border-radius: 3px; }
  .vo-table { min-width: 750px; }
}

@media (max-width: 600px) {
  body.vo-has-vet-panel .entry-content > .vo-wrap { padding: 12px !important; margin: 12px auto !important; }
  .vo-steps .vo-step { font-size: 11px; padding: 8px 3px; }
  .vo-table th, .vo-table td { padding: 10px 8px; font-size: 12px; }
  .vo-table th:last-child, .vo-table td:last-child { min-width: 200px; }
  body .vo-action-btn { padding: 5px 10px; font-size: 11px; }
  .vo-chat-box { height: 92vh; max-height: 92vh; border-radius: 12px; }
  .vo-modal { padding: 0; }
  .vo-modal-content { width: 100%; height: 100%; max-height: 100vh; border-radius: 0; }
  .vo-modal-header { border-radius: 0; }
  .vo-chat-avatar { width: 42px; height: 42px; }
  .vo-chat-meta span { font-size: 10px; padding: 1px 6px; }
  body .vo-chat-tool, body button.vo-chat-tool { width: 36px; height: 36px; }
  body .vo-chat-tool svg, body button.vo-chat-tool svg { width: 18px !important; height: 18px !important; }
  .vo-search-top { flex-direction: column; }
  .vo-search-btn { width: 100%; justify-content: center; }
  .vo-files-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .vo-file-preview { height: 90px; }
  .vo-file-icon { font-size: 32px; margin: 6px 0; }
  .vo-msg { max-width: 85%; }
  .vo-summary div { flex-direction: column; gap: 2px; }
  .vo-summary div span:first-child { font-weight: 600; color: #666; }
  .vo-lightbox { padding: 10px; }
  .vo-lightbox-close { top: 10px; right: 10px; width: 40px; height: 40px; font-size: 28px; }
  .vo-history-summary { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
 *  🔥 END VISIT — دکمه پایان ویزیت + بنر پایان
 * ============================================================ */

/* گروه اکشن‌های هدر چت */
.vo-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* دکمه پایان ویزیت — قرمز */
body .vo-chat-end-btn,
body button.vo-chat-end-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: #E53935 !important;
  background-color: #E53935 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  border: none !important;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 2px 6px rgba(229,57,53,0.45);
  text-shadow: 0 1px 1px rgba(0,0,0,0.15);
  white-space: nowrap;
}

body .vo-chat-end-btn svg {
  stroke: #fff !important;
  color: #fff !important;
  flex-shrink: 0;
}

body .vo-chat-end-btn:hover {
  background: #C62828 !important;
  background-color: #C62828 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(229,57,53,0.55);
}

body .vo-chat-end-btn:active {
  transform: translateY(0);
}

body .vo-chat-end-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* بنر «ویزیت پایان یافته» بالای پیام‌ها */
.vo-chat-ended-banner {
  background: #E8F5E9;
  color: #1B5E20;
  padding: 11px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
  margin: 0 0 12px;
  border: 1px solid #4CAF50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(76,175,80,0.15);
}

.vo-chat-ended-banner svg {
  stroke: #1B5E20;
  color: #1B5E20;
  flex-shrink: 0;
}

/* حالت ended — input area مخفی می‌شود */
#vo-chat-input-area[style*="display: none"],
.vo-chat-box.vo-ended .vo-chat-input-area {
  display: none !important;
}

/* وضعیت ended در هدر */
#vo-chat-status.vo-status-ended {
  color: #FFCDD2;
}

/* واکنش‌گرا: دکمه پایان در موبایل */
@media (max-width: 600px) {
  body .vo-chat-end-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
  body .vo-chat-end-btn span {
    display: none; /* فقط آیکون در موبایل */
  }
  body .vo-chat-end-btn svg {
    width: 18px;
    height: 18px;
  }
  .vo-chat-ended-banner {
    font-size: 12px;
    padding: 9px 12px;
  }
}

/* ============================================================
 *  🔥 v15 — Login Form + Logout + Refresh
 * ============================================================ */

/* فرم ورود */
.vo-vet-login {
  max-width: 440px;
  margin: 40px auto;
  padding: 32px 28px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.12);
  border: 1px solid #eaeef2;
}
.vo-login-header { text-align: center; margin-bottom: 24px; }
.vo-login-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #4CAF50, #388E3C);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: #fff;
  box-shadow: 0 6px 20px rgba(76,175,80,0.4);
}
.vo-login-icon svg { stroke: #fff !important; }
.vo-login-header h2 { margin: 0 0 8px; color: #2c3e50; font-size: 20px; font-weight: 700; }
.vo-login-header p { margin: 0; color: #888; font-size: 13px; line-height: 1.6; }

.vo-login-form .vo-field { margin-bottom: 14px; }
.vo-login-form label { display: block; margin-bottom: 6px; font-weight: 600; color: #555; font-size: 13px; }
.vo-login-form input[type=text],
.vo-login-form input[type=password] {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  color: #333;
  transition: border .2s, box-shadow .2s;
}
.vo-login-form input:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 0 3px rgba(76,175,80,0.15);
}
.vo-login-submit {
  width: 100% !important;
  margin-top: 10px;
  padding: 13px !important;
  font-size: 15px !important;
}
.vo-btn-block {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  padding: 13px !important;
}

/* دکمه خروج در سایدبار */
body .vo-btn-logout {
  background-color: rgba(229,57,53,0.9) !important;
  border-color: rgba(255,255,255,0.3) !important;
  color: #fff !important;
}
body .vo-btn-logout:hover {
  background-color: #C62828 !important;
  border-color: #fff !important;
}

/* دکمه بروزرسانی در هدر */
body .vo-btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  background: #4CAF50 !important;
  background-color: #4CAF50 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  border: none !important;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  text-shadow: 0 1px 1px rgba(0,0,0,0.15);
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(76,175,80,0.35);
}
body .vo-btn-refresh:hover { background: #388E3C !important; background-color: #388E3C !important; }
body .vo-btn-refresh:disabled { opacity: 0.6; cursor: not-allowed; }
body .vo-btn-refresh svg { stroke: #fff !important; color: #fff !important; flex-shrink: 0; }

/* دکمه‌های tracking */
.vo-tracking-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
body #vo-track-clear {
  background: #E53935 !important;
  background-color: #E53935 !important;
  color: #fff !important;
}
body #vo-track-clear:hover {
  background: #C62828 !important;
  background-color: #C62828 !important;
}

/* موبایل */
@media (max-width: 600px) {
  .vo-vet-login { padding: 24px 18px; margin: 20px auto; }
  .vo-login-icon { width: 60px; height: 60px; }
  .vo-login-icon svg { width: 32px; height: 32px; }
  body .vo-btn-refresh { padding: 7px 10px; font-size: 11px; }
  body .vo-btn-refresh span { display: none; }
  body .vo-btn-refresh svg { width: 16px; height: 16px; }
  body .vo-vet-sidebar-footer .vo-btn-logout svg { display: none; }
  .vo-tracking-actions { flex-direction: column; }
  .vo-tracking-actions .vo-btn { width: 100%; }
}