/* OFERTY-APP — design 1:1 wg PRODUKCJA-APP (hardpower.pl: Clash Display, czerwień #d70000, żółty CTA #FCC300)
   Tło JASNE, czerń marki tylko w górnym pasku. Przemalowanie 13.08.2026 na polecenie BB. */

@font-face { font-family: 'Clash Display'; src: url('../fonts/ClashDisplay-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Clash Display'; src: url('../fonts/ClashDisplay-500.woff2') format('woff2'); font-weight: 500 700; font-display: swap; }

:root {
  --bg: #f7f7f7;
  --card: #ffffff;
  --text: #1f1f1f;
  --muted: #666666;
  --brand-black: #1f1f1f;
  --accent: #d70000;
  --accent-dark: #b10303;
  --accent-soft: #fff0f0;
  --yellow: #FCC300;
  --yellow-dark: #e0ad00;
  --ok: #15803d; --warn: #d97706; --red: #dc2626;
  --border: #e3e3e3;
  --radius: 10px;
  --font-display: 'Clash Display', 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; margin: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; }
main, .container { max-width: 1280px; margin: 0 auto; padding: 20px 16px 60px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, .brand, .btn, .status { font-family: var(--font-display); }
h2 { font-size: 18px; font-weight: 500; margin-bottom: 10px; }
.muted { color: var(--muted); }

/* topbar — czerń marki HP */
.topbar { background: var(--brand-black); color: #eee; display: flex; align-items: center; gap: 24px; padding: 0 20px; height: 54px; position: sticky; top: 0; z-index: 10; border-bottom: 3px solid var(--accent); }
.brand { font-weight: 500; font-size: 17px; letter-spacing: .5px; color: #fff; font-family: var(--font-display); }
.brand span { color: var(--accent); font-weight: 500; }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-links a, .nav-links button { padding: 6px 14px; border-radius: 6px; color: #c8c8c8; font-family: var(--font-display); font-size: 15px; background: none; border: 0; cursor: pointer; }
.nav-links a:hover, .nav-links a.active, .nav-links button:hover, .nav-links button.active { background: #383838; color: #fff; }
.tab-badge { display: inline-block; background: var(--accent); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; margin-left: 4px; font-family: 'Segoe UI', sans-serif; }

/* zalogowany użytkownik (17.08.2026 — osobne loginy zamiast wspólnego basic auth) */
.user-box { display: flex; align-items: center; gap: 12px; margin-left: auto; white-space: nowrap; }
.user-name { font-family: var(--font-display); font-size: 14px; color: #fff; background: #383838; padding: 5px 12px; border-radius: 20px; }
.user-logout { font-size: 13px; color: #c8c8c8; padding: 5px 10px; border-radius: 6px; }
.user-logout:hover { background: #383838; color: #fff; }

/* cards & forms */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card h2 { font-size: 16px; font-weight: 500; margin-bottom: 12px; }
input, select, textarea, .form-control { width: 100%; padding: 8px 10px; border: 1px solid #c8c8c8; border-radius: 6px; font: inherit; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
label { font-size: 13px; color: #434343; }
.form-group { margin-bottom: 10px; flex: 1; }
.form-group label { display: block; margin-bottom: 4px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.button-group { display: flex; gap: 10px; margin-top: 8px; }

.btn { display: inline-block; padding: 8px 18px; border: 1px solid #c8c8c8; border-radius: 6px; background: #fff; font: inherit; font-family: var(--font-display); cursor: pointer; color: var(--text); width: auto; }
.btn:hover { background: #f0f0f0; }
.btn-primary, .btn-success { background: var(--yellow); border-color: var(--yellow); color: #1f1f1f; font-weight: 600; }
.btn-primary:hover, .btn-success:hover { background: var(--yellow-dark); border-color: var(--yellow-dark); }
.btn-secondary { background: #fff; }
.btn-danger { border-color: var(--red); color: var(--red); background: #fff; }
.btn-danger:hover { background: var(--accent-soft); }
.btn-large { padding: 12px 28px; font-size: 16px; }
.btn-sm { padding: 4px 12px; font-size: 13px; }

/* generator — układ */
.main-layout { display: flex; gap: 16px; align-items: flex-start; }
.main-content { flex: 1; min-width: 0; }

.client-preview { margin-top: 12px; background: #fafafa; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-size: 14px; }
.client-preview h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 6px; font-family: var(--font-display); font-weight: 500; }

.language-selector { display: flex; gap: 16px; }
.lang-option { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.lang-option input[type=radio] { width: auto; accent-color: var(--accent); }
.lang-badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: #f0f0f0; color: var(--text); font-family: var(--font-display); }
.lang-pl { background: var(--accent-soft); color: var(--accent); }
.lang-en { background: #eff6ff; color: #1d4ed8; }
.lang-de { background: #fff8e1; color: #a16207; }

.item-row { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; background: #fafafa; }
.item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.item-number { font-family: var(--font-display); font-weight: 500; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }

.success-card { border-left: 5px solid var(--ok); background: #f8fdf9; }

/* panel historii ofert */
.history-panel { width: 340px; background: var(--card); border: 1px solid var(--border); padding: 16px; border-radius: var(--radius); position: sticky; top: 74px; max-height: calc(100vh - 94px); overflow-y: auto; }
.history-panel h2 { font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin-bottom: 12px; }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item { background: #fafafa; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); border-left: 4px solid var(--accent); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.history-item:hover { background: #fdf6f6; }
.history-content { flex: 1; min-width: 0; cursor: pointer; }
.offer-number { font-family: var(--font-display); font-weight: 500; font-size: 14px; }
.client-name { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offer-date { font-size: 12px; color: var(--muted); }
.delete-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; padding: 0 4px; width: auto; }
.delete-btn:hover { color: var(--accent); }
.loading { color: var(--muted); }

/* ==================== ZAPYTANIA ==================== */

/* pasek follow-up — jak alert-card w PRODUKCJI */
.alert-card { display: block; background: var(--accent-soft); border: 1px solid #ff9494; border-left: 5px solid var(--accent); border-radius: 8px; padding: 12px 16px; margin-bottom: 14px; cursor: pointer; }
.alert-card:hover { background: #ffdddd; }
.alert-card b { color: var(--accent); font-family: var(--font-display); }

/* chipy filtrów z licznikami — 1:1 PRODUKCJA */
.inq-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.inq-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid #c8c8c8; border-radius: 20px; background: #fff; font-family: var(--font-display); font-size: 13px; font-weight: 500; letter-spacing: .3px; cursor: pointer; color: var(--text); width: auto; }
.chip b { background: #f0f0f0; border-radius: 10px; padding: 0 7px; font-size: 12px; }
.chip:hover { border-color: var(--brand-black); background: #fff; }
.chip.active { background: var(--brand-black); color: #fff; border-color: var(--brand-black); }
.chip.active b { background: #383838; color: #fff; }

/* karty zapytań */
.inq-card { background: var(--card); border: 1px solid var(--border); border-left: 5px solid #c8c8c8; border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.inq-card.st-PRZESLANE { border-left-color: #4338ca; }
.inq-card.st-MATERIAL  { border-left-color: var(--yellow-dark); }
.inq-card.st-KLIENT    { border-left-color: #b45309; }
.inq-card.st-WYCENA    { border-left-color: #1d4ed8; }
.inq-card.st-WYSLANE   { border-left-color: var(--ok); }
.inq-card.st-ARCHIWUM  { border-left-color: #c8c8c8; opacity: .72; }

.inq-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; flex-wrap: wrap; }
.inq-head:hover { background: #fdf6f6; }
.inq-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.inq-client { font-family: var(--font-display); font-weight: 500; font-size: 15px; }
.inq-subject { font-size: 13px; color: var(--muted); }
.inq-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* licznik dni od zapytania */
.inq-days { background: var(--brand-black); color: #fff; border-radius: 6px; padding: 3px 10px; font-size: 13px; font-weight: 600; white-space: nowrap; font-family: var(--font-display); }

/* statusy — pastelowe pigułki jak w PRODUKCJI */
.inq-status-badge { display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: 12px; font-weight: 500; white-space: nowrap; letter-spacing: .3px; font-family: var(--font-display); }
.inq-status-badge.st-PRZESLANE { background: #eef2ff; color: #4338ca; }
.inq-status-badge.st-MATERIAL  { background: #fff8e1; color: #a16207; }
.inq-status-badge.st-KLIENT    { background: #fef3e2; color: #b45309; }
.inq-status-badge.st-WYCENA    { background: #eff6ff; color: #1d4ed8; }
.inq-status-badge.st-WYSLANE   { background: #ecfdf3; color: var(--ok); }
.inq-status-badge.st-ARCHIWUM  { background: #f0f0f0; color: var(--muted); }

.inq-badge.followup { background: var(--accent-soft); color: var(--accent); border: 1px solid #fecaca; border-radius: 6px; padding: 3px 10px; font-size: 12px; font-weight: 700; font-family: var(--font-display); }
.inq-flag { font-size: 15px; }

.inq-details { padding: 0 14px 14px; border-top: 1px solid var(--border); background: #fafafa; }
.inq-info { padding: 10px 0; font-size: 13.5px; color: #434343; display: flex; flex-direction: column; gap: 4px; }
.inq-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-bottom: 10px; }
.inq-status-select { max-width: 280px; font-size: 13px; width: auto; }

.inq-history { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13px; color: #434343; max-height: 160px; overflow-y: auto; }
.inq-h-row { padding: 5px 0; border-bottom: 1px solid var(--border); }
.inq-h-row:last-child { border-bottom: none; }
.inq-h-row .h-t { color: var(--muted); font-size: 12px; }
.inq-h-row .h-kto { font-weight: 600; color: var(--accent); }

/* telefon */
@media (max-width: 900px) {
  .topbar { height: auto; flex-wrap: wrap; gap: 10px; padding: 8px 12px; }
  .nav-links { flex-wrap: wrap; }
  .main-layout { flex-direction: column; }
  .history-panel { width: 100%; position: static; max-height: none; }
  .inq-head { align-items: flex-start; }
}

/* U-1: wykonany follow-up — duży, widoczny znacznik na główce karty */
.inq-badge.followup-done { background: #ecfdf3; color: var(--ok); border: 1px solid #bbf7d0; border-radius: 6px; padding: 3px 10px; font-size: 12px; font-weight: 700; font-family: var(--font-display); }
/* U-3: odmowa wyceny */
.inq-badge.odmowa { background: #f0f0f0; color: #434343; border: 1px solid #c8c8c8; border-radius: 6px; padding: 3px 10px; font-size: 12px; font-weight: 600; font-family: var(--font-display); }
.inq-status-badge.st-ODMOWA { background: #f0f0f0; color: #434343; }
.inq-card.st-ODMOWA { border-left-color: #909090; opacity: .85; }
/* U-4: draft */
.inq-badge.draft { background: #fff8e1; color: #a16207; border: 1px solid #fcd34d; border-radius: 6px; padding: 3px 10px; font-size: 12px; font-weight: 700; font-family: var(--font-display); }

.draft-box { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; }
.draft-h { font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 4px; font-family: var(--font-display); }
.draft-row { display: flex; gap: 8px; margin-bottom: 6px; align-items: center; }
.draft-row .d-name { flex: 3; }
.draft-row .d-qty { flex: 0 0 90px; }
.draft-row .d-price { flex: 0 0 120px; }
.draft-akcje { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.draft-podglad { background: #fffdf5; border: 1px solid #fcd34d; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; font-size: 13px; }
.draft-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.draft-table td { padding: 3px 6px; border-bottom: 1px solid #f0e6c8; }
.draft-table td.r { text-align: right; white-space: nowrap; }
.draft-suma { text-align: right; margin-top: 6px; font-family: var(--font-display); }

/* U-5: zestawienie ofert */
.zest-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.zest-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 10px 12px; border-bottom: 2px solid var(--brand-black); background: #fafafa; font-family: var(--font-display); font-weight: 500; }
.zest-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; font-size: 13.5px; }
.zest-table tbody tr:hover { background: #fdf6f6; }
.zest-table .r { text-align: right; }
.zest-table .nowrap { white-space: nowrap; }
.zest-pozycje { max-width: 520px; }
.zest-poz { display: flex; gap: 10px; align-items: baseline; padding: 1px 0; }
.zest-nazwa { flex: 1; min-width: 0; }
.zest-ilosc { color: var(--muted); white-space: nowrap; }
.zest-cena { color: var(--muted); white-space: nowrap; min-width: 92px; text-align: right; }

/* U-6: zwijana lista pozycji w zestawieniu (oferty z wieloma pozycjami) */
.zest-det > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 8px; padding: 2px 0; }
.zest-det > summary::-webkit-details-marker { display: none; }
.zest-det > summary::before { content: '▸'; color: var(--accent); font-size: 12px; transition: transform .15s; }
.zest-det[open] > summary::before { content: '▾'; }
.zest-det > summary:hover .zest-pierwsza { color: var(--text); }
.zest-ile { font-family: var(--font-display); font-weight: 500; background: #f0f0f0; border-radius: 10px; padding: 1px 9px; font-size: 12px; white-space: nowrap; }
.zest-pierwsza { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zest-det[open] > summary { margin-bottom: 4px; border-bottom: 1px dashed var(--border); }

/* Odmowy — osobny rejestr */
.odm-powod { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; font-family: var(--font-display); white-space: nowrap; }
.odm-za_male { background: #eff6ff; color: #1d4ed8; }
.odm-za_duze { background: #fff8e1; color: #a16207; }
.odm-inne    { background: #f0f0f0; color: #434343; }

/* U-8: follow-up bez kopert — znaczniki większe i wyraźniejsze */
.inq-badge.followup-done { font-size: 13px; padding: 4px 12px; letter-spacing: .3px; }
.inq-badge.followup { font-size: 13px; padding: 4px 12px; letter-spacing: .3px; }
/* U-9: data przesłania zapytania obok licznika dni */
.inq-data { background: #fff; border: 1px solid var(--border); color: #434343; border-radius: 6px; padding: 3px 9px; font-size: 12.5px; white-space: nowrap; font-family: var(--font-display); }

/* Potwierdzenie otrzymania — pigułka tekstowa zamiast koperty (BB: żadnych kopert) */
.inq-badge.potw { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; border-radius: 6px; padding: 3px 10px; font-size: 12px; font-weight: 600; font-family: var(--font-display); white-space: nowrap; }
