/* Shared, non-invasive UI baseline */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.9);
  outline-offset: 2px;
}

/* Shared visual tokens and core components */
:root {
  --ui-bg-glass: rgba(15, 23, 42, 0.72);
  --ui-border-soft: rgba(255, 255, 255, 0.1);
  --ui-border-strong: rgba(255, 255, 255, 0.16);
  --ui-radius-xl: 22px;
  --ui-radius-lg: 18px;
  --ui-radius-md: 14px;
  --ui-shadow-lg: 0 16px 44px rgba(0, 0, 0, 0.24);
  --ui-shadow-md: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.ui-topbar,
.topbar.ui-topbar,
.ui-panel-card,
.panel-card.ui-panel-card,
.file-card.ui-panel-card {
  background: var(--ui-bg-glass);
  border: 1px solid var(--ui-border-soft);
  backdrop-filter: blur(16px);
  box-shadow: var(--ui-shadow-lg);
}

.ui-topbar,
.topbar.ui-topbar {
  border-radius: var(--ui-radius-lg);
}

.ui-panel-card,
.panel-card.ui-panel-card,
.file-card.ui-panel-card {
  border-radius: var(--ui-radius-xl);
}

.ui-back-btn,
.btn-back.ui-back-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--ui-radius-md);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  transition: 0.18s ease;
  flex: 0 0 auto;
}

.ui-back-btn:hover,
.btn-back.ui-back-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.ui-pill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.28rem 0.68rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid var(--ui-border-strong);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
}

.ui-action-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  transition: 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.ui-action-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  transform: translateY(-1px);
}

.ui-modal-surface,
.modal-content.ui-modal-surface {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--ui-border-soft);
  border-radius: var(--ui-radius-xl);
  color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.35);
}

.ui-table-wrap,
.table-wrap.ui-table-wrap {
  width: 100%;
  background: var(--ui-bg-glass);
  border: 1px solid var(--ui-border-soft);
  border-radius: var(--ui-radius-xl);
  overflow: auto;
  box-shadow: var(--ui-shadow-lg);
}

.ui-table-modern,
.table-modern.ui-table-modern {
  margin: 0;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

/* Shared admin UI */
.admin-topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 18px;
  background: var(--card, rgba(15, 23, 42, 0.72));
  border: 1px solid var(--gold-border, rgba(245, 158, 11, 0.24));
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  position: relative;
  flex-wrap: wrap;
}

.admin-topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--gold-glass, transparent);
  pointer-events: none;
  z-index: 0;
}

.admin-topbar > * {
  position: relative;
  z-index: 1;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: var(--gold-subtle, rgba(245, 158, 11, 0.12));
  border: 1px solid var(--gold-border, rgba(245, 158, 11, 0.24));
  color: var(--gold-text, #fde68a);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
}

.admin-actions-label {
  color: var(--gold-text-dim, rgba(253, 230, 138, 0.52));
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-right: 0.15rem;
}

.topbar-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.85rem;
  width: 100%;
  margin-top: 1rem;
}

.admin-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 100px;
  padding: 16px 12px;
  border-radius: 16px;
  border: 1px solid rgba(245, 158, 11, 0.24);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(217, 119, 6, 0.08));
  color: var(--gold-text, #fde68a);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.08);
  transition: 0.18s cubic-bezier(.34,.1,.68,.55);
  cursor: pointer;
}

.admin-action-btn:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(217, 119, 6, 0.14));
  border-color: rgba(245, 158, 11, 0.32);
  color: #fef3c7;
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.15);
}

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

.admin-action-btn i {
  font-size: 1.5rem;
}

.admin-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: var(--gold-glass, rgba(245, 158, 11, 0.08));
  border: 1px solid var(--gold-border, rgba(245, 158, 11, 0.24));
  color: var(--gold-text-dim, rgba(253, 230, 138, 0.52));
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  backdrop-filter: blur(16px);
  transition: 0.18s ease;
  cursor: pointer;
}

.admin-login-btn:hover {
  background: var(--gold-subtle, rgba(245, 158, 11, 0.12));
  color: var(--gold-text, #fde68a);
}

.btn-admin-ui {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.3rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--gold-border, rgba(245, 158, 11, 0.24));
  background: var(--gold-subtle, rgba(245, 158, 11, 0.12));
  color: var(--gold-text, #fde68a);
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 700;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.08);
  transition: 0.18s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn-add-vehicle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.3rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--gold-border, rgba(245, 158, 11, 0.24));
  background: var(--gold-subtle, rgba(245, 158, 11, 0.12));
  color: var(--gold-text, #fde68a);
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 700;
  backdrop-filter: blur(16px);
  transition: 0.18s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn-admin-ui:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(217, 119, 6, 0.14));
  border-color: rgba(245, 158, 11, 0.32);
  color: #fef3c7;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.10);
}

.btn-admin-ui.danger,
.admin-btn.danger {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
}

.btn-admin-ui.danger:hover,
.admin-btn.danger:hover {
  background: rgba(248, 113, 113, 0.22);
  color: #f87171;
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.16);
}

.btn-add-vehicle:hover {
  background: rgba(245, 158, 11, 0.20);
  color: var(--gold-text, #fde68a);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.10);
}

/* ==========================================================================
   .ui-current-file — card z obecnym plikiem (np. PDF umowy, upoważnienia)
   w modalach edycji. Zastępuje default Bootstrap link + checkbox styling.
   ========================================================================== */
.ui-current-file {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  font-size: 0.84rem;
}

.ui-current-file-label {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.ui-current-file-link {
  color: rgba(253, 230, 138, 0.92);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  word-break: break-all;
}

.ui-current-file-link:hover {
  color: #fde68a;
  text-decoration: underline;
}

.ui-current-file-link i {
  color: rgba(252, 211, 77, 0.85);
}

.ui-current-file-remove {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-size: 0.78rem;
  color: rgba(248, 113, 113, 0.88);
  user-select: none;
}

.ui-current-file-remove input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: rgba(248, 113, 113, 0.75);
  cursor: pointer;
}

.btn-add-vehicle:active {
  transform: translateY(0);
}

.btn-admin-ui:active {
  transform: translateY(0);
}

.admin-login-modal .modal-content {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(245, 158, 11, 0.24);
  border-radius: 22px;
}

.admin-login-modal .modal-header {
  border-bottom: 1px solid rgba(245, 158, 11, 0.16);
}

.admin-login-modal .modal-footer {
  border-top: 1px solid rgba(245, 158, 11, 0.16);
}

.modal-admin .modal-dialog {
  max-width: 520px;
}

.modal-admin .modal-content {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--gold-border, rgba(245, 158, 11, 0.24));
  border-radius: 22px;
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.36), 0 0 0 1px var(--gold-glass, rgba(245, 158, 11, 0.08));
  color: rgba(255, 255, 255, 0.95);
}

.modal-admin .modal-header {
  background: var(--gold-glass, rgba(245, 158, 11, 0.08));
  border-bottom: 1px solid var(--gold-border, rgba(245, 158, 11, 0.24));
  padding: 16px 18px;
}

.modal-admin .modal-body {
  padding: 20px 22px;
}

.modal-admin .modal-footer {
  background: var(--gold-glass, rgba(245, 158, 11, 0.08));
  border-top: 1px solid var(--gold-border, rgba(245, 158, 11, 0.24));
  padding: 14px 18px 16px;
}

.modal-admin .modal-title {
  font-weight: 800;
  font-size: 1.04rem;
  color: var(--gold-text, #fde68a);
  letter-spacing: -0.01em;
}

.modal-admin .form-control,
.modal-admin select.form-select {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--gold-border, rgba(245, 158, 11, 0.24)) !important;
  color: rgba(255, 255, 255, 0.95) !important;
  border-radius: 14px !important;
  font-weight: 600;
  font-size: 0.94rem;
}

.modal-admin .form-control:focus,
.modal-admin select.form-select:focus {
  border-color: rgba(245, 158, 11, 0.38) !important;
  box-shadow: 0 0 0 0.18rem var(--gold-glow, rgba(245, 158, 11, 0.12)) !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

.modal-admin .form-control::placeholder {
  color: rgba(253, 230, 138, 0.3);
}

.modal-admin label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-text-dim, rgba(253, 230, 138, 0.52));
  margin-bottom: 8px;
}

.admin-modal-idx input[type="password"] {
  font-size: 1.3rem;
  letter-spacing: 0.4em;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, monospace;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--gold-border, rgba(245, 158, 11, 0.24)) !important;
  border-radius: 18px !important;
  padding: 16px 14px !important;
  color: var(--gold-text, #fde68a) !important;
}

.admin-modal-idx input[type="password"]:focus {
  border-color: rgba(245, 158, 11, 0.38) !important;
  box-shadow: 0 0 0 0.18rem var(--gold-glow, rgba(245, 158, 11, 0.12)) !important;
}

.admin-modal-idx input[type="password"]::placeholder {
  letter-spacing: 0.2em;
  color: var(--gold-text-dim, rgba(253, 230, 138, 0.52));
}

.modal-status {
  font-size: 0.84rem;
  font-weight: 700;
  min-height: 1.2em;
  margin-top: 12px;
}

.modal-status.ok {
  color: #86efac;
}

.modal-status.err {
  color: #fca5a5;
}

.admin-login-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-modal-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text, #e8edf5);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
  transition: 0.18s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn-modal-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-modal-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--gold-border, rgba(245, 158, 11, 0.24));
  background: var(--gold-subtle, rgba(245, 158, 11, 0.12));
  color: var(--gold-text, #fde68a);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.08);
  transition: 0.18s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn-modal-save:hover {
  background: rgba(245, 158, 11, 0.20);
  border-color: rgba(245, 158, 11, 0.32);
  color: #fef3c7;
  transform: translateY(-1px);
}

.btn-modal-save:active,
.btn-modal-cancel:active {
  transform: translateY(0);
}

.btn-cancel-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0.48rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  transition: 0.18s ease;
  cursor: pointer;
}

.btn-cancel-edit:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: translateY(-1px);
}

/* Shared layout contract */
:root {
  --ui-page-max: 90vw;
  --ui-page-pad: 16px;
  --ui-page-pad-md: 24px;
  --ui-page-pad-sm: 12px;
  --ui-surface: rgba(15, 23, 42, 0.82);
  --ui-surface-strong: rgba(15, 23, 42, 0.96);
  --ui-titlebar: rgba(255, 255, 255, 0.06);
  --ui-text: #f8fafc;
  --ui-text-muted: rgba(226, 232, 240, 0.68);
  --ui-success: #86efac;
  --ui-danger: #fca5a5;
  --ui-warn: #fde68a;
  --ui-info: #93c5fd;
}

.wrap-full,
.ui-page-shell {
  width: 100%;
  max-width: var(--ui-page-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--ui-page-pad);
  padding-right: var(--ui-page-pad);
}

body:not(.ocp-page) .wrap-full:not(.wrap-edge) {
  max-width: var(--ui-page-max) !important;
}

body:not(.ocp-page) .page-shell:not(.wrap-edge),
body:not(.ocp-page) .layout:not(.wrap-edge) {
  width: 100%;
  max-width: var(--ui-page-max) !important;
  margin-left: auto;
  margin-right: auto;
}

.wrap-edge,
.ocp-page .wrap-full {
  max-width: none;
}

@media (min-width: 768px) {
  .wrap-full,
  .ui-page-shell {
    padding-left: var(--ui-page-pad-md);
    padding-right: var(--ui-page-pad-md);
  }
}

@media (max-width: 767.98px) {
  :root {
    --ui-page-max: 100vw;
  }

  .wrap-full,
  .ui-page-shell {
    padding-left: var(--ui-page-pad-sm);
    padding-right: var(--ui-page-pad-sm);
  }
}

.topbar.ui-topbar,
.ui-topbar {
  width: 100%;
  padding: 12px 14px;
  color: var(--ui-text);
}

.topbar-main,
.topbar.ui-topbar > .d-flex:not(.flex-column),
.ui-topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.topbar-brand,
.ui-topbar-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-actions,
.topbar-actions-group,
.ui-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 767.98px) {
  .topbar.ui-topbar,
  .ui-topbar {
    padding: 12px;
    border-radius: 18px;
  }

  .topbar-actions,
  .topbar-actions-group,
  .ui-topbar-actions,
  .topbar-actions .admin-topbar {
    width: 100%;
    justify-content: flex-start;
  }
}

.alert-modern {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.78);
  color: var(--ui-text);
  box-shadow: var(--ui-shadow-md);
  transition: opacity 0.18s ease, transform 0.18s ease, max-height 0.18s ease, margin 0.18s ease, padding 0.18s ease;
}

.alert-modern-success,
.alert.alert-modern-success {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.32);
  color: #bbf7d0;
}

.alert-modern-danger,
.alert.alert-modern-danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.32);
  color: #fecaca;
}

.alert-modern-warn,
.alert.alert-modern-warn {
  background: rgba(234, 179, 8, 0.14);
  border-color: rgba(234, 179, 8, 0.32);
  color: #fde68a;
}

.alert-modern-info,
.alert.alert-modern-info {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.32);
  color: #93c5fd;
}

.ui-alert-hidden {
  opacity: 0;
  transform: translateY(-6px);
  max-height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden;
  pointer-events: none;
}

.alert:not(.ui-inline-alert),
.alert-modern:not(.ui-inline-alert),
.js-auto-hide-alert:not(.ui-inline-alert),
[data-ui-toast]:not(.ui-inline-alert) {
  display: none !important;
}

.modal-admin .modal-dialog,
.ui-modal-dialog {
  max-width: min(92vw, 560px);
}

.modal-admin .modal-dialog.modal-lg,
.ui-modal-dialog-wide {
  max-width: min(94vw, 900px);
}

.modal-pdf .modal-dialog,
.ui-modal-dialog-preview {
  max-width: min(94vw, 1100px);
  width: 94vw;
}

.modal-admin .modal-content,
.admin-login-modal .modal-content,
.modal-pdf .modal-content,
.modal-confirm .modal-content,
.ui-modal-surface,
.modal-content.ui-modal-surface {
  overflow: hidden !important;
  color: var(--ui-text) !important;
  background: var(--ui-surface-strong) !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  border-radius: 18px !important;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48) !important;
  backdrop-filter: blur(18px) !important;
}

.modal-admin .modal-header,
.modal-pdf .modal-header,
.modal-confirm .modal-header,
.ui-modal-surface .modal-header {
  min-height: 52px !important;
  padding: 12px 16px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035)) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18) !important;
}

.modal-admin .modal-title,
.modal-pdf .modal-title,
.modal-confirm .modal-title,
.ui-modal-surface .modal-title {
  min-width: 0;
  color: var(--ui-text) !important;
  font-size: 0.98rem !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-admin .modal-body,
.modal-confirm .modal-body,
.ui-modal-surface .modal-body {
  padding: 18px 20px;
}

.modal-pdf .modal-body,
.modal-pdf .ui-modal-surface .modal-body {
  padding: 0 !important;
  height: 80vh !important;
}

.modal-pdf .modal-body iframe,
.modal-pdf .modal-body img.preview-img {
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  display: block !important;
}

.modal-admin .modal-footer,
.modal-pdf .modal-footer,
.modal-confirm .modal-footer,
.ui-modal-surface .modal-footer {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.035);
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.modal-admin .form-control,
.modal-admin select.form-select,
.ui-modal-surface .form-control,
.ui-modal-surface select.form-select {
  border-radius: 12px !important;
}

select.form-select,
.modal-admin select.form-select,
.ui-modal-surface select.form-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  cursor: pointer;
  padding-right: 2.65rem !important;
  background-color: rgba(15, 23, 42, 0.72) !important;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055), rgba(59, 130, 246, 0.11)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='M4.5 6.75 9 11.25l4.5-4.5' fill='none' stroke='%23bfdbfe' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat, no-repeat !important;
  background-position: 0 0, right 0.9rem center !important;
  background-size: 100% 100%, 18px 18px !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, filter 0.18s ease;
}

/* Tom Select kopiuje klasę form-select na .ts-wrapper — resetujemy, bo styl
   aktywatora definiuje .ts-control (pseudoelement, padding, border).
   Bez tego widać podwójną ramkę: wrapper (form-select) + ts-control. */
.ts-wrapper.form-select {
  padding: 0 !important;
  border: 0 !important;
  background-color: transparent !important;
  background-image: none !important;
  border-radius: 0 !important;
  min-height: 0 !important;
}

/* Całkowicie ukryj natywny select wewnątrz wrappera — Bootstrap :invalid
   background-image (error SVG) i chevron mogą renderować się off-screen
   i przebijać jako resztki obramowania. */
.ts-wrapper select.tomselected,
.ts-wrapper select.ts-hidden-accessible,
.ts-wrapper > select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  background: transparent !important;
  background-image: none !important;
}

select.form-select:hover,
.modal-admin select.form-select:hover,
.ui-modal-surface select.form-select:hover {
  background-color: rgba(30, 41, 59, 0.86) !important;
  border-color: rgba(147, 197, 253, 0.38) !important;
  filter: brightness(1.06);
}

select.form-select:focus,
.modal-admin select.form-select:focus,
.ui-modal-surface select.form-select:focus {
  background-color: rgba(30, 41, 59, 0.9) !important;
  border-color: rgba(96, 165, 250, 0.58) !important;
  box-shadow: 0 0 0 0.18rem rgba(59, 130, 246, 0.16) !important;
  filter: brightness(1.08);
}

.modal-admin select.form-select,
.ui-modal-surface select.form-select {
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(245, 158, 11, 0.12)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='M4.5 6.75 9 11.25l4.5-4.5' fill='none' stroke='%23fcd34d' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}

select.form-select option,
.modal-admin .form-select option,
.ui-modal-surface .form-select option {
  padding: 9px 14px;
  background-color: #0f172a;
  color: #e5e7eb;
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: 8px;
}

select.form-select option:checked,
.modal-admin .form-select option:checked,
.ui-modal-surface .form-select option:checked,
select.form-select option[selected],
.modal-admin .form-select option[selected],
.ui-modal-surface .form-select option[selected] {
  background-color: rgba(59, 130, 246, 0.32);
  color: #ffffff;
  font-weight: 800;
}

select.form-select option:hover,
.modal-admin .form-select option:hover,
.ui-modal-surface .form-select option:hover,
select.form-select option:focus,
.modal-admin .form-select option:focus,
.ui-modal-surface .form-select option:focus {
  background-color: rgba(59, 130, 246, 0.18);
  color: #ffffff;
}

/* Shared searchable select, powered by Tom Select when available. */
select.ui-search-select {
  width: 100%;
  min-height: 44px;
  appearance: auto;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.66);
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 14px;
  padding: 0.6rem 2.4rem 0.6rem 0.85rem;
  font-weight: 800;
}

select.ui-search-select.ui-search-select-spaced {
  margin-top: 8px;
}

.ts-dropdown {
  z-index: 2147482000 !important;
}

.ts-wrapper.ui-search-select {
  --ui-search-bg: rgba(15, 23, 42, 0.66);
  --ui-search-bg-hover: rgba(30, 41, 59, 0.78);
  --ui-search-border: rgba(148, 163, 184, 0.32);
  --ui-search-border-focus: rgba(96, 165, 250, 0.62);
  --ui-search-text: #f8fafc;
  --ui-search-muted: rgba(226, 232, 240, 0.58);
  --ui-search-option-hover: rgba(59, 130, 246, 0.22);
  --ui-search-option-active: rgba(37, 99, 235, 0.42);
  width: 100%;
  min-width: 0;
  color: var(--ui-search-text);
}

.ts-wrapper.ui-search-select .ts-control {
  position: relative;
  min-height: 46px;
  padding: 10px 42px 10px 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.065), rgba(59, 130, 246, 0.085)),
    var(--ui-search-bg);
  border: 1px solid var(--ui-search-border);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--ui-search-text);
  font-weight: 800;
  line-height: 1.2;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.ts-wrapper.ui-search-select .ts-control::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(191, 219, 254, 0.86);
  border-bottom: 2px solid rgba(191, 219, 254, 0.86);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.ts-wrapper.ui-search-select:not(.disabled):hover .ts-control {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(59, 130, 246, 0.11)),
    var(--ui-search-bg-hover);
  border-color: rgba(147, 197, 253, 0.42);
}

.ts-wrapper.ui-search-select.focus .ts-control {
  border-color: var(--ui-search-border-focus);
  box-shadow:
    0 0 0 0.18rem rgba(59, 130, 246, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ts-wrapper.ui-search-select .ts-control > input,
.ts-wrapper.ui-search-select .ts-control .item {
  color: var(--ui-search-text);
  font-weight: 800;
}

.ts-wrapper.ui-search-select .ts-control .item {
  max-width: 100%;
  padding: 0;
  color: var(--ui-search-text) !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.ts-wrapper.ui-search-select.dropdown-active .ts-control,
.ts-wrapper.ui-search-select.input-active .ts-control,
.ts-wrapper.ui-search-select.focus .ts-control {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(59, 130, 246, 0.11)),
    var(--ui-search-bg-hover) !important;
  color: var(--ui-search-text) !important;
}

.ts-wrapper.ui-search-select.dropdown-active .ts-control .item,
.ts-wrapper.ui-search-select.input-active .ts-control .item,
.ts-wrapper.ui-search-select.focus .ts-control .item {
  color: var(--ui-search-text) !important;
  background: transparent !important;
}

.ts-wrapper.ui-search-select .ts-control > input::placeholder {
  color: var(--ui-search-muted);
}

.ts-wrapper.ui-search-select.plugin-dropdown_input .ts-control > input {
  display: none !important;
}

/* Proste selecty bez wyszukiwarki — ukryj input i pokaż placeholder jako pseudoelement */
.ts-wrapper.ui-select .ts-control > input {
  display: none !important;
}

.ts-wrapper.ui-select:not(.has-items) .ts-control::before {
  content: attr(data-placeholder);
  color: var(--ui-search-muted);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 28px);
  display: inline-block;
}

.ts-wrapper.ui-search-select.plugin-dropdown_input:not(.has-items) .ts-control::before {
  content: attr(data-placeholder);
  min-width: 0;
  color: var(--ui-search-muted);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.ts-wrapper.ui-search-select .ts-control .item,
.ts-wrapper.ui-search-select .ts-dropdown .option {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ts-wrapper.ui-search-select .ts-dropdown,
.ts-dropdown.ui-search-select,
.ts-dropdown.ui-search-select-dropdown {
  --ui-search-bg: rgba(15, 23, 42, 0.66);
  --ui-search-bg-hover: rgba(30, 41, 59, 0.78);
  --ui-search-border: rgba(148, 163, 184, 0.32);
  --ui-search-border-focus: rgba(96, 165, 250, 0.62);
  --ui-search-text: #f8fafc;
  --ui-search-muted: rgba(226, 232, 240, 0.58);
  --ui-search-option-hover: rgba(59, 130, 246, 0.22);
  --ui-search-option-active: rgba(37, 99, 235, 0.42);
  margin-top: 8px;
  background: rgba(15, 23, 42, 0.985);
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 14px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.42);
  color: #e5e7eb;
  overflow: hidden;
  backdrop-filter: blur(14px);
  z-index: 2147482000 !important;
}

.ts-wrapper.ui-search-select .ts-dropdown .ts-dropdown-content,
.ts-dropdown.ui-search-select .ts-dropdown-content,
.ts-dropdown.ui-search-select-dropdown .ts-dropdown-content {
  max-height: min(280px, calc(100vh - 160px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.58) rgba(15, 23, 42, 0.72);
}

.ts-wrapper.ui-search-select .ts-dropdown .ts-dropdown-content::-webkit-scrollbar,
.ts-dropdown.ui-search-select .ts-dropdown-content::-webkit-scrollbar,
.ts-dropdown.ui-search-select-dropdown .ts-dropdown-content::-webkit-scrollbar {
  width: 8px;
}

.ts-wrapper.ui-search-select .ts-dropdown .ts-dropdown-content::-webkit-scrollbar-track,
.ts-dropdown.ui-search-select .ts-dropdown-content::-webkit-scrollbar-track,
.ts-dropdown.ui-search-select-dropdown .ts-dropdown-content::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.72);
}

.ts-wrapper.ui-search-select .ts-dropdown .ts-dropdown-content::-webkit-scrollbar-thumb,
.ts-dropdown.ui-search-select .ts-dropdown-content::-webkit-scrollbar-thumb,
.ts-dropdown.ui-search-select-dropdown .ts-dropdown-content::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.58);
  border-radius: 999px;
}

.ts-wrapper.ui-search-select .ts-dropdown input,
.ts-wrapper.ui-search-select .ts-dropdown .dropdown-input,
.ts-dropdown.ui-search-select input,
.ts-dropdown.ui-search-select .dropdown-input,
.ts-dropdown.ui-search-select-dropdown input,
.ts-dropdown.ui-search-select-dropdown .dropdown-input {
  width: calc(100% - 20px);
  min-height: 38px;
  margin: 10px;
  padding: 8px 11px;
  background: rgba(2, 6, 23, 0.54);
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 12px;
  color: #f8fafc;
  font-weight: 800;
  outline: none;
}

.ts-wrapper.ui-search-select .ts-dropdown input::placeholder,
.ts-wrapper.ui-search-select .ts-dropdown .dropdown-input::placeholder,
.ts-dropdown.ui-search-select input::placeholder,
.ts-dropdown.ui-search-select .dropdown-input::placeholder,
.ts-dropdown.ui-search-select-dropdown input::placeholder,
.ts-dropdown.ui-search-select-dropdown .dropdown-input::placeholder {
  color: var(--ui-search-muted);
}

.ts-wrapper.ui-search-select .ts-dropdown input:focus,
.ts-wrapper.ui-search-select .ts-dropdown .dropdown-input:focus,
.ts-dropdown.ui-search-select input:focus,
.ts-dropdown.ui-search-select .dropdown-input:focus,
.ts-dropdown.ui-search-select-dropdown input:focus,
.ts-dropdown.ui-search-select-dropdown .dropdown-input:focus {
  border-color: var(--ui-search-border-focus);
  box-shadow: 0 0 0 0.14rem rgba(59, 130, 246, 0.12);
}

.ts-wrapper.ui-search-select .ts-dropdown .option,
.ts-dropdown.ui-search-select .option,
.ts-dropdown.ui-search-select-dropdown .option {
  padding: 9px 12px;
  color: #e5e7eb;
  font-weight: 700;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ts-wrapper.ui-search-select .ts-dropdown .option:hover,
.ts-dropdown.ui-search-select .option:hover,
.ts-dropdown.ui-search-select-dropdown .option:hover {
  background: var(--ui-search-option-hover);
  color: #fff;
}

.ts-wrapper.ui-search-select .ts-dropdown .active,
.ts-wrapper.ui-search-select .ts-dropdown .selected,
.ts-dropdown.ui-search-select .active,
.ts-dropdown.ui-search-select .selected,
.ts-dropdown.ui-search-select-dropdown .active,
.ts-dropdown.ui-search-select-dropdown .selected {
  background: var(--ui-search-option-active);
  color: #fff;
}

.ts-wrapper.ui-search-select .ts-dropdown .no-results,
.ts-dropdown.ui-search-select .no-results,
.ts-dropdown.ui-search-select-dropdown .no-results {
  padding: 9px 12px;
  color: rgba(226, 232, 240, 0.72);
}

.ts-wrapper.ui-search-select.ui-search-select-spaced {
  margin-top: 8px;
}

.ts-wrapper.ui-search-select.ui-search-select-embedded .ts-control,
.ts-wrapper.ui-search-select.ui-search-select-spaced .ts-control {
  min-height: 42px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(59, 130, 246, 0.075)),
    rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.13);
}

.ts-wrapper.ui-search-select.ui-search-select-compact {
  margin-top: 8px;
}

.ts-wrapper.ui-search-select.ui-search-select-compact .ts-control {
  min-height: 34px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  font-size: 1.02rem;
}

.ts-wrapper.ui-search-select.ui-search-select-compact.focus .ts-control {
  box-shadow: none;
}

.modal-admin .form-control,
.modal-admin select.form-select,
.modal-admin .ts-wrapper.ui-search-select .ts-control {
  min-height: 46px !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  font-size: 0.94rem !important;
  line-height: 1.2 !important;
}

.modal-admin .ts-wrapper.ui-search-select {
  --ui-search-bg: rgba(15, 23, 42, 0.72);
  --ui-search-bg-hover: rgba(30, 41, 59, 0.86);
  --ui-search-border: rgba(245, 158, 11, 0.24);
  --ui-search-border-focus: rgba(245, 158, 11, 0.48);
  --ui-search-text: rgba(255, 255, 255, 0.95);
  --ui-search-muted: rgba(253, 230, 138, 0.34);
  --ui-search-option-hover: rgba(245, 158, 11, 0.14);
  --ui-search-option-active: rgba(245, 158, 11, 0.24);
}

.modal-admin .ts-wrapper.ui-search-select .ts-control {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(245, 158, 11, 0.12)),
    var(--ui-search-bg) !important;
  border-color: var(--ui-search-border) !important;
  border-radius: 14px !important;
  box-shadow: none !important;
  font-weight: 600 !important;
}

.modal-admin .ts-wrapper.ui-search-select .ts-control::after {
  border-color: #fcd34d;
}

.modal-admin .ts-wrapper.ui-search-select:hover .ts-control,
.modal-admin .ts-wrapper.ui-search-select.dropdown-active .ts-control,
.modal-admin .ts-wrapper.ui-search-select.input-active .ts-control,
.modal-admin .ts-wrapper.ui-search-select.focus .ts-control {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(245, 158, 11, 0.15)),
    var(--ui-search-bg-hover) !important;
  border-color: var(--ui-search-border-focus) !important;
  box-shadow: 0 0 0 0.18rem var(--gold-glow, rgba(245, 158, 11, 0.12)) !important;
}

.modal-admin .ts-wrapper.ui-search-select .ts-control .item,
.modal-admin .ts-wrapper.ui-search-select .ts-control > input {
  font-weight: 600 !important;
}

.modal-admin .ts-wrapper.ui-search-select.plugin-dropdown_input:not(.has-items) .ts-control::before {
  font-weight: 600;
}

.ts-dropdown.ui-search-select-dropdown .option:hover,
.ts-dropdown.ui-search-select-dropdown .active,
.ts-dropdown.ui-search-select-dropdown .selected {
  color: #fff;
}

.btn-modal-save.danger {
  border-color: rgba(248, 113, 113, 0.32);
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
}

.btn-modal-save.danger:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(248, 113, 113, 0.42);
  color: #fee2e2;
}

.modal-admin .btn-modal-cancel,
.ui-modal-surface .btn-modal-cancel {
  border-radius: 12px !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #e2e8f0 !important;
}

.modal-admin .btn-modal-save,
.ui-modal-surface .btn-modal-save {
  border-radius: 12px !important;
  border-color: rgba(96, 165, 250, 0.34) !important;
  background: rgba(59, 130, 246, 0.18) !important;
  color: #bfdbfe !important;
  box-shadow: none !important;
}

.modal-admin .btn-modal-save:hover,
.ui-modal-surface .btn-modal-save:hover {
  background: rgba(59, 130, 246, 0.28) !important;
  color: #dbeafe !important;
}

.modal-admin .btn-modal-save.danger,
.ui-modal-surface .btn-modal-save.danger {
  border-color: rgba(248, 113, 113, 0.32) !important;
  background: rgba(239, 68, 68, 0.16) !important;
  color: #fecaca !important;
}

/* Admin modals use file-preview modal geometry with a gold admin accent. */
.modal-admin .modal-content,
.admin-login-modal .modal-content {
  border-color: var(--gold-border, rgba(245, 158, 11, 0.28)) !important;
  border-radius: 18px !important;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.94)),
    var(--ui-surface-strong) !important;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.48),
    0 0 0 1px var(--gold-glass, rgba(245, 158, 11, 0.08)),
    inset 0 1px 0 rgba(253, 230, 138, 0.08) !important;
}

.modal-admin .modal-header,
.admin-login-modal .modal-header {
  position: relative;
  min-height: 52px !important;
  padding: 12px 16px !important;
  background:
    linear-gradient(180deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.045)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035)) !important;
  border-bottom-color: var(--gold-border, rgba(245, 158, 11, 0.26)) !important;
}

.modal-admin .modal-header::before,
.admin-login-modal .modal-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #fbbf24, rgba(245, 158, 11, 0.34), transparent);
  pointer-events: none;
}

.modal-admin .modal-title,
.admin-login-modal .modal-title {
  color: var(--gold-text, #fde68a) !important;
}

.modal-admin .modal-title i,
.admin-login-modal .modal-title i {
  color: var(--gold-text, #fde68a) !important;
}

.modal-admin .modal-footer,
.admin-login-modal .modal-footer {
  padding: 12px 16px !important;
  background:
    linear-gradient(180deg, rgba(245, 158, 11, 0.045), rgba(245, 158, 11, 0.075)),
    rgba(255, 255, 255, 0.035) !important;
  border-top-color: var(--gold-border, rgba(245, 158, 11, 0.22)) !important;
}

.modal-admin .btn-modal-save,
.admin-login-modal .btn-modal-save {
  border-color: var(--gold-border, rgba(245, 158, 11, 0.30)) !important;
  background: var(--gold-subtle, rgba(245, 158, 11, 0.14)) !important;
  color: var(--gold-text, #fde68a) !important;
}

.modal-admin .btn-modal-save:hover,
.admin-login-modal .btn-modal-save:hover {
  background: rgba(245, 158, 11, 0.22) !important;
  border-color: rgba(245, 158, 11, 0.40) !important;
  color: #fef3c7 !important;
}

.ui-confirm-copy {
  margin: 0;
  color: #e2e8f0;
  font-size: 0.95rem;
  line-height: 1.55;
}

.ui-confirm-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.ui-confirm-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.10);
  border: 1px solid rgba(59, 130, 246, 0.24);
}

.ui-confirm-details > .ui-confirm-item:only-child {
  grid-column: 1 / -1;
}

/* Wariant "linijki rozdzielone" — analogiczny do modal-table-row w brokerze.
   Używany w modali leasingu, wypisów licencji i kart paliwowych. */
.ui-confirm-details.ui-confirm-rows {
  display: block;
  margin-top: 0;
}
.ui-confirm-details.ui-confirm-rows .ui-confirm-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ui-confirm-details.ui-confirm-rows .ui-confirm-item:last-child {
  border-bottom: 0;
}
.ui-confirm-details.ui-confirm-rows .ui-confirm-item span {
  display: inline;
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.85rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  flex-shrink: 0;
}
.ui-confirm-details.ui-confirm-rows .ui-confirm-item strong {
  text-align: right;
  flex: 1;
  font-size: 0.92rem;
}
/* PIN line w wariant rows — wyrównany do prawej, nie rozjeżdża się */
.ui-confirm-details.ui-confirm-rows .ui-confirm-item .pin-line {
  display: flex;
  justify-content: flex-end;
  flex: 1;
  align-items: center;
}

.ui-confirm-item.is-danger {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.26);
}

.ui-confirm-item.is-success {
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.24);
}

.ui-confirm-item.is-warning {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.24);
}

.ui-confirm-item span {
  display: block;
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ui-confirm-item strong {
  color: #f8fafc;
  font-size: 0.95rem;
  word-break: break-word;
}

.ui-confirm-item.is-danger strong {
  color: #fecaca;
}

.ui-confirm-item.is-success strong {
  color: #dcfce7;
}

.ui-confirm-item.is-warning strong {
  color: #fde68a;
}

.btn-icon-only {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
  line-height: 1 !important;
}

.btn-icon-only i {
  margin: 0 !important;
}

/* ── Współdzielony komponent PIN (pokaż/ukryj) ────────────────────────────
   Używany w modalech kart paliwowych i innych miejscach z ukrytym PIN-em.
   Struktura: .pin-line > .pin-pill > (.pin-label + .js-pin-value + .js-pin-toggle) */
.pin-line {
  display: flex;
  align-items: stretch;
}

.pin-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.pin-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 780;
  color: #cbd5e1;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  line-height: 1;
}

.pin-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  padding: 6px 11px;
  color: #f8fafc;
  font-size: 0.76rem;
  font-weight: 820;
  letter-spacing: 0.04em;
  line-height: 1;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.pin-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.10);
  color: #e2e8f0;
  border-radius: 0;
  padding: 6px 12px;
  line-height: 1;
  font-size: 0.75rem;
  font-weight: 790;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.pin-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

@media (max-width: 575px) {
  .ui-confirm-details {
    grid-template-columns: 1fr;
  }
}

.ui-toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 24px));
  pointer-events: none;
}

.ui-toast {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 10px 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.96);
  color: var(--ui-text);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(18px);
  pointer-events: auto;
  animation: ui-toast-in 0.18s ease-out;
}

.ui-toast.is-hiding {
  animation: ui-toast-out 0.18s ease-in forwards;
}

.ui-toast-icon {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #93c5fd;
  box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.14);
}

.ui-toast-success .ui-toast-icon {
  background: var(--ui-success);
  box-shadow: 0 0 0 4px rgba(134, 239, 172, 0.14);
}

.ui-toast-error .ui-toast-icon {
  background: var(--ui-danger);
  box-shadow: 0 0 0 4px rgba(252, 165, 165, 0.14);
}

.ui-toast-warn .ui-toast-icon {
  background: var(--ui-warn);
  box-shadow: 0 0 0 4px rgba(253, 230, 138, 0.14);
}

.ui-toast-info .ui-toast-icon {
  background: var(--ui-info);
  box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.14);
}

.ui-toast-body {
  min-width: 0;
  color: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ui-toast-close {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.72);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.ui-toast-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

@keyframes ui-toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ui-toast-out {
  to { opacity: 0; transform: translateY(8px) scale(0.98); }
}

@media (max-width: 575.98px) {
  .ui-toast-root {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }
}

/* ==========================================================================
   .ui-file-drop — globalny komponent drag&drop dla inputów plików.
   Działa zarówno jako auto-wrap wokół <input type="file" class="ui-file-input">,
   jak i jako wrapper istniejących dropzones (.dz). Auto-init w common-ui.js.
   ========================================================================== */

.ui-file-drop {
  --ui-fd-bg: rgba(59, 130, 246, 0.04);
  --ui-fd-bg-hover: rgba(59, 130, 246, 0.08);
  --ui-fd-bg-drag: rgba(59, 130, 246, 0.14);
  --ui-fd-border: rgba(96, 165, 250, 0.28);
  --ui-fd-border-hover: rgba(96, 165, 250, 0.5);
  --ui-fd-border-drag: rgba(147, 197, 253, 0.85);
  --ui-fd-accent: #60a5fa;
  --ui-fd-accent-strong: #93c5fd;
  --ui-fd-text: #e2e8f0;
  --ui-fd-muted: rgba(226, 232, 240, 0.62);
  --ui-fd-glow: rgba(59, 130, 246, 0.16);
  --ui-fd-success-bg: rgba(34, 197, 94, 0.10);
  --ui-fd-success-border: rgba(134, 239, 172, 0.5);
  --ui-fd-success-accent: #86efac;

  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 132px;
  padding: 22px 18px;
  border: 1.5px dashed var(--ui-fd-border);
  border-radius: var(--ui-radius-lg, 18px);
  background:
    radial-gradient(120% 80% at 50% 0%, var(--ui-fd-bg) 0%, transparent 70%),
    rgba(15, 23, 42, 0.42);
  color: var(--ui-fd-text);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease,
    color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  outline: none;
}

.ui-file-drop.ui-file-drop-compact {
  min-height: 88px;
  padding: 14px 16px;
}

.ui-file-drop::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(60% 50% at 50% 50%, var(--ui-fd-glow), transparent 70%);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.ui-file-drop:hover,
.ui-file-drop:focus-visible {
  border-color: var(--ui-fd-border-hover);
  background:
    radial-gradient(120% 80% at 50% 0%, var(--ui-fd-bg-hover) 0%, transparent 70%),
    rgba(15, 23, 42, 0.5);
  color: var(--ui-fd-accent-strong);
}

.ui-file-drop:focus-visible {
  border-style: solid;
  box-shadow: 0 0 0 0.18rem var(--ui-fd-glow);
}

.ui-file-drop.is-drag,
.ui-file-drop.is-drag:hover {
  border-color: var(--ui-fd-border-drag);
  border-style: solid;
  background:
    radial-gradient(120% 80% at 50% 0%, var(--ui-fd-bg-drag) 0%, transparent 75%),
    rgba(15, 23, 42, 0.55);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.18);
}

.ui-file-drop.is-drag::after {
  opacity: 1;
}

.ui-file-drop.has-file {
  border-color: var(--ui-fd-success-border);
  border-style: solid;
  background:
    radial-gradient(120% 80% at 50% 0%, var(--ui-fd-success-bg) 0%, transparent 75%),
    rgba(15, 23, 42, 0.45);
}

.ui-file-drop.is-disabled,
.ui-file-drop:has(input[disabled]) {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.ui-file-drop-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.24);
  color: var(--ui-fd-accent);
  font-size: 1.4rem;
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.ui-file-drop:hover .ui-file-drop-icon,
.ui-file-drop:focus-visible .ui-file-drop-icon {
  background: rgba(96, 165, 250, 0.2);
  transform: translateY(-2px);
}

.ui-file-drop.is-drag .ui-file-drop-icon {
  background: rgba(147, 197, 253, 0.24);
  color: #fff;
  transform: scale(1.06);
  animation: ui-file-drop-bob 1.1s ease-in-out infinite;
}

.ui-file-drop.has-file .ui-file-drop-icon {
  background: rgba(134, 239, 172, 0.16);
  border-color: rgba(134, 239, 172, 0.34);
  color: var(--ui-fd-success-accent);
}

@keyframes ui-file-drop-bob {
  0%, 100% { transform: translateY(0) scale(1.06); }
  50% { transform: translateY(-3px) scale(1.06); }
}

.ui-file-drop-title {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0;
  color: inherit;
  line-height: 1.35;
}

.ui-file-drop-title-action {
  color: var(--ui-fd-accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(147, 197, 253, 0.55);
}

.ui-file-drop-hint {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ui-fd-muted);
  letter-spacing: 0.01em;
}

.ui-file-drop-file {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(134, 239, 172, 0.10);
  border: 1px solid rgba(134, 239, 172, 0.28);
  color: #dcfce7;
  font-size: 0.82rem;
  font-weight: 700;
  max-width: 100%;
}

.ui-file-drop.has-file .ui-file-drop-file {
  display: inline-flex;
}

.ui-file-drop.has-file .ui-file-drop-title-action,
.ui-file-drop.has-file .ui-file-drop-hint {
  display: none;
}

.ui-file-drop-file-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.ui-file-drop-file-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(220, 252, 231, 0.85);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ui-file-drop-file-clear:hover {
  background: rgba(252, 165, 165, 0.22);
  color: #fee2e2;
}

/* Ukryty natywny input — jest klikalny przez wrapper, ale niewidoczny. */
.ui-file-drop .ui-file-input,
.ui-file-drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

/* Adaptacja do kontekstu admin (gold). */
.modal-admin .ui-file-drop,
.admin-login-modal .ui-file-drop,
.ui-modal-surface .ui-file-drop,
.ui-file-drop.ui-file-drop-gold {
  --ui-fd-bg: rgba(245, 158, 11, 0.06);
  --ui-fd-bg-hover: rgba(245, 158, 11, 0.10);
  --ui-fd-bg-drag: rgba(245, 158, 11, 0.18);
  --ui-fd-border: rgba(245, 158, 11, 0.30);
  --ui-fd-border-hover: rgba(245, 158, 11, 0.52);
  --ui-fd-border-drag: rgba(253, 224, 71, 0.85);
  --ui-fd-accent: #fbbf24;
  --ui-fd-accent-strong: #fde68a;
  --ui-fd-glow: rgba(245, 158, 11, 0.18);
}

.modal-admin .ui-file-drop-icon,
.admin-login-modal .ui-file-drop-icon,
.ui-modal-surface .ui-file-drop-icon,
.ui-file-drop.ui-file-drop-gold .ui-file-drop-icon {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.28);
  color: var(--ui-fd-accent, #fbbf24);
}

/* Compat: istniejące dropzones (.dz) z jakimkolwiek markupem dostają wspólne
   podstawy. Pozwala to unifikować wygląd bez wymuszania jednej struktury HTML. */
.dz.ui-file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.dz.ui-file-drop > i,
.dz.ui-file-drop > i.fa-solid,
.dz.ui-file-drop > i.fas {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.24);
  color: var(--ui-fd-accent);
  font-size: 1.4rem;
  margin: 0;
}

.dz.ui-file-drop:hover > i {
  background: rgba(96, 165, 250, 0.2);
}

.dz.ui-file-drop.is-drag > i {
  background: rgba(147, 197, 253, 0.24);
  color: #fff;
}

/* Gold theme override for .dz icons inside admin/admin-login/ui-modal-surface
   contexts — same contexts as .ui-file-drop-icon above, but the .dz > i rule
   has higher specificity than .modal-admin .ui-file-drop-icon, so without
   this override the icon stays blue inside gold modals (e.g. ocp-files upload). */
.modal-admin .dz.ui-file-drop > i,
.admin-login-modal .dz.ui-file-drop > i,
.ui-modal-surface .dz.ui-file-drop > i,
.dz.ui-file-drop.ui-file-drop-gold > i {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.28);
  color: var(--ui-fd-accent, #fbbf24);
}

.modal-admin .dz.ui-file-drop:hover > i,
.admin-login-modal .dz.ui-file-drop:hover > i,
.ui-modal-surface .dz.ui-file-drop:hover > i,
.dz.ui-file-drop.ui-file-drop-gold:hover > i {
  background: rgba(245, 158, 11, 0.2);
}

.modal-admin .dz.ui-file-drop.is-drag > i,
.admin-login-modal .dz.ui-file-drop.is-drag > i,
.ui-modal-surface .dz.ui-file-drop.is-drag > i,
.dz.ui-file-drop.ui-file-drop-gold.is-drag > i {
  background: rgba(253, 224, 71, 0.24);
  color: #fff;
}

/* Selected-file state on legacy .dz: same green success treatment as the
   new component. Host-page JS toggles .has-file on the dropzone when a
   file is chosen (see setSelectedFile / onFile / setUploadFile). */
.dz.ui-file-drop.has-file > i {
  background: rgba(134, 239, 172, 0.16);
  border-color: rgba(134, 239, 172, 0.34);
  color: var(--ui-fd-success-accent);
}

/* Hide the "kliknij, aby wybrać" prompt once a file is chosen — matches the
   behaviour of the new .ui-file-drop component (where title-action + hint
   disappear under .has-file). Applies to all .dz pages regardless of whether
   the action text is wrapped in .ui-file-drop-title-action. */
.dz.ui-file-drop.has-file > .drop-title {
  display: none;
}

/* Legacy filename text containers (#fn / #uploadFileName / etc.) are still
   updated by host-page JS for backward compatibility, but visually the new
   .ui-file-drop-file badge is the source of truth. Hide them once a file is
   selected so they don't duplicate the badge. */
.dz.ui-file-drop.has-file > .dz-legacy-file-name {
  display: none;
}

/* Tytuł dropzone — użyj klasy .drop-title. Stare markup'y z inline tekstem
   dostaną wystarczająco czytelną prezentację dzięki dziedziczeniu koloru
   z .dz.ui-file-drop. */
.dz.ui-file-drop > .drop-title {
  font-weight: 800;
  color: var(--ui-fd-text);
  font-size: 0.92rem;
  line-height: 1.35;
  margin: 0;
}

/* Tekst akcji "kliknij, aby wybrać" w starych markupach bez .drop-title
   wrap — ostylowujemy <u> i domyślny text-color jako kontynuację tytułu. */
.dz.ui-file-drop:not(:has(.drop-title)) {
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.35;
}

/* Mały tekst pomocniczy — np. nazwa wybranego pliku (zastępuje stare
   .upload-file-name / inline #fn). */
.dz.ui-file-drop > .drop-note,
.dz.ui-file-drop > .upload-file-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ui-fd-muted);
  margin-top: 4px;
  word-break: break-word;
  max-width: 100%;
}

.dz.ui-file-drop > .drop-note:not(:empty),
.dz.ui-file-drop > .upload-file-name:not(:empty) {
  color: var(--ui-fd-accent-strong);
}

/* Podkreślenie akcji w starej strukturze <u>kliknij</u> → spójne z nowym
   komponentem. */
.dz.ui-file-drop u {
  color: var(--ui-fd-accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(147, 197, 253, 0.55);
}

@media (max-width: 575.98px) {
  .ui-file-drop {
    min-height: 116px;
    padding: 18px 14px;
  }

  .ui-file-drop-file-name {
    max-width: 60vw;
  }
}

/* === Globalny custom scrollbar — gradient jak w index.php (.sidebar-left) ===
   application: każdy element scrollowalny (body, sidebar, main, modale, tabele, dropdowny).
   Firefox: scrollbar-width + scrollbar-color. WebKit: pseudo-elementy. */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(96, 165, 250, 0.55) #07111f;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #07111f;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.65), rgba(168, 85, 247, 0.55));
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.85), rgba(168, 85, 247, 0.75));
}
::-webkit-scrollbar-corner {
  background: transparent;
}

/* ── Tooltipy: ciemnoszare szkło spójne z resztą UI ────────────────────────
   Nadpisuje domyślny czarny styl Bootstrap 5.3.3. Zmienne ustawiamy na .tooltip
   (tam gdzie Bootstrap je definiuje), a arrow też jawnie przez border-color,
   bo strzałka w 5.3 używa ::before z border-* w kolorze tła. */
.tooltip {
  --bs-tooltip-bg: rgba(15, 23, 42, 0.96);
  --bs-tooltip-color: #f8fafc;
  --bs-tooltip-font-size: 0.78rem;
  --bs-tooltip-padding-x: 0.6rem;
  --bs-tooltip-padding-y: 0.4rem;
  --bs-tooltip-border-radius: 10px;
  --bs-tooltip-max-width: 320px;
}
.tooltip-inner {
  background: var(--bs-tooltip-bg);
  color: var(--bs-tooltip-color);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--bs-tooltip-border-radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  max-width: var(--bs-tooltip-max-width);
}
/* Strzałka — w 5.3 jest pseudo-elementem z border w kolorze tła.
   Nadpisujemy wszystkie warianty pozycji, żeby pasowała do nowego tła. */
.bs-tooltip-top .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="top"] .tooltip-arrow::before {
  border-top-color: rgba(15, 23, 42, 0.96);
}
.bs-tooltip-bottom .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="bottom"] .tooltip-arrow::before {
  border-bottom-color: rgba(15, 23, 42, 0.96);
}
.bs-tooltip-start .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="left"] .tooltip-arrow::before {
  border-left-color: rgba(15, 23, 42, 0.96);
}
.bs-tooltip-end .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="right"] .tooltip-arrow::before {
  border-right-color: rgba(15, 23, 42, 0.96);
}
