:root {
  --green: #217346;
  --green-dk: #185a36;
  --green-mid: #2d8a56;
  --green-lt: #e6f4ec;
  --ink: #201f1e;
  --ink-2: #323130;
  --muted: #605e5c;
  --faint: #8a8886;
  --line: #d2d0ce;
  --grid: #edebe9;
  --bg: #f3f2f1;
  --white: #fff;
  --sel: #deecf9;
  --sel-edge: #2b88d8;
  --weekend: #f7f6f4;
  --today: #d13438;
  --row-h: 30px;
  --head-h: 48px;
  --font: "Segoe UI", "SF Pro Text", -apple-system, system-ui, sans-serif;
  --shadow: 0 1px 0 rgba(0,0,0,.06);
  --shadow-md: 0 8px 28px rgba(16,24,20,.16);
  --todo: #d13438;
  --todo-bg: #fff;
  --doing-y: #f1c40f;
  --doing-o: #e67e22;
  --doing-bg: #fff;
  --done: #217346;
  --done-bg: #fff;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #e9e8e6;
  overflow: hidden;
  font-size: 12px;
  -webkit-font-smoothing: antialiased;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--white);
}

/* ========== Title bar ========== */
.titlebar {
  height: 52px;
  background: linear-gradient(180deg, #26824f 0%, var(--green) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 16px 0 12px;
  gap: 16px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 40;
}
.tb-brand { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.logo {
  width: 28px; height: 28px;
  background: #fff;
  color: var(--green);
  border-radius: 5px;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
}
.logo svg { width: 18px; height: 18px; }
.tb-titles { line-height: 1.15; }
.app-name { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.file-name { font-size: 13px; font-weight: 600; max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tb-search {
  flex: 1;
  max-width: 420px;
  height: 30px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: rgba(255,255,255,.85);
}
.tb-search:focus-within { background: #fff; color: var(--muted); border-color: #fff; }
.tb-search input {
  flex: 1;
  border: 0;
  background: transparent;
  color: inherit;
  font: 12px var(--font);
  outline: none;
}
.tb-search input::placeholder { color: inherit; opacity: .75; }

.tb-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
#accountBox { display: flex; align-items: center; gap: 6px; }
.tb-dates { text-align: right; line-height: 1.2; }
.tb-kicker { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; opacity: .7; font-weight: 700; }
.meta { font-size: 11px; opacity: .95; }

.hdr-ring {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255,255,255,.22) 0);
  display: grid;
  place-items: center;
  position: relative;
}
.hdr-ring::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--green);
  border-radius: 50%;
}
.hdr-ring span {
  position: relative;
  z-index: 1;
  font-size: 9px;
  font-weight: 700;
}

/* ========== Ribbon ========== */
.ribbon { background: #fff; border-bottom: 1px solid var(--line); flex-shrink: 0; box-shadow: var(--shadow); z-index: 35; position: sticky; top: 52px; }
.ribbon-tabs {
  display: flex;
  padding: 0 10px;
  background: var(--green);
  gap: 2px;
}
.ribbon-tabs button {
  background: transparent;
  border: 0;
  color: rgba(255,255,255,.88);
  padding: 8px 16px 9px;
  font: 600 12px var(--font);
  cursor: pointer;
  border-radius: 4px 4px 0 0;
}
.ribbon-tabs button:hover { background: rgba(255,255,255,.12); color: #fff; }
.ribbon-tabs button.active { background: #fff; color: var(--green); }

.ribbon-body {
  display: flex;
  gap: 0;
  padding: 8px 6px 6px;
  align-items: stretch;
  min-height: 78px;
}
.rgroup {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
  border-right: 1px solid var(--grid);
}
.rgroup:last-child { border-right: 0; }
.rgroup .btns { display: flex; gap: 3px; align-items: flex-start; }
.rbtn {
  border: 1px solid transparent;
  background: #fff;
  padding: 6px 8px 5px;
  min-width: 58px;
  border-radius: 4px;
  cursor: pointer;
  font: 11px/1.2 var(--font);
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.rbtn:hover { background: var(--green-lt); border-color: #c5dfd0; }
.rbtn:active { background: #d8eedf; }
.rbtn.on { background: var(--green-lt); border-color: #9cc9ad; color: var(--green-dk); }
.ico-svg { width: 18px; height: 18px; color: var(--green); }
.rbtn .ico { font-size: 15px; line-height: 1; color: var(--green); }
.rgroup label.tiny {
  font-size: 10px;
  color: var(--faint);
  text-align: center;
  margin-top: auto;
  letter-spacing: .02em;
}
select.rselect, input.rinput {
  font: 11px var(--font);
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
}
input.rinput { min-width: 180px; }
select.rselect { min-width: 200px; }
.chk {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-2);
}

/* ========== Timeline ========== */
.timeline-strip {
  background: #faf9f8;
  border-bottom: 1px solid var(--line);
  padding: 8px 16px 10px;
  flex-shrink: 0;
}
.tl-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.tl-head h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.tl-range { font-size: 11px; color: var(--faint); }
.tl-axis {
  display: flex;
  height: 16px;
  margin-bottom: 4px;
  position: relative;
}
.tl-tick {
  position: absolute;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  transform: translateX(-50%);
}
.tl-track {
  position: relative;
  height: 38px;
  background:
    linear-gradient(90deg, rgba(33,115,70,.06) 0, transparent 8%, transparent 92%, rgba(209,52,56,.08) 100%),
    #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.tl-item {
  position: absolute;
  top: 8px;
  height: 22px;
  border-radius: 3px;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.15);
}
.tl-item:hover { filter: brightness(1.08); }
.tl-mile {
  width: 10px;
  height: 10px;
  top: 14px;
  padding: 0;
  transform: rotate(45deg);
  border-radius: 1px;
  box-shadow: 0 0 0 2px #fff;
}

/* ========== Views ========== */
.views { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--white); }
.view { display: none; flex: 1; min-height: 0; }
.view.active { display: flex; flex-direction: column; }

.gantt-view { flex-direction: row !important; }
.sheet-pane {
  width: 54%;
  min-width: 340px;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.gantt-pane {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}
.splitter {
  width: 6px;
  cursor: col-resize;
  background: var(--bg);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  flex-shrink: 0;
  position: relative;
}
.splitter::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 2px;
  width: 2px;
  height: 22px;
  margin-top: -11px;
  background: #c8c6c4;
  border-radius: 1px;
}
.splitter:hover { background: var(--green-lt); }

.sheet-scroll, .gantt-scroll { flex: 1; overflow: auto; }
.gantt-scroll { overflow-x: auto; overflow-y: auto; }

.sheet-scroll::-webkit-scrollbar,
.gantt-scroll::-webkit-scrollbar { width: 11px; height: 11px; }
.sheet-scroll::-webkit-scrollbar-thumb,
.gantt-scroll::-webkit-scrollbar-thumb { background: #c8c6c4; border: 2px solid #fff; border-radius: 8px; }
.sheet-scroll::-webkit-scrollbar-track,
.gantt-scroll::-webkit-scrollbar-track { background: #f3f2f1; }

table.sheet {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
}
table.sheet th, table.sheet td {
  border-right: 1px solid #e1dfdd;
  border-bottom: 1px solid #e1dfdd;
  height: var(--row-h);
  padding: 0 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11.5px;
  vertical-align: middle;
}
table.sheet thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: linear-gradient(#f8f7f6, #f0efed);
  font-weight: 600;
  color: #484644;
  height: var(--head-h);
  text-align: left;
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 1px solid #d0cecb;
}
table.sheet th.ind { width: 22px; padding: 0; }
table.sheet th.id, table.sheet td.id { width: 36px; text-align: center; color: var(--faint); }
table.sheet th.wbs, table.sheet td.wbs { width: 52px; color: var(--muted); font-variant-numeric: tabular-nums; }
table.sheet th.dur { width: 68px; }
table.sheet th.dt, table.sheet td.dt { width: 78px; font-variant-numeric: tabular-nums; }
table.sheet th.pred { width: 48px; }
table.sheet th.res { width: 120px; }
table.sheet th.pct { width: 86px; }

table.sheet tbody tr { height: var(--row-h); }
table.sheet tbody tr:nth-child(even) td { background: #fcfcfb; }
table.sheet tbody tr:hover td { background: #f3f9f5; }
table.sheet tbody tr.selected td {
  background: var(--sel);
  box-shadow: inset 3px 0 0 var(--sel-edge);
}
table.sheet tbody tr.summary td { background: #f4f3f2; }
table.sheet tbody tr.summary td.name { font-weight: 700; color: var(--ink); }
table.sheet tbody tr.l0 td.name { font-size: 12px; letter-spacing: .01em; }
table.sheet tbody tr.milestone td.name { font-style: italic; }
table.sheet td.num, table.sheet th.num { text-align: right; }
table.sheet td.ind { text-align: center; padding: 0; color: var(--faint); }
table.sheet .twisty {
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 9px;
  border-radius: 3px;
}
table.sheet .twisty:hover { background: #e1dfdd; }
table.sheet .indent { display: inline-block; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
}
.chip i {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.pct-cell { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.pct-mini {
  width: 28px; height: 5px;
  background: #e1dfdd;
  border-radius: 3px;
  overflow: hidden;
}
.pct-mini b { display: block; height: 100%; background: var(--todo); }
.pct-mini.st-todo b { background: var(--todo); }
.pct-mini.st-doing b { background: linear-gradient(90deg, var(--doing-y), var(--doing-o)); }
.pct-mini.st-done b { background: var(--done); }
table.sheet tbody tr.st-todo td,
table.sheet tbody tr.st-doing td,
table.sheet tbody tr.st-done td { background: #fff; }
table.sheet tbody tr.st-todo td.ind { box-shadow: inset 4px 0 0 var(--todo); }
table.sheet tbody tr.st-doing td.ind { box-shadow: inset 4px 0 0 var(--doing-o); }
table.sheet tbody tr.st-done td.ind { box-shadow: inset 4px 0 0 var(--done); }
table.sheet tbody tr.st-todo:hover td,
table.sheet tbody tr.st-doing:hover td,
table.sheet tbody tr.st-done:hover td { background: #f8f7f6; }
table.sheet tbody tr.selected.st-todo td,
table.sheet tbody tr.selected.st-doing td,
table.sheet tbody tr.selected.st-done td { box-shadow: inset 3px 0 0 var(--sel-edge); }
table.sheet input.pct {
  width: 34px;
  border: 1px solid transparent;
  background: transparent;
  font: 11px var(--font);
  text-align: right;
}
table.sheet input.pct:focus { border-color: var(--green); background: #fff; outline: none; border-radius: 2px; }

/* ========== Gantt ========== */
.gantt-head {
  height: var(--head-h);
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(#f8f7f6, #f0efed);
  border-bottom: 1px solid #d0cecb;
}
.gantt-months, .gantt-days { display: flex; height: 24px; }
.gantt-months { border-bottom: 1px solid var(--line); }
.gantt-m, .gantt-d {
  border-right: 1px solid #e1dfdd;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #484644;
}
.gantt-m { font-weight: 700; letter-spacing: .03em; text-transform: uppercase; font-size: 10px; }
.gantt-d.weekend { background: var(--weekend); color: #a19f9d; }
.gantt-d.today { background: #fde7e9; color: var(--today); font-weight: 700; }

.gantt-body { position: relative; }
.gantt-row {
  height: var(--row-h);
  position: relative;
  border-bottom: 1px solid #f0eeec;
}
.gantt-row:nth-child(even) { background: #fcfcfb; }
.gantt-row.selected { background: var(--sel); }
.gantt-gridcol {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: #f3f2f1;
  pointer-events: none;
}
.gantt-gridcol.weekend { background: var(--weekend); width: var(--day-w, 18px); opacity: .85; }
.gantt-today {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--today);
  z-index: 4;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(209,52,56,.15);
}

.bar {
  position: absolute;
  top: 7px;
  height: 16px;
  border-radius: 3px;
  min-width: 4px;
  z-index: 2;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 1px rgba(0,0,0,.12);
}
.bar:hover { filter: brightness(1.06); }
.bar.summary {
  height: 9px;
  top: 11px;
  border-radius: 0;
  background: #252423 !important;
  box-shadow: none;
}
.bar.summary::before, .bar.summary::after {
  content: "";
  position: absolute;
  top: 0;
  border: 5px solid transparent;
}
.bar.summary::before { left: 0; border-top-color: #252423; border-left-color: #252423; }
.bar.summary::after { right: 0; border-top-color: #252423; border-right-color: #252423; }
.bar .fill {
  height: 100%;
  background: rgba(0,0,0,.28);
  border-radius: 3px 0 0 3px;
}
.bar.hi { outline: 1px solid rgba(209,52,56,.35); }
.bar.st-todo { background: var(--todo) !important; }
.bar.st-doing { background: linear-gradient(90deg, var(--doing-y), var(--doing-o)) !important; }
.bar.st-done { background: var(--done) !important; }
.diamond {
  position: absolute;
  top: 9px;
  width: 12px; height: 12px;
  background: var(--todo);
  transform: rotate(45deg);
  z-index: 3;
  cursor: pointer;
  box-shadow: 0 1px 1px rgba(0,0,0,.2);
}
.diamond.todo { background: var(--todo); }
.diamond.doing { background: var(--doing-o); }
.diamond.done { background: var(--done); }
.bar-label {
  position: absolute;
  top: 7px;
  font-size: 10px;
  font-weight: 600;
  color: #484644;
  white-space: nowrap;
  z-index: 2;
  pointer-events: none;
}

/* ========== Dashboard ========== */
.dash { padding: 18px 20px 28px; overflow: auto; background: var(--bg); }
.hero {
  background: linear-gradient(135deg, #1a5c38 0%, #217346 48%, #2b579a 130%);
  color: #fff;
  border-radius: 10px;
  padding: 20px 22px;
  display: grid;
  grid-template-columns: 1.4fr auto auto auto;
  gap: 22px;
  align-items: center;
  margin-bottom: 14px;
  box-shadow: var(--shadow-md);
}
.hero h2 { margin: 0 0 6px; font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.hero p { margin: 0; font-size: 12px; line-height: 1.45; opacity: .88; max-width: 520px; }
.hero-stat { text-align: center; min-width: 88px; }
.hero-stat b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.hero-stat span { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }

.kpis {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}
.kpi .v { font-size: 22px; font-weight: 700; color: var(--green-dk); letter-spacing: -.03em; }
.kpi .l { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cards { display: grid; grid-template-columns: 1.15fr 1fr; gap: 12px; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 16px 14px;
}
.card h3 { margin: 0 0 12px; font-size: 13px; font-weight: 700; }
.prio-list { list-style: none; margin: 0; padding: 0; }
.prio-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--grid);
  font-size: 12px;
}
.prio-list li span:last-child { color: var(--muted); white-space: nowrap; }
.bar-meter {
  height: 6px;
  background: var(--grid);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}
.bar-meter span { display: block; height: 100%; background: var(--green); border-radius: 4px; }

/* My Tasks */
.mine-view { overflow: auto; background: #fff; padding: 18px 22px 36px; }
.dash-view { overflow: auto; background: #fff; padding: 18px 22px 36px; }
.mine-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin: -18px 0 16px;
  padding: 18px 0 12px;
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
}
.mine-head h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.02em; }
.mine-head p { margin: 0; color: var(--muted); font-size: 13px; }
.mine-meta { font-size: 12px; font-weight: 700; color: var(--green-dk); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 6px 12px; }
.mine-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px 12px;
  margin-bottom: 10px;
}
.mine-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.mine-card h3 { margin: 8px 0 4px; font-size: 16px; }
.mine-sub { font-size: 12px; color: var(--muted); }
.st-btns { display: flex; gap: 4px; flex-shrink: 0; }
.st-btns button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 5px 10px;
  font: 600 11px var(--font);
  cursor: pointer;
}
.st-btns button.on { color: #fff; }
.st-btns button[data-st="0"].on { background: var(--todo); border-color: var(--todo); }
.st-btns button[data-st="50"].on {
  background: linear-gradient(90deg, var(--doing-y), var(--doing-o));
  border-color: var(--doing-o);
  color: #3d2a00;
}
.st-btns button[data-st="100"].on { background: var(--done); border-color: var(--done); }
.mine-card label { display: block; margin: 12px 0 4px; font-size: 11px; font-weight: 700; color: var(--muted); }
.mine-note {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  font: 13px var(--font);
  resize: vertical;
}
.mine-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 12px; }
.mine-last { font-size: 11px; color: var(--faint); }
.mine-empty { background: #fff; border: 1px dashed var(--line); border-radius: 8px; padding: 28px; color: var(--muted); text-align: center; }
.mine-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.mine-chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 5px 11px;
  font: 600 12px var(--font);
  color: var(--muted);
  cursor: pointer;
}
.mine-chip b { font-weight: 700; color: var(--ink); }
.mine-chip.on { color: #fff; }
.mine-chip.on b { color: #fff; }
.mine-chip[data-mf="todo"].on { background: var(--todo); border-color: var(--todo); }
.mine-chip[data-mf="doing"].on {
  background: linear-gradient(90deg, var(--doing-y), var(--doing-o));
  border-color: var(--doing-o);
  color: #3d2a00;
}
.mine-chip[data-mf="doing"].on b { color: #3d2a00; }
.mine-chip[data-mf="done"].on { background: var(--done); border-color: var(--done); }
.mine-chip[data-mf="open"].on,
.mine-chip[data-mf="all"].on { background: var(--ink-2); border-color: var(--ink-2); }
.mine-card.st-todo {
  background: #fff;
  border-color: var(--line);
  box-shadow: inset 6px 0 0 var(--todo);
}
.mine-card.st-doing {
  background: #fff;
  border-color: var(--line);
  box-shadow: inset 6px 0 0 var(--doing-o);
}
.mine-card.st-done {
  background: #fff;
  border-color: var(--line);
  box-shadow: inset 6px 0 0 var(--done);
}

.undo-btn {
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.1);
  color: #fff;
  border-radius: 4px;
  padding: 3px 10px;
  font: 600 11px var(--font);
  cursor: pointer;
  margin-right: 8px;
}
.undo-btn:disabled { opacity: .4; cursor: default; }
.undo-btn:not(:disabled):hover { background: rgba(255,255,255,.2); }

.undo-toast {
  position: fixed;
  left: 50%;
  bottom: 52px;
  transform: translateX(-50%) translateY(12px);
  background: #252423;
  color: #fff;
  border-radius: 8px;
  padding: 10px 12px 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  font: 600 13px var(--font);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  z-index: 80;
  transition: opacity .2s, transform .2s;
}
.undo-toast.show { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.undo-toast button {
  border: 0;
  background: #c8e6c9;
  color: #0b6a0b;
  font: 700 12px var(--font);
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
}

.pb-swal {
  font-family: var(--font) !important;
  border-radius: 10px !important;
}
.pb-swal .swal2-title {
  font-size: 22px !important;
  color: var(--ink) !important;
}
.pb-swal .swal2-html-container {
  font-size: 15px !important;
  color: var(--muted) !important;
}
.pb-swal .swal2-html-container strong { color: var(--ink); }

/* Resources */
.res-view { overflow: auto; background: #fff; }
.res-view table { width: 100%; border-collapse: collapse; }
.res-view th, .res-view td {
  border-bottom: 1px solid var(--grid);
  padding: 11px 16px;
  text-align: left;
  font-size: 12px;
}
.res-view th {
  background: #f8f7f6;
  position: sticky;
  top: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #484644;
}
.res-view tr:hover td { background: #f3f9f5; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  color: #fff; display: inline-grid; place-items: center;
  font-size: 10px; font-weight: 700; margin-right: 8px;
}
.who { display: flex; align-items: center; }

/* Actions */
.actions-view { overflow: auto; background: var(--bg); padding: 18px 20px 32px; }
.actions-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}
.actions-head h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.02em; }
.actions-head p { margin: 0; font-size: 12px; color: var(--muted); max-width: 560px; }
.actions-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--green-dk);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 12px;
}
.action-block {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.action-owner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #faf9f8;
  border-bottom: 1px solid var(--grid);
}
.action-owner span:last-child,
.action-owner div span { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.action-table { width: 100%; border-collapse: collapse; }
.action-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #484644;
  padding: 8px 14px;
  background: #f8f7f6;
  border-bottom: 1px solid var(--grid);
}
.action-table td {
  padding: 10px 14px;
  font-size: 12px;
  border-bottom: 1px solid var(--grid);
  vertical-align: top;
}
.action-table tr:last-child td { border-bottom: 0; }
.action-table tbody tr { cursor: pointer; }
.action-table tbody tr:hover td { background: #f3f9f5; }
.col-action { width: 28%; }
.col-need { color: var(--ink-2); }
.nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }
.st {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 10px;
}
.st.st-todo { background: var(--todo-bg); color: #a4262c; }
.st.st-prog { background: var(--doing-bg); color: #c45900; }
.st.st-done { background: var(--done-bg); color: var(--done); }

/* Weekly */
.week-view { overflow: auto; background: var(--bg); padding: 16px 18px 28px; }
.week-lead { margin: 0 0 14px; font-size: 12px; color: var(--muted); max-width: 720px; }
.week-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.week-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}
.week-card h3 { margin: 0 0 10px; font-size: 13px; }
.week-card table { width: 100%; border-collapse: collapse; }
.week-card td { padding: 7px 0; font-size: 12px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  letter-spacing: .02em;
}

/* Status */
.status {
  height: 28px;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 11px;
  gap: 14px;
  flex-shrink: 0;
}
.status .right { margin-left: auto; display: flex; gap: 14px; opacity: .92; }
.view-pills { display: flex; gap: 2px; background: rgba(0,0,0,.15); border-radius: 4px; padding: 2px; }
.view-pills button {
  border: 0;
  background: transparent;
  color: #fff;
  font: 600 10px var(--font);
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
}
.view-pills button.on { background: #fff; color: var(--green); }

/* Modal */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(32,31,30,.42);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal-bg.open { display: flex; }
.modal {
  background: #fff;
  width: 580px;
  max-width: 94vw;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.modal h2 {
  margin: 0;
  padding: 14px 18px;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
}
.modal .body { padding: 16px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.modal input, .modal select, .modal textarea {
  width: 100%;
  font: 13px var(--font);
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
}
.modal input:focus, .modal select:focus, .modal textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(33,115,70,.18);
}
.modal .full { grid-column: 1 / -1; }
.modal .foot {
  padding: 12px 18px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #faf9f8;
  border-top: 1px solid var(--grid);
}
.btn {
  border: 1px solid var(--line);
  background: #fff;
  padding: 7px 16px;
  border-radius: 4px;
  cursor: pointer;
  font: 12px var(--font);
}
.btn:hover { background: #f3f2f1; }
.btn.primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn.primary:hover { background: var(--green-dk); }
.btn.danger { color: #a4262c; border-color: #e1b3b5; }

.legend {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 10px;
  color: rgba(255,255,255,.82);
  overflow: hidden;
  white-space: nowrap;
}
.swatch { width: 9px; height: 9px; border-radius: 2px; display: inline-block; vertical-align: -1px; margin-right: 3px; }

@media print {
  .titlebar, .ribbon, .splitter, .status, .modal-bg, .timeline-strip { display: none !important; }
  .app, .views, .view.active { height: auto; overflow: visible; display: block; }
  body { overflow: visible; }
}

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .cards, .week-grid { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr 1fr 1fr; }
  .hero p { max-width: none; }
  .legend { display: none; }
  .tb-search { display: none; }
}
