/* ============================================================
   Navigator Hub — EndoEstetica
   Design System v8 — Montserrat, Refined Light
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@200;300;400;500;600;700;800;900&family=DM+Mono:wght@400;500&display=swap');

:root {
  /* LIGHT MODE (default) */
  /* Sidebar — ciemna lewa kolumna */
  --navy: #111827;
  --sidebar-bg: #111827;
  --sidebar-active: rgba(255,255,255,.08);
  --sidebar-text: rgba(255,255,255,.45);
  --sidebar-text-active: #ffffff;

  /* Tło aplikacji */
  --bg-main: #f4f6f9;
  --bg-card: #ffffff;
  --bg-hover: #f8fafc;

  /* Akcenty */
  --accent-blue: #4f7fff;
  --accent-blue2: #3d6aff;
  --accent-green: #34c97e;
  --accent-red: #e05252;
  --accent-orange: #f0a843;
  --accent-purple: #8b7ff0;

  /* Tekst */
  --text-primary: #1a2033;
  --text-secondary: #5c6070;
  --text-tertiary: #9196a8;

  /* Bordery */
  --border: #e8eaf0;
  --border2: #d4d8e4;

  /* Wymiary */
  --sidebar-width: 224px;
  --header-height: 64px;
  --border-radius: 14px;
  --border-radius-sm: 9px;
  --shadow: 0 1px 3px rgba(26,32,51,.06), 0 1px 2px rgba(26,32,51,.04);
  --shadow-md: 0 4px 16px rgba(26,32,51,.08);
  --shadow-lg: 0 12px 40px rgba(26,32,51,.12);
  --transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);

  /* Font */
  --font: 'Montserrat', -apple-system, sans-serif;
  --mono: 'DM Mono', monospace;
}

/* DARK MODE */
body.dark-mode {
  --navy: #0f172a;
  --sidebar-bg: #0f172a;
  --sidebar-active: rgba(255,255,255,.12);
  --sidebar-text: rgba(255,255,255,.50);
  --sidebar-text-active: #ffffff;

  /* Tło aplikacji */
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --bg-hover: #334155;

  /* Akcenty */
  --accent-blue: #60a5fa;
  --accent-blue2: #3b82f6;
  --accent-green: #34d399;
  --accent-red: #f87171;
  --accent-orange: #fbbf24;
  --accent-purple: #a78bfa;

  /* Tekst */
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;

  /* Bordery */
  --border: #334155;
  --border2: #475569;

  --shadow: 0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-size: 13px;
}

.sidebar-menu .menu-item {
  font-family: var(--font);
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* ============================================================
   LAYOUT
   ============================================================ */

#app {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  border-right: none;
}

.sidebar-logo {
  display: flex;
  flex-direction: column;
  padding: 24px 20px 20px;
  gap: 3px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.logo-text {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}

.logo-subtext {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,.28);
  font-weight: 500;
}

.sidebar-menu {
  list-style: none;
  padding: 10px 8px;
  flex: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.menu-item:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.75);
}

.menu-item.active {
  background: rgba(79,127,255,.18);
  color: #fff;
  font-weight: 500;
}

.menu-icon {
  font-size: 15px;
  width: 20px;
  display: flex;
  justify-content: center;
  opacity: 0.65;
}

.menu-item.active .menu-icon {
  opacity: 1;
}

.tab-badge {
  margin-left: auto;
  background: var(--accent-red);
  color: white;
  border-radius: 99px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 600;
}

.sidebar-status {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: rgba(255,255,255,.3);
  border-top: 1px solid rgba(255,255,255,.06);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
}

.status-dot.online {
  background: var(--accent-green);
  box-shadow: 0 0 6px rgba(52,201,126,.5);
}

.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

#sidebarUserName {
  font-weight: 600;
  color: #fff;
  font-size: 13px;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */

/* ── Sidebar rozwijany po najechaniu ───────────────────────────────────────── */
.sidebar {
  width: 52px;
  transition: width 0.22s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.sidebar:hover {
  width: 210px;
  box-shadow: 4px 0 24px rgba(0,0,0,.18);
}

/* Etykiety nawigacji — ukryte domyślnie, widoczne po rozwinięciu */
.nav-label {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: .01em;
  color: inherit;
  white-space: nowrap;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: opacity .18s ease, max-width .22s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
.sidebar:hover .nav-label {
  opacity: 1;
  max-width: 150px;
}

/* Logo — wersja rozwinięta (zdjęcie) i zwinięta (NH badge) */
.sidebar-logo-collapsed { display: flex; }
.sidebar-logo-expanded  { display: none; opacity: 0; transition: opacity .18s; }
.sidebar:hover .sidebar-logo-collapsed { display: none; }
.sidebar:hover .sidebar-logo-expanded  { display: flex; opacity: 1; }

/* Przyciski nawigacyjne */
.sb-nav-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 11px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,.42);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: background .15s, color .15s, width .22s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  padding: 0 14px 0 14px;
}
.sidebar:hover .sb-nav-btn {
  width: 196px;
  justify-content: flex-start;
  border-radius: 10px;
}
.sb-nav-btn svg { flex-shrink: 0; width: 20px; height: 20px; }
.sb-nav-btn:hover {
  background: rgba(255,255,255,.08) !important;
  color: rgba(255,255,255,.88) !important;
}
.sb-nav-btn.active {
  background: rgba(79,127,255,.18) !important;
  color: #7ba8ff !important;
}
.sb-nav-btn.active .nav-label { color: #7ba8ff; }



/* Separator */
.sb-divider {
  width: 24px;
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: 4px 0;
  flex-shrink: 0;
  transition: width .22s;
}
.sidebar:hover .sb-divider { width: 186px; }

/* Avatar + dolna sekcja */
.sb-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding-bottom: 6px;
  width: 100%;
}
.sidebar:hover .sb-bottom { align-items: flex-start; padding-left: 12px; }

.sb-avatar-row {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 9px;
  transition: background .15s;
  width: 36px;
  overflow: hidden;
  transition: background .15s, width .22s cubic-bezier(.4,0,.2,1);
}
.sidebar:hover .sb-avatar-row { width: 186px; }
.sb-avatar-row:hover { background: rgba(255,255,255,.07); }

.sb-username {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  white-space: nowrap;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: opacity .18s, max-width .22s cubic-bezier(.4,0,.2,1);
}
.sidebar:hover .sb-username { opacity: 1; max-width: 120px; }

.sb-logout-btn {
  background: none;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 5px;
  color: rgba(255,255,255,.25);
  font-size: 9px;
  cursor: pointer;
  font-family: var(--font);
  padding: 2px 7px;
  white-space: nowrap;
  transition: opacity .18s, max-width .22s;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
}
.sidebar:hover .sb-logout-btn { opacity: 1; max-width: 60px; }

/* Hover overlay na avatarze */
.avatar-camera-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
  font-size: 11px;
}
.sb-avatar-row:hover .avatar-camera-overlay { opacity: 1; }

/* Main content — nie przesuwa się gdy sidebar się rozszerza (sidebar jest fixed + overlay) */
.main-content {
  margin-left: 52px;
  flex: 1;
  padding: 20px 28px;
  min-height: 100vh;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.view-header h1 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.header-search {
  flex: 1;
  max-width: 360px;
}

.header-search input {
  width: 100%;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: var(--transition);
  color: var(--text-primary);
}

.header-search input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(79,127,255,.1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.current-time {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============================================================
   KPI CARDS
   ============================================================ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.kpi-card.kpi-alert {
  border-left: 3px solid var(--accent-red);
}

.kpi-value {
  font-size: 28px;
  font-weight: 200;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.01em;
}

/* Kolorowe wartości KPI per karta */
.kpi-card.kpi-blue .kpi-value  { color: #4f7fff; }
.kpi-card.kpi-orange .kpi-value { color: #f0a843; }
.kpi-card.kpi-red .kpi-value   { color: #e05252; }
.kpi-card.kpi-green .kpi-value { color: #34c97e; }

.kpi-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============================================================
   TABS
   ============================================================ */

.tabs-container {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 32px;
}

.tabs-header {
  display: flex;
  gap: 8px;
  padding: 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.tab-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.05);
}

.tab-btn.active {
  color: var(--accent-blue);
  background: #fff;
  box-shadow: var(--shadow);
}

.tab-content {
  display: none;
  padding: 24px;
}

.tab-content.active {
  display: block;
}

/* ============================================================
   TASKS & SECTIONS
   ============================================================ */

.tasks-today-section {
  background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 100%);
  border: 1px solid #fde68a;
  border-radius: var(--border-radius-sm);
  padding: 20px;
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-secondary, .btn-primary, .btn-call, .btn-report, .btn-edit {
  padding: 10px 20px;
  border-radius: var(--border-radius-sm);
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-secondary {
  background: #fff;
  color: var(--text-primary);
  border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent-blue);
  color: white;
}

.btn-primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-call {
  background: var(--accent-green);
  color: white;
}

.btn-call:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-report {
  background: #6366f1;
  color: white;
}

.btn-report:hover {
  background: #4f46e5;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ============================================================
   LISTS & CARDS
   ============================================================ */

.leads-list, .tasks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lead-card, .task-item {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.lead-card:hover, .task-item:hover {
  border-color: #e2e8f0;
  box-shadow: var(--shadow-md);
}

.lead-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  margin-right: 12px;
}

.lead-info {
  flex: 1;
  min-width: 0;
}

.lead-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.lead-phone {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.lead-zglosza {
  font-size: 12px;
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 4px;
}

.lead-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.lead-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
}

.tag-new {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-green);
}

.tag-waiting {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-orange);
}

.tag-done {
  background: rgba(148, 163, 166, 0.1);
  color: var(--text-secondary);
}

.lead-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.lead-actions button {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lead-actions button:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

/* ============================================================
   DASHBOARD & STATS
   ============================================================ */
.dashboard-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid #e2e8f0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.section-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.live-feed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #f8fafc;
  transition: background 0.2s;
}

.live-feed-item:hover {
  background: #f8fafc;
}

.feed-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.feed-content {
  flex: 1;
}

.feed-title {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.feed-time {
  font-size: 12px;
  color: #94a3b8;
}

.status-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-missed { background: #fee2e2; color: #ef4444; }
.status-no-answer { background: #fef3c7; color: #d97706; }
.status-connected { background: #dcfce7; color: #10b981; }
.status-ineffective { background: #fef3c7; color: #d97706; }

/* ============================================================
   DIALER & CHAT WIDGETS
   ============================================================ */

.dialer-widget, .sonia-chat-widget {
  position: fixed;
  z-index: 8000;
  transition: var(--transition);
}

.dialer-widget {
  bottom: 24px;
  right: 24px;
}

.sonia-chat-widget {
  bottom: 24px;
  left: calc(var(--sidebar-width) + 20px);
}

.dialer-widget > button, .sonia-chat-widget > button {
  position: relative;
  height: 44px;
  padding: 0 18px;
  border-radius: 22px;
  background: var(--navy);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition: var(--transition);
}

.dialer-widget > button:hover, .sonia-chat-widget > button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.32);
  background: #1e293b;
}

.dialer-panel, .sonia-chat-panel {
  position: absolute;
  bottom: 58px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 340px;
  max-height: 500px;
  transition: var(--transition);
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dialer-panel .widget-header, .sonia-chat-panel .widget-header {
  background: var(--navy);
  color: #fff;
  border-bottom: none;
  padding: 16px 20px;
}

.dialer-panel .widget-title, .sonia-chat-panel .widget-title {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.dialer-panel .widget-btn, .sonia-chat-panel .widget-btn {
  color: rgba(255,255,255,0.7);
  font-size: 16px;
}

.dialer-panel .widget-btn:hover, .sonia-chat-panel .widget-btn:hover {
  color: #fff;
}

/* .sonia-msg-text styles defined below in the chat section */

/* sonia-chat-input-row styles defined below in the chat section */

.dialer-panel {
  right: 0;
}

.sonia-chat-panel {
  left: 0;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dialer-panel.minimized, .sonia-chat-panel.minimized {
  height: 52px;
  width: 200px;
  max-height: 52px;
  overflow: hidden;
}

.widget-header {
  padding: 14px 18px;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.widget-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}

.widget-actions {
  display: flex;
  gap: 8px;
}

.widget-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  color: #94a3b8;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.widget-btn:hover {
  color: var(--navy);
}

.dialer-body {
  padding: 16px;
  overflow-y: auto;
}

.dialer-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  outline: none;
  text-align: center;
  letter-spacing: 1px;
  box-sizing: border-box;
  margin-bottom: 12px;
}

.dialer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.dialer-key {
  height: 56px;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 20px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dialer-key:hover {
  background: #fff;
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.dialer-key:hover {
  background: #f1f5f9;
}

.dialer-key:active {
  background: #e2e8f0;
  transform: scale(0.96);
}

.dialer-actions {
  display: flex;
  gap: 8px;
}

.dialer-del {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #f3f4f6;
  border: 1px solid #e2e8f0;
  font-size: 18px;
  cursor: pointer;
  color: #6b7280;
  flex-shrink: 0;
  transition: var(--transition);
}

.dialer-del:hover {
  background: #e5e7eb;
}

.dialer-call-btn {
  flex: 1;
  height: 56px;
  border-radius: 12px;
  background: var(--accent-green);
  border: none;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.dialer-call-btn:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.dialer-del {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 20px;
  color: #64748b;
}

.dialer-call-btn:hover {
  background: #059669;
}

.sonia-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8fafc;
  min-height: 200px;
  max-height: 300px;
}

.sonia-msg {
  margin-bottom: 12px;
  max-width: 85%;
  display: flex;
  flex-direction: column;
}

.sonia-msg-mine {
  margin-left: auto;
  text-align: right;
}

.sonia-msg-other {
  margin-right: auto;
}

.sonia-msg-text {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
  display: inline-block;
}

.sonia-msg-mine .sonia-msg-text {
  background: var(--navy);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.sonia-msg-other .sonia-msg-text {
  background: #fff;
  color: var(--text-primary);
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}

.sonia-msg-time {
  font-size: 10px;
  color: #9ca3af;
  margin-top: 2px;
}

.sonia-msg-sender {
  font-size: 10px;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 2px;
}

.sonia-msg-mine .sonia-msg-sender {
  color: rgba(255, 255, 255, 0.6);
  text-align: right;
}

.sonia-chat-input-row {
  display: flex;
  gap: 6px;
  padding: 12px;
  border-top: 1px solid #f1f5f9;
}

.sonia-chat-input-row input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

.sonia-chat-input-row input:focus {
  border-color: var(--accent-blue);
}

.sonia-chat-input-row button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--navy);
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.sonia-chat-input-row button:hover {
  background: #1e293b;
}

.sonia-inbox-item {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: var(--transition);
}

.sonia-inbox-item:hover {
  background: #f9fafb;
}

.sonia-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--accent-red);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* ============================================================
   USER INFO HEADER
   ============================================================ */

.user-info-header {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-right: 12px;
}

.user-role-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.user-role-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.user-avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  border: 1px solid #e2e8f0;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

.hidden {
  display: none !important;
}

.empty-state, .loading-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   MOBILE ADJUSTMENTS
   ============================================================ */

@media (max-width: 1024px) {
  .sidebar {
    width: 80px;
  }
  
  .logo-text, .logo-subtext, .menu-label, #sidebarUserName {
    display: none;
  }
  
  .main-content {
    margin-left: 80px;
    padding: 24px 20px;
  }
  
  .sonia-chat-widget {
    left: 100px; /* sidebar 80px + 20px margin */
  }
  
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .view-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .sidebar {
    width: 60px;
  }
  
  .main-content {
    margin-left: 60px;
    padding: 16px;
  }

  .sonia-chat-widget {
    left: 80px; /* sidebar 60px + 20px margin */
  }
  
  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .dialer-panel, .sonia-chat-panel {
    width: 280px;
  }
}


/* ==================== STATS PAGE REDESIGN ==================== */

.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stats-kpi-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stats-kpi-card .stats-kpi-value {
  color: #1e293b;
}

.stats-kpi-card .stats-kpi-label {
  color: #64748b;
}

.stats-kpi-card .stats-kpi-sub {
  color: #94a3b8;
}

.stats-kpi-card:nth-child(1) { border-top: 4px solid #3b82f6; }
.stats-kpi-card:nth-child(2) { border-top: 4px solid #10b981; }
.stats-kpi-card:nth-child(3) { border-top: 4px solid #f59e0b; }
.stats-kpi-card:nth-child(4) { border-top: 4px solid #ef4444; }

.stats-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}

.stats-kpi-icon {
  font-size: 24px;
}

.stats-kpi-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.stats-kpi-value {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
}

.stats-kpi-sub {
  font-size: 12px;
  color: #cbd5e1;
}

/* Content Grid */
.stats-content-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  margin-bottom: 32px;
}

.stats-chart-section,
.stats-table-section {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stats-chart-section h3,
.stats-table-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
}

.stats-donut-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.stats-donut-wrapper canvas {
  max-width: 160px;
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

/* Stats Table */
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.stats-table thead {
  background: #f1f5f9;
  border-bottom: 2px solid #e2e8f0;
}

.stats-table th {
  padding: 12px;
  text-align: left;
  font-weight: 700;
  color: #475569;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.stats-table tbody tr {
  border-bottom: 1px solid #e2e8f0;
  transition: background 0.2s;
}

.stats-table tbody tr:hover {
  background: #f8fafc;
}

.stats-table td {
  padding: 12px;
  color: #1e293b;
}

.stats-table td:nth-child(2),
.stats-table td:nth-child(3) {
  text-align: right;
  font-weight: 600;
}

/* Duration Section */
.stats-duration-section {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.stats-duration-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
}

.stats-duration-value {
  font-size: 48px;
  font-weight: 700;
  color: #3b82f6;
  margin-bottom: 8px;
}

.stats-duration-sub {
  font-size: 12px;
  color: #64748b;
}

/* Responsive */
@media (max-width: 1200px) {
  .stats-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stats-content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .stats-kpi-grid {
    grid-template-columns: 1fr;
  }
}


/* ==================== CONTACTS TABLE ==================== */

.contacts-grid {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid #e2e8f0;
}

.contacts-grid-header {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1.2fr 1.2fr 1fr 0.8fr;
  gap: 0;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  padding: 0 16px;
}

.contacts-grid-header > div {
  padding: 12px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.contacts-grid-row {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1.2fr 1.2fr 1fr 0.8fr;
  gap: 0;
  padding: 0 16px;
  border-bottom: 1px solid #f1f5f9;
  align-items: center;
  transition: background 0.15s;
  min-height: 56px;
}

.contacts-grid-row:last-child {
  border-bottom: none;
}

.contacts-grid-row:hover {
  background: #f8fafc;
}

.contact-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px;
}

.contact-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a192f 0%, #1e293b 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.contact-name {
  font-size: 14px;
  font-weight: 600;
  color: #3b82f6;
  text-decoration: none;
  cursor: pointer;
}

.contact-name:hover {
  text-decoration: underline;
}

.contact-phone-cell,
.contact-email-cell {
  padding: 12px 8px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}

.contact-phone-cell:hover,
.contact-email-cell:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.contact-tags-cell {
  padding: 12px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.contact-status-cell {
  padding: 12px 8px;
}

.contact-tag {
  background: #e0f2fe;
  color: #0369a1;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

.contact-actions-cell {
  padding: 12px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-call.btn-sm {
  background: #10b981;
  color: #fff;
  min-width: 36px;
  justify-content: center;
}

.btn-call.btn-sm:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-edit.btn-sm {
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
}

.btn-edit.btn-sm:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.no-data {
  color: #94a3b8;
  font-style: italic;
  font-size: 12px;
}

.contact-field-input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid #3b82f6;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  background: #eff6ff;
}


/* ==================== CALLS TABLE ==================== */

.calls-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.calls-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}

.call-row {
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #f1f5f9;
}

.call-row:last-child {
  border-bottom: none;
}

.call-row:hover {
  background: #f8fafc;
}

.call-row td {
  padding: 12px 16px;
  font-size: 13px;
  color: #374151;
  vertical-align: middle;
}

.call-row td:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.call-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  color: #fff;
}

.av-in  { background: linear-gradient(135deg, #10b981, #059669); }
.av-out { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }

.call-name-cell .call-name {
  font-weight: 600;
  color: #1e293b;
  font-size: 13px;
}

.call-name-cell .call-number {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
}

/* Call tags */
.call-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.tag-connected   { background: #dcfce7; color: #166534; }
.tag-missed      { background: #fee2e2; color: #991b1b; }
.tag-ineffective { background: #fef3c7; color: #92400e; }
.tag-unknown     { background: #f1f5f9; color: #475569; }

/* Recording player */
.call-recording-player {
  height: 28px;
  width: 140px;
}

#popupRecordingPlayer audio {
  height: 30px;
  width: 100%;
  max-width: 300px;
  border-radius: 20px;
  accent-color: #3b82f6;
}

.btn-fetch-rec {
  padding: 4px 10px;
  font-size: 11px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-fetch-rec:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.btn-fetch-rec:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-rec-pending {
  font-size: 11px;
  color: #92400e;
  background: #fef3c7;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.btn-download-rec {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: #f1f5f9;
  border-radius: 50%;
  color: #475569;
  text-decoration: none;
  font-size: 13px;
  margin-left: 4px;
  transition: background 0.15s;
}

.btn-download-rec:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* Tasks list */
.tasks-list {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  min-height: 60px;
}

.task-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}

.task-item:last-child { border-bottom: none; }
.task-item:hover { background: #f8fafc; }

.task-item .task-title {
  font-weight: 600;
  font-size: 13px;
  color: #1e293b;
}

.task-item .task-meta-info {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.tabs-container {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.tabs-header {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 0 8px;
  gap: 4px;
}

.tab-btn {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -1px;
}

.tab-btn:hover { color: #1e293b; }
.tab-btn.active { color: #0a192f; border-bottom-color: #0a192f; font-weight: 700; }

.tab-badge {
  background: #e2e8f0;
  color: #475569;
  border-radius: 20px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
}

.tab-btn.active .tab-badge {
  background: #0a192f;
  color: #fff;
}

.tab-content { display: none; }
.tab-content.active { display: block; }


/* ==================== LOGIN SCREEN ==================== */

/* ==================== LOGIN SCREEN ==================== */

/* login-screen v7 removed — see v8 at bottom */


.login-user-grid {
  text-align: center;
  width: 100%;
}

/* overridden by v8 at bottom of file — kept for legacy refs */
.login-role-section { margin-bottom: 28px; display: flex; flex-direction: column; align-items: center; }
.login-role-label {
  font-size: 9px;
  font-weight: 600;
  color: rgba(255,255,255,.25);
  text-transform: uppercase;
  letter-spacing: .18em;
  margin-bottom: 14px;
}

/* login card styles moved to v8 section at bottom */

/* ==================== MODAL ==================== */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.modal.hidden {
  display: none !important;
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: #0a192f;
  margin: 0;
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  color: #1e293b;
  background: #fff;
  font-family: 'Montserrat', sans-serif;
  transition: border-color 0.15s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.btn-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
}

.btn-close:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* ==================== SOURCE FILTER BUTTONS ==================== */

.source-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0;
}

.source-filter-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Montserrat', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.source-filter-btn:hover {
  border-color: #94a3b8;
  color: #1e293b;
  background: #f8fafc;
}

.source-filter-btn.active {
  background: #0a192f;
  color: #fff;
  border-color: #0a192f;
  box-shadow: 0 2px 8px rgba(10,25,47,0.2);
}

.source-tag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.source-tag-dot.source-smart-day { background: #3b82f6; }
.source-tag-dot.source-audyt { background: #8b5cf6; }
.source-tag-dot.source-other { background: #64748b; }

/* Lead source tags */
.lead-source-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.lead-source-tag.source-smart-day { background: #dbeafe; color: #1d4ed8; }
.lead-source-tag.source-audyt { background: #ede9fe; color: #6d28d9; }
.lead-source-tag.source-other { background: #f1f5f9; color: #475569; }

/* Lead card buttons */
.new-lead-btn {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Montserrat', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  border: none;
  background: linear-gradient(135deg, #0a192f 0%, #1e3a5f 100%);
  color: #fff;
}

.new-lead-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(10,25,47,0.25);
}

.btn-call-back {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Montserrat', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  border: 1.5px solid #10b981;
  background: #ecfdf5;
  color: #065f46;
}

.btn-call-back:hover {
  background: #10b981;
  color: #fff;
  transform: translateY(-1px);
}

/* Lead age indicators */
.lead-age {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.lead-age.age-ok { background: #dcfce7; color: #166534; }
.lead-age.age-warn { background: #fef3c7; color: #92400e; }
.lead-age.age-critical { background: #fee2e2; color: #991b1b; }

/* ==================== CALL FILTER BUTTONS ==================== */

.call-filter-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Montserrat', sans-serif;
  white-space: nowrap;
}

.call-filter-btn:hover {
  border-color: #94a3b8;
  color: #1e293b;
  background: #f8fafc;
}

.call-filter-btn.active {
  background: #0a192f;
  color: #fff;
  border-color: #0a192f;
  box-shadow: 0 2px 8px rgba(10,25,47,0.2);
}

/* ==================== PATIENT STATUS BADGES ==================== */
.patient-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ps-czeka_na_kontakt { background: #fff7ed; color: #ea580c; border: 1px solid #ffedd5; }
.ps-nie_odbiera_w_procesie { background: #eff6ff; color: #2563eb; border: 1px solid #dbeafe; }
.ps-nie_odbiera_przegrana { background: #1f2937; color: #f9fafb; border: 1px solid #111827; }
.ps-prosi_o_kontakt { background: #faf5ff; color: #9333ea; border: 1px solid #f3e8ff; }
.ps-umowiony_na_w0 { background: #f0fdf4; color: #16a34a; border: 1px solid #dcfce7; }
.ps-niekwalifikowany { background: #fef2f2; color: #dc2626; border: 1px solid #fee2e2; }
.ps-rezygnacja { background: #fef2f2; color: #dc2626; border: 1px solid #fee2e2; }

.status-dot-mini {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.sd-czeka_na_kontakt { background: #f97316; }
.sd-nie_odbiera_w_procesie { background: #3b82f6; }
.sd-nie_odbiera_przegrana { background: #000000; }
.sd-prosi_o_kontakt { background: #a855f7; }
.sd-umowiony_na_w0 { background: #22c55e; }
.sd-niekwalifikowany, .sd-rezygnacja { background: #ef4444; }

/* ==================== GENERAL BUTTONS ==================== */

.btn-primary {
  padding: 10px 20px;
  background: linear-gradient(135deg, #0a192f 0%, #1e3a5f 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Montserrat', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(10,25,47,0.3);
}

.btn-secondary {
  padding: 10px 20px;
  background: #fff;
  color: #374151;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Montserrat', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  transform: translateY(-1px);
}


/* ============================================================
   CALL POPUP — nakładka połączenia
   ============================================================ */

.call-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.call-popup.hidden {
  display: none !important;
}

.popup-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
}

.popup-content {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 20px;
  width: 680px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
}

/* Header popup */
.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #0a192f 0%, #1e3a5f 100%);
  border-radius: 20px 20px 0 0;
  gap: 12px;
  flex-wrap: wrap;
}

.call-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulseDot 1.2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.6; }
}

.popup-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.call-timer {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  min-width: 52px;
  text-align: center;
}

.call-tag {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.tag-connected  { background: #dcfce7; color: #166534; }
.tag-missed     { background: #fee2e2; color: #991b1b; }
.tag-ineffective { background: #fef3c7; color: #92400e; }

.btn-answer {
  padding: 7px 16px;
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}

.btn-answer:hover { background: #16a34a; }

.btn-hangup {
  padding: 7px 16px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}

.btn-hangup:hover { background: #dc2626; }

.popup-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.popup-close:hover { background: rgba(255,255,255,0.3); }

/* Dane pacjenta */
.popup-patient-info {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
}

.patient-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a192f, #1e3a5f);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.patient-details {
  flex: 1;
  min-width: 0;
}

.patient-details h2 {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px;
}

.patient-details p {
  font-size: 14px;
  color: #64748b;
  margin: 0;
}

.zglosza-info {
  margin-top: 8px;
  padding: 8px 12px;
  background: #eff6ff;
  border-radius: 8px;
  border-left: 3px solid #3b82f6;
}

.zglosza-label {
  font-size: 11px;
  font-weight: 700;
  color: #3b82f6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 2px;
}

.zglosza-value {
  font-size: 13px;
  color: #1e293b;
}

.popup-actions-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.btn-call-action {
  padding: 7px 14px;
  background: #0a192f;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-call-action:hover { background: #1e3a5f; }

.btn-edit-request {
  padding: 7px 14px;
  background: #fff;
  color: #374151;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-edit-request:hover { background: #f9fafb; border-color: #9ca3af; }

/* Formularz raportu */
.popup-report {
  padding: 20px;
}

.popup-report h3 {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-selector label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 10px;
}

.status-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.status-tile {
  padding: 20px 12px;
  border: none;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
  color: #fff;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
}

.status-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
  filter: brightness(1.05);
}

.status-tile.active {
  outline: 4px solid #fff;
  outline-offset: -4px;
  box-shadow: 0 0 0 5px rgba(0,0,0,0.35), 0 4px 12px rgba(0,0,0,0.2);
  transform: scale(0.96);
  filter: brightness(1.1);
  position: relative;
}
.status-tile.active::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* Kolory dla poszczególnych kafelków */
#tile-NOWY_PACJENT {
  background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
}
#tile-STALY_PACJENT {
  background: linear-gradient(135deg, #2196F3 0%, #1565C0 100%);
}
#tile-WIZYTA_BIEZACA {
  background: linear-gradient(135deg, #FFEB3B 0%, #FBC02D 100%);
}
#tile-SPAM {
  background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

.status-tile-icon { 
  font-size: 28px; 
  background: rgba(255,255,255,0.2);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 4px;
}

.status-tile-label {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.2;
}

.status-tile-sublabel {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.9;
  text-align: center;
}

/* Przyciski wyniku rozmowy (Outcome) */
.outcome-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.outcome-btn {
  padding: 8px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Montserrat', sans-serif;
}

.outcome-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.outcome-btn.active {
  background: #0a192f;
  color: #fff;
  border-color: #0a192f;
  box-shadow: 0 2px 8px rgba(10,25,47,0.2);
}

/* Przyciski czasu kontaktu */
.contact-time-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.time-btn {
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.time-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.time-btn.active {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

.report-form {
  margin-top: 12px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.report-form .form-group {
  margin-bottom: 12px;
}

.report-form label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  display: block;
  margin-bottom: 4px;
}

.form-select, .form-textarea, .form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Montserrat', sans-serif;
  color: #1e293b;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.form-select:focus, .form-textarea:focus, .form-input:focus {
  outline: none;
  border-color: #0a192f;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.popup-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
  border-radius: 0 0 20px 20px;
}

/* Modal popup (editRequest, patientCard) */
.modal-popup {
  position: fixed;
  inset: 0;
  z-index: 10001; /* Wyżej niż call-popup (10000) */
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-popup.hidden { display: none !important; }

.modal-content {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 16px;
  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.modal-body { padding: 20px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid #f1f5f9;
}

/* Modal (createTaskModal) */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
}

.modal.hidden { display: none !important; }

.modal .modal-content {
  background: #fff;
  border-radius: 16px;
  width: 500px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.btn-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #64748b;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}

.btn-close:hover { color: #0f172a; }

/* Diagnose modal */
#diagnoseModal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

#diagnoseModal.hidden { display: none !important; }

#diagnoseModal .modal-content {
  background: #fff;
  border-radius: 16px;
  width: 600px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* ============================================================
   NAKŁADKA BLOKUJĄCA RAPORT (podczas dzwonienia)
   ============================================================ */

.popup-report {
  position: relative;
}

.report-block-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 0 20px 20px;
  transition: opacity 0.3s ease;
}

.report-block-overlay.hidden {
  display: none !important;
}

.report-block-content {
  text-align: center;
  color: #64748b;
}

.report-block-content p {
  font-size: 14px;
  font-weight: 600;
  margin-top: 16px;
  color: #475569;
}

.ringing-animation {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.ring-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #3b82f6;
  animation: ringBounce 1.2s ease-in-out infinite;
}

.ring-dot:nth-child(1) { animation-delay: 0s; }
.ring-dot:nth-child(2) { animation-delay: 0.2s; }
.ring-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes ringBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ============================================================
   HISTORIA POŁĄCZEŃ — rozszerzone style
   ============================================================ */

.call-stage-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.stage-new        { background: #dbeafe; color: #1d4ed8; }
.stage-attempt1   { background: #fef3c7; color: #d97706; }
.stage-attempt2   { background: #fee2e2; color: #dc2626; }
.stage-followup   { background: #f3e8ff; color: #7c3aed; }
.stage-after-call { background: #d1fae5; color: #065f46; }
.stage-booked     { background: #dcfce7; color: #15803d; }
.stage-noshow     { background: #fce7f3; color: #9d174d; }
.stage-refused    { background: #f1f5f9; color: #475569; }

/* ============================================================
   WIDOK ZADAŃ — kalendarz miesięczny
   ============================================================ */

.tasks-calendar {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
}

.calendar-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.calendar-nav-btn {
  background: none;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 14px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.calendar-nav-btn:hover { background: #f8fafc; border-color: #94a3b8; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
}

.calendar-day-header {
  padding: 8px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #f1f5f9;
}

.calendar-day {
  min-height: 72px;
  padding: 6px;
  border-right: 1px solid #f8fafc;
  border-bottom: 1px solid #f8fafc;
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
}

.calendar-day:hover { background: #f8fafc; }

.calendar-day.today { background: #eff6ff; }

.calendar-day.today .day-num {
  background: #3b82f6;
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-day.other-month { opacity: 0.35; }

.calendar-day.selected { background: #f0f9ff; }

.day-num {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-tasks {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.day-task-dot {
  font-size: 10px;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 1px 4px;
  border-radius: 3px;
  background: #e0f2fe;
  color: #0369a1;
  line-height: 1.4;
}

.day-task-dot.overdue { background: #fee2e2; color: #dc2626; }

.day-more {
  font-size: 10px;
  color: #94a3b8;
  padding: 1px 4px;
}

/* Pool sekcja na kokpicie */
.pool-section {
  background: #fff;
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
}

.pool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
}

.pool-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pool-badge {
  background: #f59e0b;
  color: #fff;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}

.pool-list {
  max-height: 300px;
  overflow-y: auto;
}

.pool-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid #f8fafc;
  gap: 12px;
}

.pool-item:last-child { border-bottom: none; }

.pool-item:hover { background: #fafafa; }

.pool-item-info { flex: 1; min-width: 0; }

.pool-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pool-item-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.btn-claim {
  padding: 5px 12px;
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
}

.btn-claim:hover { background: #d97706; }

/* ==================== KALENDARZ MIESIĘCZNY ====================  */
.tasks-calendar {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.calendar-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}
.calendar-nav-btn {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 16px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.calendar-nav-btn:hover { background: #f1f5f9; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.calendar-day-header {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  padding: 4px 0;
}
.calendar-day {
  min-height: 52px;
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
}
.calendar-day:hover { background: #f8fafc; border-color: #e2e8f0; }
.calendar-day.today { background: #eff6ff; border-color: #3b82f6; }
.calendar-day.today .day-num { color: #3b82f6; font-weight: 800; }
.calendar-day.other-month { opacity: 0.3; cursor: default; }
.day-num {
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 2px;
}
.day-tasks { display: flex; flex-direction: column; gap: 1px; }
.day-task-dot {
  font-size: 9px;
  background: #dbeafe;
  color: #1d4ed8;
  border-radius: 3px;
  padding: 1px 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.day-task-dot.overdue {
  background: #fee2e2;
  color: #dc2626;
}
.day-more {
  font-size: 9px;
  color: #94a3b8;
  padding: 1px 3px;
}

/* ==================== PULA ZADAŃ NA KOKPICIE ==================== */
.pool-section {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}
.pool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
}
.pool-header h3 {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pool-badge {
  background: #f59e0b;
  color: #fff;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
}
.pool-list { max-height: 200px; overflow-y: auto; }
.pool-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid #f8fafc;
  gap: 12px;
}
.pool-item:last-child { border-bottom: none; }
.pool-item-info { flex: 1; min-width: 0; }
.pool-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pool-item-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}
.btn-claim {
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-claim:hover { background: #059669; }
.btn-claim:disabled { background: #94a3b8; cursor: not-allowed; }

/* ==================== TAGI ETAPÓW LEJKA ==================== */
.call-stage-tag, .lead-stage-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.stage-new { background: #dbeafe; color: #1d4ed8; }
.stage-attempt1 { background: #fef3c7; color: #b45309; }
.stage-attempt2 { background: #fed7aa; color: #c2410c; }
.stage-followup { background: #e0e7ff; color: #4338ca; }
.stage-after-call { background: #d1fae5; color: #065f46; }
.stage-booked { background: #bbf7d0; color: #14532d; }
.stage-noshow { background: #fee2e2; color: #991b1b; }
.stage-refused { background: #f1f5f9; color: #475569; }

/* ==================== ZEGAR W NAGŁÓWKU ==================== */
.header-clock {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 12px;
  margin-right: 8px;
}
.clock-icon { font-size: 14px; }
.clock-time {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}
.clock-date {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

/* ==================== STATUS PACJENTA W TABELI ==================== */
.contact-type-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.ct-new     { background: #dbeafe; color: #1d4ed8; }
.ct-regular { background: #d1fae5; color: #065f46; }
.ct-visit   { background: #fef3c7; color: #b45309; }
.ct-spam    { background: #f1f5f9; color: #94a3b8; }

/* ==================== TAG PROGRAMU ==================== */
.program-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== NAPRAWA PRZYCISKÓW (btn-task-done) ==================== */
.btn-task-done {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-task-done:hover { background: #059669; }

/* Naprawa ogólna - przyciski nie powinny wyglądać jak tekst */
button {
  font-family: inherit;
}

/* Naprawa przycisków w task-meta */
.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.task-due {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
}

/* ==================== MENU SIDEBAR - DRUKOWANE LITERY ==================== */
.menu-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
}

/* ===== PENDING REPORTS BAR (punkt 6) ===== */
.pending-reports-bar {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  border-radius: 10px;
  padding: 8px 16px;
  margin: 0 0 16px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  animation: pulse-report 2s ease-in-out infinite;
}

.pending-report-item {
  font-size: 12px;
  color: #92400e;
  cursor: pointer;
  padding: 4px 12px;
  background: rgba(255,255,255,0.6);
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.2s;
}

.pending-report-item:hover {
  background: rgba(255,255,255,0.9);
}

@keyframes pulse-report {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}

/* ===== DONE TASK BUTTON (punkt 10) ===== */
.btn-done-task {
  padding: 5px 14px;
  font-size: 12px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-done-task:hover {
  background: #059669;
  transform: scale(1.05);
}

.task-completed {
  opacity: 0.5;
  background: #f8fafc;
}

/* ===== REPORT STATUS TAGS (punkt 8) ===== */
.report-status-done {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #dcfce7;
  color: #166534;
  font-weight: 600;
}

.report-status-pending {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 600;
  cursor: pointer;
  animation: pulse-report 2s ease-in-out infinite;
}

/* ===== ADMIN REPORT STATS (punkt 9) ===== */
#adminReportStatsSection {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e2e8f0;
}

#adminReportStatsSection h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
}

#adminReportStatsSection h4 {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
}

#adminReportStatsSection .stats-table {
  width: 100%;
  border-collapse: collapse;
}

#adminReportStatsSection .stats-table th,
#adminReportStatsSection .stats-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
}

#adminReportStatsSection .stats-table th {
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
}

/* ==================== TAGI STATUSU RAPORTU ==================== */
.report-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: default;
}
.report-done {
  background: #dcfce7;
  color: #166534;
}
.report-missing {
  background: #fee2e2;
  color: #991b1b;
  cursor: pointer;
  animation: pulse-red 2s infinite;
  border: 1px solid #fca5a5;
}
.report-missing:hover {
  background: #fecaca;
  color: #7f1d1d;
}
@keyframes pulse-red {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

/* ==================== KOKPIT — SEKCJE ==================== */
.dashboard-section-block {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.dashboard-section-block .section-header {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dashboard-section-block .section-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dashboard-section-block .tasks-list,
.dashboard-section-block .leads-list {
  padding: 8px 0;
}

/* ==================== CHAT SONIA — ZAKŁADKI I PRZYCISK ROZWIĄZANY ==================== */
.sonia-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.sonia-tab {
  flex: 1;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.sonia-tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
  background: #fff;
}
.sonia-tab:hover:not(.active) {
  background: #f1f5f9;
  color: #1e293b;
}
.btn-resolve-chat {
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-right: 4px;
  white-space: nowrap;
}
.btn-resolve-chat:hover {
  background: #16a34a;
}
.sonia-date-sep {
  text-align: center;
  font-size: 10px;
  color: #94a3b8;
  padding: 6px 0 2px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==================== KARTA PACJENTA — ZAKŁADKI ==================== */
.patient-card-tab {
  padding: 10px 18px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}
.patient-card-tab:hover { color: #3b82f6; }
.patient-card-tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

/* ==================== RECEPTION OS STYLES ==================== */
.urgent-task {
  border-left: 4px solid var(--accent-red) !important;
  background-color: #fff1f2 !important;
}

.report-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.st-new { background: #dbeafe; color: #1e40af; }
.st-regular { background: #fef3c7; color: #92400e; }
.st-visit { background: #dcfce7; color: #166534; }
.st-spam { background: #f1f5f9; color: #475569; }

.task-item {
  transition: var(--transition);
}

.task-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.pool-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: var(--transition);
}

.pool-item:hover {
  background: #f8fafc;
}

.pool-item-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.pool-item-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.btn-claim {
  padding: 6px 12px;
  font-size: 12px;
  background: var(--accent-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.btn-claim:hover {
  background: #2563eb;
  transform: scale(1.05);
}


/* ==================== RECEPTION OS — FINAL STYLES ==================== */

/* W0 Block Notice */
.w0-block-notice {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #92400e;
  margin-bottom: 12px;
}

/* Response Time Indicator */
.response-time-indicator {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  font-weight: 600;
}

/* Response Time Alert Banner */
.response-time-alert {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 9999;
  background: #dc2626;
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4);
  animation: pulse-alert 1.5s infinite;
}

.response-time-alert button {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 16px;
}

@keyframes pulse-alert {
  0%, 100% { box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4); }
  50% { box-shadow: 0 4px 30px rgba(220, 38, 38, 0.8); }
}

/* Shake animation for blocked tile */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* KPI Card Accents */
.kpi-accent-blue { border-top: 3px solid #3b82f6; }
.kpi-accent-orange { border-top: 3px solid #f59e0b; }
.kpi-accent-green { border-top: 3px solid #10b981; }
.kpi-accent-red { border-top: 3px solid #ef4444; }

/* Stats Chart Full Width */
.stats-chart-full {
  background: white;
  border-radius: 12px;
  padding: 20px 24px;
  margin-top: 20px;
  border: 1px solid #e2e8f0;
}

.stats-chart-full h3 {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
}

.stats-chart-full canvas {
  width: 100% !important;
}

/* Cancellation List */
.cancellation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.cancellation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.cancellation-reason {
  font-size: 13px;
  color: #374151;
}

.cancellation-count {
  font-size: 14px;
  font-weight: 700;
  color: #ef4444;
  background: #fef2f2;
  padding: 2px 8px;
  border-radius: 12px;
}

/* Follow-up overdue badge */
.task-overdue {
  border-left: 3px solid #ef4444 !important;
  background: #fef2f2 !important;
}

.task-overdue .task-type-badge {
  background: #ef4444;
  color: white;
}

/* User activity status dot */
.user-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.user-status-dot.online { background: #10b981; }
.user-status-dot.offline { background: #94a3b8; }

/* Edit Request popup enhancements */
.form-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: white;
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Heartbeat / user online indicator in sidebar */
.sidebar-user-status {
  font-size: 11px;
  color: #10b981;
  font-weight: 600;
}

/* ── Minimalizacja popupu połączenia ─────────────────────────── */
#callPopup.minimized .popup-overlay { display: none; }
#callPopup.minimized .popup-content {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 380px;
  max-height: 56px;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.18);
  cursor: pointer;
  transition: max-height 0.3s ease;
  z-index: 9999;
}
#callPopup.minimized .popup-content::before {
  content: 'Polaczenie aktywne - kliknij aby rozwinac';
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  font-weight: 600;
  font-size: 14px;
  color: #1a56db;
  background: #e8f0fe;
  border-top: 3px solid #1a56db;
  padding: 0 20px;
}

/* ── Dashboard Two-Column Layout ─────────────────────────────── */
.dash-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.dash-panel {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 380px;
  height: 100%;
}

.dash-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
  flex-wrap: wrap;
  gap: 8px;
}

.dash-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-panel-title h3 {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.dash-panel-icon {
  font-size: 18px;
  line-height: 1;
}

.dash-panel-body {
  padding: 12px;
  flex: 1;
  overflow-y: auto;
  max-height: 460px;
  min-height: 0;
}

.btn-icon-sm {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 14px;
  cursor: pointer;
  color: #64748b;
  transition: all 0.15s;
}
.btn-icon-sm:hover { background: #f1f5f9; color: #1e293b; }

/* Callback subsections */
.callback-subsection {
  margin-bottom: 12px;
}

.callback-subsection:last-child { margin-bottom: 0; }

.callback-subsection-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.missed-label {
  background: #fee2e2;
  color: #b91c1c;
}

.ineffective-label {
  background: #fef3c7;
  color: #92400e;
}

.callback-count {
  background: rgba(0,0,0,0.12);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
}

.callback-sub-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 2px;
}

.callback-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #f1f5f9;
  transition: all 0.15s;
}

.callback-item:hover {
  border-color: #e2e8f0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.callback-item-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.avatar-missed { background: #fee2e2; color: #b91c1c; }
.avatar-ineffective { background: #fef3c7; color: #92400e; }

.callback-item-info {
  flex: 1;
  min-width: 0;
}

.callback-item-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.callback-item-time {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.btn-callback-call {
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-callback-call:hover { background: #1f2937; transform: translateY(-1px); }

.empty-state-sm {
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  padding: 10px;
}

/* Pool items in dash-panel */
.pool-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #f1f5f9;
  margin-bottom: 8px;
  transition: all 0.15s;
}
.pool-item:hover { border-color: #e2e8f0; box-shadow: 0 2px 6px rgba(0,0,0,0.06); }
.pool-item-info { flex: 1; min-width: 0; }
.pool-item-title { font-size: 13px; font-weight: 600; color: #1e293b; }
.pool-item-meta { font-size: 11px; color: #64748b; margin-top: 3px; }

.btn-claim {
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-claim:hover { background: #2563eb; transform: translateY(-1px); }

/* Responsive */
@media (max-width: 900px) {
  .dash-two-col { grid-template-columns: 1fr; }
}

/* ── Lead Card v2 — nowy styl kart zgłoszeń ─────────────────── */
.lead-card-v2 {
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.lead-card-v2:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  border-color: #d0d9e8;
}

/* Header row: awatar + imię + źródło + czas */
.lc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.lc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}
.lc-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}
.lc-name {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
}
.lc-age {
  margin-left: auto;
  flex-shrink: 0;
}

/* Problem pacjenta */
.lc-problem {
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-left: 3px solid #e2e8f0;
}
.lc-problem-label {
  display: block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.lc-problem-text {
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
}

/* Footer: telefon + ID + przyciski */
.lc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.lc-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.lc-phone {
  font-size: 13px;
  color: #475569;
  font-weight: 500;
}
.lc-no-phone { color: #cbd5e1; }
.lc-id {
  font-size: 12px;
  color: #94a3b8;
}
.lc-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Przycisk Zadzwoń — czarny (#111827) wg briefu */
.lc-btn-call {
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: 'Montserrat', sans-serif;
}
.lc-btn-call:hover {
  background: #1f2937;
  transform: translateY(-1px);
}

/* Przycisk Raport — szary (admin) */
.lc-btn-report {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.lc-btn-report:hover { background: #e2e8f0; color: #1e293b; }

/* Przycisk Usuń — czerwony (admin) */
.lc-btn-delete {
  background: #fff;
  color: #ef4444;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.lc-btn-delete:hover { background: #fee2e2; border-color: #ef4444; }

/* Czas oczekiwania — badge */
.lead-age {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  border: 1.5px solid transparent;
  white-space: nowrap;
}
.lead-age::before { content: '⏱'; font-size: 12px; }
.age-ok {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}
.age-warn {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
  animation: pulse-warn 2s ease-in-out infinite;
}
.age-critical {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
  animation: pulse-critical 1s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(239,68,68,0.4);
}

@keyframes pulse-warn {
  0%, 100% { opacity: 1; box-shadow: none; }
  50% { opacity: 0.75; box-shadow: 0 0 6px rgba(234,179,8,0.5); }
}

@keyframes pulse-critical {
  0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); opacity: 1; }
  50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); opacity: 0.8; }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); opacity: 1; }
}

/* Urgent Pool Tasks Blinking */
@keyframes urgentBlink {
  0% { background-color: #fff; }
  50% { background-color: #fee2e2; }
  100% { background-color: #fff; }
}
.urgent-blink {
  animation: urgentBlink 2s infinite;
  border-left: 4px solid #ef4444 !important;
}
.pool-task {
  border-left: 4px solid #3b82f6;
}

/* ==================== LEAD WAIT TIME — wyraźny czas oczekiwania ==================== */
.lead-age {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.lead-age strong { font-size: 13px; }
.lead-age.age-ok       { background: #dcfce7; color: #15803d; }
.lead-age.age-warn     { background: #fef9c3; color: #854d0e; }
.lead-age.age-critical { background: #fee2e2; color: #991b1b; animation: pulse-critical 2s infinite; }

/* ==================== CALL TYPE BUTTONS (pierwsze/kolejne połączenie) ==================== */
.call-type-btn {
  transition: all 0.15s ease;
  border-radius: 6px !important;
  font-weight: 600 !important;
  cursor: pointer;
}
.call-type-btn:hover { opacity: 0.85; }

/* ==================== PATIENT CARD NOTES TAB ==================== */
#patientCardSection_notes .form-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
}
#patientCardSection_notes .form-textarea:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px rgba(124,58,237,.15);
}

/* ==================== CALL POPUP — zakończone połączenie ==================== */
/* Pulse dot ukryty gdy połączenie zakończone — przez display:none w JS */

/* ── Stage-aware report fields ─────────────────────────── */
.stage-fields { transition: all .2s; }
.form-select {
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  background: #fff;
  color: #1e293b;
  font-family: inherit;
}
.form-select:focus { outline: none; border-color: #3b82f6; }
.form-input {
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: #1e293b;
  font-family: inherit;
}
.form-input:focus { outline: none; border-color: #3b82f6; }

/* ── Shake animation dla blokady zamknięcia ─────────────── */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ── Stats view kompakt ─────────────────────────────────── */
#view-stats .stats-kpi-grid { margin-top: 12px; }
#view-stats .stats-chart-full { margin-top: 12px; }

/* ── Tasks 4-panel layout ────────────────────────────── */
@media (max-width: 900px) {
  #tasksGridLayout { grid-template-columns: 1fr !important; }
}
.tasks-list .task-item {
  padding: 8px 12px;
  border-bottom: 0.5px solid var(--color-border-tertiary);
  display: flex; align-items: flex-start; gap: 8px;
}
.tasks-list .task-item:last-child { border-bottom: none; }

/* ── Report panel slide-in ───────────────────────────── */
#reportFormPanel > div {
  transition: transform .25s ease;
}

/* Optymalizacja wydajności i wizualna */
.spinner-sm {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Poprawa czytelności ikon emoji */
.menu-icon, .dash-panel-icon, .status-tile-icon {
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Android Emoji", sans-serif;
}

/* Nadpisy dla lepszej spójności (zamiast inline style) */
.dash-panel {
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.dash-panel-header {
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}

/* ─── KANBAN ─── */
.kanban-view {
  display: none;
}
.kanban-view.active {
  display: flex !important;
}
.kanban-cards-col::-webkit-scrollbar { width: 3px; }
.kanban-cards-col::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 99px; }
#kanban-board::-webkit-scrollbar { height: 5px; }
#kanban-board::-webkit-scrollbar-track { background: #f8fafc; }
#kanban-board::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 99px; }

/* ─── ROZSZERZENIE KARTY PACJENTA ─── */
#patientCardModal .modal-content {
  width: 820px !important;
}
#patientCardModal .modal-header {
  display: none; /* zastąpiony nowym headerem inline */
}
.patient-card-tab {
  white-space: nowrap;
}
/* Szybkie akcje w headerze karty */
#patientCardModal [id^="pcAction"],
#patientCardModal button[onclick^="switchPatientCardTab"] {
  transition: all .15s;
}
#patientCardModal button:hover {
  filter: brightness(.96);
}

/* ============================================================
   USER AVATARS — zdjęcia profilowe
   ============================================================ */

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.9);
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
  flex-shrink: 0;
  display: block;
}

.user-avatar-sm {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255,255,255,.9);
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  flex-shrink: 0;
  display: block;
}

.user-avatar-lg {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.9);
  box-shadow: 0 1px 6px rgba(0,0,0,.14);
  flex-shrink: 0;
  display: block;
}

/* Fallback initials avatar */
.user-avatar-initials {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.8);
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
  font-family: var(--font);
  letter-spacing: 0;
  text-transform: uppercase;
}

.user-avatar-initials.sm {
  width: 22px;
  height: 22px;
  font-size: 9px;
  border-width: 1.5px;
}

.user-avatar-initials.lg {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

/* Stacked avatars (np. w kanban) */
.avatars-stack {
  display: flex;
}
.avatars-stack .user-avatar,
.avatars-stack .user-avatar-initials {
  margin-left: -6px;
}
.avatars-stack .user-avatar:first-child,
.avatars-stack .user-avatar-initials:first-child {
  margin-left: 0;
}

/* ============================================================
   KANBAN — odświeżony styl
   ============================================================ */

.kanban-column-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  margin-bottom: 8px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--border);
}

.kanban-stage-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kanban-stage-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  flex: 1;
  font-family: var(--font);
}

.kanban-stage-count {
  font-size: 10px;
  font-weight: 600;
  background: var(--bg-main);
  color: var(--text-tertiary);
  padding: 1px 7px;
  border-radius: 99px;
  border: 1px solid var(--border);
}

.kanban-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px 9px;
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
  font-family: var(--font);
}

.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kanban-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.kanban-card-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--bg-main);
}

.attempt-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 99px;
  background: rgba(224,82,82,.1);
  color: var(--accent-red);
}

/* ============================================================
   LEAD CARD — nowe zgłoszenia
   ============================================================ */

.lead-responsible-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  flex-shrink: 0;
  object-fit: cover;
}


/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║ modal-overlay — bazowe style dla nowych modali (compose, admin, etc.)   ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  padding: 16px;
}
.modal-overlay.hidden { display: none !important; }

.modal-container {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.22), 0 4px 16px rgba(0,0,0,.10);
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-container .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}
.modal-container .modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}
.modal-container .modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}
.modal-container .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #f1f5f9;
  flex-shrink: 0;
  background: #fff;
}

/* ============================================================
   NAVIGATOR BRIEF v8 — Nowe klasy CSS
   ============================================================ */

/* --- Tabela połączeń — kierunki --- */
.dir-in   { color: #4f7fff; font-weight: 500; }
.dir-out  { color: #34c97e; font-weight: 500; }
.dir-miss { color: #9196a8; font-weight: 500; }

.dir-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500;
}

/* Tabela połączeń — waveform nagranie */
.waveform-wrap {
  display: inline-flex; align-items: center; gap: 6px;
}
.waveform-play {
  width: 22px; height: 22px; border-radius: 50%;
  background: #eef3ff; border: 1px solid #c7d7ff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.waveform-bars {
  display: inline-flex; align-items: center; gap: 1.5px; height: 16px;
}
.waveform-bars span {
  display: block; width: 2px; border-radius: 1px;
  background: #b5d4f4;
}
.waveform-time { font-size: 10px; color: #9196a8; }

/* Tabela połączeń — raport */
.report-link {
  font-size: 11px; color: #9196a8;
  border-bottom: 1px dashed #c5c8d4;
  cursor: pointer; white-space: nowrap;
}
.report-link.pending { color: #f0a843; border-bottom-color: #f0a843; }

/* --- Status badges kontaktów --- */
.st-badge {
  display: inline-block; font-size: 10px; font-weight: 500;
  padding: 2px 9px; border-radius: 20px; white-space: nowrap;
}
.st-a { background: #edf9f3; color: #1a7a4a; }  /* Aktywny */
.st-n { background: #eef3ff; color: #2a50b8; }  /* Nowy */
.st-c { background: #f4f0ff; color: #5b3db8; }  /* Kompleksowy */
.st-i { background: #f4f5f7; color: #9196a8; }  /* Nieaktywny */

/* --- Tagi kanałów komunikacji --- */
.chtag {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 8px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; padding: 2px 6px; border-radius: 10px;
}
.cht-ph { background: #edf9f3; color: #1a7a4a; }
.cht-em { background: #eef3ff; color: #2a50b8; }
.cht-fb { background: #e3f2fd; color: #1565c0; }
.cht-ig { background: linear-gradient(135deg,#fce4ec,#f3e5f5,#e8eaf6); color: #c2185b; }

/* --- Ikony kanałów kontaktów (tabela/grid) --- */
.ch-icon-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px;
  position: relative; flex-shrink: 0;
}
.ch-icon-wrap.ch-ph { background: #edf9f3; }
.ch-icon-wrap.ch-em { background: #eef3ff; }
.ch-icon-wrap.ch-ig { background: linear-gradient(135deg,#fce4ec,#f3e5f5,#e8eaf6); }
.ch-icon-wrap.ch-fb { background: #e3f2fd; }
.ch-icon-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 13px; height: 13px; border-radius: 10px;
  background: #4f7fff; color: #fff;
  font-size: 7px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 2px; border: 1.5px solid #fff;
}
.ch-icons-row { display: flex; gap: 4px; align-items: center; }

/* --- Stats bar (kontakty, zadania) --- */
.stats-bar {
  display: flex; align-items: center; gap: 0;
  background: #fff; border-bottom: 1px solid #e5e8f0;
  padding: 12px 24px;
}
.stats-bar-item {
  display: flex; flex-direction: column; padding: 0 24px;
  border-right: 1px solid #e5e8f0;
}
.stats-bar-item:first-child { padding-left: 0; }
.stats-bar-item:last-child { border-right: none; }
.stats-bar-value {
  font-size: 18px; font-weight: 200; line-height: 1.2;
  color: var(--text-primary);
}
.stats-bar-value.sv-green  { color: #34c97e; }
.stats-bar-value.sv-blue   { color: #4f7fff; }
.stats-bar-value.sv-purple { color: #8b7ff0; }
.stats-bar-value.sv-red    { color: #e05252; }
.stats-bar-value.sv-orange { color: #f0a843; }
.stats-bar-label {
  font-size: 9px; font-weight: 500; letter-spacing: .1em;
  text-transform: uppercase; color: #9196a8; margin-top: 2px;
}

/* --- Filter chips --- */
.filter-chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fchip {
  font-size: 11px; font-weight: 400;
  border-radius: 20px; border: 1px solid #e5e8f0;
  padding: 5px 13px; cursor: pointer;
  background: #fff; color: var(--text-secondary);
  transition: all .15s;
}
.fchip:hover { background: #f4f6f9; }
.fchip.active { background: #111827; color: #fff; border-color: #111827; }
.fchip.fc-complex { background: #f4f0ff; color: #5b3db8; border-color: #e0d8ff; }
.fchip.fc-complex.active { background: #5b3db8; color: #fff; border-color: #5b3db8; }

/* --- Toggle widoku lista/grid --- */
.view-toggle {
  display: flex; background: #f0f2f7; border-radius: 8px; padding: 3px; gap: 2px;
}
.vtoggle-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px; border: none;
  background: transparent; cursor: pointer; color: #9196a8;
  transition: all .15s;
}
.vtoggle-btn.active { background: #fff; color: #1a2033; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* --- Kanban karty zadań --- */
.tcard {
  background: #fff; border-radius: 12px; border: 1px solid #e5e8f0;
  padding: 14px; position: relative; overflow: hidden;
  transition: all .18s; cursor: pointer;
}
.tcard:hover { box-shadow: 0 4px 16px rgba(26,32,51,.1); transform: translateY(-1px); }
.tcard-accent { position: absolute; top: 0; left: 0; width: 3px; height: 100%; }
.tcard-accent.ta-urgent  { background: #e05252; }
.tcard-accent.ta-call    { background: #4f7fff; }
.tcard-accent.ta-email   { background: #34c97e; }
.tcard-accent.ta-task    { background: #f0a843; }
.tcard-accent.ta-default { background: #8b7ff0; }

.tc-type {
  font-size: 9px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 20px;
  display: inline-block;
}
.tc-type.tct-urgent  { background: #fff0f0; color: #c0392b; }
.tc-type.tct-call    { background: #eef3ff; color: #2a50b8; }
.tc-type.tct-email   { background: #f0faf4; color: #1a7a4a; }
.tc-type.tct-task    { background: #fff8ec; color: #a05f10; }

.tc-title {
  font-size: 12px; font-weight: 500; color: var(--text-primary);
  margin: 8px 0 6px; line-height: 1.4;
}
.tc-patient {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 300; color: #5c6070;
}
.tc-mini-avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: #111827; color: #fff;
  font-size: 8px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tc-note {
  border-left: 2px solid #e5e8f0; padding-left: 8px;
  font-size: 10px; color: #9196a8; margin-top: 6px; line-height: 1.4;
}
.tc-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
}
.tc-due { font-size: 10px; font-weight: 300; color: #9196a8; }
.tc-due.overdue { color: #e05252; }
.tc-progress {
  height: 2px; background: #f0f2f7; border-radius: 1px; margin-top: 8px; overflow: hidden;
}
.tc-progress-fill { height: 100%; background: #4f7fff; border-radius: 1px; }
.tcard.done { opacity: .6; }
.tcard.done .tc-title { text-decoration: line-through; color: #9196a8; }

/* Kanban kolumna */
.kanban-col {
  display: flex; flex-direction: column; gap: 8px;
  background: #f4f6f9; border-radius: 14px; padding: 14px;
  min-width: 0;
}
.kanban-col-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.kanban-col-title {
  font-size: 10px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: #9196a8;
}
.kanban-col-count {
  background: #e5e8f0; border-radius: 20px; padding: 1px 8px;
  font-size: 10px; font-weight: 500; color: #5c6070;
}
.kanban-add-btn {
  width: 100%; border: 1px dashed #d0d3de; border-radius: 10px;
  background: none; font-size: 11px; font-weight: 300; color: #9196a8;
  padding: 8px; cursor: pointer; margin-top: 4px; transition: all .15s;
}
.kanban-add-btn:hover { background: #fff; color: #5c6070; }

/* Kanban board */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 20px 24px;
  overflow-x: auto;
  flex: 1;
}

/* --- Summary strip (zadania) --- */
.summary-strip {
  display: flex; align-items: center; gap: 0;
  background: #fff; border-bottom: 1px solid #e5e8f0;
  padding: 10px 24px;
}
.summary-strip-item {
  display: flex; flex-direction: column; padding: 0 20px;
  border-right: 1px solid #e5e8f0;
}
.summary-strip-item:first-child { padding-left: 0; }
.summary-strip-item:last-child  { border-right: none; }
.summary-strip-value {
  font-size: 20px; font-weight: 200; line-height: 1.2;
  color: var(--text-primary);
}
.summary-strip-label {
  font-size: 9px; font-weight: 500; letter-spacing: .1em;
  text-transform: uppercase; color: #9196a8; margin-top: 1px;
}

/* --- Grid kontaktów --- */
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
  gap: 14px; padding: 20px 24px;
}
.cg-card {
  background: #fff; border-radius: 14px; border: 1px solid #e5e8f0;
  padding: 18px 14px; display: flex; flex-direction: column;
  align-items: center; text-align: center;
  transition: all .18s; cursor: pointer;
}
.cg-card:hover {
  box-shadow: 0 6px 20px rgba(26,32,51,.1);
  transform: translateY(-2px);
}
.cg-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 300; color: #fff;
  margin-bottom: 10px; flex-shrink: 0;
}
.cg-name {
  font-size: 12px; font-weight: 500; color: var(--text-primary);
  margin-bottom: 6px;
}
.cg-channels { display: flex; gap: 4px; justify-content: center; margin-bottom: 8px; }
.cg-last {
  font-size: 9px; font-weight: 300; color: #9196a8; margin-top: 4px;
}

/* --- Kontakty: opiekun cell --- */
.opiekun-cell {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 300; color: var(--text-secondary);
}
.online-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.online-dot.online  { background: #34c97e; }
.online-dot.offline { background: #9196a8; }

/* --- Kontakty: hover akcje --- */
.row-actions {
  display: flex; gap: 4px; align-items: center;
  opacity: 0; transition: opacity .15s;
}
tr:hover .row-actions { opacity: 1; }
.row-action-btn {
  width: 26px; height: 26px; border: 1px solid #e5e8f0;
  border-radius: 6px; background: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #9196a8; transition: all .15s;
}
.row-action-btn:hover { background: #f4f6f9; color: #1a2033; }

/* --- Mail: aktywna pozycja i unread --- */
.mail-item.active {
  border-left: 2px solid #4f7fff !important;
  padding-left: 14px !important;
  background: #f4f6f9 !important;
}
.unread-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4f7fff; flex-shrink: 0;
}
.mail-unread-badge {
  background: #eef3ff; color: #4f7fff;
  border-radius: 20px; padding: 1px 8px;
  font-size: 10px; font-weight: 500;
}

/* --- Login: nowy styl kart --- */
.login-user-card {
  width: 106px !important; min-width: 106px !important;
  border: 1px solid rgba(255,255,255,.06) !important;
  transition: transform .15s, background .15s, border-color .15s !important;
}
.login-user-card:hover {
  transform: translateY(-2px) !important;
  background: rgba(255,255,255,.05) !important;
}
.login-user-card.login-card-online {
  border-color: rgba(79,127,255,.55) !important;
  background: rgba(79,127,255,.1) !important;
}
.login-user-avatar {
  width: 62px !important; height: 62px !important;
  font-size: 20px !important; font-weight: 300 !important;
}

/* Online dot dla loginu */
.login-online-dot {
  position: absolute; bottom: 2px; right: 2px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #34c97e; border: 2px solid #0d1525;
}

/* --- Reply box poczty --- */
.reply-textarea,
#mailReplyTextarea,
.reply-box textarea {
  background: #f4f6f9 !important;
  border: 1px solid #e8eaf0 !important;
}

/* --- Przyciski Zadzwoń/Wyślij — czarne --- */
.btn-call-dark,
.call-btn-dark {
  background: #111827 !important;
  color: #fff !important;
  border: none !important;
}


/* ============================================================
   LOGIN v8 — dokładnie wg makiety navigator_login_screen.html
   ============================================================ */

.login-screen {
  position: fixed;
  inset: 0;
  background: #0d1525;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 40px 24px;
  overflow-y: auto;
  font-family: 'Montserrat', sans-serif;
}

/* Logo row */
.login-logo-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 28px;
}
.login-logo-icon {
  width: 40px; height: 40px; background: #1e2d4a; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.login-logo-brand { font-size: 9px; font-weight: 400; color: rgba(255,255,255,.35); letter-spacing: .18em; text-transform: uppercase; }
.login-logo-name  { font-size: 20px; font-weight: 300; color: #fff; letter-spacing: .04em; }

/* Tytuł */
.login-screen-title { font-size: 22px; font-weight: 200; color: #fff; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 6px; }
.login-screen-sub   { font-size: 12px; font-weight: 300; color: rgba(255,255,255,.35); letter-spacing: .06em; margin-bottom: 48px; }

/* Grupy */
.login-user-grid    { width: 100%; max-width: 700px; display: flex; flex-direction: column; gap: 32px; align-items: center; }
.login-role-section { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.login-role-label   { font-size: 9px; font-weight: 500; color: rgba(255,255,255,.22); letter-spacing: .22em; text-transform: uppercase; align-self: flex-start; padding-left: 2px; }
.login-role-sep     { width: 100%; height: 1px; background: rgba(255,255,255,.06); margin-top: -4px; }
.login-cards-row    { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

/* Karty użytkowników */
.login-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer; padding: 16px 14px 14px; border-radius: 14px;
  border: 1px solid rgba(255,255,255,.06); background: rgba(255,255,255,.03);
  transition: background .18s, border-color .18s, transform .18s;
  width: 106px; font-family: 'Montserrat', sans-serif; position: relative;
  text-align: center;
}
.login-card:hover { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); transform: translateY(-2px); }
.login-card.login-card-online   { border-color: rgba(79,127,255,.55); background: rgba(79,127,255,.1); }
.login-card.login-card-occupied { border-color: rgba(240,168,67,.45); background: rgba(240,168,67,.07); }

/* Avatar */
.login-card-avatar-wrap { position: relative; width: 62px; height: 62px; }
.login-online-dot {
  position: absolute; bottom: 2px; right: 2px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #34c97e; border: 2px solid #0d1525;
}
.login-card-name   { font-size: 12px; font-weight: 300; color: rgba(255,255,255,.8); letter-spacing: .04em; text-align: center; line-height: 1.3; }
.login-card-status { font-size: 10px; font-weight: 300; color: rgba(255,255,255,.28); }
.lcs-online   { color: #34c97e !important; }
.lcs-occupied { color: #f0a843 !important; }
.lcs-away     { color: rgba(255,255,255,.28); }

/* PIN modal */
.pin-dot {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.2); background: transparent; transition: all .12s;
}
.pin-dot.filled { background: #4f7fff; border-color: #4f7fff; box-shadow: 0 0 8px rgba(79,127,255,.5); }
.pin-dot.error  { background: #e05252; border-color: #e05252; animation: pinShake .3s ease; }
@keyframes pinShake {
  0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)}
}
.pin-key {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px; color: #e2e8f0; font-size: 18px; font-weight: 300;
  font-family: 'Montserrat', sans-serif; width: 64px; height: 64px;
  cursor: pointer; transition: all .12s;
}
.pin-key:hover  { background: rgba(255,255,255,.12); transform: scale(1.04); }
.pin-key:active { background: rgba(79,127,255,.25); }
.pin-key-del    { font-size: 20px; color: #9196a8; }
.pin-key-empty  { visibility: hidden; }
#pinModal       { display: none; }
#pinModal.active{ display: flex !important; }


/* ============================================================
   KARTA PACJENTA v8 — hero + zakładki + metryki
   ============================================================ */

/* Zakładki w hero sekcji */
.pc-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 18px 12px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,.4);
  cursor: pointer;
  letter-spacing: .04em;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.pc-tab:hover { color: rgba(255,255,255,.7); }
.pc-tab.active {
  color: #fff;
  border-bottom-color: #4f7fff;
  font-weight: 500;
}

/* Sekcje karty */
.pc-section { }
.pc-section.hidden { display: none !important; }

/* Pole danych (grid 2-kol) */
.pc-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pc-field-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #9196a8;
}
.pc-field-value {
  font-size: 12px;
  font-weight: 300;
  color: #1a2033;
}

/* Historia wizyt — timeline */
.pc-visit {
  display: flex;
  gap: 14px;
  padding-bottom: 16px;
  position: relative;
}
.pc-visit::before {
  content: '';
  position: absolute;
  left: 36px;
  top: 24px;
  bottom: 0;
  width: 1px;
  background: #e5e8f0;
}
.pc-visit:last-child::before { display: none; }
.pc-visit-date {
  width: 36px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.pc-visit-day { font-size: 16px; font-weight: 200; color: #1a2033; line-height: 1; }
.pc-visit-month { font-size: 8px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #9196a8; }
.pc-visit-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #34c97e; margin-top: 6px; flex-shrink: 0;
}
.pc-visit-content { flex: 1; padding-top: 2px; }
.pc-visit-title { font-size: 13px; font-weight: 400; color: #1a2033; margin-bottom: 4px; }
.pc-visit-badge {
  display: inline-block; font-size: 10px; font-weight: 500;
  padding: 2px 8px; border-radius: 20px;
}
.pcvb-done { background: #edf9f3; color: #1a7a4a; }
.pcvb-plan { background: #eef3ff; color: #2a50b8; }

/* Historia komunikacji — wiersz -->
.pc-comm {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid #f4f6f9;
}
.pc-comm:last-child { border-bottom: none; }
.pc-comm-dir {
  width: 20px; height: 20px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pcd-in  { background: #eef3ff; }
.pcd-out { background: #edf9f3; }
.pcd-mis { background: #f4f5f7; }
.pc-comm-body { flex: 1; min-width: 0; }
.pc-comm-title { font-size: 12px; font-weight: 400; color: #1a2033; }
.pc-comm-meta { font-size: 10px; font-weight: 300; color: #9196a8; }

/* Wskaźnik zaangażowania */
.pc-metric {
  display: flex; align-items: center; gap: 8px;
}
.pc-metric-label {
  font-size: 10px; font-weight: 300; color: rgba(255,255,255,.4);
  width: 60px; flex-shrink: 0;
}
.pc-metric-bar {
  flex: 1; height: 3px; background: rgba(255,255,255,.1); border-radius: 2px; overflow: hidden;
}
.pc-metric-fill { height: 100%; border-radius: 2px; transition: width .4s; }
.pc-metric-val {
  font-size: 11px; font-weight: 300; color: rgba(255,255,255,.5);
  width: 30px; text-align: right; flex-shrink: 0;
}

/* Ikony kanałów w hero */
.pc-ch-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  position: relative; flex-shrink: 0; cursor: pointer;
}
.pc-ch-icon .ch-count {
  position: absolute; top: -4px; right: -4px;
  min-width: 14px; height: 14px; border-radius: 8px;
  background: #4f7fff; color: #fff; font-size: 7px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 2px; border: 1.5px solid #111827;
}


/* ── patient-link: klikalne imię pacjenta (bez niebieskiego koloru) ── */
.patient-link {
  cursor: pointer;
  color: #1e293b;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dotted #94a3b8;
  padding-bottom: 1px;
  transition: all 0.15s ease;
}
.patient-link:hover {
  color: #0f172a;
  border-bottom-color: #475569;
  border-bottom-style: solid;
}
.patient-link:active {
  color: #3b82f6;
}

/* ── Report summary popup ── */
.report-summary-popup {
  position: fixed; z-index: 9999;
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.12);
  padding: 14px 16px; min-width: 240px; max-width: 320px;
  font-family: var(--font); animation: fadeIn .15s ease;
}
.report-summary-popup h4 {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: #9196a8; margin: 0 0 10px;
}
.report-summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; border-bottom: 1px solid #f4f6f9; font-size: 12px;
}
.report-summary-row:last-child { border-bottom: none; }
.report-summary-label { color: #9196a8; font-size: 11px; }
.report-summary-value { color: #1a2033; font-weight: 500; }

/* ── Social message channel tabs ── */
.social-tab-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 8px; border: 1px solid #e8eaf0;
  background: #f4f6f9; color: #5c6070; font-size: 12px;
  cursor: pointer; font-family: var(--font); transition: all .15s;
}
.social-tab-btn.active { background: #eff6ff; border-color: #bfdbfe; color: #3b82f6; }
.social-tab-btn:hover:not(.active) { background: #fff; }

/* ── Social message compose box ── */
.social-compose-box {
  border: 1px solid #e8eaf0; border-radius: 10px;
  background: #f8fafc; padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
