/* ماژول طب کار — تم teb-design-system */
.oh-page {
  font-family: var(--teb-font);
  background: var(--teb-bg-gradient);
  color: var(--teb-text);
  min-height: 100vh;
}

.oh-topbar {
  background: var(--teb-surface-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--teb-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.oh-brand {
  font-weight: 800;
  color: var(--teb-primary-dark);
  text-decoration: none;
  font-size: var(--teb-font-size-lg);
}

.oh-hero {
  background: linear-gradient(135deg, #0c4a6e 0%, #0f766e 45%, #134e4a 100%);
  color: var(--teb-text-inverse);
  padding: var(--teb-space-10) 0 var(--teb-space-12);
  position: relative;
  overflow: hidden;
}

.oh-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 40%);
  pointer-events: none;
}

.oh-hero > .container { position: relative; z-index: 1; }

.oh-hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: var(--teb-radius-pill);
  padding: 0.35rem 0.9rem;
  font-size: var(--teb-font-size-sm);
  margin-bottom: var(--teb-space-3);
}

.oh-hero-title {
  font-weight: 900;
  font-size: clamp(1.6rem, 4vw, 2.35rem);
  line-height: var(--teb-line-height-tight);
  margin-bottom: var(--teb-space-3);
}

.oh-hero-lead {
  opacity: 0.92;
  max-width: 36rem;
  font-size: var(--teb-font-size-lg);
  line-height: var(--teb-line-height);
}

.oh-hero-visual svg {
  max-width: 300px;
  width: 100%;
  filter: drop-shadow(0 16px 32px rgba(0,0,0,.2));
}

.oh-main { margin-top: calc(-1 * var(--teb-space-6)); position: relative; z-index: 2; }

.oh-section-title {
  font-size: var(--teb-font-size-xl);
  font-weight: 700;
  margin-bottom: var(--teb-space-4);
}

.oh-workflow { padding: var(--teb-space-6); }

.oh-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--teb-space-2);
  justify-content: center;
}

.oh-step {
  flex: 1 1 140px;
  text-align: center;
  padding: var(--teb-space-3);
  background: var(--teb-surface);
  border-radius: var(--teb-radius-lg);
  border: 1px solid var(--teb-border);
}

.oh-step span {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--teb-primary);
  color: #fff;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.oh-step strong { display: block; font-size: var(--teb-font-size-sm); }
.oh-step small { color: var(--teb-text-muted); font-size: 0.75rem; }

.oh-step-arrow { color: var(--teb-text-muted); opacity: 0.5; }

.oh-feature-card { padding: var(--teb-space-5); }

.oh-feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ecfeff, #ccfbf1);
  color: #0f766e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: var(--teb-space-3);
}

.oh-feature-card h3 { font-size: var(--teb-font-size-lg); font-weight: 700; }

.oh-cap-grid {
  display: grid;
  gap: var(--teb-space-3);
  padding: var(--teb-space-5);
}

.oh-cap-item {
  display: flex;
  align-items: center;
  gap: var(--teb-space-3);
  padding: var(--teb-space-3);
  background: var(--teb-surface-muted);
  border-radius: var(--teb-radius-md);
}

.oh-cap-item i {
  font-size: 1.25rem;
  color: #0f766e;
  width: 2rem;
  text-align: center;
}

.oh-cap-item span { display: block; font-size: 0.8rem; color: var(--teb-text-muted); }

.oh-footer { border-top: 1px solid var(--teb-border); background: var(--teb-surface); }

/* ─── Dashboard ─── */
.oh-dash-body {
  background: var(--teb-bg-gradient, #f8fafc);
  color: var(--teb-text, #0f172a);
  min-height: 100vh;
  font-family: var(--teb-font);
}

.oh-dash-header {
  background: var(--teb-surface-glass, #fff);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--teb-border, #e2e8f0);
  padding: 0.85rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.oh-dash-title {
  display: inline-block;
  font-size: 1.15rem;
  margin: 0 0.5rem 0 0;
  vertical-align: middle;
  font-weight: 700;
}

.oh-dash-back { color: #0f766e; margin-left: 0.5rem; }

.oh-lang-switch {
  display: inline-flex;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.oh-lang-btn {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  line-height: 1;
}

.oh-lang-btn.active {
  background: #0f766e;
  color: #fff;
}

.oh-lang-btn:focus-visible {
  outline: 2px solid #0f766e;
  outline-offset: 2px;
}

body.oh-ltr .oh-dash-back i {
  transform: scaleX(-1);
}

body.oh-ltr .oh-sidebar {
  border-left: 1px solid #e2e8f0;
  border-right: 0;
}

body.oh-ltr .oh-nav-item {
  text-align: left;
}

body.oh-ltr .oh-dash-layout {
  direction: ltr;
}

body.oh-ltr .oh-table th,
body.oh-ltr .oh-table td {
  text-align: left;
}

.oh-help-btn {
  white-space: nowrap;
}

.oh-help-modal {
  max-width: 640px;
}

.oh-help-body {
  max-height: min(70vh, 520px);
  overflow-y: auto;
}

.oh-help-intro {
  color: #475569;
  margin-bottom: 1rem;
}

.oh-help-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
}

.oh-help-item summary {
  cursor: pointer;
  font-weight: 600;
  color: #0f766e;
}

.oh-help-item p {
  margin: 0.5rem 0 0;
  color: #334155;
  font-size: 0.95rem;
}

.oh-help-tips {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed #cbd5e1;
}

.oh-help-tips h4 {
  font-size: 1rem;
  color: #0f766e;
  margin-bottom: 0.5rem;
}

.oh-help-tips ul {
  margin: 0;
  padding-right: 1.25rem;
  color: #475569;
  font-size: 0.9rem;
}

body.oh-ltr .oh-help-tips ul {
  padding-right: 0;
  padding-left: 1.25rem;
}

/* تقویم شمسی */
.oh-jdate-wrap,
.oh-jdt-wrap {
  width: 100%;
}

.oh-jcal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 10040;
}

.oh-jcal-popup {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 118, 110, 0.18);
  padding: 12px;
  width: min(300px, calc(100vw - 24px));
  direction: rtl;
}

.oh-jcal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
}

.oh-jcal-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.oh-jcal-nav {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  line-height: 1;
  font-size: 1.25rem;
  cursor: pointer;
}

.oh-jcal-weekdays,
.oh-jcal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.oh-jcal-weekdays {
  margin-bottom: 6px;
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
}

.oh-jcal-day {
  aspect-ratio: 1;
  min-height: 34px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.oh-jcal-day.is-empty {
  border: none;
  background: transparent;
  cursor: default;
}

.oh-jcal-day.is-today {
  border-color: #0f766e;
  font-weight: 700;
}

.oh-jcal-day.is-selected {
  background: #0f766e;
  color: #fff;
  border-color: #0f766e;
}

.oh-jcal-day:hover:not(.is-empty):not(.is-selected) {
  background: #f0fdfa;
}

.oh-jcal-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.bg-teal { background: #0f766e !important; }

.btn-teal {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

.btn-teal:hover {
  background: #115e59;
  border-color: #115e59;
  color: #fff;
}

.oh-dash-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  padding: 1rem;
}

.oh-sidebar {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.5rem;
  align-self: start;
  position: sticky;
  top: 72px;
}

.oh-nav { display: flex; flex-direction: column; gap: 0.25rem; }

.oh-nav-item {
  border: none;
  background: transparent;
  text-align: right;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s ease;
}

.oh-nav-item:hover,
.oh-nav-item.active {
  background: #ecfdf5;
  color: #0f766e;
}

.oh-panel { display: none; }
.oh-panel.active { display: block; }

.oh-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.25rem;
}

.oh-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.oh-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.oh-stat {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.oh-stat strong { display: block; font-size: 1.6rem; color: #0f766e; }
.oh-stat span { color: #64748b; font-size: 0.85rem; }

.oh-table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.oh-table { width: 100%; margin: 0; font-size: 0.92rem; }
.oh-table th, .oh-table td { padding: 0.65rem 0.85rem; border-bottom: 1px solid #e2e8f0; white-space: nowrap; }
.oh-table th { background: #f1f5f9; font-weight: 600; }

.oh-badge-abnormal {
  background: #fef2f2;
  color: #b91c1c;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.8rem;
}

.oh-wizard-steps { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.oh-wizard-step {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
}

.oh-wizard-step.done { background: #d1fae5; color: #065f46; }
.oh-wizard-step.current { background: #0f766e; color: #fff; }

.oh-physical-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.oh-physical-row {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: #f8fafc;
}

.oh-physical-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.oh-physical-label { font-weight: 600; font-size: 0.88rem; }
.oh-physical-finding { max-width: 140px; }

.oh-paraclinical-row {
  display: grid;
  grid-template-columns: 1fr 1fr 100px 1fr auto;
  gap: 0.5rem;
  align-items: end;
  margin-bottom: 0.5rem;
}

.oh-attach-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.oh-attach-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  font-size: 0.9rem;
}

.oh-attach-link {
  color: #0f766e;
  text-decoration: none;
}

.oh-attach-link:hover { text-decoration: underline; }

.oh-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: #0f172a;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  z-index: 2000;
  transition: transform 0.25s ease;
  max-width: 90vw;
}

.oh-toast.show { transform: translateX(-50%) translateY(0); }

/* Modal فرم‌های CRUD */
.oh-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.oh-modal {
  background: #fff;
  border-radius: 14px;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
}

.oh-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.oh-modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.oh-modal-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 0 0.25rem;
}

.oh-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
}

.oh-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid #e2e8f0;
}

.oh-subnav .nav-link {
  cursor: pointer;
  color: #64748b;
  border: none;
  background: transparent;
}

.oh-subnav .nav-link.active {
  color: #0f766e;
  font-weight: 600;
}

.oh-actions-cell .btn { padding: 0.1rem 0.35rem; }

.oh-emp-filters .form-control,
.oh-emp-filters .form-select { flex: 0 1 auto; }

.emp-dossier-tab { padding-top: 0.25rem; }

.oh-conditions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.35rem 1rem;
}

.oh-conditions-grid .form-check {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.oh-report-filters { align-items: center; }

.oh-chart-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #334155;
}

.oh-pie-chart {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  box-shadow: inset 0 0 0 4px #fff;
}

.oh-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: center;
  font-size: 0.85rem;
}

.oh-chart-legend span::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-left: 4px;
  vertical-align: middle;
}

.oh-bar-chart { display: flex; flex-direction: column; gap: 0.5rem; }

.oh-bar-row {
  display: grid;
  grid-template-columns: 100px 1fr 40px;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.88rem;
}

.oh-bar-row .bar-track {
  background: #e2e8f0;
  border-radius: 6px;
  height: 10px;
  overflow: hidden;
}

.oh-bar-row .bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0f766e, #14b8a6);
  border-radius: 6px;
  min-width: 2px;
}

.oh-summary-bar {
  background: #f8fafc;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

.oh-summary-bar .bar {
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: 0.35rem;
}

.oh-summary-bar .fill { height: 100%; background: #14b8a6; }

/* چاپ گواهی */
@media print {
  .oh-print-actions { display: none !important; }
  .oh-cert-page { box-shadow: none !important; margin: 0 !important; }
}

.oh-cert-page {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2.5rem;
  background: #fff;
  border: 2px solid #0f766e;
  border-radius: 8px;
}

/* جستجوی پرسنل */
.oh-emp-picker-slot {
  position: relative;
}

.oh-emp-picker {
  position: relative;
}

.oh-emp-picker-inline .oh-emp-picker-selected {
  margin-top: 0.25rem;
}

.oh-emp-picker-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.oh-emp-picker-control .oh-emp-picker-search {
  flex: 1 1 160px;
  min-width: 0;
}

.oh-emp-picker-selected {
  margin-top: 0.35rem;
  padding: 0.35rem 0.5rem;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  color: #0f766e;
  font-size: 0.875rem;
}

.oh-emp-picker-selected.is-empty {
  display: none;
}

.oh-emp-picker-results {
  position: absolute;
  z-index: 1060;
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 4px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  border-radius: 8px;
}

.oh-emp-picker-results .list-group-item {
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.55rem 0.75rem;
}

.oh-emp-picker-results .list-group-item:hover {
  background: #f0fdfa;
}

.oh-emp-picker-clear {
  padding: 0;
  font-size: 0.8rem;
  text-decoration: none;
}

body.oh-ltr .oh-emp-picker-results {
  text-align: left;
}

@media (max-width: 991px) {
  .oh-dash-layout { grid-template-columns: 1fr; }
  .oh-sidebar { position: static; }
  .oh-nav { flex-direction: row; overflow-x: auto; }
  .oh-nav-item { white-space: nowrap; flex-shrink: 0; }
  .oh-paraclinical-row { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .oh-nav-item, .oh-toast { transition: none; }
}
