:root {
    --rdza:       #B5651D;
    --rdza-dark:  #95501A;
    --glina:      #5C4332;
    --granat:     #1B3A5C;
    --granat-dark:#142D47;
    --krem:       #FBF7F2;
    --krem-dark:  #F1E6D8;
    --tekst:      #3A2E27;
    --zielen:     #4A7A56;
    --czerwien:   #B3413A;
    --border:     #E3D4C4;
    --radius:     10px;
}

* { box-sizing: border-box; }

html { background: #c8c8c8; }

body {
    margin: 0 auto;
    max-width: calc(100% - 20cm);
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--tekst);
    background: var(--krem);
    line-height: 1.55;
    box-shadow: 0 0 48px rgba(0,0,0,.14);
}

@media (max-width: 900px) {
    body { max-width: 100%; box-shadow: none; }
    html { background: var(--krem); }
}

h1, h2, h3 { color: var(--glina); line-height: 1.25; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }
a { color: var(--rdza); }

/* ── Topbar ─────────────────────────────────────────────────────────── */
.topbar { background: var(--granat); color: var(--krem); }
.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.logo {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--krem);
    text-decoration: none;
    letter-spacing: -0.5px;
}
.logo .dot { color: var(--rdza); }
.nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.nav a { color: var(--krem); text-decoration: none; font-size: 0.95rem; }
.nav a:hover { color: var(--rdza); }
.lang-switch { display: flex; gap: 2px; align-items: center; margin-left: 4px; }
.lang-flag { font-size: 1.15rem; text-decoration: none; opacity: 0.45; transition: opacity .15s; line-height: 1; }
.lang-flag:hover, .lang-flag.active { opacity: 1; }

/* ── Layout ─────────────────────────────────────────────────────────── */
main { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section { padding: 48px 0; }

/* ── Flash ──────────────────────────────────────────────────────────── */
.flash-wrap { padding-top: 16px; }
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    font-size: 0.95rem;
}
.flash-error   { background: #FBE3E1; color: var(--czerwien); }
.flash-success { background: #E5F0E8; color: var(--zielen); }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    background: var(--rdza);
    color: #fff;
    text-decoration: none;
    padding: 10px 22px;
    border-radius: var(--radius);
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.4;
}
.btn:hover { background: var(--rdza-dark); color: #fff; }
.btn-granat { background: var(--granat); }
.btn-granat:hover { background: var(--granat-dark); }
.btn-large  { padding: 14px 30px; font-size: 1.05rem; }
.btn-small  { padding: 6px 14px; font-size: 0.88rem; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--glina);
}
.btn-outline:hover { background: var(--krem-dark); }
.btn-danger { background: var(--czerwien); }
.btn-danger:hover { background: #8f342d; }

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero {
    padding: 56px 0 40px;
    text-align: center;
    background: linear-gradient(135deg, var(--krem) 0%, var(--krem-dark) 100%);
    margin: 0 -24px;
    padding-left: 24px;
    padding-right: 24px;
}
.hero h1 { font-size: 2.4rem; margin-bottom: 12px; }
.hero .lead { font-size: 1.1rem; color: var(--glina); max-width: 560px; margin: 0 auto 28px; }

/* ── Search form ────────────────────────────────────────────────────── */
.search-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 680px;
    margin: 0 auto;
}
.search-form input,
.search-form select {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background: #fff;
    flex: 1;
    min-width: 160px;
}
.search-form .btn { flex: 0 0 auto; }

/* ── Map ────────────────────────────────────────────────────────────── */
.map-wrap {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    margin: 32px 0;
}
#map { height: 420px; }

/* ── Section titles ─────────────────────────────────────────────────── */
.section-title {
    font-size: 1.4rem;
    color: var(--glina);
    margin: 0 0 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--krem-dark);
}
.section-title a { font-size: 0.9rem; font-weight: 400; float: right; margin-top: 4px; }

/* ── Workshop cards ─────────────────────────────────────────────────── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.card:hover { box-shadow: 0 4px 18px rgba(0,0,0,.10); border-color: var(--rdza); }
.card.premium { border-color: var(--rdza); }
.card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--krem-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--border);
}
.card-img img { width: 100%; height: 160px; object-fit: cover; }
.card-body { padding: 14px 16px; flex: 1; }
.card-body h3 { margin: 0 0 4px; font-size: 1.05rem; color: var(--glina); }
.card-city { font-size: 0.88rem; color: #8A7A6E; margin: 0 0 8px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
    font-size: 0.78rem;
    background: var(--krem-dark);
    color: var(--glina);
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

/* ── Badges ─────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    vertical-align: middle;
}
.badge-verified  { background: #E5F0E8; color: var(--zielen); }
.badge-premium   { background: #FDF0DC; color: var(--rdza-dark); }
.badge-warsztat  { background: #E0EAF5; color: var(--granat); }
.badge-kurs      { background: #F0E8F5; color: #6A3580; }
.badge-sprzedaz  { background: #FDF0DC; color: var(--rdza-dark); }

/* ── Ogłoszenie cards (tablica) ─────────────────────────────────────── */
.og-list { display: flex; flex-direction: column; gap: 14px; }
.og-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s;
}
.og-card:hover { box-shadow: 0 3px 14px rgba(0,0,0,.09); border-color: var(--rdza); }
.og-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--krem-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--border);
}
.og-thumb img { width: 80px; height: 80px; border-radius: 8px; object-fit: cover; }
.og-body { flex: 1; min-width: 0; }
.og-body h3 { margin: 0 0 4px; font-size: 1rem; color: var(--glina); }
.og-meta { font-size: 0.85rem; color: #8A7A6E; margin: 0 0 6px; }
.og-body p { margin: 0; font-size: 0.9rem; color: var(--tekst); }

/* ── Filters ────────────────────────────────────────────────────────── */
.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    align-items: flex-end;
}
.filters input,
.filters select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: #fff;
}
.filter-chip {
    padding: 6px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    color: var(--glina);
    text-decoration: none;
    font-size: 0.88rem;
    background: #fff;
}
.filter-chip.active { background: var(--rdza); color: #fff; border-color: var(--rdza); }

/* ── Pracownia profile ──────────────────────────────────────────────── */
.profil-header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 32px 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
}
.profil-photo {
    width: 160px;
    height: 160px;
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--krem-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: var(--border);
    flex-shrink: 0;
}
.profil-photo img { width: 160px; height: 160px; border-radius: var(--radius); object-fit: cover; }
.profil-info { flex: 1; min-width: 200px; }
.profil-info h1 { margin: 0 0 4px; }
.profil-info .city { color: #8A7A6E; margin: 0 0 10px; font-size: 0.95rem; }
.profil-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.profil-details { font-size: 0.92rem; }
.profil-details p { margin: 4px 0; }
.profil-details a { color: var(--rdza); }

/* ── Forms ──────────────────────────────────────────────────────────── */
.form-wrap { max-width: 560px; }
.form-wrap fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
    background: #fff;
}
.form-wrap legend { font-weight: 700; color: var(--glina); padding: 0 6px; }
.form-wrap label { display: block; font-weight: 600; margin: 12px 0 4px; font-size: 0.95rem; }
.form-wrap input[type="text"],
.form-wrap input[type="email"],
.form-wrap input[type="tel"],
.form-wrap input[type="password"],
.form-wrap input[type="date"],
.form-wrap input[type="number"],
.form-wrap input[type="url"],
.form-wrap textarea,
.form-wrap select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--krem);
}
.form-wrap textarea { resize: vertical; min-height: 100px; }
.form-wrap .hint  { color: #8A7A6E; font-size: 0.85rem; margin: 4px 0 0; }
.form-wrap .error { color: var(--czerwien); font-size: 0.85rem; margin: 4px 0 0; }
.form-wrap .row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.form-wide { max-width: 800px; }

/* ── Checkbox/radio cards (zajecia) ─────────────────────────────────── */
.check-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    margin-top: 8px;
}
.check-card {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    background: var(--krem);
    user-select: none;
}
.check-card input { margin: 0; }
.check-card:has(input:checked) {
    border-color: var(--rdza);
    background: #FDF7F0;
}

/* ── Panel layout ───────────────────────────────────────────────────── */
.panel-wrap {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 28px;
    padding: 32px 0;
}
.panel-sidebar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 0;
    align-self: start;
}
.panel-sidebar .sidebar-name {
    padding: 0 18px 14px;
    font-weight: 700;
    color: var(--glina);
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    word-break: break-word;
}
.sidebar-nav { list-style: none; padding: 10px 0 0; margin: 0; }
.sidebar-nav a {
    display: block;
    padding: 9px 18px;
    color: var(--tekst);
    text-decoration: none;
    font-size: 0.93rem;
}
.sidebar-nav a:hover { background: var(--krem); color: var(--rdza); }
.sidebar-nav a.active { color: var(--rdza); font-weight: 600; background: var(--krem-dark); }
.sidebar-nav .sidebar-logout {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.panel-content { min-width: 0; }
.panel-content h2 { margin-top: 0; }

/* ── Admin ──────────────────────────────────────────────────────────── */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
}
.stat-card .stat-num { font-size: 2rem; font-weight: 700; color: var(--rdza); line-height: 1; }
.stat-card .stat-label { font-size: 0.82rem; color: #8A7A6E; margin-top: 4px; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 0.92rem;
}
.admin-table th, .admin-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.admin-table th { background: var(--krem-dark); font-size: 0.85rem; }
.admin-table tbody tr:hover { background: var(--krem); cursor: pointer; }
.admin-table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }

/* Details grid */
.details { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; margin: 8px 0 20px; }
.details dt { font-weight: 600; color: var(--glina); font-size: 0.9rem; }
.details dd { margin: 0; font-size: 0.92rem; }

/* ── Footer ─────────────────────────────────────────────────────────── */
.footer { background: var(--granat); color: rgba(255,255,255,0.75); margin-top: 48px; }
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
    font-size: 0.88rem;
    text-align: center;
}
.footer a { color: var(--rdza); }

/* ── Giełda — product grid ──────────────────────────────────────────── */
.produkt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}
.produkt-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.produkt-card:hover  { box-shadow: 0 4px 18px rgba(0,0,0,.10); border-color: var(--rdza); }
.produkt-card.premium { border-color: var(--rdza); }
.produkt-img {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--krem-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--border);
}
.produkt-img img { width: 100%; height: 200px; object-fit: cover; }
.produkt-body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.produkt-body h3 { margin: 0; font-size: 1rem; color: var(--glina); }
.produkt-pracownia { font-size: .82rem; color: #8A7A6E; margin: 0; }
.produkt-technika  { font-size: .82rem; color: var(--rdza); margin: 0; }
.produkt-footer    { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; }
.produkt-cena      { font-size: 1.05rem; color: var(--glina); }
.produkt-dostawa   { font-size: 1rem; }
.produkt-cena-duza { font-size: 1.8rem; font-weight: 700; color: var(--rdza); margin: 8px 0; }

/* ── Giełda — product detail ────────────────────────────────────────── */
.produkt-szczegoly-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    margin-top: 8px;
}
.galeria-glowne { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.galeria-glowne img { width: 100%; max-height: 440px; object-fit: cover; display: block; }
.galeria-placeholder {
    height: 300px;
    background: var(--krem-dark);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: var(--border);
}
.galeria-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.galeria-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: border-color .15s;
}
.galeria-thumb:hover, .galeria-thumb.active { border-color: var(--rdza); }

@media (max-width: 760px) {
    .produkt-szczegoly-wrap { grid-template-columns: 1fr; }
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    h1 { font-size: 1.7rem; }
    .panel-wrap { grid-template-columns: 1fr; }
    .panel-sidebar { order: -1; }
    .profil-header { flex-direction: column; }
    .profil-photo { width: 100%; height: 200px; }
    .profil-photo img { width: 100%; }
    .form-wrap .row { grid-template-columns: 1fr; }
    #map { height: 280px; }
}
