:root {
    --bg: #f5f5f3;
    --surface: #ffffff;
    --surface-soft: #fafaf8;
    --text: #191918;
    --muted: #73736f;
    --line: #e7e7e3;
    --dark: #20211f;
    --accent: #b78b5a;
    --accent-soft: #f3eadf;
    --danger: #a43c3c;
    --danger-soft: #fbefef;
    --radius: 14px;
    --shadow: 0 12px 34px rgba(22, 22, 20, .055);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.auth-page {
    background:
        radial-gradient(circle at 15% 15%, rgba(183,139,90,.10), transparent 28%),
        radial-gradient(circle at 85% 85%, rgba(32,33,31,.06), transparent 30%),
        var(--bg);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-content: center;
    padding: 28px;
}

.auth-card {
    width: min(100%, 420px);
    min-width: 420px;
    padding: 38px;
    background: rgba(255,255,255,.96);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.auth-brand, .brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--dark);
    color: #fff;
    font-size: 15px;
    font-weight: 650;
}

.auth-brand strong, .brand strong {
    display: block;
    font-size: 13px;
    line-height: 1.1;
    letter-spacing: .16em;
}

.auth-brand small, .brand small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 9px;
    line-height: 1;
    letter-spacing: .24em;
}

.auth-heading { margin: 42px 0 26px; }
.auth-heading h1, .error-card h1 {
    margin: 0 0 7px;
    font-size: 27px;
    line-height: 1.2;
    letter-spacing: -.025em;
    font-weight: 640;
}
.auth-heading p, .error-card p { margin: 0; color: var(--muted); }

.form-stack { display: grid; gap: 18px; }
.form-stack label { display: grid; gap: 7px; }
.form-stack label > span {
    color: #4d4d49;
    font-size: 12px;
    font-weight: 600;
}

input {
    width: 100%;
    height: 44px;
    padding: 0 13px;
    border: 1px solid #dcdcd7;
    border-radius: 9px;
    outline: none;
    background: #fff;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}

input:focus {
    border-color: #9c7951;
    box-shadow: 0 0 0 3px rgba(183,139,90,.14);
}

.button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.button.primary { background: var(--dark); color: #fff; }
.button.primary:hover { background: #090a09; }
.button.full { width: 100%; margin-top: 5px; }
.button.muted { border-color: var(--line); background: var(--surface); color: #999; }
.disabled-button { cursor: not-allowed; }

.alert {
    margin: -8px 0 20px;
    padding: 11px 13px;
    border: 1px solid #f0cccc;
    border-radius: 9px;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 12px;
}

.auth-foot {
    margin: 18px 0 0;
    color: #92928e;
    font-size: 11px;
    text-align: center;
}

.error-card h1 { margin-top: 38px; }
.error-card .button { margin-top: 26px; }

.app-page { padding-left: 238px; }

.sidebar {
    position: fixed;
    z-index: 10;
    inset: 0 auto 0 0;
    width: 238px;
    display: flex;
    flex-direction: column;
    padding: 26px 18px 20px;
    border-right: 1px solid var(--line);
    background: rgba(250,250,248,.94);
    backdrop-filter: blur(16px);
}

.brand { margin: 0 10px 34px; }
.nav { display: grid; gap: 4px; }
.nav-item {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 12px;
    border-radius: 9px;
    color: #555550;
    font-size: 13px;
}
.nav-item svg { width: 17px; height: 17px; fill: currentColor; opacity: .8; }
.nav-item.active { background: #ebebe7; color: var(--text); font-weight: 600; }
.nav-item.disabled { color: #aaa; cursor: default; }
.nav-item > small { margin-left: auto; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }

.sidebar-footer {
    margin-top: auto;
    padding: 18px 9px 0;
    border-top: 1px solid var(--line);
}
.user-block { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: #7c5a35;
    font-size: 12px;
    font-weight: 700;
}
.user-copy { min-width: 0; }
.user-copy strong, .user-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: 12px; }
.user-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.logout-link {
    margin: 10px 0 0 42px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #8c8c87;
    cursor: pointer;
    font-size: 11px;
}
.logout-link:hover { color: var(--text); }

.content { width: 100%; max-width: 1440px; margin: 0 auto; padding: 42px 48px 60px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.eyebrow { margin: 0 0 8px; color: #979791; font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.page-header h1 { margin: 0; font-size: 25px; line-height: 1.25; letter-spacing: -.025em; font-weight: 640; }
.page-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 13px; }

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 34px;
}
.stat-card {
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 19px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.stat-card span { color: var(--muted); font-size: 11px; font-weight: 600; }
.stat-card strong { font-size: 28px; line-height: 1; font-weight: 620; letter-spacing: -.04em; }
.stat-card.accent { border-color: #e5d5c2; background: var(--accent-soft); }

.panel {
    margin-top: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.panel-heading { display: flex; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font-size: 14px; font-weight: 650; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }

.empty-state { display: grid; justify-items: center; padding: 68px 24px 72px; text-align: center; }
.empty-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    margin-bottom: 17px;
    border-radius: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
}
.empty-icon svg { width: 19px; height: 19px; fill: #8b8b86; }
.empty-state h3 { margin: 0; font-size: 13px; font-weight: 650; }
.empty-state p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 18px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: #8b8b86; background: var(--surface-soft); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
td { color: #5a5a56; font-size: 12px; }
td strong { color: var(--text); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
.status-badge { padding: 4px 8px; border-radius: 999px; background: #efefec; font-size: 10px; }
.status-signed { background: #e8f3eb; color: #347044; }

@media (max-width: 950px) {
    .app-page { padding-left: 74px; }
    .sidebar { width: 74px; padding-inline: 12px; }
    .brand { margin-inline: 8px; }
    .brand > span:last-child, .nav-item span, .nav-item > small, .sidebar-footer .user-copy, .sidebar-footer form { display: none; }
    .nav-item { justify-content: center; padding: 0; }
    .sidebar-footer { padding-inline: 9px; }
    .user-block { justify-content: center; }
    .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
    .auth-card { min-width: 0; padding: 28px 24px; }
    .auth-shell { display: block; padding: 20px; }
    .auth-card { margin: 8vh auto 0; }
    .app-page { padding-left: 0; padding-top: 64px; }
    .sidebar { inset: 0 0 auto 0; width: auto; height: 64px; flex-direction: row; align-items: center; padding: 0 16px; border-right: 0; border-bottom: 1px solid var(--line); }
    .brand { margin: 0; }
    .nav { display: none; }
    .sidebar-footer { margin: 0 0 0 auto; padding: 0; border: 0; }
    .content { padding: 28px 18px 48px; }
    .page-header { display: block; }
    .page-header > .button { margin-top: 18px; }
    .stats { grid-template-columns: 1fr 1fr; gap: 9px; }
    .stat-card { min-height: 98px; padding: 16px; }
}

/* Etap 3 — kreator umów */
select, textarea {
    width: 100%;
    border: 1px solid #dcdcd7;
    border-radius: 9px;
    outline: none;
    background: #fff;
    color: var(--text);
    font: inherit;
    transition: border-color .15s, box-shadow .15s;
}
select { height: 44px; padding: 0 36px 0 13px; }
textarea { min-height: 78px; padding: 11px 13px; line-height: 1.55; resize: vertical; }
select:focus, textarea:focus { border-color: #9c7951; box-shadow: 0 0 0 3px rgba(183,139,90,.14); }
button:disabled { opacity: .35; cursor: default; }
.button.secondary { border-color: var(--line); background: var(--surface); color: #4d4d49; }
.button.secondary:hover { border-color: #cfcfc9; background: #fbfbf9; }
.text-link, .row-action, .back-link { color: #765735; font-size: 12px; font-weight: 600; }
.text-link:hover, .row-action:hover, .back-link:hover { color: #3d2b19; }
.compact-header { align-items: flex-end; }
.compact-header .back-link { display: inline-block; margin: 0 0 13px; }
.filter-bar { display: flex; align-items: center; gap: 10px; margin-top: 28px; }
.filter-bar input { width: min(420px, 100%); }
.filter-bar select { width: 190px; }
.list-panel { margin-top: 14px; }
.cell-main, .cell-sub { display: block; }
.cell-sub { margin-top: 2px; color: #999994; font-size: 10px; }
.click-row a { display: block; }

.form-content { max-width: 1140px; }
.contract-form { display: grid; gap: 14px; margin-top: 26px; }
.form-section { padding: 25px 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.section-intro { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 24px; }
.section-intro h2 { margin: 0; font-size: 14px; font-weight: 680; }
.section-intro p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.section-number { flex: 0 0 auto; color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: .08em; }
.row-intro { justify-content: space-between; align-items: center; }
.intro-left { display: flex; align-items: flex-start; gap: 13px; }
.small-button, .icon-button, .clear-key-button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: #5d5d58;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
}
.small-button { min-height: 34px; padding: 0 12px; }
.small-button:hover, .icon-button:hover { border-color: #c8c8c2; background: #f8f8f6; }
.form-grid { display: grid; gap: 18px; }
.form-grid.two-columns { grid-template-columns: 1fr 1fr; }
.full-row { grid-column: 1 / -1; }
.field { display: grid; gap: 7px; align-content: start; }
.field > span:first-child, .date-pair label > span { color: #4d4d49; font-size: 11px; font-weight: 650; }
.field em { color: #9b5c4d; font-style: normal; }
.field small { color: #94948f; font-size: 10px; }
.date-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.date-pair label { display: grid; gap: 7px; }
.input-suffix { position: relative; display: block; }
.input-suffix input { padding-right: 43px; }
.input-suffix b { position: absolute; top: 50%; right: 13px; transform: translateY(-50%); color: #92928d; font-size: 11px; font-weight: 600; }
.repeat-list { display: grid; gap: 8px; }
.repeat-row { display: grid; grid-template-columns: 25px 1fr 34px; align-items: center; gap: 8px; }
.repeat-index { color: #a1a19c; font-size: 10px; text-align: center; }
.icon-button { width: 30px; height: 30px; padding: 0; }
.remove-scope, .remove-stage { color: #93625a; }

.stages-list { display: grid; gap: 10px; }
.stage-card { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fcfcfa; transition: border-color .15s, box-shadow .15s; }
.stage-card.is-key { border-color: #d8b992; box-shadow: 0 0 0 2px rgba(183,139,90,.09); }
.stage-header { min-height: 45px; display: flex; align-items: center; justify-content: space-between; padding: 0 13px; border-bottom: 1px solid var(--line); background: #f8f8f5; }
.stage-header > div { display: flex; align-items: center; gap: 9px; }
.stage-header strong { font-size: 11px; }
.drag-handle { color: #b2b2ad; letter-spacing: -3px; }
.stage-actions { gap: 5px !important; }
.stage-actions .icon-button { width: 26px; height: 26px; }
.stage-body { display: grid; grid-template-columns: 1fr 300px; gap: 17px 22px; padding: 18px; }
.key-stage-choice { display: flex; align-items: flex-start; gap: 9px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
.key-stage-choice input { width: 15px; height: 15px; margin-top: 2px; accent-color: var(--accent); }
.key-stage-choice span { min-width: 0; }
.key-stage-choice b, .key-stage-choice small { display: block; }
.key-stage-choice b { font-size: 11px; }
.key-stage-choice small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.stage-meta { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.clear-key-button { margin-top: 12px; padding: 7px 10px; }
.clear-key-button[hidden] { display: none; }
.section-disabled { opacity: .64; }
.conditional-cost[hidden] { display: none; }
.legal-note { margin: 17px 0 0; padding: 10px 12px; border-left: 2px solid #d9c1a5; background: #faf7f2; color: #77716a; font-size: 10px; }
.form-footer { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 8px; padding: 13px 0; background: linear-gradient(to bottom, rgba(245,245,243,0), var(--bg) 24%); }
.form-errors { margin-top: 22px; padding: 14px 16px; border: 1px solid #f0cccc; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 12px; }
.form-errors ul { margin: 7px 0 0; padding-left: 18px; }

.success-note { margin-top: 22px; padding: 11px 14px; border: 1px solid #cfe4d4; border-radius: 9px; background: #edf7ef; color: #347044; font-size: 12px; }
.title-status { display: flex; align-items: center; gap: 12px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; margin-top: 26px; align-items: start; }
.detail-main, .detail-side { display: grid; gap: 14px; }
.detail-card { padding: 23px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.compact-card { padding: 19px; }
.detail-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.detail-card-head h2 { margin: 0; font-size: 13px; font-weight: 680; }
.detail-card-head > span { color: var(--muted); font-size: 11px; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0; }
.summary-grid div { padding: 13px; border-radius: 9px; background: var(--surface-soft); }
.summary-grid dt, .side-label { color: #92928d; font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.summary-grid dd { margin: 5px 0 0; font-size: 12px; font-weight: 600; }
.prose-block { margin-top: 24px; }
.prose-block h3 { margin: 0 0 8px; font-size: 11px; }
.prose-block p, .compact-card p { margin: 0; color: #62625e; font-size: 12px; line-height: 1.65; white-space: pre-line; }
.scope-summary { margin: 0; padding-left: 21px; color: #555550; font-size: 12px; }
.scope-summary li { padding: 4px 0 4px 5px; }
.timeline { display: grid; }
.timeline-item { position: relative; display: grid; grid-template-columns: 33px 1fr; gap: 13px; padding-bottom: 24px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:not(:last-child)::before { content: ''; position: absolute; top: 31px; bottom: 2px; left: 15px; width: 1px; background: var(--line); }
.timeline-marker { position: relative; z-index: 1; width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fafaf8; color: #777; font-size: 10px; font-weight: 700; }
.timeline-item.key .timeline-marker { border-color: #cba87f; background: var(--accent-soft); color: #77532d; }
.timeline-copy { padding-top: 4px; }
.timeline-title { display: flex; align-items: center; gap: 8px; }
.timeline-title h3 { margin: 0; font-size: 12px; }
.timeline-title span { padding: 3px 6px; border-radius: 5px; background: var(--accent-soft); color: #7c5a35; font-size: 8px; font-weight: 750; letter-spacing: .05em; }
.timeline-copy > p { margin: 7px 0 0; color: var(--muted); font-size: 11px; white-space: pre-line; }
.timeline-meta { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 9px; color: #8a8a85; font-size: 9px; }
.timeline-meta b { color: #555550; }
.key-stage-name { margin-bottom: 17px !important; color: var(--text) !important; font-weight: 650; }
.side-label { margin: 0 0 5px !important; }
.side-value { margin-top: 11px !important; color: var(--text) !important; font-size: 16px !important; font-weight: 680; }
.warning-card { border-color: #ead7be; background: #fcf8f2; }
.muted-copy { margin: 0; color: var(--muted); font-size: 11px; }

@media (max-width: 900px) {
    .stage-body { grid-template-columns: 1fr; }
    .stage-name-field, .key-stage-choice { grid-column: 1; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-side { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
    .filter-bar { align-items: stretch; flex-direction: column; }
    .filter-bar input, .filter-bar select { width: 100%; }
    .form-grid.two-columns, .summary-grid { grid-template-columns: 1fr; }
    .full-row { grid-column: 1; }
    .date-pair, .stage-meta { grid-template-columns: 1fr; }
    .stage-body { padding: 14px; }
    .form-section { padding: 20px 16px; }
    .row-intro { align-items: flex-start; gap: 12px; }
    .detail-side { grid-template-columns: 1fr; }
    .title-status { align-items: flex-start; flex-direction: column; gap: 8px; }
}

/* Etap 4 — ustawienia */
.settings-content { max-width: 1060px; }
.settings-form { max-width: 920px; }
.settings-grid { column-gap: 22px; }
.legal-form-banner {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 3px 15px;
    margin-bottom: 22px;
    padding: 14px 16px;
    border: 1px solid #e5d5c2;
    border-radius: 10px;
    background: var(--accent-soft);
}
.legal-form-banner > span { color: #8b6b47; font-size: 9px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.legal-form-banner > strong { font-size: 12px; }
.legal-form-banner > p { grid-column: 2; margin: 1px 0 0; color: #786c5e; font-size: 10px; }
.portfolio-warning { margin-bottom: 20px; padding: 11px 13px; border-left: 2px solid #d2b38d; background: #faf7f2; color: #6f675d; font-size: 11px; }
.channel-field { display: flex; flex-wrap: wrap; gap: 9px 18px; margin: 0; padding: 0; border: 0; }
.channel-field legend { margin-bottom: 9px; color: #4d4d49; font-size: 11px; font-weight: 650; }
.channel-field label { display: flex; align-items: center; gap: 7px; cursor: pointer; color: #575752; font-size: 11px; }
.channel-field input { width: 15px; height: 15px; accent-color: var(--accent); }

@media (max-width: 700px) {
    .legal-form-banner { grid-template-columns: 1fr; }
    .legal-form-banner > p { grid-column: 1; }
}

/* Etap 5 — klient */
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-actions form { margin: 0; }
.client-link-panel, .client-completed-panel { display: grid; gap: 12px; margin-top: 22px; padding: 17px 19px; border: 1px solid #d8c2a7; border-radius: 12px; background: #faf5ee; }
.client-link-panel strong, .client-completed-panel strong { font-size: 12px; }
.client-link-panel p, .client-completed-panel p { margin: 3px 0 0; color: #77716a; font-size: 10px; }
.copy-line { display: flex; gap: 8px; }
.copy-line input { height: 38px; font-size: 11px; }
.text-danger-button { padding: 0; border: 0; background: transparent; color: #995e54; cursor: pointer; font-size: 10px; }
.client-completed-panel { grid-template-columns: 31px 1fr; align-items: center; border-color: #cae0cf; background: #eff7f1; }
.client-completed-panel > span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: #3c7850; color: #fff; }
.client-data-grid { grid-template-columns: 1fr 1fr; }

.client-page { background: #f4f3f0; color: #22221f; }
.client-topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100vw - 900px) / 2)); border-bottom: 1px solid #e2e1dc; background: rgba(255,255,255,.91); backdrop-filter: blur(14px); }
.client-brand { display: flex; align-items: center; gap: 10px; }
.client-brand strong, .client-brand small { display: block; }
.client-brand strong { font-size: 12px; letter-spacing: .15em; }
.client-brand small { margin-top: 3px; color: #878781; font-size: 8px; letter-spacing: .18em; }
.secure-label { color: #74746e; font-size: 10px; }
.secure-label::before { content: '●'; margin-right: 6px; color: #47815a; font-size: 7px; }
.client-shell { width: min(100% - 32px, 900px); margin: 0 auto; padding: 46px 0 55px; }
.client-hero { margin-bottom: 28px; }
.client-hero > p, .terms-shell > header > p { margin: 0 0 9px; color: #a47c4e; font-size: 9px; font-weight: 750; letter-spacing: .15em; }
.client-hero h1 { max-width: 700px; margin: 0; font-size: 30px; line-height: 1.2; letter-spacing: -.035em; }
.client-hero > span { display: block; margin-top: 10px; color: #777772; font-size: 11px; }
.client-card { margin-top: 13px; padding: 25px 27px; border: 1px solid #e3e2dd; border-radius: 14px; background: #fff; box-shadow: 0 10px 28px rgba(30,30,27,.035); }
.client-card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 21px; }
.client-card-head > span { color: #a47c4e; font-size: 9px; font-weight: 750; }
.client-card-head h2 { margin: 0; font-size: 14px; }
.client-card-head p { margin: 3px 0 0; color: #85857f; font-size: 10px; }
.client-description { margin: 0 0 17px; color: #5f5f5a; font-size: 12px; line-height: 1.65; white-space: pre-line; }
.client-scope { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.client-scope li { display: flex; align-items: flex-start; gap: 9px; color: #4e4e49; font-size: 12px; }
.client-scope li > span { color: #9b754a; font-weight: 700; }
.client-price-row { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; padding-top: 16px; border-top: 1px solid #ecebe7; }
.client-price-row span { color: #6e6e69; font-size: 11px; }
.client-price-row strong { font-size: 18px; }
.client-timeline { display: grid; }
.client-stage { position: relative; display: grid; grid-template-columns: 31px 1fr; gap: 12px; padding-bottom: 20px; }
.client-stage:last-child { padding-bottom: 0; }
.client-stage:not(:last-child)::before { content: ''; position: absolute; top: 29px; bottom: 2px; left: 14px; width: 1px; background: #e6e5e0; }
.client-stage-number { position: relative; z-index: 1; width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid #deddd8; border-radius: 50%; background: #fafaf8; color: #777; font-size: 9px; font-weight: 700; }
.client-stage.key .client-stage-number { border-color: #c9a77d; background: #f3eadf; color: #76532e; }
.client-stage-title { display: flex; align-items: center; gap: 8px; padding-top: 4px; }
.client-stage-title h3 { margin: 0; font-size: 12px; }
.client-stage-title span { padding: 3px 6px; border-radius: 5px; background: #f3eadf; color: #7c5a35; font-size: 7px; font-weight: 750; letter-spacing: .06em; }
.client-stage p { margin: 6px 0 0; color: #777772; font-size: 10px; white-space: pre-line; }
.client-stage small { display: block; margin-top: 6px; color: #9a9a94; font-size: 9px; }
.client-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.client-grid .full-row { grid-column: 1 / -1; }
.acceptance-list { display: grid; gap: 9px; }
.acceptance-item { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 12px 13px; border: 1px solid #e5e4df; border-radius: 9px; background: #fcfcfa; cursor: pointer; }
.acceptance-item input { width: 16px; height: 16px; margin-top: 2px; accent-color: #9c7448; }
.acceptance-item > span { color: #555550; font-size: 10px; line-height: 1.55; }
.acceptance-item a { color: #765735; font-weight: 700; text-decoration: underline; }
.acceptance-item.optional { border-color: #decab1; background: #fbf7f1; }
.discount-label { display: block; margin-top: 7px; color: #77542f; font-size: 10px; }
.client-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 2px 6px; }
.client-submit-row p { margin: 0; color: #85857f; font-size: 10px; }
.client-footer { display: flex; justify-content: space-between; margin-top: 28px; padding: 17px 2px 0; border-top: 1px solid #deddd8; color: #85857f; font-size: 9px; }
.client-footer a { color: #6f5334; }
.client-errors { margin-bottom: 13px; padding: 14px 16px; border: 1px solid #f0cccc; border-radius: 10px; background: #fbefef; color: #a43c3c; font-size: 11px; }
.client-errors ul { margin: 6px 0 0; padding-left: 18px; }
.complete-shell { min-height: calc(100vh - 68px); display: grid; place-items: center; padding-block: 40px; }
.complete-card { width: min(100%, 520px); padding: 44px; border: 1px solid #e3e2dd; border-radius: 16px; background: #fff; text-align: center; box-shadow: 0 12px 35px rgba(25,25,22,.05); }
.complete-check { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 22px; border-radius: 50%; background: #3f7b52; color: #fff; font-size: 18px; }
.complete-check.neutral { background: #a47c4e; }
.complete-card h1 { margin: 0; font-size: 27px; }
.complete-card > p:not(.eyebrow) { margin: 11px 0 24px; color: #6f6f69; font-size: 12px; line-height: 1.65; }
.complete-card > div { padding: 14px; border-radius: 10px; background: #f7f7f4; }
.complete-card > div strong, .complete-card > div small { display: block; }
.complete-card > div small { margin-top: 4px; color: #888882; font-size: 10px; }
.terms-shell { width: min(100% - 32px, 760px); margin: 0 auto; padding: 48px 0 70px; }
.terms-shell > header { margin-bottom: 32px; }
.terms-shell > header h1 { margin: 0; font-size: 29px; letter-spacing: -.03em; }
.terms-shell > header span { display: block; margin-top: 8px; color: #74746f; font-size: 11px; }
.terms-shell section { padding: 21px 0; border-top: 1px solid #deddd8; }
.terms-shell h2 { margin: 0 0 9px; font-size: 13px; }
.terms-shell section p { margin: 0; color: #595954; font-size: 11px; line-height: 1.75; }
.withdrawal-template { margin-top: 17px; padding: 22px !important; border: 1px solid #dbc7ad !important; border-radius: 11px; background: #faf6f0; }
.terms-shell footer { margin-top: 25px; }

@media (max-width: 700px) {
    .header-actions { align-items: stretch; flex-direction: column; }
    .copy-line, .client-submit-row { align-items: stretch; flex-direction: column; }
    .client-topbar { padding-inline: 16px; }
    .secure-label { display: none; }
    .client-shell { width: min(100% - 22px, 900px); padding-top: 30px; }
    .client-card { padding: 21px 17px; }
    .client-hero h1 { font-size: 25px; }
    .client-grid, .client-data-grid { grid-template-columns: 1fr; }
    .client-grid .full-row { grid-column: 1; }
    .client-footer { align-items: flex-start; flex-direction: column; gap: 7px; }
    .complete-card { padding: 35px 22px; }
}

/* Poprawka 2.4.1 */
.delete-button { min-height: 40px; border-color: #ead4d0; background: #fffafa; color: #95594f; }
.delete-button:hover { border-color: #ddbcb6; background: #fbefed; }
.trash-panel { margin-top: 27px; }
.restore-button { border: 0; background: transparent; cursor: pointer; }
.trash-panel form { margin: 0; }

/* Etap 6 — podpis SMS */
.sms-start-card form, .otp-card form { background: transparent; padding: 0; }
.contract-mini { margin-bottom: 17px; }
.sms-error { margin: 15px 0; padding: 11px 13px; border: 1px solid #efc9c5; border-radius: 9px; background: #fff1ef; color: #98483e; font-size: 11px; }
.sms-help, .signature-note { display: block; margin-top: 13px; color: #8b8b85; font-size: 9px; line-height: 1.5; }
.otp-label { display: grid; gap: 7px; margin: 20px 0 13px; text-align: left; }
.otp-label > span { color: #555550; font-size: 10px; font-weight: 650; }
.otp-label input { height: 58px; font-size: 25px; font-weight: 650; letter-spacing: .28em; text-align: center; }
.resend-form { margin-top: 12px !important; }
.text-resend { border: 0; background: transparent; color: #745535; cursor: pointer; font-size: 10px; text-decoration: underline; }
.signed-card dl { display: grid; gap: 1px; margin: 22px 0 0; overflow: hidden; border: 1px solid #e6e5e0; border-radius: 10px; background: #e6e5e0; text-align: left; }
.signed-card dl > div { display: grid; grid-template-columns: 145px 1fr; gap: 12px; padding: 11px 13px; background: #fafaf8; }
.signed-card dt { color: #8a8a84; font-size: 9px; }
.signed-card dd { margin: 0; overflow-wrap: anywhere; font-size: 10px; font-weight: 650; }
.signed-proof-panel { display: grid; grid-template-columns: 34px minmax(180px, 1fr) auto auto; align-items: center; gap: 15px; margin-top: 22px; padding: 17px 19px; border: 1px solid #c8dfce; border-radius: 12px; background: #eff8f1; }
.signed-proof-panel > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #39744c; color: #fff; }
.signed-proof-panel strong { font-size: 12px; }
.signed-proof-panel p { margin: 3px 0 0; color: #66756a; font-size: 9px; }
.signed-proof-meta small, .signed-proof-meta b, .signed-hash small, .signed-hash code { display: block; }
.signed-proof-meta small, .signed-hash small { color: #778078; font-size: 8px; text-transform: uppercase; }
.signed-proof-meta b { margin-top: 3px; font-size: 10px; }
.signed-hash { grid-column: 2 / -1; padding-top: 10px; border-top: 1px solid #d8e9dc; }
.signed-hash code { margin-top: 4px; overflow-wrap: anywhere; color: #4c6252; font-size: 8px; }

@media (max-width: 700px) {
    .signed-card dl > div { grid-template-columns: 1fr; gap: 3px; }
    .signed-proof-panel { grid-template-columns: 34px 1fr; }
    .signed-proof-meta { grid-column: 2; }
    .signed-hash { grid-column: 1 / -1; }
}

/* Etap 7 — PDF i e-mail */
.signed-document-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 10px; }
.signed-document-actions form { margin: 0; }
.signed-document-actions small { color: #627064; font-size: 9px; }
.signed-document-actions .email-error { width: 100%; color: #a34f45; }
.pdf-download-button { display: inline-flex; margin-top: 20px; text-decoration: none; }

/* Etap 8 — realizacja i historia */
.realization-panel { margin: 18px 0; padding: 20px; border: 1px solid #dedbd5; border-radius: 14px; background: #fff; }
.realization-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.realization-head h2 { margin: 3px 0 0; font-size: 17px; }
.realization-head form { margin: 0; }
.realization-date { margin: 12px 0 0; color: #696761; font-size: 10px; }
.key-stage-alert, .cancelled-alert { margin: 13px 0 0; padding: 12px 14px; border-radius: 9px; font-size: 10px; line-height: 1.5; }
.key-stage-alert { border: 1px solid #ddc39f; background: #fbf4e8; color: #76552d; }
.cancelled-alert { border: 1px solid #e2bbb5; background: #fff2f0; color: #8a4037; }
.cancel-details { margin-top: 15px; padding-top: 13px; border-top: 1px solid #ece9e3; }
.cancel-details summary { color: #9a5147; font-size: 10px; cursor: pointer; }
.cancel-work-form { display: grid; gap: 10px; max-width: 520px; margin-top: 12px; }
.cancel-work-form label span { display: block; margin-bottom: 6px; color: #6f6c66; font-size: 9px; }
.cancel-work-form textarea { width: 100%; resize: vertical; }
.timeline-item.completed .timeline-marker { background: #3d7750; color: #fff; }
.timeline-item.completed .timeline-copy { opacity: .78; }
.stage-completed { margin-top: 9px; color: #39714b; font-size: 9px; font-weight: 700; }
.stage-action { margin-top: 10px; }
.stage-waiting { margin-top: 9px; color: #99958e; font-size: 9px; }
.history-card { margin-top: 18px; }
.history-list { display: grid; }
.history-item { position: relative; display: grid; grid-template-columns: 17px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid #efede8; }
.history-item:first-child { border-top: 0; }
.history-dot { width: 8px; height: 8px; margin-top: 4px; border: 2px solid #fff; border-radius: 50%; background: #9a7448; box-shadow: 0 0 0 1px #cfc9c0; }
.history-title { display: flex; justify-content: space-between; gap: 14px; }
.history-title strong { font-size: 10px; }
.history-title time { color: #85817a; font-size: 9px; white-space: nowrap; }
.history-item p, .history-item small { margin: 4px 0 0; color: #817d76; font-size: 9px; }
@media (max-width: 700px) {
    .realization-head, .history-title { align-items: flex-start; flex-direction: column; }
    .history-title { gap: 4px; }
}

/* Etap 9 — powiadomienia e-mail */
.notification-actions { display:flex; align-items:center; flex-wrap:wrap; gap:10px 14px; }
.notification-actions form, .key-email-status form { margin:0; }
.notification-actions small { color:#77736c; font-size:9px; }
.notification-actions .email-error, .key-email-status .email-error { display:block; width:100%; color:#9a5147; }
.key-email-status { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:10px; padding:11px 13px; border:1px solid #e5e1da; border-radius:9px; background:#faf9f7; }
.key-email-status strong, .key-email-status small { display:block; }
.key-email-status strong { margin-bottom:3px; font-size:10px; }
.key-email-status small { color:#77736c; font-size:9px; }
@media (max-width:700px) {
    .key-email-status { align-items:flex-start; flex-direction:column; }
}

/* Poprawka wiadomości e-mail */
.mail-button-wrap { display:flex; flex-direction:column; align-items:flex-end; gap:5px; max-width:245px; }
.mail-button-wrap small, .spam-hint { color:#817d76; font-size:9px; line-height:1.4; }
.signed-document-actions .spam-hint { flex-basis:100%; }
.work-email-row { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:12px; padding:11px 13px; border:1px solid #e5e1da; border-radius:9px; background:#faf9f7; }
.work-email-row p { margin:0; }
.work-email-row small { display:block; margin-top:4px; color:#77736c; font-size:9px; }
.work-email-row form { margin:0; }
@media (max-width:700px) {
    .mail-button-wrap { align-items:stretch; max-width:none; }
    .work-email-row { align-items:flex-start; flex-direction:column; }
}


.first-open-panel{display:flex;align-items:flex-start;gap:12px;margin:0 0 18px;padding:14px 16px;background:#f4faf6;border:1px solid #d8eadf;border-radius:12px;color:#263c2e}
.first-open-panel p{margin:3px 0 0;color:#58685e;font-size:13px}
.first-open-panel small{display:block;margin-top:5px;color:#708077;font-size:12px}
.first-open-panel .first-open-error{color:#a23c32}
.first-open-dot{width:9px;height:9px;margin-top:5px;border-radius:50%;background:#2f9b5d;box-shadow:0 0 0 4px rgba(47,155,93,.12);flex:none}


.style-profile-links {
    display: block;
    margin-top: 10px;
    color: #777;
    font-size: 0.88rem;
    line-height: 1.55;
}
.style-profile-links a {
    color: #353535;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.style-profile-links > span {
    margin: 0 5px;
    color: #aaa;
}

/* Typy umów i edytor umowy ogólnej */
.contract-type-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.contract-type-card {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    border: 1px solid #dedbd5;
    border-radius: 11px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.contract-type-card:hover { border-color: #bcb5aa; }
.contract-type-card.selected {
    border-color: #9a7448;
    background: #fcf9f5;
    box-shadow: 0 0 0 2px rgba(154,116,72,.08);
}
.contract-type-card input {
    width: 16px;
    height: 16px;
    margin: 1px 0 0;
    accent-color: #9a7448;
}
.contract-type-card b, .contract-type-card small { display: block; }
.contract-type-card b { color: #272622; font-size: 12px; }
.contract-type-card small { margin-top: 5px; color: #77736d; font-size: 10px; line-height: 1.5; }
.contract-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    padding: 8px;
    border: 1px solid #dedbd5;
    border-bottom: 0;
    border-radius: 9px 9px 0 0;
    background: #f7f6f3;
}
.contract-editor-toolbar button {
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid #d7d3cd;
    border-radius: 6px;
    background: #fff;
    color: #4e4b46;
    font: inherit;
    font-size: 9px;
    cursor: pointer;
}
.contract-editor-toolbar button:hover { border-color: #a89e92; background: #faf8f5; }
.general-terms-editor {
    min-height: 390px;
    margin-top: -8px;
    border-radius: 0 0 9px 9px !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    line-height: 1.65;
}
.written-contract-content {
    color: #4e4d48;
    font-size: 11px;
    line-height: 1.72;
}
.written-contract-content h3 {
    margin: 22px 0 8px;
    color: #262521;
    font-size: 13px;
}
.written-contract-content h3:first-child { margin-top: 0; }
.written-contract-content p { margin: 0 0 10px; white-space: pre-line; }
.written-contract-content ul, .written-contract-content ol {
    margin: 6px 0 14px;
    padding-left: 22px;
}
.written-contract-content li { margin: 5px 0; }
.written-contract-content strong { color: #24231f; }

@media (max-width: 700px) {
    .contract-type-grid { grid-template-columns: 1fr; }
    .general-terms-editor { min-height: 310px; }
}
