*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5f3ef;
  --surface: #ffffff;
  --border: #e8e4de;
  --border-strong: #d0c9bf;
  --text: #1c1917;
  --text-muted: #78716c;
  --text-faint: #a8a29e;
  --accent: #16793a;
  --accent-light: #dcfce7;
  --accent-hover: #0f5a2b;
  --danger: #dc2626;
  --danger-light: #fee2e2;

  /* Category colors */
  --cat-education: #dbeafe;
  --cat-education-text: #1e40af;
  --cat-ticket: #fef9c3;
  --cat-ticket-text: #854d0e;
  --cat-brand: #fce7f3;
  --cat-brand-text: #9d174d;
  --cat-fundraising: #ede9fe;
  --cat-fundraising-text: #5b21b6;
  --cat-announcement: #ffedd5;
  --cat-announcement-text: #9a3412;

  /* Status colors */
  --status-draft: #f3f4f6;
  --status-draft-text: #6b7280;
  --status-review: #fef9c3;
  --status-review-text: #854d0e;
  --status-scheduled: #dbeafe;
  --status-scheduled-text: #1e40af;
  --status-posted: #dcfce7;
  --status-posted-text: #166534;
  --status-approved: #dcfce7;
  --status-approved-text: #166534;
  --status-hold: #fee2e2;
  --status-hold-text: #991b1b;

  /* Content type colors */
  --type-post: #e0f2fe;
  --type-email: #ede9fe;
  --type-tabling: #fef9c3;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

/* ── HEADER ─────────────────────────────────────────── */
.header {
  background: var(--text);
  color: white;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  font-family: 'Instrument Serif', serif;
  font-size: 20px;
  color: white;
  letter-spacing: -0.02em;
}

.logo span {
  color: #86efac;
}

.header-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a8a29e;
  border: 1px solid #3f3f46;
  padding: 2px 8px;
  border-radius: 4px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.15);
}
.btn-ghost:hover { background: rgba(255,255,255,0.15); }

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-strong);
  color: var(--text-muted);
}
.btn-outline:hover { background: var(--border); color: var(--text); }
.btn-outline.active { background: var(--text); color: white; border-color: var(--text); }

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: none;
}
.btn-danger:hover { background: var(--danger); color: white; }

/* ── TOOLBAR ─────────────────────────────────────────── */
.toolbar {
  background: var(--surface);
  border-bottom: 1.5px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toolbar-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.week-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 160px;
  text-align: center;
}

.tab-group {
  display: flex;
  background: var(--bg);
  border-radius: 6px;
  padding: 3px;
  gap: 2px;
}

.tab {
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.tab.active {
  background: white;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ── MAIN LAYOUT ─────────────────────────────────────── */
.main {
  padding: 20px 24px 60px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── WEEK CALENDAR ───────────────────────────────────── */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.day-col {
  background: var(--surface);
  border-radius: 10px;
  border: 1.5px solid var(--border);
  overflow: hidden;
  min-height: 200px;
  transition: border-color 0.15s;
}

.day-col.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}

.day-header {
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.day-name {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.day-num {
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  color: var(--text);
  line-height: 1;
}

.day-col.today .day-name { color: var(--accent); }
.day-col.today .day-num { color: var(--accent); }
.day-col.today { border-color: var(--accent); }

.day-body {
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.add-btn {
  width: 100%;
  padding: 6px;
  background: none;
  border: 1.5px dashed var(--border);
  border-radius: 6px;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s;
  margin-top: 4px;
}
.add-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* ── CALENDAR CARDS ──────────────────────────────────── */
.cal-card {
  border-radius: 6px;
  padding: 7px 9px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.15s;
  position: relative;
  user-select: none;
}
.cal-card:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,0.1); }
.cal-card[draggable="true"] { cursor: grab; }
.cal-card.dragging { opacity: 0.4; }

.cal-card.type-post { background: #f0f9ff; border-color: #bae6fd; }
.cal-card.type-email { background: #f5f3ff; border-color: #ddd6fe; }
.cal-card.type-tabling { background: #fefce8; border-color: #fde68a; }

.card-top {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.card-type-icon {
  font-size: 11px;
}

.card-platform {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.card-theme {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-Draft { background: var(--status-draft); color: var(--status-draft-text); }
.status-Needs-Review { background: var(--status-review); color: var(--status-review-text); }
.status-Scheduled { background: var(--status-scheduled); color: var(--status-scheduled-text); }
.status-Posted { background: var(--status-posted); color: var(--status-posted-text); }
.status-Approved { background: #dcfce7; color: #166534; }
.status-On-Hold { background: var(--status-hold); color: var(--status-hold-text); }

.cat-Education { background: var(--cat-education); color: var(--cat-education-text); }
.cat-Ticket-Sales { background: var(--cat-ticket); color: var(--cat-ticket-text); }
.cat-Brand-Building { background: var(--cat-brand); color: var(--cat-brand-text); }
.cat-Fundraising { background: var(--cat-fundraising); color: var(--cat-fundraising-text); }
.cat-Announcement { background: var(--cat-announcement); color: var(--cat-announcement-text); }

/* ── LIST VIEW ───────────────────────────────────────── */
.list-view { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }

.list-section-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 12px 0 4px;
  border-bottom: 1px solid var(--border);
}

.list-row {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 90px 70px 110px 120px 110px 1fr auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: all 0.15s;
}
.list-row:hover { border-color: var(--border-strong); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.list-row.type-email { border-left: 3px solid #a78bfa; }
.list-row.type-tabling { border-left: 3px solid #fbbf24; }
.list-row.type-post { border-left: 3px solid #38bdf8; }

.list-date { font-size: 12px; font-weight: 600; color: var(--text-muted); font-family: 'DM Mono', monospace; }
.list-theme { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-copy { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-actions { display: flex; gap: 5px; align-items: center; }

/* ── MODAL ───────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s;
}
.overlay.open { opacity: 1; }

.modal {
  background: var(--surface);
  border-radius: 14px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  transform: translateY(10px);
  transition: transform 0.2s;
}
.overlay.open .modal { transform: translateY(0); }

.modal-header {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 10;
  border-radius: 14px 14px 0 0;
}

.modal-title {
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-radius: 0 0 14px 14px;
}

/* ── FORM ELEMENTS ───────────────────────────────────── */
.form-row { display: grid; gap: 14px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.field { display: flex; flex-direction: column; gap: 5px; }

label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="url"],
select,
textarea {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 9px 12px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: white; }
textarea { resize: vertical; min-height: 80px; }

/* ── TYPE SWITCHER ───────────────────────────────────── */
.type-switcher {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.type-btn {
  flex: 1;
  padding: 10px 8px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: white;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  transition: all 0.15s;
}
.type-btn:hover { border-color: var(--border-strong); }
.type-btn.active.post { border-color: #38bdf8; background: #f0f9ff; color: #0369a1; }
.type-btn.active.email { border-color: #a78bfa; background: #f5f3ff; color: #6d28d9; }
.type-btn.active.tabling { border-color: #fbbf24; background: #fefce8; color: #92400e; }

/* ── CONTENT DUE CALLOUT ─────────────────────────────── */
.due-callout {
  background: #fef9c3;
  border: 1.5px solid #fde68a;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #92400e;
}

/* ── EMPTY STATE ─────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-faint);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .empty-title { font-weight: 600; font-size: 16px; color: var(--text-muted); margin-bottom: 6px; }
.empty-state .empty-sub { font-size: 13px; }

/* ── CONFIRM DIALOG ──────────────────────────────────── */
.confirm-dialog {
  background: white;
  border-radius: 12px;
  padding: 28px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

/* ── TOAST ───────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── MONTH GRID ──────────────────────────────────────── */
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--border);
}

.month-day-header {
  background: var(--text);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 8px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.month-cell {
  background: var(--surface);
  min-height: 110px;
  padding: 6px;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  position: relative;
  vertical-align: top;
  transition: background 0.1s;
}
.month-cell:nth-child(7n) { border-right: none; }
.month-cell.other-month { background: #faf9f7; }
.month-cell.today { background: #f0fdf4; }
.month-cell.today .month-cell-num { color: var(--accent); font-weight: 700; }

.month-cell-num {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 4px;
  line-height: 1;
}
.month-cell.other-month .month-cell-num { color: var(--text-faint); }

.month-cell .add-btn {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  padding: 0;
  font-size: 14px;
  border-radius: 4px;
  display: none;
}
.month-cell:hover .add-btn { display: flex; align-items: center; justify-content: center; }

.month-card {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  margin-bottom: 3px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.15s;
  line-height: 1.4;
}
.month-card:hover { opacity: 0.8; }
.month-card.type-post { background: #e0f2fe; color: #0369a1; }
.month-card.type-email { background: #ede9fe; color: #6d28d9; }
.month-card.type-tabling { background: #fef9c3; color: #92400e; }

.month-more {
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}
.month-more:hover { color: var(--accent); }

/* ── SCROLLBAR ───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
