:root {
  --bg1: #7a1a5d;
  --bg2: #3a0b55;
  --panel: rgba(255, 255, 255, 0.08);
  --panel2: rgba(255, 255, 255, 0.06);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.70);
  --border: rgba(255, 255, 255, 0.14);
  --btn: rgba(255, 255, 255, 0.14);
  --btnHover: rgba(255, 255, 255, 0.20);
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.15);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.15);
  --incoming: #22d3ee;
  --outgoing: #a78bfa;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: 
    radial-gradient(1200px 800px at 25% 10%, rgba(255, 70, 130, 0.40), transparent 55%),
    radial-gradient(900px 600px at 75% 30%, rgba(140, 60, 255, 0.35), transparent 60%),
    linear-gradient(135deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
  min-height: 100vh;
}

/* ========== TOPBAR ========== */
.topbar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand { display: flex; align-items: center; gap: 10px; }

.mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mark svg {
  width: 22px;
  height: 22px;
  stroke: var(--text);
}

.brandname { font-weight: 700; letter-spacing: 0.06em; font-size: 11px; opacity: 0.85; }
.brandapp { font-weight: 800; font-size: 17px; margin-top: 1px; }

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-name {
  font-size: 13px;
  color: var(--muted);
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

/* ========== LOGIN SCREEN ========== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 48px 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.mark-large {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}
.mark-large svg {
  width: 36px;
  height: 36px;
}

.login-brandtext .brandname {
  font-size: 13px;
}
.login-brandtext .brandapp {
  font-size: 24px;
}

.login-description {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 32px;
}

.btn-large {
  width: 100%;
  padding: 14px 24px;
  font-size: 15px;
  gap: 12px;
}

.login-error {
  margin-top: 20px;
  padding: 12px 16px;
  background: var(--danger-bg);
  border-radius: 8px;
  color: var(--danger);
  font-size: 13px;
}

.login-loading {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

/* ========== APP CONTAINER ========== */
.app-container {
  display: block;
}

/* ========== LICENSE ERROR ========== */
.license-error {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.license-error-card {
  background: var(--panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 48px 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.license-error-icon {
  width: 64px;
  height: 64px;
  stroke: var(--warning);
  margin-bottom: 20px;
}

.license-error-card h2 {
  margin: 0 0 12px 0;
  font-size: 24px;
}

.license-error-card p {
  margin: 0 0 16px 0;
  line-height: 1.6;
}

.license-error-card .btn {
  margin-top: 16px;
}

/* ========== TABS ========== */
.tabs-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 18px;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}
.tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.tab.is-active {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

.tab-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.badge {
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* ========== CONTENT ========== */
.content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 18px 40px;
}

.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
}

.panel-header { margin-bottom: 20px; }
.panel-header h1 { margin: 0 0 6px; font-size: 24px; font-weight: 700; }
.muted { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }

.is-hidden { display: none !important; }

/* ========== DATE SELECTOR ========== */
.date-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.date-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.date-btn {
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  background: var(--btn);
  color: var(--text);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.date-btn:hover {
  background: var(--btnHover);
}

.date-btn.active {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.3);
}

.date-calendar-wrapper {
  position: relative;
}

.btn-icon-only {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--btn);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s ease;
}

.btn-icon-only:hover {
  background: var(--btnHover);
}

.btn-icon-only svg {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  stroke: currentColor;
  fill: none;
}

.date-calendar-popup {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: rgba(40, 20, 60, 0.98);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  min-width: 280px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.calendar-header span {
  font-weight: 600;
  font-size: 14px;
}

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

.calendar-day-header {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  padding: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  border: none;
  background: transparent;
  color: var(--text);
}

.calendar-day:hover:not(.disabled):not(.empty) {
  background: var(--btnHover);
}

.calendar-day.today {
  background: rgba(255, 255, 255, 0.1);
  font-weight: 600;
}

.calendar-day.selected {
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.calendar-day.disabled {
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
}

.calendar-day.empty {
  cursor: default;
}

.date-selected {
  font-size: 13px;
  color: var(--muted);
  margin-left: auto;
}

/* ========== FILTERS ========== */
.filters {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.field-wide { flex: 1; min-width: 200px; }

input, select, textarea {
  background: rgba(0, 0, 0, 0.20);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(255, 255, 255, 0.35);
}
textarea { resize: vertical; min-height: 60px; }
select { cursor: pointer; }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--btn);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}
.btn:hover { background: var(--btnHover); }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-small { padding: 8px 12px; font-size: 13px; }
.btn-ghost { background: transparent; }
.btn-primary { background: var(--info); border-color: var(--info); }
.btn-primary:hover { background: #2563eb; }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-success:hover { background: #16a34a; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #000; }
.btn-warning:hover { background: #d97706; }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; }

.btn-icon { width: 16px; height: 16px; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ========== LOADING & EMPTY STATES ========== */
.loading-state, .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}
.spinner-small { width: 20px; height: 20px; border-width: 2px; }

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

.loading-state span { color: var(--muted); font-size: 14px; }

/* Progress bar */
.progress-container {
  margin-top: 16px;
  width: 100%;
  max-width: 300px;
}
.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--bg1), #a855f7);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
  animation: progress-pulse 1.5s ease-in-out infinite;
}
@keyframes progress-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.progress-text {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.empty-icon {
  width: 64px;
  height: 64px;
  stroke: var(--muted);
  margin-bottom: 16px;
  opacity: 0.6;
}
.empty-state h3 { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.empty-state p { margin: 0; color: var(--muted); font-size: 14px; }

/* Pasek ładowania dziennikarzy nad listą */
.journalists-loading-bar {
  background: rgba(122, 26, 93, 0.3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.loading-bar-content {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.loading-bar-content span {
  font-size: 13px;
  color: var(--muted);
}
.loading-bar-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}
.loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--bg1), #a855f7, var(--bg1));
  background-size: 200% 100%;
  border-radius: 2px;
  width: 30%;
  animation: loading-bar-animate 1.5s ease-in-out infinite;
}
@keyframes loading-bar-animate {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Stan ładowania dla kart interakcji */
.interactions-list.is-loading {
  pointer-events: none;
}
.interactions-list.is-loading .interaction-card {
  opacity: 0.5;
  animation: card-pulse 1.5s ease-in-out infinite;
}
@keyframes card-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.3; }
}
.interaction-card.is-matched {
  animation: none;
  opacity: 1;
}
.interaction-card.is-matching {
  opacity: 0.6;
}
.interaction-card.is-matching .interaction-actions {
  pointer-events: none;
  opacity: 0.5;
}
.matching-placeholder {
  color: var(--muted);
  font-style: italic;
  font-size: 13px;
}

.loading-state-small, .empty-state-small {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  color: var(--muted);
  font-size: 14px;
}

/* ========== INTERACTIONS LIST ========== */
.interactions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.interaction-card {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  transition: border-color 0.15s ease;
}
.interaction-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
}
.interaction-card.is-matched {
  border-left: 3px solid var(--success);
}
.interaction-card.is-unmatched {
  border-left: 3px solid var(--warning);
}

.interaction-direction {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.interaction-direction.incoming {
  background: rgba(34, 211, 238, 0.15);
}
.interaction-direction.outgoing {
  background: rgba(167, 139, 250, 0.15);
}
.interaction-direction svg {
  width: 24px;
  height: 24px;
}
.interaction-direction.incoming svg { stroke: var(--incoming); }
.interaction-direction.outgoing svg { stroke: var(--outgoing); }

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

.interaction-journalist {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.interaction-journalist .unmatched-badge {
  font-size: 11px;
  font-weight: 500;
  background: var(--warning-bg);
  color: var(--warning);
  padding: 2px 8px;
  border-radius: 6px;
}

.interaction-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}
.interaction-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.interaction-meta-item svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

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

/* ========== SETTINGS ========== */
.settings-section {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.settings-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.settings-section h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
}

/* ========== HISTORY CARDS ========== */
.history-card {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  transition: border-color 0.15s ease;
}
.history-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
}
.history-card.is-owner {
  border-left: 3px solid var(--primary);
}
.history-card .interaction-notes {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}
.history-card .client-badge {
  background: rgba(122, 26, 93, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin-left: 8px;
}
.history-card .owner-tag {
  color: var(--muted);
  font-size: 12px;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 8px;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}
.btn-ghost.btn-danger {
  color: var(--error);
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-ghost.btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* Field checkbox inline */
.field-checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.field-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}
.field-checkbox span {
  margin-bottom: 0;
}

.info-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.info-row {
  display: flex;
  gap: 12px;
  font-size: 14px;
}
.info-label {
  color: var(--muted);
  min-width: 140px;
}
.info-value {
  font-weight: 500;
}

.admin-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.ignored-numbers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.ignored-number-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}
.ignored-number-value {
  font-family: monospace;
  font-size: 14px;
}

/* ========== DEBUG PANEL ========== */
.debug-form {
  display: grid;
  grid-template-columns: 200px 200px 1fr;
  gap: 12px;
  align-items: end;
}

.status {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  min-height: 20px;
}

.tablewrap {
  margin-top: 16px;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
}
.table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(0, 0, 0, 0.12);
}
.table th, .table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  white-space: nowrap;
  text-align: left;
}
.table th {
  color: rgba(255, 255, 255, 0.80);
  background: rgba(0, 0, 0, 0.15);
  font-weight: 600;
}
.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.60);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal {
  background: linear-gradient(180deg, #4a1842, #2d0a3e);
  border: 1px solid var(--border);
  border-radius: 18px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-small { max-width: 400px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { margin: 0; font-size: 18px; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-interaction-info {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 14px;
}
.modal-interaction-info .journalist-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
.modal-interaction-info .meta-row {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}

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

/* ========== ASSIGN PHONE MODAL ========== */
.assign-info {
  margin: 0;
  font-size: 14px;
}
.assign-info strong {
  color: var(--info);
}

.assign-search-results {
  max-height: 180px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 8px;
}

.assign-search-result {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.assign-search-result:hover {
  background: rgba(255, 255, 255, 0.08);
}
.assign-search-result-name {
  font-weight: 600;
  font-size: 14px;
}
.assign-search-result-media {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.assign-selected-journalist {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.assign-selected-journalist h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: var(--info);
}

.assign-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.assign-detail-row {
  display: flex;
  gap: 8px;
  font-size: 13px;
}
.assign-label {
  color: var(--muted);
  min-width: 80px;
}

.assign-phone-choice {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.assign-phone-choice > p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.assign-phone-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.assign-phone-option:hover {
  border-color: rgba(255, 255, 255, 0.25);
}
.assign-phone-option:has(input:checked) {
  border-color: var(--info);
  background: rgba(34, 211, 238, 0.08);
}
.assign-phone-option input {
  margin-top: 2px;
}
.assign-phone-option span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.assign-phone-option strong {
  font-size: 14px;
}
.assign-current-value {
  font-size: 12px;
  color: var(--muted);
}
.assign-current-value:empty::before {
  content: '(brak)';
  font-style: italic;
}

.assign-overwrite-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid var(--warning);
  border-radius: 8px;
  color: var(--warning);
  font-size: 13px;
}
.assign-overwrite-warning svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.assign-new-contact {
  text-align: center;
  padding-top: 8px;
}
.assign-new-contact a {
  color: var(--info);
  text-decoration: none;
}
.assign-new-contact a:hover {
  text-decoration: underline;
}

/* ========== TOAST ========== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1100;
}

.toast {
  background: #1e1e2e;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  min-width: 280px;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.25s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info { border-left: 3px solid var(--info); }

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.toast.success .toast-icon { stroke: var(--success); }
.toast.error .toast-icon { stroke: var(--danger); }
.toast.warning .toast-icon { stroke: var(--warning); }
.toast.info .toast-icon { stroke: var(--info); }

.toast-message {
  flex: 1;
  font-size: 14px;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========== CLIENTS MULTISELECT DROPDOWN ========== */
.clients-dropdown {
  background: #e9ecef;
  border: 1px solid #ced4da;
  border-radius: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.client-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.12s ease;
  border-bottom: 1px solid #ced4da;
  color: #212529;
}
.client-option:last-child {
  border-bottom: none;
}
.client-option:hover {
  background: #dee2e6;
}
.client-option.is-selected {
  background: #e7f1ff;
}
.client-option input[type="checkbox"] {
  display: none;
}

.client-option-check {
  width: 20px;
  height: 20px;
  border: 2px solid #adb5bd;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.12s ease;
  background: white;
}
.client-option-check svg {
  width: 14px;
  height: 14px;
  opacity: 0;
  stroke: white;
}
.client-option.is-selected .client-option-check {
  background: #0d6efd;
  border-color: #0d6efd;
}
.client-option.is-selected .client-option-check svg {
  opacity: 1;
}

.client-logo {
  width: 60px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}
.client-logo-letter {
  width: 32px;
  height: 28px;
  background: #dee2e6;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #495057;
  flex-shrink: 0;
}

.client-option-name {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
  color: #212529 !important;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .date-selector {
    flex-direction: column;
    align-items: stretch;
  }
  
  .date-buttons {
    order: 2;
  }
  
  .date-calendar-wrapper {
    order: 1;
  }
  
  .date-selected {
    order: 3;
    margin-left: 0;
    text-align: center;
  }
  
  .date-calendar-popup {
    left: 0;
    right: auto;
  }
  
  .filters {
    flex-direction: column;
    align-items: stretch;
  }
  .filters .field { width: 100%; }
  .filters .btn { width: 100%; justify-content: center; }
  
  .interaction-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .interaction-direction {
    width: 36px;
    height: 36px;
  }
  .interaction-actions {
    width: 100%;
  }
  .interaction-actions .btn {
    flex: 1;
    justify-content: center;
  }
  
  .debug-form {
    grid-template-columns: 1fr;
  }
  
  .modal {
    margin: 10px;
    max-height: calc(100vh - 20px);
  }
}
