﻿/* PathoLIS v3 — TO'LIQ YANGI UI (Variant 3 Workspace Pro) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --pl-primary: #7c3aed;
  --pl-primary-hover: #6d28d9;
  --pl-primary-dark: #5b21b6;
  --pl-primary-light: #ede9fe;
  --pl-primary-glow: rgba(124, 58, 237, 0.32);
  
  --pl-sidebar: #f8f9fc;
  --pl-sidebar-w: 230px;
  --pl-sidebar-border: #e2e8f0;
  --pl-sidebar-text: #64748b;
  --pl-sidebar-active: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  
  --pl-bg: #f4f6fb;
  --pl-surface: #ffffff;
  --pl-border: #e2e8f0;
  --pl-border-soft: #f1f5f9;
  --pl-border-focus: #7c3aed;
  
  --pl-text: #0f172a;
  --pl-text-2: #334155;
  --pl-muted: #64748b;
  
  --pl-blue: #7c3aed;
  --pl-blue-dark: #6d28d9;
  --pl-navy: #4c1d95;
  --pl-cyto: #7c3aed;
  
  --pl-radius: 14px;
  --pl-radius-sm: 10px;
  --pl-radius-xs: 6px;
  
  --pl-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --pl-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.03);
  --pl-shadow-lg: 0 20px 40px -10px rgba(15, 23, 42, 0.1), 0 8px 16px -4px rgba(15, 23, 42, 0.04);
  
  --pl-font: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --pl-mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  --pl-success: #166534;
  --pl-danger: #dc2626;
  --pl-warn: #d97706;
}

html { font-size: 14px; }
body.patholis-v3 {
  font-family: var(--pl-font);
  background: var(--pl-bg);
  color: var(--pl-text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body.patholis-v3.module-cytology {
  --pl-blue: #7c3aed;
  --pl-blue-dark: #6d28d9;
  --pl-navy: #4c1d95;
}

/* ===== UTIL ===== */
.hidden { display: none !important; }
.req { color: var(--pl-danger); }

/* ===== LOADING & TOAST ===== */
.loading-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(15,23,42,.35);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 99999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 16px; border-radius: 10px;
  background: var(--pl-navy); color: #fff;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  animation: toastIn .25s ease;
}
.toast.success { background: var(--pl-success); }
.toast.error { background: var(--pl-danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ===== LOGIN ===== */
#login-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--pl-sidebar);
}
.pl-login-wrap { display: flex; min-height: 100vh; width: 100%; }
.pl-login-brand {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 40px; color: #fff;
  background: linear-gradient(145deg, #3b0764, #4c1d95 55%, #4a1238);
}
.pl-login-brand-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px; box-shadow: 0 4px 16px rgba(176,40,120,.25);
}
.pl-login-brand-icon svg { width: 22px; height: 22px; fill: #fff; }
.clinic-brand-logo {
  background: #fff !important;
  border: 2px solid #7c3aed;
  color: #6d28d9;
  font-family: Georgia, "Times New Roman", serif;
  box-shadow: 0 4px 16px rgba(176,40,120,.2);
}
.clinic-brand-logo span {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .04em;
}
.clinic-brand-logo .clinic-logo-img,
.clinic-logo-img {
  width: 100%;
  height: 100%;
  min-width: 24px;
  min-height: 24px;
  object-fit: contain;
  display: block;
  border-radius: inherit;
}
.pl-login-brand-icon.clinic-brand-logo {
  width: 108px;
  height: 108px;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #fff !important;
  border: 2px solid rgba(255,255,255,.35);
  box-shadow: 0 6px 24px rgba(0,0,0,.28), 0 0 0 1px rgba(176,40,120,.35);
  flex-shrink: 0;
}
.pl-login-brand-icon.clinic-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.pro-sidebar-logo-icon.clinic-brand-logo {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #fff !important;
  border: 2px solid rgba(255,255,255,.22);
  box-shadow: 0 3px 12px rgba(0,0,0,.22), 0 0 0 1px rgba(176,40,120,.28);
  flex-shrink: 0;
}
.pro-sidebar-logo-icon.clinic-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.pl-login-brand h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 8px; }
.pl-login-brand > p { font-size: 13px; color: #94a3b8; max-width: 360px; line-height: 1.55; }
.pl-login-brand-features { margin-top: 24px; display: flex; flex-direction: column; gap: 8px; }
.pl-login-brand-features span {
  font-size: 13px; color: #cbd5e1;
  padding-left: 28px; position: relative;
}
.pl-login-brand-features span::before {
  content: ""; position: absolute; left: 0; top: 5px;
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(176,40,120,.22);
  border: 2px solid #8b5cf6;
}
.pl-login-panel {
  width: min(400px, 100%); background: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 28px; box-shadow: -8px 0 32px rgba(0,0,0,.12);
}
.pl-login-panel h2 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.pl-login-sub { font-size: 13px; color: var(--pl-muted); margin-bottom: 20px; }
.login-field { margin-bottom: 14px; }
.login-field label {
  display: block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--pl-muted); margin-bottom: 6px;
}
.login-field input, .language-select {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--pl-border); border-radius: 8px;
  font-size: 13px; font-family: var(--pl-font);
  background: #f8fafc; outline: none;
}
.login-field input:focus, .language-select:focus {
  border-color: var(--pl-blue);
  box-shadow: 0 0 0 3px rgba(176,40,120,.12);
  background: #fff;
}
.login-error { color: var(--pl-danger); font-size: 13px; min-height: 20px; margin-bottom: 8px; }
.btn-login {
  width: 100%; padding: 9px; border: none; border-radius: 8px;
  background: var(--pl-blue);
  color: #fff; font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: var(--pl-font);
}
.btn-login:hover { filter: brightness(1.05); }
.login-card { width: 100%; }

/* ===== APP SHELL ===== */
#app-root.pro-app { display: none; min-height: 100vh; background: var(--pl-bg); }
#app-root.pro-app[style*="block"] { display: flex !important; }

.pro-sidebar {
  width: var(--pl-sidebar-w); background: var(--pl-sidebar);
  color: #94a3b8; display: flex; flex-direction: column;
  flex-shrink: 0; height: 100vh; position: sticky; top: 0;
  border-right: 1px solid rgba(255,255,255,.05);
}
.pro-sidebar-logo {
  padding: 16px 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; gap: 12px;
}
.pro-sidebar-logo-icon {
  width: 34px; height: 34px; border-radius: 8px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pro-sidebar-logo-icon svg { width: 18px; height: 18px; fill: #fff; }
.pro-sidebar-logo-icon.clinic-brand-logo span { font-size: 12px; }
body.module-cytology .pro-sidebar-logo-icon {
  background: #fff !important;
  border-color: #7c3aed;
  color: #6d28d9;
}
.pro-sidebar-logo strong { display: block; color: #000; font-size: 14px; font-weight: 800; }
.pro-sidebar-logo span { font-size: 10px; color: #64748b; line-height: 1.3; }

.pro-sidebar-nav { flex: 1; padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.pro-nav-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 10px;
  border: none; border-radius: 8px;
  background: transparent; color: #94a3b8;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  text-align: left; font-family: var(--pl-font);
}
.pro-nav-item:hover { background: rgba(255,255,255,.05); color: #e2e8f0; }
.pro-nav-item.active,
body.module-cytology .pro-nav-item.active,
body.module-ipsum .pro-nav-item.active {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35) !important;
  font-weight: 700 !important;
}
.pro-nav-item.active .pl-ico svg {
  stroke: #ffffff !important;
}
.pro-nav-item.active .pro-nav-badge {
  background: #ffffff !important;
  color: #7c3aed !important;
}
.pl-ico {
  width: 18px; height: 18px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.pl-ico svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.pro-nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  background: var(--pl-blue); color: #fff;
  border-radius: 10px; font-size: 10px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}

.pl-sidebar-stats {
  margin: 6px 8px; padding: 10px 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--pl-radius);
}
.pl-stats-title {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: #64748b; margin-bottom: 10px;
}
.pl-stat-row {
  display: flex; justify-content: space-between;
  padding: 4px 0; font-size: 12px; color: #94a3b8;
}
.pl-stat-row strong { color: #f1f5f9; font-family: var(--pl-mono); font-size: 13px; }
.pl-sidebar-help {
  margin: 8px 10px 14px; padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.08); border-radius: 10px;
  background: transparent; color: #94a3b8;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: var(--pl-font); text-align: left; width: calc(100% - 20px);
}

.pro-shell { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pro-topbar {
  display: flex; align-items: center; height: 50px;
  padding: 0 16px; background: #fff;
  border-bottom: 1px solid var(--pl-border);
}
.pro-topbar-center { flex: 1; max-width: 400px; }
.pl-global-search {
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 10px;
  background: #f1f5f9; border: 1px solid var(--pl-border);
  border-radius: 8px;
}
.pl-global-search svg { width: 16px; height: 16px; stroke: var(--pl-muted); fill: none; flex-shrink: 0; }
.pl-global-search input {
  border: none; background: transparent; flex: 1;
  font-size: 13px; outline: none; font-family: var(--pl-font);
}
.pro-topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.module-switcher-wrap { display: flex; flex-direction: column; gap: 2px; }
.module-switcher-label { font-size: 9px; font-weight: 800; text-transform: uppercase; color: var(--pl-muted); }
.module-switcher {
  display: flex; padding: 3px; gap: 2px;
  background: #f1f5f9; border: 1px solid var(--pl-border);
  border-radius: 10px;
}
.module-switcher-btn {
  padding: 4px 10px; border: none; border-radius: 6px;
  background: transparent; font-size: 11px; font-weight: 700;
  color: var(--pl-muted); cursor: pointer; font-family: var(--pl-font);
}
.module-switcher-btn.active { background: #fff; color: var(--pl-navy); box-shadow: var(--pl-shadow); }
body.module-cytology .module-switcher-btn.active { color: var(--pl-cyto); }
body.module-ipsum .module-switcher-btn.active { color: #dc2626; }
.mod-icon { display: none; }
.pl-notif-btn {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--pl-border); background: #fff;
  cursor: pointer; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.pl-notif-btn svg { width: 18px; height: 18px; stroke: var(--pl-text-2); fill: none; }
.pl-notif-dot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px; background: #ef4444;
  border-radius: 50%; border: 2px solid #fff;
}
.user-badge {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--pl-border); border-radius: 999px; background: #fff;
}
.app-header .user-badge { display: none !important; }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.user-name { font-size: 12px; font-weight: 700; }
.user-role { font-size: 10px; color: var(--pl-muted); }
.btn-logout {
  padding: 5px 10px; border: 1px solid var(--pl-border);
  border-radius: 8px; background: #fff;
  font-size: 11px; font-weight: 600; color: var(--pl-muted);
  cursor: pointer; font-family: var(--pl-font);
}

.app-header, .app-module-bar, .nav-tabs { display: none !important; }
.pro-page, .page { padding: 14px 18px 20px; flex: 1; max-width: none; margin: 0; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 6px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600; font-family: var(--pl-font);
  cursor: pointer; border: none; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.btn-primary {
  background: var(--pl-blue);
  color: #fff; box-shadow: none;
}
body.module-cytology .btn-primary {
  background: var(--pl-blue-dark);
  box-shadow: none;
}
body.module-ipsum .btn-primary {
  background: #dc2626;
  box-shadow: none;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary, .btn-outline {
  background: #fff; color: var(--pl-navy);
  border: 1px solid var(--pl-border);
}
.btn-danger { background: #fef2f2; color: var(--pl-danger); border: 1px solid #fecaca; }
.btn-ghost-danger { background: #fff; color: var(--pl-danger); border: 1px solid #fecaca; padding: 5px 8px; }
.btn-success { background: #ecfdf5; color: var(--pl-success); border: 1px solid #bbf7d0; }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-tg, .btn-tg-pending, .btn-tg-linked { min-width: auto; padding: 4px 8px; font-size: 11px; }

/* ===== CARDS & FORMS ===== */
.card {
  background: var(--pl-surface); border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius); box-shadow: var(--pl-shadow); overflow: hidden;
}
.card-header {
  padding: 12px 14px; border-bottom: 1px solid var(--pl-border-soft);
  background: #fff;
}
.card-title { font-size: 14px; font-weight: 800; }
.card-subtitle { font-size: 12px; color: var(--pl-muted); margin-top: 2px; }
.card-body { padding: 14px; }
.card-footer {
  padding: 10px 14px; border-top: 1px solid var(--pl-border-soft);
  background: #fafbfc; display: flex; gap: 10px; justify-content: flex-end;
}
.step-panel > .card-header { display: none; }
.pro-form-panel > .card-body, .pro-work-panel > .card-body {
  background: transparent; border: none; box-shadow: none; padding: 0;
}

.field { margin-bottom: 12px; }
.field label {
  display: block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--pl-muted); margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--pl-border); border-radius: 8px;
  font-size: 13px; font-family: var(--pl-font); background: #fff;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--pl-blue);
  box-shadow: 0 0 0 3px rgba(176,40,120,.1);
}
.form-grid-2 {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 768px) { .form-grid-2 { grid-template-columns: 1fr; } }
.reg-payment-panel {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--pl-border);
  border-radius: 10px;
  background: #f8fafc;
}
.reg-payment-title {
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 800;
  color: var(--pl-navy);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.reg-payment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 768px) { .reg-payment-grid { grid-template-columns: 1fr; } }

.reg-intake-page {
  max-width: 1240px;
  margin: 0 auto;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}
.reg-intake-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  margin-bottom: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.2);
  background:
    linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,0)),
    linear-gradient(135deg, #4c1d95 0%, #6d28d9 52%, #7c3aed 100%);
  box-shadow: 0 18px 38px rgba(80,18,58,.16);
  color: #fff;
}
.reg-intake-hero .card-title {
  font-size: 24px;
  color: #fff;
  margin-top: 8px;
}
.reg-intake-hero .card-subtitle {
  color: rgba(255,255,255,.72);
  font-size: 13px;
}
.reg-kicker {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: rgba(255,255,255,.86);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.reg-hero-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.reg-meta-chip {
  min-width: 142px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 10px;
  background: rgba(255,255,255,.10);
}
.reg-meta-chip span {
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: rgba(255,255,255,.68);
}
.reg-meta-chip strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: #fff;
}
.reg-intake-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 14px;
  align-items: start;
}
.reg-form-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.reg-section {
  background: #fff;
  border: 1px solid var(--pl-border);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(65,26,52,.06);
  overflow: visible;
}
.reg-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--pl-border-soft);
  background: linear-gradient(180deg, #fff, #fbfaff);
}
.reg-section-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--pl-text);
}
.reg-section-head p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--pl-muted);
}
.reg-section-num {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: #ede9fe;
  color: var(--pl-blue);
  font-size: 12px;
  font-weight: 900;
}
.reg-form-grid {
  padding: 16px;
  gap: 14px;
}
.reg-field-wide {
  grid-column: 1 / -1;
}
.reg-intake-page .field {
  margin-bottom: 0;
}
.reg-intake-page .field label small {
  color: var(--pl-blue);
  font-size: 10px;
  font-weight: 800;
}
.reg-intake-page .field input,
.reg-intake-page .field select,
.reg-intake-page .field textarea {
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: var(--pl-text);
  font-family: var(--pl-font);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.reg-intake-page .field select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #7c3aed 50%),
    linear-gradient(135deg, #7c3aed 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 17px,
    calc(100% - 12px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
.reg-intake-page .field input::placeholder,
.reg-intake-page .field textarea::placeholder {
  color: #94a3b8;
  font-weight: 500;
}
.reg-intake-page .field input:hover,
.reg-intake-page .field select:hover,
.reg-intake-page .field textarea:hover {
  border-color: #c4b5fd;
}
.reg-intake-page .field input:focus,
.reg-intake-page .field select:focus,
.reg-intake-page .field textarea:focus {
  border-color: var(--pl-blue);
  box-shadow: 0 0 0 3px rgba(176,40,120,.12);
}
.reg-intake-page .field input[readonly] {
  cursor: pointer;
  background: #fff;
}
.field-hint {
  color: var(--pl-muted);
  font-size: 11px;
  margin-top: 5px;
  display: block;
}
.reg-dropdown-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  z-index: 999;
  box-shadow: 0 12px 28px rgba(65,26,52,.12);
}
.reg-summary-panel {
  min-width: 0;
}
.reg-summary-card {
  position: sticky;
  top: 76px;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--pl-border);
  background: linear-gradient(180deg, #fff, #fbfaff);
  box-shadow: 0 12px 30px rgba(65,26,52,.06);
}
.reg-summary-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ede9fe;
  color: var(--pl-blue);
  margin-bottom: 12px;
}
.reg-summary-icon svg {
  width: 23px;
  height: 23px;
}
.reg-summary-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}
.reg-summary-card p {
  margin: 7px 0 14px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--pl-text-2);
}
.reg-check-list {
  display: grid;
  gap: 8px;
}
.reg-check-list span {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--pl-border-soft);
  border-radius: 9px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  color: var(--pl-text-2);
}
.reg-check-list b {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ede9fe;
  color: var(--pl-blue);
  font-size: 11px;
}
.reg-footer {
  margin-top: 14px;
  padding: 12px 0 0;
  border-top: 0;
  background: transparent;
}
.reg-footer .btn {
  min-height: 38px;
}
@media (max-width: 1080px) {
  .reg-intake-layout { grid-template-columns: 1fr; }
  .reg-summary-card { position: static; }
}
@media (max-width: 760px) {
  .reg-intake-hero { align-items: flex-start; flex-direction: column; }
  .reg-hero-meta { justify-content: flex-start; }
  .reg-meta-chip { min-width: 0; flex: 1 1 150px; }
  .reg-field-wide { grid-column: auto; }
}

.template-field { position: relative; }
.template-suggestions {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 50;
  background: #fff; border: 1px solid var(--pl-border);
  border-radius: 10px; box-shadow: var(--pl-shadow);
  max-height: 200px; overflow-y: auto; display: none;
}
.template-suggestion {
  padding: 8px 12px; font-size: 13px; cursor: pointer;
  border-bottom: 1px solid var(--pl-border-soft);
}
.template-suggestion:hover { background: #f1f5f9; }
.template-empty { padding: 12px; font-size: 12px; color: var(--pl-muted); }

/* ===== DASHBOARD ===== */
.pro-dashboard {
  display: block;
  max-width: 1240px;
  margin: 0 auto;
  padding-bottom: 28px;
}
.dashboard-greeting {
  background:
    linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,0)),
    linear-gradient(135deg, #4c1d95 0%, #6d28d9 48%, #7c3aed 100%);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: 0 18px 38px rgba(80, 18, 58, .18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #fff;
  overflow: hidden;
  position: relative;
}
.dashboard-greeting::after {
  content: "";
  position: absolute;
  right: -58px;
  top: -62px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
}
.dashboard-head-copy {
  position: relative;
  z-index: 1;
}
.dashboard-kicker {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  margin-bottom: 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: rgba(255,255,255,.86);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.dashboard-greeting h1 {
  display: block;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}
.dashboard-greeting p { font-size: 13px; color: rgba(255,255,255,.72); margin-top: 6px; }
.dashboard-quick-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.dash-action-btn {
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.10);
  color: #fff;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  font-family: var(--pl-font);
}
.dash-action-btn:hover { background: rgba(255,255,255,.18); }
.dash-action-btn.primary {
  background: #fff;
  color: var(--pl-blue);
  border-color: #fff;
  box-shadow: 0 10px 22px rgba(35, 9, 27, .18);
}
.stats-section-label {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--pl-navy); margin: 16px 0 10px;
}
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px; margin-bottom: 16px;
}
.dashboard-main-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 14px;
}
.dashboard-telegram-stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  background: #fff;
  border: 1px solid var(--pl-border);
  border-radius: 12px;
  padding: 10px;
  box-shadow: var(--pl-shadow);
}
.stat-card {
  background: #fff; border: 1px solid var(--pl-border);
  border-radius: 10px; padding: 13px;
  box-shadow: var(--pl-shadow);
  min-height: 112px;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: #f1d2e4;
}
.dashboard-main-stats .stat-card {
  border-top: 0;
  box-shadow: 0 10px 24px rgba(65, 26, 52, .06);
}
.dashboard-main-stats .stat-card::before {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -24px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: #fff4fa;
}
.stat-card.clickable:hover {
  border-color: #c4b5fd;
  box-shadow: 0 8px 22px rgba(176,40,120,.08);
}
.stat-value { font-size: 25px; font-weight: 800; color: var(--pl-blue); line-height: 1.1; position: relative; }
.stat-title { font-size: 11px; color: var(--pl-text-2); margin-top: 5px; line-height: 1.25; }
.stat-icon { width: 28px; height: 28px; border-radius: 8px; margin-bottom: 6px;
  display: flex; align-items: center; justify-content: center; }
.stat-icon svg { width: 16px; height: 16px; }
.stat-badge {
  display: inline-flex;
  font-size: 9px;
  font-weight: 800;
  color: var(--pl-blue);
  background: #ede9fe;
  border-radius: 999px;
  padding: 2px 7px;
  margin-bottom: 6px;
}
.stat-card.blue .stat-value, .stat-icon.blue { color: var(--pl-blue); }
.stat-icon.blue { background: #ede9fe; }
.stat-card.green .stat-value { color: #3B6D11; }
.stat-icon.green { background: #EAF3DE; color: #3B6D11; }
.stat-card.orange .stat-value { color: #BA7517; }
.stat-icon.orange { background: #FAEEDA; color: #BA7517; }
.stat-card.purple .stat-value { color: #534AB7; }
.stat-icon.purple { background: #EEEDFE; color: #534AB7; }
.stat-card.indigo .stat-value { color: #0F6E56; }
.stat-icon.indigo { background: #E1F5EE; color: #0F6E56; }
.stat-card.gray .stat-value { color: #5F5E5A; }
.stat-icon.gray { background: #F1EFE8; color: #5F5E5A; }

.dashboard-ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr);
  gap: 14px;
  align-items: start;
  margin-top: 8px;
}
.dashboard-primary-panel,
.dashboard-side-panel {
  min-width: 0;
}
.dashboard-ops-grid-single {
  grid-template-columns: 1fr;
}
.dash-alerts-block {
  margin-top: 0;
  background: #fff;
  border: 1px solid #c4b5fd;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(176,40,120,.10);
  overflow: hidden;
}
.dash-alerts-header {
  margin-bottom: 0;
  padding: 15px 16px;
  background: linear-gradient(135deg, #4c1d95, #7c3aed);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dash-alerts-header small { color: rgba(255,255,255,.75) !important; }
.dash-alerts-title { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.dash-alerts-title .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255,255,255,.18);
}
.dash-alert-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 16px; background: #fff;
  border: 0; border-bottom: 1px solid var(--pl-border-soft);
  border-radius: 0;
  margin-bottom: 0; cursor: pointer;
}
.dash-alert-row:hover { background: #fbfaff; }
.dash-alert-left { display: flex; gap: 12px; align-items: flex-start; }
.dash-alert-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.dash-alert-icon.red { background: #fef2f2; }
.dash-alert-icon.amber { background: #fffbeb; }
.dash-alert-icon.blue { background: #ede9fe; }
.dash-alert-label { font-size: 13px; font-weight: 700; }
.dash-alert-sub { font-size: 11px; color: var(--pl-muted); margin-top: 1px; }
.dash-alert-badge {
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.dash-alert-badge.red { background: #fef2f2; color: var(--pl-danger); }
.dash-alert-badge.amber { background: #fffbeb; color: var(--pl-warn); }
.dash-alert-badge.blue { background: #ede9fe; color: var(--pl-blue); }
.dash-alert-panel { display: none; background: #fbfaff; border: 0;
  border-bottom: 1px solid var(--pl-border-soft); border-radius: 0; margin-bottom: 0; overflow: hidden; }
.dash-alert-panel.open { display: block; }
.dash-alert-panel-inner { padding: 14px; }
.dash-alert-panel-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.dash-alert-panel-filters input {
  padding: 8px 10px; border: 1px solid var(--pl-border);
  border-radius: 8px; font-size: 13px;
}
.dash-alert-list { display: flex; flex-direction: column; gap: 6px; }
.dash-alert-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; background: #fff;
  border-radius: 6px; font-size: 12px;
  border: 1px solid var(--pl-border-soft);
}
.dash-alert-item-name { font-weight: 700; font-size: 12.5px; }
.dash-alert-item-meta { font-size: 10px; color: var(--pl-muted); }
.dash-alert-item-tag {
  font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 999px;
}
.tag-overdue { background: #fef2f2; color: var(--pl-danger); }
.tag-warn { background: #fffbeb; color: var(--pl-warn); }
.tag-no-tg, .tag-no-fin { background: #ede9fe; color: var(--pl-blue); }

.info-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 0;
}
.info-card {
  background: linear-gradient(180deg, #fff, #fffafd);
  border: 1px solid var(--pl-border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(65, 26, 52, .06);
}
.info-card-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--pl-navy);
  margin-bottom: 10px;
}
.workflow-steps {
  display: grid;
  gap: 8px;
}
.wf-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: var(--pl-text-2);
  padding: 9px;
  background: #fff;
  border: 1px solid var(--pl-border-soft);
  border-radius: 9px;
}
.wf-step-num {
  width: 24px; height: 24px;
  border-radius: 8px;
  background: #ede9fe;
  color: var(--pl-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-weight: 800;
  font-size: 11px;
}
.wf-step-label b { color: var(--pl-text); }

.dashboard-telegram-label {
  margin-top: 18px;
}
.dashboard-telegram-stats .stat-card {
  min-height: 96px;
  border-color: transparent;
  background: #fbfaff;
  box-shadow: none;
}
.dashboard-telegram-stats .stat-card::after {
  background: transparent;
}
.dashboard-telegram-stats .stat-value {
  font-size: 22px;
}
#dashboard-telegram-panel {
  background: #fff !important;
  border: 1px solid var(--pl-border) !important;
  border-radius: 10px !important;
  box-shadow: var(--pl-shadow) !important;
}

@media (max-width: 1200px) {
  .dashboard-main-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-telegram-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-ops-grid { grid-template-columns: 1fr; }
  .info-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .dashboard-greeting { align-items: flex-start; flex-direction: column; }
  .dashboard-quick-actions { justify-content: flex-start; }
  .dashboard-main-stats,
  .dashboard-telegram-stats,
  .info-cards { grid-template-columns: 1fr; }
}

/* ===== QUEUE ===== */
.pro-section { display: flex; flex-direction: column; gap: 10px; }
.pro-section-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; background: #fff;
  border: 1px solid var(--pl-border); border-radius: var(--pl-radius);
  box-shadow: var(--pl-shadow);
}
.pro-section-filters { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; justify-content: flex-end; }
.pro-stat-chip {
  padding: 6px 12px; background: #ede9fe;
  border: 1px solid var(--pl-border); border-radius: 8px;
}
.pro-stat-chip span { display: block; font-size: 9px; font-weight: 700; text-transform: uppercase; color: var(--pl-muted); }
.pro-stat-chip strong { font-size: 18px; font-weight: 800; color: var(--pl-blue); font-family: var(--pl-mono); }
.search-input-wrap { position: relative; flex: 1; min-width: 200px; }
.search-input-wrap svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; stroke: var(--pl-muted); fill: none; pointer-events: none;
}
.pro-search input, .search-input-wrap input {
  width: 100%; padding: 7px 10px 7px 32px;
  border: 1px solid var(--pl-border); border-radius: 8px;
  font-size: 12px; background: #f8fafc; outline: none; font-family: var(--pl-font);
}
.pro-queue-list { display: flex; flex-direction: column; gap: 6px; }
.pro-queue-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; background: #fff;
  border: 1px solid var(--pl-border); border-radius: var(--pl-radius);
  box-shadow: var(--pl-shadow);
}
.pro-queue-card:hover { border-color: #c4b5fd; }
.pro-queue-card.overdue { border-color: #fecaca; background: linear-gradient(90deg, #fff, #fffafa); }
.pro-queue-card-main { flex: 1; min-width: 0; }
.pro-queue-card-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.pro-queue-id {
  font-size: 10px; font-weight: 700; font-family: var(--pl-mono);
  color: var(--pl-blue); background: #ede9fe;
  padding: 2px 8px; border-radius: 999px;
}
.analysis-tabs{display:flex;gap:8px;padding:16px 24px 0;border-top:1px solid var(--border-soft)}
.analysis-tab{border:1.5px solid var(--border);background:#fff;color:var(--text-secondary);border-radius:10px;padding:10px 16px;font-weight:700;cursor:pointer}
.analysis-tab.active{background:var(--accent);border-color:var(--accent);color:#fff;box-shadow:var(--shadow-sm)}
#reg-ipsum-only-fields{display:none}
#reg-ipsum-only-fields.is-open{display:contents}
.analysis-type-badge {
  font-size: 9px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
}
.analysis-type-badge.histology { background: #ede9fe; color: #6d28d9; }
.analysis-type-badge.cytology { background: #ede9fe; color: #7c3aed; }
.analysis-type-badge.ipsum { background: #fee2e2; color: #b91c1c; }

.ipsum-stepper .lab-flow-step.active .lab-flow-num {
    background: #dc2626;
}
.ipsum-form-card .lab-section-card-head {
    border-bottom-color: #fecaca;
}
.ipsum-upload {
    margin-bottom: 16px;
    max-width: 360px;
}
.ipsum-table-editor-wrap {
    border: 1px solid #fecaca;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.ipsum-table-editor-title {
    padding: 11px 14px;
    background: #fff5f5;
    color: #991b1b;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.ipsum-editor-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.ipsum-editor-table th,
.ipsum-editor-table td {
    border-top: 1px solid #fecaca;
    padding: 9px 10px;
    vertical-align: middle;
    font-size: 13px;
}
.ipsum-editor-table th {
    background: #fffafa;
    color: #7f1d1d;
    font-weight: 800;
    text-align: left;
}
.ipsum-editor-table th:nth-child(1),
.ipsum-editor-table td:nth-child(1) { width: 36%; font-weight: 700; }
.ipsum-editor-table th:nth-child(2),
.ipsum-editor-table td:nth-child(2) { width: 20%; }
.ipsum-editor-table th:nth-child(3),
.ipsum-editor-table td:nth-child(3) { width: 22%; color: #475569; text-align: center; }
.ipsum-editor-table th:nth-child(4),
.ipsum-editor-table td:nth-child(4) { width: 22%; color: #475569; text-align: center; }
.ipsum-result-input {
    width: 100%;
    min-height: 36px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 7px 9px;
    font-weight: 700;
    text-align: center;
}
.pro-queue-badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.pro-queue-badge.ok { background: #ecfdf5; color: var(--pl-success); }
.pro-queue-badge.warn { background: #fff7ed; color: var(--pl-warn); }
.pro-queue-badge.overdue { background: #fef2f2; color: var(--pl-danger); }
.pro-queue-name { font-size: 13.5px; font-weight: 700; margin-bottom: 3px; }
.pro-queue-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--pl-muted); margin-bottom: 4px; }
.pro-queue-dx { font-size: 11.5px; color: var(--pl-text-2); line-height: 1.4; }
.pro-queue-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pro-empty {
  text-align: center; padding: 32px; background: #fff;
  border: 1px dashed var(--pl-border); border-radius: var(--pl-radius);
}
.pro-empty p { color: var(--pl-muted); font-weight: 600; margin-top: 8px; }

.pager, .pro-pager {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: #fff;
  border: 1px solid var(--pl-border); border-radius: var(--pl-radius);
}
.pager-info { font-size: 12px; color: var(--pl-muted); }

.pl-dash-card {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--pl-border); border-radius: 8px;
  background: #fff; cursor: pointer;
}
.pl-dash-card:hover { border-color: #c4b5fd; background: #fbfaff; }
.pl-dash-card-main { min-width: 0; flex: 1; }
.pl-dash-card-name {
  font-weight: 700; font-size: 12.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pl-dash-card-meta { font-size: 10.5px; color: var(--pl-muted); margin-top: 1px; }
.pl-dash-card-status {
  font-size: 10px; line-height: 1.4; margin-top: 4px;
  display: flex; flex-direction: column; gap: 1px;
}
.pl-dash-card-actions { display: flex; gap: 6px; flex-shrink: 0; }

#completed-section .completed-patient-name { font-size: 13.5px; font-weight: 700; }
#completed-section .completed-patient-sub { font-size: 11px; color: var(--pl-muted); margin-top: 2px; }
#completed-section .completed-dx { max-width: 320px; }
#completed-section .completed-date,
#completed-section .completed-blank { font-family: var(--pl-mono); font-size: 12px; }
#completed-section .completed-actions {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end;
}

/* ===== TABLES ===== */
.pro-table-wrap, .data-table-wrap {
  background: #fff; border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius); overflow: hidden; box-shadow: var(--pl-shadow);
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  padding: 8px 12px; text-align: left;
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--pl-muted);
  background: #f8fafc; border-bottom: 1px solid var(--pl-border);
}
.data-table tbody td { padding: 10px 12px; font-size: 12.5px; border-bottom: 1px solid var(--pl-border-soft); vertical-align: middle; }
.data-table tbody tr:hover { background: #f8fafc; }
.td-muted { color: var(--pl-muted); font-size: 12px; }

/* ===== WORKSPACE (Variant 3) ===== */
.ws-header { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--pl-border); }
.ws-tabs {
  display: inline-flex; gap: 2px; padding: 3px;
  background: #f1f5f9; border: 1px solid var(--pl-border); border-radius: 8px;
}
.ws-tab {
  padding: 5px 12px; border: none; border-radius: 6px;
  background: transparent; font-size: 12px; font-weight: 600;
  color: var(--pl-muted); cursor: pointer; font-family: var(--pl-font);
  display: inline-flex; align-items: center; gap: 6px;
}
.ws-tab.active { background: #fff; color: var(--pl-navy); box-shadow: var(--pl-shadow); }
.ws-tab-badge { background: var(--pl-blue); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px; }
.ws-title-block h2 { font-size: 17px; font-weight: 800; margin: 8px 0 2px; letter-spacing: -.02em; }
.ws-sample-id { font-size: 12px; color: var(--pl-muted); }
.ws-sample-id strong { font-family: var(--pl-mono); color: var(--pl-text); }
.ws-copy-btn { border: none; background: none; cursor: pointer; opacity: .5; margin-left: 4px; }

.pro-workspace-grid {
  display: grid; grid-template-columns: 240px 1fr;
  gap: 14px; align-items: start;
}
@media (max-width: 1100px) { .pro-workspace-grid { grid-template-columns: 1fr; } }

.pro-patient-card {
  background: #fff; border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius); overflow: hidden;
  box-shadow: var(--pl-shadow); position: sticky; top: 76px;
}
.pro-patient-card-head {
  padding: 10px 12px; background: var(--pl-navy);
}
body.module-cytology .pro-patient-card-head { background: linear-gradient(135deg, #4c1d95, #7c3aed); }
.pro-patient-card-head h3 {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: #fff; margin: 0;
}
.pro-patient-card-body { padding: 12px; }
.pro-info-list { display: flex; flex-direction: column; gap: 8px; }
.pro-info-item { display: flex; flex-direction: column; gap: 3px; }
.pro-info-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--pl-muted); }
.pro-info-value { font-size: 12.5px; font-weight: 600; line-height: 1.35; word-break: break-word; }
.pro-status-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.pl-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.pl-badge.orange { background: #ffedd5; color: #c2410c; }
.pl-badge.blue { background: #ede9fe; color: #6d28d9; }
.pro-edit-btn {
  width: 100%; margin-top: 10px; padding: 7px;
  border: 1px solid var(--pl-border); border-radius: 8px;
  background: #f8fafc; color: var(--pl-navy);
  font-size: 11.5px; font-weight: 700; cursor: pointer; font-family: var(--pl-font);
}

.lab-workflow-stepper {
  display: flex; align-items: center; gap: 0;
  background: #fff; border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius); padding: 10px 14px;
  margin-bottom: 12px; box-shadow: var(--pl-shadow);
}
.lab-flow-step {
  flex: 1; display: flex; align-items: center; gap: 8px;
  position: relative; color: var(--pl-muted); font-size: 12px; font-weight: 600;
}
.lab-flow-step:not(:last-child)::after {
  content: ""; flex: 1; height: 2px; background: var(--pl-border);
  margin: 0 12px;
}
.lab-flow-step.done:not(:last-child)::after { background: #86efac; }
.lab-flow-num {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--pl-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; flex-shrink: 0;
}
.lab-flow-step.active .lab-flow-num {
  background: var(--pl-blue);
  border-color: transparent; color: #fff;
  box-shadow: 0 0 0 3px rgba(176,40,120,.12);
}
.lab-flow-step.done .lab-flow-num { background: #dcfce7; border-color: #22c55e; color: #166534; }
.lab-flow-step.active { color: var(--pl-navy); }

.lab-section-card {
  background: #fff; border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius); margin-bottom: 12px;
  box-shadow: var(--pl-shadow); overflow: hidden;
}
.lab-section-card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--pl-border-soft);
  background: #fafbfc;
}
.lab-section-card-head h3 { font-size: 13px; font-weight: 800; margin: 0; }
.lab-section-card-head p { font-size: 11px; color: var(--pl-muted); margin: 1px 0 0; }
.lab-step-num {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--pl-blue);
  color: #fff; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.lab-section-card-body { padding: 12px; }
.lab-split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
@media (max-width: 900px) { .lab-split { grid-template-columns: 1fr; } }
.lab-split-side, .pro-upload-zone {
  background: #f8fafc; border: 1.5px dashed #c4b5fd;
  border-radius: var(--pl-radius); padding: 16px;
  min-height: 180px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.pro-upload-zone-icon svg { width: 32px; height: 32px; stroke: #c4b5fd; fill: none; opacity: .8; }
.pro-upload-zone-title {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--pl-muted); margin: 6px 0 4px;
}
.pl-upload-hint { font-size: 11px; color: var(--pl-muted); line-height: 1.45; margin-bottom: 8px; }
.file-upload-wrap input[type=file] {
  font-size: 12px; color: var(--pl-blue); font-weight: 700; cursor: pointer;
  border: none; background: transparent;
}
.img-preview-wrap img { max-width: 100%; border-radius: 8px; margin-top: 10px; cursor: zoom-in; }

.lab-conclusion-card {
  border: 1px solid var(--pl-border); border-radius: var(--pl-radius);
  overflow: hidden; box-shadow: var(--pl-shadow); margin-bottom: 16px;
}
.lab-panel-header, .lab-conclusion-card .lab-panel-header {
  padding: 10px 12px; background: var(--pl-navy);
  color: #fff; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em;
}
body.module-cytology .lab-panel-header { background: linear-gradient(135deg, #4c1d95, #7c3aed); }

.ws-footer {
  display: flex !important; align-items: center; justify-content: space-between;
  background: #fff !important; border: 1px solid var(--pl-border) !important;
  border-radius: var(--pl-radius) !important; padding: 10px 12px !important;
  margin-top: 12px !important; box-shadow: var(--pl-shadow) !important;
}
.ws-footer-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.analysis-mode-bar { display: none !important; }

/* ===== CYTOLOGY ===== */
.sito-accordion {
  border: 1px solid var(--pl-border); border-radius: var(--pl-radius);
  margin-bottom: 10px; overflow: hidden; background: #fff;
}
.sito-accordion summary {
  padding: 10px 12px; font-size: 13px; font-weight: 700;
  cursor: pointer; list-style: none; background: #fafbfc;
  border-bottom: 1px solid transparent;
}
.sito-accordion[open] summary { border-bottom-color: var(--pl-border-soft); }
.sito-accordion summary::-webkit-details-marker { display: none; }
.sito-accordion-body { padding: 12px; }
.sito-cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sito-cat-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border: 1px solid var(--pl-border);
  border-radius: 8px; font-size: 12px; cursor: pointer;
}
.sito-cat-item:has(input:checked) { border-color: var(--pl-cyto); background: #ede9fe; }
.sito-type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sito-type-label {
  padding: 10px; border: 1px solid var(--pl-border); border-radius: 8px;
  cursor: pointer; text-align: center; font-size: 12px; font-weight: 600;
}
.sito-type-label.active, .sito-type-label:has(input:checked) {
  border-color: var(--pl-cyto); background: #ede9fe;
}
.tis-manual-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 14px; border: 1px solid var(--pl-border); border-radius: var(--pl-radius);
  background: #ede9fe; font-weight: 600;
}
.tis-manual-row input {
  width: 70px; text-align: center; font-weight: 800;
  border: none; border-bottom: 2px solid var(--pl-cyto);
  background: transparent; font-size: 15px;
}
.lab-split-images { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ===== STATISTICS ===== */
.statistics-page { padding: 0; }
.statistics-shell { display: flex; flex-direction: column; gap: 20px; }
.statistics-hero { margin-bottom: 4px; }
.statistics-title { font-size: 18px; font-weight: 800; }
.statistics-subtitle { font-size: 13px; color: var(--pl-muted); margin-top: 2px; }
.statistics-module-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.statistics-module-btn {
  padding: 7px 12px; border: 1px solid var(--pl-border); border-radius: 8px;
  background: #fff; color: var(--pl-muted); font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: var(--pl-font);
}
.statistics-module-btn.active {
  background: var(--pl-blue); color: #fff; border-color: var(--pl-blue);
  box-shadow: 0 8px 18px rgba(124, 58, 237, 0.18);
}
.statistics-chart-card, .statistics-grid-2 > div {
  background: #fff; border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius); box-shadow: var(--pl-shadow); overflow: hidden;
}
.statistics-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .statistics-grid-2 { grid-template-columns: 1fr; } }
.statistics-chart-head { padding: 16px 18px; border-bottom: 1px solid var(--pl-border-soft); }
.statistics-chart-body { padding: 16px 18px; min-height: 80px; }
.flow-range-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.flow-range-btn {
  padding: 6px 12px; border: 1px solid var(--pl-border); border-radius: 8px;
  background: #fff; font-size: 12px; font-weight: 600; cursor: pointer; font-family: var(--pl-font);
}
.flow-range-btn.active { background: var(--pl-blue); color: #fff; border-color: var(--pl-blue); }
.flow-date-input { padding: 6px 10px; border: 1px solid var(--pl-border); border-radius: 8px; font-size: 12px; }
.flow-apply-btn { padding: 6px 14px; background: var(--pl-blue); color: #fff; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; }
.ranking-list { display: flex; flex-direction: column; gap: 10px; }
.ranking-item { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.ranking-bar { height: 8px; background: #ede9fe; border-radius: 999px; overflow: hidden; grid-column: 1 / -1; }
.ranking-bar > div { height: 100%; background: var(--pl-blue); border-radius: 999px; }

/* ===== FINANCE ===== */
.page.finance-wide-page,
main.page.finance-wide-page {
  width: 100%;
  max-width: none;
}
#finance-page {
  width: 100%;
}
.finance-grid {
  display: block;
  width: 100%;
}
.finance-grid > div {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}
.finance-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
}
@media (max-width: 1200px) {
  .finance-summary { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
}
@media (max-width: 760px) {
  .finance-summary { grid-template-columns: 1fr; }
}
.finance-summary-card {
  padding: 12px; background: #fff; border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius); box-shadow: var(--pl-shadow);
}
.finance-summary-card span { font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--pl-muted); }
.finance-summary-card strong { display: block; font-size: 16px; margin-top: 4px; font-family: var(--pl-mono); }
.finance-income strong { color: var(--pl-success); }
.finance-expense strong { color: var(--pl-danger); }
.finance-main-card {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius);
  overflow: hidden;
}
.finance-filters {
  padding: 14px 16px;
  border-bottom: 1px solid var(--pl-border-soft);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}
.finance-filters > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.finance-filters label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--pl-muted);
}
.finance-filters input,
.finance-filters select {
  height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--pl-border);
  border-radius: 8px;
  background: #fff;
  font-family: var(--pl-font);
  font-size: 12px;
}
.finance-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.finance-table-wrap .data-table {
  min-width: 980px;
}
.finance-table-wrap .data-table th,
.finance-table-wrap .data-table td {
  white-space: nowrap;
}
.finance-table-wrap .data-table th:nth-child(5),
.finance-table-wrap .data-table td:nth-child(5),
.finance-table-wrap .data-table th:nth-child(8),
.finance-table-wrap .data-table td:nth-child(8) {
  white-space: normal;
  min-width: 150px;
}
.finance-modal {
  display: none; position: fixed; inset: 0; z-index: 9990;
  background: rgba(15,23,42,.45); align-items: center; justify-content: center;
}
.finance-modal.open { display: flex; }
.finance-modal-box {
  background: #fff; border-radius: var(--pl-radius);
  width: min(760px, 94vw); max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.2);
}
.finance-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px; border-bottom: 1px solid var(--pl-border-soft);
}
.finance-form { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.finance-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.finance-wide { grid-column: 1 / -1; }
.finance-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--pl-muted);
}
.finance-form input,
.finance-form select {
  width: 100%;
  height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--pl-border);
  border-radius: 8px;
  background: #fff;
  color: var(--pl-text);
  font-family: var(--pl-font);
  font-size: 13px;
}
.finance-form input:focus,
.finance-form select:focus,
.finance-filters input:focus,
.finance-filters select:focus {
  outline: none;
  border-color: var(--pl-blue);
  box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}
.finance-total-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--pl-border);
  border-radius: 10px;
  background: #f8fafc;
}
.finance-total-preview span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--pl-muted);
}
.finance-total-preview strong {
  font-family: var(--pl-mono);
  font-size: 17px;
  color: var(--pl-text);
}
.finance-modal-actions { padding: 14px 20px; border-top: 1px solid var(--pl-border-soft); display: flex; justify-content: flex-end; gap: 10px; }
@media (max-width: 640px) {
  .finance-form-grid { grid-template-columns: 1fr; }
  .finance-wide { grid-column: auto; }
  .finance-modal-actions { flex-direction: column-reverse; }
  .finance-modal-actions .btn { width: 100%; justify-content: center; }
}

/* ===== PREVIEW / PRINT DOCUMENT (bemor kartasi) ===== */
#step-4.card { overflow: visible; }
#step-4 > .card-body { overflow: visible; padding: 16px 20px 24px; }

#step-4 .top-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding: 16px 20px; background: #fff;
  border: 1px solid var(--pl-border); border-radius: var(--pl-radius);
  margin-bottom: 16px; box-shadow: var(--pl-shadow);
}
#step-4 .doc-wrapper.report {
  width: min(100%, 185mm);
  max-width: 185mm;
  margin: 0 auto;
  padding: 0;
  background: #fff;
  border: none;
  border-radius: 0;
  box-shadow: none;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  line-height: 1.3;
  color: #111827;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
#step-4.histology-print .doc-wrapper.report { width: min(100%, 185mm); max-width: 185mm; }

#step-4 .clinic-header {
  display: grid;
  grid-template-columns: 1fr 140px 1fr;
  gap: 16px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 2px solid #000;
  margin-bottom: 10px;
}
#step-4 .clinic-col-left {
  font-size: 11px;
  line-height: 1.6;
  text-align: left;
}
#step-4 .clinic-col-left strong { display: block; font-size: 12px; font-weight: 700; }
#step-4 .clinic-col-left span { display: block; }
#step-4 .clinic-col-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
#step-4 .clinic-col-center img,
#step-4 .clinic-logo {
  width: 115px; height: 115px;
  display: block; object-fit: contain; margin: 0 auto;
}
#step-4 .clinic-col-right {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  text-align: right;
}
#step-4 .clinic-col-right .clinic-header-line {
  display: block;
}
#step-4.ipsum-print .clinic-header {
  grid-template-columns: 1fr 150px 1fr;
}
#step-4.ipsum-print .clinic-col-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 135px;
  font-size: 14px;
  line-height: 1.25;
  gap: 1px;
}
#step-4.ipsum-print .clinic-col-left strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}
#step-4.ipsum-print .clinic-col-center img,
#step-4.ipsum-print .clinic-logo {
  width: 135px;
  height: 135px;
}
#step-4.ipsum-print .clinic-col-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 135px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-align: right;
}
#step-4.ipsum-print .clinic-col-right .clinic-header-line {
  display: block;
}
#step-4.ipsum-print .ipsum-lab-title,
.ipsum-report .ipsum-lab-title {
  margin: 0 0 8px;
  color: var(--pl-blue, #7c3aed);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.02em;
}
#step-4 .clinic-license { font-size: 9.5px; text-align: center; margin-bottom: 4px; }
#step-4 .clinic-contact { font-size: 9.5px; text-align: center; line-height: 1.6; margin-bottom: 10px; }

#step-4 .report-title-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid #d1d5db;
}
#step-4 .report-title-row > div:first-child { min-width: 0; flex: 1 1 auto; }
#step-4 .report-title { font-size: 16px; font-weight: 700; color: #111827; }
#step-4 #p-reportSubtitle { font-size: 12px !important; color: #6b7280 !important; margin-top: 2px; }
#step-4 .report-meta {
  font-size: 12px; color: #111827; text-align: right; line-height: 1.8; font-weight: 500;
  flex: 0 0 auto; white-space: nowrap;
}
#step-4 #p-caseNumber { color: #dc2626; font-weight: 700; }

#step-4 .report-section { margin-bottom: 16px; break-inside: avoid; page-break-inside: avoid; }
#step-4 .report-section-title,
#step-4 .report-box-header {
  font-size: 12px; font-weight: 600; color: #111827;
  margin-bottom: 0; padding: 7px 12px;
  background: #ede9fe;
  border: 1.5px solid #111;
  border-radius: 4px 4px 0 0;
}
#step-4 .report-box {
  border: 1.5px solid #111;
  border-radius: 4px;
  overflow: visible;
}
#step-4 .report-box-header {
  border: 0;
  border-bottom: 1.5px solid #111;
  border-radius: 0;
}
#step-4 .report-table { width: 100%; border-collapse: collapse; font-size: 12.5px; table-layout: fixed; }
#step-4 .report-table tr { border-bottom: 1px solid #ddd6fe; }
#step-4 .report-table td {
  padding: 5px 10px; font-weight: 600; color: #1a1a1a;
  border: 1px solid #ddd6fe;
  word-break: break-word; overflow-wrap: anywhere;
}
#step-4 .report-table td:first-child { width: 40%; font-size: 12px; }
#step-4 .report-box-body {
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 240px);
  gap: 12px;
  align-items: start;
  border: none;
}
#step-4 .report-box-text {
  min-width: 0;
  font-size: 13px; line-height: 1.7; white-space: pre-wrap;
}
#step-4 .report-box-image,
#step-4 #p-macroImgWrapper,
#step-4 #p-microImgWrapper,
#step-4 #p-microImgWrapper2 {
  min-width: 0;
  justify-self: end;
  width: 100%;
  max-width: 240px;
}
#step-4 .report-box-image img,
#step-4 #p-macroImg, #step-4 #p-microImg, #step-4 #p-microImg2 {
  width: 100%;
  max-width: 240px;
  height: 220px;
  border-radius: 3px; border: 1px solid #111;
  object-fit: contain; background: #fff; display: block;
}
#step-4 .conclusion-box {
  background: #fff;
  border-left: 3px solid #111;
  border-top: 1.5px solid #111;
  border-right: 1.5px solid #111;
  border-bottom: 1.5px solid #111;
  border-radius: 0 4px 4px 4px;
  padding: 12px 14px;
  font-size: 13px; line-height: 1.75;
  white-space: pre-wrap; color: #111827;
}
#step-4 #p-conclusionSection > div[style] { font-size: 12px !important; line-height: 1.9 !important; color: #111827 !important; }
#step-4 .report-footer-note {
  font-size: 11px; color: #6b7280; font-style: italic; line-height: 1.6;
  padding-top: 10px; margin-top: 10px;
  border-top: 1.5px solid #111; text-align: center;
}
#step-4 .sut-report-images {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; width: 100%;
}
#step-4 .sut-report-images img { width: 100%; height: 220px; object-fit: contain; border: 1px solid #111; background: #fff; }

/* PAP / Sitologiya hujjatlari */
#step-4 .pap-doc-card { border: 1.2px solid #111; border-radius: 4px; overflow: hidden; }
#step-4 .pap-doc-body { padding: 6px 7px 7px; }
#step-4 .pap-mini-section {
  border: 1px solid #ddd6fe; border-radius: 4px; overflow: hidden;
  margin-bottom: 4px; background: #fff;
}
#step-4 .pap-subtitle {
  font-size: 9.2px; font-weight: 800; color: #0f3b66;
  background: #eaf2fb; padding: 4px 6px; text-transform: uppercase;
  border-bottom: 1px solid #ddd6fe;
}
#step-4 .pap-mini-body { padding: 4px 5px; }
#step-4 .pap-report-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #d8e7f7; border-bottom: 0; border-right: 0;
}
#step-4 .pap-report-line,
#step-4 .pap-check-item {
  font-size: 9px; line-height: 1.16; padding: 3px 5px; min-height: 18px;
  border-right: 1px solid #d8e7f7; border-bottom: 1px solid #d8e7f7;
}
#step-4 .pap-check-item { display: flex; gap: 5px; align-items: flex-start; }
#step-4 .pap-check-item span { font-weight: 800; color: #0f3b66; }
#step-4 .pap-text-block {
  border: 1.3px solid #111; border-radius: 3px;
  min-height: 34px; padding: 7px 8px;
  font-size: 10.2px; line-height: 1.38; white-space: pre-wrap;
}
#step-4 .pap-sign-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  margin-top: 8px; font-size: 10.2px;
}

/* TIS / Bethesda ma'lumot sahifalari */
#step-4 .tis-info-page .report-box { width: 100%; max-width: 184mm; margin: 0 auto; }
#step-4 .tis-info-page .report-box-body { display: block; padding: 12px; }
#step-4 .tis-info-table { width: 100%; table-layout: fixed; font-size: 12.8px; line-height: 1.38; border: 1.5px solid #c4b5fd !important; }
#step-4 .tis-info-table td { padding: 8px 10px; vertical-align: top; border: 1px solid #c4b5fd; overflow-wrap: break-word; word-break: normal; hyphens: auto; }
#step-4 .tis-info-table td:nth-child(1) { width: 18%; }
#step-4 .tis-info-table td:nth-child(2) { width: 24%; }
#step-4 .tis-info-table td:nth-child(3) { width: 35%; }
#step-4 .tis-info-table td:nth-child(4) { width: 23%; }
#step-4 .tis-info-table tr:first-child td { background: #f8fbff; color: #0f3b66; }
#step-4 .bethesda-info-card {
  max-width: 178mm; margin: 0 auto;
  border: 1.5px solid #c4b5fd; border-radius: 6px;
  padding: 12mm 13mm; background: #fff;
}
#step-4 .bethesda-info-title { font-size: 17px; font-weight: 800; color: #2563a6; margin-bottom: 8mm; }
#step-4 .bethesda-info-item { margin-bottom: 6mm; }
#step-4 .bethesda-info-item h4 { font-size: 13.2px; line-height: 1.35; color: #3b73b9; margin: 0 0 2mm; }
#step-4 .bethesda-info-item li { font-size: 11.5px; line-height: 1.35; margin: 1.2mm 0; }

#step-4 .signature-row { margin-top: 24px; }

#step-4.ipsum-print .doc-wrapper.report {
  width: min(100%, 185mm);
  max-width: 185mm;
  padding: 0;
  border: 0;
  box-shadow: none;
  color: #111827;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  line-height: 1.3;
  background: #fff;
}
.ipsum-report { font-size: 15px; line-height: 1.22; }
.ipsum-report .ipsum-patient-table {
  width: 90%;
  margin: 4px auto;
}
.ipsum-report .ipsum-patient-table td { padding: 2px 12px; }
.ipsum-report .ipsum-metric-table,
.ipsum-report .ipsum-johnsen-table {
  width: 90%;
  margin: 4px auto;
}
.ipsum-patient-table {
  width: 100%; border-collapse: collapse; border: 1.5px solid #000; margin: 4px 0; font-size: 14px;
}
.ipsum-patient-table td { padding: 2px 12px; vertical-align: top; }
.ipsum-patient-table td:first-child { width: 43%; }
.reg-patogenez-card-wrap { position: relative; margin-bottom: 20px; }
.reg-patogenez-order-note {
  text-align: right; font-size: 11px; margin-bottom: 4px; color: #333; line-height: 1.2;
}
.reg-patogenez-patient-table input.reg-patogenez-input,
.reg-patogenez-patient-table select.reg-patogenez-input {
  width: 100%; border: none; background: transparent; padding: 0; font: inherit;
  outline: none; min-height: 22px; box-shadow: none;
}
.reg-patogenez-patient-table td { vertical-align: middle; }
.reg-patogenez-patient-table #pg-mount-doctor { position: relative; min-width: 0; }
.reg-patogenez-patient-table #doctorSearch.reg-patogenez-input { width: 100%; cursor: pointer; }
.reg-patogenez-age-hint { margin-left: 6px; font-size: 14px; white-space: nowrap; }
.reg-patogenez-extra {
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--pl-border, #e5e7eb);
}
.reg-patogenez-patient-table.readonly td:last-child { font-weight: 500; }
#patogenez-sidebar-card .reg-patogenez-order-note { font-size: 9px; margin-bottom: 6px; }
#patogenez-sidebar-card .ipsum-patient-table { font-size: 11.5px; margin-bottom: 12px; }
#patogenez-sidebar-card .ipsum-patient-table td { padding: 3px 8px; }
.ipsum-report h3 { margin: 4px 0 1px; font-size: 16px; font-weight: 900; }
.ipsum-text { font-size: 14px; line-height: 1.18; white-space: pre-wrap; text-align: justify; }
.ipsum-page-section {
  min-height: 281mm;
  display: flex;
  flex-direction: column;
}
.ipsum-page-section-first {
  min-height: 0;
  display: block;
}
.ipsum-page-section-first .ipsum-page-footer {
  margin-top: 8px;
  padding-top: 8px;
}
.ipsum-page-section-first .clinic-header {
  padding-bottom: 10px;
  margin-bottom: 6px;
}
.ipsum-page-section-first .clinic-license,
.ipsum-page-section-first .clinic-contact {
  margin-bottom: 3px;
}
.ipsum-page-section-first .ipsum-lab-title {
  margin-bottom: 6px;
}
.ipsum-page-section-first h3 {
  margin: 2px 0 1px;
}
.ipsum-page-section-first .ipsum-text {
  margin-bottom: 2px;
}
.ipsum-micro-block {
  overflow: hidden;
  margin: 2px 0;
}
.ipsum-micro-block .ipsum-micro-img {
  float: right;
  width: 260px;
  height: 185px;
  object-fit: cover;
  display: block;
  margin: 0 0 6px 10px;
}
.ipsum-page-section-first .ipsum-metric-table {
  margin-top: 2px;
}
.ipsum-page-section-first .ipsum-metric-table th,
.ipsum-page-section-first .ipsum-metric-table td {
  padding: 1px 5px;
  font-size: 11px;
  line-height: 1.1;
}
.ipsum-micro-img { width: 330px; height: 230px; object-fit: cover; display: block; margin: 4px 0 4px 8px; }
.ipsum-metric-table, .ipsum-johnsen-table { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: 4px; }
.ipsum-metric-table th, .ipsum-metric-table td, .ipsum-johnsen-table td {
  border: 1px solid #e7a3a3; padding: 2px 6px; vertical-align: middle; font-size: 12px; line-height: 1.12;
}
.ipsum-metric-table th { text-align: center; font-size: 12px; font-weight: 800; }
.ipsum-metric-table td:nth-child(1) { width: 36%; font-weight: 800; }
.ipsum-metric-table td:nth-child(2) { width: 20%; text-align: center; }
.ipsum-metric-table td:nth-child(3) { width: 22%; text-align: center; }
.ipsum-metric-table td:nth-child(4) { width: 22%; text-align: center; }
.ipsum-page-break { break-before: page; page-break-before: always; height: 0; }
.ipsum-red-title { color: var(--pl-blue, #7c3aed); text-align: center; margin: 8px 0 6px !important; font-weight: 900; font-size: 13px; }
.ipsum-johnsen-table td:first-child { width: 60px; text-align: center; font-size: 19px; font-weight: 900; }
.ipsum-johnsen-table td:nth-child(2) { text-align: center; font-size: 14px; line-height: 1.08; }
.ipsum-conclusion { font-size: 16px; line-height: 1.2; white-space: pre-wrap; }
.ipsum-page-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 245px;
  gap: 18px;
  align-items: end;
  margin-top: auto;
  padding-top: 12px;
  break-inside: avoid;
  page-break-inside: avoid;
}
.ipsum-footer-note {
  max-width: 520px;
  margin-left: auto;
  font-size: 10px;
  line-height: 1.15;
}
.ipsum-sign {
  width: 245px; min-height: 74px; border: 2px solid #777; margin: 0 0 0 auto;
  text-align: center; padding: 8px; font-size: 14px;
}
/* ===== ZOOM MODAL ===== */
.zoom-modal {
  display: none; position: fixed; inset: 0; z-index: 9995;
  background: rgba(0,0,0,.85); align-items: center; justify-content: center;
  cursor: zoom-out;
}
.zoom-modal img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }

/* ===== BADGES ===== */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-orange { background: #fffbeb; color: var(--pl-warn); }
.badge-blue { background: #ede9fe; color: var(--pl-blue); }
.badge-green { background: #ecfdf5; color: var(--pl-success); }

@media (max-width: 1100px) {
  .pl-login-brand { display: none; }
  .pl-login-panel { width: 100%; max-width: none; }
  .pro-sidebar { width: 72px; }
  .pro-sidebar-logo span, .pro-nav-item span:not(.pro-nav-badge), .pl-sidebar-stats, .pl-sidebar-help { display: none; }
  .pro-nav-item { justify-content: center; padding: 12px; }
}

/* ===== VARIANT 3 EXTRAS ===== */
.dash-alert-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; }
.dash-alert-icon.red svg { color: var(--pl-danger); }
.dash-alert-icon.amber svg { color: var(--pl-warn); }
.dash-alert-icon.blue svg { color: var(--pl-blue); }
.dash-alert-chevron { font-size: 10px; color: var(--pl-muted); }

.pl-meta-item { display: inline-flex; gap: 6px; align-items: baseline; }
.pl-meta-k {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: var(--pl-muted);
}
.pro-empty-icon { color: var(--pl-muted); opacity: .45; margin-bottom: 4px; }
.pl-icon-btn { padding: 5px 8px; }
.pl-icon-btn svg { display: block; }

.ws-header-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}

.pro-upload-zone-icon svg { width: 32px; height: 32px; stroke: #c4b5fd; fill: none; }
.file-upload-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pl-file-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 12px; border-radius: 8px;
  background: var(--pl-blue);
  color: #fff; font-size: 11px; font-weight: 700;
  cursor: pointer; font-family: var(--pl-font);
}
body.module-cytology .pl-file-btn {
  background: var(--pl-cyto);
}
body.module-ipsum .pl-file-btn {
  background: #dc2626;
}
body.module-ipsum .pl-file-btn:hover {
  filter: brightness(1.05);
}
.pl-file-input {
  position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden;
}
.ws-copy-btn {
  border: none; background: #f1f5f9; border-radius: 6px;
  padding: 4px 6px; cursor: pointer; vertical-align: middle; margin-left: 6px;
}
.ws-copy-btn svg { stroke: var(--pl-muted); }

.stats-export-btn {
  padding: 6px 12px; border: 1px solid var(--pl-border);
  border-radius: 8px; background: #fff; font-size: 11px;
  font-weight: 700; color: var(--pl-navy); cursor: pointer; font-family: var(--pl-font);
}
.stats-export-btn:hover { background: #f8fafc; }

#tgModal {
  display: none; position: fixed; inset: 0; z-index: 9990;
  background: rgba(15,23,42,.45); align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.tg-modal-box {
  background: #fff; border-radius: var(--pl-radius);
  width: min(480px, 94vw); max-height: 90vh; overflow-y: auto;
  padding: 24px; box-shadow: 0 24px 64px rgba(0,0,0,.2);
  border: 1px solid var(--pl-border);
}
.tg-modal-box h3 { font-size: 18px; font-weight: 800; margin-bottom: 16px; }
.tg-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.tg-link-wrap {
  font-family: var(--pl-mono); font-size: 12px; word-break: break-all;
  background: #f8fafc; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--pl-border);
}

#settingsModal,
.settings-modal {
  position: fixed; inset: 0; z-index: 9999;
  align-items: center; justify-content: center;
  background: rgba(39,13,32,.52) !important;
  backdrop-filter: blur(4px);
  padding: 18px;
}
.settings-dialog {
  width: min(980px, 96vw);
  max-height: 92vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 14px;
  box-shadow: 0 28px 80px rgba(29,8,23,.32);
}
.settings-rail {
  background: linear-gradient(180deg, #3b0764 0%, #4c1d95 100%);
  color: #fff;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.settings-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 4px 18px;
  border-bottom: 1px solid rgba(255,255,255,.14);
  margin-bottom: 6px;
}
.settings-brand-mark {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #000; color: #6d28d9;
  border: 2px solid #c4b5fd;
  overflow: hidden;
  padding: 2px;
}
.settings-brand strong { display: block; font-size: 14px; line-height: 1.2; }
.settings-brand span { display: block; font-size: 11px; color: #cbd5e1; margin-top: 2px; }
.settings-tab {
  display: flex; align-items: center; gap: 10px;
  width: 100%; border: 1px solid transparent;
  background: transparent; color: #94a3b8;
  padding: 10px; border-radius: 10px;
  cursor: pointer; font-family: var(--pl-font);
  text-align: left;
}
.settings-tab:hover { background: rgba(255,255,255,.08); color: #fff; }
.settings-tab.active {
  background: #fff;
  color: #4c1d95;
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
}
.settings-tab-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  background: rgba(255,255,255,.12);
  font-size: 10px; font-weight: 800;
}
.settings-tab.active .settings-tab-icon { background: #ede9fe; color: #7c3aed; }
.settings-tab b { display: block; font-size: 13px; }
.settings-tab small { display: block; font-size: 10.5px; line-height: 1.3; opacity: .78; margin-top: 1px; }
.settings-content {
  min-width: 0;
  padding: 20px;
  overflow-y: auto;
  background: #ffffff;
}
.settings-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.settings-header h3 { margin: 0; font-size: 20px; font-weight: 800; color: var(--pl-text); }
.settings-header p { margin: 3px 0 0; font-size: 12px; color: var(--pl-muted); }
.settings-panel { display: flex; flex-direction: column; gap: 14px; }
.settings-card,
.settings-bot-card,
.settings-list-head,
.settings-list {
  background: #fff;
  border: 1px solid var(--pl-border);
  border-radius: 10px;
  box-shadow: var(--pl-shadow);
}
.settings-card { padding: 14px; }
.settings-card-title {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--pl-navy);
  margin-bottom: 10px;
}
.settings-form-row {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.settings-form-row input,
.settings-list-head input {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--pl-border);
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--pl-font);
  outline: none;
}
.settings-form-row input { flex: 1 1 180px; }
.settings-form-row input:focus,
.settings-list-head input:focus {
  border-color: var(--pl-blue);
  box-shadow: 0 0 0 3px rgba(176,40,120,.1);
}
.settings-bot-card {
  padding: 14px;
  background: #ede9fe;
  border-color: #ddd6fe;
}
.settings-bot-card small,
.settings-list-head small,
.settings-hint {
  color: var(--pl-muted);
  font-size: 11px;
}
.settings-link-row {
  display: flex; align-items: center; gap: 8px;
}
#settings-bot-link-text {
  flex: 1;
  min-width: 0;
  font-family: var(--pl-mono);
  font-size: 12px;
  word-break: break-all;
  background: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #ddd6fe;
}
.settings-list-head {
  padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.settings-list-head .settings-card-title { margin-bottom: 2px; }
.settings-list-head input { width: min(280px, 100%); }
.settings-list {
  min-height: 64px;
  max-height: 360px;
  overflow-y: auto;
}
.settings-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--pl-border-soft);
  font-size: 13px;
}
.settings-list-row:last-child { border-bottom: 0; }
.settings-list-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}
.settings-finance-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.finance-category-settings-list {
  margin-top: 12px;
  max-height: calc(100vh - 340px);
}
@media (max-width: 900px) {
  .settings-finance-category-grid { grid-template-columns: 1fr; }
}
.settings-empty {
  color: var(--pl-muted);
  font-size: 13px;
  text-align: center;
  padding: 20px;
}
.settings-import-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 12px;
  border-radius: 8px;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: var(--pl-success);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.pl-modal-close {
  background: #f1f5f9; border: none; width: 32px; height: 32px;
  border-radius: 8px; font-size: 20px; line-height: 1;
  cursor: pointer; color: var(--pl-muted);
}
.pl-modal-close:hover { background: #ede9fe; color: var(--pl-blue); }

@media (max-width: 760px) {
  .settings-dialog { grid-template-columns: 1fr; }
  .settings-rail { flex-direction: row; overflow-x: auto; }
  .settings-brand { min-width: 190px; padding-bottom: 4px; margin-bottom: 0; border-bottom: 0; }
  .settings-tab { min-width: 180px; }
  .settings-content { padding: 14px; }
}

.pl-status-ok { color: var(--pl-success); font-weight: 600; }
.pl-status-no { color: var(--pl-danger); font-weight: 600; }
.pl-status-wait { color: var(--pl-warn); font-weight: 600; }
.pl-status-muted { color: var(--pl-muted); font-weight: 600; }

.upload-zone-label {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--pl-muted); margin-bottom: 8px;
}


.pro-topbar-left-brand { display: flex; align-items: center; gap: 8px; }
.pro-topbar-brand-kicker { font-size: 14px; font-weight: 800; color: #4c1d95; letter-spacing: -0.01em; }
