/* ===== A4 document preview inside admin layout ===== */

.admin-doc {
  /* tło “biurka” tylko w obrębie main-content (nie ruszamy body) */
  background: #F6F6F6;
  padding: 1rem 0;
  border-radius: 12px;
}

.admin-doc .a4-page {
  width: 27cm;
  min-height: 29.7cm;
  margin: 1.5rem auto;
  padding: 2cm;
  background: #fff;
  box-shadow: 0 0 8px rgba(0,0,0,0.15);
  position: relative;
  box-sizing: border-box;
}

/* Na małych ekranach: A4 robi się płynne */
@media (max-width: 992px) {
  .admin-doc .a4-page {
    width: 100%;
    min-height: auto;
    padding: 1.25rem;
    margin: 1rem 0;
  }
}

.admin-doc .page-header { margin-bottom: 1.5rem; }
.admin-doc .doc-meta { font-size: 0.9rem; color: #555; }

.admin-doc h1 { font-size: 1.4rem; margin-bottom: 0.3rem; }
.admin-doc h2 { font-size: 1.1rem; margin-top: 1rem; margin-bottom: 0.4rem; }
.admin-doc h3 { font-size: 1rem; margin-top: 0.6rem; margin-bottom: 0.2rem; }
.admin-doc p { margin: 0.2rem 0 0.5rem 0; }

.admin-doc table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.5em 0;
  font-size: 0.9rem;
}
.admin-doc th, .admin-doc td {
  border: 1px solid #ccc;
  padding: 4px 6px;
  vertical-align: top;
}
.admin-doc th { background: #f5f5f5; }

.admin-doc ul { margin: 0.2rem 0 0.6rem 1.2rem; }

.admin-doc .page-footer {
  position: absolute;
  bottom: 1cm;
  left: 2cm;
  right: 2cm;
  font-size: 0.8rem;
  color: #777;
  display: flex;
  justify-content: space-between;
}

@media (max-width: 992px) {
  .admin-doc .page-footer {
    position: static;
    margin-top: 1rem;
    padding-top: .75rem;
    border-top: 1px solid #eee;
  }
}

/* ===== PRINT (A4) ===== */
@media print {
  /* Ustawienia strony */
  @page {
    size: A4;
    margin: 15mm;
  }

  /* Ukryj elementy UI, które nie mają się drukować */
  .no-print,
  nav,
  .sidebar,
  .topbar,
  .btn,
  .modal,
  .modal-backdrop {
    display: none !important;
  }

  /* Tło "biurka" i cienie nie są potrzebne w druku */
  .admin-doc {
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }

  /* Kartka ma się drukować jako czysta strona */
  .admin-doc .a4-page {
    width: auto !important;
    min-height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
  }

  /* Jeśli chcesz ręczne łamanie stron: */
  .page-break {
    break-before: page;
    page-break-before: always; /* kompatybilność */
  }

  /* Linki: bez niebieskich podkreśleń */
  a, a:visited {
    color: #000 !important;
    text-decoration: none !important;
  }
}
