:root {
  --bg: #f1f5f9;
  --bg-elevated: #ffffff;
  --surface: #f8fafc;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-light: #3b82f6;
  --accent-bg: #eff6ff;
  --success: #059669;
  --success-bg: #ecfdf5;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.07), 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --transition: 0.15s ease;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.container {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}
.brand h1, .brand h2 { margin: 0; line-height: 1.1; font-weight: 700; }
.brand p { margin: 4px 0 0; color: var(--text-muted); font-size: 0.92rem; }

/* Nav */
.nav { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ── Center main navigation ── */
.nav-main {
  flex: 1;
  justify-content: center;
  gap: 4px;
}
.nav-main a {
  position: relative;
  display: inline-flex;
  padding: 6px 14px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color var(--transition);
}
.nav-main a::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 3px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform var(--transition);
}
.nav-main a:hover {
  color: var(--text);
  background: var(--bg-elevated);
}
.nav-main a:hover::after {
  transform: scaleX(1);
}

/* ── Right action icons ── */
.nav-actions {
  justify-content: flex-end;
  gap: 2px;
}
.nav-actions .notification-bell,
.nav-user,
.nav-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.nav-actions svg {
  width: 20px;
  height: 20px;
}
.nav-actions .notification-bell:hover,
.nav-user:hover {
  background: var(--bg-elevated);
  color: var(--text);
}
.nav-logout:hover {
  background: var(--danger-bg);
  color: var(--danger);
}
.nav-logout-label {
  display: none;
}

/* ── Mobile: show logout label on small screens ── */
@media (max-width: 600px) {
  .nav-logout-label { display: inline; margin-left: 6px; font-size: 0.85rem; }
  .nav-user, .notification-bell, .nav-logout { width: auto; height: auto; padding: 6px 10px; border: 1px solid var(--border); }
}

/* ── Minimal nav for auth pages ── */
.nav-auth {
  justify-content: flex-end;
  gap: 8px;
}
.nav-auth a {
  padding: 7px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  transition: all var(--transition);
}
.nav-auth a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

/* ── Brand link ── */
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.22);
  flex-shrink: 0;
}
.brand h2 { margin: 0; line-height: 1.1; font-weight: 700; font-size: 1.25rem; }
.brand-text { display: flex; flex-direction: column; gap: 2px; }

/* ── Hamburger (mobile) ── */
.nav-hamburger { display: none; }
.hero, .panel, .card, .form-card, .section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  padding: 28px;
  display: grid;
  gap: 22px;
  grid-template-columns: 1.3fr 0.9fr;
  align-items: center;
}
.hero h1 { margin: 0 0 12px; font-size: clamp(2rem, 4vw, 3.8rem); font-weight: 800; letter-spacing: -0.02em; }
.hero p { color: var(--text-secondary); font-size: 1.05rem; line-height: 1.6; max-width: 58ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

/* Buttons */
.button, .button-secondary, .button-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.94rem;
  transition: all var(--transition);
}
.button {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.button:hover { background: #1d4ed8; transform: translateY(-1px); }
.button-secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.button-secondary:hover { background: var(--bg-elevated); border-color: var(--border-hover); }
.button-danger { background: var(--danger); color: white; }
.button-danger:hover { background: #b91c1c; transform: translateY(-1px); }

/* Alias klasy uzywane w HTML */
.btn, .btn-primary, .btn-secondary, .btn-text { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--radius-sm); padding: 10px 18px; cursor: pointer; font-weight: 600; font-size: 0.94rem; transition: all var(--transition); }
.btn-primary { background: var(--accent); color: white; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25); }
.btn-primary:hover { background: #1d4ed8; transform: translateY(-1px); }
.btn-secondary { background: var(--surface); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-elevated); border-color: var(--border-hover); }
.btn-text { background: transparent; color: var(--accent); padding: 4px 8px; font-weight: 500; }
.btn-text:hover { text-decoration: underline; }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid transparent; padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.btn-ghost:hover { text-decoration: underline; }

.mini-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mini-stat {
  padding: 18px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}
.mini-stat strong { display: block; font-size: 1.6rem; margin-bottom: 4px; color: var(--text); }
.mini-stat span { color: var(--text-muted); font-size: 0.86rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.card, .form-card, .section { padding: 22px; }
.card h3, .section h2, .form-card h2 { margin-top: 0; }
.card p, .section p, .form-card p { color: var(--text-muted); }

/* Filters / Forms */
.filters, .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.field { display: grid; gap: 6px; }
.field label { color: var(--text-secondary); font-size: 0.88rem; font-weight: 500; }
.input,
select,
textarea {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 10px 14px;
  font-size: 0.94rem;
  transition: all var(--transition);
}
.input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
textarea { min-height: 100px; resize: vertical; }

/* Table */
.table-wrap { overflow: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; min-width: 720px; background: var(--bg-elevated); }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
th { color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; background: var(--surface); }
td { color: var(--text); font-size: 0.92rem; }
tr:hover td { background: #f8fafc; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge.todo { background: var(--accent-bg); color: var(--accent); }
.badge.in_progress { background: var(--warning-bg); color: var(--warning); }
.badge.done { background: var(--success-bg); color: var(--success); }
.badge.archived { background: #f1f5f9; color: var(--text-muted); }
.badge.cancelled { background: #f1f5f9; color: var(--text-muted); }

/* Idea status badges */
.badge--active { background: var(--accent-bg); color: var(--accent); }
.badge--accepted { background: var(--success-bg); color: var(--success); }
.badge--rejected { background: var(--danger-bg); color: var(--danger); }
.badge--converted { background: var(--warning-bg); color: var(--warning); }
.badge--archived { background: #f1f5f9; color: var(--text-muted); }

.status-action { border: 0; background: transparent; padding: 0; cursor: pointer; font: inherit; }
.status-action:hover { transform: translateY(-1px); }

/* Notices */
.notice, .alert { border-radius: var(--radius-sm); padding: 12px 14px; margin: 12px 0 0; font-size: 0.9rem; }
.notice { background: var(--accent-bg); border: 1px solid #bfdbfe; color: #1e40af; }
.alert { background: var(--danger-bg); border: 1px solid #fecaca; color: #991b1b; }
.muted { color: var(--text-muted); }
.stack { display: grid; gap: 14px; }
.compact { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.small { font-size: 0.86rem; color: var(--text-muted); }
.auth-shell { width: min(440px, calc(100% - 32px)); margin: 64px auto; }

/* Toast */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.25s ease;
  max-width: 360px;
}
.toast.success { background: var(--success); color: white; }
.toast.error { background: var(--danger); color: white; }
.toast.info { background: var(--accent); color: white; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* Inline edit */
.inline-edit td { vertical-align: middle; }
.inline-edit input, .inline-edit select {
  padding: 8px 10px;
  font-size: 0.88rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  width: 100%;
}

/* FTP Modal */
.ftp-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.ftp-modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: min(560px, 100%);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.ftp-modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.ftp-modal header h3 { margin: 0; font-size: 1.05rem; }
.ftp-modal .ftp-body { padding: 14px 20px; overflow: auto; }
.ftp-modal .ftp-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 12px;
}
.ftp-modal .ftp-breadcrumb button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.8rem;
}
.ftp-list { display: grid; gap: 6px; }
.ftp-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}
.ftp-item:hover { border-color: var(--border-hover); background: #f8fafc; }
.ftp-item .name { display: flex; align-items: center; gap: 10px; }
.ftp-item .name .icon { width: 22px; text-align: center; font-size: 1.1rem; }
.ftp-item .actions { display: flex; gap: 8px; }
.ftp-modal footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

/* Profile page */
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
}
.profile-title { flex: 1; }
.profile-title h2 { margin: 0; }
.profile-title p { margin: 4px 0 0; color: var(--text-muted); }

/* Project detail */
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}
.project-meta .chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Animations */
@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.card { animation: slideIn 0.2s ease; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 20px; }
  .topbar { flex-wrap: wrap; gap: 12px; }
  .nav { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .hero { padding: 18px; }
  .hero h1 { font-size: 1.8rem; }
  .hero p  { font-size: 0.95rem; }
  .hero-actions { flex-direction: column; gap: 10px; }
  .hero-actions .button,
  .hero-actions .button-secondary { width: 100%; justify-content: center; }
  .brand h2 { font-size: 20px; }
  .brand p   { font-size: 13px; }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .grid { grid-template-columns: 1fr !important; }
  .filters, .form-grid { grid-template-columns: 1fr; }
  .mini-stats { grid-template-columns: repeat(2, 1fr); }
  .auth-shell { width: calc(100% - 24px); margin: 24px auto; }
  .profile-header { flex-direction: column; gap: 16px; align-items: flex-start; }
  .project-header { flex-direction: column; }
  .compact { flex-direction: column; align-items: stretch; }
  .table-wrap { overflow-x: auto; }
  table { min-width: 600px; }
  .modal-card { padding: 16px; margin: 8px; width: 100%; }
  .ftp-overlay { padding: 8px; }
  .ftp-modal { width: 100%; margin: 0; }
  .toast-container { bottom: 12px; right: 12px; left: 12px; }
  .toast { max-width: 100%; width: 100%; }
}

/* ── Toast / Notification ── */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  padding: 14px 24px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-weight: 500;
  font-size: 0.9rem;
  animation: slideInUp 0.3s ease;
  max-width: 340px;
}
.toast.success { border-left: 4px solid var(--success); color: var(--success); }
.toast.error   { border-left: 4px solid var(--danger);  color: var(--danger); }
.toast.info    { border-left: 4px solid var(--accent); color: var(--accent); }

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

/* ── Loading / Spinner ── */
.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(241,245,249,0.65);
  backdrop-filter: blur(3px);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-overlay .spinner { width: 36px; height: 36px; }

/* ── Skeleton shimmer ── */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, #e2e8f0 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Modal / Overlay ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}
.modal-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  padding: 24px;
  animation: scaleIn 0.25s ease;
}

/* ── Standard Modal (modal-content + header/body/footer) ── */
.modal-content {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  animation: scaleIn 0.25s ease;
}
.modal-content.modal-large { max-width: 800px; }
.modal-card.modal-large { max-width: 900px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}
.modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #111827;
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.modal-close:hover {
  color: #374151;
  background: #f3f4f6;
}
.modal-body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}
.modal-body .form-group {
  margin-bottom: 16px;
}
.modal-body .form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}
.modal-body .form-group select,
.modal-body .form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fff;
}
.modal-body .form-group select:focus,
.modal-body .form-group input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.modal-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}
.modal-footer .btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.modal-footer .btn-primary {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}
.modal-footer .btn-primary:hover { background: #4f46e5; }
.modal-footer .btn-secondary {
  background: #fff;
  color: #374151;
  border-color: #d1d5db;
}
.modal-footer .btn-secondary:hover { background: #f3f4f6; }
.modal-footer .btn-ghost {
  background: transparent;
  color: #6366f1;
  border-color: transparent;
  margin-left: auto;
}
.modal-footer .btn-ghost:hover { text-decoration: underline; }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* ── Tag chips ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-bg);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.tag.low     { background: #dcfce7; color: #166534; }
.tag.medium  { background: #fef9c3; color: #854d0e; }
.tag.high    { background: #fee2e2; color: #991b1b; }
.tag.draft   { background: #f3f4f6; color: #6b7280; }
.tag.active  { background: #dbeafe; color: #1e40af; }
.tag.archived{ background: #e5e7eb; color: #4b5563; }

/* ── Progress ── */
.progress {
  height: 10px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 999px;
  transition: width 0.5s ease;
}

/* ── Empty state ── */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty svg, .empty .icon {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

/* ── Scrollbar light ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ── Notifications ── */
.notification-wrapper { position: relative; }
.notification-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.notification-bell:hover { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-light); }
.notification-bell svg { width: 20px; height: 20px; }
.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-elevated);
}
.notification-badge.show { display: inline-flex; }
.notification-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  max-height: 420px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
}
.notification-wrapper.open .notification-dropdown {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.notification-header h4 { font-size: 14px; margin: 0; color: var(--text); }
.notification-header .btn-text {
  font-size: 12px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.notification-header .btn-text:hover { text-decoration: underline; }
.notification-list {
  max-height: 280px;
  overflow-y: auto;
}
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}
.notification-item:last-child { border-bottom: none; }
.notification-item:hover { background: var(--accent-bg); }
.notification-item.unread { background: var(--accent-bg); }
.notification-item.unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.notification-item .n-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 11px;
}
.notification-item .n-icon.info    { background: var(--accent-bg); color: var(--accent); }
.notification-item .n-icon.success { background: var(--success-bg); color: var(--success); }
.notification-item .n-icon.warning { background: var(--warning-bg); color: var(--warning); }
.notification-item .n-icon.error   { background: var(--danger-bg); color: var(--danger); }
.notification-item .n-content { flex: 1; min-width: 0; }
.notification-item .n-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notification-item .n-msg {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notification-item .n-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
}
.notification-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.notification-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  text-align: center;
  background: var(--surface);
}
.notification-footer a {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}
.notification-footer a:hover { text-decoration: underline; }

/* ============================================================
   RESPONSYWNOŚC I NOWY TOPBAR
   ============================================================ */

/* ---- Nawigacja mobilna: topbar zostaje 1-liniowy ---- */
@media (max-width: 720px) {
  .topbar {
    flex-wrap: nowrap;
    gap: 8px;
    position: relative;
    z-index: 100;
  }

  /* brand skurczony */
  .brand-text { display: none; }

  .nav-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ukryj centrum i prawy na mobile domyślnie */
  .nav-main,
  .nav-actions {
    display: none;
    width: 100%;
    order: 3;
    padding: 6px 0;
    gap: 4px;
  }
  .nav-main { flex-direction: column; align-items: stretch; }
  .nav-actions {
    flex-direction: row;
    justify-content: flex-start;
    padding-top: 0;
  }

  /* rozwinięte */
  .nav-main.open,
  .nav-actions.open { display: flex; }

  /* nav-actions na mobile: wąski panel z ikonami w rzędzie */
  .nav-actions.open {
    order: 4;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    margin-top: 4px;
  }
  .nav-actions.open .nav-logout-label { display: none; }

  /* linki mobilne -> lista */
  .nav-main a {
    display: block;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text);
  }
  .nav-main a:hover {
    background: var(--accent-bg);
    color: var(--accent);
  }
  .nav-main a::after { display: none; }

  /* action ikony na mobile -> label + row */
  .nav-actions .notification-bell,
  .nav-actions .nav-user,
  .nav-actions .nav-logout {
    width: auto;
    height: auto;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    gap: 6px;
  }
  .nav-logout-label { display: inline; font-size: 0.85rem; }

  /* powiadomienia full-width w mobilnym menu */
  .notification-wrapper { width: auto; }
  .notification-bell {
    justify-content: flex-start;
  }
  .notification-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
  }

  .container {
    width: calc(100% - 16px);
    padding: 12px 0 32px;
  }
}

/* ---- Very small phones ---- */
@media (max-width: 380px) {
  .container {
    width: calc(100% - 8px);
    padding: 8px 0 24px;
  }
  .brand h2 { font-size: 18px; }
  .brand p   { font-size: 12px; }
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .notification-dropdown {
    width: 100%;
  }
}

/* ---- Tablet ---- */
@media (min-width: 721px) and (max-width: 1024px) {
  .container {
    width: min(960px, calc(100% - 32px));
  }
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- Desktop ---- */
@media (min-width: 1025px) {
  .grid {
    grid-template-columns: repeat(var(--cols, 2), 1fr);
  }
}

/* ---- Tabs ---- */
.tabs-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

.tab-btn[aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--bg-elevated);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ---- Tables ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

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

.data-table tr:hover td {
  background: var(--surface);
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-dot.active { background: var(--success); }
.status-dot.inactive { background: var(--danger); }
.status-dot.draft { background: var(--warning); }
.status-dot.in_progress { background: var(--accent-light); }
.status-dot.pending { background: var(--warning); }

/* ---- Chat ---- */
.chat-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  min-height: 260px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg { display: flex; gap: 10px; }
.chat-msg.assistant { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }

.chat-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  max-width: 80%;
  font-size: 14px;
  line-height: 1.5;
}

.chat-msg.assistant .chat-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.chat-msg.user .chat-bubble {
  background: var(--accent);
  color: #fff;
}

.chat-input-group {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.chat-input-group input {
  flex: 1;
}

.chat-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 40px 20px;
  font-size: 14px;
}

/* ---- Generated tasks ---- */
.generated-task-item {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.generated-task-item .task-info { flex: 1; }
.generated-task-item .task-actions { display: flex; gap: 8px; }


/* ---- Ads specific ---- */
.ads-tabs {
  margin-bottom: 20px;
}

.ads-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ---- Settings ---- */
.settings-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-nav button {
  text-align: left;
  padding: 10px 14px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.settings-nav button:hover {
  background: var(--surface);
  color: var(--text);
}

.settings-nav button.active {
  background: var(--accent-bg);
  color: var(--accent);
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: block;
}

.settings-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.settings-card h3 {
  margin: 0 0 20px;
  font-size: 18px;
}

.settings-form .field {
  margin-bottom: 16px;
}

.settings-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.settings-form input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
}

.settings-form input:disabled {
  background: var(--bg);
  color: var(--text-muted);
}

.settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-row .info h4 {
  margin: 0 0 4px;
  font-size: 15px;
}

.toggle-row .info p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border);
  border-radius: 24px;
  transition: var(--transition);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

@media (max-width: 720px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Task cards (project detail) ── */
.task-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  animation: slideIn 0.2s ease;
}

.task-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

.task-card-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-card-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
}

.task-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.task-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.task-card-footer {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.task-card-footer .small {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.task-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.task-card-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
}

.task-card-actions button:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
  transform: translateY(-1px);
}

.task-card-actions .button-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #fecaca;
}

.task-card-actions .button-danger:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.button-small {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.task-card.inline-edit {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.task-card .badge {
  font-size: 0.75rem;
  padding: 3px 10px;
}

/* ── Progress bar (project detail) ── */
.progress {
  background: var(--border);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}
.progress-bar {
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

@media (max-width: 720px) {
  .task-card-header {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .task-card-meta { justify-content: flex-start; }
  .task-card-actions {
    flex-direction: row;
    justify-content: flex-start;
    border-top: none;
    padding-top: 0;
  }
  .hero-actions button { flex: 1 1 100%; }
}

/* ═══════════════════════════════════════
   ERROR PAGES (404 / 500)
   ═══════════════════════════════════════ */
.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 65vh;
  padding: 32px 20px;
  text-align: center;
}
.error-illustration {
  width: 200px;
  height: 160px;
  margin-bottom: 24px;
}
.error-illustration svg {
  width: 100%;
  height: 100%;
  display: block;
}
.error-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}
.error-desc {
  font-size: 1rem;
  color: #6b7280;
  max-width: 420px;
  line-height: 1.55;
  margin-bottom: 24px;
}
.error-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.error-actions .btn { min-width: 140px; }

/* ═══════════════════════════════════════
   KANBAN BOARD
   ═══════════════════════════════════════ */
.kanban-filter {
  display: flex;
  gap: 8px;
  align-items: center;
}
.kanban-filter label {
  font-size: 0.875rem;
  color: #6b7280;
}
.kanban-filter select {
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  font-size: 0.875rem;
  cursor: pointer;
  min-width: 160px;
}
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 20px;
}
.kanban-column {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}
.kanban-column-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}
.kanban-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.kanban-count {
  margin-left: auto;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}
.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.kanban-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
  position: relative;
}
.kanban-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-color: #cbd5e1;
}
.kanban-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #111827;
  margin-bottom: 6px;
  line-height: 1.35;
}
.kanban-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.kanban-card-priority {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.kanban-card-due {
  font-size: 0.75rem;
  color: #6b7280;
}
.kanban-card-project {
  font-size: 0.75rem;
  color: #6366f1;
  background: #eef2ff;
  padding: 2px 8px;
  border-radius: 4px;
}
.kanban-modal-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: #111827;
  margin-bottom: 14px;
}

/* ═══════════════════════════════════════
   COMMENTS / TASK OVERLAY
   ═══════════════════════════════════════ */
.comments-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.comments-modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}
.comments-header h3 {
  margin: 0;
  font-size: 1.1rem;
}
.comments-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.comment-item {
  background: #f9fafb;
  border-radius: 8px;
  padding: 12px;
}
.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.8rem;
  color: #6b7280;
}
.comment-author {
  font-weight: 600;
  color: #374151;
}
.comment-text {
  font-size: 0.92rem;
  color: #111827;
  line-height: 1.45;
  white-space: pre-wrap;
}
.comments-form {
  padding: 12px 20px 16px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.comments-form textarea {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 120px;
}
.comments-empty {
  text-align: center;
  color: #9ca3af;
  padding: 24px;
  font-size: 0.9rem;
}

@media (max-width: 1024px) {
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .kanban-board { grid-template-columns: 1fr; }
  .kanban-filter { flex-wrap: wrap; }
  .comments-modal { max-height: 90vh; }
}

/* ═══════════════════════════════════════
   GLOBAL SEARCH
   ═══════════════════════════════════════ */
.global-search { position: relative; }
.global-search input {
  width: 220px;
  padding: 6px 12px 6px 32px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.88rem;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.442.656a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") no-repeat 10px center;
  transition: width .2s, box-shadow .2s;
}
.global-search input:focus {
  width: 300px;
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.global-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  max-height: 60vh;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}
.global-search-results.open { display: block; }
.gsr-section { padding: 8px 0; }
.gsr-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9ca3af;
  padding: 4px 14px;
}
.gsr-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
  color: #111827;
  font-size: 0.9rem;
}
.gsr-item:hover { background: #f3f4f6; }
.gsr-icon { font-size: 1rem; width: 22px; text-align: center; }
.gsr-empty { padding: 14px; text-align: center; color: #9ca3af; font-size: 0.88rem; }

/* ═══════════════════════════════════════
   AI CONTEXT PANEL
   ═══════════════════════════════════════ */
.ai-context {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1px solid #c4b5fd;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.ai-context h4 { margin: 0 0 8px; font-size: 1.05rem; }
.ai-context .stats { display: flex; gap: 20px; }
.ai-context .stat { text-align: center; }
.ai-context .stat .num { font-size: 1.4rem; font-weight: 700; color: #6d28d9; }
.ai-context .stat .lbl { font-size: 0.8rem; color: #6b7280; }
.ai-actions { display: flex; gap: 10px; margin-bottom: 16px; }
.ai-loading { text-align: center; color: #6b7280; padding: 20px; font-size: 0.9rem; }
.ai-result { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px; font-size: 0.92rem; line-height: 1.6; }
.ai-result:empty { display: none; }

/* ═══════════════════════════════════════
    FTP BROWSER
    ═══════════════════════════════════════ */
.ftp-browser { padding: 0; overflow: hidden; }
.ftp-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}
.ftp-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: #374151;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 4px 10px;
  flex: 1;
  min-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ftp-status {
  font-size: 0.8rem;
  color: #6b7280;
}
.ftp-list {
  padding: 8px;
  min-height: 300px;
}
.ftp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s;
}
.ftp-row:hover { background: #f3f4f6; }
.ftp-row .icon { font-size: 1.1rem; width: 24px; text-align: center; }
.ftp-row .name { flex: 1; font-size: 0.92rem; color: #111827; }
.ftp-row .meta { font-size: 0.8rem; color: #6b7280; font-family: monospace; }
.ftp-empty { text-align: center; padding: 40px; color: #9ca3af; }

/* ═══════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════ */
.hide { display: none !important; }

/* ═══════════════════════════════════════
   IDEAS
   ═══════════════════════════════════════ */
.ideas-page { max-width: 960px; margin: 0 auto; }
.ideas-toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.ideas-toolbar .input { max-width: 240px; }
.idea-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 14px; margin-bottom: 12px; transition: box-shadow .15s; }
.idea-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.06); }
.idea-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.idea-card-header h4 { margin: 0; font-size: 1.05rem; }
.idea-card-body { color: #4b5563; font-size: 0.92rem; margin-bottom: 10px; }
.idea-card-footer { display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; color: #9ca3af; }
.idea-card-footer .btn-text { font-size: 0.82rem; }
.idea-mini { background: #f9fafb; border-radius: 8px; padding: 10px; margin-bottom: 8px; border: 1px solid #e5e7eb; }

/* ═══════════════════════════════════════
   BOOKS / DOCUMENTS
   ═══════════════════════════════════════ */
.books-page { max-width: 1200px; margin: 0 auto; }
.books-toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.book-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; text-align: center; transition: transform .1s, box-shadow .15s; }
.book-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.book-icon { font-size: 2.5rem; margin-bottom: 8px; }
.book-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 6px; color: #111827; }
.book-meta { display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 0.78rem; flex-wrap: wrap; }
.book-detail-tabs { display: flex; gap: 8px; border-bottom: 1px solid #e5e7eb; margin-bottom: 12px; padding-bottom: 6px; }
.tab-btn { background: none; border: none; padding: 6px 12px; font-size: 0.88rem; cursor: pointer; border-radius: 6px; color: #6b7280; }
.tab-btn.active { background: #eef2ff; color: #4f46e5; font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.scroll-box { max-height: 400px; overflow-y: auto; background: #f9fafb; padding: 12px; border-radius: 8px; white-space: pre-wrap; font-size: 0.88rem; }
.ai-model-select { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.ai-result-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px; font-size: 0.92rem; margin-top: 10px; line-height: 1.6; }

/* ═══════════════════════════════════════
   SCHEDULER / CONTENT PLANNER CALENDAR
   ═══════════════════════════════════════ */
.scheduler-container { max-width: 1400px; margin: 0 auto; }
.scheduler-layout { display: flex; gap: 20px; }
.scheduler-sidebar { width: 260px; flex-shrink: 0; }
.scheduler-main { flex: 1; min-width: 0; }

/* Sidebar */
.sched-sidebar { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; }
.sched-sidebar-section { margin-bottom: 20px; }
.sched-sidebar-section h4 { margin: 0 0 12px; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em; }
.sched-filter-group { margin-bottom: 12px; }
.sched-filter-group label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.sched-checkbox { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 6px; cursor: pointer; }
.sched-checkbox input { accent-color: var(--accent); }

/* Tabs */
.scheduler-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid var(--border); padding-bottom: 0; }
.sched-tab { background: none; border: none; padding: 10px 18px; cursor: pointer; font-size: 0.92rem; color: var(--text-secondary); border-radius: var(--radius-sm) var(--radius-sm) 0 0; transition: all 0.15s; font-weight: 500; }
.sched-tab:hover { background: var(--surface); color: var(--text); }
.sched-tab.active { border-bottom: 3px solid var(--accent); color: var(--accent); font-weight: 600; background: var(--accent-bg); }

/* Calendar Header */
.sched-calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.sched-nav { display: flex; gap: 6px; }
.sched-week-title { font-size: 1.25rem; font-weight: 600; color: var(--text); margin: 0; }

/* Calendar Grid */
.sched-calendar-grid { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.sched-calendar-header-row { display: grid; grid-template-columns: 60px repeat(7, 1fr); border-bottom: 1px solid var(--border); background: var(--surface); }
.sched-time-col-header { padding: 12px; border-right: 1px solid var(--border); }
.sched-day-header { padding: 12px 8px; text-align: center; border-right: 1px solid var(--border); transition: background 0.15s; }
.sched-day-header.today { background: var(--accent-bg); }
.sched-day-header:last-child { border-right: none; }
.sched-day-name { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em; }
.sched-day-date { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-top: 2px; }
.sched-day-header.today .sched-day-date { color: var(--accent); }

/* Calendar Rows */
.sched-calendar-row { display: grid; grid-template-columns: 60px repeat(7, 1fr); border-bottom: 1px solid var(--border); }
.sched-calendar-row:last-child { border-bottom: none; }
.sched-time-label { padding: 8px; font-size: 0.75rem; color: var(--text-muted); text-align: right; border-right: 1px solid var(--border); background: var(--surface); }
.sched-calendar-cell { min-height: 48px; padding: 4px; border-right: 1px solid var(--border); position: relative; transition: background 0.1s; }
.sched-calendar-cell:last-child { border-right: none; }
.sched-calendar-cell:hover { background: var(--surface); }

/* Event Cards */
.sched-event-card { background: var(--bg-elevated); border-left: 3px solid; border-radius: 6px; padding: 6px 8px; margin-bottom: 4px; cursor: pointer; transition: transform 0.1s, box-shadow 0.15s; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.sched-event-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.sched-event-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.sched-event-icon { font-size: 0.9rem; }
.sched-event-plat { font-size: 0.8rem; opacity: 0.7; }
.sched-event-title { font-size: 0.8rem; font-weight: 500; color: var(--text); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-event-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* List Header */
.sched-list-header { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }

/* Modal Form */
.sched-form-modal { max-width: 900px !important; padding: 0 !important; overflow: hidden; }
.sched-form-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
.sched-form-header h3 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.sched-form-body { padding: 20px; max-height: calc(100vh - 160px); overflow-y: auto; }
.sched-form-columns { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.sched-form-left { min-width: 0; }
.sched-form-right { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; min-width: 0; background: var(--surface); border-radius: var(--radius-sm); padding: 16px; border: 1px solid var(--border); }
.preview-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.03em; }

/* Form Elements */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.char-counter { font-size: 0.75rem; color: var(--text-muted); text-align: right; margin-top: 4px; }

/* Media Upload */
.media-upload-area { margin-bottom: 12px; }
.media-dropzone { border: 2px dashed var(--border); border-radius: var(--radius-sm); padding: 24px; text-align: center; cursor: pointer; transition: all 0.15s; background: var(--bg); }
.media-dropzone:hover { border-color: var(--accent); background: var(--accent-bg); }
.media-dropzone-icon { font-size: 2rem; margin-bottom: 8px; }
.media-dropzone-text { font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); }
.media-dropzone-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.media-preview { margin-top: 12px; }
.media-preview img, .media-preview video { max-width: 100%; border-radius: var(--radius-sm); }

/* Phone Preview */
.phone-preview { display: flex; justify-content: center; width: 100%; }
.phone-frame { width: 280px; max-width: 100%; height: 500px; background: #1a1a2e; border-radius: 36px; padding: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); position: relative; }
.phone-notch { width: 120px; height: 24px; background: #1a1a2e; position: absolute; top: 0; left: 50%; transform: translateX(-50%); border-radius: 0 0 16px 16px; z-index: 10; }
.phone-screen { width: 100%; height: 100%; border-radius: 28px; overflow-y: auto; position: relative; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.phone-screen::-webkit-scrollbar { width: 0; }

/* ── Instagram Preview ── */
.phone-screen.platform-instagram { background: #fff; font-size: 12px; color: #262626; }
.phone-screen.platform-instagram .ig-topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 6px; font-size: 11px; font-weight: 600; }
.phone-screen.platform-instagram .ig-topbar-brand { font-family: 'Billabong', 'Segoe Script', cursive; font-size: 16px; }
.phone-screen.platform-instagram .ig-post-header { display: flex; align-items: center; gap: 8px; padding: 6px 12px; }
.phone-screen.platform-instagram .ig-avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.phone-screen.platform-instagram .ig-avatar-inner { width: 24px; height: 24px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 10px; color: #262626; }
.phone-screen.platform-instagram .ig-username { font-weight: 600; font-size: 12px; flex: 1; }
.phone-screen.platform-instagram .ig-dots { color: #262626; font-weight: 700; }
.phone-screen.platform-instagram .ig-media { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.phone-screen.platform-instagram .ig-actions { display: flex; gap: 12px; padding: 8px 12px; font-size: 18px; }
.phone-screen.platform-instagram .ig-actions-right { margin-left: auto; }
.phone-screen.platform-instagram .ig-likes { padding: 0 12px 4px; font-weight: 600; font-size: 12px; }
.phone-screen.platform-instagram .ig-caption { padding: 0 12px 8px; font-size: 12px; line-height: 1.4; }
.phone-screen.platform-instagram .ig-caption strong { font-weight: 600; margin-right: 4px; }
.phone-screen.platform-instagram .ig-cta { margin: 4px 12px 8px; font-size: 11px; color: #0095f6; font-weight: 600; }
.phone-screen.platform-instagram .ig-story { position: relative; width: 100%; height: 100%; display: flex; align-items: flex-end; background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.6) 70%); }
.phone-screen.platform-instagram .ig-story-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.phone-screen.platform-instagram .ig-story-bar { position: absolute; top: 8px; left: 8px; right: 8px; height: 3px; background: rgba(255,255,255,0.3); border-radius: 2px; }
.phone-screen.platform-instagram .ig-story-fill { height: 100%; width: 40%; background: #fff; border-radius: 2px; }
.phone-screen.platform-instagram .ig-story-user { position: absolute; top: 16px; left: 12px; display: flex; align-items: center; gap: 6px; color: #fff; font-size: 11px; font-weight: 600; }
.phone-screen.platform-instagram .ig-story-text { color: #fff; padding: 0 16px 24px; font-size: 11px; text-shadow: 0 1px 3px rgba(0,0,0,0.5); z-index: 2; }

/* ── Facebook Preview ── */
.phone-screen.platform-facebook { background: #f0f2f5; font-size: 12px; color: #1c1e21; }
.phone-screen.platform-facebook .fb-topbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; border-bottom: 1px solid #ddd; }
.phone-screen.platform-facebook .fb-logo { width: 28px; height: 28px; border-radius: 50%; background: #1877f2; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.phone-screen.platform-facebook .fb-search { flex: 1; height: 28px; border-radius: 14px; background: #e4e6eb; display: flex; align-items: center; padding: 0 10px; font-size: 11px; color: #65676b; }
.phone-screen.platform-facebook .fb-post { background: #fff; margin: 8px 0; border-radius: 0; border: 1px solid #ddd; border-left: 0; border-right: 0; }
.phone-screen.platform-facebook .fb-post-header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.phone-screen.platform-facebook .fb-avatar { width: 36px; height: 36px; border-radius: 50%; background: #1877f2; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.phone-screen.platform-facebook .fb-page-name { font-weight: 600; font-size: 13px; }
.phone-screen.platform-facebook .fb-post-meta { font-size: 10px; color: #65676b; display: flex; align-items: center; gap: 4px; }
.phone-screen.platform-facebook .fb-spons-label { font-size: 10px; color: #65676b; padding: 2px 12px 8px; }
.phone-screen.platform-facebook .fb-post-text { padding: 0 12px 10px; font-size: 12px; line-height: 1.4; }
.phone-screen.platform-facebook .fb-media { width: 100%; max-height: 180px; object-fit: cover; display: block; }
.phone-screen.platform-facebook .fb-cta-wrap { padding: 6px 12px; }
.phone-screen.platform-facebook .fb-cta-btn { display: block; width: 100%; background: #1877f2; color: #fff; border: none; border-radius: 6px; padding: 8px; font-size: 12px; font-weight: 600; text-align: center; cursor: pointer; }
.phone-screen.platform-facebook .fb-post-footer { padding: 6px 12px; display: flex; justify-content: space-between; font-size: 10px; color: #65676b; border-top: 1px solid #e4e6eb; }
.phone-screen.platform-facebook .fb-actions { display: flex; justify-content: space-around; padding: 4px 0; border-top: 1px solid #e4e6eb; }
.phone-screen.platform-facebook .fb-action { font-size: 11px; color: #65676b; display: flex; align-items: center; gap: 4px; padding: 6px 0; }
.phone-screen.platform-facebook .fb-ad-label { font-size: 10px; color: #65676b; padding: 4px 12px 6px; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Analytics Dashboard ── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.kpi-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px 20px; box-shadow: var(--shadow-sm); transition: all var(--transition); }
.kpi-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi-card .kpi-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.kpi-card .kpi-icon { font-size: 1.25rem; width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--accent-bg); flex-shrink: 0; }
.kpi-card .kpi-title { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-card .kpi-value { font-size: 1.75rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.kpi-card .kpi-sub { font-size: 0.8rem; color: var(--text-muted); margin: 0; }

/* metric tooltip icon */
.metric-tip-icon { display: inline-block; font-size: 0.72rem; cursor: pointer; opacity: 0.5; vertical-align: middle; transition: opacity 0.15s; user-select: none; }
.metric-tip-icon:hover { opacity: 1; }

/* metric popup */
.metric-popup { position: fixed; z-index: 9999; background: #1e293b; color: #f1f5f9; padding: 12px 16px; border-radius: 8px; font-size: 0.82rem; line-height: 1.5; max-width: 280px; box-shadow: 0 4px 20px rgba(0,0,0,0.25); display: none; pointer-events: auto; }
.metric-popup.show { display: block; }
.metric-popup-close { position: absolute; top: 4px; right: 8px; cursor: pointer; font-size: 0.8rem; opacity: 0.6; color: #94a3b8; }
.metric-popup-close:hover { opacity: 1; color: #fff; }

/* ── Alerts Section ── */
.alerts-section { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.alerts-section .section-title { font-size: 0.95rem; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.alert-item { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 18px; display: flex; align-items: center; gap: 14px; position: relative; overflow: hidden; box-shadow: var(--shadow-sm); transition: all var(--transition); animation: slideIn 0.25s ease; }
.alert-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 4px 0 0 4px; }
.alert-item:hover { border-color: var(--border-hover); box-shadow: var(--shadow); }
.alert-item.red::before { background: var(--danger); }
.alert-item.orange::before { background: var(--warning); }
.alert-item.green::before { background: var(--success); }
.alert-item .alert-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.alert-item.red .alert-icon { background: var(--danger-bg); color: var(--danger); }
.alert-item.orange .alert-icon { background: var(--warning-bg); color: var(--warning); }
.alert-item.green .alert-icon { background: var(--success-bg); color: var(--success); }
.alert-item .alert-content { flex: 1; min-width: 0; }
.alert-item .alert-title { font-size: 0.9rem; font-weight: 600; color: var(--text); margin: 0 0 2px; }
.alert-item .alert-desc { font-size: 0.82rem; color: var(--text-muted); margin: 0; }
.alert-item .alert-action { display: inline-flex; align-items: center; justify-content: center; padding: 6px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-secondary); font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all var(--transition); white-space: nowrap; }
.alert-item .alert-action:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }

/* ── Ranking Table ── */
.ranking-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.ranking-table thead th { text-align: left; padding: 12px 16px; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); background: var(--surface); border-bottom: 2px solid var(--border); }
.ranking-table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
.ranking-table tbody tr:nth-child(even) td { background: var(--surface); }
.ranking-table tbody tr:hover td { background: var(--accent-bg); }
.ranking-table tbody tr:last-child td { border-bottom: none; }
.ranking-table .rank-col { font-weight: 700; font-size: 1rem; color: var(--text); text-align: center; width: 48px; }
.ranking-table .roas-cell { font-weight: 700; text-align: right; padding: 10px 16px; }
.ranking-table .roas-high { background: rgba(5, 150, 105, 0.12); color: var(--success); }
.ranking-table .roas-mid { background: rgba(217, 119, 6, 0.1); color: var(--warning); }
.ranking-table .roas-low { background: rgba(220, 38, 38, 0.1); color: var(--danger); }
.ranking-table .traffic-cell { text-align: center; }
.ranking-table .traffic-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 2px; }
.ranking-table .traffic-dot.red    { background: var(--danger); }
.ranking-table .traffic-dot.yellow { background: var(--warning); }
.ranking-table .traffic-dot.green  { background: var(--success); }
.ranking-table .trend-cell { text-align: right; font-weight: 600; }
.ranking-table .trend-cell.up   { color: var(--success); }
.ranking-table .trend-cell.down { color: var(--danger); }

/* ── Chart Container ── */
.chart-container { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 24px; margin-bottom: 24px; overflow-x: auto; }
.chart-container .chart-title { font-size: 0.95rem; font-weight: 700; color: var(--text); margin: 0 0 16px; }

/* ── Conversion Funnel ── */
.funnel-container { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.funnel-bar { display: flex; align-items: center; gap: 14px; animation: funnel-slide 0.4s ease forwards; opacity: 0; }
.funnel-bar:nth-child(1) { animation-delay: 0.05s; }
.funnel-bar:nth-child(2) { animation-delay: 0.12s; }
.funnel-bar:nth-child(3) { animation-delay: 0.19s; }
.funnel-bar:nth-child(4) { animation-delay: 0.26s; }
.funnel-bar:nth-child(5) { animation-delay: 0.33s; }
.funnel-bar:nth-child(6) { animation-delay: 0.40s; }
@keyframes funnel-slide { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: translateX(0); } }
.funnel-bar .funnel-fill { height: 42px; border-radius: var(--radius-sm); display: flex; align-items: center; padding: 0 16px; font-size: 0.85rem; font-weight: 700; color: #fff; min-width: 60px; white-space: nowrap; transition: width 0.4s ease; }
.funnel-bar .funnel-label { font-size: 0.85rem; font-weight: 600; color: var(--text); min-width: 100px; white-space: nowrap; }
.funnel-bar .funnel-count { font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; margin-left: 8px; }
.funnel-bar .funnel-fill.funnel-stage-1 { background: linear-gradient(135deg, #6366f1, #818cf8); width: 100% !important; }
.funnel-bar .funnel-fill.funnel-stage-2 { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.funnel-bar .funnel-fill.funnel-stage-3 { background: linear-gradient(135deg, var(--accent), var(--accent-light)); }
.funnel-bar .funnel-fill.funnel-stage-4 { background: linear-gradient(135deg, #06b6d4, #22d3ee); }

/* Form Footer */
.sched-form-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border); background: var(--surface); }

/* Responsive */
@media (max-width: 1024px) {
  .scheduler-layout { flex-direction: column; }
  .sched-sidebar { width: 100%; }
  .sched-form-columns { grid-template-columns: 1fr; }
  .sched-form-right { display: none; }
}
@media (max-width: 768px) {
  .sched-calendar-header { flex-direction: column; align-items: flex-start; }
  .sched-nav { order: 2; }
  .sched-week-title { order: 1; }
  .sched-calendar-grid { overflow-x: auto; }
  .form-row { grid-template-columns: 1fr; }
}
