/* e-WebLink – style wg makiety docs/makieta (Manrope + Inter, granat/niebieski/pomarańcz). */
:root {
  --ink: #0F172A;
  --muted: #475569;
  --line: #E2E8F0;
  --line-soft: #F1F5F9;
  --bg: #F5F7FA;
  --card: #FFFFFF;
  --primary: #1F4FD1;
  --primary-dark: #163A9E;
  --primary-soft: #E8EEFF;
  --accent: #C2410C;
  --accent-soft: #FFF1E8;
  --ok-bg: #DCFCE7; --ok-fg: #166534;
  --warn-bg: #FEF3C7; --warn-fg: #92400E;
  --bad-bg: #FEE2E2; --bad-fg: #991B1B;
  --side: #0F172A;
  --side-active: #1E293B;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.5; }
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
h1, h2, h3 { font-family: Manrope, Inter, sans-serif; margin: 0; line-height: 1.2; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-family: Manrope, sans-serif; font-weight: 800; font-size: 19px; }
.logo svg { flex: none; }

/* Strona publiczna */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header .inner { max-width: 1200px; margin: 0 auto; padding: 16px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 22px; flex: 1 1 auto; }
.site-header nav a { color: #334155; text-decoration: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 48px 24px; }
.container.narrow { max-width: 760px; }
.hero { background: var(--card); }
.hero .inner { max-width: 1200px; margin: 0 auto; padding: 80px 24px; display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.hero h1 { font-size: 50px; letter-spacing: -0.02em; }
.lead { font-size: 18px; color: var(--muted); max-width: 560px; }
.pill { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: #9A3412; font-size: 13px; font-weight: 600; }
.site-footer { background: var(--side); color: #CBD5E1; }
.site-footer .inner { max-width: 1200px; margin: 0 auto; padding: 36px 24px; display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; font-size: 14px; }
.site-footer a { color: #CBD5E1; }
.prose { line-height: 1.7; }
.prose h2 { margin: 28px 0 8px; }

/* Panel */
.app { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar { flex: 1 1 240px; max-width: 260px; background: var(--side); color: #CBD5E1; padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; }
.sidebar .logo { color: #fff; padding: 4px 8px 20px; }
.sidebar a.nav { padding: 11px 12px; border-radius: 10px; color: #CBD5E1; text-decoration: none; }
.sidebar a.nav:hover { background: var(--side-active); color: #fff; }
.sidebar a.nav.active { background: var(--side-active); color: #fff; font-weight: 600; }
.sidebar .spacer { flex: 1 1 auto; }
.sidebar form button { width: 100%; text-align: left; background: none; border: 0; color: #CBD5E1; padding: 11px 12px; font: inherit; cursor: pointer; border-radius: 10px; }
.sidebar form button:hover { background: var(--side-active); color: #fff; }
.sidebar.admin { background: #1C1917; }
.main { flex: 999 1 560px; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 24px; }

/* Karty i siatki */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card.flush { padding: 0; overflow-x: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat .label { font-size: 13px; color: var(--muted); }
.stat .value { font-family: Manrope, sans-serif; font-weight: 800; font-size: 30px; margin-top: 4px; }
.stat .value.accent { color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.steps li { padding: 14px 16px; border-radius: 12px; background: var(--line-soft); color: var(--muted); }
.steps li.done { background: var(--primary-soft); color: #1E3A8A; }
.steps li.now { background: var(--primary); color: #fff; }

/* Tabele */
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; color: var(--muted); font-size: 13px; font-weight: 600; background: #F8FAFC; padding: 13px 16px; }
table.data td { padding: 13px 16px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
table.data td.nowrap, table.data th.nowrap { white-space: nowrap; }
table.data td.trunc { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* Etykiety */
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge.warn { background: var(--warn-bg); color: var(--warn-fg); }
.badge.bad { background: var(--bad-bg); color: var(--bad-fg); }
.badge.info { background: var(--primary-soft); color: #1E3A8A; }

/* Formularze */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.field input, .field select, .field textarea, input.input, select.input {
  padding: 12px 14px; border-radius: 10px; border: 1px solid #CBD5E1; font: inherit; font-weight: 400; background: #fff; color: var(--ink); min-height: 44px;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.field .error, .error-text { font-weight: 500; color: var(--bad-fg); font-size: 13px; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
label.check input { width: 18px; height: 18px; }

/* Przyciski */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; background: var(--primary); color: #fff; }
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn.secondary { background: #fff; color: var(--ink); border-color: #CBD5E1; }
.btn.secondary:hover { background: var(--line-soft); color: var(--ink); }
.btn.danger { background: #fff; color: var(--bad-fg); border-color: #FCA5A5; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.success { background: #16A34A; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--primary); cursor: pointer; }
.link-btn.danger { color: var(--bad-fg); }

/* Komunikaty */
.alert { padding: 14px 16px; border-radius: 12px; border: 1px solid; }
.alert.ok { background: #F0FDF4; border-color: #BBF7D0; color: #14532D; }
.alert.warn { background: #FFF7ED; border-color: #FED7AA; color: #7C2D12; }
.alert.bad { background: #FEF2F2; border-color: #FECACA; color: #7F1D1D; }
.alert.info { background: #EFF4FF; border-color: #C7D7FE; color: #1E3A8A; }

/* Kod */
.code { background: var(--ink); color: #E2E8F0; border-radius: 12px; padding: 18px 20px; overflow-x: auto; }
.code pre { margin: 0; font-size: 13px; line-height: 1.7; white-space: pre; }
.code .label { font-size: 12px; color: #94A3B8; margin-bottom: 8px; }

/* Logowanie */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.auth .card { width: 100%; max-width: 440px; }

/* Lista projektów */
.projects a { display: flex; justify-content: space-between; gap: 12px; padding: 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.projects a.active { background: var(--primary-soft); color: #1E3A8A; font-weight: 600; }
.projects a:hover { background: var(--line-soft); }

/* Paginacja Laravela */
nav[role="navigation"] { font-size: 14px; }
nav[role="navigation"] svg { width: 18px; height: 18px; }

@media (max-width: 720px) {
  .main { padding: 20px 16px; }
  .sidebar { max-width: none; }
  .hero h1 { font-size: 36px; }
  .steps { grid-template-columns: 1fr; }
}
