/* =====================================================================
   Circle Media — Panel Klienta. Style (namespace .pcm-*).
   Biel / ink #0E0D0C / akcent czerwień #C8102E.
   Archivo (nagłówki) · Hanken Grotesk (tekst) · JetBrains Mono (detale).
   ===================================================================== */

:root {
  --pcm-ink: #0E0D0C;
  --pcm-bg: #ffffff;
  --pcm-paper: #ffffff;
  --pcm-accent: #C8102E;
  --pcm-accent-700: #a50d26;
  --pcm-muted: #6b6864;
  --pcm-line: #e7e4e0;
  --pcm-soft: #f6f4f2;
  --pcm-soft-2: #efece8;
  --pcm-ok: #1f8a4c;
  --pcm-radius: 14px;
  --pcm-radius-s: 9px;
  --pcm-shadow: 0 1px 2px rgba(14,13,12,.04), 0 8px 24px rgba(14,13,12,.05);
  --pcm-shell: 1080px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

.pcm-body {
  background:
    radial-gradient(1200px 480px at 100% -10%, #faf2f3 0%, rgba(250,242,243,0) 60%),
    var(--pcm-bg);
  color: var(--pcm-ink);
  font-family: "Hanken Grotesk", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.pcm-shell { width: 100%; max-width: var(--pcm-shell); margin: 0 auto; padding: 0 24px; }
.pcm-mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.pcm-muted { color: var(--pcm-muted); }

/* ---------- Topbar ---------- */
.pcm-topbar { border-bottom: 1px solid var(--pcm-line); background: rgba(255,255,255,.85); backdrop-filter: saturate(1.4) blur(8px); position: sticky; top: 0; z-index: 20; }
.pcm-topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.pcm-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--pcm-ink); }
.pcm-brand__mark { width: 14px; height: 14px; border-radius: 50%; background: var(--pcm-accent); box-shadow: 0 0 0 4px rgba(200,16,46,.14); flex: none; }
.pcm-brand__text { font-family: "Archivo", sans-serif; font-weight: 800; letter-spacing: -.01em; font-size: 1.08rem; }
.pcm-brand__tag { font-family: "JetBrains Mono", monospace; font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--pcm-muted); border: 1px solid var(--pcm-line); padding: 2px 7px; border-radius: 999px; }

.pcm-nav { display: flex; align-items: center; gap: 18px; }
.pcm-nav__link { text-decoration: none; color: var(--pcm-ink); font-weight: 600; font-size: .94rem; opacity: .82; }
.pcm-nav__link:hover { opacity: 1; color: var(--pcm-accent); }
.pcm-nav__user { color: var(--pcm-muted); font-size: .9rem; padding-left: 6px; border-left: 1px solid var(--pcm-line); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcm-nav__logout { margin: 0; }

/* ---------- Main / layout ---------- */
.pcm-main { flex: 1 0 auto; padding: 34px 24px 64px; }
.pcm-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.pcm-h1 { font-family: "Archivo", sans-serif; font-weight: 800; letter-spacing: -.02em; font-size: 1.7rem; margin: 0; }
.pcm-h2 { font-family: "Archivo", sans-serif; font-weight: 700; letter-spacing: -.01em; font-size: 1.22rem; margin: 0; }
.pcm-h3 { font-family: "Archivo", sans-serif; font-weight: 700; font-size: 1rem; margin: 0; }
.pcm-sub { color: var(--pcm-muted); margin: 4px 0 0; }
.pcm-back { display: inline-block; text-decoration: none; color: var(--pcm-muted); font-size: .88rem; margin-bottom: 8px; }
.pcm-back:hover { color: var(--pcm-accent); }
.pcm-actions { display: flex; gap: 10px; }

/* ---------- Cards ---------- */
.pcm-card { background: var(--pcm-paper); border: 1px solid var(--pcm-line); border-radius: var(--pcm-radius); box-shadow: var(--pcm-shadow); padding: 22px 24px; margin-bottom: 20px; }
.pcm-card--narrow { max-width: 620px; }
.pcm-card--empty { text-align: center; }
.pcm-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pcm-section-head--mt { margin-top: 26px; }

/* ---------- Buttons ---------- */
.pcm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: "Hanken Grotesk", sans-serif; font-weight: 700; font-size: .92rem; line-height: 1; padding: 11px 18px; border-radius: var(--pcm-radius-s); border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: transform .04s ease, background .15s ease, border-color .15s ease; }
.pcm-btn:active { transform: translateY(1px); }
.pcm-btn--primary { background: var(--pcm-accent); color: #fff; }
.pcm-btn--primary:hover { background: var(--pcm-accent-700); }
.pcm-btn--ghost { background: #fff; color: var(--pcm-ink); border-color: var(--pcm-line); }
.pcm-btn--ghost:hover { border-color: var(--pcm-ink); }
.pcm-btn--block { width: 100%; }

.pcm-link { background: none; border: none; padding: 0; font: inherit; font-weight: 600; font-size: .9rem; color: var(--pcm-accent); cursor: pointer; text-decoration: none; }
.pcm-link:hover { text-decoration: underline; }
.pcm-link--danger { color: #b21f2d; }

/* ---------- Forms ---------- */
.pcm-form { display: flex; flex-direction: column; gap: 15px; }
.pcm-field { display: flex; flex-direction: column; gap: 6px; }
.pcm-field__label { font-size: .85rem; font-weight: 600; color: var(--pcm-ink); }
.pcm-input { font: inherit; color: var(--pcm-ink); background: #fff; border: 1px solid var(--pcm-line); border-radius: var(--pcm-radius-s); padding: 11px 13px; width: 100%; transition: border-color .15s, box-shadow .15s; }
.pcm-input:focus { outline: none; border-color: var(--pcm-accent); box-shadow: 0 0 0 3px rgba(200,16,46,.12); }
textarea.pcm-input { resize: vertical; min-height: 64px; }
.pcm-input--file { padding: 9px 13px; background: var(--pcm-soft); }
.pcm-field-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.pcm-form__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.pcm-hint { color: var(--pcm-muted); font-size: .86rem; margin: -2px 0 0; }

/* ---------- Flash ---------- */
.pcm-flash { border-radius: var(--pcm-radius-s); padding: 12px 15px; margin-bottom: 16px; font-size: .92rem; border: 1px solid; }
.pcm-flash--error { background: #fdf0f1; border-color: #f3c9ce; color: #97121f; }
.pcm-flash--success { background: #eefaf1; border-color: #bfe6cb; color: #156b38; }
.pcm-flash--info { background: #f3f6fc; border-color: #cfdcf0; color: #284b86; }

/* ---------- Auth ---------- */
.pcm-auth { max-width: 420px; margin: 6vh auto 0; }
.pcm-auth__card { background: #fff; border: 1px solid var(--pcm-line); border-radius: 18px; box-shadow: var(--pcm-shadow); padding: 32px 30px; }
.pcm-auth__card--admin { border-top: 3px solid var(--pcm-ink); }
.pcm-auth__brand { display: flex; align-items: center; gap: 9px; font-family: "Archivo", sans-serif; font-weight: 800; margin-bottom: 18px; }
.pcm-auth__title { font-family: "Archivo", sans-serif; font-weight: 800; font-size: 1.5rem; letter-spacing: -.02em; margin: 0 0 6px; }
.pcm-auth__lead { color: var(--pcm-muted); margin: 0 0 22px; font-size: .95rem; }
.pcm-auth__foot { text-align: center; color: var(--pcm-muted); font-size: .84rem; margin-top: 18px; }

/* ---------- Project / status ---------- */
.pcm-project__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.pcm-status { display: flex; flex-direction: column; gap: 20px; }

/* Stepper (bez numeracji 01/02/03 — kropki + etykiety) */
.pcm-stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; }
.pcm-stepper__item { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding-top: 2px; }
.pcm-stepper__item::before { content: ""; position: absolute; top: 7px; left: -50%; width: 100%; height: 2px; background: var(--pcm-line); z-index: 0; }
.pcm-stepper__item:first-child::before { display: none; }
.pcm-stepper__dot { position: relative; z-index: 1; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--pcm-line); }
.pcm-stepper__label { font-size: .78rem; color: var(--pcm-muted); font-weight: 600; }
.pcm-stepper__item.is-done .pcm-stepper__dot { background: var(--pcm-ink); border-color: var(--pcm-ink); }
.pcm-stepper__item.is-done::before { background: var(--pcm-ink); }
.pcm-stepper__item.is-current .pcm-stepper__dot { background: var(--pcm-accent); border-color: var(--pcm-accent); box-shadow: 0 0 0 4px rgba(200,16,46,.16); }
.pcm-stepper__item.is-current::before { background: var(--pcm-ink); }
.pcm-stepper__item.is-current .pcm-stepper__label { color: var(--pcm-ink); }

/* Progress */
.pcm-progress__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; }
.pcm-progress__label { font-size: .82rem; font-weight: 600; color: var(--pcm-muted); }
.pcm-progress__value { font-weight: 600; }
.pcm-progress__track { height: 9px; background: var(--pcm-soft-2); border-radius: 999px; overflow: hidden; }
.pcm-progress__fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--pcm-accent), #e23b52); transition: width .4s ease; }

/* Meta */
.pcm-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pcm-meta__item { background: var(--pcm-soft); border: 1px solid var(--pcm-line); border-radius: var(--pcm-radius-s); padding: 11px 14px; }
.pcm-meta__k { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--pcm-muted); margin-bottom: 3px; }
.pcm-meta__v { font-weight: 600; }

/* Pills (status) */
.pcm-pill { display: inline-block; font-size: .76rem; font-weight: 700; padding: 5px 11px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.pcm-pill--s0 { background: var(--pcm-soft-2); color: #44413d; border-color: var(--pcm-line); }
.pcm-pill--s1 { background: #eef3fb; color: #2b5298; border-color: #d3e0f3; }
.pcm-pill--s2 { background: #fff2ec; color: #b4521d; border-color: #f6d6c6; }
.pcm-pill--s3 { background: #f2eefb; color: #6a3ca8; border-color: #ddd1f1; }
.pcm-pill--s4 { background: #eafaf0; color: #15713c; border-color: #c6ead2; }

/* ---------- Timeline ---------- */
.pcm-timeline { list-style: none; margin: 6px 0 0; padding: 0; }
.pcm-timeline__item { display: grid; grid-template-columns: 22px 1fr; gap: 14px; }
.pcm-timeline__rail { position: relative; display: flex; justify-content: center; }
.pcm-timeline__rail::before { content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--pcm-line); }
.pcm-timeline__item:last-child .pcm-timeline__rail::before { bottom: auto; height: 14px; }
.pcm-timeline__node { position: relative; z-index: 1; width: 11px; height: 11px; border-radius: 50%; background: var(--pcm-accent); margin-top: 5px; box-shadow: 0 0 0 3px #fff; }
.pcm-timeline__body { padding-bottom: 20px; }
.pcm-timeline__date { color: var(--pcm-muted); font-size: .82rem; }
.pcm-timeline__text { margin-top: 3px; }
.pcm-attach { display: inline-flex; align-items: center; gap: 7px; margin-top: 9px; padding: 7px 12px; background: var(--pcm-soft); border: 1px solid var(--pcm-line); border-radius: var(--pcm-radius-s); text-decoration: none; color: var(--pcm-ink); font-size: .86rem; font-weight: 600; }
.pcm-attach:hover { border-color: var(--pcm-accent); color: var(--pcm-accent); }
.pcm-attach--static { cursor: default; }
.pcm-attach__icon { font-weight: 700; color: var(--pcm-accent); }

.pcm-empty { color: var(--pcm-muted); font-size: .94rem; margin: 6px 0; }

/* ---------- Tables ---------- */
.pcm-table-wrap { overflow-x: auto; }
.pcm-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.pcm-table th { text-align: left; font-weight: 600; color: var(--pcm-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; padding: 9px 12px; border-bottom: 1px solid var(--pcm-line); }
.pcm-table td { padding: 13px 12px; border-bottom: 1px solid var(--pcm-soft-2); vertical-align: top; }
.pcm-table tr:last-child td { border-bottom: none; }
.pcm-table__r { text-align: right; }
.pcm-rowactions { display: flex; gap: 14px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.pcm-rowactions form { margin: 0; }

/* ---------- Admin list ---------- */
.pcm-adminlist { list-style: none; margin: 8px 0 0; padding: 0; }
.pcm-adminlist__item { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--pcm-soft-2); }
.pcm-adminlist__item:last-child { border-bottom: none; }
.pcm-adminlist__text { margin-top: 3px; }

/* ---------- Credentials ---------- */
.pcm-creds { margin: 4px 0 20px; display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; }
.pcm-creds dt { color: var(--pcm-muted); font-size: .85rem; }
.pcm-creds dd { margin: 0; font-weight: 600; }
.pcm-creds__secret { font-size: 1.05rem; background: var(--pcm-soft); border: 1px dashed var(--pcm-accent); border-radius: 8px; padding: 6px 10px; display: inline-block; }

/* ---------- Error ---------- */
.pcm-error { text-align: center; padding: 8vh 0; }
.pcm-error__code { font-size: 3.4rem; font-weight: 700; color: var(--pcm-accent); }
.pcm-error__msg { color: var(--pcm-muted); margin: 6px 0 22px; }

/* ---------- Footer ---------- */
.pcm-footer { flex: none; border-top: 1px solid var(--pcm-line); padding: 18px 0; color: var(--pcm-muted); font-size: .85rem; }
.pcm-footer__inner { display: flex; align-items: center; justify-content: space-between; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .pcm-field-row { grid-template-columns: 1fr; }
  .pcm-meta { grid-template-columns: 1fr; }
  .pcm-page-head { flex-direction: column; align-items: flex-start; }
  .pcm-nav { gap: 12px; }
  .pcm-nav__user { display: none; }
  .pcm-stepper__label { font-size: .68rem; }
  .pcm-creds { grid-template-columns: 1fr; gap: 3px 0; }
  .pcm-creds dd { margin-bottom: 8px; }
}
