/* Panel Ofert — paleta aplikacji: niebieski #2e6da4, złoto #f09010, zieleń #2f8a4c */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
       background: #f4f7fa; color: #1d2b38; line-height: 1.5; font-size: 15px; }
h1 { font-size: 24px; color: #1d2b38; margin-bottom: 14px; }
h2 { font-size: 16px; color: #2e6da4; margin-bottom: 10px; }
a { color: #2e6da4; }
[hidden] { display: none !important; }

/* nagłówek */
.topbar { background: #2e6da4; color: #fff; }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 10px 20px;
                display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand img { height: 36px; background: #fff; border-radius: 6px; padding: 3px 6px; }
.topbar nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.navlink { background: none; border: 0; color: inherit; font: inherit; cursor: pointer;
           padding: 7px 10px; border-radius: 6px; opacity: .92; }
.topbar .navlink:hover, .topbar .navlink.active { background: rgba(255,255,255,.16); opacity: 1; }
.user { font-size: 13px; opacity: .85; margin-left: 8px; }
.goldline { height: 4px; background: #f09010; }

.container { max-width: 1180px; margin: 0 auto; padding: 24px 20px 80px; }
main section { display: none; }
main section.active { display: block; }

/* przyciski */
.btn { display: inline-block; border: 1px solid #b9cede; background: #fff; color: #2e6da4;
       font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 8px; cursor: pointer; }
.btn:hover { background: #eef4f9; }
.btn-blue { background: #2e6da4; border-color: #2e6da4; color: #fff; }
.btn-blue:hover { background: #275d8d; }
.btn-green { background: #2f8a4c; border-color: #2f8a4c; color: #fff; }
.btn-green:hover { background: #277a41; }
.btn-small { padding: 4px 9px; font-size: 13px; border-radius: 6px; }
.btn-danger { color: #a03030; border-color: #d8b0b0; }

/* logowanie */
.login-box { max-width: 380px; margin: 10vh auto; background: #fff; border-radius: 12px;
             padding: 34px; box-shadow: 0 2px 10px rgba(20,40,60,.1); text-align: center; }
.login-box img { height: 60px; margin-bottom: 8px; }
.login-box h1 { color: #2e6da4; margin-bottom: 20px; }
.login-box form { text-align: left; }
.login-box .btn { width: 100%; margin-top: 12px; padding: 11px; }

/* formularze */
label { display: block; margin: 10px 0 2px; font-size: 13px; font-weight: 600; color: #44586b; }
input, select, textarea { width: 100%; font: inherit; padding: 9px 11px; margin-top: 3px;
  border: 1px solid #c3d2de; border-radius: 8px; background: #fff; color: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid #2e6da4; outline-offset: 0; border-color: #2e6da4; }
input[type="search"] { max-width: 340px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { color: #a03030; font-size: 14px; margin: 8px 0; min-height: 18px; }
.hint { font-size: 12.5px; color: #5a7186; margin: 6px 0 10px; }

/* układ */
.panel { background: #fff; border-radius: 12px; padding: 20px 22px;
         box-shadow: 0 1px 4px rgba(20,40,60,.08); margin-bottom: 20px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px;
               flex-wrap: wrap; margin-bottom: 12px; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.editor-grid { display: grid; grid-template-columns: 420px 1fr; gap: 20px; align-items: start; }
.editor-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* chipy statusów */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { border: 1px solid #b9cede; background: #fff; color: #2e6da4; font: inherit; font-size: 13.5px;
        font-weight: 600; padding: 6px 13px; border-radius: 999px; cursor: pointer; }
.chip.active { background: #2e6da4; border-color: #2e6da4; color: #fff; }
.chip .n { opacity: .7; font-weight: 400; margin-left: 4px; }

/* wiersze ofert */
.offer-rows { display: flex; flex-direction: column; gap: 10px; }
.offer-row { background: #fff; border-radius: 10px; padding: 13px 16px;
             box-shadow: 0 1px 3px rgba(20,40,60,.07); display: flex; align-items: center;
             gap: 14px; flex-wrap: wrap; }
.offer-row .grow { flex: 1; min-width: 220px; }
.offer-row .t { font-weight: 700; }
.offer-row .s { font-size: 13px; color: #5a7186; }
.offer-row .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
         padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge.draft { background: #e8edf2; color: #5a7186; }
.badge.review { background: #fdeeda; color: #b26a08; }
.badge.published { background: #e2f2e8; color: #2f8a4c; }
.badge.sent { background: #e6eef5; color: #2e6da4; }
.badge.archived { background: #f0f0f0; color: #888; }
.badge.anatol { background: #f3e8fb; color: #7a3aa8; }

/* kafelki wykonawców */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.tile { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(20,40,60,.08);
        display: flex; flex-direction: column; }
.tile img { width: 100%; aspect-ratio: 4/3; object-fit: cover; object-position: top center;
            display: block; background: #dde7ef; }
.tile .body { padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.tile .name { font-weight: 700; font-size: 14px; line-height: 1.25; }
.tile .price { font-size: 12.5px; color: #2e6da4; font-weight: 600; }
.tile .btn { margin-top: auto; }

/* karta wykonawcy w edytorze oferty */
.oa-card { border: 1px solid #dbe5ee; border-radius: 10px; padding: 13px 15px; margin-bottom: 12px; background: #fbfdff; }
.oa-card.hidden-row { opacity: .55; }
.oa-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.oa-head img { width: 52px; height: 52px; object-fit: cover; object-position: top center;
               border-radius: 8px; background: #dde7ef; }
.oa-head .name { font-weight: 700; flex: 1; min-width: 140px; }
.oa-head .mini { display: flex; gap: 4px; }
.oa-fields { margin-top: 10px; display: grid; grid-template-columns: 130px 110px 1fr; gap: 10px; align-items: start; }
.oa-fields textarea { min-height: 58px; }
.oa-foot { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.oa-foot .spacer { flex: 1; }

/* modale */
.modal-back { position: fixed; inset: 0; background: rgba(20,35,50,.5); z-index: 50;
              display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; }
.modal { background: #fff; border-radius: 14px; padding: 22px 24px; width: 100%; max-width: 860px;
         max-height: 88vh; overflow-y: auto; box-shadow: 0 8px 40px rgba(0,0,0,.25); }
.picker-filters { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.picker-filters select { max-width: 240px; }

/* toast */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
         background: #1d2b38; color: #fff; padding: 11px 20px; border-radius: 10px;
         font-size: 14px; z-index: 100; box-shadow: 0 4px 16px rgba(0,0,0,.3); }

@media (max-width: 900px) {
  .dash-cols, .editor-grid, .two-col { grid-template-columns: 1fr; }
  .oa-fields { grid-template-columns: 1fr 1fr; }
  .oa-fields .oa-desc { grid-column: 1 / -1; }
}
