/* ============================================================================
   ZeroSpam PL — design system (jasny motyw)
   Kierunek: czysty, jasny panel operacyjny - biały sidebar z pogrupowaną
   nawigacją, czarno-biały system (bez kolorowego akcentu poza stronami
   statusów/logowania), pigułkowe badge'e statusów, karty z ikoną w szarym
   kole. Kolor pojawia się tylko tam gdzie niesie informację: statusy
   weryfikacji i gradient na stronie logowania.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-page: #f7f8fa;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-sidebar-active: #0f172a;
  --bg-sidebar-hover: #f1f5f9;
  --ink: #0f172a;
  --muted: #6b7280;
  --border: #e5e7eb;

  --accent: #0f172a;
  --accent-dark: #000000;
  --accent-soft: rgba(15, 23, 42, 0.08);

  --danger: #dc2626;
  --warning: #d97706;
  --success: #16a34a;
  --purple: #7c3aed;
  --orange: #ea580c;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 1px rgba(15, 23, 42, 0.03);

  /* Nadpisanie zmiennych Bootstrapa 5.3, żeby WSZYSTKIE istniejące klasy
     (btn-primary, badge bg-success, text-primary, bg-success, itd.) w całej
     aplikacji automatycznie przeszły na nową paletę - bez zmiany ani jednego
     innego pliku PHP. */
  --bs-body-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg-page);

  --bs-primary: var(--accent);
  --bs-primary-rgb: 15, 23, 42;
  --bs-link-color: var(--ink);
  --bs-link-hover-color: var(--accent-dark);

  --bs-success: var(--success);
  --bs-success-rgb: 22, 163, 74;
  --bs-danger: var(--danger);
  --bs-danger-rgb: 220, 38, 38;
  --bs-warning: var(--warning);
  --bs-warning-rgb: 217, 119, 6;
  --bs-secondary: var(--muted);
  --bs-secondary-rgb: 107, 114, 128;

  --bs-border-radius: var(--radius-sm);
  --bs-border-radius-sm: 6px;
  --bs-border-radius-lg: var(--radius);
}

body {
  background: var(--bg-page);
  color: var(--ink);
  font-size: 0.925rem;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Dane techniczne (adresy e-mail, domeny, hosty MX, kody SMTP, klucze API)
   zawsze w monospace - to one niosą tu informację, nie proza. */
code, .mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  background: rgba(15, 23, 42, 0.045);
  color: #1e293b;
  padding: 0.1em 0.4em;
  border-radius: 5px;
}
td code, .table code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* ---------- Layout: sidebar + topbar ---------- */
.sidebar {
  width: 252px;
  min-height: 100vh;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem;
}
.sidebar-brand {
  padding: 0.25rem 0.5rem;
  margin-bottom: 1.5rem !important;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.sidebar-brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-brand .fs-4 {
  font-size: 1.05rem !important;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.sidebar-brand .text-primary {
  color: var(--muted) !important;
  font-weight: 400;
}

#wrapper > .flex-grow-1 {
  min-width: 0;
}

.sidebar .nav-section-label {
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #9ca3af;
  padding: 0 0.6rem;
  margin: 1.1rem 0 0.35rem;
}
.sidebar .nav-section-label:first-of-type {
  margin-top: 0.25rem;
}

.sidebar .nav-link {
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: background 0.12s ease, color 0.12s ease;
}
.sidebar .nav-link svg {
  flex-shrink: 0;
  color: #9ca3af;
}
.sidebar .nav-link:hover {
  background: var(--bg-sidebar-hover);
  color: var(--ink);
}
.sidebar .nav-link.active {
  background: var(--bg-sidebar-active);
  color: #ffffff;
}
.sidebar .nav-link.active svg {
  color: #ffffff;
}
.sidebar hr {
  border-color: var(--border);
  margin: 0.85rem 0;
}

.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--border);
}
.card-stat {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  background: var(--bg-card);
}
.card-stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---------- Tables ---------- */
.table {
  --bs-table-bg: transparent;
  font-size: 0.89rem;
}
.table thead th {
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom-width: 1px;
  background: #fafbfc;
}
.table-responsive code,
td code {
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ---------- Status badges: jeden spójny słownik kolorów, pigułki z delikatnym tłem ---------- */
.badge {
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  padding: 0.38em 0.7em;
  border-radius: 999px;
}
.badge.bg-success { background-color: #dcfce7 !important; color: #15803d !important; }
.badge.bg-danger { background-color: #fee2e2 !important; color: #b91c1c !important; }
.badge.bg-warning { background-color: #fef3c7 !important; color: #b45309 !important; }
.badge.bg-secondary { background-color: #f1f5f9 !important; color: #475569 !important; }
.badge.bg-dark { background-color: #e5e7eb !important; color: #1f2937 !important; }
.badge.bg-light { background-color: #f8fafc !important; color: #64748b !important; border: 1px solid var(--border); }
.badge.bg-purple { background-color: #ede9fe !important; color: #6d28d9 !important; }
.badge.bg-orange { background-color: #ffedd5 !important; color: #c2410c !important; }

/* ---------- Forms & buttons ---------- */
.btn {
  font-weight: 500;
  border-radius: var(--radius-sm);
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}
.btn-outline-primary {
  color: var(--ink);
  border-color: #d1d5db;
}
.btn-outline-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.form-control:focus,
.form-select:focus {
  border-color: #9ca3af;
  box-shadow: 0 0 0 0.2rem var(--accent-soft);
}

.progress {
  height: 22px;
  border-radius: 999px;
  background-color: #f1f5f9;
}
.progress-bar {
  background-color: var(--accent);
}

/* Widoczny focus klawiatury - dostępność, nie tylko myszka. */
a:focus-visible,
button:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Strona logowania (split-screen) ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
}
.login-panel-brand {
  flex: 1 1 46%;
  background:
    radial-gradient(900px 500px at 15% 15%, rgba(124, 58, 237, 0.35), transparent 60%),
    linear-gradient(165deg, #1e1b4b 0%, #0f172a 55%, #020617 100%);
  color: #fff;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-panel-brand .brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.1rem;
}
.login-panel-brand .brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-panel-brand h1 {
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  max-width: 420px;
}
.login-panel-brand p.lead-sub {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
  max-width: 420px;
}
.login-feature {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.88rem;
  margin-bottom: 0.9rem;
}
.login-feature-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.login-panel-brand footer {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.78rem;
}
.login-panel-form {
  flex: 1 1 54%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 2rem;
}
.login-panel-form .login-form-inner {
  width: 100%;
  max-width: 360px;
}
@media (max-width: 860px) {
  .login-page { flex-direction: column; }
  .login-panel-brand, .login-panel-form { flex: none; }
  .login-panel-brand { padding: 2rem; }
}
