/* The D2C Pulse — Operations Dashboard */
:root {
  --bg: #0b0d0e;
  --surface: #14171a;
  --surface-2: #1b1f23;
  --surface-3: #232930;
  --border: #2a3038;
  --border-2: #353c45;
  --text: #e9eef3;
  --text-2: #9aa4ad;
  --text-3: #6b7480;
  --accent: #d4a85a; /* warm editorial gold */
  --accent-2: #6ea4d6;
  --green: #5ec47a;
  --red: #e26b6b;
  --amber: #e2a85a;
  --purple: #9b8ee0;
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.18);
}
[data-theme="light"] {
  --bg: #f6f4ee;
  --surface: #ffffff;
  --surface-2: #f0ede4;
  --surface-3: #e7e3d6;
  --border: #d9d4c4;
  --border-2: #c5bfaa;
  --text: #1a1d1f;
  --text-2: #56606b;
  --text-3: #8b939c;
  --accent: #a47e2b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }

/* ===== Layout ===== */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { padding: 6px 10px 18px 10px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.brand-mark { font-family: var(--serif); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; color: var(--text); }
.brand-mark .accent { color: var(--accent); }
.brand-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; letter-spacing: 0.04em; text-transform: uppercase; }

.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm); color: var(--text-2); cursor: pointer; font-size: 13px; border: none; background: transparent; text-align: left; width: 100%; transition: 0.12s; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); }
.nav-item .ico { width: 16px; height: 16px; opacity: 0.85; }
.nav-item .badge { margin-left: auto; font-size: 11px; background: var(--surface-3); color: var(--text-2); padding: 1px 6px; border-radius: 10px; }
.nav-item.active .badge { background: var(--accent); color: #1a1d1f; }
.nav-divider { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; padding: 14px 12px 6px; }

.main { padding: 28px 36px 60px; max-width: 1500px; }
.main-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; gap: 20px; flex-wrap: wrap; }
.h1 { font-family: var(--serif); font-size: 32px; font-weight: 500; letter-spacing: -0.02em; margin: 0; }
.subtle { color: var(--text-2); font-size: 13px; }
.h2 { font-family: var(--serif); font-size: 19px; font-weight: 500; margin: 0 0 12px 0; letter-spacing: -0.01em; }
.eyebrow { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }

/* ===== Cards ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; }
.card.tight { padding: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h3 { font-family: var(--serif); font-size: 16px; font-weight: 500; margin: 0; }

/* ===== Grid ===== */
.grid { display: grid; gap: 16px; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-2-3 { grid-template-columns: 2fr 3fr; }
.cols-3-2 { grid-template-columns: 3fr 2fr; }

/* ===== KPI ===== */
.kpi { padding: 16px 18px; }
.kpi .lbl { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.kpi .val { font-family: var(--serif); font-size: 30px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; }
.kpi .sub { font-size: 12px; color: var(--text-2); margin-top: 6px; }
.kpi .sub.good { color: var(--green); }
.kpi .sub.bad { color: var(--red); }
.kpi .sub.warn { color: var(--amber); }

/* ===== Pills/Badges ===== */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.pill.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.green { color: var(--green); border-color: rgba(94,196,122,0.25); background: rgba(94,196,122,0.1); }
.pill.red { color: var(--red); border-color: rgba(226,107,107,0.25); background: rgba(226,107,107,0.1); }
.pill.amber { color: var(--amber); border-color: rgba(226,168,90,0.25); background: rgba(226,168,90,0.1); }
.pill.blue { color: var(--accent-2); border-color: rgba(110,164,214,0.25); background: rgba(110,164,214,0.1); }
.pill.purple { color: var(--purple); border-color: rgba(155,142,224,0.25); background: rgba(155,142,224,0.1); }
.pill.gold { color: var(--accent); border-color: rgba(212,168,90,0.3); background: rgba(212,168,90,0.1); }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: var(--r-sm); font-size: 12px; transition: 0.12s; }
.btn:hover { background: var(--surface-3); }
.btn.primary { background: var(--accent); color: #1a1d1f; border-color: var(--accent); font-weight: 500; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 8px; font-size: 11px; }

/* ===== Inputs ===== */
.inp, select.inp { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); padding: 7px 10px; border-radius: var(--r-sm); font-size: 13px; font-family: var(--sans); width: 100%; }
.inp:focus { outline: none; border-color: var(--accent); }
textarea.inp { resize: vertical; min-height: 60px; line-height: 1.5; }

/* ===== Task list ===== */
.task { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 8px; transition: 0.12s; }
.task:hover { border-color: var(--border-2); }
.task.done { opacity: 0.5; }
.task.done .task-title { text-decoration: line-through; }
.task.overdue { border-left: 2px solid var(--red); }
.task .check { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--border-2); flex-shrink: 0; margin-top: 2px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.task.done .check { background: var(--accent); border-color: var(--accent); color: #1a1d1f; }
.task-title { font-size: 13px; color: var(--text); }
.task-meta { font-size: 11px; color: var(--text-3); display: flex; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.task-body { flex: 1; min-width: 0; }

/* ===== Heatmap ===== */
.heatmap { display: grid; gap: 2px; }
.heat-row { display: contents; }
.heat-cell { width: 100%; aspect-ratio: 1; border-radius: 3px; background: var(--surface-3); cursor: pointer; transition: 0.12s; position: relative; }
.heat-cell:hover { transform: scale(1.15); }
.heat-cell[data-state="posted"] { background: var(--accent); }
.heat-cell[data-state="scheduled"] { background: rgba(212,168,90,0.4); }
.heat-cell[data-state="pending"] { background: var(--surface-3); }
.heat-cell[data-state="overdue"] { background: var(--red); }

/* ===== Tables ===== */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 500; color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: var(--surface-2); cursor: pointer; }
.table tr:last-child td { border-bottom: none; }

/* ===== Funnel ===== */
.funnel-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 12px; }
.funnel-row .lbl { width: 130px; color: var(--text-2); flex-shrink: 0; }
.funnel-row .bar { height: 22px; background: var(--accent); border-radius: 4px; min-width: 4px; display: flex; align-items: center; padding: 0 8px; color: #1a1d1f; font-weight: 500; font-size: 11px; }
.funnel-row .bar.muted { background: var(--surface-3); color: var(--text-2); }

/* ===== Drawer ===== */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 80; opacity: 0; pointer-events: none; transition: 0.2s; }
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 540px; max-width: 96vw; background: var(--surface); border-left: 1px solid var(--border); z-index: 90; transform: translateX(100%); transition: transform 0.25s cubic-bezier(0.4,0,0.2,1); overflow-y: auto; }
.drawer.open { transform: translateX(0); }
.drawer-head { padding: 18px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.drawer-body { padding: 22px; }
.drawer-section { margin-bottom: 26px; }

/* ===== Kanban ===== */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.kan-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px; min-height: 200px; }
.kan-col-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 12px; }
.kan-col-head .name { font-weight: 500; }
.kan-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 8px; cursor: pointer; transition: 0.12s; }
.kan-card:hover { border-color: var(--accent); }
.kan-card-title { font-size: 12px; line-height: 1.35; margin-bottom: 6px; }
.kan-card-meta { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }

/* ===== Calendar ===== */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; padding: 4px 6px; }
.cal-cell { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px; min-height: 90px; font-size: 11px; }
.cal-cell.today { border-color: var(--accent); }
.cal-cell.outside { opacity: 0.4; }
.cal-day-num { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.cal-cell.today .cal-day-num { color: var(--accent); font-weight: 600; }
.cal-event { font-size: 10px; padding: 2px 5px; border-radius: 3px; margin-bottom: 2px; background: var(--surface-3); border-left: 2px solid var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }

/* ===== Toggle group ===== */
.toggle-grp { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 2px; }
.toggle-grp button { padding: 5px 10px; font-size: 12px; border: none; background: transparent; color: var(--text-2); border-radius: 4px; }
.toggle-grp button.on { background: var(--surface-3); color: var(--text); }

/* misc */
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.muted { color: var(--text-3); }
.tiny { font-size: 11px; }
hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.scroll { overflow-y: auto; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-2); }


/* ===== Section dividers (3-section dashboard) ===== */
.dash-section { margin-bottom: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.section-title { display: flex; align-items: center; gap: 12px; }
.section-title h2 { font-family: var(--serif); font-size: 20px; font-weight: 500; margin: 0; letter-spacing: -0.01em; }
.section-num { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #1a1d1f; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; font-family: var(--sans); }

/* ===== Box label (alphabet ID) ===== */
.card { position: relative; }
.box-label { position: absolute; top: 10px; right: 12px; font-size: 9px; color: var(--text-3); font-family: var(--sans); letter-spacing: 0.1em; font-weight: 600; opacity: 0.55; pointer-events: none; }

/* ===== KPI val variants ===== */
.kpi .val.pos { color: var(--green); }
.kpi .val.neg { color: var(--red); }

/* ===== Recent published item ===== */
.recent-item { padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.recent-item:last-child { border-bottom: none; }
.recent-item:hover .recent-title { color: var(--accent); }
.recent-title { font-size: 13px; line-height: 1.35; margin-bottom: 4px; transition: color 0.12s; }
.recent-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.recent-url { font-size: 10px; color: var(--text-3); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-url:hover { color: var(--accent-2); text-decoration: underline; }
.link-count { color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ===== Segmented toggle ===== */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 2px; gap: 2px; }
.seg-btn { background: transparent; border: none; color: var(--text-2); font-size: 11px; padding: 4px 10px; border-radius: 4px; cursor: pointer; font-family: var(--sans); }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--accent); color: #1a1d1f; font-weight: 500; }


/* ===== Editable title input (drawer head) ===== */
.inp-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  color: var(--text);
  padding: 2px 0;
  margin: 4px 0 0 0;
  width: 100%;
  outline: none;
  transition: 0.12s;
}
.inp-title:hover { border-bottom-color: var(--border); }
.inp-title:focus { border-bottom-color: var(--accent); }

/* ===== Form field ===== */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field > label {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}
.field .inp { width: 100%; }
.tiny-inp { padding: 5px 8px; font-size: 12px; }

/* ===== Kanban inline date input ===== */
.kan-date-inp {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-2);
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: var(--sans);
  cursor: pointer;
  width: 110px;
}
.kan-date-inp:hover { border-color: var(--border); color: var(--text); }
.kan-date-inp:focus { outline: none; border-color: var(--accent); color: var(--text); }
.kan-date-inp::-webkit-calendar-picker-indicator { filter: invert(0.6); cursor: pointer; }
[data-theme="light"] .kan-date-inp::-webkit-calendar-picker-indicator { filter: invert(0.3); }

.kan-edit-btn {
  margin-left: auto;
  padding: 2px 6px;
  opacity: 0.6;
}
.kan-edit-btn:hover { opacity: 1; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 95;
  opacity: 0;
  pointer-events: none;
  transition: 0.18s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 720px;
  max-width: 96vw;
  max-height: 90vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  z-index: 96;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
}
.modal-tab {
  background: transparent;
  border: none;
  padding: 12px 18px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  border-bottom: 2px solid transparent;
  transition: 0.12s;
}
.modal-tab:hover { color: var(--text); }
.modal-tab.active {
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  background: var(--surface);
}

.modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}

/* ===== CSV export preview ===== */
.export-preview {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 11px;
}
.export-row {
  display: grid;
  grid-template-columns: 30px 1.4fr 1fr 1.6fr 1fr 0.9fr;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
}
.export-row:last-child { border-bottom: none; }
.export-row.export-head {
  font-family: var(--sans);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  background: var(--surface-3);
}
.export-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* date input visibility */
input[type="date"].inp {
  font-family: var(--sans);
}
input[type="date"].inp::-webkit-calendar-picker-indicator {
  filter: invert(0.6);
  cursor: pointer;
}
[data-theme="light"] input[type="date"].inp::-webkit-calendar-picker-indicator {
  filter: invert(0.3);
}


/* ===== Kanban v2: drag-drop, card fields, scheduled date ===== */
.kan-col {
  transition: background 0.12s, border-color 0.12s;
}
.kan-col.drag-over {
  background: var(--surface-2);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.kan-card {
  cursor: grab;
  transition: 0.12s;
}
.kan-card:active { cursor: grabbing; }
.kan-card.dragging { opacity: 0.4; transform: scale(0.97); }
.kan-card.needs-date { border-color: var(--red); }

.kan-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}
.kan-id {
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--sans);
  font-weight: 700;
}

.kan-card-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.kan-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}
.kan-field-lbl {
  font-size: 9px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 3px;
}
.kan-field.required .kan-field-lbl { color: var(--red); }
.kan-field.today .kan-field-lbl { color: var(--accent); }
.kan-field.past .kan-field-lbl { color: var(--red); }
.kan-required { color: var(--red); font-weight: 600; }

.kan-field .kan-date-inp {
  width: 100%;
  font-size: 11px;
  padding: 3px 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
}
.kan-field.required .kan-date-inp { border-color: var(--red); }
.kan-field.today .kan-date-inp { border-color: var(--accent); background: rgba(212,168,90,0.08); }
.kan-field.past .kan-date-inp { border-color: var(--red); background: rgba(226,107,107,0.08); }

.kan-warn {
  font-size: 10px;
  color: var(--red);
  margin-top: 6px;
  padding: 4px 6px;
  background: rgba(226,107,107,0.1);
  border-radius: 3px;
  line-height: 1.35;
}
.kan-warn.good {
  color: var(--green);
  background: rgba(94,196,122,0.1);
}

.kan-drop-hint {
  padding: 14px 6px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  margin-top: 4px;
}
.kan-col.drag-over .kan-drop-hint {
  border-color: var(--accent);
  color: var(--accent);
}

/* Content-specific export preview (6 columns instead of 6 with different widths) */
.export-preview.content-export .export-row {
  grid-template-columns: 36px 1.4fr 1fr 0.8fr 0.7fr 0.7fr 0.7fr 0.7fr;
}


/* ===== Slot state colors ===== */
:root {
  --slot-pending: #d4a85a;       /* yellow/gold */
  --slot-pending-bg: rgba(212,168,90,0.14);
  --slot-scheduled: #5ec47a;     /* green */
  --slot-scheduled-bg: rgba(94,196,122,0.14);
  --slot-posted: #2a8447;        /* dark green */
  --slot-posted-bg: rgba(42,132,71,0.22);
  --slot-overdue: #e26b6b;       /* red */
  --slot-overdue-bg: rgba(226,107,107,0.14);
}
[data-theme="light"] {
  --slot-pending-bg: rgba(180,140,60,0.18);
  --slot-scheduled-bg: rgba(70,160,90,0.18);
  --slot-posted-bg: rgba(30,110,55,0.22);
  --slot-overdue-bg: rgba(200,80,80,0.18);
}

.slot-pill {
  display: inline-block;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.slot-pill.pending   { color: var(--slot-pending);   background: var(--slot-pending-bg);   border-color: rgba(212,168,90,0.4); }
.slot-pill.scheduled { color: var(--slot-scheduled); background: var(--slot-scheduled-bg); border-color: rgba(94,196,122,0.4); }
.slot-pill.posted    { color: #fff;                  background: var(--slot-posted);       border-color: var(--slot-posted); }
.slot-pill.overdue   { color: var(--slot-overdue);   background: var(--slot-overdue-bg);   border-color: rgba(226,107,107,0.4); }

/* Legend */
.cal-legend {
  display: flex; gap: 18px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 10px 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  font-size: 11px;
}
.cal-legend-item { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }

/* ===== Week calendar ===== */
.week-cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.week-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  min-height: 260px;
}
.week-day.past { background: var(--surface); opacity: 0.85; }
.week-day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.week-day-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.week-day-name {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.week-day-num {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.week-day.today .week-day-num { color: var(--accent); }
.week-day-rel { margin-top: 2px; }

.week-day-slots { display: flex; flex-direction: column; gap: 6px; }
.slot-card {
  padding: 6px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: 0.12s;
  border-left-width: 3px;
}
.slot-card:hover { border-color: var(--border-2); }
.slot-card.slot-pending   { border-left-color: var(--slot-pending); }
.slot-card.slot-scheduled { border-left-color: var(--slot-scheduled); }
.slot-card.slot-posted    { border-left-color: var(--slot-posted); background: var(--slot-posted-bg); }
.slot-card.slot-overdue   { border-left-color: var(--slot-overdue); background: var(--slot-overdue-bg); }
.slot-ch { font-size: 11px; font-weight: 500; }
.slot-blog {
  font-size: 10px;
  color: var(--text-2);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
}

/* ===== Month calendar ===== */
.month-cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.month-head {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 8px;
  font-weight: 600;
}
.month-cell {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
  min-height: 100px;
  position: relative;
  overflow: hidden;
}
.month-cell.outside { background: transparent; border-color: transparent; }
.month-cell.past { opacity: 0.75; }
.month-cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.month-cell-num {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  margin-bottom: 4px;
}
.month-cell.today .month-cell-num { color: var(--accent); font-weight: 600; }
.month-slots { display: flex; flex-direction: column; gap: 2px; }
.month-slot {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 3px;
  cursor: pointer;
  background: var(--surface);
  border-left: 2px solid var(--slot-pending);
}
.month-slot.slot-scheduled { border-left-color: var(--slot-scheduled); }
.month-slot.slot-posted { border-left-color: var(--slot-posted); background: var(--slot-posted-bg); }
.month-slot.slot-overdue { border-left-color: var(--slot-overdue); background: var(--slot-overdue-bg); }
.slot-dot { display: none; }
.slot-ch-mini { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month-more {
  font-size: 9px;
  color: var(--text-3);
  margin-top: 2px;
  padding: 0 4px;
}
.month-state-bar {
  position: absolute;
  bottom: 4px; left: 6px;
  display: flex; gap: 3px;
}
.state-dot {
  width: 6px; height: 6px; border-radius: 50%;
  display: inline-block;
}
.state-dot.slot-pending { background: var(--slot-pending); }
.state-dot.slot-scheduled { background: var(--slot-scheduled); }
.state-dot.slot-posted { background: var(--slot-posted); }
.state-dot.slot-overdue { background: var(--slot-overdue); }

/* ===== Drawer: deadline stack ===== */
.deadline-stack { display: flex; flex-direction: column; gap: 6px; }
.deadline-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  border-left: 3px solid var(--border-2);
}
.deadline-row.done { border-left-color: var(--slot-scheduled); background: var(--slot-scheduled-bg); }
.deadline-row.overdue { border-left-color: var(--slot-overdue); background: var(--slot-overdue-bg); }
.deadline-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--surface-3);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  color: var(--text-2);
  flex-shrink: 0;
}
.deadline-row.done .deadline-dot { background: var(--slot-scheduled); color: #fff; }
.deadline-row.overdue .deadline-dot { background: var(--slot-overdue); color: #fff; }
.deadline-name { font-size: 13px; font-weight: 500; }
.deadline-desc { font-size: 11px; color: var(--text-3); }
.deadline-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}
.deadline-row.done .deadline-date { color: var(--slot-scheduled); }
.deadline-row.overdue .deadline-date { color: var(--slot-overdue); }

/* Published banner in drawer */
.published-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--slot-posted-bg);
  border: 1px solid var(--slot-posted);
  border-radius: 10px;
}
.published-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--slot-posted);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600;
}
.published-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }
.published-date { font-family: var(--serif); font-size: 18px; font-weight: 500; margin-top: 2px; }

/* Single-field card layout */
.kan-card-fields.single { grid-template-columns: 1fr; }


/* ===== Calendar drag-drop states ===== */
.week-day.drag-over {
  background: var(--slot-scheduled-bg);
  border-color: var(--slot-scheduled);
  box-shadow: inset 0 0 0 2px var(--slot-scheduled);
}
.month-cell.drag-over {
  background: var(--slot-scheduled-bg);
  border-color: var(--slot-scheduled);
  box-shadow: inset 0 0 0 2px var(--slot-scheduled);
}
.slot-card[draggable="true"] { cursor: grab; }
.slot-card[draggable="true"]:active { cursor: grabbing; }
.month-slot[draggable="true"] { cursor: grab; }
.month-slot[draggable="true"]:active { cursor: grabbing; }

/* tighter legend item with muted right slot */
.cal-legend .cal-legend-item.muted { color: var(--text-3); }

/* Hover slide-down submenu transition */
.content-wrapper {
  position: relative;
}

.content-wrapper .submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.7s ease-in-out;
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: -2px;
  margin-bottom: 2px;
}

.content-wrapper:hover .submenu,
.content-wrapper.open .submenu {
  max-height: 80px;
}

.submenu-item {
  background: transparent;
  border: none;
  color: var(--text-3);
  padding: 6px 12px;
  text-align: left;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.submenu-item:hover, .submenu-item.active {
  color: var(--accent);
  background: var(--surface-2);
}

.submenu-item .badge {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 10px;
  font-family: var(--sans);
  margin-left: auto;
}

.submenu-item .badge.overdue {
  background: var(--red);
  color: #fff;
  font-weight: 600;
}

.nav-item .badge.overdue {
  background: var(--red);
  color: #fff;
  font-weight: 600;
}
