/* ═══════════════════════════════════════════════════
   AML RISK SCORING — DESIGN SYSTEM
   Dark professional theme with sharp green accents
═══════════════════════════════════════════════════ */

:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --bg-card2: #1c2128;
  --bg-hover: #21262d;
  --border: #30363d;
  --border-light: #21262d;
  --text: #e6edf3;
  --text-secondary: #8b949e;
  --muted: #6e7681;
  --accent: #00e5a0;
  --accent-dim: rgba(0,229,160,0.12);
  --accent-hover: #00c98a;
  --blue: #58a6ff;
  --blue-dim: rgba(88,166,255,0.12);
  --orange: #f0883e;
  --orange-dim: rgba(240,136,62,0.12);
  --red: #f85149;
  --red-dim: rgba(248,81,73,0.12);
  --green: #3fb950;
  --green-dim: rgba(63,185,80,0.12);
  --yellow: #d29922;
  --yellow-dim: rgba(210,153,34,0.12);
  --purple: #a371f7;
  --purple-dim: rgba(163,113,247,0.12);
  --sidebar-width: 240px;
  --topbar-h: 56px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --font: 'Outfit', system-ui, sans-serif;
  --mono: 'DM Mono', monospace;
}

/* ── LIGHT THEME ─────────────────────────────────── */
[data-theme="light"] {
  --bg: #f6f8fa;
  --bg-card: #ffffff;
  --bg-card2: #f0f2f5;
  --bg-hover: #e8eaed;
  --border: #d0d7de;
  --border-light: #e8eaed;
  --text: #1c2128;
  --text-secondary: #57606a;
  --muted: #6e7781;
  --shadow: 0 4px 24px rgba(0,0,0,0.1);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
}

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

html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

input, textarea, select, button {
  font-family: var(--font);
  font-size: 14px;
  outline: none;
}

a { color: var(--accent); text-decoration: none; }

/* ═══════════════════════════════════════════════════
   UTILITIES
═══════════════════════════════════════════════════ */
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-size: 13px; }
.text-muted { color: var(--muted); }
.text-error { color: var(--red); }
.text-success { color: var(--green); }
.text-warning { color: var(--yellow); }

/* ═══════════════════════════════════════════════════
   SPINNER
═══════════════════════════════════════════════════ */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
.spinner-lg {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page-loading {
  display: flex; align-items: center; justify-content: center;
  min-height: 300px;
}

/* ═══════════════════════════════════════════════════
   LOGIN
═══════════════════════════════════════════════════ */
.page-login {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background: var(--bg);
}

.login-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(0,229,160,0.06) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(88,166,255,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.login-card {
  width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(0,229,160,0.05);
  position: relative; z-index: 1;
  animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-logo {
  text-align: center; margin-bottom: 32px;
}
.login-logo h1 {
  font-size: 24px; font-weight: 700; margin: 12px 0 4px;
}
.login-logo p {
  font-size: 13px; color: var(--muted);
}

.logo-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #000;
  font-family: var(--mono); font-weight: 500; font-size: 13px;
  padding: 4px 10px; border-radius: 6px;
  letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════════
   FORM FIELDS
═══════════════════════════════════════════════════ */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  margin-bottom: 6px;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,229,160,0.12);
}
.field textarea { resize: vertical; min-height: 80px; }
.field select { cursor: pointer; }
.field-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}

.input-wrap { position: relative; }
.input-wrap input { padding-right: 44px; }
.btn-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 4px;
  transition: color 0.15s;
}
.btn-eye:hover { color: var(--text); }
.btn-eye svg { width: 18px; height: 18px; display: block; }

.field-group { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 16px; }

.error-msg {
  background: var(--red-dim); border: 1px solid rgba(248,81,73,0.3);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: var(--red); font-size: 13px; margin-bottom: 12px;
}

/* ═══════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #000;
  font-weight: 600; font-size: 14px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  border: none; cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-full { width: 100%; }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-card2); color: var(--text);
  font-weight: 500; font-size: 14px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--text-secondary); }
.btn-secondary.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-danger {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red-dim); color: var(--red);
  font-weight: 600; font-size: 14px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  border: 1px solid rgba(248,81,73,0.3); cursor: pointer;
  transition: background 0.15s;
}
.btn-danger:hover { background: rgba(248,81,73,0.2); }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-sm); cursor: pointer;
  color: var(--muted); transition: all 0.15s;
}
.btn-icon svg { width: 15px; height: 15px; }
.btn-icon:hover { background: var(--bg-hover); border-color: var(--border); color: var(--text); }
.btn-icon--danger:hover { background: var(--red-dim); border-color: rgba(248,81,73,0.3); color: var(--red); }

.btn-link {
  background: none; border: none; cursor: pointer;
  color: var(--accent); font-size: 13px; padding: 0;
}
.btn-link:hover { color: var(--accent-hover); }

.btn-logout {
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 6px; border-radius: 6px;
  display: flex; align-items: center; transition: color 0.15s, background 0.15s;
  margin-left: auto;
}
.btn-logout svg { width: 18px; height: 18px; }
.btn-logout:hover { color: var(--red); background: var(--red-dim); }

/* ═══════════════════════════════════════════════════
   APP LAYOUT
═══════════════════════════════════════════════════ */
.app {
  display: flex; min-height: 100vh;
}

/* ═══════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.25s ease;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-light);
}
.logo-text { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }

.sidebar-nav {
  flex: 1; padding: 16px 12px;
}

.nav-section-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  color: var(--muted); padding: 0 8px; margin-bottom: 4px; margin-top: 8px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
  text-decoration: none; border: none; background: none;
  width: 100%;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}
.nav-item.active svg { stroke: var(--accent); }

.sidebar-user {
  padding: 16px 16px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}

.user-avatar {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent); color: #000;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 12px; color: var(--muted); }

/* ═══════════════════════════════════════════════════
   MAIN
═══════════════════════════════════════════════════ */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left 0.25s ease;
}

.app.sidebar-collapsed .main { margin-left: 0; }
.app.sidebar-collapsed .sidebar { transform: translateX(-100%); }

.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky; top: 0; z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.btn-sidebar-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 6px; border-radius: 6px;
  display: flex; transition: all 0.15s;
}
.btn-sidebar-toggle svg { width: 20px; height: 20px; }
.btn-sidebar-toggle:hover { color: var(--text); background: var(--bg-hover); }

.page-title { font-size: 16px; font-weight: 600; }

.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted);
}
.status-dot.active { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.status-text { font-size: 13px; color: var(--muted); }

.content { flex: 1; padding: 24px; }

/* ═══════════════════════════════════════════════════
   PAGE
═══════════════════════════════════════════════════ */
.page { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.page-toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}

.search-wrap {
  display: flex; align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  gap: 8px;
}
.search-wrap svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.search-wrap input {
  background: none; border: none;
  padding: 9px 0; color: var(--text);
  width: 240px;
}
.search-wrap input:focus { outline: none; }
.search-wrap input::placeholder { color: var(--muted); }

/* ═══════════════════════════════════════════════════
   DASHBOARD
═══════════════════════════════════════════════════ */
.dashboard-page {}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--border); }

.stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon--blue { background: var(--blue-dim); color: var(--blue); }
.stat-icon--green { background: var(--green-dim); color: var(--green); }
.stat-icon--orange { background: var(--orange-dim); color: var(--orange); }
.stat-icon--red { background: var(--red-dim); color: var(--red); }

.stat-value { font-size: 28px; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.dashboard-charts {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.chart-card--wide {}

.chart-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.chart-header h3 { font-size: 14px; font-weight: 600; }
.chart-legend {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-secondary);
}
.legend-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}

.chart-wrap { height: 200px; position: relative; }
.chart-wrap--donut { height: 160px; }

.donut-legend { margin-top: 12px; }
.donut-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}
.donut-item:last-child { border-bottom: none; }
.donut-item strong { margin-left: auto; font-family: var(--mono); }

.dashboard-bottom {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.form-status-list { padding: 8px 0; }
.form-status-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}
.form-status-item:last-child { border-bottom: none; }
.fsi-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.fsi--grey .fsi-icon { color: var(--muted); }
.fsi--blue .fsi-icon { color: var(--blue); }
.fsi--green .fsi-icon { color: var(--green); }
.fsi--red .fsi-icon { color: var(--red); }
.fsi-label { flex: 1; }
.fsi-count { font-family: var(--mono); font-weight: 600; font-size: 18px; }

/* ═══════════════════════════════════════════════════
   TABLE
═══════════════════════════════════════════════════ */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.table-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.table-card-header h3 { font-size: 14px; font-weight: 600; }

.data-table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 12px; font-weight: 600;
  color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--bg-card2);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr.clickable-row { cursor: pointer; }

.table-footer {
  padding: 10px 16px;
  font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--border-light);
  background: var(--bg-card2);
}

.firm-name-cell {
  display: flex; flex-direction: column; gap: 2px;
}
.firm-name-cell strong { font-weight: 600; }

.action-btns { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }

.empty-state {
  padding: 60px 24px; text-align: center;
  color: var(--muted);
}
.empty-state svg { margin: 0 auto 16px; display: block; }
.empty-state p { font-size: 15px; }

/* ═══════════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.badge--niskie  { background: var(--green-dim); color: var(--green); }
.badge--standardowe { background: var(--blue-dim); color: var(--blue); }
.badge--wysokie { background: var(--yellow-dim); color: var(--yellow); }
.badge--krytyczne { background: var(--red-dim); color: var(--red); }
.badge--green   { background: var(--green-dim); color: var(--green); }
.badge--blue    { background: var(--blue-dim); color: var(--blue); }
.badge--grey    { background: rgba(110,118,129,0.15); color: var(--muted); }
.badge--red     { background: var(--red-dim); color: var(--red); }
.badge--purple  { background: var(--purple-dim); color: var(--purple); }

/* ═══════════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%; max-width: 760px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
  animation: slideUp 0.2s ease;
}

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

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }

.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 4px; border-radius: 6px;
  display: flex; transition: all 0.15s;
}
.modal-close svg { width: 18px; height: 18px; }
.modal-close:hover { color: var(--text); background: var(--bg-hover); }

.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
   GUS RESULT
═══════════════════════════════════════════════════ */
.gus-result {
  margin-top: 8px; padding: 8px 12px;
  background: var(--bg-card2); border-radius: var(--radius-sm);
  font-size: 13px; min-height: 34px;
  display: flex; align-items: center;
}

/* ═══════════════════════════════════════════════════
   INFO BOX
═══════════════════════════════════════════════════ */
.info-box {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--blue-dim); border: 1px solid rgba(88,166,255,0.2);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 13px; color: var(--blue); margin-top: 4px;
}

/* ═══════════════════════════════════════════════════
   FIRM DETAIL
═══════════════════════════════════════════════════ */
.firm-detail { display: flex; flex-direction: column; gap: 0; }

.detail-section {
  padding: 0 0 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}
.detail-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.detail-section h4 { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.05em; }

.detail-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 20px;
}
.detail-item { display: flex; flex-direction: column; gap: 3px; }
.detail-item label { font-size: 12px; color: var(--muted); }
.detail-item span { font-size: 14px; }

.notatka-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 13px; color: var(--text-secondary);
  white-space: pre-wrap;
}

.person-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border-light);
}
.person-card:last-child { border-bottom: none; }
.person-avatar {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--accent-dim); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; font-weight: 600; flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999;
}

.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  box-shadow: var(--shadow);
  min-width: 280px; max-width: 400px;
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
}
.toast.visible { transform: translateX(0); }
.toast-icon { font-size: 16px; flex-shrink: 0; }

.toast--success { border-left: 3px solid var(--green); }
.toast--success .toast-icon { color: var(--green); }
.toast--error { border-left: 3px solid var(--red); }
.toast--error .toast-icon { color: var(--red); }
.toast--info { border-left: 3px solid var(--blue); }
.toast--info .toast-icon { color: var(--blue); }
.toast--warning { border-left: 3px solid var(--yellow); }
.toast--warning .toast-icon { color: var(--yellow); }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-charts { grid-template-columns: 1fr; }
  .dashboard-bottom { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 220px; }
  .content { padding: 16px; }
}

@media (max-width: 700px) {
  .app .sidebar { transform: translateX(-100%); }
  .app .main { margin-left: 0; }
  .app.sidebar-open .sidebar { transform: translateX(0); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .login-card { width: 100%; max-width: 400px; padding: 28px 24px; }
}

@media (max-width: 500px) {
  .stats-grid { grid-template-columns: 1fr; }
  .data-table { font-size: 13px; }
  .data-table th, .data-table td { padding: 10px 12px; }
}

/* ═══════════════════════════════════════════════════
   DASHBOARD — SUPPORT CARD
═══════════════════════════════════════════════════ */
.support-card {
  background: var(--card);
  border-radius: 12px;
  padding: 20px 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
  border: 1px solid var(--border);
}
.support-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  flex: 0 0 auto;
  color: var(--text);
}
.support-contacts {
  display: flex;
  gap: 32px;
  align-items: center;
  flex-wrap: wrap;
  flex: 1;
}
.support-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.support-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.support-icon--blue   { background: rgba(59,130,246,.12); color: #3b82f6; }
.support-icon--orange { background: rgba(245,158,11,.12);  color: #f59e0b; }
.support-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
}
a.support-link:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════
   DASHBOARD — KOMUNIKATY
═══════════════════════════════════════════════════ */
.komunikaty-list { padding: 4px 0; }
.komunikat-item {
  display: flex;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.komunikat-item:last-child { border-bottom: none; }
.komunikat-date {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  min-width: 82px;
  padding-top: 2px;
}
.komunikat-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}
.komunikat-body {
  font-size: 12px;
  margin-top: 3px;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════
   DASHBOARD — helpers
═══════════════════════════════════════════════════ */
.stat-sub-row { font-size: 13px; margin-top: 4px; line-height: 1.4; }
.text-green   { color: #22c55e; }
.table-sub    { font-size: 12px; color: var(--muted); display: block; margin-top: 2px; font-weight: 400; }

/* ═══════════════════════════════════════════════════
   SKELETON LOADERS
═══════════════════════════════════════════════════ */
@keyframes skeleton-wave {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-card2) 50%, var(--bg-hover) 75%);
  background-size: 800px 100%;
  animation: skeleton-wave 1.4s infinite linear;
  border-radius: var(--radius-sm);
}
.skeleton-wrap { padding: 12px 0; }
.skeleton-row {
  height: 52px;
  margin: 4px 16px;
  border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════════════
   NAV BADGE (expiring count)
═══════════════════════════════════════════════════ */
.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ═══════════════════════════════════════════════════
   THEME TOGGLE BUTTON
═══════════════════════════════════════════════════ */
.btn-theme-toggle {
  color: var(--text-secondary);
  margin-right: 8px;
}
.btn-theme-toggle:hover { color: var(--text); }
.btn-theme-toggle svg { width: 18px; height: 18px; }

/* ═══════════════════════════════════════════════════
   MOBILE RESPONSIVE
═══════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-charts { grid-template-columns: 1fr; }
  .dashboard-bottom { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 240px; }

  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.sidebar--open { transform: translateX(0); }

  .main { margin-left: 0 !important; }

  .topbar {
    left: 0 !important;
    width: 100% !important;
  }

  /* Overlay kiedy sidebar otwarty */
  .sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 299;
  }
  .sidebar-backdrop.active { display: block; }

  /* Tabele przewijalne */
  .table-card  { overflow-x: auto; }
  .data-table  { min-width: 620px; }

  /* Mniejsze paddingi */
  .page { padding: 16px; }
  .page-toolbar { flex-wrap: wrap; gap: 8px; }
  .search-wrap { min-width: 100%; }

  /* Modal — dolna szuflada na mobile */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 95vh;
  }

  /* Ukryj status tekst */
  .status-text { display: none; }

  .stats-grid { grid-template-columns: 1fr; }
}

/* ── Zakładki (wyciągi bankowe i inne) ─────────────────────── */
.tab-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
  font-family: inherit;
}
.tab-btn:hover { color: var(--text); }
.tab-btn--active { color: var(--accent) !important; border-bottom-color: var(--accent); }
