:root {
  --cream: #F6F1E4;
  --surface: #FFFDF8;
  --forest: #1E3A2C;
  --forest-2: #274A38;
  --lime: #82C83C;
  --ink: #21201B;
  --muted: #8B8570;
  --line: #E4DCC8;
  --danger: #B33F3F;
  --danger-bg: #F6E6E4;

  --pillar-education: #3E6B8A;
  --pillar-entertainment: #C9762A;
  --pillar-relatability: #B0567D;
  --pillar-product: #1E3A2C;
  --pillar-bip: #6B4F9E;
  --pillar-community: #5C9A2E;
  --pillar-social: #8B8570;

  --radius: 10px;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
}

button, input, select, textarea { font-family: var(--font); font-size: 14px; }

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
  background: var(--forest);
  color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }

.brand-stripes {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: repeating-linear-gradient(
    115deg,
    var(--lime) 0px, var(--lime) 3px,
    var(--forest-2) 3px, var(--forest-2) 7px
  );
  flex-shrink: 0;
}

.brand-name { font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }

.view-switch { display: flex; gap: 4px; background: rgba(0,0,0,0.18); padding: 4px; border-radius: 999px; }

.tab {
  border: none;
  background: transparent;
  color: var(--cream);
  opacity: 0.7;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
}

.tab.is-active { opacity: 1; background: var(--forest-2); }

.btn {
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
}

.btn-primary { background: var(--lime); color: var(--forest); }
.btn-primary:hover { filter: brightness(1.06); }

.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { filter: brightness(0.98); }

/* ---------- Views ---------- */

main { padding: 20px 24px 60px; }

.view { display: none; }
.view.is-active { display: block; }

/* ---------- Board ---------- */

.board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.board-col {
  background: transparent;
  min-width: 260px;
  max-width: 260px;
  flex-shrink: 0;
}

.board-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 10px;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--forest);
}

.board-col-count {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.board-col-body { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }

.card-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-tile:hover { border-color: var(--forest-2); }

.card-tile-title { font-weight: 600; font-size: 13.5px; color: var(--ink); }

.card-tile-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11.5px; color: var(--muted); }

.card-tile-meta span { background: var(--cream); border-radius: 5px; padding: 2px 6px; }

.card-tile-status-select {
  margin-top: 2px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
  background: var(--cream);
  color: var(--ink);
}

.board-col-empty { font-size: 12.5px; color: var(--muted); padding: 8px 6px; font-style: italic; }

/* ---------- Table ---------- */

.table-toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }

.table-toolbar input, .table-toolbar select {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 8px 10px;
}

#table-search { flex: 1; min-width: 200px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

table { width: 100%; border-collapse: collapse; }

th, td { text-align: left; padding: 10px 14px; font-size: 13px; white-space: nowrap; }

thead th {
  color: var(--forest);
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
}

tbody tr { border-bottom: 1px solid var(--line); cursor: pointer; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--cream); }

.status-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--cream);
  color: var(--forest);
  border: 1px solid var(--line);
}

/* ---------- Dashboard ---------- */

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dash-card-wide { grid-column: 1 / -1; }

.dash-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.dash-card h2 { font-size: 14px; margin: 0 0 14px; color: var(--forest); font-weight: 700; }

.bar-list { display: flex; flex-direction: column; gap: 8px; }

.bar-row { display: grid; grid-template-columns: 110px 1fr 30px; align-items: center; gap: 10px; font-size: 12.5px; }

.bar-track { background: var(--cream); border-radius: 6px; height: 10px; overflow: hidden; }
.bar-fill { background: var(--lime); height: 100%; border-radius: 6px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.stat-box { background: var(--cream); border-radius: 8px; padding: 12px 14px; }
.stat-box .num { font-size: 22px; font-weight: 800; color: var(--forest); display: block; }
.stat-box .label { font-size: 12px; color: var(--muted); }

@media (max-width: 720px) {
  .dash-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Modals ---------- */

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30, 58, 44, 0.35);
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 100;
}

.modal-backdrop.is-open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: 14px;
  width: 100%;
  max-width: 640px;
  padding: 22px 24px 26px;
}

.modal-small { max-width: 420px; }

.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 17px; color: var(--forest); }

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

form { display: flex; flex-direction: column; gap: 12px; }

label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--forest-2); flex: 1; }

input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  font-weight: 400;
  color: var(--ink);
  background: #fff;
}

textarea { resize: vertical; }

.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row > label { min-width: 140px; }

.field-row-perf label { min-width: 100px; }

.section-label { font-size: 13px; color: var(--forest); margin: 4px 0 -4px; }

.modal-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.modal-actions-split { justify-content: space-between; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--forest);
  color: var(--cream);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
}

.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
