/* System Zapotrzebowań Zakupowych — style bazowe */

:root {
    --primary: #0f5c4b;
    --primary-dark: #0a3f33;
    --accent: #1d7a63;
    --grey-bg: #f5f6f7;
    --border: #dfe3e6;
    --text: #1f2a2e;
    --red: #b4232a;
    --orange: #b5691a;
    --green: #1c7c3f;
    --blue: #1a5fb4;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--grey-bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.impersonation-banner {
    background: #7a4a05;
    color: #fff;
    font-size: 0.85rem;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    text-align: center;
}
.impersonation-banner a {
    color: #fff;
    text-decoration: underline;
    font-weight: 600;
    white-space: nowrap;
}

.topbar {
    background: var(--primary-dark);
    color: #fff;
    box-shadow: 0 1px 0 rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08);
}
.topbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
    min-height: 64px;
}
.brand {
    color: #fff;
    font-weight: 700;
    font-size: 0.86rem;
    line-height: 1.15;
    letter-spacing: .01em;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 8px;
    margin-right: 4px;
    border-right: 1px solid rgba(255,255,255,0.14);
}
.brand-logo { height: 32px; width: auto; display: block; flex-shrink: 0; }
.brand-text { opacity: 0.92; }
.login-logo { display: block; height: 60px; margin: 0 auto 16px; }

.nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
    align-items: center;
}
.nav a {
    color: #cfe9e0;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 20px;
    transition: background-color .12s ease, color .12s ease;
}
.nav a:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,0.08); }
.nav a.active { color: #fff; background: rgba(255,255,255,0.16); }

.user-box {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #d9efe8;
    padding-left: 12px;
    border-left: 1px solid rgba(255,255,255,0.14);
}
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-name { color: #fff; font-weight: 600; font-size: 0.84rem; }
.user-role { color: #a9d3c6; font-size: 0.74rem; }
.logout-link {
    color: #fff;
    border: 1px solid rgba(255,255,255,0.35);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    white-space: nowrap;
}
.logout-link:hover { background: rgba(255,255,255,0.1); text-decoration: none; }

@media (max-width: 860px) {
    .topbar-inner { padding: 10px 16px; }
    .brand { border-right: none; padding-right: 0; width: 100%; }
    .user-box { border-left: none; padding-left: 0; margin-left: auto; }
}

.container { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }

.site-footer { color: #7a8489; font-size: 0.8rem; padding: 20px 0 40px; text-align: center; }

h1 { font-size: 1.5rem; margin: 0 0 20px; }
h2 { font-size: 1.15rem; margin: 24px 0 12px; }

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 0.92rem; }
.flash-success { background: #e4f5e8; color: var(--green); border: 1px solid #bfe6c9; }
.flash-error { background: #fbe7e6; color: var(--red); border: 1px solid #f3c4c1; }
.flash-info { background: #e6f0fb; color: var(--blue); border: 1px solid #c4d9f3; }

form .field { margin-bottom: 16px; }
label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 5px; }
label .hint { font-weight: 400; color: #6b7580; }
input[type=text], input[type=number], input[type=email], input[type=password],
input[type=date], input[type=file], textarea, select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
.field-error { color: var(--red); font-size: 0.85rem; margin-top: 4px; }

.btn {
    display: inline-block;
    padding: 9px 16px;
    border-radius: 5px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-size: 0.92rem;
    font-family: inherit;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: #f0f1f2; }
.btn-danger { background: var(--red); border-color: var(--red); }
.btn-danger:hover { background: #8f1c22; }
.btn-warning { background: var(--orange); border-color: var(--orange); }
.btn-sm { padding: 5px 10px; font-size: 0.82rem; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.9rem; }
th { background: #fafbfc; font-weight: 600; }
tr:hover td { background: #fafcfb; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 0.78rem; font-weight: 600; }
.badge-grey { background: #e9ecee; color: #55606a; }
.badge-blue { background: #e1edfb; color: var(--blue); }
.badge-orange { background: #fbedd9; color: var(--orange); }
.badge-red { background: #fbe1e0; color: var(--red); }
.badge-green { background: #dff3e4; color: var(--green); }

.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; align-items: flex-end; }
.filters .field { margin-bottom: 0; min-width: 160px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}
.stat-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stat-box-wide { grid-column: span 2; }
.stat-label { font-size: 0.8rem; font-weight: 600; color: #6b7580; text-transform: uppercase; letter-spacing: 0.02em; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--primary); line-height: 1.2; }
.stat-value-red { color: var(--red); }
.stat-sub { font-size: 0.82rem; color: #6b7580; }
@media (max-width: 900px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .stat-box-wide { grid-column: span 2; }
}
@media (max-width: 560px) {
    .stat-grid { grid-template-columns: 1fr; }
    .stat-box-wide { grid-column: span 1; }
}

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0 10px 16px; border-left: 2px solid var(--border); position: relative; margin-left: 6px; }
.timeline li::before {
    content: ""; position: absolute; left: -7px; top: 14px; width: 10px; height: 10px;
    border-radius: 50%; background: var(--accent);
}
.timeline .ts { color: #8a929a; font-size: 0.8rem; }

.steps-path { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 20px; }
.step-chip { border: 1px solid var(--border); border-radius: 20px; padding: 6px 14px; font-size: 0.85rem; background: #fff; }
.step-chip.done { background: #dff3e4; border-color: #bfe6c9; }
.step-chip.current { background: #e1edfb; border-color: #c4d9f3; font-weight: 700; }
.step-chip.rejected { background: #fbe1e0; border-color: #f3c4c1; }
.step-chip.returned { background: #fbedd9; border-color: #f0d6ac; }

.muted { color: #6b7580; }
.text-right { text-align: right; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.login-wrap { max-width: 380px; margin: 60px auto; }
