/* ── ideas.css — app-specific styles ───────────────────────────────────── */

/* ── Impersonation Banner ────────────────────────────────────────────── */
.imp-banner {
  background: #f59e0b; color: #1a1a1a;
  font-size: 12px; font-weight: 600;
  padding: 3px 12px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  flex-shrink: 0;
}
.imp-banner .btn-sm { background: rgba(0,0,0,.15); color: #1a1a1a; border: none; font-size: 11px; padding: 1px 8px; border-radius: 4px; cursor: pointer; }
.imp-banner .btn-sm:hover { background: rgba(0,0,0,.25); }

/* ── Impersonate custom dropdown ─────────────────────────────────────── */
.imp-dropdown-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  width: 100%; padding: 7px 11px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.12);
  color: #fff; font-size: .82rem; cursor: pointer; text-align: left;
}
.imp-dropdown-btn:hover { border-color: rgba(255,255,255,.4); }
.imp-dropdown-list {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  max-height: 60vh; overflow-y: auto; z-index: 100;
  background: #2c5171; border: 1px solid rgba(255,255,255,.2);
  margin-top: 2px;
}
.imp-dropdown-list.open { display: block; }
.imp-dropdown-item {
  padding: 5px 11px; font-size: .8rem; color: rgba(255,255,255,.85);
  cursor: pointer; border-bottom: 1px solid rgba(255,255,255,.08);
}
.imp-dropdown-item:last-child { border-bottom: none; }
.imp-dropdown-item:hover { background: rgba(255,255,255,.12); }

/* Override pibico.css app-main padding — views manage their own spacing */
.app-main { padding: 0; }

body {
  background: linear-gradient(135deg, #2c5171 0%, #4682b4 50%, #6a9bc3 100%);
  min-height: 100vh;
}

/* ── Header buttons ─────────────────────────────────────────────────────── */
.app-header-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 4px;
  border: none; border-radius: 7px; background: transparent;
  color: #2c5171; cursor: pointer;
  transition: background .15s, color .15s;
  flex-shrink: 0; text-decoration: none;
}
.app-header-btn:hover {
  background: rgba(44,81,113,.12); color: #2c5171;
}
.app-header-btn.active {
  background: rgba(44,81,113,.18); color: #1a3a55;
}
.app-header-btn svg { display: block; flex-shrink: 0; }

/* Separator between nav buttons and lang selector */
.app-header-actions { gap: 2px; }
.app-header-actions > .lang-selector { margin-left: 6px; }
.app-header-actions > a.app-header-btn { margin-left: 2px; }

/* ── Language selector ───────────────────────────────────────────────────── */
.lang-selector {
  display: flex; align-items: center; gap: 1px;
  background: rgba(44,81,113,.08); border-radius: 7px; padding: 2px;
}
.lang-btn {
  padding: 2px 6px; border-radius: 5px; border: none; background: transparent;
  color: #2c5171; font-size: .7rem; font-weight: 700; cursor: pointer;
  line-height: 1; letter-spacing: .04em; transition: background .15s, color .15s;
  height: 24px;
}
.lang-btn:hover { background: rgba(44,81,113,.12); }
.lang-btn.active { background: rgba(44,81,113,.22); color: #1a3a55; }

/* ── Auth Gate ──────────────────────────────────────────────────────────── */
.auth-gate {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(30,50,80,.85); backdrop-filter: blur(8px);
}
.auth-gate.hidden { display: none; }
.auth-box {
  background: rgba(255,255,255,.12); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.25); border-radius: 16px;
  padding: 40px 48px; text-align: center; color: #fff; min-width: 320px;
}
.auth-box h2 { font-family: 'Montserrat',sans-serif; font-size: 1.5rem; margin: 12px 0 4px; }
.auth-box p { font-size: .875rem; opacity: .75; margin-bottom: 20px; }
.auth-box input {
  width: 100%; padding: 10px 14px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.15);
  color: #fff; font-size: .95rem; margin-bottom: 12px; box-sizing: border-box;
}
.auth-box input::placeholder { color: rgba(255,255,255,.5); }
.auth-box button {
  width: 100%; padding: 10px; border-radius: 8px; border: none;
  background: rgba(255,255,255,.25); color: #fff; font-weight: 600;
  cursor: pointer; font-size: .95rem; transition: background .2s;
}
.auth-box button:hover { background: rgba(255,255,255,.4); }
.auth-error { color: #ffb3b3; font-size: .8rem; margin-top: 8px; }

/* ── Toast ──────────────────────────────────────────────────────────────── */
#toastContainer {
  position: fixed; bottom: 52px; right: 16px; z-index: 8000;
  display: flex; flex-direction: column; gap: 6px;
}
.toast {
  padding: 8px 16px; border-radius: 8px; font-size: .82rem; font-weight: 500;
  color: #fff; backdrop-filter: blur(12px); animation: toastIn .25s ease;
  max-width: 320px;
}
.toast.ok { background: rgba(34,197,94,.85); }
.toast.err { background: rgba(239,68,68,.85); }
.toast.info { background: rgba(59,130,246,.85); }
@keyframes toastIn { from { opacity:0; transform:translateY(8px) } to { opacity:1; transform:translateY(0) } }

/* ── Slide Panel ────────────────────────────────────────────────────────── */
.panel-backdrop {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.45); backdrop-filter: blur(2px);
}
.panel-backdrop.open { display: block; }
.slide-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 2100;
  width: 45%; background: rgba(255,255,255,.96); backdrop-filter: blur(20px);
  box-shadow: -4px 0 32px rgba(0,0,0,.25);
  transform: translateX(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.slide-panel.open { transform: translateX(0); }
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid rgba(0,0,0,.1);
  background: rgba(44,81,113,.08); flex-shrink: 0;
}
.panel-header span { font-family: 'Montserrat',sans-serif; font-weight: 600; font-size: .95rem; }
.panel-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; min-height: 0; }

/* ── Views ──────────────────────────────────────────────────────────────── */
.view { display: none; flex: 1; overflow: hidden; }
.view.active { display: flex; flex-direction: column; overflow: hidden; }

/* ── Project Cards ──────────────────────────────────────────────────────── */
.view-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; flex-shrink: 0;
}
.view-header h2 { font-family: 'Montserrat',sans-serif; font-size: 1.1rem; color: #fff; margin: 0; }

/* ── Project filter bar ────────────────────────────────── */
.projects-filter-bar {
  display: flex; gap: 8px; padding: 0 16px 8px; flex-wrap: wrap; align-items: center;
}
.pf-input {
  flex: 1; min-width: 140px; padding: 5px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.1); color: #fff; font-size: .82rem; outline: none;
  backdrop-filter: blur(8px); transition: border-color .2s;
}
.pf-input::placeholder { color: rgba(255,255,255,.45); }
.pf-input:focus { border-color: rgba(255,255,255,.5); }
.pf-select {
  padding: 5px 8px; border-radius: 8px; border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.1); color: #fff; font-size: .82rem; outline: none;
  backdrop-filter: blur(8px); cursor: pointer;
}
.pf-select option { background: #2c5171; color: #fff; }

.btn-primary {
  padding: 6px 14px; border-radius: 8px; border: none;
  background: rgba(255,255,255,.25); color: #fff; font-weight: 600;
  cursor: pointer; font-size: .82rem; transition: background .2s;
}
.btn-primary:hover { background: rgba(255,255,255,.4); }

/* btn-primary inside the white slide panel needs solid dark colours */
.panel-body .btn-primary,
.panel-body .btn-primary:hover {
  background: #2c5171; color: #fff;
}
.panel-body .btn-primary:hover { background: #4682b4; }
.btn-sm {
  padding: 3px 10px; border-radius: 6px; border: none;
  background: rgba(44,81,113,.15); color: #2c5171; font-size: .78rem;
  font-weight: 600; cursor: pointer; transition: background .2s;
}
.btn-sm:hover { background: rgba(44,81,113,.25); }
.btn-danger {
  padding: 3px 10px; border-radius: 6px; border: none;
  background: rgba(239,68,68,.12); color: #dc2626; font-size: .78rem;
  font-weight: 600; cursor: pointer; transition: background .2s;
}
.btn-danger:hover { background: rgba(239,68,68,.22); }

/* ── Icon-only square button (matches header 32×32 standard) ─── */
/* Default: dark background context (project cards, kanban, views) → light icons */
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  border: none; border-radius: 7px;
  background: rgba(255,255,255,.12); color: rgba(255,255,255,.7);
  cursor: pointer; flex-shrink: 0;
  transition: background .15s, color .15s;
}
.btn-icon:hover { background: rgba(255,255,255,.25); color: #fff; }
.btn-icon svg { display: block; flex-shrink: 0; }
.btn-icon-danger { background: rgba(239,68,68,.2); color: #fca5a5; }
.btn-icon-danger:hover { background: rgba(239,68,68,.35); color: #fecaca; }
/* Light background context (panels, idea rows, info view, company rows) → grey icons */
.panel-body .btn-icon, .pd-idea-row .btn-icon, .pd-info-view .btn-icon,
.pd-info-view-header .btn-icon, .pd-company-row .btn-icon {
  background: rgba(0,0,0,.05); color: #64748b;
}
.panel-body .btn-icon:hover, .pd-idea-row .btn-icon:hover, .pd-info-view .btn-icon:hover,
.pd-info-view-header .btn-icon:hover, .pd-company-row .btn-icon:hover {
  background: rgba(0,0,0,.1); color: #334155;
}
.panel-body .btn-icon-danger, .pd-idea-row .btn-icon-danger,
.pd-company-row .btn-icon-danger {
  background: rgba(239,68,68,.06); color: #dc2626;
}
.panel-body .btn-icon-danger:hover, .pd-idea-row .btn-icon-danger:hover,
.pd-company-row .btn-icon-danger:hover {
  background: rgba(239,68,68,.15); color: #b91c1c;
}

.cards-grid {
  columns: 6 200px; column-gap: 12px;
  padding: 0 16px 16px; overflow-y: auto; flex: 1;
}
.project-card {
  break-inside: avoid;
  margin-bottom: 12px;
  display: block;
}
.project-card {
  background: rgba(255,255,255,.15); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.25); border-radius: 12px;
  padding: 14px; cursor: pointer; transition: background .2s, transform .15s;
  color: #fff;
}
.project-card:hover { background: rgba(255,255,255,.25); transform: translateY(-2px); }
.project-card h3 { font-family: 'Montserrat',sans-serif; font-size: .95rem; margin: 0 0 4px; }
.project-card .meta { font-size: .78rem; opacity: .75; margin-bottom: 8px; }
.project-card .stats { display: flex; gap: 6px; flex-wrap: nowrap; }
.stat-badge {
  background: rgba(255,255,255,.2); border-radius: 20px;
  padding: 1px 6px; font-weight: 600; font-size: .65rem;
  white-space: nowrap;
}
.status-badge {
  display: inline-block; padding: 1px 8px; border-radius: 20px;
  font-size: .72rem; font-weight: 600; margin-bottom: 6px;
}
.status-draft    { background: rgba(156,163,175,.3); color: #374151; }
.status-active   { background: rgba(34,197,94,.3);   color: #166534; }
.status-archived { background: rgba(107,114,128,.3); color: #374151; }

/* ── Kanban — horizontal rows ────────────────────────────────────────────── */
.kanban-wrap {
  display: flex; flex-direction: column; gap: 5px;
  padding: 0 14px 12px; overflow-y: auto; overflow-x: hidden;
  flex: 1;
}
.kanban-col {
  display: flex; flex-direction: row; align-items: flex-start;
  background: rgba(255,255,255,.08);
  border-radius: 8px; border: 2px solid transparent;
  transition: border-color .2s; min-height: 46px;
  width: 100%; flex-shrink: 0;
}
.kanban-col.drag-over { border-color: rgba(255,255,255,.5); }
.kanban-col-header {
  font-family: 'Montserrat',sans-serif; font-size: .72rem; font-weight: 700;
  color: rgba(255,255,255,.8); text-transform: uppercase; letter-spacing: .05em;
  flex: 0 0 110px; padding: 8px 10px; display: flex;
  flex-direction: column; align-items: flex-start; gap: 2px;
  border-right: 1px solid rgba(255,255,255,.1); align-self: stretch;
  justify-content: flex-start; flex-shrink: 0;
}
.kanban-col-header .col-count {
  background: #9b2335; border-radius: 20px;
  padding: 0 6px; font-size: .65rem; font-weight: 700;
  color: #fff;
}
/* Cards scroll horizontally inside each row */
.kanban-cards-row {
  display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px;
  padding: 6px 8px; overflow: visible;
  flex: 1; align-items: flex-start; min-width: 0;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
  -webkit-overflow-scrolling: touch;
}
.company-card {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.15);
  border-radius: 5px; padding: 3px 8px;
  cursor: pointer; transition: background .2s;
  display: flex; align-items: center; gap: 5px;
  flex: 0 0 auto; white-space: nowrap; min-height: 24px;
}
.company-card:hover { background: rgba(255,255,255,.28); }
.company-card[draggable=true] { cursor: grab; }
.company-card.dragging { opacity: .4; }
.company-card h4 {
  font-size: .65rem; font-weight: 600; color: #fff; margin: 0;
  white-space: nowrap; letter-spacing: .01em;
}
.tag { background: rgba(44,81,113,.4); border-radius: 20px; padding: 1px 6px; font-size: .68rem; color: rgba(255,255,255,.8); }

/* ── Groups View ─────────────────────────────────────────────────────────── */
.groups-layout {
  display: grid; grid-template-columns: 280px 1fr;
  gap: 12px; padding: 0 16px 16px; flex: 1; overflow: hidden;
}
.groups-list {
  background: rgba(255,255,255,.1); border-radius: 10px;
  overflow-y: auto; padding: 8px;
}
.group-item {
  padding: 3px 10px; border-radius: 8px; cursor: pointer;
  transition: background .2s; color: #fff; margin-bottom: 2px; line-height: 1;
}
.group-item:hover, .group-item.active { background: rgba(255,255,255,.2); }
.group-item .gname { font-weight: 600; font-size: .78rem; }
.group-item .gmeta { font-size: .68rem; opacity: .7; line-height: 1; }
.groups-detail {
  background: rgba(255,255,255,.1); border-radius: 10px; padding: 12px;
  overflow-y: auto; color: #fff;
}

/* ── Campaigns View ──────────────────────────────────────────────────────── */
.campaigns-tabs {
  display: flex; gap: 4px; padding: 8px 16px 0;
}
.tab-btn {
  padding: 6px 16px; border-radius: 8px 8px 0 0; border: none;
  background: rgba(255,255,255,.1); color: rgba(255,255,255,.65);
  cursor: pointer; font-size: .85rem; font-weight: 600; transition: background .2s;
}
.tab-btn.active { background: rgba(255,255,255,.25); color: #fff; }
.tab-content { display: none; flex: 1; overflow-y: auto; padding: 12px 16px; min-height: 0; }
.tab-content.active { display: flex; flex-direction: column; gap: 10px; }

/* Compose form — stretches to fill tab height */
.compose-form {
  background: rgba(255,255,255,.12); border-radius: 10px;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  flex: 1; min-height: 0;
}
/* Body row stretches to fill remaining space */
.compose-form .form-row:has(#cmpBody) { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.form-row { display: flex; flex-direction: column; gap: 4px; }
.form-row label { font-size: .78rem; font-weight: 600; color: rgba(255,255,255,.8); }
.form-control {
  padding: 7px 11px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.12);
  color: #fff; font-size: .88rem; width: 100%; box-sizing: border-box;
}
.form-control::placeholder { color: rgba(255,255,255,.4); }
.form-control option { background: #2c5171; border-radius: 0; -webkit-appearance: none; appearance: none; padding: 4px 8px; outline: none; border: none; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; font-family: 'JetBrains Mono','Courier New',monospace; font-size: .8rem; }

.preview-frame {
  width: 100%; height: 300px; border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px; background: #fff;
}
.recipients-count {
  font-size: .82rem; color: rgba(255,255,255,.75); padding: 4px 0;
}
.confirm-row {
  display: none; align-items: center; gap: 10px;
  background: rgba(255,255,255,.1); border-radius: 8px; padding: 10px 14px;
}
.confirm-row.visible { display: flex; }
.confirm-row span { font-size: .85rem; color: #fff; flex: 1; }

/* History table */
.data-table {
  width: 100%; border-collapse: collapse; font-size: .82rem;
}
.data-table th {
  text-align: left; padding: 6px 8px; font-size: .72rem;
  font-weight: 700; color: rgba(255,255,255,.7); text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.data-table td {
  padding: 6px 8px; color: rgba(255,255,255,.85); border-bottom: 1px solid rgba(255,255,255,.08);
}
.data-table tr:hover td { background: rgba(255,255,255,.05); }
.data-table tr { cursor: pointer; }

/* ── Settings Panel ──────────────────────────────────────────────────────── */
.settings-view {
  padding: 16px; padding-top: 12px; overflow-y: auto; flex: 1;
}
.settings-tabs {
  display: flex; gap: 0; padding: 0 16px; margin-bottom: 0;
}
.settings-tab {
  padding: 6px 16px; font-size: .82rem; font-weight: 600;
  background: rgba(255,255,255,.06); color: rgba(255,255,255,.5);
  border: 1px solid rgba(255,255,255,.12); border-bottom: none;
  border-radius: 8px 8px 0 0; cursor: pointer;
  transition: background .15s, color .15s;
}
.settings-tab:hover { background: rgba(255,255,255,.1); color: rgba(255,255,255,.7); }
.settings-tab.active { background: rgba(255,255,255,.12); color: #fff; }
.settings-card {
  background: rgba(255,255,255,.12); border-radius: 0 12px 12px 12px;
  padding: 20px; max-width: 500px; display: flex; flex-direction: column; gap: 12px;
}
.settings-card h3 { font-family: 'Montserrat',sans-serif; font-size: 1rem; color: #fff; margin: 0; }
.radio-group { display: flex; gap: 16px; }
.radio-group label { display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,.85); font-size: .85rem; cursor: pointer; }

/* ── Pipeline panel tabs ────────────────────────────────────────────────── */
.pipe-tabs {
  display: flex; gap: 0; border-bottom: 2px solid #e5e7eb; margin-bottom: 12px;
}
.pipe-tab {
  flex: 1; padding: 6px 0; background: none; border: none;
  font-size: .82rem; font-weight: 600; color: #9ca3af; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color .2s, border-color .2s;
}
.pipe-tab:hover { color: #4682b4; }
.pipe-tab.active { color: #2c5171; border-bottom-color: #4682b4; }
.pipe-content {
  display: flex; flex-direction: column; min-height: 0; flex: 1; overflow-y: auto;
}
.pipe-content > .panel-section { display: flex; flex-direction: column; }

/* ── Panel inner styles ──────────────────────────────────────────────────── */
.panel-section { margin-bottom: 16px; }
.panel-section h4 { font-family: 'Montserrat',sans-serif; font-size: .88rem; color: #2c5171; margin: 0 0 8px; border-bottom: 1px solid #e5e7eb; padding-bottom: 4px; }
.inline-edit { display: flex; flex-direction: column; gap: 6px; }
.inline-edit textarea.flex-grow { flex: 1; min-height: 80px; resize: none; }
.inline-input {
  padding: 5px 9px; border-radius: 6px; border: 1px solid #d1d5db;
  font-size: .85rem; width: 100%; box-sizing: border-box;
}
.inline-input:focus { outline: none; border-color: #4682b4; }
.event-list { display: flex; flex-direction: column; gap: 6px; max-height: 250px; overflow-y: auto; }
.event-item {
  padding: 5px 10px; border-radius: 6px; background: #f9fafb;
  font-size: .78rem;
}
.event-item .etype-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.event-item .etype { font-weight: 600; color: #2c5171; font-size: .72rem; text-transform: uppercase; }
.event-item .etime { color: #9ca3af; font-size: .66rem; white-space: nowrap; }
.event-item .enotes { color: #374151; margin-top: 1px; }
.status-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.status-btn {
  padding: 3px 10px; border-radius: 20px; border: 2px solid transparent;
  font-size: .72rem; font-weight: 600; cursor: pointer; background: transparent;
  transition: opacity .15s, transform .1s;
}
.status-btn:hover { opacity: .75; }
.status-btn.current { opacity: 1; transform: scale(1.05); }
/* Each status gets its own colour pair (bg + text) so .current is always visible */
.status-prospect   { background: rgba(99,102,241,.15);  color: #6366f1;  border-color: #6366f1; }
.status-contacted  { background: rgba(245,158,11,.15);  color: #b45309;  border-color: #f59e0b; }
.status-replied    { background: rgba(59,130,246,.15);  color: #1d4ed8;  border-color: #3b82f6; }
.status-interested { background: rgba(139,92,246,.15);  color: #7c3aed;  border-color: #8b5cf6; }
.status-meeting    { background: rgba(236,72,153,.15);  color: #be185d;  border-color: #ec4899; }
.status-partner    { background: rgba(34,197,94,.15);   color: #15803d;  border-color: #22c55e; }
.status-rejected   { background: rgba(239,68,68,.15);   color: #dc2626;  border-color: #ef4444; }
.status-btn.current.status-prospect   { background: #6366f1; color: #fff; }
.status-btn.current.status-contacted  { background: #f59e0b; color: #fff; }
.status-btn.current.status-replied    { background: #3b82f6; color: #fff; }
.status-btn.current.status-interested { background: #8b5cf6; color: #fff; }
.status-btn.current.status-meeting    { background: #ec4899; color: #fff; }
.status-btn.current.status-partner    { background: #22c55e; color: #fff; }
.status-btn.current.status-rejected   { background: #ef4444; color: #fff; }

.idea-list { display: flex; flex-direction: column; gap: 6px; }
.idea-row {
  display: flex; align-items: center; gap: 8px;
  background: #f9fafb; border-radius: 6px; padding: 6px 10px;
}
.idea-row .iname { flex: 1; font-size: .85rem; color: #1f2937; }
.idea-row .istatus { font-size: .72rem; color: #6b7280; }

/* ── Import CSV ─────────────────────────────────────────────────────────── */
.csv-area {
  width: 100%; height: 80px; padding: 8px; border-radius: 6px;
  border: 1px solid #d1d5db; font-size: .78rem; font-family: monospace;
  resize: vertical; box-sizing: border-box;
}

.empty-state {
  padding: 40px; text-align: center; color: rgba(255,255,255,.5); font-size: .9rem;
}

/* ── AI Compose ─────────────────────────────────────────────────────────── */
.ai-compose-bar {
  display: flex; gap: 8px; align-items: flex-end;
  background: rgba(255,255,255,.08); border-radius: 8px;
  padding: 10px 14px; border: 1px solid rgba(255,255,255,.15);
}
.ai-compose-bar textarea {
  flex: 1; resize: none; background: transparent; border: none;
  color: #fff; font-size: .82rem; line-height: 1.4; outline: none;
  font-family: inherit;
}
.ai-compose-bar textarea::placeholder { color: rgba(255,255,255,.35); }
.btn-ai {
  padding: 5px 14px; border-radius: 7px; border: none;
  background: linear-gradient(135deg, #4682b4, #7c4dff);
  color: #fff; font-weight: 700; font-size: .78rem;
  cursor: pointer; white-space: nowrap; transition: opacity .2s;
  flex-shrink: 0;
}
.btn-ai:hover { opacity: .85; }
.btn-ai:disabled { opacity: .5; cursor: default; }
.ai-lang-row {
  display: flex; gap: 6px; align-items: center; font-size: .78rem;
  color: rgba(255,255,255,.7); flex-shrink: 0;
}
.ai-lang-row select { padding: 3px 6px; border-radius: 5px;
  border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.1);
  color: #fff; font-size: .78rem; }
.ai-lang-row select option { background: #2c5171; }

/* ── Project card description ───────────────────────────────────────────── */
.project-card p { font-size: .78rem; opacity: .8; margin: 0 0 8px; line-height: 1.4; }

/* ── Landing link in project card ───────────────────────────────────────── */
.project-card .landing-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; color: rgba(255,255,255,.6); text-decoration: none;
  margin-top: 6px; transition: color .2s;
}
.project-card .landing-link:hover { color: rgba(255,255,255,.9); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .app-header { padding: 0 10px; }
  .app-header-title span { display: none; }
  .app-header-actions { gap: 1px; }
  .lang-selector { display: none; } /* hide on very small; could show via menu */

  /* Kanban: same horizontal row layout on mobile, tighter */
  .kanban-wrap { padding: 0 6px 10px; }
  .kanban-col-header { flex: 0 0 82px; font-size: .65rem; padding: 0 6px; }
  .kanban-cards-row { padding: 4px 6px; gap: 5px; }
  .company-card { padding: 2px 6px; }
  .company-card h4 { font-size: .62rem; }

  /* Projects filter bar on mobile */
  .projects-filter-bar { padding: 0 8px 6px; }
  .pf-input { min-width: 100px; }

  /* Projects: 2-col masonry on mobile */
  .cards-grid {
    columns: 2; column-gap: 8px; padding: 0 8px 12px;
  }
  .project-card { margin-bottom: 8px; }

  /* Groups: stacked */
  .groups-layout {
    grid-template-columns: 1fr; grid-template-rows: auto 1fr;
  }
  .groups-list { max-height: 180px; }

  /* Campaigns */
  .compose-form { padding: 10px; }

  /* Slide panel full-width */
  .slide-panel { width: 100%; }

  /* Settings */
  .settings-card { max-width: 100%; }

  /* View header */
  .view-header { padding: 8px 10px; }
  .view-header h2 { font-size: .95rem; }

  /* Data table horizontal scroll */
  .tab-content { overflow-x: auto; }
  .data-table { min-width: 500px; }

  /* Hide kanban column header count on tiny screens */
  .kanban-col-header { font-size: .72rem; }

  /* Footer */
  .app-footer { font-size: .68rem; padding: 0 10px; }
}

@media (max-width: 480px) {
  .lang-selector { display: none; }
  .app-header-btn { width: 28px; height: 28px; }
  .status-buttons { gap: 4px; }
  .status-btn { padding: 2px 7px; font-size: .68rem; }
  .kanban-col { padding: 6px; }
  .company-card { padding: 6px 8px; }
  .company-card h4 { font-size: .78rem; }
  .campaigns-tabs { padding: 6px 8px 0; gap: 3px; }
  .tab-btn { padding: 5px 10px; font-size: .78rem; }
  .pd-field-row { flex-direction: column; }
}

/* ── Project Detail — full-width editing workspace ─────────────────── */
#viewProject { padding: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; }

/* Tabs bar */
.pd-tabs {
  display: flex; align-items: center; gap: 2px;
  padding: 0 14px; background: rgba(44,81,113,.35); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.1); flex-shrink: 0;
}
.pd-tab {
  padding: 7px 14px; border: none; background: transparent; color: rgba(255,255,255,.55);
  font-size: .78rem; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.pd-tab:hover { color: rgba(255,255,255,.8); }
.pd-tab.active { color: #fff; border-bottom-color: #4682b4; }
.pd-tab-count {
  font-size: .65rem; font-weight: 700; background: rgba(70,130,180,.3);
  padding: 0 5px; border-radius: 8px; margin-left: 4px;
}
.pd-tab-link {
  display: flex; align-items: center; gap: 4px; padding: 5px 10px;
  font-size: .72rem; font-weight: 600; color: rgba(255,255,255,.45);
  text-decoration: none; transition: color .15s;
}
.pd-tab-link:hover { color: #4fc3f7; }

/* Content area */
.pd-content { padding: 14px 18px; display: flex; flex-direction: column; overflow-y: auto; flex: 1; min-height: 0; }

/* ── Info tab ──────────────────────────────────────────────────────── */
.pd-info-top {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px;
  background: rgba(255,255,255,.88); border: 1px solid rgba(255,255,255,.95);
  border-radius: 8px; padding: 12px 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.pd-field-row { display: flex; gap: 8px; align-items: flex-start; }
.pd-field { display: flex; flex-direction: column; gap: 2px; }
.pd-field label { font-size: .7rem; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.pd-info-top .pd-input {
  background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.15); color: #1e293b;
}
.pd-info-top .pd-input:focus { border-color: #4682b4; }
.pd-info-top .pd-check-label { color: #475569; }
.pd-info-top .btn-primary { background: #4682b4; color: #fff; }
.pd-input {
  padding: 4px 8px; border-radius: 5px; font-size: .82rem; color: #e2e8f0;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  outline: none; font-family: inherit; transition: border-color .15s;
}
.pd-input:focus { border-color: rgba(70,130,180,.6); }
.pd-check-label {
  font-size: .78rem; color: rgba(255,255,255,.6); cursor: pointer;
  display: flex; align-items: center; gap: 6px; padding: 4px 0;
}

/* Description — full width below fields, two textareas */
.pd-desc-full {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
  background: rgba(255,255,255,.88); border: 1px solid rgba(255,255,255,.95);
  border-radius: 8px; padding: 12px 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.pd-desc-bar {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px;
}
.pd-desc-bar > label { color: #64748b !important; }
.pd-desc-full .pd-check-label { color: #475569; }
.pd-desc-bar > label { font-size: .7rem; color: rgba(255,255,255,.45); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* Text textarea */
.pd-desc-editor {
  padding: 10px 14px; border-radius: 8px;
  background: rgba(0,0,0,.04); border: 1px solid rgba(0,0,0,.12);
  font-family: inherit; font-size: .85rem;
  color: #1e293b; line-height: 1.5; resize: vertical; outline: none;
  width: 100%; flex: 1; min-height: 140px;
}
.pd-desc-editor:focus { border-color: #4682b4; }

/* HTML box — same flex slot as text textarea, contains editor + preview + hint */
.pd-desc-html-box {
  flex: 1; min-height: 140px; display: flex; flex-direction: column;
  border: 1px solid rgba(70,130,180,.3); border-radius: 8px;
  overflow: hidden;
}
.pd-desc-html-editor {
  flex: 1; min-height: 80px; padding: 10px 14px; border: none; outline: none;
  background: rgba(0,0,0,.06); resize: none;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: .78rem; color: #334155; line-height: 1.5; width: 100%;
}
.pd-desc-html-editor:focus { background: rgba(0,0,0,.45); }
.pd-desc-preview {
  padding: 8px 14px; border-top: 1px solid rgba(0,0,0,.08);
  background: rgba(0,0,0,.03);
  font-size: .82rem; color: #334155; line-height: 1.5;
  overflow-y: auto; max-height: 50%;
}
.pd-desc-preview:empty { display: none; }
.pd-desc-preview p { margin-bottom: 6px; }
.pd-desc-preview ul { margin: 4px 0 6px 18px; }
.pd-desc-preview li { margin-bottom: 2px; }
.pd-desc-preview strong { color: #1e293b; }
.pd-desc-hint {
  padding: 3px 12px; font-size: .65rem; color: #4682b4;
  font-style: italic; background: rgba(70,130,180,.06);
  border-top: 1px solid rgba(70,130,180,.1);
}

/* AI → HTML button */
.pd-ai-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 5px; border: 1px solid rgba(79,195,247,.3);
  background: rgba(79,195,247,.08); color: #4fc3f7; font-size: .7rem; font-weight: 600;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.pd-ai-btn:hover { background: rgba(79,195,247,.18); border-color: rgba(79,195,247,.5); }
.pd-ai-btn:disabled { opacity: .5; cursor: wait; }
.pd-ai-spinner {
  display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(79,195,247,.3);
  border-top-color: #4fc3f7; border-radius: 50%; animation: pdSpin .6s linear infinite;
}
@keyframes pdSpin { to { transform: rotate(360deg); } }

/* ── Ideas tab ─────────────────────────────────────────────────────── */
.pd-ideas-wrap { display: flex; flex-direction: column; gap: 8px; }
.pd-idea-add { display: flex; gap: 6px; margin-bottom: 4px; }
#ideaList { columns: 2 340px; column-gap: 8px; }
@media (min-width: 1600px) { #ideaList { columns: 4; } }
@media (min-width: 1200px) and (max-width: 1599px) { #ideaList { columns: 3; } }
#ideaList > .pd-idea-row { break-inside: avoid; margin-bottom: 8px; }
.pd-idea-row {
  background: rgba(255,255,255,.88); border: 1px solid rgba(255,255,255,.95);
  border-radius: 7px; padding: 8px 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.pd-idea-row-main {
  display: flex; align-items: center; gap: 8px;
}
.pd-idea-row-title { flex: 1; font-size: .85rem; font-weight: 600; color: #1e293b; }
.pd-idea-row-desc {
  font-size: .92rem; color: #475569; line-height: 1.55; margin-top: 3px;
  white-space: pre-line;
}
.pd-idea-row-desc:empty { display: none; }
.pd-idea-edit { display: flex; flex-direction: column; gap: 6px; }
.pd-idea-confirm { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: #dc2626; }
.pd-idea-row .pd-input {
  background: rgba(0,0,0,.06); border-color: rgba(0,0,0,.15); color: #334155;
}
.pd-idea-row .pd-input:focus { border-color: #4682b4; }
.pd-idea-row .pd-field label { color: #64748b; }
.pd-idea-row .btn-sm { color: #64748b; }
.pd-idea-row .btn-sm:hover { color: #1e293b; }
.pd-idea-row .btn-primary { background: #4682b4; color: #fff; border: none; }
.pd-idea-row .btn-primary:hover { background: #3a6d99; }
.pd-idea-row .btn-danger { color: #dc2626; background: rgba(220,38,38,.08); border-color: rgba(220,38,38,.2); }
.pd-idea-row .btn-danger:hover { background: rgba(220,38,38,.15); }
.pd-idea-status {
  width: auto; max-width: 100px; flex-shrink: 0;
  height: 32px; padding: 0 8px;
  font-size: .78rem; border-radius: 7px;
  background: rgba(0,0,0,.05); border: 1px solid rgba(0,0,0,.12);
  color: #334155; cursor: pointer;
}

/* ── Companies tab ─────────────────────────────────────────────────── */
.pd-companies-wrap { display: flex; flex-direction: column; gap: 8px; }
.pd-company-add { display: flex; gap: 6px; margin-bottom: 4px; }
.pd-company-grid {
  columns: 2 300px; column-gap: 8px;
}
.pd-company-grid > .pd-company-row { break-inside: avoid; margin-bottom: 8px; }
@media (min-width: 1600px) { .pd-company-grid { columns: 4; } }
@media (min-width: 1200px) and (max-width: 1599px) { .pd-company-grid { columns: 3; } }
.pd-company-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px; border-radius: 6px;
  background: rgba(255,255,255,.88); border: 1px solid rgba(255,255,255,.95);
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.pd-company-name { font-size: .82rem; font-weight: 600; color: #1e293b; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-company-meta { font-size: .72rem; color: #64748b; flex-shrink: 0; }
.pd-company-row .btn-sm { color: #94a3b8; }
.pd-company-row .btn-sm:hover { color: #dc2626; }

/* ── Actions tab ───────────────────────────────────────────────────── */
.pd-actions-grid { columns: 2 340px; column-gap: 12px; }
.pd-actions-grid > .pd-act-card { break-inside: avoid; margin-bottom: 12px; }
@media (min-width: 1600px) { .pd-actions-grid { columns: 4; } }
@media (min-width: 1200px) and (max-width: 1599px) { .pd-actions-grid { columns: 3; } }
.pd-act-card {
  background: rgba(255,255,255,.88); border: 1px solid rgba(255,255,255,.95);
  border-radius: 8px; padding: 12px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.pd-act-card-title {
  font-size: .72rem; font-weight: 700; color: #64748b;
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px;
}
.pd-act-stats { display: flex; flex-direction: column; gap: 8px; }
.pd-act-stat-group { display: flex; align-items: center; gap: 8px; }
.pd-act-stat-label { font-size: .8rem; font-weight: 600; color: #334155; min-width: 110px; }
.pd-act-stat-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.pd-act-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-act-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 6px; font-size: .78rem; font-weight: 600;
  border: 1px solid rgba(0,0,0,.12); background: rgba(0,0,0,.03); color: #334155;
  cursor: pointer; transition: background .15s, border-color .15s; text-decoration: none;
}
.pd-act-btn:hover { background: rgba(70,130,180,.08); border-color: rgba(70,130,180,.3); color: #1e40af; }
.pd-act-btn-warn {
  border-color: rgba(245,158,11,.3); color: #b45309; background: rgba(245,158,11,.06);
}
.pd-act-btn-warn:hover { background: rgba(245,158,11,.15); border-color: rgba(245,158,11,.5); color: #92400e; }
.pd-act-btn-danger {
  border-color: rgba(239,68,68,.3); color: #dc2626; background: rgba(239,68,68,.06);
}
.pd-act-btn-danger:hover { background: rgba(239,68,68,.15); border-color: rgba(239,68,68,.5); color: #b91c1c; }
.pd-act-danger { border-color: rgba(239,68,68,.2); }
.pd-act-danger .pd-act-card-title { color: #dc2626; }
.pd-act-confirm { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: #dc2626; width: 100%; }

/* ── Help guide (light panel background) ──────────────────────────── */
.help-guide { padding: 0 4px; }
.help-intro { font-size: .88rem; color: #334155; line-height: 1.5; margin: 0 0 18px; }
.help-section { position: relative; margin-bottom: 24px; padding-left: 36px; }
.help-step-num {
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%;
  background: #2563eb; color: #fff;
  font-size: .75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.help-step-title { font-size: .88rem; font-weight: 700; color: #1e293b; margin: 0 0 4px; }
.help-step-desc { font-size: .8rem; color: #475569; line-height: 1.45; margin: 0 0 8px; }
.help-step-desc strong { color: #1d4ed8; }
.help-img-wrap {
  position: relative; border-radius: 6px; overflow: hidden; cursor: pointer;
  border: 1px solid rgba(0,0,0,.12);
  transition: border-color .2s;
}
.help-img-wrap:hover { border-color: #3b82f6; }
.help-img-wrap img { width: 100%; display: block; border-radius: 5px; }
.help-zoom-hint {
  position: absolute; bottom: 6px; right: 8px;
  font-size: .65rem; color: #fff;
  background: rgba(0,0,0,.55); padding: 2px 8px; border-radius: 4px;
  pointer-events: none; opacity: 0; transition: opacity .2s;
}
.help-img-wrap:hover .help-zoom-hint { opacity: 1; }
.help-footer-note { font-size: .75rem; color: #94a3b8; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(0,0,0,.08); }
.help-footer-note a { color: #2563eb; }

/* Zoom overlay */
.help-zoom-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.85); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out; animation: helpFadeIn .15s ease;
}
.help-zoom-overlay img { max-width: 95vw; max-height: 92vh; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,.5); }
.help-zoom-close {
  position: absolute; top: 16px; right: 20px;
  font-size: 2rem; color: rgba(255,255,255,.6); cursor: pointer;
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
}
.help-zoom-close:hover { color: #fff; }
@keyframes helpFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Idea row with HTML content — remove pre-line wrapping ── */
.pd-idea-row-desc:has(.memoria-detail-card) { white-space: normal; }
/* HTML content in idea desc — override pre-line */
.pd-idea-row-desc:has(p), .pd-idea-row-desc:has(ul), .pd-idea-row-desc:has(div) { white-space: normal; }

/* ── Info View Mode ──────────────────────────────────────────────── */
.pd-info-view {
  display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0;
}
.pd-info-view-header {
  display: flex; align-items: flex-start; gap: 12px;
  background: rgba(255,255,255,.88); border: 1px solid rgba(255,255,255,.95);
  border-radius: 8px; padding: 14px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.pd-info-view-title {
  font-family: 'Montserrat', sans-serif; font-size: 1.2rem;
  font-weight: 700; color: #1e293b; margin: 0 0 6px; line-height: 1.3;
}
.pd-info-view-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.pd-info-badge {
  display: inline-block; padding: 1px 10px; border-radius: 20px;
  font-size: .72rem; font-weight: 600; background: rgba(44,81,113,.12); color: #2c5171;
}
.pd-info-badge-draft { background: rgba(156,163,175,.2); color: #475569; }
.pd-info-badge-active { background: rgba(34,197,94,.15); color: #166534; }
.pd-info-badge-archived { background: rgba(107,114,128,.2); color: #475569; }
.pd-info-badge-private { background: rgba(239,68,68,.12); color: #dc2626; }
/* pd-info-edit-btn now uses btn-icon base — keep for backward compat */
.pd-info-edit-btn { border: 1px solid rgba(0,0,0,.1); }
.pd-info-edit-btn:hover { border-color: rgba(70,130,180,.3); }
.pd-info-view-links { padding: 0 2px; }
.pd-info-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .82rem; color: #2563eb; text-decoration: none;
  transition: color .15s;
}
.pd-info-link:hover { color: #1d4ed8; text-decoration: underline; }
.pd-info-view-desc {
  flex: 1; min-height: 0; overflow-y: auto;
}
.pd-info-text-preview {
  font-size: .88rem; color: #334155; line-height: 1.6; margin: 0;
  white-space: pre-line;
  background: rgba(255,255,255,.88); border: 1px solid rgba(255,255,255,.95);
  border-radius: 8px; padding: 14px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.pd-info-html-preview {
  background: #0a1428; border-radius: 8px; padding: 20px 24px;
  color: #cbd5e1; font-size: .88rem; line-height: 1.6;
  overflow-y: auto; box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.pd-info-html-preview p { margin-bottom: 10px; }
.pd-info-html-preview ul { margin: 6px 0 14px 18px; line-height: 1.9; }
.pd-info-html-preview li { margin-bottom: 3px; }
.pd-info-html-preview blockquote {
  border-left: 3px solid #3b82f6; padding-left: 14px; margin: 14px 0;
  color: #e2e8f0; font-size: .92rem; line-height: 1.6;
}
.pd-info-html-preview h1, .pd-info-html-preview h2, .pd-info-html-preview h3 {
  color: #f1f5f9; margin: 16px 0 8px;
}
.pd-info-html-preview strong { color: #60a5fa; }

/* ── Idea card HTML description styling (no wrapper needed) ───── */
/* Override inline dark-theme colors — idea cards have light background */
.pd-idea-row-desc p { margin-bottom: 6px; color: #334155 !important; }
.pd-idea-row-desc ul { margin: 4px 0 8px 16px; line-height: 1.7; }
.pd-idea-row-desc li { margin-bottom: 2px; color: #475569 !important; }
.pd-idea-row-desc span { color: #2563eb !important; }
.pd-idea-row-desc blockquote {
  border-left: 2px solid #4682b4; padding-left: 10px; margin: 8px 0;
  color: #475569 !important; font-size: .76rem; line-height: 1.5;
}
.pd-idea-row-desc blockquote span { color: #2563eb !important; }
.pd-idea-row-desc strong { color: #1e40af !important; }
.pd-idea-row-desc em { color: #334155 !important; }
.pd-idea-row-desc div[style*="background"] {
  background: rgba(37,99,235,.06) !important;
  border-color: rgba(37,99,235,.18) !important;
}
.pd-idea-row-desc div[style*="background"] p { color: #334155 !important; }
.pd-idea-row-desc div[style*="background"] span { color: #2563eb !important; }
.pd-idea-row-desc div[style*="background"] strong { color: #1e40af !important; }
