/* ---------- Design tokens ---------- */
:root {
  /* Brand (ARES green) */
  --brand-700: #065f46;
  --brand-600: #047857;
  --brand-500: #059669;
  --brand-400: #10b981;
  --brand-300: #34d399;
  --brand-100: #d1fae5;
  --brand-50: #ecfdf5;

  /* Archiwum (pomarańczowy akcent) */
  --archive-700: #c2410c;
  --archive-600: #ea580c;
  --archive-50: #fff7ed;

  /* Neutrals */
  --ink-900: #111827;
  --ink-700: #374151;
  --ink-500: #6b7280;
  --ink-300: #d1d5db;
  --ink-200: #e5e7eb;
  --ink-100: #f3f4f6;
  --ink-50: #f9fafb;
  --surface: #ffffff;
  --page-bg: #fffef5;

  /* Semantic */
  --info-700: #0369a1;
  --info-600: #0284c7;
  --info-500: #0ea5e9;
  --info-50: #f0f9ff;
  --warn-600: #d97706;
  --warn-500: #f59e0b;
  --warn-50: #fef3c7;
  --danger-700: #991b1b;
  --danger-600: #b91c1c;
  --danger-500: #dc2626;
  --danger-50: #fef2f2;

  /* System */
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.08);
  --container: 960px;
  --container-wide: 1200px;
  --font-sans: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
}

form {
  margin: 0;
}

a {
  text-decoration: none;
  color: #2563eb;
}
a:hover {
  text-decoration: underline;
  color: #dc2626;
}

.sub_n {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #f8fafc;
  text-decoration: none;
}
.sub {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  color: #374151;
  text-decoration: none;
  font-weight: normal;
}

.nagl_black {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  color: #111827;
  text-decoration: none;
}

.nagl_blue {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 600;
}
.nagl_blue_s {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 16px;
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 600;
}
.nagl_blue_d {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 20px;
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 700;
}

.nagl_red {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  color: #dc2626;
  text-decoration: none;
  font-weight: 600;
}
.nagl_red_s {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 16px;
  color: #dc2626;
  text-decoration: none;
  font-weight: 600;
}
.nagl_red_d {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 20px;
  color: #dc2626;
  text-decoration: none;
  font-weight: 700;
}

.nagl_zolty {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  color: #f59e0b;
  text-decoration: none;
  font-weight: 600;
}

.nagl_green_s {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 16px;
  color: #059669;
  text-decoration: none;
  font-weight: 600;
}

.nagl_braz_s {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 16px;
  color: #92400e;
  text-decoration: none;
  font-weight: 600;
}

.links {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  color: #dc2626;
  text-decoration: none;
  font-weight: normal;
}

.tekst_druk {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 15px;
  color: #374151;
  text-decoration: none;
  font-weight: 600;
}
.tekst {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  color: #374151;
  text-decoration: none;
  font-weight: normal;
  line-height: 1.6;
  text-align: justify;
}
.tekst_szary {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  color: #9ca3af;
  text-decoration: none;
  text-align: justify;
}
.tekst_c_szary {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  color: #6b7280;
  text-decoration: none;
  text-align: justify;
}
.szary {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  color: #9ca3af;
  text-decoration: none;
  font-weight: normal;
}
.c_szary {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  color: #6b7280;
  text-decoration: none;
  font-weight: normal;
}
.c_szary_maly {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 12px;
  color: #6b7280;
  text-decoration: none;
  font-weight: normal;
}
.c_maly {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 12px;
  color: #374151;
  text-decoration: none;
  font-weight: normal;
}

.b_maly {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 12px;
  color: #9ca3af;
  text-decoration: none;
  font-weight: normal;
  letter-spacing: 0.1em;
}
.b_maly2 {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 12px;
  color: #374151;
  text-decoration: none;
  font-weight: normal;
}
a.b_maly:hover {
  color: #6b7280;
}

a.sub_n:hover,
a.nagl_blue:hover,
a.nagl_red_s:hover,
a.nagl_blue_s:hover,
a.nagl_green_s:hover,
a.nagl_red:hover,
a.links:hover,
a.szary:hover {
  color: #f59e0b;
  text-decoration: underline;
}
a.nagl_black:hover {
  color: #dc2626;
  text-decoration: underline;
}
a.sub:hover {
  color: #f59e0b;
  text-decoration: underline;
}

blockquote {
  margin-bottom: 0px;
  margin-top: 0px;
  margin-right: 0px;
}
ul {
  list-style-type: disc;
  list-style-position: outside;
  font-size: 14px;
  margin-right: 0px;
  margin-left: 10px;
  margin-bottom: 0px;
  margin-top: 0px;
}

table {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  color: #374151;
  text-decoration: none;
  font-weight: normal;
  line-height: 1.6;
}
.komorka {
  background-color: #f5f5f0;
}

.form,
select {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  background-color: #fffef7;
  color: #333300;
  border: 1px #cccccc solid;
  transition: border-color 0.2s ease-in-out;
}
input,
textarea {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  background-color: #fffef7;
  color: #333300;
  border: 1px #cccccc solid;
  transition: border-color 0.2s ease-in-out;
}
input:focus,
textarea:focus,
select:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.in_r {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  background-color: #fffef0;
  color: #333300;
  border: 1px #cccccc solid;
  text-align: right;
  width: 100%;
  min-width: 45px;
}

.m_w {
  width: 100%;
  min-width: 200px;
}

/* Radio buttons i checkboxy */
input[type='radio'],
input[type='checkbox'] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid #cccccc;
  background-color: #fffef7;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  vertical-align: middle;
  margin-right: 6px;
}

input[type='radio'] {
  border-radius: 50%;
}

input[type='checkbox'] {
  border-radius: 3px;
}

input[type='radio']:checked {
  background-color: #93c5fd;
  border-color: #60a5fa;
  position: relative;
}

input[type='radio']:checked::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: white;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

input[type='checkbox']:checked {
  background-color: #93c5fd;
  border-color: #60a5fa;
  position: relative;
}

input[type='checkbox']:checked::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: bold;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  line-height: 1;
}

input[type='radio']:focus,
input[type='checkbox']:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type='radio']:hover,
input[type='checkbox']:hover {
  border-color: #9ca3af;
}

.radio {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
}

input.submit,
input.button,
.butt {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  color: #374151;
  background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
  border: 1px #d1d5db solid;
  border-radius: 4px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  min-width: 140px;
  height: 30px;
  white-space: nowrap;
}

input.submit:hover,
input.button:hover,
.butt:hover {
  background: linear-gradient(to bottom, #e9ecef, #dee2e6);
  border-color: #9ca3af;
}

.butt_neutral {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  color: #6b7280;
  background: transparent;
  border: 1px #d1d5db solid;
  border-radius: 4px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  min-width: 140px;
  height: 30px;
  white-space: nowrap;
}

.butt_neutral:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #374151;
}

.butt_red {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  color: #b91c1c;
  background: linear-gradient(to bottom, #fef2f2, #fee2e2);
  border: 1px #f9a8a8 solid;
  border-radius: 4px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(185, 28, 28, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  min-width: 140px;
  height: 30px;
  white-space: nowrap;
}

.butt_red:hover {
  background: linear-gradient(to bottom, #fee2e2, #fecaca);
  border-color: #f87171;
}

.butt--ghost {
  background: transparent;
  color: var(--ink-600, #4b5563);
  border: 1px solid var(--ink-300, #d1d5db);
  box-shadow: none;
}

.butt--ghost:hover {
  background: var(--ink-50, #f9fafb);
  border-color: var(--ink-400, #9ca3af);
}

/* Grupa przycisków w kolumnie akcji */
.butt-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.butt--icon {
  min-width: 0;
  width: 30px;
  height: 30px;
  padding: 0;
}

/* Badge statusu sprawozdania */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  min-width: 155px;
  text-align: center;
}

.status-badge--draft {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.status-badge--pending {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.status-badge--approved {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.status-badge--error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  font-size: 12px;
  font-weight: 500;
}

.uid-badge {
  display: inline-block;
  min-width: 40px;
  text-align: center;
  background: var(--ink-100, #f3f4f6);
  color: var(--ink-500, #6b7280);
  font-size: 12px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--ink-200, #e5e7eb);
  margin-right: 6px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

/* Mini-tabelka danych kontaktowych w raporcie spływu */
.contact-table {
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.3;
}

.contact-table td {
  padding: 0 0 0 0;
  border: none !important;
  vertical-align: baseline;
}

.contact-label {
  color: var(--ink-400, #9ca3af);
  font-size: 12px;
  white-space: nowrap;
  padding-right: 8px !important;
  width: 1%;
}

.contact-table tr.contact-section-start td {
  padding-top: 4px;
}

.contact-ico {
  vertical-align: -1px;
  color: var(--ink-400, #9ca3af);
}

.unit-td {
  vertical-align: middle;
}

.unit-meta {
  margin-bottom: 2px;
}

.unit-regon {
  font-size: 12px;
  color: #9ca3af;
}

.unit-name {
  font-weight: 600;
}

.status-td {
  vertical-align: middle;
}

.status-date {
  font-size: 12px;
  color: var(--ink-400, #9ca3af);
  margin-top: auto;
  padding-top: 6px;
}

.status-notes {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #92400e;
  line-height: 1.3;
}

/* Linki z klasami przycisków */
a.butt,
a.butt_red,
a.butt_neutral,
a.butt--ghost {
  text-decoration: none !important;
  color: inherit;
}

a.butt:hover,
a.butt_red:hover,
a.butt_neutral:hover,
a.butt--ghost:hover {
  text-decoration: none !important;
  color: inherit;
}

.border {
  border: 1px #cccccc solid;
}

BODY {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  background-color: #fffef5;
  color: #374151;
  line-height: 1.6;
}

/* input type number no arrows */
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.summary {
  cursor: pointer;
  font-weight: 600;
  color: #dc2626;
  font-size: 16px;
}

/* container */
.container {
  height: 100vh;
  display: flex;
  justify-content: center;
  padding-top: 10px;
  box-sizing: border-box;
}

.content {
  width: auto;
  max-width: 100%;
  min-width: 100%;
}

@media (min-width: 1024px) {
  .content {
    min-width: 1024px;
  }
}

/* Dodatkowe style dla lepszej dostępności */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Delikatne ramki dla tabel formularzowych */
.form-table {
  border: 1px solid #e5e7eb;
  border-collapse: collapse;
}

.form-table td {
  border: 1px solid #f3f4f6;
}

/* Elastyczny kontener główny */
.main-container {
  transition: max-width 0.3s ease;
}

/* Responsywność formularza logowania */
@media (max-width: 900px) {
  /* Na małych ekranach panele po prawej stronie chowamy */
  .login-panels {
    display: none !important;
  }

  /* Upewniamy się, że kontener formularza nie powoduje poziomego przewijania */
  .login-container > div {
    flex-direction: column !important;
    align-items: center !important;
  }

  /* Wyśrodkowanie zawartości w module raportów */
  .content-area {
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important;
  }

  /* Responsywny nagłówek - zapobieganie poziomemu przewijaniu */
  body > table {
    width: 100% !important;
  }

  body > table td table {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Ukrywamy tło z obrazkiem na małych ekranach dla lepszej czytelności */
  body {
    background-image: none !important;
  }
}

@media (max-width: 400px) {
  /* Na bardzo małych ekranach zapobiegamy uciekaniu formularza w lewo */
  .login-container {
    justify-content: flex-start !important;
    padding: 10px !important;
  }

  .login-container > div {
    width: 100% !important;
    max-width: 100% !important;
  }

  .login-container > div > div {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

@media (max-height: 700px) {
  /* Przy niskim oknie zmniejszamy odstępy */
  .login-container {
    padding: 10px 0 !important;
  }
}

@media (max-height: 500px) {
  /* Przy bardzo niskim oknie dalej zmniejszamy odstępy */
  .login-container {
    padding: 5px 0 !important;
  }
}

/* Style dla input file - custom file upload button */
.file-input-wrapper {
  position: relative;
  display: inline-block;
}

.file-input-wrapper input[type='file'] {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.file-input-label {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  color: #374151;
  background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
  border: 1px #d1d5db solid;
  border-radius: 4px;
  /* padding: 4px 8px; */
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  min-width: 100px;
  height: 30px;
  white-space: nowrap;
  text-decoration: none;
}

.file-input-label:hover {
  background: linear-gradient(to bottom, #e9ecef, #dee2e6);
  border-color: #9ca3af;
  text-decoration: none;
}

.file-input-label:focus-within {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.file-selected {
  margin-left: 8px;
  font-size: 12px;
  color: #059669;
  font-weight: 500;
}

/* Slim Select styles for dictionary fields */
.ss-main {
  border: 1px #cccccc solid !important;
  border-radius: 0 !important; /* Usuń zaokrąglenia - jak zwykłe inputy */
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif !important;
  font-size: 14px !important;
  background-color: #fffef7 !important;
  color: #333300 !important;
  box-shadow: none !important;
  transition: border-color 0.2s ease-in-out !important;
  padding: 0 !important; /* Usuń domyślny padding */
  min-height: 23px !important;
}

/* Style dla głównego tekstu w Slim Select - upodobnienie do zwykłego selecta */
.ss-single {
  padding: 2px 6px !important; /* Minimalny padding jak w zwykłym select */
  line-height: 1.2 !important;
  font-size: 14px !important;
  color: #333300 !important;
}

.ss-single-selected {
  padding: 2px 6px !important;
  line-height: 1.2 !important;
  font-size: 14px !important;
  color: #333300 !important;
}

.ss-main:focus {
  border-color: #059669 !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1) !important;
}

/* Style dla elementów błędnych - czerwona ramka i wykrzyknik */
.dict-error .ss-main {
  border-color: #dc2626 !important;
  background-color: #fff3cd !important;
}

.dict-error .ss-main .ss-single,
.dict-error .ss-main .ss-single-selected,
.dict-error .ss-main .ss-placeholder,
.dict-error .ss-main .ss-values .ss-single {
  color: #dc2626 !important;
  font-weight: bold !important;
}

/* Specjalnie dla wykrzyknika w opcjach */
.ss-option[data-id*='popraw'] {
  color: #dc2626 !important;
  font-weight: bold !important;
}

/* Wykrzyknik w wybranej opcji */
option[style*='#fff3cd'] {
  color: #dc2626 !important;
}

/* Wykrzyknik w ss-single (główny wyświetlany tekst) */
.ss-single.has-error {
  color: #dc2626 !important;
  font-weight: bold !important;
}

/* Dropdown lista opcji */
.ss-content {
  border: 1px #cccccc solid !important;
  border-radius: 0 !important; /* Usuń zaokrąglenia - jak zwykłe inputy */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
  background-color: #fffef7 !important;
  min-width: max-content !important; /* Co najmniej szerokość najszerszej opcji */
  max-width: 1024px !important; /* Maksymalna szerokość dropdown */
}

.ss-option {
  padding: 8px 12px !important;
  font-size: 14px !important;
  color: #333300 !important;
  background-color: #fffef7 !important;
}

.ss-option:hover {
  background-color: #f3f4f6 !important;
}

.ss-option.ss-highlighted {
  background-color: #059669 !important;
  color: white !important;
}

/* Zaznaczona opcja - wyróżnienie */
.ss-option.ss-selected {
  background-color: #e0f2e7 !important; /* Jasny zielony tło */
  color: #065f46 !important; /* Ciemny zielony tekst */
  font-weight: bold !important;
}

/* Style dla wyszukiwania */
.ss-search input {
  border: 1px #cccccc solid !important;
  border-radius: 0 !important; /* Usuń zaokrąglenia - jak zwykłe inputy */
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont,
    sans-serif !important;
  font-size: 14px !important;
  background-color: #fffef7 !important;
  color: #333300 !important;
  padding: 6px 8px !important;
}

.ss-search input:focus {
  border-color: #059669 !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1) !important;
}

/* Style dla tooltipów weryfikacji */
.custom-tooltip {
  position: relative;
  display: inline-block;
}

.custom-tooltip .tooltip-text {
  visibility: hidden;
  background-color: #ffffff;
  color: #374151;
  text-align: center;
  border-radius: 6px;
  padding: 6px 10px;
  position: absolute;
  z-index: 1000;
  bottom: 125%;
  left: 50%;
  margin-left: -65px;
  font-size: 12px;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e7eb;
}

.custom-tooltip .tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #ffffff transparent transparent transparent;
}

.custom-tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Nowa funkcjonalność: Style dla read-only wartości [nn,nn,nn.d] */
/* .readonly-value i .readonly-empty są stylowane przez kontener nadrzędny */

/* ---------- UI Primitives ---------- */

/* ---------- Karta ---------- */
.ui-card {
  background: var(--surface);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  width: 100%;
  max-width: var(--container);
  margin: 16px auto;
  font-family: var(--font-sans);
  color: var(--ink-700);
  box-sizing: border-box;
}

.ui-card--wide {
  max-width: var(--container-wide);
}

.ui-card--flush {
  margin: 0;
}

.ui-card__header {
  background: linear-gradient(
    135deg,
    var(--brand-600) 0%,
    var(--brand-400) 100%
  );
  color: #ffffff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ui-card__title {
  font: 700 17px/1.3 var(--font-sans);
  margin: 0;
  letter-spacing: 0.3px;
  color: #ffffff;
}

.ui-card__subtitle {
  font: 500 15px/1.4 var(--font-sans);
  margin: 6px 0 0 0;
  color: var(--brand-100);
}

.ui-card__body {
  padding: 18px 20px;
  color: var(--ink-700);
  font-size: 14px;
  line-height: 1.6;
}

.ui-card__footer {
  padding: 12px 20px;
  background: var(--ink-50);
  border-top: 1px solid var(--ink-100);
}

/* Subtelny nagłówek sekcji wewnątrz .ui-card__body
   Używany dla kart drugorzędnych (pomoc, instrukcja), które nie
   potrzebują pełnego zielonego headera — tylko wyróżniony tytuł. */
.ui-section-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--ink-200);
}

.ui-section-header::before {
  content: '';
  display: block;
  width: 3px;
  align-self: stretch;
  background: var(--brand-500);
  border-radius: 2px;
  flex-shrink: 0;
}

.ui-section-header__text {
  flex: 1;
  min-width: 0;
}

.ui-section-header__title {
  font: 600 15px/1.3 var(--font-sans);
  margin: 0;
  color: var(--brand-700);
  letter-spacing: 0.2px;
}

.ui-section-header__subtitle {
  font: 400 12px/1.4 var(--font-sans);
  margin: 2px 0 0 0;
  color: var(--ink-500);
}

/* Wariant informacyjny (niebieski gradient) — dla sekcji pomocy */
.ui-card--info .ui-card__header {
  background: linear-gradient(
    135deg,
    var(--info-700) 0%,
    var(--info-600) 100%
  );
}
.ui-card--info .ui-card__subtitle {
  color: #e0f2fe;
}

/* Wariant archiwum (pomarańczowy gradient) */
.ui-card--archive .ui-card__header {
  background: linear-gradient(
    135deg,
    var(--archive-700) 0%,
    var(--archive-600) 100%
  );
}
.ui-card--archive .ui-card__subtitle {
  color: var(--archive-50);
}

/* ---------- Przyciski ---------- */
.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  font: 500 14px/1 var(--font-sans);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
  box-sizing: border-box;
}

.ui-btn:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

.ui-btn--primary {
  background: var(--brand-600);
  color: #ffffff;
  border-color: var(--brand-600);
}
.ui-btn--primary:hover {
  background: var(--brand-700);
  border-color: var(--brand-700);
  color: #ffffff;
  text-decoration: none;
}

.ui-btn--secondary {
  background: #ffffff;
  color: var(--brand-700);
  border-color: var(--brand-600);
}
.ui-btn--secondary:hover {
  background: var(--brand-50);
  color: var(--brand-700);
  text-decoration: none;
}

.ui-btn--ghost {
  background: #ffffff;
  color: var(--ink-700);
  border-color: var(--ink-300);
}
.ui-btn--ghost:hover {
  background: var(--ink-50);
  border-color: var(--ink-500);
  color: var(--ink-900);
  text-decoration: none;
}

.ui-btn--danger {
  background: #ffffff;
  color: var(--danger-600);
  border-color: var(--danger-600);
}
.ui-btn--danger:hover {
  background: var(--danger-50);
  color: var(--danger-700);
  border-color: var(--danger-700);
  text-decoration: none;
}

.ui-btn--sm {
  height: 30px;
  padding: 0 12px;
  font-size: 13px;
}

.ui-btn--lg {
  height: 42px;
  padding: 0 20px;
  font-size: 15px;
}

/* Linki z klasami przycisków */
a.ui-btn,
a.ui-btn:hover {
  text-decoration: none !important;
}

/* ---------- Grupa akcji (stopka karty) ---------- */
.ui-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 12px 0 4px;
}

.ui-actions--end {
  justify-content: flex-end;
}

.ui-actions--split {
  justify-content: space-between;
}

/* ---------- Powiadomienia (alerty) ---------- */
.ui-notice {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: 400 13px/1.5 var(--font-sans);
  align-items: flex-start;
}

.ui-notice__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.ui-notice__title {
  font-weight: 700;
  font-size: 14px;
  margin: 0 0 4px 0;
}

.ui-notice--warn {
  background: var(--warn-50);
  border-color: var(--warn-500);
  color: #78350f;
}
.ui-notice--warn .ui-notice__icon {
  fill: var(--warn-600);
}

.ui-notice--info {
  background: var(--info-50);
  border-color: var(--info-500);
  color: #0c4a6e;
}
.ui-notice--info .ui-notice__icon {
  fill: var(--info-600);
}

.ui-notice--danger {
  background: var(--danger-50);
  border-color: var(--danger-500);
  color: #7f1d1d;
}
.ui-notice--danger .ui-notice__icon {
  fill: var(--danger-600);
}

.ui-notice--success {
  background: var(--brand-50);
  border-color: var(--brand-500);
  color: var(--brand-700);
}
.ui-notice--success .ui-notice__icon {
  fill: var(--brand-600);
}

/* ---------- Chipy / pill-linki (Wzór formularza, klauzule itp.) ---------- */
.ui-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid var(--brand-100);
  font: 500 13px var(--font-sans);
  text-decoration: none;
  transition: all 0.15s ease;
}
.ui-chip:hover {
  background: var(--brand-100);
  color: var(--brand-700);
  text-decoration: none;
}

.ui-chip--info {
  background: var(--info-50);
  color: var(--info-700);
  border-color: #bae6fd;
}
.ui-chip--info:hover {
  background: #bae6fd;
  color: var(--info-700);
}

.ui-chip-rodo {
  display: inline-block;
  background: #dbeafe;
  color: #1e40af;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 5px;
  vertical-align: 1px;
  letter-spacing: 0.5px;
  line-height: 1;
}

/* ---------- Siatka formularza etykieta : kontrolka ---------- */
.ui-form {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 12px 16px;
  align-items: center;
  max-width: 520px;
  margin: 0 auto;
}

/* Zapobiega overflow kontrolek szerszych niż kolumna */
.ui-form > * {
  min-width: 0;
}

.ui-form > label,
.ui-form .ui-form__label {
  font-weight: 600;
  color: var(--ink-700);
  font-size: 14px;
}

/* Kontrolki rozciągają się do szerokości kolumny */
.ui-form select,
.ui-form input[type='text'],
.ui-form input[type='number'],
.ui-form input[type='email'],
.ui-form input[type='password'] {
  max-width: 100%;
  box-sizing: border-box;
}

.ui-form__full {
  grid-column: 1 / -1;
}

/* ---------- Tabela danych ---------- */
.ui-table {
  width: 100%;
  border-collapse: collapse;
  font: 14px/1.5 var(--font-sans);
  background: transparent;
}

.ui-table th {
  background: var(--brand-50);
  color: var(--brand-700);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--brand-100);
  white-space: nowrap;
}

.ui-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--ink-300);
  color: var(--ink-700);
}

.ui-table tbody tr:hover td {
  background: var(--ink-50);
}

.ui-table tbody tr:last-child td {
  border-bottom: none;
}

/* Wariant z ramką zewnętrzną */
.ui-table--bordered {
  border: 1px solid var(--ink-300);
}

.ui-table--bordered th {
  border-bottom: 2px solid var(--brand-100);
  border-right: 1px solid var(--ink-200);
}

.ui-table--bordered th:last-child {
  border-right: none;
}

.ui-table--bordered td {
  border-right: 1px solid var(--ink-200);
}

.ui-table--bordered td:last-child {
  border-right: none;
}

/* Optymalizacja renderowania dużych tabel — przeglądarka pomija wiersze poza viewportem */
.ui-table--bordered tbody tr {
  content-visibility: auto;
  contain-intrinsic-size: auto 60px;
}

/* ---------- Topbar ---------- */
.topbar-card {
  max-width: var(--container-wide);
  margin: 12px auto;
  background: var(--surface);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  font-family: var(--font-sans);
  box-sizing: border-box;
}

.topbar-card__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 20px;
  align-items: center;
}

.topbar-card__firm-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-900);
  margin: 0 0 6px 0;
}

.topbar-card__firm-info {
  color: var(--ink-500);
  font-size: 13px;
  line-height: 1.5;
}

.topbar-card__contact-label {
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 4px;
  font-size: 13px;
}

.topbar-card__contact-data {
  font-size: 13px;
  color: var(--ink-700);
  line-height: 1.6;
}

.topbar-card__contact-data a {
  color: var(--brand-600);
  font-weight: 600;
}

.topbar-card__actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-card__actions-separator {
  width: 1px;
  height: 28px;
  background: var(--ink-200);
  margin: 0 4px;
}

/* Responsywność topbaru */
@media (max-width: 900px) {
  .topbar-card__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .topbar-card__actions {
    justify-content: flex-start;
  }

  .ui-card {
    max-width: 100%;
    margin: 12px;
  }
}

/* ---------- Kod / code-block w instrukcjach ---------- */
.ui-code {
  background: var(--ink-100);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: 'Courier New', Consolas, monospace;
  font-size: 13px;
  color: var(--ink-900);
}

.ui-code-block {
  display: block;
  background: var(--brand-50);
  color: var(--brand-700);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand-100);
  font-family: 'Courier New', Consolas, monospace;
  font-size: 14px;
  font-weight: 600;
  white-space: pre-line;
  margin: 8px 0;
}
