:root {
  /* --- Brandbook PayEye 06/2026 --- */
  --bg: #f4f5f7;           /* jasne, chłodne tło (rodzina szarości) */
  --card: #ffffff;
  --paper: #fdfdfd;        /* brandowa biel */
  --ink: #2c2c2f;          /* grafit firmowy (tekst główny) */
  --muted: #6f7073;        /* czytelna szarość dla tekstu pomocniczego */
  --grey: #9c9c9c;         /* brandowa szarość */
  --line: #e8e8eb;         /* linie/obrysy (szarość 10–15%) */
  /* kolory firmowe */
  --brand: #2c2c2f;        /* grafit – elementy główne, przyciski, pasy */
  --brand-d: #1c1c1f;      /* ciemniejszy do hoverów */
  --brand-tint: #eef0f6;   /* jasne tło pochodne (niebiesko-szare) */
  --accent: #7f95ce;       /* niebieski firmowy */
  --accent-d: #5d72ad;     /* ciemniejszy niebieski (tekst/hover) */
  --accent-tint: #eef1f9;  /* niebieski 10% */
  --ok: #7f95ce;           /* status pozytywny = niebieski */
  --off: #6b6c70;          /* niedostępny/nieaktywny = grafitowa szarość */
  --warn: #8a8b8f;         /* robocze = szarość */
  --shadow: 0 1px 3px rgba(44, 44, 47, .07), 0 1px 2px rgba(44, 44, 47, .04);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .brand, .wordmark, .stat {
  font-family: "Outfit", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent-d); text-decoration: none; }
a:hover { text-decoration: underline; }

header.topbar {
  background: #fff; border-bottom: 1px solid var(--line); padding: 0 20px;
  display: flex; align-items: center; gap: 22px; height: 56px; position: sticky; top: 0; z-index: 10;
}
.wordmark { font-weight: 600; color: var(--ink); letter-spacing: -.01em; line-height: 1; }
.brand { font-weight: 600; color: var(--ink); font-size: 17px; }
.brand span { color: var(--accent); }
nav.main { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
nav.main a {
  padding: 7px 12px; border-radius: 8px; color: var(--ink); font-weight: 500;
}
nav.main a:hover { background: var(--brand-tint); text-decoration: none; }
nav.main a.active { background: var(--brand); color: #fff; }
.userbox { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.userbox b { color: var(--ink); }

.wrap { max-width: 1180px; margin: 24px auto; padding: 0 20px; }
h1 { font-size: 23px; margin: 0 0 4px; letter-spacing: -.01em; }
.sub { color: var(--muted); margin: 0 0 20px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.card h2 { font-size: 16px; margin: 0 0 14px; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.stat { font-size: 30px; font-weight: 700; }
.stat small { display: block; font-size: 13px; font-weight: 500; color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tr:hover td { background: #f7f8fa; }
td.wknd, th.wknd { background: #eef0f3; }

label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 4px; }
input, select, button {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 2px solid rgba(127, 149, 206, .45); border-color: var(--accent); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > div { flex: 1; min-width: 140px; }

button, .btn {
  background: var(--brand); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px;
  font-weight: 600; cursor: pointer;
}
button:hover, .btn:hover { background: var(--brand-d); text-decoration: none; }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid #d4d5da; }
.btn-ghost:hover { background: var(--brand-tint); border-color: var(--ink); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-danger { background: #fff; color: var(--ink); border: 1px solid var(--ink); }
.btn-danger:hover { background: var(--ink); color: #fff; }
.btn-ok { background: var(--ok); }
.btn-ok:hover { background: var(--accent-d); }

.pill { display: inline-block; padding: 2px 5px; border-radius: 999px; font-size: 12px; font-weight: 600; margin-left: 5px;}
.pill-ok { background: var(--accent-tint); color: var(--accent-d); border: 1px solid #5566b0!important;}
.pill-off { background: #ececee; color: var(--off); }
.pill-warn { background: #f0f1f3; color: var(--warn); border: 1px solid var(--warn)!important;}
.pill-muted { background: #f0f1f3; color: var(--muted); }

.flash { background: var(--accent-tint); border: 1px solid #d9e0f1; color: var(--accent-d); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }

.loc-chip { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.loc-work { background: var(--accent-tint); color: var(--accent-d); }
.loc-off { background: #ececee; color: var(--off); }

.login-wrap { max-width: 380px; margin: 8vh auto; }
.login-wrap .card { padding: 28px; }
.muted { color: var(--muted); font-size: 13px; }
.err { background: #f1f2f4; color: var(--ink); border-left: 3px solid var(--ink); padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.scroll { overflow-x: auto; }
.right { text-align: right; }
.tag-role { font-size: 11px; color: var(--muted); }
.demo-creds { font-size: 12px; color: var(--muted); margin-top: 16px; line-height: 1.7; }
.demo-creds code { background: #f0f1f3; padding: 1px 5px; border-radius: 4px; }

/* --- mikro-interakcje --- */
button, .btn, nav.main a, input, select { transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease, transform .05s ease; }
button:active, .btn:active { transform: translateY(1px); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus-visible, .btn:focus-visible { outline-offset: 3px; }

/* --- tło ekranów logowania/resetu --- */
body.auth {
  background:
    radial-gradient(900px 380px at 12% -12%, rgba(127,149,206,.18), transparent 60%),
    radial-gradient(720px 320px at 102% 0%, rgba(44,44,47,.06), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

/* --- awatary z inicjałami --- */
.avatar { display:inline-flex; align-items:center; justify-content:center; border-radius:50%; font-family:"Outfit",sans-serif; font-weight:700; flex:0 0 auto; text-transform:uppercase; background:var(--accent-tint); color:var(--accent-d); width:34px; height:34px; font-size:13px; letter-spacing:.01em; }
.avatar-sm { width:26px; height:26px; font-size:11px; }
.avatar-head { background:var(--accent); color:#fff; }
.cell-person { display:flex; align-items:center; gap:10px; }
.cell-person .meta { min-width:0; }

/* --- zebra + hover w tabelach zarządczych --- */
table.zebra tbody tr:nth-child(odd) td { background:#fbfbfc; }
table.zebra tbody tr:hover td { background:var(--brand-tint); }

/* --- legenda skali heatmapy --- */
.hm-legend { display:inline-flex; align-items:center; gap:8px; font-size:12px; color:var(--muted); }
.hm-legend .bar { width:120px; height:10px; border-radius:5px; background:linear-gradient(90deg, rgba(127,149,206,.10), #7f95ce); border:1px solid var(--line); }

/* --- kropka koloru lokalizacji --- */
.loc-dot { display:inline-block; width:11px; height:11px; border-radius:50%; background:var(--grey); vertical-align:middle; flex:0 0 auto; box-shadow:0 0 0 2px #fff inset; }

/* --- ikony kafelków pulpitu --- */
.tile-ico { width:36px; height:36px; border-radius:10px; display:flex; align-items:center; justify-content:center; background:var(--accent-tint); color:var(--accent-d); margin-bottom:10px; }
.tile-ico svg { width:20px; height:20px; }

/* --- gradient zanikania tuż przy przyklejonej kolumnie sumy (maskuje ucięty skrawek) --- */
.grid-fade { position:relative; }
.grid-fade .scroll table td[style*="right:0"]::before,
.grid-fade .scroll table th[style*="right:0"]::before {
  content:""; position:absolute; left:-36px; top:0; bottom:0; width:36px; pointer-events:none;
  background:linear-gradient(to right, rgba(255,255,255,0), #fff);
}

/* --- cień przyklejonych kolumn (siatka zespołu / heatmapa) --- */
.scroll table tbody td[style*="left:0"], .scroll table thead th[style*="left:0"] { box-shadow:6px 0 8px -6px rgba(44,44,47,.14); }
.scroll table tbody td[style*="right:0"], .scroll table thead th[style*="right:0"] { box-shadow:-6px 0 8px -6px rgba(44,44,47,.14); }
