﻿/* ===== EDITOR v4 CSS ===== */

/* === Modal base === */
.po-modal-overlay {
  position: fixed; inset: 0; background: rgba(23,43,77,0.55);
  z-index: 999; display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.po-modal-overlay.open { display: flex; }
.po-modal-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: var(--space-4); width: 360px; box-shadow: 0 16px 48px rgba(0,0,0,0.2);
}
.po-modal-title {
  font-family: "Fraunces", serif; font-size: var(--text-xl); font-weight: 500;
  letter-spacing: -0.01em; margin-bottom: 6px; color: var(--ink);
}
.po-modal-hint { font-size: 13px; color: var(--ink-muted); margin-bottom: 18px; }
.po-modal-input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 4px;
  font-family: "Geist", -apple-system, sans-serif; font-size: 14px;
  outline: none; background: var(--bg); color: var(--ink); box-sizing: border-box;
}
.po-modal-input:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
.po-modal-error { color: var(--danger); font-size: 12px; min-height: 16px; margin-top: 4px; }
.po-modal-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: 14px; }
.po-btn { font-family: inherit; font-size: 13px; padding: 7px 16px; border-radius: 4px; cursor: pointer; }
.po-btn-cancel { background: transparent; border: 1px solid var(--line); color: var(--ink-muted); }
.po-btn-cancel:hover { border-color: var(--ink); color: var(--ink); }
.po-btn-primary { background: var(--accent); border: 1px solid var(--accent); color: #FFFFFF; }
.po-btn-primary:hover { background: #0B8FC9; }

/* === Edit toolbar === */
.po-edit-bar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: #172B4D; z-index: 100; padding: 10px 32px;
  align-items: center; gap: 12px;
}
body[data-mode="edit"] .po-edit-bar { display: flex; }
body[data-mode="edit"] { padding-bottom: 56px; }
.po-edit-bar-label {
  font-family: "Geist Mono", monospace; font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.45); margin-right: auto;
}
.po-edit-saved {
  font-family: "Geist Mono", monospace; font-size: 10.5px;
  color: rgba(255,255,255,0.35); transition: color 0.3s;
}
.po-edit-saved.flash { color: #7EBF83; }
.po-btn-pub {
  background: var(--status-green-ink); border: 1px solid var(--status-green-ink); color: #FFFFFF;
  font-family: inherit; font-size: 12px; padding: 6px 16px;
  border-radius: 4px; cursor: pointer; transition: all 0.12s;
}
.po-btn-pub:hover { background: #245228; }
.po-btn-pub:disabled { opacity: 0.55; cursor: default; }
.po-btn-logout {
  background: transparent; border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.6); font-family: inherit; font-size: 12px;
  padding: 6px 14px; border-radius: 4px; cursor: pointer; transition: all 0.12s;
}
.po-btn-logout:hover { border-color: rgba(255,255,255,0.55); color: #fff; }
.po-btn-reset {
  background: transparent; border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.7); font-family: inherit; font-size: 12px;
  padding: 6px 14px; border-radius: 4px; cursor: pointer; transition: all 0.12s;
}
.po-btn-reset:hover { border-color: rgba(255,255,255,0.6); color: #FFFFFF; }

/* === Rich text floating toolbar === */
#po-rt-bar {
  position: fixed; z-index: 2000; display: none;
  background: #172B4D; border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  padding: 4px 6px; gap: 2px; align-items: center;
}
#po-rt-bar::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #172B4D;
}
.po-rt-btn {
  background: transparent; border: none; color: rgba(255,255,255,0.75);
  font-family: "Geist", sans-serif; font-size: 12px; font-weight: 600;
  padding: 4px 7px; border-radius: 4px; cursor: pointer; line-height: 1;
  transition: all 0.1s; white-space: nowrap;
}
.po-rt-btn:hover  { background: rgba(255,255,255,0.15); color: #fff; }
.po-rt-btn.active { background: rgba(255,255,255,0.2);  color: #fff; }
.po-rt-sep {
  width: 1px; height: 14px; background: rgba(255,255,255,0.15); margin: 0 3px;
}

/* === Editable text fields === */
body[data-mode="edit"] .po-editable {
  outline: 1px dashed var(--line); border-radius: var(--radius-sm);
  padding: 2px 5px; cursor: text; transition: outline 0.1s;
}
body[data-mode="edit"] .po-editable:hover { outline-color: var(--ink-soft); }
body[data-mode="edit"] .po-editable:focus,
body[data-mode="edit"] .po-editable:focus-within { outline: none; box-shadow: var(--focus-ring); }
body[data-mode="edit"] .po-editable:empty::before {
  content: attr(data-ph); color: var(--ink-soft); font-style: italic; pointer-events: none;
}
/* rich text output styles */
.po-editable b, .po-editable strong { font-weight: 700; }
.po-editable i, .po-editable em    { font-style: italic; }
.po-editable u                      { text-decoration: underline; }
.po-editable ul { padding-left: 18px; margin: 4px 0; }
.po-editable li { margin: 2px 0; }

/* === Project status row === */
.po-proj-status-row {
  display: flex; gap: 20px; padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; background: var(--surface);
}
.po-proj-status-cell { display: flex; align-items: center; gap: 7px; }
.po-proj-status-label {
  font-family: "Geist Mono", monospace; font-size: 9.5px;
  letter-spacing: 0.14em; color: var(--ink-soft); text-transform: uppercase;
}
.po-status-chip {
  font-family: "Geist Mono", monospace; font-size: var(--text-xs); font-weight: 500;
  padding: 2px 9px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: default; background: transparent; transition: opacity 0.12s;
  letter-spacing: 0.02em;
}
body[data-mode="edit"] .po-status-chip { cursor: pointer; }
body[data-mode="edit"] .po-status-chip:hover { opacity: 0.75; }
.po-proj-owner-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; border: none; padding: 2px 4px; border-radius: 4px;
  cursor: default; font-family: inherit; font-size: 11px; color: var(--ink-soft);
}
body[data-mode="edit"] .po-proj-owner-btn { cursor: pointer; }
body[data-mode="edit"] .po-proj-owner-btn:hover { background: var(--hover); }
.po-proj-owner-av {
  width: 18px; height: 18px; border-radius: 50%; background: var(--active); color: var(--ink-muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 7.5px; font-weight: 700; font-family: "Geist Mono", monospace; flex-shrink: 0;
}
.po-proj-owner-btn:focus { outline: none; }
.po-proj-owner-btn:focus-visible { box-shadow: var(--focus-ring); outline: none; }

/* === Task editor === */
.po-task-section { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-soft); }
.po-task-section-head {
  font-family: "Geist Mono", monospace; font-size: 9.5px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 6px;
}
.po-task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.po-task-item { display: flex; align-items: flex-start; gap: 7px; padding: 3px 0; }
.po-task-cb {
  flex-shrink: 0; margin-top: 1px; cursor: pointer;
  border: none; padding: 1px 7px; border-radius: 10px;
  font-size: 10px; font-family: "Geist Mono", monospace; font-weight: 500;
  line-height: 1.6; white-space: nowrap;
  background: var(--avatar-person-bg); color: var(--avatar-person-ink);
  transition: opacity 0.12s;
}
.po-task-cb:hover { opacity: 0.72; }
.po-task-item[data-st="not_started"] .po-task-cb { background: var(--avatar-person-bg);  color: var(--avatar-person-ink); }
.po-task-item[data-st="in_progress"] .po-task-cb { background: var(--task-progress-bg);  color: var(--task-progress-ink); }
.po-task-item[data-st="review"]      .po-task-cb { background: var(--task-review-bg);    color: var(--task-review-ink); }
.po-task-item[data-st="blocked"]     .po-task-cb { background: var(--task-blocked-bg);   color: var(--task-blocked-ink); }
.po-task-item[data-st="done"]        .po-task-cb { background: var(--task-done-bg);      color: var(--task-done-ink); }
.po-task-item[data-st="cancelled"]   .po-task-cb { background: var(--task-cancelled-bg); color: var(--task-cancelled-ink); text-decoration: line-through; }
.po-task-item[data-st="draft"]       .po-task-cb { background: var(--task-draft-bg);     color: var(--task-draft-ink); }
/* Status dropdown */
.po-task-st-drop {
  position: fixed; z-index: 400;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  list-style: none; margin: 0; padding: 4px 0;
  box-shadow: 0 6px 20px rgba(0,0,0,0.13); min-width: 140px;
}
.po-task-st-opt {
  padding: 6px 12px; font-size: 12px; font-family: inherit; cursor: pointer;
  color: var(--ink); white-space: nowrap; border-radius: 4px; margin: 0 3px;
}
.po-task-st-opt:hover { background: var(--hover); }
.po-task-st-opt.current { font-weight: 600; background: var(--active); }
body:not([data-mode="edit"]) .po-task-cb { pointer-events: none; cursor: default; }
/* Add-project button (edit mode only) */
.po-add-proj-btn {
  display: none; width: 100%; margin-top: 6px;
  background: transparent; border: 1px dashed var(--line); border-radius: 6px;
  padding: 6px 14px; font-family: inherit; font-size: 12px; color: var(--ink-soft);
  cursor: pointer; text-align: left; transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.po-add-proj-btn:hover { background: var(--hover); border-color: var(--ink-soft); color: var(--ink); }
body[data-mode="edit"] .po-add-proj-btn { display: block; }
/* Add-program button (edit mode only, below each month's program list) */
.po-add-prog-btn {
  display: none; width: 100%; margin-top: 10px;
  background: transparent; border: 1px dashed var(--line); border-radius: 6px;
  padding: 8px 16px; font-family: inherit; font-size: 12.5px; color: var(--ink-soft);
  cursor: pointer; text-align: left; transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.po-add-prog-btn:hover { background: var(--hover); border-color: var(--ink-muted); color: var(--ink); }
body[data-mode="edit"] .po-add-prog-btn { display: block; }
/* New project modal */
.po-newproj-modal {
  display: none; position: fixed; inset: 0; z-index: 900;
  background: rgba(23,43,77,0.55); align-items: center; justify-content: center;
}
.po-newproj-modal.open { display: flex; }
.po-newproj-box {
  background: var(--surface); border-radius: var(--radius-md); padding: 24px 28px;
  min-width: 360px; max-width: 460px; width: 90%;
  box-shadow: 0 16px 48px rgba(0,0,0,0.22);
}
.po-newproj-title {
  font-family: "Fraunces", serif; font-size: var(--text-xl); font-weight: 500;
  letter-spacing: -0.01em; margin-bottom: 18px; color: var(--ink);
}
.po-newproj-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.po-newproj-field label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.07em; color: var(--ink-soft); text-transform: uppercase;
}
.po-newproj-field input {
  border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px;
  font-family: inherit; font-size: 13px; background: var(--surface); color: var(--ink); outline: none;
}
.po-newproj-field input:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
.po-newproj-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.po-newproj-cancel {
  background: transparent; border: 1px solid var(--line); border-radius: 4px;
  padding: 7px 16px; font-family: inherit; font-size: 13px; color: var(--ink-muted); cursor: pointer;
}
.po-newproj-cancel:hover { border-color: var(--ink-muted); }
.po-newproj-confirm {
  background: var(--accent); border: none; border-radius: 4px;
  padding: 7px 18px; font-family: inherit; font-size: 13px; color: #FFFFFF; cursor: pointer;
}
.po-newproj-confirm:hover { background: #0B8FC9; }
.po-task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.po-task-id-line {
  font-family: "Geist Mono", monospace; font-size: 9.5px;
  color: var(--ink-soft); letter-spacing: 0.04em; display: none;
}
.po-task-id-line:not(:empty) { display: block; }
body[data-mode="edit"] .po-task-id-line { display: block; }
.po-task-updated {
  font-family: "Geist Mono", monospace; font-size: 9.5px; color: var(--ink-soft);
  margin-left: auto; white-space: nowrap; flex-shrink: 0;
}
.po-task-text {
  font-size: var(--text-sm); line-height: 1.45; color: var(--ink);
  outline: none; word-break: break-word;
}
.po-task-item[data-st="done"] .po-task-text { text-decoration: line-through; color: var(--ink-soft); }
.po-task-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
/* Assignee picker button */
.po-task-asgn-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: none; padding: 1px 3px; border-radius: 4px;
  cursor: default; font-family: inherit; font-size: 11px; color: var(--ink-soft);
}
body[data-mode="edit"] .po-task-asgn-btn { cursor: pointer; }
body[data-mode="edit"] .po-task-asgn-btn:hover { background: var(--hover); }
.po-task-asgn-av {
  width: 16px; height: 16px; border-radius: 50%; background: var(--active); color: var(--ink-muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 7px; font-weight: 700; font-family: "Geist Mono", monospace; flex-shrink: 0;
}
.po-task-asgn-nm { font-size: 11px; color: var(--ink-soft); }
.po-task-asgn-nm.ph { color: var(--line); }
/* Due date picker button */
.po-task-due-btn {
  background: transparent; border: none; padding: 1px 3px; border-radius: 4px;
  cursor: default; font-family: "Geist Mono", monospace; font-size: 10px; color: var(--ink-soft);
}
body[data-mode="edit"] .po-task-due-btn { cursor: pointer; }
body[data-mode="edit"] .po-task-due-btn:hover { background: var(--hover); }
.po-task-due-btn.ph { color: var(--line); }
.po-task-del {
  background: transparent; border: none; color: transparent; cursor: pointer;
  font-size: 15px; padding: 0 2px; flex-shrink: 0; line-height: 1; transition: color 0.1s;
  margin-top: 1px; display: none;
}
body[data-mode="edit"] .po-task-del { display: block; }
body[data-mode="edit"] .po-task-item:hover .po-task-del { color: var(--ink-soft); }
body[data-mode="edit"] .po-task-del:hover { color: var(--danger) !important; }
.po-task-add {
  display: none; margin-top: 6px; font-family: inherit; font-size: 11px; color: var(--ink-muted);
  background: transparent; border: 1px dashed var(--line); padding: 4px 10px;
  border-radius: var(--radius-sm); cursor: pointer; width: 100%; text-align: left; transition: all 0.12s;
}
.po-task-add:hover { border-color: var(--ink); color: var(--ink); border-style: solid; }
body[data-mode="edit"] .po-task-add { display: block; }

/* === Progress bars === */
.po-prog-wrap {
  display: flex; align-items: center; gap: 8px; flex-basis: 100%; margin-top: 8px;
}

/* === People editor modal === */
.po-btn-people {
  background: transparent; border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.65); font-family: inherit; font-size: 12px;
  padding: 6px 14px; border-radius: 4px; cursor: pointer; transition: all 0.12s;
}
.po-btn-people:hover { border-color: rgba(255,255,255,0.55); color: #fff; }

.pe-modal-overlay {
  position: fixed; inset: 0; background: rgba(23,43,77,0.6);
  z-index: 999; display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.pe-modal-overlay.open { display: flex; }
.pe-modal-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  width: min(900px, 96vw); max-height: 80vh;
  display: flex; flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.25);
}
.pe-modal-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px 14px; border-bottom: 1px solid var(--line-soft);
}
.pe-modal-title {
  font-family: "Fraunces", serif; font-size: 18px; font-weight: 500;
  letter-spacing: -0.01em; color: var(--ink); flex: 1;
}
.pe-modal-hint { font-size: 12px; color: var(--ink-soft); }
.pe-close-btn {
  background: transparent; border: none; cursor: pointer;
  font-size: 18px; color: var(--ink-soft); padding: 2px 6px; border-radius: var(--radius-sm);
  line-height: 1; transition: color 0.1s;
}
.pe-close-btn:hover { color: var(--ink); }
.pe-modal-body { overflow-y: auto; padding: 0 20px 4px; flex: 1; }
.pe-table {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
  margin: 12px 0 4px;
}
.pe-table th {
  text-align: left; padding: 6px 8px; font-size: 10px;
  font-family: "Geist Mono", monospace; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-soft);
  border-bottom: 1px solid var(--line-soft); white-space: nowrap;
}
.pe-table td { padding: 3px 4px; vertical-align: middle; }
.pe-table tr:hover td { background: rgba(31,29,26,0.02); }
.pe-input {
  width: 100%; padding: 5px 8px; border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); font-family: inherit; font-size: 12.5px;
  background: var(--bg); color: var(--ink); box-sizing: border-box;
  outline: none; transition: border-color 0.1s;
}
.pe-input:focus { border-color: var(--ink-muted); }
.pe-input.pe-code { font-family: "Geist Mono", monospace; font-size: 11px; width: 68px; }
.pe-input.pe-initials { width: 64px; }
.pe-input.pe-last { width: 120px; }
.pe-del-btn {
  background: transparent; border: none; cursor: pointer;
  color: var(--ink-soft); font-size: 13px; padding: 4px 6px;
  border-radius: var(--radius-sm); transition: color 0.1s, background 0.1s;
}
.pe-del-btn:hover { color: var(--danger, #8B2635); background: rgba(139,38,53,0.06); }
.pe-add-btn {
  margin: 8px 0 16px; padding: 6px 14px; font-family: inherit; font-size: 12px;
  background: transparent; border: 1px dashed var(--line);
  color: var(--ink-muted); border-radius: 4px; cursor: pointer;
  transition: all 0.12s;
}
.pe-add-btn:hover { border-color: var(--ink); color: var(--ink); border-style: solid; }
.pe-modal-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-top: 1px solid var(--line-soft);
}
.pe-save-btn {
  background: #172B4D; border: 1px solid #172B4D; color: #FFFFFF;
  font-family: inherit; font-size: 12.5px; padding: 7px 18px;
  border-radius: 4px; cursor: pointer; transition: all 0.12s;
}
.pe-save-btn:hover { background: #0F1E38; }
.pe-reset-btn {
  background: transparent; border: 1px solid var(--line);
  color: var(--ink-muted); font-family: inherit; font-size: 12.5px;
  padding: 7px 14px; border-radius: 4px; cursor: pointer; transition: all 0.12s;
  margin-left: auto;
}
.pe-reset-btn:hover { border-color: var(--ink); color: var(--ink); }
.pe-override-note {
  font-size: 11px; color: var(--ink-soft); font-style: italic;
}
.po-prog-bar { flex: 1; height: 3px; background: var(--status-neutral-bg); border-radius: var(--radius-sm); overflow: hidden; }
.po-prog-fill { height: 100%; border-radius: var(--radius-sm); background: var(--status-green-ink); transition: width 0.4s; }
.po-prog-lbl { font-family: "Geist Mono", monospace; font-size: 9.5px; color: var(--ink-soft); white-space: nowrap; flex-shrink: 0; }
.po-proj-prog { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; flex-shrink: 0; }
.po-proj-prog-bar { width: 36px; height: 3px; background: var(--status-neutral-bg); border-radius: var(--radius-sm); overflow: hidden; }
.po-proj-prog-fill { height: 100%; background: var(--status-green-ink); border-radius: var(--radius-sm); transition: width 0.4s; }
.po-proj-prog-lbl { font-family: "Geist Mono", monospace; font-size: 9px; color: var(--ink-soft); }
