@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* Dark Theme (default) */
:root {
  --bg-primary: #0f1419;
  --bg-secondary: #15202b;
  --bg-card: #192734;
  --bg-card-hover: #22303c;
  --border: #38444d;
  --border-light: #536471;
  --text-primary: #f7f9f9;
  --text-secondary: #8b98a5;
  --text-muted: #6e767d;
  --accent: #1d9bf0;
  --accent-light: #4db5f9;
  --accent-dark: #1a8cd8;
  --accent-glow: rgba(29, 155, 240, 0.2);
}

/* Light Theme */
[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f7f9f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f3f5;
  --border: #e1e8ed;
  --border-light: #cfd9de;
  --text-primary: #0f1419;
  --text-secondary: #536471;
  --text-muted: #8b98a5;
  --accent: #1d9bf0;
  --accent-light: #1a8cd8;
  --accent-dark: #0c7abf;
  --accent-glow: rgba(29, 155, 240, 0.15);
}

/* Theme Toggle Button */
.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  transition: all 0.3s ease;
}
.theme-toggle:hover {
  background: var(--bg-card-hover);
  transform: rotate(20deg);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  overflow-x: hidden;
}

body { 
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; 
  background: var(--bg-primary);
  color: var(--text-secondary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100vw;
}

.container { 
  max-width: 1400px; 
  margin: 0 auto; 
  padding: 30px;
  overflow-x: hidden;
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   NAWIGACJA - PREMIUM DARK
   ═══════════════════════════════════════════════════════════ */
nav {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(20px);
  max-width: 100vw;
  overflow: visible;
}

nav .nav-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 16px 30px;
  overflow: visible;
}

/* === LOGO === */
nav .logo { 
  text-decoration: none; 
  display: flex; 
  align-items: center; 
  gap: 14px;
  transition: transform 0.3s ease;
}
nav .logo:hover {
  transform: scale(1.02);
}

nav .logo-icon { 
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 50%, var(--accent-light) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  box-shadow: 
    0 4px 20px rgba(29, 155, 240, 0.25),
    0 0 40px rgba(29, 155, 240, 0.1),
    inset 0 1px 0 rgba(255,255,255,0.2);
}

nav .logo-text { 
  display: flex; 
  flex-direction: column; 
  gap: 2px;
}

nav .logo-main { 
  font-weight: 800; 
  font-size: 1.5em;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1;
}

nav .logo-sub { 
  font-size: 0.75em; 
  color: var(--accent-light); 
  font-weight: 500; 
  letter-spacing: 3px; 
  text-transform: uppercase;
}

/* === MENU === */
nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  background: var(--bg-card);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: visible;
}

nav ul li a { 
  color: var(--text-secondary); 
  text-decoration: none; 
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.9em;
  padding: 10px 18px;
  border-radius: 8px;
  display: block;
}

nav ul li a:hover { 
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

nav ul li a.active { 
  color: var(--text-primary);
  background: var(--accent);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

/* === DROPDOWN MENU === */
nav ul li.dropdown {
  position: relative;
}
nav ul li.dropdown .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  min-width: 200px;
  z-index: 9999;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}
nav ul li.dropdown:hover .dropdown-menu,
nav ul li.dropdown .dropdown-menu.show {
  display: flex;
}
nav ul li.dropdown .dropdown-menu li {
  width: 100%;
}
nav ul li.dropdown .dropdown-menu li a {
  padding: 10px 15px;
  border-radius: 8px;
  white-space: nowrap;
}
nav ul li.dropdown .dropdown-menu li a:hover {
  background: var(--accent);
  color: white;
}

/* === DROPDOWN TOGGLE ARROW === */
nav ul li.dropdown > .dropdown-toggle {
  cursor: pointer;
  user-select: none;
}

/* === HAMBURGER BUTTON === */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* === BREADCRUMB === */
.breadcrumb {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 10px 30px;
  font-size: 0.85em;
}
.breadcrumb-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--accent-light);
  text-decoration: underline;
}
.breadcrumb-sep {
  color: var(--text-muted);
}
.breadcrumb-current {
  color: var(--text-secondary);
  font-weight: 500;
}

/* === SEARCH === */
.search-box { display: flex; gap: 8px; }

.search-box input { 
  padding: 12px 18px; 
  border: 1px solid var(--border); 
  background: var(--bg-card); 
  color: var(--text-primary); 
  border-radius: 10px; 
  width: 240px;
  font-size: 0.9em;
  transition: all 0.3s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-box input::placeholder { color: var(--text-muted); }

.search-box button { 
  padding: 12px 20px; 
  background: var(--accent);
  color: white; 
  border: none; 
  border-radius: 10px; 
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.search-box button:hover { 
  background: var(--accent-light);
  transform: translateY(-1px);
}

/* === USER MENU === */
.nav-right { display: flex; align-items: center; gap: 20px; }
.user-menu { display: flex; align-items: center; gap: 15px; }
.user-name { color: var(--text-secondary); font-size: 0.9em; font-weight: 500; }

.btn-logout { 
  padding: 10px 18px; 
  background: transparent; 
  color: var(--text-secondary); 
  border-radius: 8px; 
  text-decoration: none; 
  font-size: 0.9em; 
  font-weight: 500;
  transition: all 0.2s; 
  border: 1px solid var(--border); 
}

.btn-logout:hover { 
  background: #ef444420;
  border-color: #ef4444;
  color: #f87171;
}

/* ═══════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════ */
h1 { 
  margin: 0 0 30px 0; 
  color: var(--text-primary);
  font-size: 2em;
  font-weight: 800;
  letter-spacing: -0.5px;
}

h2 { 
  margin: 20px 0 15px; 
  color: var(--text-primary); 
  font-size: 1.3em;
  font-weight: 700;
}

h3 {
  color: var(--text-primary);
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════
   CARDS & CONTAINERS
   ═══════════════════════════════════════════════════════════ */
.card { 
  background: var(--bg-card); 
  border-radius: 16px; 
  padding: 24px; 
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.card-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════
   STATS
   ═══════════════════════════════════════════════════════════ */
.stats { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
  gap: 20px; 
  margin-bottom: 30px; 
}

.stat-card { 
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 25px; 
  border-radius: 16px; 
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 30px var(--accent-glow);
}

.stat-card .number { 
  font-size: 2.5em; 
  font-weight: 800; 
  color: var(--text-primary);
}

.stat-card .label { 
  color: var(--text-muted); 
  margin-top: 8px;
  font-size: 0.9em;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-card.active .number { color: var(--accent); }

/* ═══════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════ */
table { width: 100%; border-collapse: collapse; }

th, td { 
  padding: 14px 18px; 
  text-align: left; 
  border-bottom: 1px solid var(--border); 
}

th {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
th.sortable { cursor: pointer; user-select: none; position: relative; padding-right: 24px; }
th.sortable:hover { color: var(--accent); }
th.sortable::after { content: '⇅'; position: absolute; right: 6px; opacity: 0.4; font-size: 0.9em; }
th.sort-asc::after { content: '▲'; opacity: 1; color: var(--accent); }
th.sort-desc::after { content: '▼'; opacity: 1; color: var(--accent); }

tr:hover { background: var(--bg-card-hover); }

td a { color: var(--accent); text-decoration: none; }
td a:hover { color: var(--accent-light); }

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */
.btn { 
  display: inline-block; 
  padding: 12px 24px; 
  border-radius: 10px; 
  text-decoration: none; 
  font-weight: 600; 
  cursor: pointer; 
  border: none; 
  transition: all 0.2s;
  font-size: 0.9em;
}

.btn-primary { 
  background: var(--accent); 
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.btn-primary:hover { 
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-success { background: var(--accent); color: white; }
.btn-danger { background: #ef4444; color: white; }
.btn-secondary { background: var(--bg-card-hover); color: var(--text-primary); border: 1px solid var(--border); }
.btn-sm { padding: 8px 16px; font-size: 0.85em; }

/* ═══════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════ */
.badge { 
  display: inline-block; 
  padding: 5px 12px; 
  border-radius: 20px; 
  font-size: 0.8em; 
  font-weight: 600;
}

.badge-active { background: var(--accent-glow); color: var(--accent); border: 1px solid var(--accent); }
.badge-completed { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid #6366f1; }
.badge-archived { background: rgba(107, 114, 128, 0.15); color: #9ca3af; border: 1px solid #6b7280; }

/* ═══════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 24px; }

.form-group label { 
  display: block; 
  margin-bottom: 10px; 
  color: var(--text-primary); 
  font-weight: 600;
  font-size: 0.9em;
}

.form-group input, 
.form-group textarea, 
.form-group select { 
  width: 100%; 
  padding: 14px 18px; 
  border: 1px solid var(--border); 
  background: var(--bg-secondary); 
  color: var(--text-primary); 
  border-radius: 10px; 
  font-size: 1em;
  transition: all 0.2s;
}

.form-group textarea { min-height: 140px; resize: vertical; }

.form-group input:focus, 
.form-group textarea:focus,
.form-group select:focus { 
  outline: none; 
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-row { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
  gap: 24px; 
}

/* ═══════════════════════════════════════════════════════════
   MISC
   ═══════════════════════════════════════════════════════════ */
.empty { 
  text-align: center; 
  padding: 60px; 
  color: var(--text-muted);
}
.empty a { color: var(--accent); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }

.detail-item { 
  background: var(--bg-secondary); 
  padding: 18px; 
  border-radius: 12px;
  border: 1px solid var(--border);
}
.detail-item label { color: var(--text-muted); font-size: 0.85em; display: block; margin-bottom: 8px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.detail-item .value { color: var(--text-primary); white-space: pre-wrap; }
.detail-item.full { grid-column: span 2; }

.actions { display: flex; gap: 12px; margin-top: 24px; }
.meta { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.9em; }

footer { text-align: center; padding: 40px; color: var(--text-muted); font-size: 0.9em; border-top: 1px solid var(--border); margin-top: 40px; }

/* ═══════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.card {
  animation: fadeIn 0.4s ease;
}

.stat-card {
  animation: scaleIn 0.4s ease;
  animation-fill-mode: both;
}
.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

.stat-card .number, .stat-card .stat-value {
  animation: countUp 0.6s ease;
  animation-fill-mode: both;
}
.stat-card:nth-child(1) .number { animation-delay: 0.3s; }
.stat-card:nth-child(2) .number { animation-delay: 0.4s; }
.stat-card:nth-child(3) .number { animation-delay: 0.5s; }
.stat-card:nth-child(4) .number { animation-delay: 0.6s; }

/* Hover animations */
.stat-card:hover {
  transform: translateY(-5px) scale(1.02);
}

.card:hover {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Loading shimmer */
.loading {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Smooth transitions for theme change */
*, *::before, *::after {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.2s ease;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

/* Tablet and below - hamburger menu */
@media (max-width: 1024px) {
  .hamburger { display: flex; }

  nav ul#navMenu {
    display: none;
    width: 100%;
    order: 3;
    flex-direction: column;
    padding: 8px;
    gap: 2px;
  }
  nav ul#navMenu.show {
    display: flex;
  }

  nav ul li.dropdown .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding: 0 0 0 16px;
    min-width: auto;
    background: transparent;
  }
  nav ul li.dropdown:hover .dropdown-menu {
    display: none;
  }
  nav ul li.dropdown .dropdown-menu.show {
    display: flex;
  }

  .breadcrumb { padding: 8px 15px; }
}

@media (max-width: 768px) {
  .container { padding: 15px; }

  nav .nav-content {
    padding: 12px 15px;
    gap: 10px;
    flex-wrap: wrap;
  }

  nav .logo-icon { width: 40px; height: 40px; font-size: 1.2em; border-radius: 10px; }
  nav .logo-main { font-size: 1.2em; }
  nav .logo-sub { font-size: 0.65em; letter-spacing: 2px; }

  nav .nav-right {
    order: 2;
    gap: 8px;
  }

  nav .search-box input { width: 100px; font-size: 0.85em; }

  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stats-row, .stat-cards {
    gap: 10px;
    flex-wrap: wrap;
  }

  .stat-card {
    flex: 1 1 calc(50% - 10px);
    min-width: 120px;
    padding: 15px;
  }

  .stat-card .stat-value, .stat-card .number { font-size: 1.5em; }

  h1 { font-size: 1.5em !important; }
  h2 { font-size: 1.2em !important; }

  /* Card header - flex wrap */
  .card-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .detail-grid { grid-template-columns: 1fr; }
  .detail-item.full { grid-column: span 1; }

  .actions { flex-wrap: wrap; }
  .btn { flex: 1; min-width: 120px; text-align: center; }

  /* Tabele - scroll poziomy */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Mobile */
@media (max-width: 480px) {
  html, body { 
    overflow-x: hidden !important; 
    max-width: 100vw !important;
  }
  
  .container { 
    padding: 10px; 
    max-width: 100vw;
    overflow-x: hidden;
  }
  
  nav .nav-content { 
    padding: 10px 12px;
    flex-direction: column;
    align-items: stretch;
  }
  
  nav .logo { justify-content: center; }
  nav .logo-icon { width: 36px; height: 36px; font-size: 1.1em; }
  nav .logo-main { font-size: 1.1em; }
  nav .logo-sub { display: none; }
  
  nav ul { 
    justify-content: flex-start;
    overflow-x: auto;
    gap: 4px;
    padding: 4px;
    border-radius: 8px;
  }
  
  nav ul li a { 
    padding: 6px 10px; 
    font-size: 0.75em;
    border-radius: 6px;
  }
  
  nav .nav-right { 
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  nav .search-box { 
    flex: 1;
    min-width: 150px;
  }
  nav .search-box input { 
    width: 100%; 
    font-size: 14px;
  }
  
  nav .user-menu {
    width: 100%;
    justify-content: center;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }
  
  .stat-card { 
    flex: 1 1 45%;
    padding: 12px;
  }
  
  .stat-card .stat-value { font-size: 1.3em; }
  .stat-card .stat-label { font-size: 0.7em; }
  
  h1 { font-size: 1.3em !important; }
  
  .card { padding: 15px; border-radius: 10px; }
  
  /* Card header - na mobile jeden pod drugim */
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .card-header h2 { font-size: 1.1em; margin: 0; }
  .card-header .btn { width: 100%; text-align: center; }
  
  table { font-size: 0.8em; display: block; overflow-x: auto; }
  th, td { padding: 8px 6px; white-space: nowrap; }
  
  .btn { padding: 10px 16px; font-size: 0.9em; }
  .btn-sm { padding: 8px 12px; font-size: 0.8em; }
  
  .form-group input,
  .form-group textarea,
  .form-group select { font-size: 16px; } /* Zapobiega zoom na iOS */
  
  footer { padding: 20px; font-size: 0.8em; }
  
  /* Stats grid - 2 w rzędzie */
  .stats { 
    grid-template-columns: 1fr 1fr; 
    gap: 10px;
  }
}

/* Tabele - scroll na mobile */
@media (max-width: 600px) {
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  
  table {
    min-width: 400px;
    max-width: 100%;
  }
  
  .card {
    max-width: 100%;
    overflow-x: auto;
  }
}

/* ═══════════════════════════════════════════════════════════════
   ASYSTENT LABORATORYJNY — widget + modal kreatora
   ═══════════════════════════════════════════════════════════════ */

.cc-assistant-widget {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
}

.cc-assistant-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.cc-assistant-header h3 {
  margin: 0;
  font-size: 1.05em;
  color: var(--text-primary, #fff);
}
.cc-assistant-icon { font-size: 1.4em; }
.cc-assistant-hint {
  font-size: 0.82em;
  color: var(--text-secondary, rgba(255,255,255,0.6));
  flex-basis: 100%;
  margin-left: 32px;
}

.cc-assistant-input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.cc-assistant-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border, rgba(255,255,255,0.15));
  background: var(--bg-secondary, rgba(0,0,0,0.3));
  color: var(--text-primary, #fff);
  border-radius: 10px;
  font-size: 0.95em;
  font-family: inherit;
  resize: vertical;
  min-height: 52px;
}
.cc-assistant-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.cc-assistant-btn-go {
  padding: 0 22px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.1s, box-shadow 0.2s;
}
.cc-assistant-btn-go:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}
.cc-assistant-btn-go:active { transform: translateY(0); }

.cc-assistant-shortcuts {
  margin-top: 12px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.cc-assistant-shortcuts-label {
  font-size: 0.82em;
  color: var(--text-secondary, rgba(255,255,255,0.5));
  margin-right: 4px;
}
.cc-assistant-chip {
  padding: 5px 12px;
  background: var(--bg-secondary, rgba(255,255,255,0.06));
  border: 1px solid var(--border, rgba(255,255,255,0.15));
  color: var(--text-primary, #fff);
  border-radius: 20px;
  font-size: 0.82em;
  cursor: pointer;
  transition: all 0.15s;
}
.cc-assistant-chip:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: #6366f1;
}

.cc-assistant-status {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.88em;
}
.cc-assistant-status-loading { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; }
.cc-assistant-status-ok { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.cc-assistant-status-warn { background: rgba(234, 179, 8, 0.15); color: #fde047; }
.cc-assistant-status-error { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }

/* ─── Modal kreatora ─── */
.cc-wizard-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cc-wizard-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}
.cc-wizard-dialog {
  position: relative;
  background: var(--bg-primary, #1a1a2e);
  color: var(--text-primary, #fff);
  border-radius: 14px;
  max-width: 820px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
}
.cc-wizard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.1));
}
.cc-wizard-header h2 { margin: 0; font-size: 1.2em; }
.cc-wizard-close {
  background: none;
  border: none;
  color: var(--text-secondary, rgba(255,255,255,0.6));
  font-size: 1.4em;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
}
.cc-wizard-close:hover { background: rgba(255,255,255,0.1); color: #fff; }

.cc-wizard-progress {
  display: flex;
  gap: 4px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
  overflow-x: auto;
}
.cc-wizard-progress-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.82em;
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary, rgba(255,255,255,0.5));
  white-space: nowrap;
  flex-shrink: 0;
}
.cc-wizard-progress-item .n {
  display: inline-flex;
  width: 22px; height: 22px;
  align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  font-weight: 600;
  font-size: 0.85em;
}
.cc-wizard-progress-item.current {
  background: rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
}
.cc-wizard-progress-item.current .n { background: #6366f1; color: #fff; }
.cc-wizard-progress-item.done {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}
.cc-wizard-progress-item.done .n { background: #22c55e; color: #fff; }

.cc-wizard-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.cc-wizard-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.cc-wizard-step-title {
  font-size: 1.05em;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary, #fff);
}
.cc-wizard-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.cc-wizard-field-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cc-wizard-field-wrap label {
  font-size: 0.85em;
  color: var(--text-secondary, rgba(255,255,255,0.7));
  font-weight: 500;
}
.cc-wizard-field {
  padding: 8px 12px;
  border: 1px solid var(--border, rgba(255,255,255,0.15));
  background: var(--bg-secondary, rgba(0,0,0,0.3));
  color: var(--text-primary, #fff);
  border-radius: 8px;
  font-size: 0.92em;
  font-family: inherit;
}
.cc-wizard-field:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
textarea.cc-wizard-field { min-height: 60px; resize: vertical; }

.cc-wizard-prefilled {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.08);
}
.cc-wizard-prefill-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.75em;
  color: #86efac;
  font-weight: 600;
}

.cc-wizard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.1));
  gap: 10px;
}
.cc-wizard-step-label {
  font-size: 0.85em;
  color: var(--text-secondary, rgba(255,255,255,0.5));
}

@media (max-width: 640px) {
  .cc-wizard-fields { grid-template-columns: 1fr; }
  .cc-assistant-input-row { flex-direction: column; }
  .cc-assistant-btn-go { padding: 12px; }
}

/* ─── Picker składników ─── */
.cc-wizard-fullrow { grid-column: 1 / -1; }

.cc-ingredients-hint {
  font-size: 0.78em;
  color: var(--text-secondary, rgba(255,255,255,0.5));
  font-weight: 400;
  margin-left: 6px;
}
.cc-ingredients-loading {
  padding: 10px;
  color: #a5b4fc;
  font-size: 0.88em;
}
.cc-ingredients-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.cc-ingredients-row {
  display: grid;
  grid-template-columns: 1fr 180px 36px;
  gap: 8px;
  align-items: center;
}
.cc-ingredients-row:has(.cc-ing-custom) {
  grid-template-columns: 1fr 1fr 180px 36px;
}
.cc-ing-select, .cc-ing-conc, .cc-ing-custom {
  padding: 7px 10px !important;
  font-size: 0.9em !important;
}
.cc-ing-remove {
  background: transparent;
  border: 1px solid var(--border, rgba(255,255,255,0.15));
  color: #fca5a5;
  border-radius: 8px;
  cursor: pointer;
  padding: 6px 10px;
  font-size: 1em;
  line-height: 1;
}
.cc-ing-remove:hover {
  background: rgba(239,68,68,0.15);
  border-color: #ef4444;
}
.cc-ingredients-add {
  padding: 7px 14px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px dashed rgba(99, 102, 241, 0.5);
  color: #c7d2fe;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88em;
}
.cc-ingredients-add:hover {
  background: rgba(99, 102, 241, 0.25);
  border-style: solid;
}

/* kolor opcji wg status — obsługiwane tylko w niektórych przeglądarkach */
.cc-ing-select option[data-status="low"] { color: #fbbf24; }
.cc-ing-select option[data-status="order"],
.cc-ing-select option[data-status="ordered"] { color: #9ca3af; font-style: italic; }

@media (max-width: 640px) {
  .cc-ingredients-row,
  .cc-ingredients-row:has(.cc-ing-custom) {
    grid-template-columns: 1fr;
  }
  .cc-ing-remove { justify-self: end; }
}
