/* =============================================================================
   Content Creation (release faadumo35)
   Every rule is scoped to .cc-root, so nothing else on the dashboard changes.
   Light/dark follow the dashboard's .dark class on <html>.
   ============================================================================= */

.cc-root {
  --cc-surface: #ffffff;
  --cc-canvas: #f8fafc;
  --cc-ink: #0f172a;
  --cc-text: #1e293b;
  --cc-muted: #64748b;
  --cc-faint: #94a3b8;
  --cc-line: #e2e8f0;
  --cc-line-soft: #f1f5f9;
  --cc-brand: #dc2626;
  --cc-brand-deep: #b91c1c;
  --cc-todo: #64748b;
  --cc-todo-soft: #f1f5f9;
  --cc-doing: #d97706;
  --cc-doing-soft: #fef3c7;
  --cc-done: #059669;
  --cc-done-soft: #d1fae5;
  --cc-archive: #4f46e5;
  --cc-archive-soft: #e0e7ff;
  --cc-danger: #dc2626;
  --cc-danger-soft: #fee2e2;
  --cc-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  --cc-radius: 16px;

  color: var(--cc-text);
  font-size: 14px;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dark .cc-root {
  --cc-surface: #0f172a;
  --cc-canvas: #111c33;
  --cc-ink: #f8fafc;
  --cc-text: #e2e8f0;
  --cc-muted: #94a3b8;
  --cc-faint: #64748b;
  --cc-line: #1e293b;
  --cc-line-soft: #16213a;
  --cc-brand: #ef4444;
  --cc-brand-deep: #dc2626;
  --cc-todo: #94a3b8;
  --cc-todo-soft: rgba(148, 163, 184, 0.14);
  --cc-doing: #fbbf24;
  --cc-doing-soft: rgba(251, 191, 36, 0.14);
  --cc-done: #34d399;
  --cc-done-soft: rgba(52, 211, 153, 0.14);
  --cc-archive: #a5b4fc;
  --cc-archive-soft: rgba(129, 140, 248, 0.16);
  --cc-danger: #f87171;
  --cc-danger-soft: rgba(248, 113, 113, 0.14);
  --cc-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.cc-root *,
.cc-root *::before,
.cc-root *::after { box-sizing: border-box; }

.cc-root h2,
.cc-root h3,
.cc-root h4,
.cc-root p { margin: 0; }

.cc-root button { font: inherit; color: inherit; }
.cc-root a { color: inherit; }

/* ---------- icons & text helpers ---------- */
.cc-root .cc-ico-xs { width: 13px; height: 13px; flex: none; }
.cc-root .cc-ico-sm { width: 16px; height: 16px; flex: none; }
.cc-root .cc-ico { width: 20px; height: 20px; flex: none; }
.cc-root .cc-ico-lg { width: 36px; height: 36px; flex: none; }
.cc-root .cc-muted { color: var(--cc-muted); }
.cc-root .cc-faint { color: var(--cc-faint); }
.cc-root .cc-spacer { flex: 1; }
.cc-root .cc-spin { animation: cc-spin 0.9s linear infinite; }
@keyframes cc-spin { to { transform: rotate(360deg); } }

.cc-root .cc-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--cc-line-soft);
  color: var(--cc-muted);
  font-size: 11px;
  font-weight: 700;
}

/* ---------- buttons ---------- */
.cc-root .cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, opacity 0.15s;
}
.cc-root .cc-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.cc-root .cc-btn--sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.cc-root .cc-btn--primary { background: var(--cc-brand); color: #fff; box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2); }
.cc-root .cc-btn--primary:hover:not(:disabled) { background: var(--cc-brand-deep); }
.cc-root .cc-btn--ghost { background: var(--cc-surface); border-color: var(--cc-line); color: var(--cc-text); }
.cc-root .cc-btn--ghost:hover:not(:disabled) { background: var(--cc-line-soft); }
.cc-root .cc-btn--danger { background: var(--cc-danger); color: #fff; }
.cc-root .cc-btn--danger-ghost { background: transparent; color: var(--cc-danger); padding: 0 8px; }
.cc-root .cc-btn--danger-ghost:hover:not(:disabled) { background: var(--cc-danger-soft); }
.cc-root .cc-btn--progress { background: var(--cc-doing-soft); color: var(--cc-doing); }
.cc-root .cc-btn--done { background: var(--cc-done-soft); color: var(--cc-done); }

.cc-root .cc-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--cc-muted);
  cursor: pointer;
  flex: none;
}
.cc-root .cc-icon-btn:hover:not(:disabled) { background: var(--cc-line-soft); color: var(--cc-ink); }
.cc-root .cc-icon-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cc-root .cc-icon-btn--bordered { width: 38px; height: 38px; border: 1px solid var(--cc-line); background: var(--cc-surface); border-radius: 10px; }
.cc-root .cc-icon-btn--danger:hover:not(:disabled) { background: var(--cc-danger-soft); color: var(--cc-danger); }

.cc-root .cc-btn:focus-visible,
.cc-root .cc-icon-btn:focus-visible,
.cc-root .cc-tab:focus-visible,
.cc-root .cc-card-main:focus-visible,
.cc-root .cc-segment-btn:focus-visible,
.cc-root .cc-thumb-add:focus-visible {
  outline: 2px solid var(--cc-brand);
  outline-offset: 2px;
}

/* ---------- header ---------- */
.cc-root .cc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.cc-root .cc-head-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cc-root .cc-head-title h2 { font-size: 20px; font-weight: 800; color: var(--cc-ink); letter-spacing: -0.01em; }
.cc-root .cc-head-title p { font-size: 13px; }
.cc-root .cc-head-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--cc-danger-soft);
  color: var(--cc-brand);
  flex: none;
}

/* ---------- stats ---------- */
.cc-root .cc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cc-root .cc-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  box-shadow: var(--cc-shadow);
  border-top: 3px solid var(--cc-stat-accent, var(--cc-line));
}
.cc-root .cc-stat strong { font-size: 22px; font-weight: 800; color: var(--cc-ink); font-variant-numeric: tabular-nums; }
.cc-root .cc-stat-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cc-stat-accent, var(--cc-muted));
}
.cc-root .cc-stat--not_started { --cc-stat-accent: var(--cc-todo); }
.cc-root .cc-stat--in_progress { --cc-stat-accent: var(--cc-doing); }
.cc-root .cc-stat--done { --cc-stat-accent: var(--cc-done); }
.cc-root .cc-stat--archive { --cc-stat-accent: var(--cc-archive); }

/* ---------- toolbar ---------- */
.cc-root .cc-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cc-root .cc-tabs {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: 12px;
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
}
.cc-root .cc-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--cc-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.cc-root .cc-tab.is-active { background: var(--cc-brand); color: #fff; }
.cc-root .cc-tab.is-active .cc-count { background: rgba(255, 255, 255, 0.22); color: #fff; }
.cc-root .cc-search {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 6px 0 12px;
  border-radius: 10px;
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
}
.cc-root .cc-search:focus-within { border-color: var(--cc-brand); }
.cc-root .cc-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--cc-text);
  font: inherit;
  font-size: 13px;
}
.cc-root .cc-search input::placeholder { color: var(--cc-faint); }

/* ---------- states ---------- */
.cc-root .cc-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 64px 16px;
  border-radius: var(--cc-radius);
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  color: var(--cc-muted);
  font-weight: 600;
}
.cc-root .cc-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--cc-danger-soft);
  color: var(--cc-danger);
  font-weight: 600;
  font-size: 13px;
}
.cc-root .cc-error span { flex: 1; }
.cc-root .cc-empty {
  padding: 18px 10px;
  border: 1px dashed var(--cc-line);
  border-radius: 12px;
  text-align: center;
  color: var(--cc-faint);
  font-size: 12px;
  font-weight: 600;
}
.cc-root .cc-empty--big {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 16px;
  background: var(--cc-surface);
  font-size: 13px;
}
.cc-root .cc-empty--big strong { color: var(--cc-ink); font-size: 15px; }

/* ---------- board ---------- */
.cc-root .cc-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.cc-root .cc-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: var(--cc-radius);
  background: var(--cc-canvas);
  border: 1px solid var(--cc-line);
  min-width: 0;
}
.cc-root .cc-col--not_started { --cc-col-accent: var(--cc-todo); }
.cc-root .cc-col--in_progress { --cc-col-accent: var(--cc-doing); }
.cc-root .cc-col--done { --cc-col-accent: var(--cc-done); }
.cc-root .cc-col-head { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.cc-root .cc-col-head h3 { font-size: 14px; font-weight: 800; color: var(--cc-ink); }
.cc-root .cc-col-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--cc-col-accent); flex: none; }
.cc-root .cc-col-body { display: flex; flex-direction: column; gap: 10px; }

/* ---------- card ---------- */
.cc-root .cc-card {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-left: 3px solid var(--cc-col-accent, var(--cc-archive));
  box-shadow: var(--cc-shadow);
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.15s, opacity 0.15s;
}
.cc-root .cc-card:hover { box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08); }
.cc-root .cc-card.is-busy { opacity: 0.6; }
.cc-root .cc-card-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 12px 12px 8px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.cc-root .cc-card-main:disabled { cursor: default; }
.cc-root .cc-card-img {
  margin: -12px -12px 4px;
  aspect-ratio: 16 / 9;
  background: var(--cc-line-soft);
  overflow: hidden;
}
.cc-root .cc-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc-root .cc-card-title { font-size: 14px; font-weight: 700; color: var(--cc-ink); overflow-wrap: anywhere; }
.cc-root .cc-card-desc {
  font-size: 12.5px;
  color: var(--cc-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.cc-root .cc-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--cc-faint);
}
.cc-root .cc-card-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.cc-root .cc-card-links { list-style: none; margin: 0; padding: 0 12px 6px; display: flex; flex-direction: column; gap: 4px; }
.cc-root .cc-card-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  font-size: 12px;
  font-weight: 600;
  color: var(--cc-archive);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cc-root .cc-card-links a:hover { text-decoration: underline; }
.cc-root .cc-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 6px 10px 10px;
}
.cc-root .cc-archived-on { margin-right: auto; font-size: 11.5px; font-weight: 600; }

/* ---------- status pill ---------- */
.cc-root .cc-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.cc-root .cc-pill--not_started { background: var(--cc-todo-soft); color: var(--cc-todo); }
.cc-root .cc-pill--in_progress { background: var(--cc-doing-soft); color: var(--cc-doing); }
.cc-root .cc-pill--done { background: var(--cc-done-soft); color: var(--cc-done); }

/* ---------- archive ---------- */
.cc-root .cc-archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; align-items: start; }

/* ---------- dialogs ---------- */
.cc-root .cc-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
.cc-root .cc-dialog {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
  overflow: hidden;
}
.cc-root .cc-dialog--sm { max-width: 400px; padding: 22px; align-items: center; text-align: center; gap: 8px; }
.cc-root .cc-dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--cc-line); }
.cc-root .cc-dialog-title { font-size: 16px; font-weight: 800; color: var(--cc-ink); }
.cc-root .cc-dialog-body { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; overflow-y: auto; }
.cc-root .cc-dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--cc-line);
  background: var(--cc-canvas);
}
.cc-root .cc-dialog-actions { display: flex; gap: 8px; }
.cc-root .cc-dialog--sm .cc-dialog-actions { margin-top: 8px; }
.cc-root .cc-confirm-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: var(--cc-danger-soft);
  color: var(--cc-danger);
}
.cc-root .cc-confirm-text { font-size: 13px; overflow-wrap: anywhere; }

/* ---------- form ---------- */
.cc-root .cc-field { display: flex; flex-direction: column; gap: 6px; }
.cc-root .cc-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--cc-muted); }
.cc-root .cc-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--cc-line);
  background: var(--cc-surface);
  color: var(--cc-text);
  font: inherit;
  font-size: 14px;
  outline: 0;
}
.cc-root .cc-input:focus { border-color: var(--cc-brand); box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12); }
.cc-root .cc-input::placeholder { color: var(--cc-faint); }
.cc-root .cc-textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.cc-root .cc-input--date { max-width: 220px; color-scheme: light; }
.dark .cc-root .cc-input--date { color-scheme: dark; }

.cc-root .cc-segment { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cc-root .cc-segment-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid var(--cc-line);
  background: var(--cc-surface);
  color: var(--cc-muted);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.cc-root .cc-segment-btn--not_started.is-active { background: var(--cc-todo-soft); color: var(--cc-ink); border-color: var(--cc-todo); }
.cc-root .cc-segment-btn--in_progress.is-active { background: var(--cc-doing-soft); color: var(--cc-doing); border-color: var(--cc-doing); }
.cc-root .cc-segment-btn--done.is-active { background: var(--cc-done-soft); color: var(--cc-done); border-color: var(--cc-done); }

.cc-root .cc-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.cc-root .cc-thumb {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--cc-line);
  background: var(--cc-line-soft);
  flex: none;
}
.cc-root .cc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc-root .cc-thumb a { display: block; width: 100%; height: 100%; }
.cc-root .cc-thumb--new { border-color: var(--cc-done); }
.cc-root .cc-thumb-empty { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--cc-faint); }
.cc-root .cc-thumb-x {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 0;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  cursor: pointer;
}
.cc-root .cc-thumb-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px dashed var(--cc-faint);
  background: transparent;
  color: var(--cc-muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.cc-root .cc-thumb-add:hover { border-color: var(--cc-brand); color: var(--cc-brand); }

.cc-root .cc-link-add { display: flex; gap: 8px; }
.cc-root .cc-link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cc-root .cc-link-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 10px;
  border-radius: 8px;
  background: var(--cc-line-soft);
  min-width: 0;
}
.cc-root .cc-link-list a {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--cc-archive);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cc-root .cc-link-list a:hover { text-decoration: underline; }
.cc-root .cc-form-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--cc-danger-soft);
  color: var(--cc-danger);
  font-size: 13px;
  font-weight: 600;
}

/* ---------- toasts ---------- */
.cc-root .cc-toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 32px);
}
.cc-root .cc-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  border-radius: 12px;
  background: var(--cc-ink);
  color: var(--cc-surface);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
  animation: cc-toast-in 0.18s ease-out;
}
.cc-root .cc-toast .cc-icon-btn { color: inherit; opacity: 0.7; }
.cc-root .cc-toast--success svg:first-child { color: #34d399; }
.cc-root .cc-toast--error svg:first-child { color: #f87171; }
@keyframes cc-toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- small screens ---------- */
@media (max-width: 960px) {
  .cc-root .cc-board { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .cc-root .cc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cc-root .cc-head > .cc-btn { width: 100%; }
  .cc-root .cc-tabs { width: 100%; }
  .cc-root .cc-tab { flex: 1; justify-content: center; }
  .cc-root .cc-search { min-width: 0; }
  .cc-root .cc-overlay { align-items: flex-end; padding: 0; }
  .cc-root .cc-dialog { max-width: none; max-height: 92vh; border-radius: 18px 18px 0 0; }
  .cc-root .cc-dialog--sm { border-radius: 18px; margin: 16px; }
  .cc-root .cc-segment-btn { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-root .cc-spin,
  .cc-root .cc-toast { animation: none; }
}
