/* ============================================================================
   KadroPlan.pl — design system
   Aesthetic: glassmorphism (frosted cards over a soft mesh) + flat, clean
   content + consistent single-colour line icons (icons.js). Polish SaaS.
   Shared by: index (landing), login, panel (client), operator (service admin).
   ==========================================================================*/

:root {
  /* brand */
  --brand:        #4f46e5;   /* indigo 600 */
  --brand-600:    #4f46e5;
  --brand-500:    #6366f1;
  --brand-400:    #818cf8;
  --brand-700:    #4338ca;
  --brand-ink:    #3730a3;
  --violet:       #7c3aed;
  --cyan:         #06b6d4;
  --brand-soft:   rgba(79, 70, 229, 0.10);

  /* ink / surfaces (light) */
  --ink:          #0f172a;
  --ink-2:        #475569;
  --muted:        #64748b;
  --line:         rgba(15, 23, 42, 0.08);
  --line-2:       rgba(15, 23, 42, 0.13);
  --page:         #eef1fb;
  --surface:      #ffffff;
  --surface-2:    #f5f7fc;
  --field:        #f4f6fc;

  /* glass */
  --glass:        rgba(255, 255, 255, 0.72);
  --glass-2:      rgba(255, 255, 255, 0.55);
  --glass-brd:    rgba(255, 255, 255, 0.65);
  --blur:         saturate(160%) blur(16px);

  /* semantic */
  --ok:           #16a34a;
  --warn:         #d97706;
  --bad:          #e11d48;

  /* shadow / radius */
  --sh-sm:        0 1px 2px rgba(15, 23, 42, 0.05);
  --sh:           0 6px 20px rgba(30, 27, 75, 0.08);
  --sh-lg:        0 20px 50px rgba(30, 27, 75, 0.14);
  --r-sm:         10px;
  --r:            16px;
  --r-lg:         22px;
  --r-xl:         28px;

  --maxw:         1160px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: -apple-system, "Segoe UI", Inter, Roboto, Arial, sans-serif;
  color: var(--ink); background: var(--page);
  -webkit-font-smoothing: antialiased; line-height: 1.5;
  overflow-x: clip;   /* clip (not hidden) so it doesn't break the sticky nav */
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.12; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
.ic-svg { vertical-align: -0.18em; flex: none; }

/* ---- soft mesh background (behind glass) --------------------------------- */
.mesh { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--page); }
.mesh::before, .mesh::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.55;
}
.mesh::before { width: 620px; height: 620px; left: -160px; top: -180px;
  background: radial-gradient(circle at 30% 30%, #818cf8, transparent 70%); }
.mesh::after  { width: 680px; height: 680px; right: -200px; top: 220px;
  background: radial-gradient(circle at 60% 40%, #c4b5fd, transparent 70%); }
.mesh i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.4; }
.mesh i.b1 { width: 480px; height: 480px; left: 40%; top: 62%;
  background: radial-gradient(circle, #67e8f9, transparent 70%); }

/* ---- layout helpers ------------------------------------------------------ */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.center { justify-content: center; }
.col { display: flex; flex-direction: column; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.mt { margin-top: 18px; } .mt-lg { margin-top: 40px; }
.hide-sm { }

/* ---- glass card ---------------------------------------------------------- */
.glass, .card {
  background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-brd); border-radius: var(--r-lg);
  box-shadow: var(--sh); padding: 22px;
}
.card.solid { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
.card h3 { font-size: 17px; }

/* ---- buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: 15px;
  padding: 11px 20px; border-radius: 12px; transition: transform .12s, box-shadow .2s, background .2s, opacity .2s;
  white-space: nowrap; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, var(--brand-500), var(--brand-600)); color: #fff;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35); }
.btn-primary:hover { box-shadow: 0 12px 26px rgba(79, 70, 229, 0.45); transform: translateY(-1px); }
.btn-ghost { background: var(--glass); border: 1px solid var(--line-2); color: var(--ink); backdrop-filter: var(--blur); }
.btn-ghost:hover { border-color: var(--brand-400); color: var(--brand-700); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13.5px; border-radius: 10px; }
.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: 14px; }
.btn .ic-svg { margin: 0; }
.btn-link { background: none; color: var(--brand-700); padding: 6px 4px; font-weight: 600; }

/* ---- pills / badges / chips --------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: var(--brand-soft); color: var(--brand-700); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 8px;
  font-size: 12px; font-weight: 600; }
.badge-ok  { background: rgba(22,163,74,.12);  color: #15803d; }
.badge-warn{ background: rgba(217,119,6,.14);  color: #b45309; }
.badge-bad { background: rgba(225,29,72,.12);  color: #be123c; }
.badge-mut { background: rgba(15,23,42,.06);   color: var(--muted); }
.badge-info{ background: var(--brand-soft);    color: var(--brand-700); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 10px;
  background: var(--glass); border: 1px solid var(--line); font-size: 13.5px; font-weight: 550; cursor: pointer; }
.chip.active { background: var(--brand); color: #fff; border-color: transparent; }
.chip .ic-svg { margin: 0; }

/* ============================================================================
   LANDING
   ==========================================================================*/
.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,0.6); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--glass-brd);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--brand-500), var(--violet)); color: #fff; box-shadow: 0 6px 16px rgba(79,70,229,.4); }
.brand .mark svg { width: 20px; height: 20px; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--ink-2); font-weight: 550; font-size: 15px; }
.nav-links a:hover { color: var(--brand-700); }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-burger { display: none; background: none; border: 0; cursor: pointer; color: var(--ink); }

section { padding: 84px 0; }
.eyebrow { }
.hero { padding: 70px 0 60px; text-align: center; }
.hero h1 { font-size: clamp(34px, 5.4vw, 60px); letter-spacing: -0.035em; }
.hero .grad { background: linear-gradient(120deg, var(--brand-600), var(--violet) 60%, var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: clamp(16px, 2vw, 20px); color: var(--ink-2); max-width: 640px; margin: 20px auto 0; }
.hero-cta { display: flex; gap: 12px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.hero-note { margin-top: 16px; font-size: 13.5px; color: var(--muted); }
.hero-shot { max-width: 940px; margin: 54px auto 0; border-radius: var(--r-xl);
  border: 1px solid var(--glass-brd); box-shadow: var(--sh-lg); overflow: hidden; background: var(--glass); }

.sec-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.sec-head h2 { font-size: clamp(26px, 3.6vw, 40px); }
.sec-head p { color: var(--ink-2); font-size: 17px; margin-top: 14px; }

.feature { padding: 24px; }
.feature .fi { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-600); margin-bottom: 16px; }
.feature .fi svg { width: 24px; height: 24px; }
.feature h3 { font-size: 18px; }
.feature p { color: var(--ink-2); font-size: 14.5px; margin-top: 8px; }

.steps { counter-reset: step; }
.step { position: relative; padding: 24px 24px 24px 68px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 22px; top: 24px;
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800;
  background: linear-gradient(160deg, var(--brand-500), var(--violet)); color: #fff; }
.step h3 { font-size: 17px; } .step p { color: var(--ink-2); font-size: 14.5px; margin-top: 6px; }

/* pricing */
.billing-toggle { display: inline-flex; gap: 4px; padding: 5px; border-radius: 999px; background: var(--glass);
  border: 1px solid var(--line-2); margin: 0 auto 12px; }
.billing-toggle button { border: 0; background: none; cursor: pointer; font: inherit; font-weight: 600; font-size: 14px;
  padding: 8px 18px; border-radius: 999px; color: var(--muted); }
.billing-toggle button.active { background: var(--brand); color: #fff; }
.save-hint { text-align: center; color: var(--ok); font-weight: 600; font-size: 13.5px; margin-bottom: 34px; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: stretch; }
.plan { display: flex; flex-direction: column; padding: 28px; position: relative; }
.plan.featured { border: 1.5px solid var(--brand-400); box-shadow: var(--sh-lg); transform: translateY(-6px); }
.plan .tag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(160deg, var(--brand-500), var(--violet)); color: #fff; font-size: 12px; font-weight: 700;
  padding: 5px 14px; border-radius: 999px; box-shadow: 0 6px 16px rgba(79,70,229,.4); }
.plan .pname { font-size: 15px; font-weight: 700; color: var(--brand-700); text-transform: uppercase; letter-spacing: .06em; }
.plan .price { display: flex; align-items: baseline; gap: 4px; margin: 12px 0 2px; }
.plan .price .amt { font-size: 42px; font-weight: 800; letter-spacing: -0.03em; }
.plan .price .cur { font-size: 18px; font-weight: 700; }
.plan .price .per { color: var(--muted); font-size: 14px; font-weight: 500; }
.plan .subprice { color: var(--muted); font-size: 13px; min-height: 18px; }
.plan .flist { list-style: none; padding: 0; margin: 22px 0; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.plan .flist li { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; color: var(--ink-2); }
.plan .flist li .ic-svg { color: var(--ok); margin-top: 1px; }
.plan .flist li.off { color: var(--muted); opacity: .6; }
.plan .flist li.off .ic-svg { color: var(--muted); }

/* faq */
.faq { max-width: 760px; margin: 0 auto; }
.qa { border-bottom: 1px solid var(--line); }
.qa summary { cursor: pointer; list-style: none; padding: 20px 4px; font-weight: 650; font-size: 16px;
  display: flex; align-items: center; justify-content: space-between; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary .ic-svg { transition: transform .2s; color: var(--muted); }
.qa[open] summary .ic-svg { transform: rotate(180deg); }
.qa p { padding: 0 4px 20px; color: var(--ink-2); font-size: 15px; }

.cta-band { text-align: center; padding: 56px; background: linear-gradient(140deg, var(--brand-600), var(--violet));
  color: #fff; border-radius: var(--r-xl); box-shadow: var(--sh-lg); }
.cta-band h2 { font-size: clamp(24px, 3.4vw, 36px); }
.cta-band p { opacity: .9; margin-top: 12px; font-size: 17px; }

footer.foot { padding: 56px 0 40px; border-top: 1px solid var(--line); margin-top: 40px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 30px; }
.foot h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 14px; }
.foot a { display: block; color: var(--ink-2); font-size: 14.5px; padding: 5px 0; }
.foot a:hover { color: var(--brand-700); }
.foot-bottom { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================================
   AUTH (login / signup)
   ==========================================================================*/
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 430px; padding: 34px; }
.auth-card .brand { justify-content: center; margin-bottom: 8px; }
.auth-tabs { display: flex; gap: 4px; padding: 5px; background: var(--field); border-radius: 12px; margin: 22px 0; }
.auth-tabs button { flex: 1; border: 0; background: none; cursor: pointer; font: inherit; font-weight: 600; font-size: 14px;
  padding: 9px; border-radius: 9px; color: var(--muted); }
.auth-tabs button.active { background: #fff; color: var(--ink); box-shadow: var(--sh-sm); }

/* ---- forms --------------------------------------------------------------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line-2); background: var(--field); color: var(--ink);
  border-radius: 11px; padding: 11px 13px; font: inherit; font-size: 15px; transition: border .15s, box-shadow .15s, background .15s;
}
.input:focus { outline: none; border-color: var(--brand-400); background: #fff; box-shadow: 0 0 0 3px var(--brand-soft); }
.input::placeholder { color: #9aa4b5; }

/* ============================================================================
   PORTAL SHELL (panel klienta + operator)  — glass sidebar
   ==========================================================================*/
.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-right: 1px solid var(--glass-brd); padding: 20px 16px; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 6px; }
.side-brand .mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--brand-500), var(--violet)); color: #fff; }
.side-brand .mark svg { width: 20px; height: 20px; }
.side-brand b { font-size: 16px; letter-spacing: -.02em; }
.nav-list { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; min-height: 44px; white-space: nowrap;
  color: var(--ink-2); font-weight: 550; font-size: 14.5px; cursor: pointer; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--glass-2); color: var(--ink); }
.nav-item.active { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(79,70,229,.32); }
/* drag-to-reorder the sidebar menu (iOS-style lift + glide) */
.nav-list.nav-sorting { cursor: grabbing; }
.nav-list.nav-sorting .nav-item { cursor: grabbing; user-select: none; }
.nav-item.nav-dragging { position: relative; z-index: 20; background: var(--surface); box-shadow: 0 16px 34px rgba(15,23,42,.28), 0 2px 6px rgba(15,23,42,.14); }
:root[data-theme="dark"] .nav-item.nav-dragging { background: var(--surface-2, #171a2b); box-shadow: 0 16px 34px rgba(0,0,0,.5); }
.nav-item .ic-svg { width: 19px; height: 19px; margin: 0; }
.nav-item .cnt { margin-left: auto; font-size: 11.5px; font-weight: 700; background: rgba(255,255,255,.25); padding: 1px 8px; border-radius: 999px; }
.nav-item:not(.active) .cnt { background: var(--brand-soft); color: var(--brand-700); }
.side-foot { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 8px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.side-user .av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  color: #fff; background: linear-gradient(160deg, var(--brand-500), var(--violet)); font-size: 14px; }
.side-user .nm { font-size: 13.5px; font-weight: 650; line-height: 1.2; }
.side-user .rl { font-size: 11.5px; color: var(--muted); }
.side-user .su-txt { min-width: 0; }
.side-user .su-txt .nm, .side-user .su-txt .rl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the profile avatar/name doubles as the entry point to the Profil view (no nav item) */
.side-user[role="button"] { cursor: pointer; border-radius: 12px; transition: background .12s ease; }
.side-user[role="button"]:hover { background: var(--brand-soft); }
.side-user[role="button"].active { background: var(--brand-soft); }
.side-user[role="button"]:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 2px; }
.side-user .su-go { margin-left: auto; flex: none; color: var(--muted); display: grid; place-items: center; opacity: .55; }
.side-user[role="button"]:hover .su-go { opacity: .9; color: var(--brand-600); }
.side-collapsed .side-user .su-go { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 18px 30px; border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.5); backdrop-filter: var(--blur); position: sticky; top: 0; z-index: 20; }
.topbar .page-title { font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.topbar .page-sub { font-size: 13px; color: var(--muted); }
.topbar .sp { flex: 1; }
.burger { display: none; background: none; border: 0; cursor: pointer; color: var(--ink); }
.content { padding: 28px 30px; }

/* stat cards */
.stat { padding: 20px 22px; }
.stat .s-top { display: flex; align-items: center; justify-content: space-between; }
.stat .s-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-600); }
.stat .s-ic svg { width: 22px; height: 22px; }
.stat .s-val { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.stat .s-val { margin-bottom: 6px; }
.stat .s-label { font-size: 13.5px; color: var(--muted); }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 13px 12px; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: rgba(79,70,229,.03); }
.table-wrap { overflow-x: auto; }

.sec-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.sec-row h3 { font-size: 19px; }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .e-ic { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 18px;
  background: var(--brand-soft); color: var(--brand-500); margin-bottom: 12px; }
.empty .e-ic svg { width: 30px; height: 30px; }

/* ---- analytics (operator "Analityka") ---- */
.an-tabs { display: flex; gap: 5px; flex-wrap: wrap; background: var(--brand-soft); padding: 5px; border-radius: 13px; }
.an-tabs button { flex: 1 1 auto; min-width: 130px; border: 0; background: transparent; padding: 10px 12px;
  border-radius: 9px; font: inherit; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.an-tabs button.active { background: var(--surface); color: var(--brand-700); box-shadow: 0 2px 8px rgba(20,20,60,.10); }
.an-funnel { display: flex; flex-direction: column; gap: 12px; }
.an-frow { display: flex; align-items: center; gap: 14px; }
.an-frow .lbl { width: 150px; flex: none; font-weight: 600; font-size: 14px; }
.an-fbar { flex: 1; height: 38px; border-radius: 10px; background: var(--brand-soft); position: relative; overflow: hidden; min-width: 60px; }
.an-fbar > span { position: absolute; inset: 0 auto 0 0; border-radius: 10px; display: flex; align-items: center;
  padding: 0 12px; color: #fff; font-weight: 700; font-size: 14px; min-width: 44px; white-space: nowrap;
  background: linear-gradient(90deg, #4f46e5, #7c3aed); }
.an-frow .val { width: 120px; flex: none; text-align: right; font-weight: 700; font-size: 13.5px; color: var(--muted); }
.stat.an-kpi-hi { background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; border: 0; }
.stat.an-kpi-hi .s-label { color: rgba(255,255,255,.85); }
.stat.an-kpi-hi .s-ic { background: rgba(255,255,255,.18); color: #fff; }
.an-trend { display: flex; align-items: flex-end; gap: 3px; height: 90px; margin-top: 6px; }
.an-trend .tb { flex: 1; min-width: 3px; display: flex; flex-direction: column; justify-content: flex-end; }
.an-trend .tb b { display: block; border-radius: 3px 3px 0 0; background: #4f46e5; }
.an-trend .tb i { display: block; border-radius: 3px 3px 0 0; background: rgba(79,70,229,.28); }
.an-prop { display: flex; flex-direction: column; gap: 14px; }
.an-chan { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.an-chan .ci { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-700); }
.an-chip { display: inline-block; padding: 5px 11px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-700); font-size: 12.5px; font-weight: 600; margin: 3px 4px 0 0; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(15,23,42,.4); backdrop-filter: blur(4px);
  display: none; place-items: center; z-index: 100; padding: 20px; }
.modal-back.show { display: grid; }
.modal { width: 100%; max-width: 520px; background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--sh-lg); padding: 26px; max-height: 90vh; overflow-y: auto; }
.modal h3 { font-size: 20px; } .modal .m-sub { color: var(--muted); font-size: 14px; margin-top: 6px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
/* wide, two-column modal (firma wizard) — compact height instead of one long scroll */
.modal.modal-wide { max-width: 998px; padding: 22px 24px; }
.modal-wide .field { margin-bottom: 9px; }
.modal-wide .field label { font-size: 12px; margin-bottom: 4px; }
.modal-wide .input, .modal-wide select.input { padding: 9px 12px; font-size: 13.5px; border-radius: 9px; }
.wz-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px; align-items: start; margin-top: 4px; }
@media (max-width: 860px) { .modal.modal-wide { max-width: 520px; } .wz-cols { grid-template-columns: 1fr; } }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 14px; font-weight: 550;
  box-shadow: var(--sh-lg); opacity: 0; visibility: hidden; pointer-events: none;
  transition: transform .3s, opacity .3s, visibility .3s; z-index: 200; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
.toast.bad { background: var(--bad); } .toast.ok { background: var(--ok); }

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .plans, .foot-grid { grid-template-columns: 1fr; }
  .grid, .plans { gap: 26px; }   /* clearer vertical space between stacked cards */
  .plan.featured { transform: none; }
  .nav-links { display: none; }
  .nav-burger { display: block; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 260px; z-index: 60; transform: translateX(-100%); transition: transform .25s; }
  .app.open .sidebar { transform: none; }
  .burger { display: block; }
  .content { padding: 20px 16px; }
  .topbar { padding: 14px 16px; }
}
@media (max-width: 560px) {
  .grid-4, .grid-2 { grid-template-columns: 1fr; }
  section.wrap:not(.hero) { padding-top: 30px; padding-bottom: 30px; }
  .foot-bottom { flex-direction: column; }
}

/* ---- two-column split band (multi-business, employee apps) --------------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; padding: 40px; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; gap: 28px; padding: 28px; } }

/* ---- employee mobile app section ---------------------------------------- */
.app-ticks { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 11px; }
.app-ticks li { display: flex; align-items: center; gap: 9px; font-size: 14.5px; color: var(--ink-2); }
.app-ticks li .ic-svg { color: var(--ok); }
.store-badges { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.store-badge { display: inline-flex; align-items: center; gap: 11px; background: #000; color: #fff;
  border: 1px solid rgba(255,255,255,.22); padding: 9px 15px; border-radius: 11px; position: relative; box-shadow: var(--sh); }
.store-badge svg { width: 22px; height: 22px; flex: none; fill: #fff; }
.store-badge small { display: block; font-size: 10.5px; opacity: .8; line-height: 1.15; }
.store-badge b { display: block; font-size: 15px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.store-badge .soon { position: absolute; top: -8px; right: -6px; background: var(--brand); color: #fff;
  font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; box-shadow: var(--sh-sm); }
.phone { width: 232px; background: #0f172a; border-radius: 34px; padding: 11px; box-shadow: var(--sh-lg); }
.phone .scr { background: #fff; border-radius: 25px; overflow: hidden; }
.phone .ph-top { background: linear-gradient(160deg, var(--brand-500), var(--violet)); color: #fff; padding: 20px 16px 24px; }
.phone .ph-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.phone .ph-cta { margin: 14px; padding: 12px; border-radius: 12px; text-align: center; font-weight: 700; font-size: 13.5px;
  color: #fff; background: linear-gradient(180deg, var(--brand-500), var(--brand-600)); }

/* ============================================================================
   REFINEMENT (v4) — smaller/cleaner desktop type · flatter surfaces ·
   nothing overflows on mobile.  Appended so it overrides by source order.
   ==========================================================================*/
:root {
  --glass:     rgba(255, 255, 255, 0.82);   /* more opaque = flatter, cleaner */
  --glass-brd: rgba(15, 23, 42, 0.07);      /* subtle outline instead of frosted white edge */
  --blur:      saturate(140%) blur(12px);
  --sh:        0 4px 16px rgba(30, 27, 75, 0.06);
  --sh-lg:     0 12px 32px rgba(30, 27, 75, 0.10);
}
body { max-width: 100%; overflow-x: clip; }

/* flatter buttons + surfaces */
.btn-primary { background: var(--brand); box-shadow: 0 4px 12px rgba(79,70,229,0.22); }
.btn-primary:hover { background: var(--brand-700); box-shadow: 0 6px 16px rgba(79,70,229,0.30); }
.glass, .card { box-shadow: var(--sh); }
.phone .ph-cta { background: var(--brand); }

/* smaller, cleaner desktop type + tighter rhythm */
.brand { font-size: 18px; }
/* .wrap sets horizontal padding at a higher specificity, which was zeroing the
   section's vertical padding — restore it with a matching-specificity selector */
section.wrap:not(.hero) { padding-top: 33px; padding-bottom: 33px; }
.hero { padding: 52px 0 44px; }
.hero h1 { font-size: clamp(29px, 4.2vw, 45px); letter-spacing: -0.03em; }
.hero p.lead { font-size: clamp(15px, 1.5vw, 17.5px); max-width: 600px; margin-top: 18px; }
.hero-cta { margin-top: 26px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.sec-head { margin-bottom: 38px; }
.sec-head h2 { font-size: clamp(23px, 2.8vw, 31px); }
.sec-head p { font-size: 15.5px; margin-top: 12px; }
.feature { padding: 22px; }
.feature h3 { font-size: 16px; }
.feature p { font-size: 13.8px; }
.feature .fi { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 14px; }
.feature .fi svg { width: 22px; height: 22px; }
.step h3 { font-size: 16px; }
.step p { font-size: 13.8px; }
.split h2 { font-size: 26px !important; }
.plan { padding: 24px; }
.plan .price .amt { font-size: 36px; }
.plan .flist li { font-size: 13.8px; }
.qa summary { font-size: 15px; }
.qa p { font-size: 14.5px; }
.cta-band { padding: 46px 40px; }
.cta-band h2 { font-size: clamp(21px, 2.6vw, 29px); }
.cta-band p { font-size: 15.5px; }

/* stop grid/flex children from forcing horizontal overflow */
.feature, .plan, .step, .card, .glass, .split > div { min-width: 0; }
.hero-shot { max-width: 900px; }
.phone { width: min(232px, 76vw); }

/* mobile: everything fits, nothing steps outside the screen */
@media (max-width: 640px) {
  .hide-sm { display: none !important; }     /* the login button that was overflowing the header */
  .wrap { padding: 0 16px; }
  .nav-cta { gap: 8px; }
  .glass, .card { padding: 18px; }
  .split { padding: 22px; gap: 24px; }
  .cta-band { padding: 34px 20px; }
  .hero { padding: 40px 0 36px; }
  .hero h1 { font-size: 29px; }
  .store-badges { gap: 10px; }
  .store-badge { flex: 1 1 auto; justify-content: center; }
  .store-badge .soon { right: 6px; }
  .plan.featured { transform: none; }
}

/* ============================================================================
   HERO v5 — two-column (copy + manager photo with a floating realistic phone)
   ==========================================================================*/
.hero { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 46px; align-items: center;
  text-align: left; padding: 44px 0 60px; }
.hero-copy { max-width: 560px; }
.hero-copy .pill { margin-bottom: 6px; }
.hero h1 { font-size: clamp(28px, 3.7vw, 44px); line-height: 1.08; }
.hero p.lead { margin: 18px 0 0; max-width: 540px; }
.hero-cta { justify-content: flex-start; margin-top: 26px; }

.hero-visual { position: relative; }
.hero-photo { border-radius: 26px; overflow: hidden; box-shadow: var(--sh-lg); aspect-ratio: 4 / 4.35; background: #e9ecf6; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; display: block; }
.hero-badge { position: absolute; top: 26px; left: -18px; display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 14px; padding: 9px 13px; box-shadow: var(--sh-lg); }
.hero-badge .hb-ic { width: 30px; height: 30px; border-radius: 9px; background: rgba(22,163,74,.13); color: var(--ok); display: grid; place-items: center; }
.hero-badge b { display: block; font-size: 12.5px; } .hero-badge small { color: var(--muted); font-size: 11px; }

/* ---- realistic phone (shared by hero + employee-apps section) ----------- */
.phone { width: min(228px, 74vw); background: #0b1020; border-radius: 40px; padding: 8px; position: relative;
  box-shadow: 0 26px 54px rgba(15,23,42,0.30); }
.phone::after { content: ""; position: absolute; top: 15px; left: 50%; transform: translateX(-50%);
  width: 62px; height: 18px; background: #0b1020; border-radius: 999px; z-index: 5; }
.phone .scr { background: #fff; border-radius: 32px; overflow: hidden; }
.phone .ph-top { background: linear-gradient(160deg, var(--brand-500), var(--violet)); color: #fff; padding: 0 0 16px; }
.phone .statusbar { display: flex; align-items: center; justify-content: space-between; padding: 11px 18px 6px;
  color: #fff; font-size: 11px; font-weight: 700; }
.phone .statusbar .sb-ic { display: inline-flex; align-items: center; gap: 5px; }
.phone .statusbar svg { display: block; }
.phone .ph-hi { display: flex; align-items: center; justify-content: space-between; padding: 6px 16px 0; }
.phone .ph-day { font-size: 10.5px; opacity: .85; }
.phone .ph-h { font-weight: 700; font-size: 16px; margin-top: 1px; }
.phone .ph-av { width: 33px; height: 33px; border-radius: 50%; background: rgba(255,255,255,.22); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.phone .ph-body { background: #fff; padding: 13px; }
.phone .ph-today { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  background: linear-gradient(160deg, #eef1fe, #f8f9ff); border: 1px solid var(--brand-soft); border-radius: 14px; padding: 12px 14px; }
.phone .ph-lbl { font-size: 10px; color: var(--brand-700); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.phone .ph-time { font-size: 18px; font-weight: 800; letter-spacing: -.02em; margin-top: 3px; white-space: nowrap; }
.phone .ph-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.phone .ph-live { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; color: var(--ok); white-space: nowrap; }
.phone .ph-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.phone .ph-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 6px;
  border-bottom: 1px solid var(--line); font-size: 12.5px; }
.phone .ph-row:last-of-type { border-bottom: 0; }
.phone .ph-d { font-weight: 600; }
.phone .ph-chip { background: var(--brand-soft); color: var(--brand-700); font-weight: 700; font-size: 11px; padding: 3px 9px; border-radius: 8px; }
.phone .ph-cta { margin: 10px 4px 4px; padding: 12px; border-radius: 12px; text-align: center; font-weight: 700; font-size: 13px; color: #fff; background: var(--brand); }

/* scale the FULL-size phone (keeps the app UI proportional — no reflow/overflow) */
.hero-phone { position: absolute; right: -6px; bottom: -16px; transform: scale(0.86); transform-origin: bottom right; z-index: 3; }

/* ---- hero responsive ---------------------------------------------------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 28px; text-align: center; padding: 34px 0 44px; }
  .hero-copy { max-width: 600px; margin: 0 auto; }
  .hero p.lead { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
  .hero-visual { width: 100%; max-width: 350px; margin: 6px auto 0; }
  .hero-photo { aspect-ratio: 4 / 4.2; }
}
@media (max-width: 480px) {
  .hero-photo { aspect-ratio: 4 / 4.2; }
  .hero-badge { left: -6px; top: 14px; padding: 8px 11px; }
}

/* ============================================================================
   REALISTIC PHONE (v8) — proper iPhone proportions + tab bar + home indicator
   ==========================================================================*/
.phone { width: 238px; max-width: 76vw; background: #0b1020; border-radius: 46px; padding: 8px;
  position: relative; box-shadow: 0 26px 56px rgba(15,23,42,.30); }
.phone::after { content: ""; position: absolute; top: 15px; left: 50%; transform: translateX(-50%);
  width: 82px; height: 23px; background: #0b1020; border-radius: 999px; z-index: 6; }
.phone .scr { background: #f5f6fb; border-radius: 38px; overflow: hidden; height: 478px; display: flex; flex-direction: column; }
.phone .ph-top { background: linear-gradient(158deg, var(--brand-500), var(--violet)); color: #fff; padding: 0; }
.phone .statusbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px 9px;
  color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .2px; }
.phone .statusbar .sb-ic { display: inline-flex; align-items: center; gap: 6px; }
.phone .statusbar svg { display: block; }
.phone .ph-hi { display: flex; align-items: center; justify-content: space-between; padding: 8px 20px 20px; }
.phone .ph-day { font-size: 11.5px; opacity: .9; }
.phone .ph-h { font-weight: 700; font-size: 19px; margin-top: 2px; }
.phone .ph-av { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.24); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.phone .ph-body { flex: 1; padding: 14px 14px 0; overflow: hidden; }
.phone .ph-today { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  background: #fff; border: 1px solid #e6e8f5; border-radius: 16px; padding: 14px 16px; box-shadow: 0 6px 16px rgba(30,27,75,.06); }
.phone .ph-lbl { font-size: 10px; color: var(--brand-700); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.phone .ph-time { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; color: var(--ink); white-space: nowrap; }
.phone .ph-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.phone .ph-live { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--ok); white-space: nowrap; }
.phone .ph-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.phone .ph-sect { font-size: 11px; color: #94a3b8; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin: 16px 6px 4px; }
.phone .ph-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 6px;
  border-bottom: 1px solid #eceef6; font-size: 13.5px; }
.phone .ph-row:last-child { border-bottom: 0; }
.phone .ph-rd { color: #334155; }
.phone .ph-free { color: #94a3b8; }
.phone .ph-chip { background: #eef1fe; color: var(--brand-700); font-weight: 700; font-size: 11.5px; padding: 3px 9px; border-radius: 8px; }
.phone .ph-tabs { background: #fff; border-top: 1px solid #eceef6; display: flex; justify-content: space-around; align-items: center; padding: 9px 0 4px; }
.phone .ph-tab { display: flex; flex-direction: column; align-items: center; gap: 3px; color: #94a3b8; font-size: 9.5px; }
.phone .ph-tab svg { width: 21px; height: 21px; }
.phone .ph-tab.on { color: var(--brand); font-weight: 700; }
.phone .ph-home-wrap { background: #fff; display: flex; justify-content: center; padding: 2px 0 8px; }
.phone .ph-home { width: 110px; height: 5px; border-radius: 3px; background: var(--ink); opacity: .22; }

/* hero: scale the full realistic phone down (proportions preserved) */
.hero-phone { position: absolute; right: 0; bottom: -16px; transform: scale(0.64); transform-origin: bottom right; z-index: 3; }
@media (max-width: 860px) { .hero-phone { display: none; } }   /* on mobile the phone is shown full-size in the Aplikacja section below */

/* ---- animated floating notification cards (hero) ------------------------ */
.hero-card { position: absolute; z-index: 4; display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 14px; padding: 9px 13px; box-shadow: var(--sh-lg); white-space: nowrap;
  opacity: 0; animation: heroCardIn .6s cubic-bezier(.2,.75,.3,1) both; }
.hero-card b { display: block; font-size: 12.5px; color: var(--ink); }
.hero-card small { display: block; color: var(--muted); font-size: 11px; }
.hero-card .hc-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.hero-card .hc-ic svg { width: 17px; height: 17px; }
@keyframes heroCardIn { from { opacity: 0; transform: translateY(12px) scale(.94); } to { opacity: 1; transform: none; } }
/* cards sit mostly in the gap beside the photo; positioned so the right edge stays under ~40% of the photo width (< the 45% limit) at every desktop width */
.hero-card.c1 { top: 24px;  left: -100px; animation-delay: .4s; }
.hero-card.c2 { top: 104px; left: -86px;  animation-delay: 1.15s; }
.hero-card.c3 { top: 184px; left: -102px; animation-delay: 1.9s; }
.hero-card.c4 { top: 264px; left: -86px;  animation-delay: 2.65s; }
@media (prefers-reduced-motion: reduce) { @keyframes heroCardIn { from { opacity: 0; } to { opacity: 1; } } }
@media (max-width: 860px) {
  .hero-card { padding: 7px 11px; }
  .hero-card b { font-size: 11.5px; }
  .hero-card small { font-size: 10px; }
  .hero-card .hc-ic { width: 26px; height: 26px; }
  .hero-card .hc-ic svg { width: 15px; height: 15px; }
  .hero-card.c1 { top: 12px;  left: -10px; }
  .hero-card.c2 { top: 82px;  left: 0; }
  .hero-card.c3 { top: 152px; left: -10px; }
  .hero-card.c4 { top: 222px; left: 0; }
}

/* ============================================================================
   MOBILE HERO (v14) — photo shrinks to the RIGHT, animated cards stack on the
   LEFT in their own space, so the cards never cover the picture. (Authoritative
   — appended last to override the earlier mobile rules.)
   ==========================================================================*/
@media (max-width: 860px) {
  .hero-visual { max-width: 440px; height: 320px; position: relative; margin: 10px auto 0; }
  .hero-phone { display: none; }
  .hero-photo { position: absolute; top: 0; right: 0; width: 62%; height: 100%; aspect-ratio: auto; border-radius: 20px; }
  /* short labels now → nowrap; cards sit left and overlap the photo's left edge a little */
  .hero-card { white-space: nowrap; max-width: none; padding: 8px 11px; gap: 9px; }
  .hero-card b { font-size: 11.5px; line-height: 1.2; }
  .hero-card small { font-size: 10px; }
  .hero-card .hc-ic { width: 27px; height: 27px; }
  .hero-card .hc-ic svg { width: 15px; height: 15px; }
  .hero-card.c1 { top: 10px;  left: 0; }
  .hero-card.c2 { top: 86px;  left: 0; }
  .hero-card.c3 { top: 162px; left: 0; }
  .hero-card.c4 { top: 238px; left: 0; }
}
@media (max-width: 400px) {
  .hero-visual { height: 300px; }
  .hero-card b { font-size: 11px; } .hero-card small { font-size: 9.5px; }
  .hero-card.c1 { top: 6px; } .hero-card.c2 { top: 78px; } .hero-card.c3 { top: 150px; } .hero-card.c4 { top: 222px; }
}

/* steps ("3 kroki") — tidy the number badge + padding on small screens */
@media (max-width: 560px) {
  .step { padding: 18px 18px 18px 60px; }
  .step::before { left: 15px; top: 18px; width: 32px; height: 32px; }
  .sec-head p, .hero p.lead { max-width: 34ch; margin-left: auto; margin-right: auto; }
}

/* ---- operator finance charts (horizontal bars) -------------------------- */
.fin-bars { display: flex; flex-direction: column; gap: 15px; margin-top: 8px; }
.fin-row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; font-size: 13.5px; }
.fin-lbl { font-weight: 600; }
.fin-val { font-weight: 700; white-space: nowrap; }
.fin-track { height: 9px; border-radius: 999px; background: var(--brand-soft); overflow: hidden; }
.fin-track > i { display: block; height: 100%; border-radius: 999px; min-width: 4px; }

/* ============================================================================
   OPERATOR PANEL PERSONALIZATION (Profil → Wygląd)
   - data-theme="dark" on <html>: dark surfaces for the whole panel
   - data-accent="...": re-tints the brand/icon palette
   Set only by operator.js from the logged-in operator's prefs — the public
   landing and client panel always stay on the default light/indigo look.
   ==========================================================================*/
:root[data-accent="violet"]  { --brand:#7c3aed; --brand-600:#7c3aed; --brand-500:#8b5cf6; --brand-400:#a78bfa; --brand-700:#6d28d9; --brand-ink:#5b21b6; --brand-soft:rgba(124,58,237,.12); }
:root[data-accent="cyan"]    { --brand:#0891b2; --brand-600:#0891b2; --brand-500:#06b6d4; --brand-400:#22d3ee; --brand-700:#0e7490; --brand-ink:#155e75; --brand-soft:rgba(8,145,178,.12); }
:root[data-accent="emerald"] { --brand:#059669; --brand-600:#059669; --brand-500:#10b981; --brand-400:#34d399; --brand-700:#047857; --brand-ink:#065f46; --brand-soft:rgba(5,150,105,.12); }
:root[data-accent="amber"]   { --brand:#d97706; --brand-600:#d97706; --brand-500:#f59e0b; --brand-400:#fbbf24; --brand-700:#b45309; --brand-ink:#92400e; --brand-soft:rgba(217,119,6,.14); }
:root[data-accent="rose"]    { --brand:#e11d48; --brand-600:#e11d48; --brand-500:#f43f5e; --brand-400:#fb7185; --brand-700:#be123c; --brand-ink:#9f1239; --brand-soft:rgba(225,29,72,.12); }

:root[data-theme="dark"] {
  color-scheme: dark;
  --brand-700: var(--brand-400); --brand-ink: var(--brand-400);
  --ink:#e8ecf8; --ink-2:#c0c7dd; --muted:#8b93b0;
  --line:rgba(255,255,255,.09); --line-2:rgba(255,255,255,.16);
  --page:#0b1020; --surface:#141b30; --surface-2:#182136; --field:#182136;
  --glass:rgba(19,26,46,.74); --glass-2:rgba(28,36,60,.62); --glass-brd:rgba(255,255,255,.08);
  --sh-sm:0 1px 2px rgba(0,0,0,.35); --sh:0 6px 20px rgba(0,0,0,.35); --sh-lg:0 20px 50px rgba(0,0,0,.5);
}
:root[data-theme="dark"] body { color: var(--ink); background: var(--page); }
:root[data-theme="dark"] .topbar { background: rgba(11,16,32,.55); }
:root[data-theme="dark"] .input:focus { background: var(--surface-2); }
:root[data-theme="dark"] .input::placeholder { color: #64748b; }
:root[data-theme="dark"] .toast { background: #1e293b; }
:root[data-theme="dark"] .btn-dark { background: #e8ecf8; color: #0f172a; }
:root[data-theme="dark"] .badge-mut { background: rgba(255,255,255,.08); color: var(--muted); }
:root[data-theme="dark"] .badge-ok  { background: rgba(34,197,94,.16);  color: #4ade80; }
:root[data-theme="dark"] .badge-warn{ background: rgba(245,158,11,.16); color: #fbbf24; }
:root[data-theme="dark"] .badge-bad { background: rgba(244,63,94,.16);  color: #fb7185; }
:root[data-theme="dark"] .badge-info{ background: var(--brand-soft);    color: var(--brand-400); }
:root[data-theme="dark"] .plan .pname { color: var(--brand-400); }
:root[data-theme="dark"] .tbl tr:hover td { background: rgba(255,255,255,.03); }
:root[data-theme="dark"] .mesh { opacity: .5; }
:root[data-theme="dark"] .chip.active { color: #fff; }
:root[data-theme="dark"] .nav-item.active { color: #fff; }

:root[data-accent] .btn-primary { box-shadow: 0 8px 20px rgba(15,23,42,.22); }
:root[data-accent] .btn-primary:hover { box-shadow: 0 12px 26px rgba(15,23,42,.28); }
:root[data-accent] .nav-item.active { box-shadow: 0 6px 16px rgba(15,23,42,.2); }

/* ---- collapsible sidebar (desktop only; mobile keeps the burger drawer) --- */
.side-collapse { display: flex; align-items: center; justify-content: flex-end;
  margin: 0 2px 8px; padding: 4px 8px; background: transparent; border: none; border-radius: 9px;
  color: var(--muted); cursor: pointer; }
.side-collapse:hover { background: var(--glass-2); color: var(--ink); }
.side-collapse .ic-svg { width: 18px; height: 18px; margin: 0; transition: transform .2s ease; }
@media (min-width: 901px) {
  .app { transition: grid-template-columns .22s ease; }
  .app.side-collapsed { grid-template-columns: 82px 1fr; }
  .app.side-collapsed .sidebar { padding: 20px 12px; }
  .app.side-collapsed .side-brand { justify-content: center; gap: 0; padding: 4px 0 6px; }
  .app.side-collapsed .side-collapse { justify-content: center; margin-right: 2px; }
  .app.side-collapsed .side-collapse .ic-svg { transform: rotate(180deg); }
  .app.side-collapsed .side-brand b,
  .app.side-collapsed .nav-item span,
  .app.side-collapsed .nav-item .cnt,
  .app.side-collapsed .side-user > div { display: none; }
  .app.side-collapsed .nav-item { justify-content: center; padding: 11px 0; }
  .app.side-collapsed .side-user { justify-content: center; padding: 6px 0; }
  .app.side-collapsed #logout { padding-left: 0; padding-right: 0; }
  .app.side-collapsed #logout span { display: none; }
}
@media (max-width: 900px) { .side-collapse { display: none; } }

/* ---- role badges / team list --------------------------------------------- */
.role-owner { display: inline-flex; align-items: center; gap: 5px; }
.owner-cap { font-size: 12.5px; color: var(--muted); }

.vat-note { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ---- promo deals on plan cards ------------------------------------------- */
.price-old { text-decoration: line-through; color: var(--muted); font-size: 16px; font-weight: 600; align-self: center; margin-right: 2px; }
.deal-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  background: rgba(225,29,72,.12); color: #be123c; font-size: 12px; font-weight: 700; }
:root[data-theme="dark"] .deal-badge { background: rgba(244,63,94,.18); color: #fb7185; }
.plan .deal-badge { margin-top: 8px; align-self: flex-start; }

/* ---- accent swatches (Profil → Wygląd) ------------------------------------ */
.swatch-row { display: flex; gap: 12px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; cursor: pointer; border: 0; position: relative;
  display: grid; place-items: center; color: #fff; box-shadow: var(--sh-sm); }
.swatch.sel { outline: 2.5px solid var(--ink); outline-offset: 2px; }
.theme-chip { min-width: 110px; justify-content: center; }

/* ---- brand logo image (replaces the old clock mark) ---------------------- */
.mark.mark--img, .kpm-mark.kpm-mark--img{background:none!important;box-shadow:none!important;padding:0!important;overflow:visible}
.mark--img img, .kpm-mark--img img{width:100%;height:100%;object-fit:contain;display:block}

/* dark mode: swap the light mark for the dark-optimised one (light header) — no white tile */
.mark--img .lg-d { display: none; }
:root[data-theme="dark"] .side-brand .mark--img .lg-l { display: none; }
:root[data-theme="dark"] .side-brand .mark--img .lg-d { display: block; }

.mark--img img, .kpm-mark--img img{transform:scale(1.21)}

/* ---- sidebar light/dark toggle (operator) -------------------------------- */
.side-theme { display:flex; gap:4px; background:var(--glass-2); border:1px solid var(--line); border-radius:12px; padding:4px; margin-bottom:12px; }
.st-opt { flex:1; display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:8px 6px; border:0; background:none; color:var(--muted); font:inherit; font-size:12.5px; font-weight:600; border-radius:9px; cursor:pointer; transition:background .15s, color .15s; }
.st-opt:hover { color:var(--ink); }
.st-opt.on { background:var(--surface); color:var(--brand-700); box-shadow:var(--sh-sm); }
.st-opt .ic-svg { width:16px; height:16px; margin:0; }
@media (min-width:901px){
  .app.side-collapsed .side-theme { flex-direction:column; gap:4px; }
  .app.side-collapsed .st-opt span { display:none; }
  .app.side-collapsed .st-opt { padding:8px 0; }
}

/* ---- segmented toggle (modals: client kind, etc.) ------------------------ */
.seg { display:inline-flex; gap:4px; background:var(--glass-2); border:1px solid var(--line); border-radius:11px; padding:4px; }
.seg-opt { display:inline-flex; align-items:center; gap:6px; padding:8px 14px; border:0; background:none; color:var(--muted); font:inherit; font-size:13.5px; font-weight:600; border-radius:8px; cursor:pointer; transition:background .15s, color .15s; }
.seg-opt:hover { color:var(--ink); }
.seg-opt.on { background:var(--surface); color:var(--brand-700); box-shadow:var(--sh-sm); }
.seg-opt .ic-svg { margin:0; }

/* --- global compact density: slightly smaller fonts + tighter layout (2026-07-14) --- */
body { zoom: 0.92; }

/* --- tone down bold: lighter, less heavy weights across the whole UI ------- */
b, strong { font-weight: 600 !important; }
h1, h2, h3, h4, h5, h6 { font-weight: 650 !important; }
[style*="font-weight:800"], [style*="font-weight: 800"] { font-weight: 700 !important; }
[style*="font-weight:750"], [style*="font-weight: 750"] { font-weight: 660 !important; }
[style*="font-weight:700"], [style*="font-weight: 700"] { font-weight: 620 !important; }

/* ==== client panel: package catalogue + add-on cards + Profil grid ========= */
.pkg-intro { max-width: 760px; font-size: 14px; line-height: 1.55; margin: 2px 0 18px; }
.pkg-note { font-size: 12.5px; margin-top: 16px; }
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr)); gap: 16px; align-items: stretch; }
.pkg-card { padding: 22px 20px 22px; position: relative; display: flex; flex-direction: column; }
.pkg-featured { border: 1.5px solid var(--brand-400); box-shadow: var(--sh-lg); }
.pkg-flag { position: absolute; top: -11px; left: 20px; background: linear-gradient(160deg, var(--brand-500), var(--violet));
  color: #fff; font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 999px; letter-spacing: .02em; }
.pkg-name { font-size: 19px; font-weight: 800; color: var(--brand-700); letter-spacing: -.01em; }
.pkg-tag { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.4; min-height: 34px; }
.pkg-price { font-size: 23px; font-weight: 800; color: var(--ink); margin-top: 12px; }
.pkg-per { font-size: 13px; font-weight: 600; color: var(--muted); }
.pkg-yr { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pkg-feats { list-style: none; margin: 15px 0 0; padding: 15px 0 0; border-top: 1px solid var(--line-2);
  display: flex; flex-direction: column; gap: 2px; flex: 1; }
.pkg-feat { display: flex; gap: 9px; align-items: flex-start; padding: 5px 0; }
.pkg-feat-ic { color: var(--brand-600); flex: none; margin-top: 1px; display: inline-flex; }
.pkg-feat b { font-size: 13.5px; }
.pkg-feat-d { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; }
.pkg-have { margin-top: 15px; display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  background: rgba(22,163,74,.12); color: var(--ok); font-size: 12.5px; font-weight: 600; padding: 6px 11px; border-radius: 999px; }

.addon-card { padding: 20px; display: flex; flex-direction: column; }
.addon-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.addon-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-600); }
.addon-title { margin: 0 0 8px; font-size: 18px; font-weight: 800; }
.addon-desc { margin: 0 0 15px; font-size: 13.5px; line-height: 1.6; color: var(--ink); }
.addon-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.addon-list li { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--muted); }
.addon-list li .ic-svg { color: var(--brand-600); flex: none; margin-top: 1px; }
.addon-foot { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line-2); padding-top: 12px; }

.pf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 14px; align-items: start; margin-top: 14px; }
.pf-lbl { font-size: 12.5px; font-weight: 600; color: var(--muted); display: block; }

/* ---- Powiadomienia (notifications feed) ----------------------------------- */
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif-item { display: flex; gap: 13px; align-items: flex-start; padding: 14px 16px; }
.notif-new { border-left: 3px solid var(--brand-500); }
.notif-ic { width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--field); }
.notif-body { flex: 1; min-width: 0; }
.notif-top { display: flex; align-items: center; gap: 8px; }
.notif-top b { font-size: 14.5px; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-500); flex: none; }
.notif-when { margin-left: auto; font-size: 12px; color: var(--muted); flex: none; white-space: nowrap; }
.notif-text { font-size: 13px; line-height: 1.5; color: var(--muted); margin-top: 3px; }
.pulpit-notif-row { display: flex; gap: 11px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line-2); }
.pulpit-notif-row:first-child { border-top: 0; padding-top: 2px; }
.pulpit-notif-sub { font-size: 12px; line-height: 1.4; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-click { cursor: pointer; transition: border-color .15s, transform .05s; }
.notif-item.notif-click:hover { border-color: var(--brand-400); }
.pulpit-notif-row.notif-click { border-radius: 10px; margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.pulpit-notif-row.notif-click:hover { background: var(--brand-soft); }
.notif-click:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 2px; }

/* ---- busy indicator for operations that hit the payment provider -------------------------------
   Charging a card is a synchronous round trip to Stripe (authorise + invoice + confirm), so these
   requests genuinely take a few seconds. Indeterminate on purpose: there is no real progress to
   report, so the UI names the stage instead of inventing a percentage. */
.kp-busy { display: flex; gap: 13px; align-items: flex-start; padding: 4px 0 2px; }
.kp-busy-spin { width: 34px; height: 34px; border-radius: 50%; flex: none;
  border: 3px solid var(--line-2); border-top-color: var(--brand-600); animation: kpspin .9s linear infinite; }
.kp-bar { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin-top: 14px; }
.kp-bar > i { display: block; height: 100%; width: 38%; border-radius: 99px;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-600)); animation: kpslide 1.4s ease-in-out infinite; }
@keyframes kpspin  { to { transform: rotate(360deg); } }
@keyframes kpslide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
/* inline spinner for a button that is waiting on the same kind of request */
.btn .kp-dot { display: inline-block; width: 13px; height: 13px; margin-right: 8px; vertical-align: -2px;
  border-radius: 50%; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: kpspin .8s linear infinite; }
.btn-ghost .kp-dot { border-color: var(--line-2); border-top-color: var(--brand-600); }
@media (prefers-reduced-motion: reduce) {
  .kp-busy-spin, .btn .kp-dot { animation-duration: 2.4s; }
  .kp-bar > i { animation: none; width: 100%; opacity: .5; }
}

/* Long invoice list: show ~6 rows and scroll the REST inside the box, so the firma modal keeps its
   height instead of growing past the viewport. --tbl-row is one .tbl row (13px padding top+bottom
   plus a ~19px line box); change it here if .tbl padding changes. */
/* scrollbar-gutter: stable is load-bearing — without it the scrollbar appears only AFTER the height
   is applied, narrowing the cells, re-wrapping the text and making the rows taller than when they were
   measured, so the box ends mid-row. Reserving the gutter keeps the width constant throughout. */
.tbl-scroll { --tbl-row: 59px; max-height: calc(var(--tbl-row) * 6); overflow-y: auto;
  overscroll-behavior: contain; scrollbar-gutter: stable; }
.tbl-scroll::-webkit-scrollbar { width: 9px; }
.tbl-scroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; }
.tbl-scroll::-webkit-scrollbar-thumb:hover { background: var(--muted); }
