/* Główne ustawienia layoutu */
body {
    font-family: Arial, Helvetica, sans-serif;
    width: 100%;
    max-width: none;         /* 🔹 usuwa ograniczenie szerokości */
    margin: 0;
    padding: 30px 18px;
    color: #222;
    background: #f7f8fa;
    box-sizing: border-box;
    font-size: 16px;
    line-height: 1.6;
}

/* formularze: inputy i textarea na 100%, ale nie buttony */
input, textarea, select {
    width: 100%;
    padding: 8px;
    margin: 6px 0;
    box-sizing: border-box;
}
button {
    width: auto;            /* przyciski mają naturalną szerokość */
    padding: 8px 12px;
    margin: 4px 0;
    cursor: pointer;
    border-radius: 6px;
    border: 0;
}
.btn,
button,
input,
select,
textarea,
label,
.filters label,
.small {
  font-size: 15px;
}

table th, table td {
  font-size: 15px;  /* wcześniej mogło być 13-14px */
  padding: 12px 10px;  /* trochę więcej przestrzeni w pionie */
}

/* header */
header { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:12px; gap:18px; }
header .left { max-width: 70%; }
header h1 { margin:0; font-size:20px; }
header p { margin:6px 0 0 0; color:#555; font-size:13px; }
header .right { text-align:right; display:flex; flex-direction:column; align-items:flex-end; gap:8px; }

/* "who" - informacja o zalogowanym */
header .right .who { font-size:14px; color:#333; }

/* Kontrolki nad tabelą (przycisk Wyślij + Dodaj plik) */
.controls {
    display:flex;
    gap:12px;
    align-items:center;
    margin-bottom:12px;
    flex-wrap:wrap;
}

/* styl przycisków */
.btn-send {
    background:#2d6a9f;
    color:#fff;
    padding:10px 14px;
    border-radius:6px;
    text-decoration:none;
    display:inline-block;
    border: none;
}
.btn-add {
    background:#6a4bd6;
    color:#fff;
    padding:8px 12px;
    border-radius:6px;
    text-decoration:none;
    display:inline-block;
}

/* tabela ma zajmować całą szerokość */
table.files-table {
    width: 100%;
    border-collapse: collapse;
}

/* drobne poprawki estetyczne */
table.files-table th, table.files-table td {
    padding: 8px 10px;
    vertical-align: middle;
    border-bottom: 1px solid #e3e6ea;
}
.badge { font-size:13px; color:#555; }


textarea {
    width: 100%;
    font-family: inherit;
    font-size: 14px;
}

#edit_section {
    border-left: 1px solid #ccc;
    padding-left: 16px;
}

#edit_section h3 {
    margin-top: 0;
}

iframe {
    border: 1px solid #aaa;
    background: #f9f9f9;
}

/* ------- Upload UI improvements (append this) ------- */

/* container for upload form */
.upload-card {
  max-width: 940px;
  margin: 18px auto;
  background: #ffffff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 6px 20px rgba(24,39,75,0.06);
  border: 1px solid #eff2f7;
}

/* form layout */
.upload-row { display:flex; gap:20px; align-items:flex-start; flex-wrap:wrap; }
.upload-col { flex:1 1 420px; min-width:260px; }

/* labels & inputs */
label.form-label { display:block; font-weight:600; margin-bottom:8px; color:#374151; }
input[type="text"].form-input, textarea.form-input {
  width:100%;
  padding:10px 12px;
  border-radius:8px;
  border:1px solid #e6e9ee;
  background: #fbfdff;
  box-sizing:border-box;
  font-size:14px;
  color:#0f172a;
}

/* custom file input */
.file-input-wrap { display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin-top:6px; }
.file-choose {
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:8px;
  background:#f3f4f6;
  border:1px solid #e6e9ee;
  cursor:pointer;
  font-weight:600;
  color:#111827;
}
.file-choose input[type="file"] { display:none; }

.file-info {
  font-size:13px;
  color:#374151;
  background:transparent;
}

/* remove file small button */
.btn-clear {
  padding:6px 10px;
  border-radius:8px;
  border:1px solid #e5e7eb;
  background:#fff;
  cursor:pointer;
  font-size:13px;
}

/* category buttons */
.category-list { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.cat-btn {
  padding:8px 12px;
  border-radius:8px;
  border:1px solid #e6e9ee;
  background:#fafafa;
  cursor:pointer;
  font-weight:600;
  font-size:13px;
  color:#374151;
}
.cat-btn.active {
  background:linear-gradient(180deg,#2b6cb0,#235a95);
  color:#fff;
  border-color:rgba(0,0,0,0.06);
  box-shadow:0 6px 18px rgba(37,99,235,0.08);
}

/* preview card */
.preview-card {
  margin-top:14px;
  border-radius:10px;
  overflow:hidden;
  border:1px solid #e6e9ee;
  box-shadow:0 10px 30px rgba(2,6,23,0.04);
  background:#fff;
}
.preview-toolbar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 12px;
  background:#fbfdff;
  border-bottom:1px solid #f1f5f9;
}
.preview-title { font-weight:700; color:#0f172a; font-size:14px; }
.preview-meta { font-size:13px; color:#6b7280; }

/* preview iframe / image */
.preview-body { height:56vh; min-height:320px; background:#0b1220; display:flex; align-items:center; justify-content:center; }
.preview-body iframe, .preview-body img, .preview-body object {
  width:100%;
  height:100%;
  border:0;
  display:block;
}

/* disabled submit */
button[type="submit"]:disabled {
  opacity:0.6;
  cursor:not-allowed;
}

/* responsive tweaks */
@media (max-width:880px){
  .upload-row { flex-direction:column; }
  .preview-body { height:48vh; }
}

.btn-secondary {
  background: #f3f4f6;
  color: #1f2937;
  border: 1px solid #d1d5db;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-secondary:hover {
  background: #e5e7eb;
  border-color: #cbd5e1;
}

/* Action menu droplet (księgowa) */
.action-menu a, .action-menu button {
  font-size:13px;
  color:#111;
  background:transparent;
}
.action-menu a:hover, .action-menu button:hover {
  background:#f3f4f6;
}

input[type="checkbox"] {
  width: 40px;
  height: 40px;
  cursor: pointer;
  accent-color: #2b6cb0; /* ładny niebieski */
}

th:first-child,
td:first-child {
  padding: 10px 12px;
}


/* Styl niestandardowego checkboxa */
.custom-checkbox {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding: 6px;
}

.custom-checkbox input[type="checkbox"] {
  display: none; /* ukrywamy natywny checkbox */
}

.custom-checkbox .checkbox-box {
  width: 24px;
  height: 24px;
  border: 2px solid #94a3b8;
  border-radius: 6px;
  background-color: white;
  display: inline-block;
  position: relative;
  transition: all 0.2s ease;
}

/* zaznaczenie: ✅ lub tło */
.custom-checkbox input[type="checkbox"]:checked + .checkbox-box::after {
  content: "✓";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -58%);
  font-size: 16px;
  color: #1d4ed8;
  font-weight: bold;
}

/* Czerwony checkbox z X dla odrzuconych plików */
.reject-box {
  border: 2px solid #dc2626;          /* czerwony obrys */
  color: #dc2626;                     /* czerwony X */
  background: #fff0f0;                /* lekko różowe tło */
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: default;
}


/* Zielony checkbox z ✓ dla pobranych plików */
.accepted-box {
  border: 2px solid #16a34a;         /* zielony obrys */
  color: #16a34a;                    /* zielony ✓ */
  background: #ecfdf5;               /* delikatne zielone tło */
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: default;
}