:root{
  --bg: #0b1220;
  --surface: #0f1a2e;
  --card: #ffffff;
  --muted: #6b7280;
  --text: #0b1220;
  --border: rgba(15, 23, 42, 0.14);
  --border-strong: rgba(15, 23, 42, 0.22);
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
  --radius: 14px;
  --ring: 0 0 0 4px rgba(59, 130, 246, 0.18);
  --accent: #2563eb;
  --panel-shadow: 0 24px 50px rgba(15, 23, 42, 0.12);
  --panel-border: rgba(15, 23, 42, 0.12);
  --parallaxY: 0px;
}

@page { size: A4 portrait; margin: 15mm; }

body {
  font-family: "Space Grotesk", "Plus Jakarta Sans", "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  margin: 0;
  background: #f6f7fb;
  color: var(--text);
}

.appTop {
  background: #0f1a2e;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  padding: 0 16px;
  position: relative;
}

.appTopInner{
  max-width: 1260px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand{
  display:flex;
  flex-direction:column;
  gap: 2px;
  min-width: 0;
}
/* Brand: logo + opis projektu */
.brandRow{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 0;
}

.brandLogo{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 6px;
  box-sizing: border-box;
  flex: 0 0 auto;
}

.brand .h{
  color:#fff;
  font-weight: 700;
  letter-spacing: 0;
  font-size: clamp(22px, 2.2vw, 36px);
  line-height: 1.1;
}
.brand .s{
  color: rgba(255,255,255,0.72);
  font-size: 13px;
}

.wrap{
  max-width: 1100px;
  margin: 16px auto 0;
  padding: 0 16px 22px;
}

.appTopNav{
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topBtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:40px;
  min-height:40px;
  line-height:1;
  padding:8px 14px;
  border-radius:10px;
  border:1px solid #d1d5db;
  background:#fff;
  color:#0f172a;
  font-weight:700;
  font-size:14px;
  text-decoration:none;
  cursor:pointer;
  white-space:nowrap;
  box-sizing:border-box;
  appearance:none;
  -webkit-appearance:none;
  transition:background-color .16s ease, box-shadow .16s ease, transform .1s ease;
}

.topBtn:hover{
  background:#f8fafc;
}

.topBtn:active{
  transform: translateY(1px);
}

.topBtnGhost{
  border-color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.08);
  color:#fff;
}

.topBtnGhost:hover{
  background: rgba(255,255,255,0.14);
}

.panelCard{
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: var(--panel-shadow);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.panelCard::after{
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(320px 120px at 10% -10%, rgba(37, 99, 235, 0.08), transparent);
  pointer-events: none;
}

.panelHeader{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.panelHeader h1{
  margin:0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.1px;
}
.panelHeader .hint{
  margin:0;
  font-size: 12px;
  color: rgba(15, 23, 42, 0.56);
}

.formGrid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.field{
  grid-column: span 6;
  display:flex;
  flex-direction: column;
  gap: 6px;
}

.field.small { grid-column: span 3; }
.field.wide  { grid-column: span 12; }

.field label{
  font-size: 12px;
  color: rgba(15, 23, 42, 0.72);
}

.control{
  width: 100%;
  height: 40px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #f8fafc;
  outline: none;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.control:focus{
  border-color: rgba(37, 99, 235, 0.7);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
  background: #fff;
}

.controlsRow{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.controlsRow .control{
  flex: 1 1 280px;
  min-width: 0;
}

.fieldNote,
.statusLine{
  font-size: 12px;
  color: var(--muted);
}

.statusLine.is-error,
.fieldNote.is-error{
  color: #b91c1c;
}

.actions{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
}

.btn{
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: #fff;
  cursor:pointer;
  font-weight: 600;
  font-size: 13px;
  transition: transform 120ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.btnPrimary{
  background: linear-gradient(120deg, #0f172a, #1e293b);
  color: #fff;
  border-color: rgba(15, 23, 42, 0.2);
}

.btn:hover{ filter: brightness(0.98); }
.btnPrimary:hover{ filter: brightness(1.05); }
.btn:active{ transform: translateY(1px); }

.tinyNote{
  font-size: 12px;
  color: var(--muted);
}

/* Arkusz etykiet */
.sheet {
  margin-top: 16px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, 8cm);
  grid-auto-rows: 4cm;
  gap: 0;
  justify-content: center;
  align-content: start;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: var(--panel-shadow);
  background: #fff;
}

.label {
  width: 8cm;
  height: 4cm;
  border: 1px solid #222;
  padding: 2mm;
  box-sizing: border-box;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.bg-blue   { background: #49a0d6; }
.bg-white  { background: #ffffff; }
.bg-yellow { background: #fff3a0; }

.title {
  font-weight: 700;
  text-align: center;
  font-size: 16px;
  margin: 0 0 6px 0;
}

.row {
  font-size: 11px;
  line-height: 1.4;
  margin: 1px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row b { font-weight: 700; }

.centerValue {
  text-align: center;
  font-size: 13px;
  line-height: 1.2;
  margin: 2px 0;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.centerValueLarge {
  font-size: 15px;
}

/* wartość bez etykiety, „opis tekst” – wyrównana do środka */
.plainValue {
  text-align: center;
  font-size: 11px;
  line-height: 1.4;
  margin: 1px 0;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.labelFooter {
  margin-top: auto;
  padding-top: 4px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.labelFooterValue {
  flex: 1 1 0;
  min-width: 0;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.labelFooterLeft {
  text-align: left;
}

.labelFooterRight {
  text-align: right;
}

.spacer { height: 4px; }
.pushBottom { margin-top: auto; }

@media (max-width: 900px){
  .field{ grid-column: span 12; }
  .field.small{ grid-column: span 6; }
  .controlsRow{
    align-items: stretch;
  }
  .controlsRow .control{
    flex-basis: 100%;
  }
  .appTopInner{
    align-items: flex-start;
  }
  .brand .h{
    font-size: 30px;
  }
  .brand .s{
    font-size: 12px;
  }
  .appTopNav{
    width: 100%;
    justify-content: flex-start;
  }
}

@media print {
  * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .appTop, .panelCard { display: none; }
  .label { cursor: default; }
  body { background: #fff; }
  .wrap{ margin: 0; padding: 0; }
  .sheet{
    margin-top: 0;
    padding: 0;
    grid-template-columns: repeat(2, 80mm);
    grid-auto-rows: 40mm;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  .label{
    width: 80mm;
    height: 40mm;
  }
  .copyrightBar{
    display:none;
  }
}

.copyrightBar{
  max-width: 1100px;
  margin: 16px auto 0;
  padding: 10px 16px 22px;
  text-align: center;
  font-size: 12px;
  color: rgba(15, 23, 42, 0.62);
}

.copyrightBar strong{
  color: rgba(15, 23, 42, 0.82);
  font-weight: 650;
}
