
:root{font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#202124;background:#f5f6f8}
*{box-sizing:border-box}body{margin:0}header{background:#172b4d;color:#fff;padding:14px 24px;display:flex;justify-content:space-between;align-items:center}header a{color:#fff;text-decoration:none;margin-left:20px}.brand{font-weight:700}
.container{max-width:1200px;margin:28px auto;padding:0 20px}h1{margin:0 0 20px}h2{margin:28px 0 12px}.section-title{font-size:18px;padding-bottom:8px;border-bottom:1px solid #dce1e8}
.topline{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}.button,button{border:0;border-radius:8px;padding:10px 14px;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;min-height:40px;box-sizing:border-box;vertical-align:middle;cursor:pointer;background:#e4e8ef;color:#172b4d;font:inherit;font-size:14px;line-height:1.2}.primary{background:#b71c1c;color:#fff}.danger{background:#e7e9ed;color:#8b0000}.small{min-height:40px;padding:8px 12px;font-size:14px;line-height:1.2}.big{min-height:44px;padding:12px 20px;font-size:15px}.actions{display:flex;gap:8px;align-items:center}
.cards{display:flex;gap:16px;margin-bottom:28px}.card{background:#fff;border-radius:12px;padding:22px;min-width:180px;box-shadow:0 1px 4px #0001}.card strong{font-size:28px;display:block}.card span,.muted,small{color:#667085}
table{width:100%;border-collapse:collapse;background:#fff;border-radius:10px;overflow:hidden}th,td{padding:12px;border-bottom:1px solid #e7e9ee;text-align:left;vertical-align:top}th{background:#f0f2f5;font-size:13px}
input,select,textarea{width:100%;padding:10px;border:1px solid #cfd4dc;border-radius:7px;background:#fff;margin-top:5px;font:inherit}label{font-size:14px;font-weight:600}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:24px}.span2{grid-column:span 2}.block{display:block;margin:20px 0}.rightcell{text-align:right}
.login-card{max-width:420px;margin:10vh auto;background:#fff;padding:28px;border-radius:14px;box-shadow:0 4px 20px #0002}.login-card label{display:block;margin:14px 0}.login-card button{width:100%;margin-top:12px}
.flash{padding:12px 14px;border-radius:8px;margin-bottom:16px;background:#eef2f7}.flash.success{background:#e9f7ef}.flash.danger{background:#fdecec}.flash.warning{background:#fff3cd}.badge{background:#eef2f7;border-radius:999px;padding:5px 9px;font-size:13px}
.detail-grid{display:grid;grid-template-columns:2fr 1fr;gap:16px;background:#fff;padding:18px;border-radius:10px;margin-bottom:20px}.table-wrap{overflow-x:auto}#items textarea{min-width:330px;resize:vertical}#items input{min-width:90px}.row-gross{white-space:nowrap;font-weight:600}
.totals-card{margin:18px 0 0 auto;max-width:440px;background:#fff;border-radius:10px;padding:12px 18px}.totals-card div,.summary-grid div{display:flex;justify-content:space-between;gap:20px;padding:7px 0;border-bottom:1px solid #edf0f4}.totals-card .grand,.summary-grid .grand{font-size:17px;border-bottom:0;border-top:2px solid #cfd4dc;margin-top:5px}
.summary-grid{margin:18px 0 18px auto;max-width:440px;background:#fff;border-radius:10px;padding:12px 18px}.meta-card{background:#fff;border-radius:10px;padding:18px;display:grid;grid-template-columns:1fr 1fr;gap:12px}.notes{background:#fff;padding:18px;border-radius:10px}
@media(max-width:800px){.form-grid,.detail-grid,.meta-card{grid-template-columns:1fr}.span2{grid-column:auto}header{display:block}nav{margin-top:10px}nav a{margin:0 14px 0 0}.topline{align-items:flex-start;flex-direction:column}}

.card-wide{background:#fff;border-radius:12px;padding:20px;margin-bottom:18px}.inline-form{display:flex;gap:10px;align-items:end}.inline-form input{margin:0;flex:1}.badge.ok{background:#e9f7ef;color:#206a3b}.responsible-layout{max-width:900px}

.login-shell{min-height:calc(100vh - 56px);display:flex;align-items:center;justify-content:center;padding:30px}
.login-card{width:100%;max-width:430px;margin:0;background:#fff;padding:34px 34px 30px;border-radius:16px;box-shadow:0 10px 30px #00000018;text-align:center}
.login-logo{width:96px;height:96px;object-fit:contain;display:block;margin:0 auto 14px}
.login-card h1{text-align:center;margin:0;font-size:30px;line-height:1.12;color:#202124}
.login-subtitle{text-align:center;color:#667085;margin:8px 0 24px;font-size:14px}
.login-card form{text-align:left}
.login-card label{display:block;margin:14px 0}
.login-card button{width:100%;margin-top:12px}
.user-form{max-width:760px}

.login-card h1 span{display:block;font-size:.78em;font-weight:700;margin-top:2px}

.vendor-field{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:end}
.vendor-field label{min-width:0}
.vendor-add{display:flex;align-items:center;gap:6px;height:42px;padding:0 12px;border-radius:8px;background:#eaf2f8;color:#183b66;text-decoration:none;font-weight:700;white-space:nowrap;border:1px solid #c9dcea}
.vendor-add:hover{background:#dcebf6}
.vendor-add-plus{font-size:20px;line-height:1;font-weight:800}

.order-desc{max-width:340px}.order-desc div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.order-desc .muted{font-size:12px;display:block;margin-top:3px}

/* Kolory statusów zamówień */
.badge.status-robocze{background:#e9eef5;color:#344054}
.badge.status-zatwierdzone{background:#e8f1ff;color:#175cd3}
.badge.status-wysłane,.badge.status-wyslane{background:#fff3d6;color:#9a6700}
.badge.status-zrealizowane{background:#dcfce7;color:#166534}
.badge.status-anulowane{background:#fee2e2;color:#b42318}

.module-home{max-width:980px;margin:50px auto}.module-heading{text-align:center;margin-bottom:28px}.module-logo{display:block;width:96px;height:96px;object-fit:contain;margin:0 auto 16px}.module-heading h1{font-size:34px;margin-bottom:6px}.module-heading p{color:#667085}.module-grid{display:grid;grid-template-columns:1fr 1fr;gap:22px}.module-card{display:grid;grid-template-columns:58px 1fr 32px;gap:18px;align-items:center;background:#fff;border:1px solid #e4e7ec;border-radius:16px;padding:28px;text-decoration:none;color:#20242a;box-shadow:0 5px 18px rgba(16,24,40,.06)}.module-card:hover{border-color:#9bbbd8}.module-card h2{margin:0 0 6px}.module-card p{margin:0;color:#667085}.module-icon{font-size:28px}.module-arrow{font-size:28px;color:#8ba8c3}.procurement-form small{display:block;color:#667085;margin-top:5px}.case-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:22px 0 30px}.case-summary>div,.case-text{background:#fff;border:1px solid #e4e7ec;border-radius:10px;padding:16px}.case-summary b,.case-summary span{display:block}.case-summary span{margin-top:6px}.workflow{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:15px 0 28px}.workflow-step{display:flex;gap:12px;align-items:center;border:1px solid #dfe5ec;border-radius:10px;background:#fff;padding:15px}.workflow-step small{display:block;color:#667085}.workflow-step.active{border-color:#87afd2;background:#f2f8fd}.workflow-step.future{opacity:.7}.step-no{display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;background:#19365f;color:#fff;font-weight:700}.case-text{white-space:pre-wrap}@media(max-width:800px){.module-grid,.case-summary,.workflow{grid-template-columns:1fr}}

.procurement-long-form{display:flex;flex-direction:column;gap:16px}
.form-section,.fixed-section{background:#fff;border:1px solid #e4e7ec;border-radius:10px;padding:18px}
.form-section h2{margin-top:0}
.fixed-section h3{margin:0 0 12px;color:#5B9BD5;font-size:17px}
.fixed-section textarea{width:100%;box-sizing:border-box}
.workflow-link{text-decoration:none;color:inherit}
.workflow-link:hover{border-color:#5B9BD5;box-shadow:0 3px 10px rgba(16,24,40,.08)}
.workflow-actions{margin:-10px 0 28px}

.workflow-card{display:flex;flex-direction:column;align-items:stretch;justify-content:space-between;gap:12px}
.workflow-main{display:flex;gap:12px;align-items:center}
.workflow-card-actions{display:flex;gap:8px;padding-top:10px;border-top:1px solid #dfe5ec}
.workflow-card-actions a{display:inline-flex;align-items:center;justify-content:center;padding:6px 12px;border-radius:7px;background:#eef2f6;color:#25364d;text-decoration:none;font-size:13px;font-weight:600}
.workflow-card-actions a:last-child{background:#19365f;color:#fff}
.workflow-card-actions a:hover{opacity:.88}

.form-info-box{background:#eef5fb;border:1px solid #bfd3e5;border-radius:10px;padding:16px 18px;margin:16px 0 18px;line-height:1.45}
.form-info-box b{display:inline;margin-bottom:0}

.table-wrap{background:#fff;border:1px solid #e4e7ec;border-radius:10px;overflow:hidden;margin:16px 0}
.data-table{width:100%;border-collapse:collapse}
.data-table th,.data-table td{padding:13px 15px;border-bottom:1px solid #e8ebef;text-align:left;vertical-align:middle}
.data-table th{background:#f6f8fa;font-size:13px}
.data-table td small{display:block;color:#667085;margin-top:3px}
.data-table tr:last-child td{border-bottom:0}
.row-actions{text-align:right!important}
.row-actions a{font-weight:600;text-decoration:none}
.empty-state{background:#fff;border:1px solid #e4e7ec;border-radius:10px;padding:32px;text-align:center;margin:16px 0}
.button.danger{background:#b42318;color:#fff;border-color:#b42318}

.add-offer-button{
  min-width:150px;
  padding:11px 18px;
  white-space:nowrap;
}


/* ===== Mobile / responsive improvements ===== */
@media (max-width: 900px) {
  body {
    overflow-x: hidden;
  }

  .container,
  .content,
  main,
  .page,
  .page-content {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  header,
  .topbar,
  .navbar,
  nav {
    max-width: 100%;
  }

  .nav-inner,
  .topbar-inner,
  .header-inner {
    flex-wrap: wrap;
    gap: 10px;
  }

  nav ul,
  .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    width: 100%;
  }

  nav a,
  .nav-links a {
    white-space: normal;
  }

  .topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .topline > * {
    max-width: 100%;
  }

  h1 {
    overflow-wrap: anywhere;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
  }

  .form-grid .span2,
  .span2 {
    grid-column: 1 !important;
  }

  .stats,
  .dashboard-grid,
  .cards,
  .module-grid,
  .workflow-grid {
    grid-template-columns: 1fr !important;
  }

  .workflow-step,
  .workflow-card,
  .module-card,
  .stat-card {
    min-width: 0;
  }

  .workflow-card-actions,
  .actions,
  .row-actions {
    flex-wrap: wrap;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  table {
    max-width: none;
  }

  input,
  select,
  textarea,
  button {
    max-width: 100%;
    box-sizing: border-box;
  }

  .button,
  button,
  .primary {
    min-height: 44px;
  }

  .procurement-long-form,
  .form-section,
  .form-info-box {
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .container,
  .content,
  main,
  .page,
  .page-content {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  header,
  .topbar,
  .navbar {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .brand,
  .brand-title,
  .site-title {
    font-size: 1.35rem !important;
    line-height: 1.2;
  }

  nav,
  .nav-links {
    font-size: 1rem;
    line-height: 1.25;
  }

  nav a,
  .nav-links a {
    padding: 4px 0;
  }

  h1 {
    font-size: 2rem !important;
    line-height: 1.05 !important;
  }

  h2 {
    font-size: 1.4rem !important;
  }

  .muted,
  .subtitle,
  .case-subject {
    font-size: 1rem !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere;
  }

  .module-card,
  .workflow-step,
  .workflow-card,
  .form-section,
  .form-info-box,
  .stat-card {
    border-radius: 16px;
  }

  .data-table {
    min-width: 720px;
  }

  .workflow-main {
    align-items: flex-start;
  }
}


/* ===== v1.3.1 Full-screen mobile navigation ===== */
.mobile-menu-toggle {
  display: none;
}

.header-top {
  display: contents;
}

@media (max-width: 900px) {
  header {
    position: relative;
    z-index: 1000;
  }

  .header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
  }

  .mobile-menu-toggle {
    display: flex;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    padding: 11px;
    border: 0;
    border-radius: 12px;
    background: rgba(255,255,255,.12);
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    position: relative;
    z-index: 1002;
  }

  .mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    border-radius: 3px;
    background: #fff;
    transition: transform .2s ease, opacity .2s ease;
  }

  header nav#main-nav {
    display: none;
  }

  body.mobile-menu-open {
    overflow: hidden;
  }

  body.mobile-menu-open header nav#main-nav {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 1001;
    width: 100vw;
    height: 100dvh;
    box-sizing: border-box;
    padding: max(100px, calc(env(safe-area-inset-top) + 84px)) 28px max(30px, env(safe-area-inset-bottom));
    background: #1d3155;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    overflow-y: auto;
  }

  body.mobile-menu-open header nav#main-nav a {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 16px 4px;
    border-bottom: 1px solid rgba(255,255,255,.15);
    font-size: 1.25rem;
    line-height: 1.2;
    white-space: normal;
  }

  body.mobile-menu-open .mobile-menu-toggle {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    right: 18px;
  }

  body.mobile-menu-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }

  body.mobile-menu-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  body.mobile-menu-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }
}


/* ===== v1.3.2 Mobile order list cards ===== */
@media (max-width: 700px) {
  .brand {
    font-size: 1.05rem !important;
    line-height: 1.15;
    white-space: nowrap;
  }

  .topline {
    margin-bottom: 18px;
  }

  .topline h1 {
    margin-bottom: 4px;
  }

  .topline .button.primary {
    width: auto;
    max-width: 100%;
    text-align: center;
    font-size: 1rem;
  }

  table.mobile-cards {
    display: block;
    background: transparent;
    border-radius: 0;
    overflow: visible;
  }

  table.mobile-cards tbody,
  table.mobile-cards tr,
  table.mobile-cards td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  table.mobile-cards > tbody > tr:first-child,
  table.mobile-cards > tr:first-child {
    display: none;
  }

  table.mobile-cards tr {
    background: #fff;
    border: 1px solid #e3e7ed;
    border-radius: 16px;
    margin-bottom: 14px;
    padding: 10px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
  }

  table.mobile-cards td {
    border-bottom: 1px solid #eef1f4;
    padding: 10px 0;
    min-height: 40px;
    overflow-wrap: anywhere;
  }

  table.mobile-cards td:last-child {
    border-bottom: 0;
  }

  table.mobile-cards td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: #667085;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
  }

  table.mobile-cards td[data-label="Numer"] a {
    font-size: 1.12rem;
    font-weight: 700;
  }

  table.mobile-cards .order-desc {
    line-height: 1.35;
  }

  table.mobile-cards .rightcell {
    text-align: left;
  }

  table.mobile-cards .rightcell .button {
    width: 100%;
    text-align: center;
    margin-top: 2px;
  }
}


/* ===== v1.3.3 Offer form action alignment ===== */
.offer-form-actions {
  display: inline-flex;
  vertical-align: top;
}

.offer-delete-form {
  display: inline-block;
  margin-left: 8px;
  vertical-align: top;
}

.offer-delete-form .danger {
  min-height: 44px;
}

@media (max-width: 700px) {
  .offer-form-actions,
  .offer-delete-form {
    display: flex;
    width: 100%;
    margin-left: 0;
  }

  .offer-form-actions {
    flex-wrap: wrap;
  }

  .offer-delete-form {
    margin-top: 8px;
  }

  .offer-delete-form .danger {
    width: 100%;
  }
}


/* ===== v1.3.4 Offer action buttons in one row ===== */
.offer-form-actions {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 8px;
}

.offer-form-actions .button,
.offer-form-actions button {
  width: auto !important;
  margin: 0 !important;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .offer-form-actions {
    overflow-x: auto;
    padding-bottom: 2px;
  }
}


/* ===== v1.3.5 Equal offer action buttons ===== */
.offer-form-actions .button,
.offer-form-actions button {
  min-height: 44px;
  padding: 10px 16px !important;
  font-size: 15px !important;
  line-height: 1.2 !important;
  border-radius: 8px !important;
  box-sizing: border-box;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}


/* ===== v1.3.6 Desktop orders table readability ===== */
@media (min-width: 901px) {
  .container {
    max-width: 1480px;
  }

  .orders-table {
    table-layout: auto;
  }

  .orders-table th,
  .orders-table td {
    vertical-align: top;
  }

  .orders-table .col-number {
    width: 17%;
    min-width: 180px;
    white-space: nowrap;
  }

  .orders-table .col-date {
    width: 10%;
    min-width: 105px;
    white-space: nowrap;
  }

  .orders-table .col-vendor {
    width: 20%;
    min-width: 190px;
  }

  .orders-table .col-desc {
    width: 28%;
    min-width: 260px;
  }

  .orders-table .col-status {
    width: 11%;
    min-width: 120px;
    white-space: nowrap;
  }

  .orders-table .col-gross {
    width: 10%;
    min-width: 120px;
    white-space: nowrap;
    text-align: right;
  }

  .orders-table .col-actions {
    width: 7%;
    min-width: 85px;
    white-space: nowrap;
    text-align: right;
  }

  .orders-table .order-desc > div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
}


/* ===== v1.3.7 eMKa.net author credit ===== */
.login-credit {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: #98a2b3;
  letter-spacing: .01em;
}

.login-credit a,
.app-footer a {
  color: #667085;
  text-decoration: none;
  font-weight: 600;
}

.login-credit a:hover,
.app-footer a:hover {
  text-decoration: underline;
}

.app-footer {
  max-width: 1480px;
  margin: 28px auto 18px;
  padding: 0 20px;
  text-align: center;
  font-size: 12px;
  color: #98a2b3;
  letter-spacing: .01em;
}

@media (max-width: 700px) {
  .app-footer {
    margin-top: 22px;
    margin-bottom: calc(14px + env(safe-area-inset-bottom));
  }
}


/* ===== v1.4.0 first-run setup ===== */
.setup-shell {
  max-width: 980px;
  margin: 34px auto;
}
.setup-card {
  background: #fff;
  border: 1px solid #e6e9ef;
  border-radius: 22px;
  padding: 34px;
  box-shadow: 0 18px 55px rgba(16, 24, 40, .08);
}
.setup-brand {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.setup-brand img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}
.setup-brand h1 {
  margin: 2px 0 5px;
}
.setup-brand p {
  margin: 0;
  color: #667085;
}
.setup-eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  font-weight: 700;
  color: #667085;
}
.setup-progress {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 0 0 30px;
}
.setup-step-dot {
  border: 0;
  background: transparent;
  color: #98a2b3;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  text-align: center;
}
.setup-step-dot span {
  display: flex;
  width: 31px;
  height: 31px;
  margin: 0 auto 6px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  border: 1px solid #d0d5dd;
  background: #fff;
  font-weight: 700;
}
.setup-step-dot.active {
  color: #101828;
  font-weight: 700;
}
.setup-step-dot.active span {
  background: #183b66;
  border-color: #183b66;
  color: #fff;
}
.setup-step-dot.done span {
  background: #eef4fb;
  border-color: #8fb2d8;
  color: #183b66;
}
.setup-step {
  display: none;
  min-height: 365px;
}
.setup-step.active {
  display: block;
}
.setup-step h2 {
  margin-top: 0;
}
.setup-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.setup-section-head h2,
.setup-section-head p {
  margin-top: 0;
}
.setup-repeat-list {
  display: grid;
  gap: 12px;
}
.setup-repeat-row {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  background: #f9fafb;
}
.setup-repeat-row.approver-row {
  grid-template-columns: .9fr 1.25fr 44px;
}
.setup-repeat-row label {
  margin: 0;
}
.icon-delete {
  width: 44px;
  height: 44px;
  border: 1px solid #f1b8b5;
  border-radius: 10px;
  background: #fff5f4;
  color: #b42318;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.setup-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 22px;
  margin-top: 14px;
  border-top: 1px solid #eaecf0;
}
.setup-actions-right {
  margin-left: auto;
}
.setup-summary {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 28px;
  border: 1px solid #d7e3f0;
  background: #f8fbff;
  border-radius: 18px;
}
.setup-summary img {
  width: 84px;
  height: 84px;
  object-fit: contain;
}
.setup-summary h3 {
  margin: 0 0 8px;
  font-size: 24px;
}
.settings-hint {
  margin-top: 18px;
}
.settings-hint p {
  margin-bottom: 0;
}

@media (max-width: 700px) {
  .setup-shell {
    margin: 12px auto;
  }
  .setup-card {
    padding: 20px 16px;
    border-radius: 16px;
  }
  .setup-brand {
    align-items: flex-start;
  }
  .setup-brand img {
    width: 58px;
    height: 58px;
  }
  .setup-progress {
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
  }
  .setup-step-dot {
    font-size: 0;
  }
  .setup-step-dot span {
    font-size: 12px;
  }
  .setup-step {
    min-height: 0;
  }
  .setup-section-head {
    display: block;
  }
  .setup-section-head .secondary {
    width: 100%;
    margin-top: 8px;
  }
  .setup-repeat-row,
  .setup-repeat-row.approver-row {
    grid-template-columns: 1fr 44px;
  }
  .setup-repeat-row.approver-row label {
    grid-column: 1 / -1;
  }
  .setup-repeat-row.approver-row .icon-delete {
    grid-column: 2;
  }
  .setup-summary {
    display: block;
    text-align: center;
  }
  .setup-summary img {
    margin-bottom: 14px;
  }
}

/* ===== v1.5.0 workflow polish ===== */
.price-nowrap{white-space:nowrap;min-width:105px}
.offer-row-actions{white-space:nowrap}.offer-row-actions a+a{margin-left:12px}
.responsible-add-form{display:grid;grid-template-columns:1.35fr 1fr .8fr auto;gap:12px;align-items:end}
.responsible-add-form label{margin:0}.responsible-actions{white-space:nowrap}.responsible-actions form{display:inline-block;margin-left:6px}
.setup-repeat-row.responsible-contact-row{grid-template-columns:1.35fr 1fr .8fr 44px}
.setup-repeat-row.approver-row{grid-template-columns:1.05fr 1.1fr 44px}
.offer-preview-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:16px 0 20px}
.offer-preview-grid .card{display:flex;flex-direction:column;gap:7px}.offer-preview-grid .card span{font-size:1.05rem}
.case-finalization{display:flex;justify-content:space-between;align-items:center;gap:22px;margin:28px 0 20px;padding:20px 22px;border:1px solid #bfd3e5;background:#f7fbff;border-radius:12px}
.case-finalization h3,.case-finalization p{margin-top:0}.case-finalization p{margin-bottom:0}
.case-finalization-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:10px}.case-finalization-actions form{margin:0}
.completion-badge{display:inline-flex;align-items:center;min-height:38px;padding:8px 13px;border-radius:9px;background:#e9f7ef;color:#166534;font-weight:700;white-space:nowrap}
.completion-badge.contract{background:#eef4ff;color:#254b86}
@media(max-width:900px){.responsible-add-form{grid-template-columns:1fr}.setup-repeat-row.responsible-contact-row{grid-template-columns:1fr 44px}.setup-repeat-row.responsible-contact-row label{grid-column:1/-1}.setup-repeat-row.responsible-contact-row .icon-delete{grid-column:2}.offer-preview-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.case-finalization{align-items:stretch;flex-direction:column}.case-finalization-actions{justify-content:flex-start}}
@media(max-width:600px){.offer-preview-grid{grid-template-columns:1fr}.case-finalization-actions,.case-finalization-actions form,.case-finalization-actions button{width:100%}.completion-badge{width:100%;box-sizing:border-box;justify-content:center}}

.app-version {
  color: #98a2b3;
  font-weight: 500;
}


/* ===== v1.5.6 Mobile UX + admin order delete ===== */
.order-delete-form {
  display: inline-block;
  margin: 0;
}

@media (max-width: 900px) {
  /* Tables that are marked as mobile-cards become real cards, not horizontally-scrolled desktop tables. */
  .table-wrap.mobile-table-wrap {
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
  }

  table.mobile-cards,
  table.mobile-data-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
    background: transparent !important;
    border: 0 !important;
    overflow: visible !important;
  }

  table.mobile-cards tbody,
  table.mobile-cards tr,
  table.mobile-cards td,
  table.mobile-data-table tbody,
  table.mobile-data-table tr,
  table.mobile-data-table td {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  table.mobile-cards > tbody > tr:first-child,
  table.mobile-cards > tr:first-child,
  table.mobile-data-table > tbody > tr:first-child,
  table.mobile-data-table > tr:first-child {
    display: none !important;
  }

  table.mobile-cards tr:not(.mobile-empty-row),
  table.mobile-data-table tr:not(.mobile-empty-row) {
    margin: 0 0 14px !important;
    padding: 8px 14px !important;
    border: 1px solid #e3e7ed !important;
    border-radius: 16px !important;
    background: #fff !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    overflow: hidden;
  }

  table.mobile-cards td,
  table.mobile-data-table td {
    padding: 10px 0 !important;
    border: 0 !important;
    border-bottom: 1px solid #eef1f4 !important;
    text-align: left !important;
    white-space: normal !important;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  table.mobile-cards td:last-child,
  table.mobile-data-table td:last-child {
    border-bottom: 0 !important;
  }

  table.mobile-cards td::before,
  table.mobile-data-table td::before {
    content: attr(data-label);
    display: block !important;
    margin: 0 0 4px !important;
    color: #667085 !important;
    font-size: .75rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-transform: uppercase;
    letter-spacing: .03em;
  }

  table.mobile-cards td[data-label="Numer"] a,
  table.mobile-cards td[data-label="Numer sprawy"] a,
  table.mobile-data-table td[data-label="Numer"] a,
  table.mobile-data-table td[data-label="Numer sprawy"] a {
    font-size: 1.08rem;
    font-weight: 700;
  }

  table.mobile-cards .order-desc,
  table.mobile-data-table .order-desc {
    max-width: none !important;
  }

  table.mobile-cards .order-desc div,
  table.mobile-data-table .order-desc div {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  table.mobile-cards .price-nowrap,
  table.mobile-data-table .price-nowrap {
    white-space: nowrap !important;
  }

  table.mobile-cards .rightcell,
  table.mobile-cards .row-actions,
  table.mobile-data-table .rightcell,
  table.mobile-data-table .row-actions {
    text-align: left !important;
  }

  table.mobile-cards .rightcell .button,
  table.mobile-cards .row-actions .button,
  table.mobile-data-table .rightcell .button,
  table.mobile-data-table .row-actions .button {
    display: inline-flex !important;
    width: auto !important;
    min-width: 110px;
    justify-content: center;
    margin: 2px 6px 2px 0 !important;
  }

  table.mobile-cards td a,
  table.mobile-data-table td a,
  table.mobile-cards td span,
  table.mobile-data-table td span {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .mobile-block {
    display: block !important;
    margin-top: 4px;
  }

  .mobile-empty-row {
    display: block !important;
    background: #fff !important;
    border: 1px solid #e3e7ed !important;
    border-radius: 16px !important;
    padding: 16px !important;
  }
  .mobile-empty-row td {
    display: block !important;
    border: 0 !important;
    padding: 0 !important;
  }
  .mobile-empty-row td::before {
    display: none !important;
  }

  .responsible-actions {
    white-space: normal !important;
  }
  .responsible-actions form {
    display: inline-block !important;
    margin: 2px 0 !important;
  }

  .order-view-actions {
    width: 100%;
  }
  .order-view-actions > a,
  .order-view-actions > form,
  .order-view-actions > form > button {
    box-sizing: border-box;
  }
}

.order-view-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .order-view-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 600px) {
  .topline .button.primary {
    width: auto !important;
    max-width: 100%;
  }

  .order-view-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .order-view-actions > a,
  .order-view-actions > form,
  .order-view-actions > form > button {
    width: 100% !important;
    margin: 0 !important;
    justify-content: center;
    text-align: center;
  }
  .order-view-actions .order-delete-form {
    grid-column: 1 / -1;
  }

  .responsible-layout {
    max-width: 100%;
  }
}


/* ===== v1.5.7 mobile polish ===== */
@media (max-width: 900px) {
  /* Compact actions in Users / Responsible people / Approvers. */
  table.mobile-cards td[data-label="Akcje"] .button,
  table.mobile-data-table td[data-label="Akcje"] .button,
  table.mobile-cards td[data-label="Akcje"] button,
  table.mobile-data-table td[data-label="Akcje"] button,
  .responsible-actions .button,
  .responsible-actions button {
    width: auto !important;
    min-width: 0 !important;
    min-height: 40px !important;
    height: 40px !important;
    padding: 0 16px !important;
    font-size: .9rem !important;
    line-height: 1 !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle;
  }

  table.mobile-cards td[data-label="Akcje"] form,
  table.mobile-data-table td[data-label="Akcje"] form,
  .responsible-actions form {
    display: inline-block !important;
    width: auto !important;
    margin: 2px 6px 2px 0 !important;
  }

  /* Received offers: force every offer into a full-width card. */
  .received-offers-table {
    width: 100% !important;
    min-width: 0 !important;
  }
  .received-offers-table tr:not(.mobile-empty-row) {
    width: 100% !important;
  }
  .received-offers-table td {
    width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
  }
  .received-offers-table td.price-nowrap {
    white-space: nowrap !important;
  }
}


/* ===== v1.5.8 independent mobile offer cards ===== */
.mobile-only {
  display: none;
}

@media (max-width: 900px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }

  .mobile-offer-list {
    display: grid !important;
    gap: 14px;
    width: 100%;
    min-width: 0;
    margin: 14px 0 18px;
  }

  .mobile-data-card {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #e3e7ed;
    border-radius: 16px;
    padding: 8px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    overflow: hidden;
  }

  .mobile-card-row {
    display: grid;
    grid-template-columns: minmax(110px, 38%) minmax(0, 1fr);
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid #eef1f4;
    align-items: start;
    min-width: 0;
  }

  .mobile-card-row > div {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .mobile-card-label {
    color: #667085;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    line-height: 1.25;
  }

  .mobile-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0 8px;
  }

  .mobile-card-actions .button {
    width: auto !important;
    min-width: 0 !important;
    min-height: 40px !important;
    height: 40px !important;
    padding: 0 16px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: .9rem !important;
  }

  .mobile-data-card .price-nowrap {
    white-space: nowrap !important;
  }
}

@media (max-width: 430px) {
  .mobile-card-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}


/* ===== v1.5.12 procurement threshold ===== */
.threshold-warning {
  padding: 12px 14px;
  border: 1px solid #f1a7a7;
  background: #fff0f0;
  color: #b42318;
  border-radius: 9px;
  font-weight: 700;
  line-height: 1.4;
}
.threshold-exceeded {
  border-color: #d92d20 !important;
  background: #fff5f5 !important;
  box-shadow: 0 0 0 2px rgba(217,45,32,.08);
}
.estimate-net-info {
  display: block;
  margin-top: 5px;
}
button:disabled {
  opacity: .55;
  cursor: not-allowed;
}


/* ===== v1.5.13 vendor list readability ===== */
.vendor-subline {
  display: block;
  margin-top: 3px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.settings-section{margin-top:28px;padding-top:24px;border-top:1px solid #d9dee7}
.settings-section h2{margin:0 0 6px}

.document-config{margin-top:24px;padding-top:20px;border-top:1px solid #e2e6ec}
.document-config h3{margin:0 0 6px}
.document-config label{display:block;margin-top:16px}
.document-config textarea{width:100%;box-sizing:border-box;resize:vertical}

.permission-box{padding:16px;border:1px solid #dfe4ea;border-radius:12px;background:#fff}
.permission-box h3{margin:0 0 10px}
.check-row{display:flex!important;align-items:center;gap:10px;margin:8px 0!important}
.check-row input{width:auto!important;margin:0!important}
.audit-summary{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:14px 0 18px;padding:12px 14px;background:#fff;border:1px solid #e0e5eb;border-radius:12px}
.audit-list{margin-top:18px;background:#fff;border:1px solid #e0e5eb;border-radius:14px;padding:8px 18px}
.audit-entry{display:flex;gap:14px;padding:14px 0;border-bottom:1px solid #edf0f3}
.audit-entry:last-child{border-bottom:0}
.audit-dot{width:10px;height:10px;border-radius:50%;background:#5B9BD5;margin-top:6px;flex:0 0 auto}
.audit-entry-body{min-width:0}
@media(max-width:700px){.audit-summary{align-items:flex-start;flex-direction:column}.audit-summary .button{width:100%;text-align:center;box-sizing:border-box}}

.audit-details{margin:4px 0 5px;line-height:1.45;color:#333;overflow-wrap:anywhere}

.topline-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
@media(max-width:700px){.topline-actions{width:100%;justify-content:flex-start}.topline-actions .button{flex:1 1 auto;text-align:center}}

.online-summary{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 16px;padding:12px 14px;background:#fff;border:1px solid #e0e5eb;border-radius:12px}
.online-indicator,.presence-online{display:inline-flex;align-items:center;gap:8px}
.online-filter-controls{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
.online-filter-link{color:inherit;text-decoration:underline;text-underline-offset:3px;padding:6px 8px;border:1px solid transparent;border-radius:8px}
.online-filter-link:hover,.online-filter-link.selected{background:#e2f8eb;border-color:#39a96b;color:#225c3c}
.online-filter-link:focus-visible{outline:3px solid #19365f;outline-offset:2px}
.online-filter-label{color:#225c3c;font-weight:600;font-size:.9rem}
.online-dot{display:inline-block;width:9px;height:9px;border-radius:50%;background:#39a96b;box-shadow:0 0 0 3px rgba(57,169,107,.12)}
.presence-online{font-weight:600;color:#28784d}
@media(max-width:700px){.online-summary{align-items:flex-start;flex-direction:column}}

.order-items-table{width:100%;table-layout:fixed}
.order-items-table .order-col-index{width:46px}
.order-items-table .order-col-description{width:auto}
.order-items-table .order-col-quantity{width:62px}
.order-items-table .order-col-unit{width:64px}
.order-items-table .order-col-net{width:118px}
.order-items-table .order-col-vat{width:64px}
.order-items-table .order-col-gross{width:128px}
.order-items-table th,.order-items-table td{overflow-wrap:normal;word-break:normal}
.order-items-table td:nth-child(2){overflow-wrap:anywhere}
.order-items-table .order-quantity-cell,.order-items-table .order-unit-cell,.order-items-table .order-vat-cell{white-space:nowrap}
.order-items-table .order-money-cell{white-space:nowrap;text-align:right;font-variant-numeric:tabular-nums}
.order-items-table th:nth-child(5),.order-items-table th:nth-child(7){text-align:right}
.mobile-order-items{margin:14px 0}
.order-item-card{margin-bottom:12px}
.order-item-card-title{display:flex;align-items:flex-start;gap:10px;padding-bottom:10px;margin-bottom:8px;border-bottom:1px solid #edf0f3}
.item-number{display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:26px;border-radius:999px;background:#eef3f8;font-weight:700}
.mobile-card-total{padding-top:10px;margin-top:6px;border-top:1px solid #edf0f3}
@media(max-width:700px){
  main.container{padding-bottom:calc(110px + env(safe-area-inset-bottom))}
  .app-footer{padding-bottom:calc(18px + env(safe-area-inset-bottom))}
  .meta-card{margin-bottom:18px}
}

@media(max-width:700px){
  #items thead{display:none}
  #items,#items tbody,#items tr,#items td{display:block;width:100%;box-sizing:border-box}
  #items{border:0;background:transparent}
  #items tbody{display:flex;flex-direction:column;gap:14px}
  #items .item-row{background:#fff;border:1px solid #e0e5eb;border-radius:12px;padding:14px;overflow:hidden}
  #items .item-row td{border:0;border-bottom:1px solid #edf0f3;padding:9px 0}
  #items .item-row td:last-child{border-bottom:0;padding-bottom:0}
  #items .item-row td::before{content:attr(data-label);display:block;margin-bottom:5px;font-size:11px;line-height:1.2;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:#657080}
  #items .item-row textarea,#items .item-row input{width:100%;max-width:none;box-sizing:border-box}
  #items .item-row textarea{min-height:72px;resize:vertical}
  #items .row-gross{font-size:17px;font-weight:700}
  #items .item-actions{text-align:right}
  #items .item-actions::before{display:none}
  #items .item-actions .danger{width:auto}
  .table-wrap{overflow:visible}
}


/* ===== v1.8.2 systemowe kafelki zamówień ===== */
.orders-system-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:10px 0 22px}
.order-system-card{min-width:0;border:1.5px solid #87afd2;border-radius:12px;background:#f8fbfe;overflow:hidden;box-shadow:none;transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}
.order-system-card.status-robocze{background:#f7f9fc}
.order-system-card.status-do-zatwierdzenia{background:#f2f8fd}
.order-system-card.status-zatwierdzone{background:#f0f6ff}
.order-system-card.status-wysłane,.order-system-card.status-wyslane{background:#fffaf0}
.order-system-card.status-zrealizowane{background:#f2fbf5}
.order-system-card.status-anulowane{background:#fff5f5}
.order-system-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:17px 18px 13px;border-bottom:1px solid rgba(25,54,95,.13)}
.order-system-number{color:#19365f;font-size:20px;line-height:1.15;font-weight:800;text-decoration:none;overflow-wrap:anywhere}
.order-system-number:hover{text-decoration:underline}
.order-system-body{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:13px 22px;padding:16px 18px 18px}
.order-system-field{min-width:0}
.order-system-field.span2{grid-column:1/-1}
.order-system-field>span{display:block;margin-bottom:4px;color:#667085;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.045em}
.order-system-field strong{display:block;font-size:14px;line-height:1.35;overflow-wrap:anywhere}
.order-system-field small{display:block;margin-top:4px}
.order-system-actions{display:flex;align-items:center;gap:8px;padding:12px 18px 14px;border-top:1px solid rgba(25,54,95,.13)}
.order-system-actions form{display:inline;margin:0}
.order-system-actions .button{font-weight:700}
.order-system-actions .order-pdf-button{background:#19365f;color:#fff}
.orders-system-grid .order-system-actions{flex-wrap:wrap}
.order-warehouse-actions{margin-inline-start:auto;display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.pagination{display:flex;justify-content:center;align-items:center;gap:12px;margin:24px 0 8px}
.pagination-pages{display:flex;align-items:center;gap:5px}
.pagination-pages a,.pagination-current{display:inline-flex;min-width:34px;height:34px;align-items:center;justify-content:center;border-radius:8px;text-decoration:none;color:#19365f;font-weight:700}
.pagination-pages a:hover{background:#eaf2f8}.pagination-current{background:#19365f;color:#fff}.pagination-gap{padding:0 4px;color:#667085}

/* ===== v1.8.2 rozeznanie rynku ===== */
.market-research-section{margin:24px 0;background:#fff;border:1px solid #d9e4ef;border-radius:12px;padding:18px}
.market-research-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px}
.market-research-heading h2{margin:0 0 5px;color:#19365f;font-size:20px}
.market-research-state{display:inline-flex;align-items:center;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:800}
.market-research-state.warning{background:#fff3d6;color:#8a5b00}.market-research-state.complete{background:#dcfce7;color:#166534}
.market-save-hint{display:block;margin:0 0 16px;line-height:1.4}
.market-add-offer{background:#19365f;color:#fff;font-weight:700}
.market-offer-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.market-offer-card{position:relative;min-width:0;border:1px solid #dfe5ec;border-radius:10px;background:#fbfcfd;padding:13px}
.market-offer-card.selected{border-color:#87afd2;background:#f2f8fd}
.market-offer-main{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.market-offer-main strong,.market-offer-main span{display:block;overflow-wrap:anywhere}.market-offer-main span{margin-top:4px;color:#667085;font-size:12px}
.market-offer-price{white-space:nowrap;font-weight:800;color:#19365f}
.market-offer-selected{display:inline-block;margin-top:8px;padding:4px 7px;border-radius:999px;background:#19365f;color:#fff;font-size:11px;font-weight:800}
.market-offer-notes{margin-top:9px;font-size:13px;line-height:1.4;color:#475467;white-space:pre-wrap}
.market-offer-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px;padding-top:10px;border-top:1px solid #e4e9ef}
.market-offer-actions form{display:inline;margin:0}
.market-offer-empty{padding:16px;border:1px dashed #cfd9e3;border-radius:9px;color:#667085;text-align:center}
.market-live-warning{margin:14px 0 4px;padding:11px 13px;border:1px solid #e4b560;border-radius:9px;background:#fff8e8;color:#7a5000;font-weight:700}
.market-live-warning.ok{border-color:#83c79f;background:#effaf3;color:#166534}
.market-offer-editor{max-width:850px}.market-selected-check{justify-content:flex-start}.market-selected-check input{width:auto;margin:0}

.received-offer-company-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 18px;margin-top:12px;padding-top:11px;border-top:1px solid #e4e9ef}
.received-offer-company-meta>div{min-width:0}
.received-offer-company-meta span{display:block;margin-bottom:3px;color:#667085;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.045em}
.received-offer-company-meta strong{display:block;font-size:13px;line-height:1.35;overflow-wrap:anywhere}
.received-offers-panel{box-shadow:0 1px 4px rgba(16,24,40,.08)}
.received-offers-panel .received-offers-info{margin:0 0 16px}
.received-vendor-picker-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:end}
.received-vendor-picker-row .vendor-add{height:42px;margin-top:5px}
.received-offer-back-actions{margin-top:18px}

@media (hover:hover) and (pointer:fine){
  .market-offer-card:hover{border-color:#19365f;box-shadow:0 8px 22px rgba(25,54,95,.14);transform:translateY(-1px)}
}

@media(max-width:900px){
  .orders-system-grid{grid-template-columns:1fr}
  .market-offer-list{grid-template-columns:1fr}
  .market-research-heading{align-items:flex-start;flex-direction:column}
  .market-add-offer{width:100%;text-align:center}
}
@media(max-width:520px){
  .order-system-body{grid-template-columns:1fr}.order-system-field.span2{grid-column:auto}
  .received-offer-company-meta{grid-template-columns:1fr}
  .received-vendor-picker-row{grid-template-columns:1fr}
  .received-vendor-picker-row .vendor-add{width:100%;margin-top:0}
  .order-system-head{align-items:flex-start;flex-direction:column}.order-system-actions{flex-wrap:wrap}
  .order-system-actions .button,.order-system-actions form,.order-system-actions form button{flex:1 1 auto;text-align:center}
  .pagination{flex-wrap:wrap}.pagination-pages{order:3;width:100%;justify-content:center}
}

/* ===== v2.0.0 spójne kafle systemowe i działania ===== */
@media (hover:hover) and (pointer:fine){
  .order-system-card:hover{border-color:#19365f;box-shadow:0 8px 22px rgba(25,54,95,.14);transform:translateY(-1px)}
}
.dashboard-orders-grid{margin-bottom:30px}
.form-submit-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:4px}

.system-record-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:10px 0 22px}
.system-record-card{display:flex;min-width:0;min-height:230px;flex-direction:column;border:1.5px solid #87afd2;border-radius:12px;background:#f8fbfe;overflow:hidden;box-shadow:none;transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}
.system-record-card.is-disabled{border-color:#cbd3dd;background:#f7f8fa}
.system-record-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:17px 18px 14px;border-bottom:1px solid rgba(25,54,95,.13)}
.system-record-title{min-width:0}
.system-record-title h2{margin:0;color:#19365f;font-size:20px;line-height:1.2;font-weight:800;overflow-wrap:anywhere}
.system-record-title>strong{display:block;margin-top:5px;color:#344054;font-size:13px;line-height:1.3}
.system-record-status{flex:0 0 auto;text-align:right}
.system-record-presence{max-width:46%;font-size:13px;line-height:1.3}
.presence-offline{color:#667085}
.system-record-body{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px 22px;padding:17px 18px 19px;flex:1}
.system-record-field{min-width:0}
.system-record-field.span2{grid-column:1/-1}
.system-record-field>span{display:block;margin-bottom:5px;color:#667085;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.045em}
.system-record-field strong{display:block;font-size:14px;line-height:1.4;overflow-wrap:anywhere}
.system-record-badges{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.system-record-actions{display:flex;align-items:center;gap:8px;padding:12px 18px 14px;border-top:1px solid rgba(25,54,95,.13)}
.system-record-actions form{display:inline-flex;margin:0}
.system-record-actions .button,.system-record-actions button{min-width:86px;font-weight:700}

.vendor-alphabet{display:flex;align-items:center;gap:4px;flex-wrap:wrap;margin:0 0 17px;padding:9px 11px;border:1px solid #e0e5eb;border-radius:11px;background:rgba(255,255,255,.72)}
.vendor-letter{display:inline-flex;width:30px;height:30px;align-items:center;justify-content:center;border-radius:7px;color:#526174;text-decoration:none;font-size:12px;font-weight:750;transition:background .15s ease,color .15s ease}
.vendor-letter:hover{background:#eaf2f8;color:#19365f}
.vendor-letter.active{background:#19365f;color:#fff}
.vendor-letter.unavailable:not(.active){color:#aeb6c1}
.vendor-letter-all{width:auto;padding:0 10px;margin-right:3px}

@media (hover:hover) and (pointer:fine){
  .system-record-card:hover{border-color:#19365f;box-shadow:0 8px 22px rgba(25,54,95,.14);transform:translateY(-1px)}
}

@media(max-width:900px){
  .system-record-grid{grid-template-columns:1fr}
}
@media(max-width:520px){
  .module-home{margin-top:28px}
  .module-logo{width:82px;height:82px}
  .system-record-card{min-height:0}
  .system-record-body{grid-template-columns:1fr}
  .system-record-field.span2{grid-column:auto}
  .system-record-actions{align-items:stretch}
  .system-record-actions .button,.system-record-actions form,.system-record-actions form button{flex:1 1 0;width:100%}
  .form-submit-actions{align-items:stretch;flex-direction:column}
  .form-submit-actions .button,.form-submit-actions button{width:100%}
  .vendor-alphabet{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;padding-bottom:10px}
  .vendor-letter{flex:0 0 32px}
  .vendor-letter-all{flex-basis:auto}
}

/* ===== v2.0.0 aktywny dashboard, dostawcy, formularz ofert i menu ===== */
.dashboard-stat-card{border:1.5px solid transparent;color:#202124;text-decoration:none;transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}
.cards{flex-wrap:wrap}
@media (hover:hover) and (pointer:fine){
  .dashboard-stat-card:hover{border-color:#19365f;box-shadow:0 8px 22px rgba(25,54,95,.14);transform:translateY(-1px)}
}
.vendor-system-actions{justify-content:space-between}
.vendor-card-primary-actions{display:flex;align-items:center;gap:8px}
.vendor-new-order-button{background:#19365f;color:#fff}
.vendor-orders-link{display:inline-flex;align-items:baseline;justify-content:center;gap:4px;margin:0 auto;color:#19365f;text-decoration:none;font-size:13px;font-weight:700;white-space:nowrap}
.vendor-orders-link strong{font-size:17px}
.vendor-orders-link:hover{text-decoration:underline;text-underline-offset:3px}
.vendor-order-count-link,.orders-vendor-name{color:#19365f;font-weight:800;text-decoration:none}
.vendor-order-count-link:hover,.orders-vendor-name:hover{text-decoration:underline;text-underline-offset:3px}
.system-record-title-link{color:inherit;text-decoration:none}
.system-record-title-link:hover{text-decoration:underline;text-underline-offset:3px}
.detail-vendor-link{color:#19365f;font-weight:800;text-decoration:none}
.detail-vendor-link:hover{text-decoration:underline;text-underline-offset:3px}
.vendor-detail-card{overflow:hidden;margin-bottom:24px;border:1.5px solid #87afd2;border-radius:12px;background:#fff;box-shadow:0 1px 4px #0001}
.vendor-detail-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:17px 20px;border-bottom:1px solid rgba(25,54,95,.13);background:#f8fbfe}
.vendor-detail-head h2{margin:0;color:#19365f;font-size:21px}
.vendor-detail-section{padding:20px}
.vendor-detail-section h3{margin:0 0 17px;color:#19365f;font-size:17px}
.vendor-contact-section{border-top:1px solid rgba(25,54,95,.13)}
.vendor-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 28px}
.vendor-detail-field{min-width:0}
.vendor-detail-field.span2{grid-column:1/-1}
.vendor-detail-field>span{display:block;margin-bottom:5px;color:#667085;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.045em}
.vendor-detail-field strong{display:block;font-size:15px;line-height:1.45;overflow-wrap:anywhere}
.vendor-detail-field a{color:#19365f;text-decoration:none}
.vendor-detail-field a:hover{text-decoration:underline}
.offer-case-card{min-height:300px}
.offer-case-card.is-complete{background:#f7fbf8}
.offer-case-stage{max-width:180px;white-space:normal;text-align:center;line-height:1.2}
.offer-case-stage.complete{background:#dcfce7;color:#166534}
.offer-case-stage.contract{background:#e8f1ff;color:#175cd3}
.offer-case-value{text-align:right}
.offer-case-actions{justify-content:flex-start}
.offer-case-pdf{margin-left:auto;background:#19365f;color:#fff}
.market-company-section-title{margin:8px 0 0;color:#19365f;font-size:17px}
.market-offer-editor{padding:24px;min-width:0}
.market-vendor-picker{padding:15px 16px;border:1px solid #c9dcea;border-radius:11px;background:#f2f8fd}
.market-vendor-picker label{display:block;color:#19365f}
.market-vendor-picker select{margin-top:7px}
.market-vendor-picker small{display:block;margin-top:7px;line-height:1.4}
.add-vendor-check{margin-top:-3px!important;padding-top:12px;border-top:1px solid #e8ebef}
.module-logo{width:140px;height:140px;margin-bottom:12px}

.app-header{position:sticky;top:0;z-index:1000;padding:9px 20px;background:#172b4d;box-shadow:0 2px 12px rgba(16,24,40,.16)}
.app-header-inner{display:flex;width:100%;max-width:1480px;margin:0 auto;align-items:center;justify-content:space-between;gap:24px}
.app-header .header-top{display:flex;align-items:center;flex:0 1 auto;min-width:0}
.header-indicators{display:flex;align-items:center;gap:8px;margin-left:auto;flex:0 0 auto}
.app-header .admin-presence{display:inline-flex;align-items:center;gap:6px;color:#fff;border:1px solid #8290aa;border-radius:9px;padding:8px 10px;text-decoration:none;white-space:nowrap;font-size:14px;font-weight:700}
.app-header .admin-presence:hover{background:rgba(255,255,255,.12)}
.app-header .admin-presence:focus-visible{outline:3px solid #60a5fa;outline-offset:2px}
.app-header .brand{display:inline-flex;align-items:center;gap:8px;margin:0;padding:8px 0;color:#fff;text-decoration:none;font-size:15px;line-height:1.2;white-space:nowrap}
.brand-icon{font-size:18px;line-height:1}
.system-nav{display:flex;align-items:center;justify-content:flex-end;gap:3px;min-width:0}
.nav-logout-form{display:flex;margin:0;padding:0}
.app-header .system-nav a{display:inline-flex;align-items:center;min-height:38px;margin:0;padding:8px 10px;border:1px solid transparent;border-radius:9px;color:#eaf0f8;text-decoration:none;font-size:13px;font-weight:650;line-height:1.15;white-space:nowrap;transition:background .15s ease,border-color .15s ease,color .15s ease}
.app-header .system-nav button.nav-logout{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:8px 10px;border:1px solid transparent;border-radius:9px;background:transparent;font:inherit;font-size:13px;font-weight:650;line-height:1.15;white-space:nowrap;cursor:pointer;transition:background .15s ease,border-color .15s ease,color .15s ease}
.app-header .system-nav a:hover{background:rgba(255,255,255,.09);border-color:rgba(255,255,255,.1);color:#fff}
.app-header .system-nav a.active{background:#fff;border-color:#fff;color:#19365f;box-shadow:0 2px 8px rgba(0,0,0,.14)}
.app-header .system-nav .nav-logout{margin-left:5px;border-color:rgba(255,255,255,.2);color:#fff}
.app-header .system-nav .nav-logout:hover{background:#b71c1c;border-color:#b71c1c}

@media(max-width:1180px){
  .app-header{padding:9px 18px}
  .app-header-inner{display:block}
  .app-header .header-top{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%}
  .app-header .brand{font-size:15px!important}
  .mobile-menu-toggle{display:flex;flex:0 0 auto;width:46px;height:46px;min-height:46px;padding:10px;border:0;border-radius:11px;background:rgba(255,255,255,.12);flex-direction:column;justify-content:center;gap:6px;cursor:pointer;position:relative;z-index:1002}
  .mobile-menu-toggle span{display:block;width:100%;height:3px;border-radius:3px;background:#fff;transition:transform .2s ease,opacity .2s ease}
  .app-header nav#main-nav{display:none}
  body.mobile-menu-open{overflow:hidden}
  body.mobile-menu-open .app-header nav#main-nav{display:flex;position:fixed;inset:0;z-index:1001;width:100vw;height:100dvh;box-sizing:border-box;padding:max(92px,calc(env(safe-area-inset-top) + 78px)) 24px max(28px,env(safe-area-inset-bottom));background:#172b4d;flex-direction:column;flex-wrap:nowrap;align-items:stretch;justify-content:flex-start;gap:3px;overflow-y:auto}
  body.mobile-menu-open .app-header nav#main-nav a{display:flex;width:100%;min-height:52px;box-sizing:border-box;margin:0;padding:14px 12px;border:0;border-bottom:1px solid rgba(255,255,255,.12);border-radius:8px;color:#fff;background:transparent;box-shadow:none;font-size:1.08rem;line-height:1.2;white-space:normal}
  body.mobile-menu-open .app-header nav#main-nav a.active{padding-left:17px;border-left:4px solid #d92d20;background:rgba(255,255,255,.1)}
  body.mobile-menu-open .app-header nav#main-nav .nav-logout{margin-top:14px;border:1px solid rgba(255,255,255,.22);justify-content:center}
  body.mobile-menu-open .app-header nav#main-nav .nav-logout-form{display:flex;width:100%}
  body.mobile-menu-open .app-header nav#main-nav button.nav-logout{width:100%;min-height:52px;padding:14px 12px;font-size:1.08rem}
  body.mobile-menu-open .mobile-menu-toggle{position:fixed;top:max(14px,env(safe-area-inset-top));right:18px}
  body.mobile-menu-open .mobile-menu-toggle span:nth-child(1){transform:translateY(9px) rotate(45deg)}
  body.mobile-menu-open .mobile-menu-toggle span:nth-child(2){opacity:0}
  body.mobile-menu-open .mobile-menu-toggle span:nth-child(3){transform:translateY(-9px) rotate(-45deg)}
}

/* ===== v2.1.0 wyszukiwanie, liczniki i karty ofert ===== */
.order-search-panel{margin:4px 0 22px;padding:16px 18px;border:1px solid #d9e4ef;background:#fff}
.order-search-grid{display:grid;grid-template-columns:minmax(260px,1.6fr) minmax(150px,.7fr) minmax(150px,.7fr) auto;gap:12px;align-items:end}
.order-search-grid label{margin:0}
.order-search-grid input{margin-top:6px}
.reference-search-input{display:flex;align-items:stretch;margin-top:6px}
.reference-search-input input{flex:1 1 auto;min-width:0;margin-top:0;border-radius:0 8px 8px 0}
.reference-prefix{display:flex;align-items:center;padding:0 11px;border:1px solid #cfd6df;border-right:0;border-radius:8px 0 0 8px;background:#f2f5f8;color:#19365f;font-weight:800;white-space:nowrap}
.order-search-actions{display:flex;gap:8px;align-items:center}
.order-search-panel>small{display:block;margin-top:9px;color:#667085}
.order-status-filters{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:14px;padding-top:14px;border-top:1px solid #e4e9ef}
.order-status-filter{display:inline-flex;align-items:center;min-height:34px;padding:6px 11px;border:1px solid #d7e0e9;border-radius:999px;background:#f8fafc;color:#344054;text-decoration:none;font-size:12px;font-weight:750;transition:border-color .15s ease,box-shadow .15s ease}
.order-status-filter.status-robocze{border-color:#d7dee8;background:#e9eef5;color:#344054}
.order-status-filter.status-do-zatwierdzenia{border-color:#d7e0e9;background:#eef2f7;color:#25364d}
.order-status-filter.status-zatwierdzone{border-color:#cfe0f7;background:#e8f1ff;color:#175cd3}
.order-status-filter.status-wysłane,.order-status-filter.status-wyslane{border-color:#f0d99c;background:#fff3d6;color:#9a6700}
.order-status-filter.status-zrealizowane{border-color:#bce8ca;background:#dcfce7;color:#166534}
.order-status-filter.status-anulowane{border-color:#f5c2c2;background:#fee2e2;color:#b42318}
.order-status-filter:hover{border-color:currentColor}
.order-status-filter.active{border-color:currentColor;box-shadow:inset 0 0 0 1px currentColor}
.search-results-title{display:flex;align-items:center;gap:8px;margin:24px 0 10px;color:#19365f;font-size:20px}
.search-results-title span{display:inline-flex;align-items:center;justify-content:center;min-width:27px;height:27px;padding:0 7px;border-radius:999px;background:#eaf2f8;font-size:13px}
.shared-number-results{margin-top:34px;padding-top:1px;border-top:1px solid #d9e4ef}
.order-system-financial{text-align:right}
.order-offer-count{display:inline-block;margin-top:7px;padding:4px 8px;border-radius:999px;background:#eaf2f8;color:#19365f;text-decoration:none;font-size:11px;font-weight:800;white-space:nowrap}
.order-offer-count:hover{background:#19365f;color:#fff}
.market-research-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.market-offers-pdf{background:#eaf2f8;color:#19365f;font-weight:800}
.market-offer-editor{width:100%;max-width:none;box-sizing:border-box}
.market-offer-detail-card{overflow:hidden;margin-bottom:24px;border:1.5px solid #87afd2;border-radius:12px;background:#fff}
.market-offer-detail-card.selected{border-color:#19365f;box-shadow:0 8px 22px rgba(25,54,95,.12)}
.market-offer-detail-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:20px;background:#f8fbfe;border-bottom:1px solid #d9e4ef}
.market-offer-detail-card.selected .market-offer-detail-head{background:#eaf3fb}
.market-offer-detail-head h2{margin:0;color:#19365f}
.market-offer-detail-head>strong{color:#19365f;font-size:20px;white-space:nowrap}
.market-offer-detail-price{text-align:right}
.market-offer-detail-price strong,.market-offer-detail-price span{display:block}
.market-offer-detail-price strong{color:#19365f;font-size:20px;white-space:nowrap}
.market-offer-detail-price span{margin-top:5px;color:#667085;font-size:13px;font-weight:700}
.market-offer-detail-card section{padding:20px}
.market-offer-detail-card section+section{border-top:1px solid #e4e9ef}
.market-offer-detail-card h3{margin:0 0 17px;color:#19365f;font-size:17px}
.market-offer-detail-notes{white-space:pre-wrap}
.market-offer-attachment-link{color:#19365f;text-decoration:underline;text-underline-offset:3px}
.offer-price-editor{padding:16px;border:1px solid #c9dcea;border-radius:11px;background:#f5f9fd}
.offer-price-editor-title{margin-bottom:10px;color:#19365f;font-size:15px;font-weight:800}
.offer-price-basis{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}
.offer-price-basis label{position:relative;margin:0;padding:0}
.offer-price-basis input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.offer-price-basis span{display:inline-flex;min-height:38px;align-items:center;padding:8px 13px;border:1px solid #cbd5e1;border-radius:9px;background:#fff;color:#344054;font-size:13px;font-weight:750;cursor:pointer;transition:border-color .15s ease,background .15s ease,color .15s ease}
.offer-price-basis input:focus-visible+span{outline:3px solid rgba(69,137,194,.28);outline-offset:2px}
.offer-price-basis input:checked+span{border-color:#19365f;background:#19365f;color:#fff}
.offer-price-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.offer-price-fields label{margin:0}
.offer-price-fields input[readonly]{background:#eaf2f8;color:#19365f;font-weight:800}
.offer-price-editor>small{display:block;margin-top:10px;line-height:1.4;color:#667085}
.offer-price-secondary{display:block;margin-top:4px;color:#667085;font-size:12px;font-weight:650;white-space:normal}
.market-offer-price .offer-price-secondary{text-align:right}
@media(max-width:900px){
  .order-search-grid{grid-template-columns:1fr 1fr}
  .order-search-grid label:first-child{grid-column:1/-1}
  .order-search-actions{justify-content:flex-end}
}
@media(max-width:520px){
  .order-search-grid{grid-template-columns:1fr}
  .order-search-grid label:first-child{grid-column:auto}
  .order-search-actions{justify-content:stretch}
  .order-search-actions .button{flex:1;text-align:center}
  .order-status-filters{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px;-webkit-overflow-scrolling:touch}
  .order-status-filter{flex:0 0 auto}
  .order-system-financial{text-align:left}
  .market-research-actions{width:100%;display:grid;grid-template-columns:1fr}
  .market-research-actions .button{text-align:center}
  .market-offer-detail-head{flex-direction:column}
  .market-offer-detail-price{text-align:left}
  .market-offer-detail-card section{padding:17px 15px}
  .offer-price-fields{grid-template-columns:1fr 1fr}
}

@media(max-width:520px){
  .module-logo{width:112px;height:112px}
  .dashboard-stat-card{flex:1 1 140px;min-width:0}
  .offer-price-fields{grid-template-columns:1fr}
  .offer-price-basis{display:grid;grid-template-columns:1fr}
  .offer-price-basis span{justify-content:center}
  .vendor-system-actions{gap:10px}
  .vendor-system-actions{display:grid;grid-template-columns:1fr 1fr}
  .vendor-card-primary-actions{display:grid;grid-template-columns:1fr 1fr;flex:1 1 auto;gap:10px}
  .vendor-card-primary-actions{grid-column:1/-1}
  .vendor-orders-link{width:100%;min-height:40px;align-items:center;margin:0;border:1px solid #d7e0e9;border-radius:8px;background:#fff}
  .vendor-system-actions .button{min-width:0}
  .vendor-detail-section{padding:17px 15px}
  .vendor-detail-grid{grid-template-columns:1fr;gap:15px}
  .vendor-detail-field.span2{grid-column:auto}
  .vendor-view-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
  .vendor-view-actions .primary{grid-column:1/-1}
  .offer-case-card{min-height:0}
  .offer-case-value{text-align:left}
  .offer-case-actions{display:grid;grid-template-columns:1fr 1fr}
  .offer-case-pdf{grid-column:1/-1;margin-left:0}
  .market-offer-editor{padding:18px 15px}
}
