/* TORIS — TYMCZASOWY arkusz dla STAREGO wyglądu (v1): tylko nowe komponenty używane przez
   przebudowane widoki (pulpit, portal, znaczki statusów, ikony). Nie zmienia kolorów ani układu v1.
   Do usunięcia razem ze starym wyglądem (patrz app\core\helpers\Ui). */

:root {
  --brand-dark: #07090F;
  --sidebar-active: #151A26;
  --sidebar-card: #11151F;
  --sidebar-text: #C7CDDA;
  --sidebar-label: #8F98AB;
  --bg: #F3F5F9;
  --surface: #FFFFFF;
  --border: #E4E8F0;
  --divider: #EEF1F6;
  --input-border: #D5DAE4;
  --text: #0B1220;
  --text-2: #3A4256;
  --muted: #5B6478;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-soft: #E8F0FE;
  --thead-bg: #FAFBFD;

  /* statusy: tło / tekst */
  --st-blue-bg: #E8F0FE;   --st-blue: #1D4ED8;
  --st-green-bg: #E7F7F1;  --st-green: #047857;
  --st-orange-bg: #FFF1E6; --st-orange: #C2410C;
  --st-gray-bg: #EEF1F6;   --st-gray: #3A4256;
  --st-red-bg: #FDECEC;    --st-red: #B91C1C;
  --st-violet-bg: #F1EEFD; --st-violet: #6D28D9;

  /* wykresy: para rozróżnialna przy zaburzeniach widzenia barw */
  --chart-1: #2563EB;
  --chart-2: #F59E0B;

  --success: #047857;
  --danger-border: #F3B4B4;
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, .28);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-mono: ui-monospace, Consolas, monospace;

  --radius-card: 16px;
  --radius-ctl: 10px;
  --sidebar-w: 248px;
  --content-max: 1160px;
  --control-h: 44px;
  --control-h-sm: 36px;
}

/* ---------- Ikony (Lucide, sprite web/img/icons.svg) ---------- */
.icon {
  flex: none; display: inline-block; vertical-align: middle;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}


.mono { font-family: var(--font-mono); font-size: 13px; color: var(--text-2); }

.sidebar-icon-btn {
  width: 44px; height: 44px; border: 0; border-radius: var(--radius-ctl);
  background: transparent; color: var(--sidebar-text);
  display: inline-flex; align-items: center; justify-content: center;
}
.sidebar-icon-btn:hover { background: var(--sidebar-active); color: #fff; }


.avatar { background: #24304A; color: #fff; }
.sidebar-user-name { color: #fff; font-weight: 600; font-size: 14px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-meta { font-size: 12px; color: var(--sidebar-label); }
.sidebar-user-meta a { color: var(--sidebar-text); text-decoration: none; }
.sidebar-user-meta a:hover { color: #fff; text-decoration: underline; }
.sidebar-user form { margin: 0 0 0 auto; }
.sidebar-icon-btn {
  width: 44px; height: 44px; border: 0; border-radius: var(--radius-ctl);
  background: transparent; color: var(--sidebar-text);
  display: inline-flex; align-items: center; justify-content: center;
}
.sidebar-icon-btn:hover { background: var(--sidebar-active); color: #fff; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--accent-soft); color: var(--accent-hover);
  font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}


.icon-btn {
  position: relative; width: 44px; height: 44px; flex: none;
  border: 1px solid var(--input-border); border-radius: var(--radius-ctl);
  background: var(--surface); color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--st-red); color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { color: var(--muted); margin: 6px 0 0; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }


.card.card-dark { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--sidebar-text); }
.card.card-dark .card-header { color: #fff; border-color: #1C2230; }

/* ---------- Kafelki KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 20px; color: var(--text); text-decoration: none; min-width: 0;
}
a.kpi:hover { border-color: #C9D3E4; color: var(--text); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.kpi-icon {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-hover);
}
.kpi-icon.is-green { background: var(--st-green-bg); color: var(--st-green); }
.kpi-icon.is-orange { background: var(--st-orange-bg); color: var(--st-orange); }
.kpi-icon.is-violet { background: var(--st-violet-bg); color: var(--st-violet); }
.kpi-icon.is-red { background: var(--st-red-bg); color: var(--st-red); }
.kpi-value { font-family: var(--font-display); font-size: 32px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-desc { font-size: 13px; color: var(--muted); }

/* ---------- Znaczki statusów (z kropką) ---------- */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.3; white-space: nowrap;
  background: var(--st-gray-bg); color: var(--st-gray);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.status-blue   { background: var(--st-blue-bg);   color: var(--st-blue); }
.status-green  { background: var(--st-green-bg);  color: var(--st-green); }
.status-orange { background: var(--st-orange-bg); color: var(--st-orange); }
.status-gray   { background: var(--st-gray-bg);   color: var(--st-gray); }
.status-red    { background: var(--st-red-bg);    color: var(--st-red); }
.status-violet { background: var(--st-violet-bg); color: var(--st-violet); }


/* ---------- Pulpit: plan dnia ---------- */
.plan-list { list-style: none; margin: 0; padding: 0; }
.plan-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 22px 12px 10px; border-bottom: 1px solid var(--divider); background: var(--surface);
}
.plan-item:last-child { border-bottom: 0; }
.plan-item.is-dragging { opacity: .5; background: var(--accent-soft); }
.plan-handle {
  width: 32px; height: 44px; flex: none; border: 0; background: transparent; color: #9AA3B5;
  border-radius: 8px; cursor: grab; display: inline-flex; align-items: center; justify-content: center;
}
.plan-handle:hover, .plan-handle:focus-visible { background: var(--bg); color: var(--text-2); }
.plan-main { flex: 1; min-width: 0; }
.plan-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.plan-title > a { color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.plan-title > a:hover { color: var(--accent); }
.plan-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.plan-meta .mono { font-size: 12px; }
.plan-actions { display: flex; gap: 6px; flex: none; }
.plan-actions form { margin: 0; }
.icon-btn.is-running { background: var(--accent); border-color: var(--accent); color: #fff; }
.icon-btn.is-paused { background: var(--st-orange-bg); border-color: #F5C9A8; color: var(--st-orange); }
.plan-empty { padding: 18px 22px; color: var(--muted); }

/* ---------- Pulpit: ciemna karta liczników ---------- */
.card-dark .h2 { color: #fff; }
.timer-count {
  min-width: 28px; height: 28px; border-radius: 14px; padding: 0 8px; background: var(--sidebar-active); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.timer-note { color: var(--sidebar-text); font-size: 13px; }
.timer-row { display: flex; align-items: center; gap: 10px 12px; padding: 12px 0; border-bottom: 1px solid #1C2230; flex-wrap: wrap; }
.timer-info { flex: 1 1 180px; }
.timer-row:last-of-type { border-bottom: 0; }
.timer-info { flex: 1; min-width: 0; }
.timer-meta { font-size: 12px; color: var(--sidebar-label); }
.timer-meta .mono { color: var(--sidebar-text); font-size: 12px; }
.timer-title { color: #fff; font-weight: 600; text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-title:hover { color: #8FB4FF; }
.timer-clock { font-family: var(--font-display); font-size: 22px; flex: none; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.timer-clock.is-paused { color: #FDBA74; }
.timer-actions { display: flex; gap: 2px; margin: 0; }

/* ---------- Pulpit: wydarzenia ---------- */
.tab-count {
  display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; margin-left: 4px;
  background: var(--divider); color: var(--text-2); font-size: 12px; align-items: center; justify-content: center;
}
.nav-link.active .tab-count { background: var(--accent-soft); color: var(--accent-hover); }
.event-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 0 10px 14px; border-bottom: 1px solid var(--divider);
  position: relative;
}
.event-row::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 2px; background: var(--event-color, var(--accent)); }
.event-row:last-child { border-bottom: 0; }
.event-time { width: 92px; flex: none; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3; }
.event-main { flex: 1; min-width: 0; }
.event-main > a { font-weight: 600; color: var(--text); text-decoration: none; }
.event-main > a:hover { color: var(--accent); }

/* licznik dnia pracy w pasku górnym */
.workday-clock { font-size: 14px; font-family: var(--font-display); padding: 8px 12px; font-variant-numeric: tabular-nums; }
.topbar-actions .d-flex.gap-1 { gap: 6px !important; }

/* tak/nie w tabelach */
.yn-yes { color: var(--success); display: inline-flex; }
.yn-no { color: var(--muted); }

/* ---------- Wpisy w zgłoszeniu (portal) ---------- */
.article-card.is-mine { border-color: #C9D8FA; }
.article-card.is-mine > .card-header { background: var(--accent-soft); }

/* ---------- Wykres ---------- */
.chart-legend { display: flex; justify-content: flex-end; gap: 18px; font-size: 13px; color: var(--text-2); margin-bottom: 6px; flex-wrap: wrap; }
.chart-legend strong { font-family: var(--font-display); font-size: 15px; margin-left: 4px; color: var(--text); }
.chart-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }


.table-wrap { overflow-x: auto; }

@media (max-width: 1199.98px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .kpi-grid { grid-template-columns: 1fr; } }

.card.card-dark .card-header { background: transparent; color: #fff; }
.card.card-dark .card-header .h2 { color: #fff; }
