/* ─── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --sidebar-bg: #0f172a;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-active-bg: #1d4ed8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

/* ─── Base ──────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  overflow: hidden;
}
a { text-decoration: none; color: inherit; }
.text-primary { color: var(--primary) !important; }

/* ─── App Layout ────────────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  transition: all 0.3s ease;
  overflow: hidden;
  z-index: 100;
}
.sidebar.collapsed {
  width: 64px;
  min-width: 64px;
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  font-weight: 700;
  font-size: 18px;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-logo i {
  font-size: 22px;
  color: #60a5fa;
  min-width: 24px;
}
.sidebar-logo-img {
  width: 44px;
  height: 44px;
  min-width: 44px;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  padding: 4px;
}
.sidebar.collapsed .sidebar-logo span { display: none; }
.sidebar.collapsed .sidebar-logo { justify-content: center; }
.sidebar.collapsed .sidebar-logo-img {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 9px;
  padding: 3px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.nav-section-label {
  color: rgba(255,255,255,0.35);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 8px 12px 4px;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
  margin-bottom: 2px;
}
.nav-item i {
  font-size: 16px;
  min-width: 20px;
  text-align: center;
}
.nav-item:hover {
  background: var(--sidebar-hover);
  color: white;
}
.nav-item.active {
  background: var(--sidebar-active-bg);
  color: white;
}
.sidebar.collapsed .nav-item span { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  overflow: hidden;
}
.user-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  font-size: 18px;
}
.user-details { overflow: hidden; }
.user-name {
  color: white;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  color: rgba(255,255,255,0.4);
  font-size: 11px;
}
.sidebar.collapsed .user-details,
.sidebar.collapsed .btn-logout { display: none; }

.btn-logout {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}
.btn-logout:hover { color: #ef4444; background: rgba(239,68,68,0.1); }

/* ─── Main Content ──────────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ─── Top Bar ───────────────────────────────────────────────────────────────── */
.top-bar {
  height: var(--topbar-height);
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  box-shadow: var(--shadow);
  z-index: 50;
}
.top-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.sidebar-toggle {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}
.sidebar-toggle:hover { background: var(--bg); color: var(--text); }

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.server-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}
.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--danger); }

.top-date {
  font-size: 13px;
  color: var(--text-muted);
}

/* ─── Ish smenasi tugmasi ─────────────────────────────────────────────────── */
.work-shift-widget {
  display: flex;
  align-items: center;
  gap: 10px;
}
.work-shift-widget .shift-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.work-shift-widget .shift-timer i {
  font-size: 8px;
}
.work-shift-widget .btn {
  white-space: nowrap;
  font-weight: 600;
}

.btn-refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-refresh:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-refresh.spinning i {
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Page Container ────────────────────────────────────────────────────────── */
.page-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.page-container::-webkit-scrollbar { width: 6px; }
.page-container::-webkit-scrollbar-track { background: transparent; }
.page-container::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
}

/* ─── Login Page ────────────────────────────────────────────────────────────── */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 40%, #0ea5e9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.logo-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: white;
  margin: 0 auto 16px;
}
.login-logo-img {
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0 auto;
  display: block;
}
.login-logo h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}
.login-logo p {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

/* ─── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  font-weight: 600;
}

/* ─── Stats Cards ───────────────────────────────────────────────────────────── */
.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.stat-icon.blue { background: #eff6ff; color: #2563eb; }
.stat-icon.green { background: #f0fdf4; color: #10b981; }
.stat-icon.yellow { background: #fffbeb; color: #f59e0b; }
.stat-icon.red { background: #fef2f2; color: #ef4444; }
.stat-icon.purple { background: #faf5ff; color: #8b5cf6; }

.stat-info { flex: 1; }
.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Tables ────────────────────────────────────────────────────────────────── */
.table-card {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}
.table-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.table { margin-bottom: 0; }
.table thead th {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  white-space: nowrap;
}
.table tbody td {
  padding: 13px 16px;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f8fafc; }

/* ─── Badges ────────────────────────────────────────────────────────────────── */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.badge-success { background: #f0fdf4; color: #15803d; }
.badge-warning { background: #fffbeb; color: #b45309; }
.badge-danger { background: #fef2f2; color: #b91c1c; }
.badge-info { background: #eff6ff; color: #1d4ed8; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.btn { font-size: 14px; font-weight: 500; border-radius: 8px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-sm { font-size: 12px; padding: 4px 10px; }
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 14px;
}

/* ─── Search Box ────────────────────────────────────────────────────────────── */
.search-box {
  position: relative;
}
.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}
.search-box input {
  padding-left: 36px;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  width: 240px;
}
.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

/* ─── Forms ─────────────────────────────────────────────────────────────────── */
.form-label { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.form-control, .form-select {
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  transition: all 0.2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.input-group .form-control:focus { z-index: 3; }
.input-group-text { background: #f8fafc; border-color: var(--border); color: var(--text-muted); }

/* ─── Empty State ───────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; color: #cbd5e1; }
.empty-state h5 { color: #94a3b8; font-weight: 500; margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin: 0; }

/* ─── Patient Card ──────────────────────────────────────────────────────────── */
.patient-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: #4338ca;
}

/* ─── Photo Upload ──────────────────────────────────────────────────────────── */
.photo-upload-area {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #f8fafc;
}
.photo-upload-area:hover { border-color: var(--primary); background: var(--primary-light); }
.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.photo-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(239,68,68,0.9);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Queue Item ────────────────────────────────────────────────────────────── */
.queue-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}
.queue-item:last-child { border-bottom: none; }
.queue-item:hover { background: #f8fafc; }
.queue-number {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}
.queue-time {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 50px;
}

/* ─── Billing ───────────────────────────────────────────────────────────────── */
.billing-summary {
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
  border-radius: 12px;
  padding: 24px;
  color: white;
  position: relative;
  overflow: hidden;
}
.billing-summary::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 150px;
  height: 150px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

/* ─── Pagination ────────────────────────────────────────────────────────────── */
.pagination .page-link {
  font-size: 13px;
  padding: 6px 12px;
  color: var(--text-muted);
  border-color: var(--border);
}
.pagination .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
}

/* ─── Utilities ─────────────────────────────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }
.hover-text-primary:hover { color: var(--primary) !important; }
.fw-semibold { font-weight: 600; }
.gap-1 { gap: 4px; }
.rounded-pill { border-radius: 50rem !important; }

/* ─── Animate ───────────────────────────────────────────────────────────────── */
.fade-in {
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ─── Toast ─────────────────────────────────────────────────────────────────── */
.toast {
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  min-width: 280px;
}
.toast-success { border-left: 4px solid var(--success) !important; }
.toast-danger { border-left: 4px solid var(--danger) !important; }
.toast-warning { border-left: 4px solid var(--warning) !important; }
.toast-info { border-left: 4px solid var(--primary) !important; }

/* ─── Modal ─────────────────────────────────────────────────────────────────── */
.modal-content { border: none; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal-header { border-radius: 14px 14px 0 0; }
.modal-lg { max-width: 700px; }
.modal-xl { max-width: 900px; }

/* ─── Date Picker ───────────────────────────────────────────────────────────── */
input[type="date"], input[type="datetime-local"] {
  color: var(--text);
}

/* ─── Queue Filter Chips ────────────────────────────────────────────────────── */
.queue-filter-bar {
  padding: 8px 16px 6px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}
.queue-filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 30px;
}
.queue-filter-row + .queue-filter-row {
  margin-top: 6px;
}
.filter-row-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .6px;
  color: #94a3b8;
  min-width: 90px;
  text-transform: uppercase;
}
.queue-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1.5px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s, background .15s, color .15s;
  line-height: 1.5;
}
.queue-chip:hover {
  border-color: #6366f1;
  color: #4f46e5;
}
.queue-chip.active {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}
.queue-chip .chip-cnt {
  font-size: 11px;
  opacity: .85;
  font-weight: 600;
}

/* Navbatga qo'shish */
.add-queue-shell {
  width: 100%;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}
.add-queue-page {
  margin-top: -24px;
  margin-left: -24px;
  margin-right: -24px;
}
.add-queue-header {
  align-items: center;
}
.add-queue-form-wrap {
  padding: 16px;
}
.add-queue-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
}
.quick-select-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
  max-height: 214px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}
.quick-select-list-compact {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  max-height: 170px;
}
.quick-select-item {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.quick-select-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, .14);
}
.quick-select-item.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.quick-select-name {
  min-width: 0;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.quick-select-meta {
  flex-shrink: 0;
  color: #047857;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.quick-select-empty {
  grid-column: 1 / -1;
  padding: 12px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* Add-queue: bo'limlar orasidagi masofa */
.add-queue-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Qabul turi / Doctor: gorizontal grid (3-4 ustun), scrollsiz — barcha element ko'rinadi */
.quick-select-grid {
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 6px;
  max-height: none;
  overflow: visible;
  padding: 6px;
}
.quick-select-grid .quick-select-item {
  min-height: 0;
  padding: 6px 10px;
}
.quick-select-grid .quick-select-name {
  font-size: 12.5px;
  font-weight: 600;
}
.quick-select-grid .quick-select-meta {
  font-size: 11.5px;
}

/* Ko'rik turlari: ikki qatorli gorizontal ro'yxat */
.queue-subtypes-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px;
  overflow-x: visible;
  overflow-y: visible;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}
.queue-payment-details-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: stretch;
}
.queue-payment-details-row:has(.queue-payment-col[style*="display:none"]),
.queue-payment-details-row:has(.queue-payment-col[style*="display: none"]) {
  grid-template-columns: 1fr;
}
.queue-payment-col {
  min-width: 0;
  min-height: 238px;
}
.queue-side-fields {
  min-height: 238px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.queue-description-field {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.queue-description-field textarea {
  flex: 1 1 auto;
  min-height: 86px;
  resize: vertical;
}
.queue-subtype-item {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.queue-subtype-item:hover {
  border-color: #f59e0b;
}
.queue-subtype-name {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.queue-subtype-price {
  flex-shrink: 0;
  color: #047857;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 992px) {
  .queue-payment-details-row {
    flex-direction: column;
    display: flex;
  }
  .queue-payment-col,
  .queue-side-fields {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .add-queue-form-wrap {
    padding: 12px;
  }
  .add-queue-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 2;
  }
  .quick-select-list,
  .quick-select-list-compact {
    grid-template-columns: 1fr;
    max-height: 220px;
  }
}

/* ─── Full-Screen Panel ─────────────────────────────────────────────────────── */
@keyframes fullPanelIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fullPanelOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(12px); }
}
/* Full panel ochiq bo'lganda Bootstrap modal va backdrop undan yuqori ko'tariladi */
body:has(#fullPanelOverlay) .modal          { z-index: 100001 !important; }
body:has(#fullPanelOverlay) .modal-backdrop { z-index: 100000 !important; }
/* Full panel ichidagi dori popup ham yuqorida bo'lsin */
#fullPanelOverlay .med-overlay              { z-index: 100002 !important; }

/* ─── Print ─────────────────────────────────────────────────────────────────── */
@media print {
  .sidebar, .top-bar, .no-print { display: none !important; }
  .page-container { padding: 0; overflow: visible; }
}

/* ─── Qidiruv progress bar ──────────────────────────────────────────────────── */
.search-progress {
  position: fixed;
  height: 3px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(37, 99, 235, 0.15);
  z-index: 2000;
  pointer-events: none;
}
.search-progress > span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 2px;
  background: var(--primary);
  animation: search-progress-slide 0.9s infinite ease-in-out;
}
@keyframes search-progress-slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

/* ─── Kutilayotgan navbatlar (Jira-board ko'rinish) ──────────────────────────── */
.pq-board {
  --pq-time-w: 74px;
  --pq-col-w: 220px;
  overflow: auto;
  max-height: calc(100vh - 260px);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
}

.pq-row {
  display: grid;
  grid-template-columns: var(--pq-time-w) repeat(var(--pq-cols), minmax(var(--pq-col-w), 1fr));
  border-bottom: 1px solid var(--border);
}
.pq-row:last-child { border-bottom: none; }

.pq-head-row {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fafc;
}

.pq-head-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  padding: 10px 12px;
  border-left: 1px solid var(--border);
  background: #f8fafc;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.pq-head-cell:first-child { border-left: none; }

.pq-head-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pq-head-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pq-head-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: #e2e8f0;
  border-radius: 10px;
  padding: 1px 8px;
}

.pq-solo-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1;
  padding: 4px 7px;
  cursor: pointer;
  transition: all .15s ease;
}
.pq-solo-btn:hover { color: var(--primary); border-color: var(--primary); }
.pq-solo-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.pq-time-cell {
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10px 6px;
  background: #f8fafc;
  border-right: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.pq-head-row .pq-time-cell { z-index: 4; }

.pq-row-now .pq-time-cell { color: var(--primary); background: var(--primary-light); }
.pq-row-now .pq-cell { background: rgba(37, 99, 235, 0.035); }

.pq-cell {
  position: relative;
  min-height: 52px;
  padding: 6px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: background .12s ease;
}
.pq-cell:hover { background: var(--primary-light); }

.pq-add-btn {
  align-self: flex-start;
  border: 1px dashed #cbd5e1;
  background: transparent;
  color: #94a3b8;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1;
  padding: 5px 9px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s ease, color .12s ease, border-color .12s ease;
}
.pq-cell:hover .pq-add-btn { opacity: 1; }
.pq-add-btn:hover { color: var(--primary); border-color: var(--primary); }

.pq-card {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 7px 8px;
  border: 1px solid #bfdbfe;
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  background: #eff6ff;
  cursor: pointer;
  transition: box-shadow .12s ease, transform .12s ease;
}
.pq-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.pq-card.moved {
  border-color: #bbf7d0;
  border-left-color: var(--success);
  background: #f0fdf4;
  cursor: default;
}

.pq-card-main { flex: 1; min-width: 0; }

.pq-card-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pq-card-phone,
.pq-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pq-card-badge {
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 600;
  color: #047857;
}

.pq-card-actions {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}

.pq-card-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  border-radius: 5px;
  font-size: 11px;
  line-height: 1;
  padding: 3px 5px;
  cursor: pointer;
  transition: all .12s ease;
}
.pq-move-btn:hover { color: var(--primary); background: rgba(37, 99, 235, .12); }
.pq-del-btn:hover  { color: var(--danger);  background: rgba(239, 68, 68, .12); }

/* Doctor filtri (dropdown) */
.pq-doctor-menu { min-width: 260px; }
.pq-doctor-menu-list { max-height: 280px; overflow-y: auto; }
.pq-doctor-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.pq-doctor-menu-item:hover { background: var(--primary-light); }

/* Bemor biriktirish dialogi */
.pq-attach-head { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── Bemor sahifasiga o'tish havolasi ─────────────────────────────────────── */
.patient-link {
  display: inline;
  cursor: pointer;
  font-weight: 600;
  color: inherit;
  border-radius: 6px;
  padding: 1px 4px;
  margin-left: -4px;
  transition: background .15s, color .15s;
}
.patient-link:hover,
.patient-link:focus-visible {
  color: var(--primary);
  background: rgba(37, 99, 235, .08);
}
.patient-link:hover { text-decoration: underline; }

/* Filter panellaridagi "Dan/Gacha" yozuvlari */
.filter-label {
  font-size: 13px;
  white-space: nowrap;
}

/* Kutilayotgan navbat kartochkasidagi yozilgan vaqti */
.pq-card-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
}
.pq-card-time i { font-size: 10px; opacity: .8; }
