/* ==========================================================================
   app.css - komponenty wspólne dla formularza publicznego i panelu admina.
   Tailwind (CDN) odpowiada za layout i typografię; tutaj są zamknięte,
   reużywalne komponenty (karty, przyciski, badge, tabele, modale, toasty).
   ========================================================================== */

:root {
  /* Paleta DRAGPACK (jak na dragpack.pl): granat slate + niebieski akcent.
     Złoto zostaje wyłącznie jako znaczenie "Premium / SLA" na etykietach. */
  --ab-brand-900: #0f172a;
  --ab-brand-800: #16233b;
  --ab-brand-700: #1d4ed8;
  --ab-brand-600: #2563eb;
  --ab-brand-500: #3b82f6;
  --ab-gold-500: #d4a017;
  --ab-gold-100: #f9efcb;
  --ab-slate-50: #f8fafc;
  --ab-slate-200: #e2e8f0;
  --ab-slate-400: #94a3b8;
  --ab-slate-600: #475569;
  --ab-slate-800: #1e293b;
  --ab-radius: 14px;
  --ab-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px -12px rgba(15, 23, 42, 0.18);
}

* {
  -webkit-tap-highlight-color: transparent;
}

/* Fallback, gdy Tailwind CDN jest niedostępny (offline): klasa .hidden musi
   nadal ukrywać elementy. Bez !important, aby nie blokować `sm:inline` itp. */
.hidden {
  display: none;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--ab-slate-50);
  border: 1px solid var(--ab-slate-200);
  border-radius: 6px;
  padding: 0.05rem 0.3rem;
}

/* ------------------------------------------------------- PASEK BŁĘDÓW */

.ab-errorbar {
  position: relative;
  z-index: 100;
  background: #7f1d1d;
  color: #fef2f2;
  border-bottom: 3px solid #fca5a5;
  padding: 0.85rem 1.25rem;
  font-size: 0.82rem;
  line-height: 1.5;
  word-break: break-word;
}

.ab-errorbar__hint {
  display: inline-block;
  margin-top: 0.35rem;
  color: #fecaca;
  font-size: 0.78rem;
}

/* ------------------------------------------------------------------ HEADER */

.ab-header {
  background: linear-gradient(135deg, #0b1220 0%, #0f172a 55%, #16233b 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.ab-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ab-brand-600), var(--ab-brand-500));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px -6px rgba(37, 99, 235, 0.75);
}

.ab-logo--lg {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 1.15rem;
}

/* -------------------------------------------------------------------- KARTY */

.ab-card {
  background: #fff;
  border: 1px solid var(--ab-slate-200);
  border-radius: var(--ab-radius);
  box-shadow: var(--ab-shadow);
  padding: 1.5rem;
}

.ab-card--info {
  background: linear-gradient(180deg, #fbfdff, #f4f8fd);
}

.ab-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ab-slate-800);
}

.ab-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
  color: var(--ab-slate-600);
}

.ab-list li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.6rem;
  line-height: 1.45;
}

.ab-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--ab-gold-500);
}

.ab-grid {
  display: grid;
  gap: 1.25rem;
}

.ab-grid--2 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.ab-grid--4 {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .ab-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .ab-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ab-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------- FORMULARZE */

.ab-fieldset {
  border: 0;
  padding: 0 0 1.75rem;
  margin: 0 0 1.75rem;
  border-bottom: 1px dashed var(--ab-slate-200);
}

.ab-fieldset--last {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.ab-legend {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ab-slate-800);
  padding: 0;
  margin-bottom: 1.1rem;
  width: 100%;
}

.ab-legend__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--ab-brand-700);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
}

.ab-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ab-slate-600);
  margin-bottom: 0.35rem;
}

.ab-req {
  color: #dc2626;
  font-weight: 700;
}

.ab-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  color: var(--ab-slate-800);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.ab-input--sm {
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
}

textarea.ab-input {
  resize: vertical;
  min-height: 120px;
}

.ab-input:focus {
  outline: none;
  border-color: var(--ab-brand-500);
  box-shadow: 0 0 0 3px rgba(60, 109, 165, 0.18);
}

.ab-input:disabled {
  background: var(--ab-slate-50);
  color: var(--ab-slate-400);
  cursor: not-allowed;
}

.ab-input.ab-invalid,
.ab-invalid {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important;
}

.ab-field-error .ab-label {
  color: #b91c1c;
}

.ab-error {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: #b91c1c;
}

.ab-nip--premium {
  border-color: var(--ab-gold-500);
  background: #fffdf5;
}

.ab-nip--standard {
  border-color: #94a3b8;
  background: #fbfdff;
}

.ab-nip--unknown {
  border-color: var(--ab-brand-400, #5e8cbf);
  background: #f7faff;
}

.ab-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.ab-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 0.15rem;
  accent-color: var(--ab-brand-600);
  flex: none;
}

/* -------------------------------------------------------------- PRZYCISKI */

.ab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.6rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.ab-btn:active {
  transform: translateY(1px);
}

.ab-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ab-btn--primary {
  background: linear-gradient(135deg, var(--ab-brand-600), var(--ab-brand-700));
  color: #fff;
  box-shadow: 0 8px 20px -10px rgba(38, 69, 108, 0.9);
}

.ab-btn--primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--ab-brand-500), var(--ab-brand-600));
}

.ab-btn--ghost {
  background: #fff;
  border-color: #cbd5e1;
  color: var(--ab-slate-600);
}

.ab-btn--ghost:hover:not(:disabled) {
  background: var(--ab-slate-50);
  border-color: var(--ab-slate-400);
}

.ab-btn--ghost-light {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.ab-btn--ghost-light:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ab-btn--ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.ab-btn--warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

.ab-btn--danger {
  background: #dc2626;
  color: #fff;
}

.ab-btn--danger:hover:not(:disabled) {
  background: #b91c1c;
}

.ab-btn--danger-ghost {
  background: #fff;
  border-color: #fecaca;
  color: #b91c1c;
}

.ab-btn--danger-ghost:hover:not(:disabled) {
  background: #fef2f2;
}

.ab-btn--sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.79rem;
  border-radius: 8px;
}

.ab-btn--lg {
  padding: 0.8rem 1.6rem;
  font-size: 0.95rem;
}

.ab-btn--block {
  width: 100%;
}

.ab-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.ab-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--ab-slate-200);
  background: #fff;
  color: var(--ab-slate-600);
  cursor: pointer;
}

.ab-icon-btn:hover {
  background: var(--ab-slate-50);
}

.ab-link {
  color: var(--ab-brand-600);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-size: inherit;
}

.ab-link:hover {
  color: var(--ab-brand-800);
}

/* ----------------------------------------------------------------- BADGE */

.ab-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.ab-badge--ok {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.ab-badge--info {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.ab-badge--warn {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.ab-badge--danger {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.ab-badge--gold {
  background: linear-gradient(135deg, #fdf3d3, #f9e6ae);
  color: #8a6109;
  border-color: #ecc45c;
}

.ab-badge--slate {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

.ab-badge--brand {
  background: #eff6ff;
  color: var(--ab-brand-700);
  border-color: #c7dbf0;
}

/* --------------------------------------------------------- BANER STATUSU SLA */

.ab-sla-banner {
  border-radius: 12px;
  border: 1px solid var(--ab-slate-200);
  background: var(--ab-slate-50);
  padding: 0.85rem 1rem;
}

.ab-sla-banner__title {
  font-size: 0.86rem;
  font-weight: 700;
}

.ab-sla-banner__sub {
  margin-top: 0.2rem;
  font-size: 0.79rem;
  line-height: 1.45;
  color: var(--ab-slate-600);
}

.ab-sla-banner--gold {
  background: linear-gradient(135deg, #fffaf0, #fdf3d7);
  border-color: #ecc45c;
  box-shadow: 0 6px 18px -12px rgba(212, 160, 23, 0.9);
}

.ab-sla-banner--gold .ab-sla-banner__title {
  color: #8a6109;
}

.ab-sla-banner--slate {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.ab-sla-banner--slate .ab-sla-banner__title {
  color: #334155;
}

.ab-sla-banner--brand {
  background: #f5f9ff;
  border-color: #c7dbf0;
}

.ab-sla-banner--brand .ab-sla-banner__title {
  color: var(--ab-brand-700);
}

.ab-sla-banner--warn {
  background: #fffbeb;
  border-color: #fde68a;
}

.ab-sla-banner--warn .ab-sla-banner__title {
  color: #b45309;
}

.ab-sla-banner--neutral .ab-sla-banner__sub {
  color: var(--ab-slate-400);
}

/* ----------------------------------------------------------------- ALERTY */

.ab-alert {
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.83rem;
  line-height: 1.5;
  border: 1px solid transparent;
}

.ab-alert--warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.ab-alert--info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

/* ------------------------------------------------------- ZAŁĄCZNIKI (FORMULARZ) */

.ab-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: #fbfdff;
  padding: 1.15rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ab-dropzone:hover,
.ab-dropzone:focus {
  border-color: var(--ab-brand-500);
  background: #f5f9ff;
  outline: none;
}

.ab-dropzone.is-dragover {
  border-color: var(--ab-gold-500);
  background: #fffaf0;
}

.ab-dropzone__icon {
  width: 34px;
  height: 34px;
  margin: 0 auto;
  color: var(--ab-brand-500);
}

.ab-dropzone__title {
  margin-top: 0.45rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ab-slate-800);
}

.ab-dropzone__text {
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: var(--ab-slate-600);
}

.ab-dropzone__hint {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--ab-slate-400);
}

.ab-dropzone__counter {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ab-brand-700);
}

.ab-photos {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
}

.ab-photo {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--ab-slate-200);
  border-radius: 10px;
  background: #fff;
  padding: 0.5rem;
}

.ab-photo__thumb {
  width: 54px;
  height: 54px;
  flex: none;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--ab-slate-200);
}

.ab-photo__meta {
  min-width: 0;
}

.ab-photo__name {
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--ab-slate-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 125px;
}

.ab-photo__size {
  font-size: 0.71rem;
  color: var(--ab-slate-400);
}

.ab-photo__saved {
  color: #047857;
  font-weight: 600;
}

.ab-photo__remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid #fecaca;
  background: #fff;
  color: #b91c1c;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}

.ab-photo__remove:hover {
  background: #fef2f2;
}

/* ------------------------------------------------------- GALERIA (PANEL) */

.ab-gallery {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.ab-gallery__item {
  border: 1px solid var(--ab-slate-200);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.ab-gallery__img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
  cursor: zoom-in;
  background: var(--ab-slate-50);
}

.ab-gallery__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.7rem;
  color: var(--ab-slate-400);
}

.ab-gallery__del {
  border: 0;
  background: none;
  padding: 0;
  color: #b91c1c;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

.ab-gallery__del:hover {
  text-decoration: underline;
}

.ab-viewer {
  text-align: center;
}

.ab-viewer__img {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
}

.ab-viewer__meta {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--ab-slate-400);
}

/* Ostrzeżenie o braku trwałego zapisu - nad treścią modułu */
.ab-notice {
  margin: 1rem 1.25rem 0;
  line-height: 1.55;
}

@media (min-width: 1024px) {
  .ab-notice {
    margin: 1.25rem 2.5rem 0;
  }
}

/* Sekcja "dodaj firmę do bazy klientów" w szczegółach zgłoszenia */
.ab-convert {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px dashed #c7dbf0;
  border-radius: 12px;
  background: #f8fbff;
}

/* ---------------------------------------------------------------- TABELE */

.ab-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.ab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.ab-th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ab-slate-400);
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--ab-slate-200);
  white-space: nowrap;
}

.ab-th--right {
  text-align: right;
}

.ab-td {
  padding: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: var(--ab-slate-800);
}

.ab-td--mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

.ab-td--muted {
  color: var(--ab-slate-400);
  font-size: 0.8rem;
}

.ab-td--right {
  text-align: right;
}

.ab-td--empty {
  text-align: center;
  color: var(--ab-slate-400);
  padding: 2rem 1rem;
}

.ab-td__sub {
  font-size: 0.75rem;
  color: var(--ab-slate-400);
}

.ab-table tbody tr:hover {
  background: #fbfdff;
}

.ab-table tbody tr.is-editing {
  background: #fffaf0;
  box-shadow: inset 3px 0 0 var(--ab-gold-500);
}

/* ---------------------------------------------------------------- KAFLI */

.ab-tile {
  border-radius: var(--ab-radius);
  border: 1px solid var(--ab-slate-200);
  background: #fff;
  padding: 1.1rem 1.25rem;
  box-shadow: var(--ab-shadow);
}

.ab-tile__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ab-slate-400);
}

.ab-tile__value {
  margin-top: 0.35rem;
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ab-slate-800);
}

.ab-tile__hint {
  margin-top: 0.35rem;
  font-size: 0.76rem;
  color: var(--ab-slate-400);
}

.ab-tile--brand {
  border-left: 4px solid var(--ab-brand-600);
}

.ab-tile--gold {
  border-left: 4px solid var(--ab-gold-500);
}

.ab-tile--warn {
  border-left: 4px solid #f59e0b;
}

.ab-tile--slate {
  border-left: 4px solid #94a3b8;
}

.ab-bars__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--ab-slate-600);
}

.ab-bars__track {
  margin-top: 0.35rem;
  height: 8px;
  border-radius: 999px;
  background: #f1f5f9;
  overflow: hidden;
}

.ab-bars__fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.ab-bars__fill--gold {
  background: linear-gradient(90deg, var(--ab-gold-500), #ecc45c);
}

.ab-bars__fill--slate {
  background: linear-gradient(90deg, #94a3b8, #cbd5e1);
}

/* ------------------------------------------------------- PANEL ADMINA: SHELL */

.ab-shell {
  display: flex;
  min-height: 100vh;
}

.ab-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: 262px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0b1220, #101a2e);
  color: #fff;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
}

.ab-sidebar.is-open {
  transform: translateX(0);
}

.ab-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(15, 23, 42, 0.45);
}

.ab-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.1rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ab-sidebar__footer {
  margin-top: auto;
  padding: 1rem 1.15rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.6;
}

.ab-nav {
  padding: 0.85rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.ab-nav__item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.ab-nav__item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.ab-nav__item.is-active {
  background: rgba(37, 99, 235, 0.22);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--ab-brand-500);
}

.ab-nav__icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.ab-nav__label {
  flex: 1;
  min-width: 0;
}

.ab-nav__badge {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
}

.ab-shell__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ab-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ab-slate-200);
}

.ab-content {
  padding: 1.5rem 1.25rem 3rem;
}

@media (min-width: 1024px) {
  .ab-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    transform: none;
  }
  .ab-sidebar-backdrop {
    display: none;
  }
  .ab-content {
    padding: 2rem 2.5rem 4rem;
  }
}

.ab-icon {
  width: 20px;
  height: 20px;
}

/* ------------------------------------------------------------- LOGOWANIE */

.ab-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(1200px 500px at 50% -10%, #1e40af 0%, #0f172a 55%, #070c16 100%);
}

.ab-gate__card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 18px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 30px 60px -25px rgba(2, 8, 20, 0.7);
  animation: ab-fade-up 0.35s ease both;
}

/* ----------------------------------------------------------------- OKNO */

.ab-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0;
  transition: opacity 0.18s ease;
  overflow-y: auto;
}

.ab-modal-backdrop.is-visible {
  opacity: 1;
}

.ab-modal {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 30px 60px -20px rgba(2, 8, 20, 0.6);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.2s ease;
}

.ab-modal--wide {
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
}

.ab-modal-backdrop.is-visible .ab-modal {
  transform: translateY(0) scale(1);
}

.ab-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ab-modal__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ab-slate-800);
}

.ab-modal__text {
  margin-top: 0.6rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ab-slate-600);
}

.ab-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.ab-modal__close {
  border: 0;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ab-slate-400);
  cursor: pointer;
}

.ab-modal__close:hover {
  color: var(--ab-slate-800);
}

.ab-detail__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.86rem;
}

.ab-detail__row span {
  color: var(--ab-slate-400);
}

.ab-detail__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ab-slate-400);
}

.ab-detail__desc {
  margin-top: 0.4rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ab-slate-800);
  background: var(--ab-slate-50);
  border: 1px solid var(--ab-slate-200);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  white-space: pre-wrap;
}

.ab-timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.25rem;
}

.ab-timeline__item {
  position: relative;
  padding: 0 0 0.9rem 1.4rem;
  font-size: 0.84rem;
  color: var(--ab-slate-600);
}

.ab-timeline__item::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.85rem;
  bottom: 0;
  width: 1px;
  background: var(--ab-slate-200);
}

.ab-timeline__item:last-child::before {
  display: none;
}

.ab-timeline__dot {
  position: absolute;
  left: 0;
  top: 0.3rem;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--ab-brand-500);
  box-shadow: 0 0 0 3px rgba(60, 109, 165, 0.15);
}

/* -------------------------------------------------------------- POTWIERDZENIE */

.ab-success__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 999px;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.ab-success__icon svg {
  width: 26px;
  height: 26px;
}

.ab-ref {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ab-brand-800);
  background: var(--ab-slate-50);
  border: 1px dashed var(--ab-brand-300, #93b4d8);
  border-radius: 10px;
  padding: 0.4rem 0.9rem;
}

.ab-success__meta {
  display: grid;
  gap: 0.1rem;
}

.ab-success__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.86rem;
}

.ab-success__row span {
  color: var(--ab-slate-400);
}

.ab-success__row strong {
  text-align: right;
  color: var(--ab-slate-800);
  font-weight: 600;
}

/* ----------------------------------------------------------------- TOASTY */

.ab-toast-root {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: min(92vw, 380px);
}

.ab-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: #fff;
  border: 1px solid var(--ab-slate-200);
  border-left-width: 4px;
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  box-shadow: 0 20px 40px -20px rgba(2, 8, 20, 0.45);
  font-size: 0.85rem;
  color: var(--ab-slate-800);
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ab-toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.ab-toast--success {
  border-left-color: #059669;
}

.ab-toast--error {
  border-left-color: #dc2626;
}

.ab-toast--warning {
  border-left-color: #f59e0b;
}

.ab-toast--info {
  border-left-color: var(--ab-brand-500);
}

.ab-toast__icon {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
}

.ab-toast--success .ab-toast__icon {
  color: #059669;
}

.ab-toast--error .ab-toast__icon {
  color: #dc2626;
}

.ab-toast--warning .ab-toast__icon {
  color: #f59e0b;
}

.ab-toast--info .ab-toast__icon {
  color: var(--ab-brand-500);
}

.ab-toast__body {
  flex: 1;
  line-height: 1.45;
}

.ab-toast__close {
  border: 0;
  background: none;
  color: var(--ab-slate-400);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
}

/* --------------------------------------------------------------- SPINNER */

.ab-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: currentColor;
  animation: ab-spin 0.7s linear infinite;
}

.ab-btn--ghost .ab-spinner,
.ab-btn--ghost-light .ab-spinner {
  border-color: rgba(30, 41, 59, 0.25);
  border-top-color: currentColor;
}

/* ------------------------------------------------------------- ANIMACJE */

@keyframes ab-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes ab-fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ab-fade-in {
  animation: ab-fade-up 0.25s ease both;
}

@media print {
  .ab-sidebar,
  .ab-topbar,
  .ab-toast-root,
  .ab-header nav {
    display: none !important;
  }
}

/* Znacznik liczby załączników w tabeli zgłoszeń */
.ab-attach {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ab-brand-700);
}

.ab-attach__icon {
  width: 14px;
  height: 14px;
}

.ab-bars__fill--danger {
  background: linear-gradient(90deg, #dc2626, #f87171);
}

.ab-alert--ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.ab-upload-box {
  margin-top: 1.25rem;
}

.ab-alert--danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
