:root {
  --lime: #97BF0D;
  --lime-dark: #6f8f09;
  --teal: #006664;
  --teal-dark: #004a49;
  --ink: #1c2321;
  --paper: #f6f7f4;
  --card: #ffffff;
  --border: #dfe3dc;
  --muted: #6b746e;
  --danger: #b3392c;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Montserrat', -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

.hidden { display: none !important; }

button {
  font-family: inherit;
  cursor: pointer;
  border-radius: var(--radius);
}

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  width: 100%;
}

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: block;
  margin: 12px 0 4px;
}

/* ---------- Login ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--teal);
}
.login-card {
  background: var(--card);
  border-radius: 16px;
  padding: 40px;
  width: 320px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}
.login-mark {
  font-weight: 700;
  color: var(--lime);
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.login-card h1 { font-size: 22px; margin: 8px 0 4px; }
.login-sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.login-card button {
  width: 100%;
  margin-top: 12px;
  background: var(--teal);
  color: white;
  border: none;
  padding: 10px;
  font-weight: 600;
}
.login-card button:hover { background: var(--teal-dark); }
.login-error { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 16px; }

/* ---------- App shell ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: var(--teal);
  color: white;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.brand-mark { color: var(--lime); font-weight: 700; }
.brand-sep { opacity: 0.5; }
.brand-title { font-weight: 400; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.view-switch {
  display: flex;
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 2px;
}
.view-btn {
  background: transparent;
  border: none;
  color: white;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
}
.view-btn.active { background: white; color: var(--teal); }

.btn-primary {
  background: var(--lime);
  color: var(--ink);
  border: none;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 13px;
}
.btn-primary:hover { background: var(--lime-dark); color: white; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-strong, #c9cec5);
  color: var(--ink);
  padding: 8px 14px;
  font-size: 13px;
}
.btn-ghost:hover { background: rgba(0,0,0,0.04); }

.topbar .btn-ghost {
  border: 1px solid rgba(255,255,255,0.4);
  color: white;
}
.topbar .btn-ghost:hover { background: rgba(255,255,255,0.12); }

.btn-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 8px 14px;
  font-size: 13px;
}

.filterbar {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.filterbar select { width: auto; min-width: 160px; }
.filter-blocked {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  width: auto;
}
.filter-blocked input { width: auto; }

.view { padding: 20px 24px; }

/* ---------- Kanban ---------- */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(180px, 1fr));
  gap: 12px;
  overflow-x: auto;
}
.kanban-col { display: flex; flex-direction: column; gap: 10px; }
.kanban-col-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
}
.kanban-col-count {
  background: var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
}
.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 40px;
}
.kanban-cards.drag-over { background: rgba(151,191,13,0.1); border-radius: 10px; }

.content-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: grab;
}
.content-card:active { cursor: grabbing; }
.content-card-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.content-card-meta { font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.content-card-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  margin-top: 6px;
}
.content-card-blocker {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(179,57,44,0.1);
  color: var(--danger);
  margin-top: 6px;
  margin-left: 4px;
}
.content-card-visual {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 8px;
  background: var(--paper);
  display: block;
}
.content-card-visual-placeholder {
  width: 100%;
  height: 28px;
  border-radius: 6px;
  margin-bottom: 8px;
  background: var(--paper);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--muted);
}
.entity-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  padding: 0 24px 10px;
}
.entity-legend-item { display: flex; align-items: center; gap: 6px; }
.entity-legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ---------- Calendar ---------- */
.calendar-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.calendar-header h2 { margin: 0; font-size: 18px; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.calendar-cell {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 90px;
  padding: 6px;
  font-size: 11px;
}
.calendar-cell.empty { background: transparent; border: none; }
.calendar-daynum { font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.calendar-item {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--paper);
  border-left: 3px solid var(--border);
  border-radius: 4px;
  padding: 2px 5px;
  margin-bottom: 3px;
  cursor: pointer;
  font-size: 10.5px;
}
.calendar-item-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calendar-item-thumb {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}
.calendar-item-thumb-ph {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--border);
  flex-shrink: 0;
}

/* ---------- Channel view ---------- */
.channel-group { margin-bottom: 28px; }
.channel-group-header {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.channel-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.channel-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
}
.channel-card-visual {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 8px;
  background: var(--paper);
}
.channel-card-visual-placeholder {
  width: 100%;
  height: 60px;
  border-radius: 6px;
  margin-bottom: 8px;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted);
  border: 1px dashed var(--border);
}
.channel-card-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.channel-card-text {
  font-size: 12px;
  color: var(--ink);
  line-height: 1.5;
  max-height: 90px;
  overflow: hidden;
  white-space: pre-line;
  margin-bottom: 8px;
}
.channel-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 20px;
}
.modal {
  background: var(--card);
  border-radius: 14px;
  width: 560px;
  max-width: 100%;
  padding: 24px 28px 28px;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h2 { font-size: 18px; margin: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.channels-checkboxes { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.channels-checkboxes label {
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: none;
  font-weight: 400;
  color: var(--ink);
  margin: 0;
}
.channels-checkboxes input { width: auto; }
.modal-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

/* ---------- Visuals list (form) ---------- */
.visuals-list { display: flex; flex-direction: column; gap: 6px; }
.visual-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.visual-row input[type="url"] { flex: 1; }
.visual-row select { width: auto; flex-shrink: 0; }
.visual-row-remove {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--danger);
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
}
.btn-add-visual { margin-top: 8px; font-size: 12px; }

/* ---------- LinkedIn-style preview ---------- */
.preview-modal {
  background: transparent;
  width: 500px;
  max-width: 100%;
  position: relative;
  padding-top: 36px;
}
.preview-close {
  position: absolute;
  top: 0;
  right: 0;
  background: white;
}
.li-card {
  background: var(--card);
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.li-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}
.li-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
}
.li-author { font-size: 14px; font-weight: 600; }
.li-meta { font-size: 12px; color: var(--muted); }
.li-body {
  padding: 0 14px 12px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
}
.li-media { width: 100%; background: var(--paper); }
.li-media img, .li-media video {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
}
.li-media-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
.li-media-grid img { max-height: 200px; }
.li-media-more {
  position: relative;
}
.li-media-more::after {
  content: attr(data-count);
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  color: white;
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.li-footer {
  display: flex;
  justify-content: space-around;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.li-visual-placeholder {
  width: 100%;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  background: var(--paper);
}
.card-preview-btn {
  margin-top: 6px;
  font-size: 11px;
  padding: 3px 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
}