:root {
  --bg-main: #0c0d11;
  --bg-sidebar: #13141a;
  --bg-card: #181920;
  --bg-card-hover: #1e1f28;
  --bg-input: #101116;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #38bdf8;
  
  --primary: #38bdf8;
  --primary-hover: #7dd3fc;
  --primary-glow: rgba(56, 189, 248, 0.25);
  
  --discord-blurple: #5865f2;
  --discord-hover: #4752c4;
  --discord-bg: #313338;
  --discord-embed-bg: #2b2d31;
  
  --text-main: #f2f3f5;
  --text-muted: #949ba4;
  --text-dim: #6d737f;
  
  --danger: #ed4245;
  --warning: #f0c35a;
  --success: #57f287;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: color .2s ease, background-color .2s ease, border-color .2s ease, opacity .2s ease, transform .2s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Sidebar MEE6 Style */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  box-shadow: 0 0 12px var(--primary-glow);
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.brand-badge {
  font-size: 10px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  margin-left: auto;
}

.nav-menu {
  list-style: none;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  border: 1px solid transparent;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: #fff;
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.2);
  font-weight: 600;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--text-dim);
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.nav-icon svg {
  display: block;
}

.nav-item:hover .nav-icon {
  color: var(--text-main);
}

.nav-item.active .nav-icon {
  color: var(--primary);
}

.nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* User Box in Sidebar */
.user-box {
  padding: 14px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
}

.user-avatar-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  display: block;
  background: var(--bg-card);
  transition: opacity 0.2s ease;
}

.user-avatar-fallback {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #222533, #15161e);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.user-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #13141a;
  box-shadow: 0 0 6px var(--primary-glow);
}

.user-details {
  flex-grow: 1;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

.user-role {
  font-size: 11px;
  color: var(--primary);
  font-weight: 500;
  margin-top: 1px;
}

.logout-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  text-decoration: none;
}

.logout-btn:hover {
  color: var(--danger);
  background: rgba(237, 66, 69, 0.12);
  border-color: rgba(237, 66, 69, 0.3);
}

.logout-btn svg {
  display: block;
}

/* Main Content Area */
.main-wrapper {
  margin-left: 260px;
  flex-grow: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  padding: 0 32px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(19, 20, 26, 0.8);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  font-size: 12px;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

.content-body {
  padding: 32px;
  max-width: 1300px;
  width: 100%;
}

/* Tab Panels */
.tab-content {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-2px);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover .stat-icon {
  color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.25);
}

.stat-icon svg {
  display: block;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
}

/* Section Cards & Form Components */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 24px;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 22px;
  line-height: 1.5;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn svg {
  flex-shrink: 0;
  display: block;
}

.btn-primary {
  background: var(--primary);
  color: #0b0c10;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
  background: rgba(237, 66, 69, 0.15);
  color: var(--danger);
  border: 1px solid rgba(237, 66, 69, 0.3);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

/* Discord Embed Builder Layout */
.builder-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
}

@media (max-width: 1024px) {
  .builder-grid {
    grid-template-columns: 1fr;
  }
}

/* Discord Mockup Preview */
.discord-preview-box {
  background: var(--discord-bg);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, 0.4);
}

.discord-msg-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.discord-bot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.discord-bot-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.discord-bot-tag {
  background: var(--discord-blurple);
  color: #fff;
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 600;
  margin-left: 6px;
}

.discord-embed-card {
  background: var(--discord-embed-bg);
  border-left: 4px solid var(--primary);
  border-radius: 4px;
  padding: 16px;
  max-width: 520px;
  position: relative;
}

.embed-preview-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.embed-preview-desc {
  font-size: 13.5px;
  color: #dbdee1;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.embed-preview-image {
  margin-top: 12px;
  max-width: 100%;
  border-radius: 4px;
  display: none;
}

.embed-preview-footer {
  margin-top: 12px;
  font-size: 11px;
  color: #949ba4;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #181922;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid var(--primary);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 500;
  animation: slideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.toast-danger {
  border-left-color: var(--danger);
}

.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--primary);
}

.toast.toast-danger .toast-icon {
  color: var(--danger);
}

.toast-icon svg {
  display: block;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Category & Modal Builder Styles */
.category-card {
  background: rgba(24, 25, 32, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  transition: var(--transition);
}

.category-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.category-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-badge {
  font-size: 11px;
  background: rgba(88, 101, 242, 0.15);
  color: #5865f2;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: monospace;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.modal-fields-box {
  background: rgba(16, 17, 22, 0.6);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 14px;
}

.modal-fields-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.field-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 1fr 1.2fr 130px 100px 40px;
  gap: 10px;
  align-items: center;
}

.field-item input, .field-item select {
  font-size: 13px;
  padding: 7px 10px;
}

.field-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.btn-icon-danger {
  background: rgba(237, 66, 69, 0.12);
  color: var(--danger);
  border: 1px solid rgba(237, 66, 69, 0.25);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon-danger:hover {
  background: rgba(237, 66, 69, 0.25);
  border-color: var(--danger);
}

.toggle-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ==============================================================================
   ROLE SELECTOR SCROLLPANEL (Scrollpanel Ról z Discorda)
   ============================================================================== */
.role-current-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  color: #fff;
  font-weight: 500;
}

.role-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.role-picker-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.role-search-wrap {
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
}

.role-search-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  padding: 8px 12px;
}

.role-scroll-panel {
  max-height: 180px;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: rgba(16, 17, 22, 0.4);
}

.role-scroll-panel::-webkit-scrollbar {
  width: 6px;
}
.role-scroll-panel::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
.role-scroll-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.role-scroll-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.4);
}

.role-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  color: var(--text-main);
  user-select: none;
}

.role-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.role-item.selected {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-weight: 600;
  color: #fff;
}

.role-item .role-check {
  margin-left: auto;
  color: var(--primary);
  font-weight: bold;
  font-size: 14px;
  display: none;
}

.role-item.selected .role-check {
  display: inline-block;
}

.role-item .role-id {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
  font-family: monospace;
}

.role-item.selected .role-id {
  margin-left: 8px;
}

.role-loading {
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ==============================================================================
   FLOATING BOTTOM-RIGHT SAVE PILL (Zapis w Prawym Dolnym Rogu)
   ============================================================================== */
.floating-save-pill {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  right: 24px;
  z-index: 999;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { transform: scale(0.8) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.floating-save-btn {
  background: var(--primary);
  color: #0c0d11;
  border: none;
  border-radius: 30px;
  padding: 12px 24px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 6px 24px rgba(56, 189, 248, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  outline: none;
}

.floating-save-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 30px rgba(56, 189, 248, 0.6);
}

.floating-save-btn:active {
  transform: translateY(0) scale(0.98);
}

.save-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.save-icon svg {
  display: block;
}

/* Rejestr Logowań i Zapamiętane Sesje */
.audit-table th {
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-size: 11px;
}

.audit-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ==============================================================================
   RESPONSYWNOŚĆ MOBILNA I PISANIE Z TELEFONU (RWD)
   ============================================================================== */
.mobile-menu-btn {
  display: none;
}

.sidebar-overlay {
  display: none;
}

@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  body.no-scroll {
    overflow: hidden;
  }

  /* Przycisk Hamburgera */
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
  }

  .mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  /* Wysuwany Sidebar (Off-canvas) */
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    z-index: 1000;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.85);
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 995;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  /* Główna treść na telefonie */
  .main-wrapper {
    margin-left: 0;
    width: 100%;
    min-width: 0;
  }

  .topbar {
    padding: 0 16px;
    height: 60px;
  }

  .page-title {
    font-size: 16px;
  }

  .topbar-status {
    padding: 4px 10px;
    font-size: 11px;
  }

  .content-body {
    padding: 16px 12px;
    width: 100%;
  }

  .card {
    padding: 18px 14px;
    margin-bottom: 16px;
    border-radius: var(--radius-md);
  }

  .card-title {
    font-size: 16px;
  }

  .card-subtitle {
    font-size: 12px;
    margin-bottom: 16px;
  }

  /* Bezwzględne zabezpieczenie przed auto-zoomem na smartfonach */
  .form-control,
  input[type="text"],
  input[type="password"],
  textarea,
  select {
    font-size: 16px !important;
    min-height: 44px;
    padding: 10px 12px;
  }

  /* Elastyczne jednokolumnowe układy na smartfonach */
  .grid-2,
  .grid-3,
  .builder-grid,
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .field-item {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px;
  }

  /* Dostosowanie pływającego przycisku do bezpiecznego marginesu dolnego iPhone'a */
  .floating-save-pill {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: 16px;
  }

  .floating-save-btn {
    padding: 11px 18px;
    font-size: 13px;
  }
}

/* Modale i Nakładki Systemowe */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-backdrop.open {
  display: flex;
}
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalEnter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-box-large {
  max-width: 900px;
  height: 85vh;
}
@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}
.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}
.modal-close-btn:hover {
  color: #fff;
}
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex-grow: 1;
}
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Przyciski Akcji Tabeli */
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-main);
  transition: var(--transition);
}
.btn-sm:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}
.btn-sm-danger {
  color: var(--danger);
  border-color: rgba(237, 66, 69, 0.3);
}
.btn-sm-danger:hover {
  background: rgba(237, 66, 69, 0.15);
  border-color: var(--danger);
}
.btn-sm-primary {
  color: var(--primary);
  border-color: rgba(56, 189, 248, 0.3);
}
.btn-sm-primary:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--primary);
}

/* Podgląd Przycisków Akcji w Embedzie */
.embed-preview-buttons {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.preview-link-btn {
  background: #4e5058;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  pointer-events: none;
}
.transcript-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #1e1f22;
  border-radius: var(--radius-sm);
}

/* ==============================================================================
   UPRAWNIENIA (Z-007): lista, podstrona edycji, kategorie
   ============================================================================== */
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid transparent; }
.btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.btn:disabled, .btn-sm:disabled { opacity: .45; cursor: not-allowed; }
.acl-owners { display: flex; gap: 10px; flex-wrap: wrap; }
.acl-owner { padding: 8px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.acl-subj { display: flex; align-items: center; gap: 10px; min-width: 0; }
.acl-subj-av { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--bg-input); flex-shrink: 0; display: inline-block; }
.acl-role-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; margin: 0 10px 0 10px; }
.acl-subj-name { color: #fff; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acl-subj-meta { color: var(--text-dim); font-size: 11.5px; margin-top: 1px; }
.acl-list-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.acl-add { padding: 16px; margin-bottom: 16px; border-radius: var(--radius-md); background: var(--bg-input); border: 1px solid var(--border-color); }
.acl-add-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.acl-add-msg { margin-right: auto; font-size: 12.5px; color: var(--text-muted); }
.acl-toolbar { display: grid; grid-template-columns: 1fr 160px 190px; gap: 8px; margin-bottom: 8px; }
.acl-toolbar .form-control { height: 38px; padding: 7px 12px; }
.acl-row { display: grid; grid-template-columns: minmax(180px, 240px) 1fr 150px auto; gap: 14px; align-items: center;
           padding: 12px 4px; border-bottom: 1px solid var(--border-color); }
.acl-row:last-child { border-bottom: 0; }
.acl-row-perms { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; min-width: 0; }
.acl-chip { display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; background: rgba(255,255,255,.06); color: var(--text-main); }
.acl-chip.star { background: rgba(56, 189, 248, .15); color: var(--primary); font-weight: 700; }
.acl-count { display: inline-flex; padding: 3px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 700; color: var(--text-muted);
             background: rgba(255,255,255,.04); border: 1px solid var(--border-color); margin-right: 4px; }
.acl-count.star { color: var(--primary); border-color: rgba(56, 189, 248,.35); }
.acl-more { border: 0; background: none; color: var(--primary); font-size: 11.5px; font-weight: 600; cursor: pointer; padding: 3px 4px; }
.acl-hidden-chips { display: contents; }
.acl-hidden-chips[hidden] { display: none; }
.acl-note { flex-basis: 100%; font-size: 11.5px; color: var(--text-dim); }
.acl-row-meta { font-size: 11.5px; color: var(--text-dim); }
.acl-row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.acl-row-actions .btn-sm { min-width: 72px; text-align: center; }
.acl-empty { display: block; text-align: center; color: var(--text-dim); padding: 24px; font-size: 13px; }
.acl-back { border: 0; background: none; color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; margin-bottom: 14px; }
.acl-back:hover { color: #fff; }
.acl-ed-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.acl-ed-head .acl-subj-av { width: 44px; height: 44px; }
.acl-ed-head .acl-subj-name { font-size: 17px; }
.acl-ed-global { display: flex; gap: 8px; }
.acl-star-note { padding: 10px 14px; margin-bottom: 14px; border-radius: var(--radius-md); font-size: 13px;
                 background: rgba(56, 189, 248,.08); border: 1px solid rgba(56, 189, 248,.25); color: var(--text-main); }
.acl-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.acl-cat { padding: 14px 16px; border-radius: var(--radius-md); background: var(--bg-input); border: 1px solid var(--border-color); }
.acl-cat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.acl-cat-title { font-size: 13.5px; font-weight: 700; color: #fff; }
.acl-cat-count { font-size: 11.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.acl-cat-head .btn-sm { margin-left: auto; }
.acl-perm-row { display: flex; align-items: flex-start; gap: 10px; padding: 7px 8px; border-radius: 7px; font-size: 13px; cursor: pointer; }
.acl-perm-row:hover { background: rgba(255,255,255,.04); }
.acl-perm-row input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--primary); flex-shrink: 0; cursor: pointer; }
.acl-perm-row strong { color: #fff; font-weight: 600; }
.acl-perm-row.is-locked { opacity: .45; cursor: not-allowed; }
.acl-perm-row.is-star { opacity: .7; }

/* Na Uprawnieniach jeden zapis = pasek zmian (bez plywajacego "Zapisz" ustawien) */
body.acl-active .floating-save-pill { display: none; }

/* ==============================================================================
   PASEK NIEZAPISANYCH ZMIAN (Z-008) - widoczny tylko przy zmianach
   ============================================================================== */
.unsaved-bar { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 1001;
               display: flex; align-items: center; gap: 18px; padding: 10px 12px 10px 18px; max-width: calc(100vw - 32px);
               background: #181922; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.55);
               transform: translate(-50%, 140%); opacity: 0; pointer-events: none; transition: transform .18s ease, opacity .18s ease; }
.unsaved-bar.is-visible { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.unsaved-text { font-size: 13.5px; font-weight: 600; color: #fff; white-space: nowrap; }
.unsaved-actions { display: flex; gap: 8px; }
.unsaved-actions .btn { padding: 9px 16px; font-size: 13px; }

@media (max-width: 900px) {
  .acl-cats { grid-template-columns: 1fr; }
  .acl-row { grid-template-columns: 1fr; gap: 8px; }
  .acl-row-actions { justify-content: flex-start; }
  .acl-toolbar { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .unsaved-bar { left: 16px; right: 16px; transform: translateY(140%); justify-content: space-between; }
  .unsaved-bar.is-visible { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) { .unsaved-bar { transition: none; } }

/* Z-008: plywajacy zapis ustawien tylko przy zmianach */
.floating-save-pill { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 14px;
                      background: #181922; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 12px 40px rgba(0,0,0,.55);
                      opacity: 0; transform: translateY(140%); pointer-events: none; animation: none;
                      transition: transform .18s ease, opacity .18s ease; }
.floating-save-pill.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.floating-save-pill .floating-save-btn { border-radius: 10px; padding: 9px 18px; }
@media (max-width: 520px) { .floating-save-pill .unsaved-text { display: none; } }

/* RWD fix: gorny pasek panelu bota i przycisk Dodaj */
.topbar-status a.btn { text-decoration: none; white-space: nowrap; }
.topbar-status #topbar-bot-info { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.acl-list-head .btn { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 768px) {
  .topbar { gap: 10px; }
  .page-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .topbar > div:first-child { min-width: 0; }
  .topbar-status { flex-shrink: 0; gap: 8px !important; padding: 4px 8px; }
  .topbar-status a.btn { padding: 5px 9px !important; font-size: 11px !important; }
  .topbar-status #topbar-bot-info { display: none; }
}
@media (max-width: 400px) {
  .topbar-status a.btn { font-size: 0 !important; }
  .topbar-status a.btn::after { content: "Licencje"; font-size: 11px; }
}

/* ==============================================================================
   P13: Wspolne komponenty paneli (przeniesione z antke.html Z-004/Z-005/Z-009),
   uzywane przez panel licencji (admin.antke.pl) i panel bota DC (bot.antke.pl)
   ============================================================================== */
.brand-badge.antke { background: rgba(56, 189, 248, .15); color: #38bdf8; }

.kv { display: grid; grid-template-columns: 1fr auto; font-size: 13px; }
.kv > div { display: flex; align-items: center; min-height: 40px; padding: 8px 0; border-bottom: 1px solid var(--border-color); }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv > div:nth-child(odd) { color: var(--text-muted); }
.kv > div:nth-child(even) { justify-content: flex-end; text-align: right; color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; gap: 6px; }
.kv .muted { color: var(--text-dim); font-weight: 500; }

.pill { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.pill.ok { background: rgba(74, 222, 128, .12); color: #4ade80; }
.pill.bad { background: rgba(237, 66, 69, .15); color: #ED4245; }
.pill.warn { background: rgba(250, 204, 21, .15); color: #facc15; }

.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head .card-title { margin-bottom: 2px; }
.card-head .card-subtitle { margin-bottom: 0; }
.card-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px;
            background: rgba(255, 255, 255, .04); border: 1px solid var(--border-color); color: var(--text-muted); cursor: pointer; transition: var(--transition); }
.icon-btn:hover { color: #fff; border-color: rgba(255, 255, 255, .2); }
.icon-btn:disabled { cursor: progress; }
.icon-btn.is-loading svg { animation: z4spin .8s linear infinite; }
@keyframes z4spin { to { transform: rotate(360deg); } }

.info-tip { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%;
            border: 1px solid var(--border-color); color: var(--text-dim); font-size: 12px; font-weight: 700; cursor: help; }
.info-tip:hover, .info-tip:focus-visible { color: #fff; border-color: rgba(255, 255, 255, .25); outline: none; }

/* Skroty w sidebarze */
.nav-shortcuts { padding: 8px 12px 14px; border-top: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 2px; }
.nav-section-label { padding: 6px 14px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.nav-shortcut { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: var(--radius-md); color: var(--text-muted);
                text-decoration: none; font-size: 13px; font-weight: 500; transition: var(--transition); }
.nav-shortcut[hidden] { display: none; }
.nav-item[hidden] { display: none; }
.nav-shortcut:hover { color: #fff; background: rgba(255, 255, 255, .04); }
.nav-shortcut:hover .nav-icon { color: var(--text-main); }
.nav-shortcut:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.nav-ext-arrow { margin-left: auto; color: var(--text-dim); }

/* Segmentowany przelacznik */
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 10px; background: rgba(255, 255, 255, .03); border: 1px solid var(--border-color); }
.seg-btn { padding: 7px 14px; border: 0; border-radius: 7px; background: transparent; color: var(--text-muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.seg-btn.active { background: rgba(255, 255, 255, .1); color: #fff; }

/* Tabele danych (alias .lic-table dla antke.js) */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table, .lic-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .lic-table th { text-align: left; color: var(--text-muted); font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--border-color); }
.data-table td, .lic-table td { padding: 10px 8px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.data-table .ta-r, .lic-table .ta-r { text-align: right; }
.table-empty, .lic-empty { text-align: center; color: var(--text-dim); padding: 24px !important; }
.sub, .lic-sub { font-size: 11px; color: var(--text-dim); }

/* Wspolna, kompaktowa skala przyciskow w naglowkach kart (bot i licencje wygladaja tak samo).
   Po P13 przyciski bota stracily inline 6px 14px / 12px i dostaly domyslne .btn (11px 20px / 14px) - wygladaly na powiekszone. */
.card-head .btn,
.card-head-actions .btn,
.card-head .btn-sm-danger,
.card-head-actions .btn-sm-danger {
  padding: 6px 14px;
  font-size: 12px;
  line-height: 1.3;
}
.card-head-actions .form-control {
  height: 34px;
  padding: 6px 12px;
  font-size: 13px;
}


/* Statystyki uzycia strony (zakladka Statystyki): slupki CSS bez bibliotek, wysokosc przez --h */
.stats-msg { margin-top: 4px; font-size: 13px; color: var(--text-dim); }
.stats-msg.is-error { color: var(--danger); }
.stats-msg[hidden] { display: none; }
.stat-card .sub { margin-top: 4px; }
.usage-legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); }
.usage-legend span { display: inline-flex; align-items: center; gap: 6px; }
.usage-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.usage-dot-detail, .usage-seg.detail { background: var(--primary); }
.usage-dot-calc, .usage-seg.calc { background: #5865f2; }
.usage-chart { display: flex; align-items: stretch; gap: 3px; height: 180px; }
.usage-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.usage-plot { flex: 1; display: flex; align-items: flex-end; border-bottom: 1px solid var(--border-color); }
.usage-bar { width: 100%; height: var(--h, 0%); display: flex; flex-direction: column; border-radius: 3px 3px 0 0; overflow: hidden; background: var(--primary); transition: filter .15s ease; }
.usage-seg { display: block; flex-shrink: 0; height: var(--h, 0%); }
.usage-col:hover .usage-bar { filter: brightness(1.3); }
.usage-x { height: 16px; margin-top: 4px; font-size: 10px; line-height: 16px; color: var(--text-dim); text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
.usage-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: 13px; }
.trend-up { color: var(--success); font-weight: 700; }
.trend-down { color: var(--danger); font-weight: 700; }
.trend-flat { color: var(--text-dim); }
/* statystyki etap 2: odwiedziny, frazy, wartosci funkcji, szczegoly przedmiotu */
.usage-row-click { cursor: pointer; }
.usage-row-click:hover td, .usage-row-click.is-selected td { background: rgba(255, 255, 255, .045); }
.usage-row-click.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.usage-row-click:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.usage-item-detail { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-color); }
.usage-item-detail[hidden] { display: none; }
.usage-kpis { display: flex; flex-wrap: wrap; gap: 28px; margin-bottom: 14px; }
.usage-legend-gap { margin-bottom: 10px; }
.usage-subhead { margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.usage-visit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; margin-top: 20px; }
.usage-chart.is-short { height: 110px; }
.usage-split { display: flex; height: 14px; margin-bottom: 10px; border-radius: 7px; overflow: hidden; background: var(--border-color); }
.usage-split-seg { display: block; width: var(--h, 0%); }
.usage-split-seg.mobile, .usage-dot-mobile { background: var(--primary); }
.usage-split-seg.desktop, .usage-dot-desktop { background: #5865f2; }
.usage-hrow { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 3px 0; font-size: 13px; }
.usage-hlabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-htrack { height: 8px; border-radius: 4px; overflow: hidden; background: var(--border-color); }
.usage-hfill { display: block; height: 100%; width: var(--h, 0%); border-radius: 4px; background: var(--primary); }
.usage-hval { min-width: 44px; text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.usage-fv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.usage-phrase { word-break: break-word; }
/* statystyki etap 4: ruch uzytkownikow */
.flow-kpi-val { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.flow-kpi-lbl { font-size: 12px; color: var(--text-muted); }
/* statystyki etap 3: okresy 1h/24h i wlasny przedzial */
.stats-custom { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stats-custom[hidden] { display: none; }
.stats-custom .form-control { width: auto; color-scheme: dark; }
.stats-custom-sep { color: var(--text-dim); }
.stats-range { color: var(--text-muted); font-weight: 600; }
.stats-scope { font-size: 12px; font-weight: 500; color: var(--text-dim); }

/* K4 (audyt UI 12.11): Licencje i Kody promo jako karty na telefonie, reszta tabel przewijana z cieniem krawedzi */
.table-wrap {
  background:
    linear-gradient(to right, var(--bg-card) 30%, transparent) left / 32px 100% no-repeat local,
    linear-gradient(to left, var(--bg-card) 30%, transparent) right / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .5), transparent) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .5), transparent) right / 12px 100% no-repeat scroll;
}
@media (max-width: 768px) {
  .table-cards-wrap { overflow: visible; }
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr { display: block; width: 100%; }
  .table-cards tr { border: 1px solid var(--border-color) !important; border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; }
  .table-cards td { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 4px 0 !important; border-bottom: 0 !important; text-align: left !important; overflow-wrap: anywhere; }
  .table-cards td::before { content: attr(data-label); color: var(--text-muted); font-size: 12px; }
  .table-cards td:not([data-label]) { display: block; }
  .table-cards td:not([data-label])::before { content: none; }
  .table-cards td.td-actions { display: block; padding-top: 8px !important; margin-top: 4px; border-top: 1px solid var(--border-color); }
  .table-cards .lic-actions { display: flex; flex-wrap: wrap; white-space: normal; }
}

/* Etap 3 (audyt UI 12.11): pasek zapisu bez kolorowej poswiaty i bez skalowania, tresc nie chowa sie pod paskiem */
.floating-save-btn, .floating-save-btn:hover { box-shadow: none; transform: none; }
.floating-save-btn:active { transform: scale(0.98); }
body:has(.floating-save-pill.is-visible) .content-body { padding-bottom: 96px; }

/* Etap 4 (audyt UI 12.11): jeden akcent cyjan we wszystkich panelach, ciemny tekst na akcencie (kontrast >= 4.5:1) */
.btn-primary, .floating-save-btn { color: #04121c; }
.btn-primary:hover, .floating-save-btn:hover { color: #04121c; }
.btn-danger { background: rgba(237, 66, 69, 0.08); color: #f87171; border: 1px solid rgba(237, 66, 69, 0.35); }
.btn-danger:hover { background: rgba(237, 66, 69, 0.16); color: #fca5a5; border-color: rgba(237, 66, 69, 0.5); }
.btn.btn-sm.btn-primary[data-logview], .btn.btn-sm[data-logview].active { background: var(--primary); color: #04121c; border-color: transparent; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Etap 4 - natywne kontrolki (audyt UI 12.11): jeden akcent i ciemny schemat systemowych pickerow */
:root { color-scheme: dark; }
input[type=checkbox], input[type=radio], input[type=range], progress { accent-color: var(--primary); }
/* D7 (audyt UI 12.11): naglowki logow nie zlewaja sie na telefonie */
#logs-head th { padding: 8px; white-space: nowrap; }
