/* ============================================================================
   AnalitykaSprzedawcy — system designu
   Kierunek: dopracowany, „editorial" dashboard analityczny.
   Ciemny leśny sidebar · ciepłe płótno · szmaragdowy akcent ·
   Bricolage Grotesque (nagłówki) + Instrument Sans (tekst). Bez build-stepu.
   ========================================================================== */

@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 400 800;
  font-display: swap; src: url("/assets/bricolage-latin-b86257e5.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 400 800;
  font-display: swap; src: url("/assets/bricolage-latinext-f02b0791.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Sans"; font-style: normal; font-weight: 400 600;
  font-display: swap; src: url("/assets/instrument-latin-570a9648.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Instrument Sans"; font-style: normal; font-weight: 400 600;
  font-display: swap; src: url("/assets/instrument-latinext-a083bc1c.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

:root {
  --ink:        #18211c;
  --ink-soft:   #55615a;
  --ink-faint:  #8a948d;
  --canvas:     #f4f3ed;
  --surface:    #ffffff;
  --line:       #e7e6dd;
  --line-soft:  #f0efe8;

  --forest:     #0f1d17;   /* sidebar */
  --forest-2:   #16271f;
  --emerald:    #1f9d63;
  --emerald-d:  #178050;
  --emerald-l:  #e6f5ec;

  --amber:      #c8842a;
  --amber-bg:   #fbf0dd;
  --rose:       #c0392f;
  --rose-bg:    #fbe9e7;

  --sidebar-w: 244px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20,30,24,.05), 0 6px 20px -8px rgba(20,30,24,.12);
  --shadow-sm: 0 1px 2px rgba(20,30,24,.06);

  --display: "Bricolage Grotesque", Georgia, serif;
  --body: "Instrument Sans", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background: var(--canvas);
  font-family: var(--body); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}

h1, h2, h3, .num, .logo-text b, .brand {
  font-family: var(--display); font-weight: 700; letter-spacing: -.015em; color: var(--ink);
}
h1 { font-size: 30px; margin: 0 0 6px; line-height: 1.1; }
h2 { font-size: 20px; margin: 30px 0 14px; }
h3 { font-size: 16px; margin: 18px 0 10px; }
p { margin: 10px 0; }
a { color: var(--emerald-d); text-decoration: none; }
a:hover { color: var(--emerald); }
strong, b { font-weight: 600; }

/* ===== App shell ===== */
body.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  position: sticky; top: 0; align-self: flex-start; height: 100vh;
  background: linear-gradient(180deg, var(--forest-2), var(--forest));
  color: #cdd8d0; padding: 22px 16px; display: flex; flex-direction: column; gap: 6px;
}
.logo { display: flex; align-items: center; gap: 11px; margin: 4px 6px 22px; color: #fff; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--emerald), #2fce86);
  color: #06150d; font-family: var(--display); font-weight: 800; font-size: 16px;
  box-shadow: 0 4px 14px -4px rgba(47,206,134,.5);
}
.logo-text { font-family: var(--display); font-size: 15px; line-height: 1.05; color: #eef3ef; }
.logo-text b { color: #fff; font-weight: 800; }

.side-group {
  font-size: 11px; text-transform: uppercase; letter-spacing: .12em;
  color: #6f8478; margin: 18px 8px 4px; font-weight: 600;
}
.side-nav a {
  display: block; padding: 9px 12px; border-radius: 10px; color: #b9c7bf;
  font-weight: 500; font-size: 14.5px; transition: background .15s, color .15s;
}
.side-nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.side-nav a.active {
  background: rgba(47,206,134,.14); color: #fff;
  box-shadow: inset 3px 0 0 var(--emerald);
}

.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 30px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.7);
  backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 5;
}
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--ink-soft); font-size: 14px; }

.page {
  padding: 30px; max-width: 1180px; width: 100%;
  animation: rise .4s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===== Auth shell ===== */
body.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(47,206,134,.18), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(31,157,99,.12), transparent 55%),
    var(--forest);
}
.auth-shell { width: 100%; max-width: 420px; text-align: center; }
.auth-brand { display: inline-flex; align-items: center; gap: 12px; color: #eaf2ec;
  font-family: var(--display); font-weight: 700; font-size: 20px; margin-bottom: 20px; }
.auth-card {
  background: var(--surface); border-radius: 18px; padding: 30px 28px;
  box-shadow: 0 24px 60px -22px rgba(0,0,0,.55); text-align: left;
}
.auth-card h1 { font-size: 23px; margin-bottom: 16px; }
.auth-card form { display: flex; flex-direction: column; gap: 2px; }
.auth-card input { width: 100%; margin: 6px 0; }
.auth-card input[type="submit"] { width: 100%; margin-top: 10px; }
.auth-card p { font-size: 14px; }
.auth-foot { color: #93a79b; font-size: 13px; margin-top: 18px; }

/* ===== Cards / tables ===== */
table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin: 14px 0; box-shadow: var(--shadow-sm);
}
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
thead th {
  background: #fbfbf8; font-family: var(--body); font-size: 11.5px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fbfcfb; }
td a { font-weight: 500; }

/* ===== KPI ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin: 18px 0 6px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: linear-gradient(var(--emerald), #2fce86); }
.kpi .k-label { color: var(--ink-faint); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.kpi .k-value { font-family: var(--display); font-weight: 800; font-size: 30px; margin: 6px 0 4px; letter-spacing: -.02em; }
.kpi .k-delta { font-size: 13px; font-weight: 600; }
.k-delta.up { color: var(--emerald-d); }
.k-delta.down { color: var(--rose); }
.k-delta.flat { color: var(--ink-faint); }

/* ===== Toolbar / cards ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm); margin: 14px 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.lead { color: var(--ink-soft); margin-top: -2px; }
.table-wrap { max-width: 100%; overflow-x: auto; }
.empty-state { padding: 32px; text-align: center; color: var(--ink-soft); border: 1px dashed var(--line); border-radius: var(--radius); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 20px 0; }
.details-grid { display: grid; grid-template-columns: minmax(130px, 220px) 1fr; gap: 8px 18px; }
.details-grid dt { font-weight: 600; color: var(--ink-soft); }
.details-grid dd { margin: 0; overflow-wrap: anywhere; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.action-grid form { border: 1px solid var(--line-soft); padding: 12px; border-radius: var(--radius-sm); }
.action-grid input[type="text"] { width: 100%; }
.system-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.system-check h2 { margin: 10px 0 4px; }
.status-down { border-left: 4px solid var(--rose); }
.status-degraded { border-left: 4px solid var(--amber); }
.status-ok { border-left: 4px solid var(--emerald); }
.problem-critical { border-left: 4px solid var(--rose); }
.problem-warning { border-left: 4px solid var(--amber); }
.one-time-code { font-size: 18px; user-select: all; }
.drawer-toggle, .drawer-button { display: none; }
code { overflow-wrap: anywhere; }

/* ===== Badges ===== */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .01em; }
.badge-plan { background: var(--emerald-l); color: var(--emerald-d); }
.badge-warn { background: var(--amber-bg); color: var(--amber); }
.badge-ok   { background: var(--emerald-l); color: var(--emerald-d); }
.badge-muted{ background: #eef0ec; color: var(--ink-soft); }

/* ===== Flash ===== */
.flash { border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 16px; font-weight: 500;
  border: 1px solid transparent; }
.flash-notice { background: var(--emerald-l); color: var(--emerald-d); border-color: #c7e8d4; }
.flash-alert  { background: var(--rose-bg);  color: var(--rose);     border-color: #f3cfca; }
.flash-alert .btn { margin-left: 8px; }

/* Konto odłączone świadomie przez merchanta: widoczne, wyszarzone, bez alarmu. */
tr.account-disconnected td { color: var(--ink-soft); opacity: .6; }
tr.account-disconnected td:last-child { opacity: 1; }
a.account-disconnected { color: var(--ink-soft); opacity: .6; }

/* ===== Forms ===== */
form { margin: 14px 0; }
label { display: inline-block; font-weight: 600; font-size: 13px; color: var(--ink-soft); margin: 0 6px 2px 0; }
input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="number"], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 11px; margin: 4px 6px 4px 0;
}
input::placeholder { color: var(--ink-faint); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(31,157,99,.16);
}

/* ===== Buttons ===== */
button, input[type="submit"], .btn {
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--emerald); color: #fff; border: 1px solid transparent;
  border-radius: var(--radius-sm); padding: 9px 16px; text-decoration: none;
  display: inline-block; transition: background .15s, transform .05s, box-shadow .15s;
  box-shadow: 0 2px 8px -2px rgba(31,157,99,.5);
}
button:hover, input[type="submit"]:hover, .btn:hover { background: var(--emerald-d); color: #fff; }
button:active, .btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); box-shadow: none; }
.btn-ghost:hover { background: #fff; color: var(--ink); border-color: var(--ink-faint); }
.btn-sm { padding: 6px 11px; font-size: 13px; }

/* akcje w komórkach obok siebie */
td form, td .btn, td button { display: inline-block; margin: 2px 4px 2px 0; vertical-align: middle; }

/* ===== Wykresy ===== */
[id^="chart-"] { background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin: 14px 0; box-shadow: var(--shadow-sm); }

/* ===== Responsywność ===== */
@media (max-width: 820px) {
  body.app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap;
    align-items: center; gap: 8px 14px; }
  .side-group { display: none; }
  .side-nav { display: contents; }
  .page, .topbar { padding: 18px; }
}

@media (max-width: 820px) {
  .admin-app { display: flex; flex-direction: row; }
  .admin-sidebar { position: fixed; inset: 0 auto 0 0; width: min(84vw, 290px); height: 100vh; z-index: 20;
    display: block; transform: translateX(-105%); transition: transform .2s ease; }
  .drawer-toggle:checked + .admin-sidebar { transform: translateX(0); }
  .drawer-button { display: inline-block; }
  .admin-page { padding: 16px; }
  .details-grid { grid-template-columns: 1fr; }
  .details-grid dd { margin-bottom: 8px; }
}

/* ============================================================================
   Marketing / landing (strony publiczne)
   ========================================================================== */
body.marketing { display: block; background: var(--canvas); color: var(--ink); }

.mk-topbar { display: flex; align-items: center; gap: 18px; max-width: 1100px;
  margin: 0 auto; padding: 20px 24px; }
.mk-logo { display: flex; align-items: center; gap: 10px; font-family: var(--display);
  font-size: 19px; color: var(--ink); text-decoration: none; }
.mk-logo b { color: var(--emerald-d); }
.mk-nav { margin-left: auto; display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.mk-nav a:not(.btn) { color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 14px; }
.mk-nav a:not(.btn):hover { color: var(--ink); }

.mk-main { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.mk-flash { max-width: 1100px; margin: 8px auto; }

.mk-hero { text-align: center; padding: 56px 0 36px; }
.mk-eyebrow { display: inline-block; background: var(--emerald-l); color: var(--emerald-d);
  font-weight: 700; font-size: 13px; padding: 5px 12px; border-radius: 999px; }
.mk-hero h1 { font-family: var(--display); font-size: clamp(34px, 6vw, 56px); line-height: 1.05;
  margin: 18px 0 14px; letter-spacing: -.02em; }
.mk-lead { max-width: 640px; margin: 0 auto; font-size: 18px; color: var(--ink-soft); }
.mk-cta { display: flex; gap: 12px; justify-content: center; margin: 26px 0 30px; flex-wrap: wrap; }

.mk-badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.mk-badge { font-size: 13px; font-weight: 600; color: var(--ink-faint); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; }
.mk-badge-on { color: var(--emerald-d); border-color: var(--emerald); background: var(--emerald-l); }

.mk-section { padding: 40px 0; border-top: 1px solid var(--line); }
.mk-section > h2 { font-family: var(--display); font-size: 28px; margin: 0 0 22px; }
.mk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.mk-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); }
.mk-card h3 { font-family: var(--display); margin: 0 0 8px; font-size: 19px; }
.mk-card p { color: var(--ink-soft); margin: 0; }

.mk-soon ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.mk-soon li { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius-sm);
  padding: 12px 16px; color: var(--ink-soft); font-weight: 600; }

.mk-pricing .mk-plan { display: flex; flex-direction: column; }
.mk-price { font-family: var(--display); font-size: 32px; margin: 6px 0 12px; }
.mk-price span { font-size: 15px; color: var(--ink-faint); font-family: var(--body); }
.mk-plan ul { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 7px; color: var(--ink-soft); }
.mk-plan ul li::before { content: "✓ "; color: var(--emerald-d); font-weight: 700; }
.mk-plan .btn { margin-top: auto; align-self: start; }
.mk-note { color: var(--ink-faint); font-size: 14px; margin-top: 16px; }

#faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 18px; margin: 10px 0; }
#faq summary { font-weight: 700; cursor: pointer; }
#faq details p { color: var(--ink-soft); margin: 10px 0 0; }

.mk-prose { max-width: 760px; }
.mk-prose h1 { font-family: var(--display); font-size: 34px; }
.mk-prose h2 { font-family: var(--display); font-size: 22px; margin-top: 28px; }
.mk-prose h3 { font-family: var(--display); font-size: 18px; margin: 24px 0 8px; }
.mk-prose p, .mk-prose li { color: var(--ink-soft); line-height: 1.6; }
.mk-prose li + li { margin-top: 6px; }
.legal-document { overflow-wrap: anywhere; }
.legal-document h1 { line-height: 1.15; }
.legal-subtitle { font-size: 18px; }
.legal-effective { margin-bottom: 36px; }
.legal-copyright { border-top: 1px solid var(--line); margin-top: 36px; padding-top: 20px; font-size: 13px; }

.mk-footer { border-top: 1px solid var(--line); margin-top: 40px; }
.mk-foot-cols { max-width: 1100px; margin: 0 auto; padding: 32px 24px 8px;
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.mk-foot-cols p { color: var(--ink-soft); max-width: 280px; }
.mk-footer nav { display: flex; flex-direction: column; gap: 8px; }
.mk-footer nav a { color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.mk-footer nav a:hover { color: var(--ink); }
.mk-copy { max-width: 1100px; margin: 0 auto; padding: 8px 24px 28px; color: var(--ink-faint); font-size: 13px; }

@media (max-width: 640px) {
  .mk-foot-cols { flex-direction: column; }
}
