/* ── Wranglers PM ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg:        #0f1117;
  --bg2:       #161b27;
  --bg3:       #1e2535;
  --border:    #2a3147;
  --text:      #e8eaf0;
  --text2:     #8b92a5;
  --text3:     #555f78;
  --accent:    #4f7cff;
  --accent2:   #3a5fd4;
  --green:     #2dd4a0;
  --yellow:    #f5c542;
  --red:       #f05252;
  --orange:    #f97316;
  --purple:    #a78bfa;
  --radius:    10px;
  --radius-sm: 6px;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
}

#wpm-app, .wpm-login-wrap {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* ── LOGIN ──────────────────────────────────────────── */
.wpm-login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}
.wpm-login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}
.wpm-login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.wpm-logo-mark {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}
.wpm-logo-text { font-size: 20px; font-weight: 700; }
.wpm-login-sub { color: var(--text2); font-size: 13px; margin-bottom: 28px; }

/* ── TOP BAR ────────────────────────────────────────── */
.wpm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 58px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.wpm-topbar-left { display: flex; align-items: center; gap: 10px; }
.wpm-site-name { font-weight: 600; font-size: 15px; }
.wpm-topbar-right { display: flex; align-items: center; gap: 12px; }
.wpm-nav { display: flex; gap: 4px; }
.wpm-nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text2);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all .15s;
}
.wpm-nav-btn.active, .wpm-nav-btn:hover {
  background: var(--bg3);
  border-color: var(--border);
  color: var(--text);
}
.wpm-team-avatars { display: flex; gap: -6px; }
.wpm-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: #fff;
  margin-left: -6px;
  cursor: default;
}
.wpm-avatar:first-child { margin-left: 0; }
.wpm-avatar-colors { background: var(--green); }
.wpm-avatar-colors:nth-child(2) { background: var(--purple); }
.wpm-user-badge {
  font-size: 13px; font-weight: 500;
  color: var(--text2); padding: 4px 10px;
  background: var(--bg3); border-radius: 20px;
}

/* ── TOOLBAR ────────────────────────────────────────── */
.wpm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-wrap: wrap;
  gap: 10px;
}
.wpm-toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wpm-filters { display: flex; gap: 8px; }

/* ── BUTTONS ────────────────────────────────────────── */
.wpm-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.wpm-btn-primary { background: var(--accent); color: #fff; }
.wpm-btn-primary:hover { background: var(--accent2); }
.wpm-btn-ghost { background: transparent; color: var(--text2); border-color: var(--border); }
.wpm-btn-ghost:hover { background: var(--bg3); color: var(--text); }
.wpm-btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.wpm-btn-outline:hover { background: rgba(79,124,255,.1); }
.wpm-btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.wpm-btn-danger:hover { background: #d93f3f; }
.wpm-btn-sm { padding: 5px 11px; font-size: 12px; }
.wpm-btn-full { width: 100%; }

/* ── FORM ───────────────────────────────────────────── */
.wpm-field { margin-bottom: 16px; }
.wpm-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}
.wpm-field input[type=text],
.wpm-field input[type=password],
.wpm-field input[type=date],
.wpm-field input[type=email],
.wpm-field textarea,
.wpm-field select,
.wpm-select,
.wpm-search {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s;
}
.wpm-field input:focus,
.wpm-field textarea:focus,
.wpm-field select:focus,
.wpm-search:focus { border-color: var(--accent); }
.wpm-field textarea { resize: vertical; }
.wpm-select { width: auto; padding: 7px 10px; font-size: 13px; }
.wpm-search { max-width: 220px; }
.wpm-msg {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
}
.wpm-msg.error { background: rgba(240,82,82,.15); border: 1px solid var(--red); color: var(--red); }
.wpm-msg.success { background: rgba(45,212,160,.15); border: 1px solid var(--green); color: var(--green); }

.wpm-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wpm-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ── BOARD ──────────────────────────────────────────── */
.wpm-view { padding: 24px; }
.wpm-columns { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; align-items: start; }
.wpm-column { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.wpm-col-header {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
}
.wpm-col-dot { width:8px; height:8px; border-radius:50%; display:inline-block; }
.dot-active { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot-hold { background: var(--yellow); }
.dot-done { background: var(--accent); }
.wpm-col-count {
  background: var(--bg3); color: var(--text2);
  font-size: 11px; padding: 2px 7px; border-radius: 10px;
  margin-left: auto;
}
.wpm-col-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 80px; }

/* ── PROJECT CARD ───────────────────────────────────── */
.wpm-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.wpm-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.wpm-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.wpm-card-title { font-weight: 600; font-size: 14px; line-height: 1.3; }
.wpm-card-client { font-size: 12px; color: var(--text2); margin-bottom: 10px; }
.wpm-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wpm-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.wpm-progress-wrap { display: flex; align-items: center; gap: 8px; flex: 1; }
.wpm-progress-bar { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.wpm-progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s; }
.wpm-progress-pct { font-size: 11px; color: var(--text3); min-width: 28px; text-align: right; font-family: 'DM Mono', monospace; }

/* ── BADGE ──────────────────────────────────────────── */
.wpm-badge {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 8px; border-radius: 20px;
  white-space: nowrap;
}
.badge-seo         { background: rgba(79,124,255,.2); color: var(--accent); }
.badge-website     { background: rgba(167,139,250,.2); color: var(--purple); }
.badge-content     { background: rgba(249,115,22,.2); color: var(--orange); }
.badge-design      { background: rgba(45,212,160,.2); color: var(--green); }
.badge-fix         { background: rgba(240,82,82,.2); color: var(--red); }
.badge-maintenance { background: rgba(245,197,66,.2); color: var(--yellow); }
.badge-general     { background: var(--bg); color: var(--text2); }
.badge-other       { background: var(--bg); color: var(--text2); }

.wpm-priority-badge {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; padding: 2px 7px;
  border-radius: 20px;
}
.pri-urgent { background: rgba(240,82,82,.2); color: var(--red); }
.pri-high   { background: rgba(249,115,22,.2); color: var(--orange); }
.pri-normal { background: rgba(79,124,255,.15); color: #7fa4ff; }
.pri-low    { background: var(--bg); color: var(--text3); }

/* ── LIST VIEW ──────────────────────────────────────── */
.wpm-table { width: 100%; border-collapse: collapse; }
.wpm-table th {
  text-align: left; padding: 10px 14px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
}
.wpm-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}
.wpm-table tr:hover td { background: var(--bg2); cursor: pointer; }

/* ── PANEL ──────────────────────────────────────────── */
.wpm-panel { position: fixed; inset: 0; z-index: 200; }
.wpm-panel-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.wpm-panel-inner {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: min(780px, 95vw);
  background: var(--bg2);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.wpm-panel-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.wpm-panel-header h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.wpm-panel-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.wpm-panel-close {
  background: transparent; border: none; color: var(--text2);
  font-size: 22px; cursor: pointer; line-height: 1;
  padding: 4px 8px; border-radius: 6px;
}
.wpm-panel-close:hover { background: var(--bg3); color: var(--text); }
.wpm-panel-body { flex: 1; overflow-y: auto; padding: 24px; }
.wpm-muted { color: var(--text2); font-size: 13px; }
.wpm-desc-text { color: var(--text2); font-size: 14px; margin-bottom: 24px; line-height: 1.6; }

/* ── SECTIONS ───────────────────────────────────────── */
.wpm-section { margin-bottom: 28px; }
.wpm-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.wpm-section-header h3 { font-size: 14px; font-weight: 700; }
.wpm-task-cols { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.wpm-task-col { background: var(--bg3); border-radius: var(--radius-sm); overflow: hidden; }
.wpm-task-col-header {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text3); padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.wpm-task-list { padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
.wpm-task-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  cursor: pointer; transition: border-color .15s;
  font-size: 13px;
}
.wpm-task-card:hover { border-color: var(--accent); }
.wpm-task-card-title { font-weight: 500; margin-bottom: 5px; }
.wpm-task-card-meta { display: flex; align-items: center; gap: 6px; }

/* ── MODAL ──────────────────────────────────────────── */
.wpm-modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; }
.wpm-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.7); }
.wpm-modal-box {
  position: relative; z-index: 1;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow);
  width: 100%; max-height: 92vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.wpm-modal-sm  { max-width: 420px; }
.wpm-modal-lg  { max-width: 640px; }
.wpm-modal-xl  { max-width: 900px; }
.wpm-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.wpm-modal-header h2 { font-size: 17px; font-weight: 700; }
.wpm-modal-close {
  background: transparent; border: none; color: var(--text2);
  font-size: 22px; cursor: pointer; line-height: 1; padding: 4px 8px;
}
.wpm-modal-close:hover { color: var(--text); }
.wpm-modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.wpm-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  flex-shrink: 0;
}
.wpm-task-modal-body { display: grid; grid-template-columns: 1fr 320px; gap: 24px; padding: 0 !important; }
.wpm-task-left { padding: 24px; overflow-y: auto; }
.wpm-task-right {
  border-left: 1px solid var(--border);
  padding: 24px;
  background: var(--bg);
  overflow-y: auto;
}

/* ── CHECKLIST ──────────────────────────────────────── */
.wpm-checklist { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.wpm-check-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.wpm-check-item.is-done .wpm-check-label { text-decoration: line-through; color: var(--text3); }
.wpm-check-item input[type=checkbox] { accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.wpm-check-label { flex: 1; }
.wpm-check-del {
  background: none; border: none; color: var(--text3); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 0 4px;
}
.wpm-check-del:hover { color: var(--red); }
.wpm-checklist-add { display: flex; gap: 8px; }
.wpm-checklist-add input { flex: 1; }
.wpm-checklist-progress { font-size: 11px; color: var(--text3); margin-bottom: 6px; }

/* ── COMMENTS ───────────────────────────────────────── */
.wpm-comments-section h4 { font-size: 13px; font-weight: 700; margin-bottom: 14px; color: var(--text2); text-transform: uppercase; letter-spacing: .05em; }
.wpm-comments-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; max-height: 300px; overflow-y: auto; }
.wpm-comment {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.wpm-comment-author { font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.wpm-comment-text { font-size: 13px; line-height: 1.5; }
.wpm-comment-time { font-size: 11px; color: var(--text3); margin-top: 4px; }
.wpm-comment-input { display: flex; flex-direction: column; gap: 8px; }
.wpm-comment-input textarea { font-family: 'DM Sans', sans-serif; }

/* ── ASSIGN ─────────────────────────────────────────── */
.wpm-assign-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.wpm-assign-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  transition: all .15s;
  background: var(--bg3);
}
.wpm-assign-chip.selected { background: rgba(79,124,255,.2); border-color: var(--accent); color: var(--accent); }
.wpm-assign-chip-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); display: flex; align-items: center;
  justify-content: center; font-size: 9px; font-weight: 700; color: #fff;
}

/* ── TOAST ──────────────────────────────────────────── */
.wpm-toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); padding: 12px 20px;
  border-radius: var(--radius); font-size: 13px;
  z-index: 9999; box-shadow: var(--shadow);
}

/* ── DUE DATE ───────────────────────────────────────── */
.wpm-due { font-size: 11px; color: var(--text3); font-family: 'DM Mono', monospace; }
.wpm-due.overdue { color: var(--red); }

/* ── EMPTY ──────────────────────────────────────────── */
.wpm-empty { text-align: center; color: var(--text3); font-size: 13px; padding: 24px 0; }

@media (max-width: 768px) {
  .wpm-columns { grid-template-columns: 1fr; }
  .wpm-grid-2, .wpm-grid-3 { grid-template-columns: 1fr; }
  .wpm-task-modal-body { grid-template-columns: 1fr; }
  .wpm-task-right { border-left: none; border-top: 1px solid var(--border); }
  .wpm-task-cols { grid-template-columns: 1fr; }
  .wpm-panel-inner { width: 100%; }
  .wpm-topbar-center { display: none; }
}
